diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aac413aae..8cf67043f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -263,3 +263,7 @@ else() add_compile_definitions(USE_SDL_UI) add_subdirectory(unix) endif() + +if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") + add_custom_command(TARGET 86Box POST_BUILD COMMAND paxctl ARGS +m $ COMMENT "Disable PaX MPROTECT") +endif() diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 174685c34..e8c5fbac9 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -20,6 +20,11 @@ #ifndef EMU_86BOX_H #define EMU_86BOX_H +#ifdef __NetBSD__ +/* Doesn't compile on NetBSD without this include */ +#include +#endif + /* Configuration values. */ #define GFXCARD_MAX 2 #define SERIAL_MAX 7 diff --git a/src/include/86box/bswap.h b/src/include/86box/bswap.h index 37c846d59..61a6a46a2 100644 --- a/src/include/86box/bswap.h +++ b/src/include/86box/bswap.h @@ -35,13 +35,12 @@ * USA. */ -#ifndef __NetBSD__ - #ifndef BSWAP_H #define BSWAP_H #include +#ifndef __NetBSD__ #define bswap_16(x) \ ((uint16_t)((((x) & 0x00ffu) << 8) | \ (((x) & 0xff00u) >> 8))) @@ -91,6 +90,7 @@ bswap64(uint64_t x) return bswap_16(x); #endif } +#endif static __inline void bswap16s(uint16_t *s) @@ -241,5 +241,3 @@ cpu_to_be32wu(uint32_t *p, uint32_t v) #undef be_bswaps #endif /*BSWAP_H*/ - -#endif diff --git a/src/include/86box/log.h b/src/include/86box/log.h index e247ef9c5..80ed6d108 100644 --- a/src/include/86box/log.h +++ b/src/include/86box/log.h @@ -24,6 +24,11 @@ extern "C" { # endif +#ifdef __NetBSD__ +/* Doesn't compile on NetBSD without this include */ +#include +#endif + #define LOG_SIZE_BUFFER 1024 /* Log size buffer */ #define LOG_SIZE_BUFFER_CYCLIC_LINES 32 /* Cyclic log size buffer (number of lines that should be cehcked) */ #define LOG_MINIMUM_REPEAT_ORDER 4 /* Minimum repeat size */ diff --git a/src/include/86box/vid_ega.h b/src/include/86box/vid_ega.h index 082cb120a..79375a2ae 100644 --- a/src/include/86box/vid_ega.h +++ b/src/include/86box/vid_ega.h @@ -47,8 +47,8 @@ typedef struct ega_t { uint8_t ctl_mode; uint8_t color_mux; uint8_t dot; - uint8_t crtc[32]; - uint8_t gdcreg[16]; + uint8_t crtc[256]; + uint8_t gdcreg[256]; uint8_t attrregs[32]; uint8_t seqregs[64]; uint8_t egapal[16]; @@ -178,6 +178,7 @@ extern uint8_t ega_in(uint16_t addr, void *priv); extern void ega_poll(void *priv); extern void ega_write(uint32_t addr, uint8_t val, void *priv); extern uint8_t ega_read(uint32_t addr, void *priv); +extern void ega_set_type(void *priv, uint32_t local); extern int firstline_draw; extern int lastline_draw; diff --git a/src/qt/languages/ja-JP.po b/src/qt/languages/ja-JP.po index 9c6fa66e7..6132a8db1 100644 --- a/src/qt/languages/ja-JP.po +++ b/src/qt/languages/ja-JP.po @@ -868,7 +868,7 @@ msgid "Hardware not available" msgstr "ハードウェアが利用できません" msgid "Make sure %1 is installed and that you are on a %1-compatible network connection." -msgstr "がインストールされてるか、%1に対応したネットワークに接続されてるか確認してください。" +msgstr "%1がインストールされていてかつ、%1に対応したネットワークに接続されてるか確認してください。" msgid "Invalid configuration" msgstr "不正な設定です" @@ -910,10 +910,10 @@ msgid "OpenGL options" msgstr "OpenGL設定" msgid "You are loading an unsupported configuration" -msgstr "読み込んでいる設定がサポートされません" +msgstr "サポートされていないコンフィグを読み込んでいます" msgid "CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid." -msgstr "選択したマシンに基づくCPUタイプのフィルター機能は、使用中のマシンでは無効になっています。\n\nこれにより、選択したマシンと互換性のないCPUが選択できます。しかし、マシンのBIOSや他のソフトウェアと互換性がない場合があります。\n\nこの設定を有効にすることは公式にはサポートされておらず、バグレポートは無効として中止される可能性があります。" +msgstr "選択したマシンに基づくCPUタイプのフィルター機能は、使用中のマシンでは無効になっています。\n\nこれにより、選択したマシンと互換性のないCPUが選択できます。しかし、マシンのBIOSや他のソフトウェアと互換性がない場合があります。\n\nこの設定を有効にすることは公式にはサポートされておらず、バグレポートは無効としてクローズされる可能性があります。" msgid "Continue" msgstr "続行" @@ -1015,7 +1015,7 @@ msgid "The selected file will be overwritten. Are you sure you want to use it?" msgstr "選択したファイルは上書きされます。よろしいですか?" msgid "Unsupported disk image" -msgstr "非対応のディスクイメージジ" +msgstr "非対応のディスクイメージ" msgid "Overwrite" msgstr "上書き" @@ -1285,7 +1285,7 @@ msgid "Host CD/DVD Drive (%1)" msgstr "ホスト CD/DVD ドライブ (%1)" msgid "Unknown Bus" -msgstr "不明バス" +msgstr "不明なバス" msgid "Null Driver" msgstr "ヌル・ドライバー" @@ -1294,7 +1294,7 @@ msgid "NIC %02i (%ls) %ls" msgstr "NIC %02i (%ls) %ls" msgid "Error opening \"%1\": %2" -msgstr "エラー・オープニング\"%1\": %2" +msgstr "\"%1\"を開く際にエラーが発生しました: %2" msgid "Error compiling vertex shader in file \"%1\"" msgstr "ファイル\"%1\"の頂点シェーダのコンパイルエラー。" diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index 1364750b1..e8a02fc3b 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -54,6 +54,10 @@ #include "qt_progsettings.hpp" #include "qt_util.hpp" +#ifndef Q_OS_WINDOWS +# include +#endif + #ifdef Q_OS_UNIX # include # include @@ -832,7 +836,7 @@ plat_set_thread_name(void *thread, const char *name) # if defined(Q_OS_DARWIN) pthread_setname_np(truncated); # elif defined(Q_OS_NETBSD) - pthread_setname_np(thread ? *((pthread_t *) thread) : pthread_self(), truncated, "%s"); + pthread_setname_np(thread ? *((pthread_t *) thread) : pthread_self(), truncated, (void*)"%s"); # elif defined(__HAIKU__) rename_thread(find_thread(NULL), truncated); # elif defined(Q_OS_OPENBSD) diff --git a/src/unix/unix_serial_passthrough.c b/src/unix/unix_serial_passthrough.c index a12346013..9929f3298 100644 --- a/src/unix/unix_serial_passthrough.c +++ b/src/unix/unix_serial_passthrough.c @@ -26,6 +26,7 @@ #endif #ifdef __NetBSD__ # define _NETBSD_VISIBLE 1 +# define _NETBSD_SOURCE 1 #endif #include #include @@ -149,8 +150,11 @@ plat_serpt_set_params(void *priv) BAUDRATE_RANGE(dev->baudrate, 9600, 19200, B9600); BAUDRATE_RANGE(dev->baudrate, 19200, 38400, B19200); BAUDRATE_RANGE(dev->baudrate, 38400, 57600, B38400); +#ifndef __NetBSD__ + /* nonexistent on NetBSD */ BAUDRATE_RANGE(dev->baudrate, 57600, 115200, B57600); BAUDRATE_RANGE(dev->baudrate, 115200, 0xFFFFFFFF, B115200); +#endif term_attr.c_cflag &= ~CSIZE; switch (dev->data_bits) { diff --git a/src/video/vid_ega.c b/src/video/vid_ega.c index 781e9a9dd..17fea7b81 100644 --- a/src/video/vid_ega.c +++ b/src/video/vid_ega.c @@ -67,6 +67,8 @@ ega_out(uint16_t addr, uint8_t val, void *priv) ega_t *ega = (ega_t *) priv; uint8_t o; uint8_t old; + uint8_t gdcmask = (ega->actual_type == EGA_SUPEREGA) ? 0xff : 0x0f; + uint8_t crtcmask = (ega->actual_type == EGA_SUPEREGA) ? 0xff : 0x1f; if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(ega->miscout & 1)) addr ^= 0x60; @@ -200,8 +202,8 @@ ega_out(uint16_t addr, uint8_t val, void *priv) ega->gdcaddr = val; break; case 0x3cf: - ega->gdcreg[ega->gdcaddr & 15] = val; - switch (ega->gdcaddr & 15) { + ega->gdcreg[ega->gdcaddr & gdcmask] = val; + switch (ega->gdcaddr & gdcmask) { case 2: ega->colourcompare = val; break; @@ -238,6 +240,19 @@ ega_out(uint16_t addr, uint8_t val, void *priv) ega->colournocare = val; break; + case 0xf8: + ega->la = val; + break; + case 0xf9: + ega->lb = val; + break; + case 0xfa: + ega->lc = val; + break; + case 0xfb: + ega->ld = val; + break; + default: break; } @@ -247,7 +262,7 @@ ega_out(uint16_t addr, uint8_t val, void *priv) if (ega->chipset) ega->crtcreg = val & 0x3f; else - ega->crtcreg = val & 0x1f; + ega->crtcreg = val & crtcmask; return; case 0x3d1: case 0x3d5: @@ -286,7 +301,8 @@ uint8_t ega_in(uint16_t addr, void *priv) { ega_t *ega = (ega_t *) priv; - uint8_t ret = 0xff; + uint8_t gdcmask = (ega->actual_type == EGA_SUPEREGA) ? 0xff : 0x0f; + uint8_t ret = 0xff; if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(ega->miscout & 1)) addr ^= 0x60; @@ -347,8 +363,25 @@ ega_in(uint16_t addr, void *priv) ret = ega->gdcaddr; break; case 0x3cf: - if (ega_type == EGA_TYPE_OTHER) - ret = ega->gdcreg[ega->gdcaddr & 0xf]; + if (ega_type == EGA_TYPE_OTHER) { + switch (ega->gdcaddr & gdcmask) { + default: + ret = ega->gdcreg[ega->gdcaddr & gdcmask]; + break; + case 0xf8: + ret = ega->la; + break; + case 0xf9: + ret = ega->lb; + break; + case 0xfa: + ret = ega->lc; + break; + case 0xfb: + ret = ega->ld; + break; + } + } break; case 0x3d0: case 0x3d4: @@ -453,19 +486,19 @@ ega_recalctimings(ega_t *ega) if (ega->crtc[7] & 1) ega->vtotal |= 0x100; - if (ega->crtc[7] & 32) + if ((ega->actual_type != EGA_SUPEREGA) && (ega->crtc[7] & 32)) ega->vtotal |= 0x200; ega->vtotal += 2; if (ega->crtc[7] & 2) ega->dispend |= 0x100; - if (ega->crtc[7] & 64) + if ((ega->actual_type != EGA_SUPEREGA) && (ega->crtc[7] & 64)) ega->dispend |= 0x200; ega->dispend++; if (ega->crtc[7] & 4) ega->vsyncstart |= 0x100; - if (ega->crtc[7] & 128) + if ((ega->actual_type != EGA_SUPEREGA) && (ega->crtc[7] & 128)) ega->vsyncstart |= 0x200; ega->vsyncstart++; @@ -1428,6 +1461,30 @@ ega_init(ega_t *ega, int monitor_type, int is_mono) timer_add(&ega->dot_timer, ega_dot_poll, ega, 1); } +void +ega_set_type(void *priv, uint32_t local) +{ + ega_t *ega = (ega_t *) priv; + + if ((local == EGA_IBM) || (local == EGA_ISKRA) || (local == EGA_TSENG)) + ega_type = EGA_TYPE_IBM; + else if (local == EGA_COMPAQ) + ega_type = EGA_TYPE_COMPAQ; + else + ega_type = EGA_TYPE_OTHER; + + ega->actual_type = local; + ega->chipset = 0; + + switch (local) { + default: + break; + case EGA_ATI800P: + ega->chipset = 1; + break; + } +} + static void * ega_standalone_init(const device_t *info) { diff --git a/src/video/vid_jega.c b/src/video/vid_jega.c index c410a15da..145579cf5 100644 --- a/src/video/vid_jega.c +++ b/src/video/vid_jega.c @@ -632,7 +632,7 @@ jega_init(const device_t *info) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_ega); jega->pallook = pallook64; ega_init(&jega->ega, 9, 0); - jega->ega.actual_type = EGA_SUPEREGA; + ega_set_type(&jega->ega, EGA_SUPEREGA); jega->ega.priv_parent = jega; mem_mapping_add(&jega->ega.mapping, 0xa0000, 0x20000, ega_read, NULL, NULL, ega_write, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, &jega->ega);