diff --git a/.ci/build.sh b/.ci/build.sh index 590119cc4..5442a512f 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -568,59 +568,64 @@ then fi else cwd_root=$(pwd) + cache_dir="$HOME/86box-build-cache" + [ ! -d "$cache_dir" ] && mkdir -p "$cache_dir" if grep -q "OPENAL:BOOL=ON" build/CMakeCache.txt then # Build openal-soft 1.21.1 manually to fix audio issues. This is a temporary # workaround until a newer version of openal-soft trickles down to Debian repos. - if [ -d "openal-soft-1.21.1" ] + prefix="$cache_dir/openal-soft-1.21.1" + if [ -d "$prefix" ] then - rm -rf openal-soft-1.21.1/build + rm -rf "$prefix/build" else - wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.21.1.tar.gz | tar zxf - + wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.21.1.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" fi - cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S openal-soft-1.21.1 -B openal-soft-1.21.1/build || exit 99 - cmake --build openal-soft-1.21.1/build -j$(nproc) || exit 99 - cmake --install openal-soft-1.21.1/build || exit 99 + cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix/build" || exit 99 + cmake --build "$prefix/build" -j$(nproc) || exit 99 + cmake --install "$prefix/build" || exit 99 # Build SDL2 without sound systems. sdl_ss=OFF else # Build FAudio 22.03 manually to remove the dependency on GStreamer. This is a temporary # workaround until a newer version of FAudio trickles down to Debian repos. - if [ -d "FAudio-22.03" ] + prefix="$cache_dir/FAudio-22.03" + if [ -d "$prefix" ] then - rm -rf FAudio-22.03/build + rm -rf "$prefix/build" else - wget -qO - https://github.com/FNA-XNA/FAudio/archive/refs/tags/22.03.tar.gz | tar zxf - + wget -qO - https://github.com/FNA-XNA/FAudio/archive/refs/tags/22.03.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" fi - cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S FAudio-22.03 -B FAudio-22.03/build || exit 99 - cmake --build FAudio-22.03/build -j$(nproc) || exit 99 - cmake --install FAudio-22.03/build || exit 99 + cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix/build" || exit 99 + cmake --build "$prefix/build" -j$(nproc) || exit 99 + cmake --install "$prefix/build" || exit 99 # Build SDL2 with sound systems. sdl_ss=ON fi # Build rtmidi without JACK support to remove the dependency on libjack. - if [ -d "rtmidi-4.0.0" ] + prefix="$cache_dir/rtmidi-4.0.0" + if [ -d "$prefix" ] then - rm -rf rtmidi-4.0.0/build + rm -rf "$prefix/build" else - wget -qO - http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz | tar zxf - + wget -qO - https://github.com/thestk/rtmidi/archive/refs/tags/4.0.0.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" fi - cmake -G Ninja -D RTMIDI_API_JACK=OFF -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S rtmidi-4.0.0 -B rtmidi-4.0.0/build || exit 99 - cmake --build rtmidi-4.0.0/build -j$(nproc) || exit 99 - cmake --install rtmidi-4.0.0/build || exit 99 + cmake -G Ninja -D RTMIDI_API_JACK=OFF -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix/build" || exit 99 + cmake --build "$prefix/build" -j$(nproc) || exit 99 + cmake --install "$prefix/build" || exit 99 # Build SDL2 for joystick and FAudio support, with most components # disabled to remove the dependencies on PulseAudio and libdrm. - if [ ! -d "SDL2-2.0.20" ] + prefix="$cache_dir/SDL2-2.0.20" + if [ ! -d "$prefix" ] then - wget -qO - https://www.libsdl.org/release/SDL2-2.0.20.tar.gz | tar zxf - + wget -qO - https://www.libsdl.org/release/SDL2-2.0.20.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix" fi - rm -rf sdlbuild - mkdir sdlbuild + rm -rf "$cache_dir/sdlbuild" cmake -G Ninja -D SDL_DISKAUDIO=OFF -D SDL_DIRECTFB_SHARED=OFF -D SDL_OPENGL=OFF -D SDL_OPENGLES=OFF -D SDL_OSS=OFF -D SDL_ALSA=$sdl_ss \ -D SDL_ALSA_SHARED=$sdl_ss -D SDL_JACK=$sdl_ss -D SDL_JACK_SHARED=$sdl_ss -D SDL_ESD=OFF -D SDL_ESD_SHARED=OFF -D SDL_PIPEWIRE=$sdl_ss \ -D SDL_PIPEWIRE_SHARED=$sdl_ss -D SDL_PULSEAUDIO=$sdl_ss -D SDL_PULSEAUDIO_SHARED=$sdl_ss -D SDL_ARTS=OFF -D SDL_ARTS_SHARED=OFF \ @@ -628,10 +633,10 @@ else -D SDL_FUSIONSOUND_SHARED=OFF -D SDL_LIBSAMPLERATE=$sdl_ss -D SDL_LIBSAMPLERATE_SHARED=$sdl_ss -D SDL_X11=OFF -D SDL_X11_SHARED=OFF \ -D SDL_WAYLAND=OFF -D SDL_WAYLAND_SHARED=OFF -D SDL_WAYLAND_LIBDECOR=OFF -D SDL_WAYLAND_LIBDECOR_SHARED=OFF -D SDL_WAYLAND_QT_TOUCH=OFF \ -D SDL_RPI=OFF -D SDL_VIVANTE=OFF -D SDL_VULKAN=OFF -D SDL_KMSDRM=OFF -D SDL_KMSDRM_SHARED=OFF -D SDL_OFFSCREEN=OFF \ - -D SDL_HIDAPI_JOYSTICK=ON -D SDL_VIRTUAL_JOYSTICK=ON -D SDL_SHARED=ON -D SDL_STATIC=OFF -S SDL2-2.0.20 -B sdlbuild \ + -D SDL_HIDAPI_JOYSTICK=ON -D SDL_VIRTUAL_JOYSTICK=ON -D SDL_SHARED=ON -D SDL_STATIC=OFF -S "$prefix" -B "$cache_dir/sdlbuild" \ -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" || exit 99 - cmake --build sdlbuild -j$(nproc) || exit 99 - cmake --install sdlbuild || exit 99 + cmake --build "$cache_dir/sdlbuild" -j$(nproc) || exit 99 + cmake --install "$cache_dir/sdlbuild" || exit 99 # Archive Discord Game SDK library. 7z e -y -o"archive_tmp/usr/lib" discord_game_sdk.zip "lib/$arch_discord/discord_game_sdk.so" diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c7d22365..294f5b55d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ if(MUNT_EXTERNAL) endif() project(86Box - VERSION 3.3 + VERSION 3.4 DESCRIPTION "Emulator of x86-based systems" HOMEPAGE_URL "https://86box.net" LANGUAGES C CXX) @@ -114,6 +114,7 @@ if(HAIKU) set(RTMIDI OFF) endif() +set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 11) set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) @@ -127,6 +128,7 @@ option(OPENAL "OpenAL" option(RTMIDI "RtMidi" ON) option(FLUIDSYNTH "FluidSynth" ON) option(MUNT "MUNT" ON) +option(VNC "VNC renderer" OFF) option(DINPUT "DirectInput" OFF) option(CPPTHREADS "C++11 threads" ON) option(NEW_DYNAREC "Use the PCem v15 (\"new\") dynamic recompiler" OFF) @@ -140,21 +142,21 @@ option(QT "Qt GUI" # Option Description Def. Condition Otherwise # ------ ----------- ---- --------- --------- cmake_dependent_option(AMD_K5 "AMD K5" ON "DEV_BRANCH" OFF) +cmake_dependent_option(AN430TX "Intel AN430TX" ON "DEV_BRANCH" OFF) cmake_dependent_option(CYRIX_6X86 "Cyrix 6x86" ON "DEV_BRANCH" OFF) +cmake_dependent_option(DESKPRO386 "Compaq Deskpro 386" ON "DEV_BRANCH" OFF) cmake_dependent_option(GUSMAX "Gravis UltraSound MAX" ON "DEV_BRANCH" OFF) cmake_dependent_option(ISAMEM_RAMPAGE "AST Rampage" ON "DEV_BRANCH" OFF) cmake_dependent_option(ISAMEM_IAB "Intel Above Board" ON "DEV_BRANCH" OFF) cmake_dependent_option(ISAMEM_BRAT "BocaRAM/AT" ON "DEV_BRANCH" OFF) cmake_dependent_option(LASERXT "VTech Laser XT" ON "DEV_BRANCH" OFF) cmake_dependent_option(MGA "Matrox Mystique graphics adapters" ON "DEV_BRANCH" OFF) -cmake_dependent_option(NO_SIO "Machines without emulated Super I/O chips" ON "DEV_BRANCH" OFF) cmake_dependent_option(OLIVETTI "Olivetti M290" ON "DEV_BRANCH" OFF) cmake_dependent_option(OPEN_AT "OpenAT" ON "DEV_BRANCH" OFF) cmake_dependent_option(PAS16 "Pro Audio Spectrum 16" ON "DEV_BRANCH" OFF) cmake_dependent_option(SIO_DETECT "Super I/O Detection Helper" ON "DEV_BRANCH" OFF) cmake_dependent_option(TANDY_ISA "Tandy PSG ISA clone boards" ON "DEV_BRANCH" OFF) cmake_dependent_option(VGAWONDER "ATI VGA Wonder (ATI-18800)" ON "DEV_BRANCH" OFF) -cmake_dependent_option(VNC "VNC renderer" OFF "DEV_BRANCH" OFF) cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF) # Ditto but for Qt diff --git a/src/86box.c b/src/86box.c index 4eae7ab02..720e33279 100644 --- a/src/86box.c +++ b/src/86box.c @@ -37,7 +37,6 @@ #ifdef __APPLE__ #include #include -#include "mac/macOSXGlue.h" #ifdef __aarch64__ #include #endif @@ -92,7 +91,9 @@ #include <86box/snd_speaker.h> #include <86box/video.h> #include <86box/ui.h> +#include <86box/path.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/version.h> #include <86box/gdbstub.h> @@ -173,7 +174,6 @@ int confirm_reset = 1; /* (C) enable reset confirmation */ int confirm_exit = 1; /* (C) enable exit confirmation */ int confirm_save = 1; /* (C) enable save confirmation */ int enable_discord = 0; /* (C) enable Discord integration */ -int enable_crashdump = 0; /* (C) enable crash dump */ /* Statistics. */ extern int mmuflush; @@ -385,48 +385,6 @@ pc_log(const char *fmt, ...) #define pc_log(fmt, ...) #endif -void -add_rom_path(const char* path) -{ - static char cwd[1024]; - memset(cwd, 0x00, sizeof(cwd)); - rom_path_t* cur_rom_path = &rom_paths; - while (cur_rom_path->next != NULL) { - cur_rom_path = cur_rom_path->next; - } - if (!plat_path_abs((char*)path)) { - /* - * This looks like a relative path. - * - * Add it to the current working directory - * to convert it (back) to an absolute path. - */ - plat_getcwd(cwd, 1024); - plat_path_slash(cwd); - snprintf(cur_rom_path->rom_path, 1024, "%s%s%c", cwd, path, 0); - } - else { - /* - * The user-provided path seems like an - * absolute path, so just use that. - */ - strncpy(cur_rom_path->rom_path, path, 1024); - } - plat_path_slash(cur_rom_path->rom_path); - cur_rom_path->next = calloc(1, sizeof(rom_path_t)); -} - -// Copied over from Unix code, which in turn is lifted from musl. Needed for parsing XDG_DATA_DIRS. -static char *local_strsep(char **str, const char *sep) -{ - char *s = *str, *end; - if (!s) return NULL; - end = s + strcspn(s, sep); - if (*end) *end++ = 0; - else end = 0; - *str = end; - return s; -} /* * Perform initial startup of the PC. @@ -438,23 +396,37 @@ static char *local_strsep(char **str, const char *sep) int pc_init(int argc, char *argv[]) { - char path[2048], path2[2048]; + char *ppath = NULL, *rpath = NULL; char *cfg = NULL, *p; -#if !defined(__APPLE__) && !defined(_WIN32) - char *appimage; -#endif - char temp[128]; + char temp[2048]; struct tm *info; time_t now; - int c, vmrp = 0; + int c; int ng = 0, lvmp = 0; +#ifdef _WIN32 uint32_t *uid, *shwnd; +#endif uint32_t lang_init = 0; /* Grab the executable's full path. */ plat_get_exe_name(exe_path, sizeof(exe_path)-1); - p = plat_get_filename(exe_path); + p = path_get_filename(exe_path); *p = '\0'; +#if defined(__APPLE__) + c = strlen(exe_path); + if ((c >= 16) && !strcmp(&exe_path[c - 16], "/Contents/MacOS/")) { + exe_path[c - 16] = '\0'; + p = path_get_filename(exe_path); + *p = '\0'; + } +#elif !defined(_WIN32) + /* Grab the actual path if we are an AppImage. */ + p = getenv("APPIMAGE"); + if (p && (p[0] != '\0')) + path_get_dirname(exe_path, p); +#endif + + path_slash(exe_path); /* * Get the current working directory. @@ -467,9 +439,6 @@ pc_init(int argc, char *argv[]) plat_getcwd(usr_path, sizeof(usr_path) - 1); plat_getcwd(rom_path, sizeof(rom_path) - 1); - memset(path, 0x00, sizeof(path)); - memset(path2, 0x00, sizeof(path)); - for (c=1; cnext) { - pclog("# ROM path: %s\n", cur_rom_path->rom_path); - cur_rom_path = cur_rom_path->next; - } + for(rom_path_t *rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) { + pclog("# ROM path: %s\n", rom_path->path); } - else -#ifndef _WIN32 - pclog("# ROM path: %sroms/\n", exe_path); -#else - pclog("# ROM path: %sroms\\\n", exe_path); -#endif + pclog("# Configuration file: %s\n#\n\n", cfg_path); /* * We are about to read the configuration file, which MAY @@ -1254,7 +1177,7 @@ pc_close(thread_t *ptr) #ifdef __APPLE__ static void _ui_window_title(void *s) { - ui_window_title((const wchar_t *) s); + ui_window_title((wchar_t *) s); free(s); } #endif diff --git a/src/Makefile.local b/src/Makefile.local index c927037d8..4c6830afd 100644 --- a/src/Makefile.local +++ b/src/Makefile.local @@ -172,7 +172,6 @@ EXTRAS := AUTODEP := n -CRASHDUMP := n DEBUG := n OPTIM := n X64 := n diff --git a/src/cdrom/cdrom_image.c b/src/cdrom/cdrom_image.c index 302ab8db1..a41e5aed5 100644 --- a/src/cdrom/cdrom_image.c +++ b/src/cdrom/cdrom_image.c @@ -16,9 +16,6 @@ * Copyright 2015-2019 Miran Grca. * Copyright 2017-2019 bit. */ -#define __USE_LARGEFILE64 -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE #include #include #include @@ -29,6 +26,7 @@ #define HAVE_STDARG_H #include <86box/86box.h> #include <86box/config.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/scsi_device.h> #include <86box/cdrom_image_backend.h> diff --git a/src/cdrom/cdrom_image_backend.c b/src/cdrom/cdrom_image_backend.c index 6a717fc97..352044780 100644 --- a/src/cdrom/cdrom_image_backend.c +++ b/src/cdrom/cdrom_image_backend.c @@ -17,8 +17,6 @@ * Copyright 2017-2020 Fred N. van Kempen. * Copyright 2002-2020 The DOSBox Team. */ -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE #define __STDC_FORMAT_MACROS #include #include @@ -34,10 +32,10 @@ #endif #define HAVE_STDARG_H #include <86box/86box.h> -#include <86box/cdrom_image_backend.h> +#include <86box/path.h> #include <86box/plat.h> +#include <86box/cdrom_image_backend.h> -#define CDROM_BCD(x) (((x) % 10) | (((x) / 10) << 4)) #define MAX_LINE_LENGTH 512 #define MAX_FILENAME_LENGTH 256 @@ -804,7 +802,7 @@ cdi_load_cue(cd_img_t *cdi, const char *cuefile) /* Get a copy of the filename into pathname, we need it later. */ memset(pathname, 0, MAX_FILENAME_LENGTH * sizeof(char)); - plat_get_dirname(pathname, cuefile); + path_get_dirname(pathname, cuefile); /* Open the file. */ fp = plat_fopen(cuefile, "r"); @@ -959,7 +957,7 @@ cdi_load_cue(cd_img_t *cdi, const char *cuefile) if (!strcmp(type, "BINARY")) { memset(temp, 0, MAX_FILENAME_LENGTH * sizeof(char)); - plat_append_filename(filename, pathname, ansi); + path_append_filename(filename, pathname, ansi); trk.file = track_file_init(filename, &error); } if (error) { diff --git a/src/codegen/CMakeLists.txt b/src/codegen/CMakeLists.txt index c5f3eef3d..416b4792a 100644 --- a/src/codegen/CMakeLists.txt +++ b/src/codegen/CMakeLists.txt @@ -23,7 +23,7 @@ if(DYNAREC) target_sources(dynarec PRIVATE codegen_x86-64.c codegen_accumulate_x86-64.c) else() - message(SEND_ERROR + message(SEND_ERROR "Dynarec is incompatible with target platform ${ARCH}") endif() diff --git a/src/codegen/codegen_ops_x86-64.h b/src/codegen/codegen_ops_x86-64.h index 08d4591ec..9184b4bff 100644 --- a/src/codegen/codegen_ops_x86-64.h +++ b/src/codegen/codegen_ops_x86-64.h @@ -23,12 +23,12 @@ static inline int find_host_xmm_reg() } static inline void call(codeblock_t *block, uintptr_t func) { - uintptr_t diff = func - (uintptr_t)&block->data[block_pos + 5]; + intptr_t diff = (intptr_t)(func - (uintptr_t)&block->data[block_pos + 5]); codegen_reg_loaded[0] = codegen_reg_loaded[1] = codegen_reg_loaded[2] = codegen_reg_loaded[3] = 0; codegen_reg_loaded[4] = codegen_reg_loaded[5] = codegen_reg_loaded[6] = codegen_reg_loaded[7] = 0; - if (diff >= -0x80000000ULL && diff < 0x7fffffffULL) + if (diff >= -0x80000000LL && diff < 0x7fffffffLL) { addbyte(0xE8); /*CALL*/ addlong((uint32_t)diff); diff --git a/src/codegen_new/CMakeLists.txt b/src/codegen_new/CMakeLists.txt index e9f53f4a6..a96d0b57e 100644 --- a/src/codegen_new/CMakeLists.txt +++ b/src/codegen_new/CMakeLists.txt @@ -43,7 +43,7 @@ if(DYNAREC) target_sources(dynarec PRIVATE codegen_backend_arm.c codegen_backend_arm_ops.c codegen_backend_arm_uops.c) else() - message(SEND_ERROR + message(SEND_ERROR "Dynarec is incompatible with target platform ${ARCH}") endif() diff --git a/src/codegen_new/codegen_backend_arm.c b/src/codegen_new/codegen_backend_arm.c index ce5f788ce..7030c401a 100644 --- a/src/codegen_new/codegen_backend_arm.c +++ b/src/codegen_new/codegen_backend_arm.c @@ -22,6 +22,7 @@ #if defined WIN32 || defined _WIN32 || defined _WIN32 #include #endif +#include void *codegen_mem_load_byte; void *codegen_mem_load_word; @@ -310,7 +311,7 @@ void codegen_backend_init() block->data = codeblock_allocator_get_ptr(block->head_mem_block); block_write_data = block->data; build_loadstore_routines(&codeblock[block_current]); -printf("block_pos=%i\n", block_pos); +//pclog("block_pos=%i\n", block_pos); codegen_fp_round = &block_write_data[block_pos]; build_fp_round_routine(&codeblock[block_current]); diff --git a/src/codegen_new/codegen_backend_arm64.c b/src/codegen_new/codegen_backend_arm64.c index 4c77f8910..ce1082d0a 100644 --- a/src/codegen_new/codegen_backend_arm64.c +++ b/src/codegen_new/codegen_backend_arm64.c @@ -74,7 +74,6 @@ static void build_load_routine(codeblock_t *block, int size, int is_float) { uint32_t *branch_offset; uint32_t *misaligned_offset; - int offset; /*In - W0 = address Out - W0 = data, W1 = abrt*/ @@ -143,7 +142,6 @@ static void build_store_routine(codeblock_t *block, int size, int is_float) { uint32_t *branch_offset; uint32_t *misaligned_offset; - int offset; /*In - R0 = address, R1 = data Out - R1 = abrt*/ @@ -283,12 +281,6 @@ void codegen_backend_init() { codeblock_t *block; int c; -#if defined(__linux__) || defined(__APPLE__) - void *start; - size_t len; - long pagesize = sysconf(_SC_PAGESIZE); - long pagemask = ~(pagesize - 1); -#endif codeblock = malloc(BLOCK_SIZE * sizeof(codeblock_t)); codeblock_hash = malloc(HASH_SIZE * sizeof(codeblock_t *)); diff --git a/src/codegen_new/codegen_backend_arm64_ops.c b/src/codegen_new/codegen_backend_arm64_ops.c index a33062299..0cc20d788 100644 --- a/src/codegen_new/codegen_backend_arm64_ops.c +++ b/src/codegen_new/codegen_backend_arm64_ops.c @@ -270,12 +270,6 @@ static inline int imm_is_imm16(uint32_t imm_data) return 1; return 0; } -static inline int imm_is_imm12(uint32_t imm_data) -{ - if (!(imm_data & 0xfffff000) || !(imm_data & 0xff000fff)) - return 1; - return 0; -} static void codegen_allocate_new_block(codeblock_t *block); diff --git a/src/codegen_new/codegen_backend_x86-64.c b/src/codegen_new/codegen_backend_x86-64.c index 02bcf2ab3..8411ca8da 100644 --- a/src/codegen_new/codegen_backend_x86-64.c +++ b/src/codegen_new/codegen_backend_x86-64.c @@ -294,12 +294,6 @@ void codegen_backend_init() { codeblock_t *block; int c; -#if defined(__linux__) || defined(__APPLE__) - void *start; - size_t len; - long pagesize = sysconf(_SC_PAGESIZE); - long pagemask = ~(pagesize - 1); -#endif codeblock = malloc(BLOCK_SIZE * sizeof(codeblock_t)); codeblock_hash = malloc(HASH_SIZE * sizeof(codeblock_t *)); diff --git a/src/codegen_new/codegen_backend_x86-64_ops.c b/src/codegen_new/codegen_backend_x86-64_ops.c index 08079bf26..2baa0f585 100644 --- a/src/codegen_new/codegen_backend_x86-64_ops.c +++ b/src/codegen_new/codegen_backend_x86-64_ops.c @@ -27,12 +27,12 @@ static inline void call(codeblock_t *block, uintptr_t func) { - uintptr_t diff; + intptr_t diff; codegen_alloc_bytes(block, 5); - diff = func - (uintptr_t)&block_write_data[block_pos + 5]; + diff = (intptr_t)(func - (uintptr_t)&block_write_data[block_pos + 5]); - if (diff >= -0x80000000 && diff < 0x7fffffff) + if (diff >= -0x80000000LL && diff < 0x7fffffffLL) { codegen_addbyte(block, 0xE8); /*CALL*/ codegen_addlong(block, (uint32_t)diff); @@ -48,12 +48,12 @@ static inline void call(codeblock_t *block, uintptr_t func) static inline void jmp(codeblock_t *block, uintptr_t func) { - uintptr_t diff; + intptr_t diff; codegen_alloc_bytes(block, 5); - diff = func - (uintptr_t)&block_write_data[block_pos + 5]; + diff = (intptr_t)(func - (uintptr_t)&block_write_data[block_pos + 5]); - if (diff >= -0x80000000 && diff < 0x7fffffff) + if (diff >= -0x80000000LL && diff < 0x7fffffffLL) { codegen_addbyte(block, 0xe9); /*JMP*/ codegen_addlong(block, (uint32_t)diff); diff --git a/src/codegen_new/codegen_backend_x86.c b/src/codegen_new/codegen_backend_x86.c index 8bbc950e6..14327607b 100644 --- a/src/codegen_new/codegen_backend_x86.c +++ b/src/codegen_new/codegen_backend_x86.c @@ -268,12 +268,7 @@ void codegen_backend_init() { codeblock_t *block; int c; -#if defined(__linux__) || defined(__APPLE__) - void *start; - size_t len; - long pagesize = sysconf(_SC_PAGESIZE); - long pagemask = ~(pagesize - 1); -#endif + codeblock = malloc(BLOCK_SIZE * sizeof(codeblock_t)); codeblock_hash = malloc(HASH_SIZE * sizeof(codeblock_t *)); diff --git a/src/codegen_new/codegen_reg.c b/src/codegen_new/codegen_reg.c index c11d1ade5..6b0cc0fd3 100644 --- a/src/codegen_new/codegen_reg.c +++ b/src/codegen_new/codegen_reg.c @@ -513,7 +513,7 @@ void codegen_reg_write_imm(codeblock_t *block, ir_reg_t ir_reg, uint32_t imm_dat case REG_DWORD: if ((uintptr_t)p < 256) - codegen_direct_write_32_imm_stack(block, (int)p, imm_data); + codegen_direct_write_32_imm_stack(block, (int)((uintptr_t) p), imm_data); else codegen_direct_write_32_imm(block, p, imm_data); break; diff --git a/src/config.c b/src/config.c index 4dbbb4a21..556a13b09 100644 --- a/src/config.c +++ b/src/config.c @@ -63,6 +63,7 @@ #include <86box/midi.h> #include <86box/snd_mpu401.h> #include <86box/video.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/plat_dir.h> #include <86box/ui.h> @@ -1422,12 +1423,12 @@ load_hard_disks(void) wcsncpy(hdd[c].fn, &wp[wcslen(usr_path)], sizeof_w(hdd[c].fn)); } else #endif - if (plat_path_abs(p)) { + if (path_abs(p)) { strncpy(hdd[c].fn, p, sizeof(hdd[c].fn) - 1); } else { - plat_append_filename(hdd[c].fn, usr_path, p); + path_append_filename(hdd[c].fn, usr_path, p); } - plat_path_normalize(hdd[c].fn); + path_normalize(hdd[c].fn); /* If disk is empty or invalid, mark it for deletion. */ if (! hdd_is_valid(c)) { @@ -2421,12 +2422,12 @@ save_machine(void) if (fpu_type == 0) config_delete_var(cat, "fpu_type"); - else + else config_set_string(cat, "fpu_type", (char *) fpu_get_internal_name(cpu_f, cpu, fpu_type)); //Write the mem_size explicitly to the setttings in order to help managers to display it without having the actual machine table - config_delete_var(cat, "mem_size"); - config_set_int(cat, "mem_size", mem_size); + config_delete_var(cat, "mem_size"); + config_set_int(cat, "mem_size", mem_size); config_set_int(cat, "cpu_use_dynarec", cpu_use_dynarec); @@ -2841,7 +2842,7 @@ save_hard_disks(void) sprintf(temp, "hdd_%02i_fn", c+1); if (hdd_is_valid(c) && (strlen(hdd[c].fn) != 0)) { - plat_path_normalize(hdd[c].fn); + path_normalize(hdd[c].fn); if (!strnicmp(hdd[c].fn, usr_path, strlen(usr_path))) config_set_string(cat, temp, &hdd[c].fn[strlen(usr_path)]); else diff --git a/src/cpu/386_dynarec.c b/src/cpu/386_dynarec.c index e9a187216..46674fbc6 100644 --- a/src/cpu/386_dynarec.c +++ b/src/cpu/386_dynarec.c @@ -33,6 +33,11 @@ #include "codegen_backend.h" #endif #endif + +#ifdef IS_DYNAREC +#undef IS_DYNAREC +#endif + #include "386_common.h" #if defined(__APPLE__) && defined(__aarch64__) diff --git a/src/cpu/386_dynarec_ops.c b/src/cpu/386_dynarec_ops.c index 28fd3ec79..0b02676f8 100644 --- a/src/cpu/386_dynarec_ops.c +++ b/src/cpu/386_dynarec_ops.c @@ -24,6 +24,10 @@ #define CPU_BLOCK_END() cpu_block_end = 1 +#ifndef IS_DYNAREC +#define IS_DYNAREC +#endif + #include "386_common.h" diff --git a/src/cpu/386_ops.h b/src/cpu/386_ops.h index 4518be9a9..790216cb9 100644 --- a/src/cpu/386_ops.h +++ b/src/cpu/386_ops.h @@ -195,7 +195,11 @@ extern void x386_dynarec_log(const char *fmt, ...); #include "x86_ops_mul.h" #include "x86_ops_pmode.h" #include "x86_ops_prefix.h" +#ifdef IS_DYNAREC +#include "x86_ops_rep_dyn.h" +#else #include "x86_ops_rep.h" +#endif #include "x86_ops_ret.h" #include "x86_ops_set.h" #include "x86_ops_stack.h" diff --git a/src/cpu/x86_ops_bitscan.h b/src/cpu/x86_ops_bitscan.h index 36ae1058e..af87a545d 100644 --- a/src/cpu/x86_ops_bitscan.h +++ b/src/cpu/x86_ops_bitscan.h @@ -1,3 +1,23 @@ +#ifdef IS_DYNAREC +#define BS_common(start, end, dir, dest, time) \ + flags_rebuild(); \ + if (temp) \ + { \ + int c; \ + cpu_state.flags &= ~Z_FLAG; \ + for (c = start; c != end; c += dir) \ + { \ + CLOCK_CYCLES(time); \ + if (temp & (1 << c)) \ + { \ + dest = c; \ + break; \ + } \ + } \ + } \ + else \ + cpu_state.flags |= Z_FLAG; +#else #define BS_common(start, end, dir, dest, time) \ flags_rebuild(); \ instr_cycles = 0; \ @@ -18,11 +38,14 @@ } \ else \ cpu_state.flags |= Z_FLAG; +#endif static int opBSF_w_a16(uint32_t fetchdat) { uint16_t temp; +#ifndef IS_DYNAREC int instr_cycles = 0; +#endif fetch_ea_16(fetchdat); if (cpu_mod != 3) @@ -32,14 +55,18 @@ static int opBSF_w_a16(uint32_t fetchdat) BS_common(0, 16, 1, cpu_state.regs[cpu_reg].w, (is486) ? 1 : 3); CLOCK_CYCLES((is486) ? 6 : 10); +#ifndef IS_DYNAREC instr_cycles += ((is486) ? 6 : 10); PREFETCH_RUN(instr_cycles, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 0); +#endif return 0; } static int opBSF_w_a32(uint32_t fetchdat) { uint16_t temp; +#ifndef IS_DYNAREC int instr_cycles = 0; +#endif fetch_ea_32(fetchdat); if (cpu_mod != 3) @@ -49,14 +76,18 @@ static int opBSF_w_a32(uint32_t fetchdat) BS_common(0, 16, 1, cpu_state.regs[cpu_reg].w, (is486) ? 1 : 3); CLOCK_CYCLES((is486) ? 6 : 10); +#ifndef IS_DYNAREC instr_cycles += ((is486) ? 6 : 10); PREFETCH_RUN(instr_cycles, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 1); +#endif return 0; } static int opBSF_l_a16(uint32_t fetchdat) { uint32_t temp; +#ifndef IS_DYNAREC int instr_cycles = 0; +#endif fetch_ea_16(fetchdat); if (cpu_mod != 3) @@ -66,14 +97,18 @@ static int opBSF_l_a16(uint32_t fetchdat) BS_common(0, 32, 1, cpu_state.regs[cpu_reg].l, (is486) ? 1 : 3); CLOCK_CYCLES((is486) ? 6 : 10); +#ifndef IS_DYNAREC instr_cycles += ((is486) ? 6 : 10); PREFETCH_RUN(instr_cycles, 2, rmdat, 0,(cpu_mod == 3) ? 0:1,0,0, 0); +#endif return 0; } static int opBSF_l_a32(uint32_t fetchdat) { uint32_t temp; +#ifndef IS_DYNAREC int instr_cycles = 0; +#endif fetch_ea_32(fetchdat); if (cpu_mod != 3) @@ -83,15 +118,19 @@ static int opBSF_l_a32(uint32_t fetchdat) BS_common(0, 32, 1, cpu_state.regs[cpu_reg].l, (is486) ? 1 : 3); CLOCK_CYCLES((is486) ? 6 : 10); +#ifndef IS_DYNAREC instr_cycles += ((is486) ? 6 : 10); PREFETCH_RUN(instr_cycles, 2, rmdat, 0,(cpu_mod == 3) ? 0:1,0,0, 1); +#endif return 0; } static int opBSR_w_a16(uint32_t fetchdat) { uint16_t temp; +#ifndef IS_DYNAREC int instr_cycles = 0; +#endif fetch_ea_16(fetchdat); if (cpu_mod != 3) @@ -101,14 +140,18 @@ static int opBSR_w_a16(uint32_t fetchdat) BS_common(15, -1, -1, cpu_state.regs[cpu_reg].w, 3); CLOCK_CYCLES((is486) ? 6 : 10); +#ifndef IS_DYNAREC instr_cycles += ((is486) ? 6 : 10); PREFETCH_RUN(instr_cycles, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 0); +#endif return 0; } static int opBSR_w_a32(uint32_t fetchdat) { uint16_t temp; +#ifndef IS_DYNAREC int instr_cycles = 0; +#endif fetch_ea_32(fetchdat); if (cpu_mod != 3) @@ -118,14 +161,18 @@ static int opBSR_w_a32(uint32_t fetchdat) BS_common(15, -1, -1, cpu_state.regs[cpu_reg].w, 3); CLOCK_CYCLES((is486) ? 6 : 10); +#ifndef IS_DYNAREC instr_cycles += ((is486) ? 6 : 10); PREFETCH_RUN(instr_cycles, 2, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 1); +#endif return 0; } static int opBSR_l_a16(uint32_t fetchdat) { uint32_t temp; +#ifndef IS_DYNAREC int instr_cycles = 0; +#endif fetch_ea_16(fetchdat); if (cpu_mod != 3) @@ -135,14 +182,18 @@ static int opBSR_l_a16(uint32_t fetchdat) BS_common(31, -1, -1, cpu_state.regs[cpu_reg].l, 3); CLOCK_CYCLES((is486) ? 6 : 10); +#ifndef IS_DYNAREC instr_cycles += ((is486) ? 6 : 10); PREFETCH_RUN(instr_cycles, 2, rmdat, 0,(cpu_mod == 3) ? 0:1,0,0, 0); +#endif return 0; } static int opBSR_l_a32(uint32_t fetchdat) { uint32_t temp; +#ifndef IS_DYNAREC int instr_cycles = 0; +#endif fetch_ea_32(fetchdat); if (cpu_mod != 3) @@ -152,7 +203,9 @@ static int opBSR_l_a32(uint32_t fetchdat) BS_common(31, -1, -1, cpu_state.regs[cpu_reg].l, 3); CLOCK_CYCLES((is486) ? 6 : 10); +#ifndef IS_DYNAREC instr_cycles += ((is486) ? 6 : 10); PREFETCH_RUN(instr_cycles, 2, rmdat, 0,(cpu_mod == 3) ? 0:1,0,0, 1); +#endif return 0; } diff --git a/src/cpu/x86_ops_rep_dyn.h b/src/cpu/x86_ops_rep_dyn.h new file mode 100644 index 000000000..e63ed32fe --- /dev/null +++ b/src/cpu/x86_ops_rep_dyn.h @@ -0,0 +1,703 @@ +#define REP_OPS(size, CNT_REG, SRC_REG, DEST_REG) \ +static int opREP_INSB_ ## size(uint32_t fetchdat) \ +{ \ + addr64 = 0x00000000; \ + \ + if (CNT_REG > 0) \ + { \ + uint8_t temp; \ + \ + SEG_CHECK_WRITE(&cpu_state.seg_es); \ + check_io_perm(DX); \ + CHECK_WRITE(&cpu_state.seg_es, DEST_REG, DEST_REG); \ + high_page = 0; \ + do_mmut_wb(es, DEST_REG, &addr64); \ + if (cpu_state.abrt) return 1; \ + temp = inb(DX); \ + writememb_n(es, DEST_REG, addr64, temp); if (cpu_state.abrt) return 1; \ + \ + if (cpu_state.flags & D_FLAG) DEST_REG--; \ + else DEST_REG++; \ + CNT_REG--; \ + cycles -= 15; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_INSW_ ## size(uint32_t fetchdat) \ +{ \ + addr64a[0] = addr64a[1] = 0x00000000; \ + \ + if (CNT_REG > 0) \ + { \ + uint16_t temp; \ + \ + SEG_CHECK_WRITE(&cpu_state.seg_es); \ + check_io_perm(DX); \ + check_io_perm(DX+1); \ + CHECK_WRITE(&cpu_state.seg_es, DEST_REG, DEST_REG + 1UL); \ + high_page = 0; \ + do_mmut_ww(es, DEST_REG, addr64a); \ + if (cpu_state.abrt) return 1; \ + temp = inw(DX); \ + writememw_n(es, DEST_REG, addr64a, temp); if (cpu_state.abrt) return 1; \ + \ + if (cpu_state.flags & D_FLAG) DEST_REG -= 2; \ + else DEST_REG += 2; \ + CNT_REG--; \ + cycles -= 15; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_INSL_ ## size(uint32_t fetchdat) \ +{ \ + addr64a[0] = addr64a[1] = addr64a[2] = addr64a[3] = 0x00000000; \ + \ + if (CNT_REG > 0) \ + { \ + uint32_t temp; \ + \ + SEG_CHECK_WRITE(&cpu_state.seg_es); \ + check_io_perm(DX); \ + check_io_perm(DX+1); \ + check_io_perm(DX+2); \ + check_io_perm(DX+3); \ + CHECK_WRITE(&cpu_state.seg_es, DEST_REG, DEST_REG + 3UL); \ + high_page = 0; \ + do_mmut_wl(es, DEST_REG, addr64a); \ + if (cpu_state.abrt) return 1; \ + temp = inl(DX); \ + writememl_n(es, DEST_REG, addr64a, temp); if (cpu_state.abrt) return 1; \ + \ + if (cpu_state.flags & D_FLAG) DEST_REG -= 4; \ + else DEST_REG += 4; \ + CNT_REG--; \ + cycles -= 15; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ + \ +static int opREP_OUTSB_ ## size(uint32_t fetchdat) \ +{ \ + if (CNT_REG > 0) \ + { \ + uint8_t temp; \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + CHECK_READ(cpu_state.ea_seg, SRC_REG, SRC_REG); \ + temp = readmemb(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \ + check_io_perm(DX); \ + outb(DX, temp); \ + if (cpu_state.flags & D_FLAG) SRC_REG--; \ + else SRC_REG++; \ + CNT_REG--; \ + cycles -= 14; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_OUTSW_ ## size(uint32_t fetchdat) \ +{ \ + if (CNT_REG > 0) \ + { \ + uint16_t temp; \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + CHECK_READ(cpu_state.ea_seg, SRC_REG, SRC_REG + 1UL); \ + temp = readmemw(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \ + check_io_perm(DX); \ + check_io_perm(DX+1); \ + outw(DX, temp); \ + if (cpu_state.flags & D_FLAG) SRC_REG -= 2; \ + else SRC_REG += 2; \ + CNT_REG--; \ + cycles -= 14; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_OUTSL_ ## size(uint32_t fetchdat) \ +{ \ + if (CNT_REG > 0) \ + { \ + uint32_t temp; \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + CHECK_READ(cpu_state.ea_seg, SRC_REG, SRC_REG + 3UL); \ + temp = readmeml(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \ + check_io_perm(DX); \ + check_io_perm(DX+1); \ + check_io_perm(DX+2); \ + check_io_perm(DX+3); \ + outl(DX, temp); \ + if (cpu_state.flags & D_FLAG) SRC_REG -= 4; \ + else SRC_REG += 4; \ + CNT_REG--; \ + cycles -= 14; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ + \ +static int opREP_MOVSB_ ## size(uint32_t fetchdat) \ +{ \ + int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ + addr64 = addr64_2 = 0x00000000; \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + if (CNT_REG > 0) \ + { \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + SEG_CHECK_WRITE(&cpu_state.seg_es); \ + } \ + while (CNT_REG > 0) \ + { \ + uint8_t temp; \ + \ + CHECK_READ_REP(cpu_state.ea_seg, SRC_REG, SRC_REG); \ + high_page = 0; \ + do_mmut_rb(cpu_state.ea_seg->base, SRC_REG, &addr64) ; \ + if (cpu_state.abrt) break; \ + CHECK_WRITE_REP(&cpu_state.seg_es, DEST_REG, DEST_REG); \ + do_mmut_wb(es, DEST_REG, &addr64_2); \ + if (cpu_state.abrt) break; \ + temp = readmemb_n(cpu_state.ea_seg->base, SRC_REG, addr64); if (cpu_state.abrt) return 1; \ + writememb_n(es, DEST_REG, addr64_2, temp); if (cpu_state.abrt) return 1; \ + \ + if (cpu_state.flags & D_FLAG) { DEST_REG--; SRC_REG--; } \ + else { DEST_REG++; SRC_REG++; } \ + CNT_REG--; \ + cycles -= is486 ? 3 : 4; \ + if (cycles < cycles_end) \ + break; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_MOVSW_ ## size(uint32_t fetchdat) \ +{ \ + int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ + addr64a[0] = addr64a[1] = 0x00000000; \ + addr64a_2[0] = addr64a_2[1] = 0x00000000; \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + if (CNT_REG > 0) \ + { \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + SEG_CHECK_WRITE(&cpu_state.seg_es); \ + } \ + while (CNT_REG > 0) \ + { \ + uint16_t temp; \ + \ + CHECK_READ_REP(cpu_state.ea_seg, SRC_REG, SRC_REG + 1UL); \ + high_page = 0; \ + do_mmut_rw(cpu_state.ea_seg->base, SRC_REG, addr64a); \ + if (cpu_state.abrt) break; \ + CHECK_WRITE_REP(&cpu_state.seg_es, DEST_REG, DEST_REG + 1UL); \ + do_mmut_ww(es, DEST_REG, addr64a_2); \ + if (cpu_state.abrt) break; \ + temp = readmemw_n(cpu_state.ea_seg->base, SRC_REG, addr64a); if (cpu_state.abrt) return 1; \ + writememw_n(es, DEST_REG, addr64a_2, temp); if (cpu_state.abrt) return 1; \ + \ + if (cpu_state.flags & D_FLAG) { DEST_REG -= 2; SRC_REG -= 2; } \ + else { DEST_REG += 2; SRC_REG += 2; } \ + CNT_REG--; \ + cycles -= is486 ? 3 : 4; \ + if (cycles < cycles_end) \ + break; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_MOVSL_ ## size(uint32_t fetchdat) \ +{ \ + int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ + addr64a[0] = addr64a[1] = addr64a[2] = addr64a[3] = 0x00000000; \ + addr64a_2[0] = addr64a_2[1] = addr64a_2[2] = addr64a_2[3] = 0x00000000; \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + if (CNT_REG > 0) \ + { \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + SEG_CHECK_WRITE(&cpu_state.seg_es); \ + } \ + while (CNT_REG > 0) \ + { \ + uint32_t temp; \ + \ + CHECK_READ_REP(cpu_state.ea_seg, SRC_REG, SRC_REG + 3UL); \ + high_page = 0; \ + do_mmut_rl(cpu_state.ea_seg->base, SRC_REG, addr64a); \ + if (cpu_state.abrt) break; \ + CHECK_WRITE_REP(&cpu_state.seg_es, DEST_REG, DEST_REG + 3UL); \ + do_mmut_wl(es, DEST_REG, addr64a_2); \ + if (cpu_state.abrt) break; \ + temp = readmeml_n(cpu_state.ea_seg->base, SRC_REG, addr64a); if (cpu_state.abrt) return 1; \ + writememl_n(es, DEST_REG, addr64a_2, temp); if (cpu_state.abrt) return 1; \ + \ + if (cpu_state.flags & D_FLAG) { DEST_REG -= 4; SRC_REG -= 4; } \ + else { DEST_REG += 4; SRC_REG += 4; } \ + CNT_REG--; \ + cycles -= is486 ? 3 : 4; \ + if (cycles < cycles_end) \ + break; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ + \ + \ +static int opREP_STOSB_ ## size(uint32_t fetchdat) \ +{ \ + int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + if (CNT_REG > 0) \ + SEG_CHECK_WRITE(&cpu_state.seg_es); \ + while (CNT_REG > 0) \ + { \ + CHECK_WRITE_REP(&cpu_state.seg_es, DEST_REG, DEST_REG); \ + writememb(es, DEST_REG, AL); if (cpu_state.abrt) return 1; \ + if (cpu_state.flags & D_FLAG) DEST_REG--; \ + else DEST_REG++; \ + CNT_REG--; \ + cycles -= is486 ? 4 : 5; \ + if (cycles < cycles_end) \ + break; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_STOSW_ ## size(uint32_t fetchdat) \ +{ \ + int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + if (CNT_REG > 0) \ + SEG_CHECK_WRITE(&cpu_state.seg_es); \ + while (CNT_REG > 0) \ + { \ + CHECK_WRITE_REP(&cpu_state.seg_es, DEST_REG, DEST_REG + 1UL); \ + writememw(es, DEST_REG, AX); if (cpu_state.abrt) return 1; \ + if (cpu_state.flags & D_FLAG) DEST_REG -= 2; \ + else DEST_REG += 2; \ + CNT_REG--; \ + cycles -= is486 ? 4 : 5; \ + if (cycles < cycles_end) \ + break; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_STOSL_ ## size(uint32_t fetchdat) \ +{ \ + int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + if (CNT_REG > 0) \ + SEG_CHECK_WRITE(&cpu_state.seg_es); \ + while (CNT_REG > 0) \ + { \ + CHECK_WRITE_REP(&cpu_state.seg_es, DEST_REG, DEST_REG + 3UL); \ + writememl(es, DEST_REG, EAX); if (cpu_state.abrt) return 1; \ + if (cpu_state.flags & D_FLAG) DEST_REG -= 4; \ + else DEST_REG += 4; \ + CNT_REG--; \ + cycles -= is486 ? 4 : 5; \ + if (cycles < cycles_end) \ + break; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ + \ +static int opREP_LODSB_ ## size(uint32_t fetchdat) \ +{ \ + int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + if (CNT_REG > 0) \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + while (CNT_REG > 0) \ + { \ + CHECK_READ_REP(cpu_state.ea_seg, SRC_REG, SRC_REG); \ + AL = readmemb(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \ + if (cpu_state.flags & D_FLAG) SRC_REG--; \ + else SRC_REG++; \ + CNT_REG--; \ + cycles -= is486 ? 4 : 5; \ + if (cycles < cycles_end) \ + break; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_LODSW_ ## size(uint32_t fetchdat) \ +{ \ + int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + if (CNT_REG > 0) \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + while (CNT_REG > 0) \ + { \ + CHECK_READ_REP(cpu_state.ea_seg, SRC_REG, SRC_REG + 1UL); \ + AX = readmemw(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \ + if (cpu_state.flags & D_FLAG) SRC_REG -= 2; \ + else SRC_REG += 2; \ + CNT_REG--; \ + cycles -= is486 ? 4 : 5; \ + if (cycles < cycles_end) \ + break; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_LODSL_ ## size(uint32_t fetchdat) \ +{ \ + int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + if (CNT_REG > 0) \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + while (CNT_REG > 0) \ + { \ + CHECK_READ_REP(cpu_state.ea_seg, SRC_REG, SRC_REG + 3UL); \ + EAX = readmeml(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \ + if (cpu_state.flags & D_FLAG) SRC_REG -= 4; \ + else SRC_REG += 4; \ + CNT_REG--; \ + cycles -= is486 ? 4 : 5; \ + if (cycles < cycles_end) \ + break; \ + } \ + if (CNT_REG > 0) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ + + +#define CHEK_READ(a, b, c) + + +#define REP_OPS_CMPS_SCAS(size, CNT_REG, SRC_REG, DEST_REG, FV) \ +static int opREP_CMPSB_ ## size(uint32_t fetchdat) \ +{ \ + int tempz; \ + \ + addr64 = addr64_2 = 0x00000000; \ + \ + tempz = FV; \ + if ((CNT_REG > 0) && (FV == tempz)) \ + { \ + uint8_t temp, temp2; \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + SEG_CHECK_READ(&cpu_state.seg_es); \ + CHECK_READ(cpu_state.ea_seg, SRC_REG, SRC_REG); \ + high_page = uncached = 0; \ + do_mmut_rb(cpu_state.ea_seg->base, SRC_REG, &addr64); \ + if (cpu_state.abrt) return 1; \ + CHECK_READ(&cpu_state.seg_es, DEST_REG, DEST_REG); \ + do_mmut_rb2(es, DEST_REG, &addr64_2); \ + if (cpu_state.abrt) return 1; \ + temp = readmemb_n(cpu_state.ea_seg->base, SRC_REG, addr64); if (cpu_state.abrt) return 1; \ + if (uncached) \ + readlookup2[(uint32_t)(es+DEST_REG)>>12] = old_rl2; \ + temp2 = readmemb_n(es, DEST_REG, addr64_2); if (cpu_state.abrt) return 1; \ + if (uncached) \ + readlookup2[(uint32_t)(es+DEST_REG)>>12] = (uintptr_t) LOOKUP_INV; \ + \ + if (cpu_state.flags & D_FLAG) { DEST_REG--; SRC_REG--; } \ + else { DEST_REG++; SRC_REG++; } \ + CNT_REG--; \ + cycles -= is486 ? 7 : 9; \ + setsub8(temp, temp2); \ + tempz = (ZF_SET()) ? 1 : 0; \ + } \ + if ((CNT_REG > 0) && (FV == tempz)) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_CMPSW_ ## size(uint32_t fetchdat) \ +{ \ + int tempz; \ + \ + addr64a[0] = addr64a[1] = 0x00000000; \ + addr64a_2[0] = addr64a_2[1] = 0x00000000; \ + \ + tempz = FV; \ + if ((CNT_REG > 0) && (FV == tempz)) \ + { \ + uint16_t temp, temp2; \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + SEG_CHECK_READ(&cpu_state.seg_es); \ + CHECK_READ(cpu_state.ea_seg, SRC_REG, SRC_REG + 1UL); \ + high_page = uncached = 0; \ + do_mmut_rw(cpu_state.ea_seg->base, SRC_REG, addr64a); \ + if (cpu_state.abrt) return 1; \ + CHECK_READ(&cpu_state.seg_es, DEST_REG, DEST_REG + 1UL); \ + do_mmut_rw2(es, DEST_REG, addr64a_2); \ + if (cpu_state.abrt) return 1; \ + temp = readmemw_n(cpu_state.ea_seg->base, SRC_REG, addr64a); if (cpu_state.abrt) return 1; \ + if (uncached) \ + readlookup2[(uint32_t)(es+DEST_REG)>>12] = old_rl2; \ + temp2 = readmemw_n(es, DEST_REG, addr64a_2); if (cpu_state.abrt) return 1; \ + if (uncached) \ + readlookup2[(uint32_t)(es+DEST_REG)>>12] = (uintptr_t) LOOKUP_INV; \ + \ + if (cpu_state.flags & D_FLAG) { DEST_REG -= 2; SRC_REG -= 2; } \ + else { DEST_REG += 2; SRC_REG += 2; } \ + CNT_REG--; \ + cycles -= is486 ? 7 : 9; \ + setsub16(temp, temp2); \ + tempz = (ZF_SET()) ? 1 : 0; \ + } \ + if ((CNT_REG > 0) && (FV == tempz)) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_CMPSL_ ## size(uint32_t fetchdat) \ +{ \ + int tempz; \ + \ + addr64a[0] = addr64a[1] = addr64a[2] = addr64a[3] = 0x00000000; \ + addr64a_2[0] = addr64a_2[1] = addr64a_2[2] = addr64a_2[3] = 0x00000000; \ + \ + tempz = FV; \ + if ((CNT_REG > 0) && (FV == tempz)) \ + { \ + uint32_t temp, temp2; \ + SEG_CHECK_READ(cpu_state.ea_seg); \ + SEG_CHECK_READ(&cpu_state.seg_es); \ + CHECK_READ(cpu_state.ea_seg, SRC_REG, SRC_REG + 3UL); \ + high_page = uncached = 0; \ + do_mmut_rl(cpu_state.ea_seg->base, SRC_REG, addr64a); \ + if (cpu_state.abrt) return 1; \ + CHECK_READ(&cpu_state.seg_es, DEST_REG, DEST_REG + 3UL); \ + do_mmut_rl2(es, DEST_REG, addr64a_2); \ + if (cpu_state.abrt) return 1; \ + temp = readmeml_n(cpu_state.ea_seg->base, SRC_REG, addr64a); if (cpu_state.abrt) return 1; \ + if (uncached) \ + readlookup2[(uint32_t)(es+DEST_REG)>>12] = old_rl2; \ + temp2 = readmeml_n(es, DEST_REG, addr64a_2); if (cpu_state.abrt) return 1; \ + if (uncached) \ + readlookup2[(uint32_t)(es+DEST_REG)>>12] = (uintptr_t) LOOKUP_INV; \ + \ + if (cpu_state.flags & D_FLAG) { DEST_REG -= 4; SRC_REG -= 4; } \ + else { DEST_REG += 4; SRC_REG += 4; } \ + CNT_REG--; \ + cycles -= is486 ? 7 : 9; \ + setsub32(temp, temp2); \ + tempz = (ZF_SET()) ? 1 : 0; \ + } \ + if ((CNT_REG > 0) && (FV == tempz)) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ + \ +static int opREP_SCASB_ ## size(uint32_t fetchdat) \ +{ \ + int tempz; \ + int cycles_end = cycles - 1000; \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + tempz = FV; \ + if ((CNT_REG > 0) && (FV == tempz)) \ + SEG_CHECK_READ(&cpu_state.seg_es); \ + while ((CNT_REG > 0) && (FV == tempz)) \ + { \ + CHECK_READ_REP(&cpu_state.seg_es, DEST_REG, DEST_REG); \ + uint8_t temp = readmemb(es, DEST_REG); if (cpu_state.abrt) break;\ + setsub8(AL, temp); \ + tempz = (ZF_SET()) ? 1 : 0; \ + if (cpu_state.flags & D_FLAG) DEST_REG--; \ + else DEST_REG++; \ + CNT_REG--; \ + cycles -= is486 ? 5 : 8; \ + if (cycles < cycles_end) \ + break; \ + } \ + if ((CNT_REG > 0) && (FV == tempz)) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_SCASW_ ## size(uint32_t fetchdat) \ +{ \ + int tempz; \ + int cycles_end = cycles - 1000; \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + tempz = FV; \ + if ((CNT_REG > 0) && (FV == tempz)) \ + SEG_CHECK_READ(&cpu_state.seg_es); \ + while ((CNT_REG > 0) && (FV == tempz)) \ + { \ + CHECK_READ_REP(&cpu_state.seg_es, DEST_REG, DEST_REG + 1UL); \ + uint16_t temp = readmemw(es, DEST_REG); if (cpu_state.abrt) break;\ + setsub16(AX, temp); \ + tempz = (ZF_SET()) ? 1 : 0; \ + if (cpu_state.flags & D_FLAG) DEST_REG -= 2; \ + else DEST_REG += 2; \ + CNT_REG--; \ + cycles -= is486 ? 5 : 8; \ + if (cycles < cycles_end) \ + break; \ + } \ + if ((CNT_REG > 0) && (FV == tempz)) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} \ +static int opREP_SCASL_ ## size(uint32_t fetchdat) \ +{ \ + int tempz; \ + int cycles_end = cycles - 1000; \ + if (trap) \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ + tempz = FV; \ + if ((CNT_REG > 0) && (FV == tempz)) \ + SEG_CHECK_READ(&cpu_state.seg_es); \ + while ((CNT_REG > 0) && (FV == tempz)) \ + { \ + CHECK_READ_REP(&cpu_state.seg_es, DEST_REG, DEST_REG + 3UL); \ + uint32_t temp = readmeml(es, DEST_REG); if (cpu_state.abrt) break;\ + setsub32(EAX, temp); \ + tempz = (ZF_SET()) ? 1 : 0; \ + if (cpu_state.flags & D_FLAG) DEST_REG -= 4; \ + else DEST_REG += 4; \ + CNT_REG--; \ + cycles -= is486 ? 5 : 8; \ + if (cycles < cycles_end) \ + break; \ + } \ + if ((CNT_REG > 0) && (FV == tempz)) \ + { \ + CPU_BLOCK_END(); \ + cpu_state.pc = cpu_state.oldpc; \ + return 1; \ + } \ + return cpu_state.abrt; \ +} + +REP_OPS(a16, CX, SI, DI) +REP_OPS(a32, ECX, ESI, EDI) +REP_OPS_CMPS_SCAS(a16_NE, CX, SI, DI, 0) +REP_OPS_CMPS_SCAS(a16_E, CX, SI, DI, 1) +REP_OPS_CMPS_SCAS(a32_NE, ECX, ESI, EDI, 0) +REP_OPS_CMPS_SCAS(a32_E, ECX, ESI, EDI, 1) + +static int opREPNE(uint32_t fetchdat) +{ + fetchdat = fastreadl(cs + cpu_state.pc); + if (cpu_state.abrt) return 1; + cpu_state.pc++; + + CLOCK_CYCLES(2); + if (x86_opcodes_REPNE[(fetchdat & 0xff) | cpu_state.op32]) + return x86_opcodes_REPNE[(fetchdat & 0xff) | cpu_state.op32](fetchdat >> 8); + return x86_opcodes[(fetchdat & 0xff) | cpu_state.op32](fetchdat >> 8); +} +static int opREPE(uint32_t fetchdat) +{ + fetchdat = fastreadl(cs + cpu_state.pc); + if (cpu_state.abrt) return 1; + cpu_state.pc++; + + CLOCK_CYCLES(2); + if (x86_opcodes_REPE[(fetchdat & 0xff) | cpu_state.op32]) + return x86_opcodes_REPE[(fetchdat & 0xff) | cpu_state.op32](fetchdat >> 8); + return x86_opcodes[(fetchdat & 0xff) | cpu_state.op32](fetchdat >> 8); +} diff --git a/src/cpu/x86_ops_stack.h b/src/cpu/x86_ops_stack.h index 76b74d393..58f24c6f9 100644 --- a/src/cpu/x86_ops_stack.h +++ b/src/cpu/x86_ops_stack.h @@ -321,7 +321,9 @@ static int opENTER_w(uint32_t fetchdat) uint16_t offset; int count; uint32_t tempEBP, tempESP, frame_ptr; +#ifndef IS_DYNAREC int reads = 0, writes = 1, instr_cycles = 0; +#endif uint16_t tempw; offset = getwordf(); @@ -342,20 +344,26 @@ static int opENTER_w(uint32_t fetchdat) PUSH_W(tempw); if (cpu_state.abrt) { ESP = tempESP; EBP = tempEBP; return 1; } CLOCK_CYCLES((is486) ? 3 : 4); +#ifndef IS_DYNAREC reads++; writes++; instr_cycles += (is486) ? 3 : 4; +#endif } PUSH_W(frame_ptr); if (cpu_state.abrt) { ESP = tempESP; EBP = tempEBP; return 1; } CLOCK_CYCLES((is486) ? 3 : 5); +#ifndef IS_DYNAREC writes++; instr_cycles += (is486) ? 3 : 5; +#endif } BP = frame_ptr; if (stack32) ESP -= offset; else SP -= offset; CLOCK_CYCLES((is486) ? 14 : 10); +#ifndef IS_DYNAREC instr_cycles += (is486) ? 14 : 10; PREFETCH_RUN(instr_cycles, 3, -1, reads,0,writes,0, 0); +#endif return 0; } static int opENTER_l(uint32_t fetchdat) @@ -363,7 +371,9 @@ static int opENTER_l(uint32_t fetchdat) uint16_t offset; int count; uint32_t tempEBP, tempESP, frame_ptr; +#ifndef IS_DYNAREC int reads = 0, writes = 1, instr_cycles = 0; +#endif uint32_t templ; offset = getwordf(); @@ -383,20 +393,26 @@ static int opENTER_l(uint32_t fetchdat) PUSH_L(templ); if (cpu_state.abrt) { ESP = tempESP; EBP = tempEBP; return 1; } CLOCK_CYCLES((is486) ? 3 : 4); +#ifndef IS_DYNAREC reads++; writes++; instr_cycles += (is486) ? 3 : 4; +#endif } PUSH_L(frame_ptr); if (cpu_state.abrt) { ESP = tempESP; EBP = tempEBP; return 1; } CLOCK_CYCLES((is486) ? 3 : 5); +#ifndef IS_DYNAREC writes++; instr_cycles += (is486) ? 3 : 5; +#endif } EBP = frame_ptr; if (stack32) ESP -= offset; else SP -= offset; CLOCK_CYCLES((is486) ? 14 : 10); +#ifndef IS_DYNAREC instr_cycles += (is486) ? 14 : 10; PREFETCH_RUN(instr_cycles, 3, -1, reads,0,writes,0, 0); +#endif return 0; } diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index f4f343f4f..67cf04222 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -258,9 +258,6 @@ do_seg_load(x86seg *s, uint16_t *segdat) else cpu_cur_status |= CPU_STATUS_NOTFLATSS; } - - if (s->base == 0xffffffff) - fatal("do_seg_load(): %04X%04X%04X%04X\n", segdat[3], segdat[2], segdat[1], segdat[0]); } diff --git a/src/device/hwm_gl518sm.c b/src/device/hwm_gl518sm.c index 4afe016f2..102026294 100644 --- a/src/device/hwm_gl518sm.c +++ b/src/device/hwm_gl518sm.c @@ -31,8 +31,7 @@ #define CLAMP(a, min, max) (((a) < (min)) ? (min) : (((a) > (max)) ? (max) : (a))) /* Formulas and factors derived from Linux's gl518sm.c driver. */ -#define GL518SM_RPMDIV(r, d) (CLAMP((r), 1, 960000) * (d)) -#define GL518SM_RPM_TO_REG(r, d) ((r) ? CLAMP((480000 + GL518SM_RPMDIV(r, d) / 2) / GL518SM_RPMDIV(r, d), 1, 255) : 0) +#define GL518SM_RPM_TO_REG(r, d) ((r) ? CLAMP((480000 + (r) * (d) / 2) / (r) * (d), 1, 255) : 0) #define GL518SM_VOLTAGE_TO_REG(v) ((uint8_t) round((v) / 19.0)) #define GL518SM_VDD_TO_REG(v) ((uint8_t) (((v) * 4) / 95.0)) diff --git a/src/device/isamem.c b/src/device/isamem.c index 7ca7d2372..4fd3e6ab2 100644 --- a/src/device/isamem.c +++ b/src/device/isamem.c @@ -683,16 +683,34 @@ isamem_close(void *priv) static const device_config_t ibmxt_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 128, "", - { 0, 512, 16 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 128, + .file_filter = "", + .spinner = { + .min = 0, + .max = 512, + .step = 16 + }, + .selection = { { 0 } } }, { - "start", "Start Address", CONFIG_SPINNER, "", 256, "", - { 0, 576, 64 }, - { { 0 } } + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 256, + .file_filter = "", + .spinner = { + .min = 0, + .max = 576, + .step = 64 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -713,16 +731,34 @@ static const device_t ibmxt_device = { static const device_config_t genericxt_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 16, "", - { 0, 640, 16 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 16, + .file_filter = "", + .spinner = { + .min = 0, + .max = 640, + .step = 16 + }, + .selection = { { 0 } } }, { - "start", "Start Address", CONFIG_SPINNER, "", 0, "", - { 0, 624, 16 }, - { { 0 } } + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { + .min = 0, + .max = 624, + .step = 16 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -743,16 +779,34 @@ static const device_t genericxt_device = { static const device_config_t msramcard_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 64, "", - { 0, 256, 64 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 64, + .file_filter = "", + .spinner = { + .min = 0, + .max = 256, + .step = 64 + }, + .selection = { { 0 } } }, { - "start", "Start Address", CONFIG_SPINNER, "", 0, "", - { 0, 624, 64 }, - { { 0 } } + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { + .min = 0, + .max = 624, + .step = 64 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -773,16 +827,34 @@ static const device_t msramcard_device = { static const device_config_t mssystemcard_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 64, "", - { 0, 256, 64 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 64, + .file_filter = "", + .spinner = { + .min = 0, + .max = 256, + .step = 64 + }, + .selection = { { 0 } } }, { - "start", "Start Address", CONFIG_SPINNER, "", 0, "", - { 0, 624, 64 }, - { { 0 } } + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { + .min = 0, + .max = 624, + .step = 64 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -803,16 +875,34 @@ static const device_t mssystemcard_device = { static const device_config_t ibmat_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 512, "", - { 0, 12288, 512 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 512, + .file_filter = "", + .spinner = { + .min = 0, + .max = 12288, + .step = 512 + }, + .selection = { { 0 } } }, { - "start", "Start Address", CONFIG_SPINNER, "", 512, "", - { 0, 15872, 512 }, - { { 0 } } + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 512, + .file_filter = "", + .spinner = { + .min = 0, + .max = 15872, + .step = 512 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -833,16 +923,34 @@ static const device_t ibmat_device = { static const device_config_t genericat_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 512, "", - { 0, 16384, 512 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 512, + .file_filter = "", + .spinner = { + .min = 0, + .max = 16384, + .step = 512 + }, + .selection = { { 0 } } }, { - "start", "Start Address", CONFIG_SPINNER, "", 512, "", - { 0, 15872, 128 }, - { { 0 } } + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 512, + .file_filter = "", + .spinner = { + .min = 0, + .max = 15872, + .step = 128 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -863,16 +971,34 @@ static const device_t genericat_device = { static const device_config_t p5pak_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 128, "", - { 0, 384, 64 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 128, + .file_filter = "", + .spinner = { + .min = 0, + .max = 384, + .step = 64 + }, + .selection = { { 0 } } }, { - "start", "Start Address", CONFIG_SPINNER, "", 512, "", - { 64, 576, 64 }, - { { 0 } } + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 512, + .file_filter = "", + .spinner = { + .min = 64, + .max = 576, + .step = 64 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -894,16 +1020,34 @@ static const device_t p5pak_device = { static const device_config_t a6pak_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 64, "", - { 0, 576, 64 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 64, + .file_filter = "", + .spinner = { + .min = 0, + .max = 576, + .step = 64 + }, + .selection = { { 0 } } }, { - "start", "Start Address", CONFIG_SPINNER, "", 256, "", - { 64, 512, 64 }, - { { 0 } } + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 256, + .file_filter = "", + .spinner = { + .min = 64, + .max = 512, + .step = 64 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -924,22 +1068,37 @@ static const device_t a6pak_device = { static const device_config_t ems5150_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 256, "", - { 0, 2048, 64 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 256, + .file_filter = "", + .spinner = { + .min = 0, + .max = 2048, + .step = 64 + }, + .selection = { { 0 } } }, { - "base", "Address", CONFIG_HEX16, "", 0, "", { 0 }, - { - { "Disabled", 0x0000 }, - { "Board 1", 0x0208 }, - { "Board 2", 0x020a }, - { "Board 3", 0x020c }, - { "Board 4", 0x020e }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x0000 }, + { .description = "Board 1", .value = 0x0208 }, + { .description = "Board 2", .value = 0x020a }, + { .description = "Board 3", .value = 0x020c }, + { .description = "Board 4", .value = 0x020e }, + { .description = "" } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -960,58 +1119,109 @@ static const device_t ems5150_device = { static const device_config_t ev159_config[] = { // clang-format off { - "size", "Memory Size", CONFIG_SPINNER, "", 512, "", - { 0, 3072, 512 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 512, + .file_filter = "", + .spinner = { + .min = 0, + .max = 3072, + .step = 512 + }, + .selection = { { 0 } } }, { - "start", "Start Address", CONFIG_SPINNER, "", 0, "", - { 0, 16128, 128 }, - { { 0 } } + .name = "start", + .description = "Start Address", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { + .min = 0, + .max = 16128, + .step = 128 + }, + .selection = { { 0 } } }, { - "length", "Contiguous Size", CONFIG_SPINNER, "", 0, "", - { 0, 16384, 128 }, - { { 0 } } + .name = "length", + .description = "Contiguous Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { + .min = 0, + .max = 16384, + .step = 128 + }, + .selection = { { 0 } } }, { - "width", "I/O Width", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "8-bit", 0 }, - { "16-bit", 1 }, - { "" } + .name = "width", + .description = "I/O Width", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "8-bit", .value = 0 }, + { .description = "16-bit", .value = 1 }, + { .description = "" } }, }, { - "speed", "Transfer Speed", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Standard (150ns)", 0 }, - { "High-Speed (120ns)", 1 }, - { "" } + .name = "speed", + .description = "Transfer Speed", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Standard (150ns)", .value = 0 }, + { .description = "High-Speed (120ns)", .value = 1 }, + { .description = "" } } }, { - "ems", "EMS mode", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Disabled", 0 }, - { "Enabled", 1 }, - { "" } + .name = "ems", + .description = "EMS mode", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "Enabled", .value = 1 }, + { .description = "" } }, }, { - "base", "Address", CONFIG_HEX16, "", 0x0258, "", { 0 }, - { - { "208H", 0x0208 }, - { "218H", 0x0218 }, - { "258H", 0x0258 }, - { "268H", 0x0268 }, - { "2A8H", 0x02A8 }, - { "2B8H", 0x02B8 }, - { "2E8H", 0x02E8 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0258, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "208H", .value = 0x0208 }, + { .description = "218H", .value = 0x0218 }, + { .description = "258H", .value = 0x0258 }, + { .description = "268H", .value = 0x0268 }, + { .description = "2A8H", .value = 0x02A8 }, + { .description = "2B8H", .value = 0x02B8 }, + { .description = "2E8H", .value = 0x02E8 }, + { .description = "" } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -1033,47 +1243,79 @@ static const device_t ev159_device = { static const device_config_t brat_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x0258, "", { 0 }, - { - { "208H", 0x0208 }, - { "218H", 0x0218 }, - { "258H", 0x0258 }, - { "268H", 0x0268 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0258, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "208H", .value = 0x0208 }, + { .description = "218H", .value = 0x0218 }, + { .description = "258H", .value = 0x0258 }, + { .description = "268H", .value = 0x0268 }, + { .description = "" } }, }, { - "frame", "Frame Address", CONFIG_HEX20, "", 0, "", { 0 }, - { - { "Disabled", 0x00000 }, - { "D000H", 0xD0000 }, - { "E000H", 0xE0000 }, - { "" } + .name = "frame", + .description = "Frame Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "D000H", .value = 0xD0000 }, + { .description = "E000H", .value = 0xE0000 }, + { .description = "" } }, }, { - "width", "I/O Width", CONFIG_SELECTION, "", 8, "", { 0 }, - { - { "8-bit", 8 }, - { "16-bit", 16 }, - { "" } + .name = "width", + .description = "I/O Width", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 8, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "8-bit", .value = 8 }, + { .description = "16-bit", .value = 16 }, + { .description = "" } }, }, { - "speed", "Transfer Speed", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Standard", 0 }, - { "High-Speed", 1 }, - { "" } + .name = "speed", + .description = "Transfer Speed", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Standard", .value = 0 }, + { .description = "High-Speed", .value = 1 }, + { .description = "" } } }, { - "size", "Memory Size", CONFIG_SPINNER, "", 128, - "", - { 0, 8192, 512 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 128, + .file_filter = "", + .spinner = { + .min = 0, + .max = 8192, + .step = 512 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -1096,50 +1338,83 @@ static const device_t brat_device = { static const device_config_t rampage_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x0258, "", { 0 }, - { - { "208H", 0x0208 }, - { "218H", 0x0218 }, - { "258H", 0x0258 }, - { "268H", 0x0268 }, - { "2A8H", 0x02A8 }, - { "2B8H", 0x02B8 }, - { "2E8H", 0x02E8 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0258, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "208H", .value = 0x0208 }, + { .description = "218H", .value = 0x0218 }, + { .description = "258H", .value = 0x0258 }, + { .description = "268H", .value = 0x0268 }, + { .description = "2A8H", .value = 0x02A8 }, + { .description = "2B8H", .value = 0x02B8 }, + { .description = "2E8H", .value = 0x02E8 }, + { .description = "" } }, }, { - "frame", "Frame Address", CONFIG_HEX20, "", 0, "", { 0 }, - { - { "Disabled", 0x00000 }, - { "C000H", 0xC0000 }, - { "D000H", 0xD0000 }, - { "E000H", 0xE0000 }, - { "" } + .name = "frame", + .description = "Frame Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "C000H", .value = 0xC0000 }, + { .description = "D000H", .value = 0xD0000 }, + { .description = "E000H", .value = 0xE0000 }, + { .description = "" } }, }, { - "width", "I/O Width", CONFIG_SELECTION, "", 8, "", { 0 }, - { - { "8-bit", 8 }, - { "16-bit", 16 }, - { "" } + .name = "width", + .description = "I/O Width", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 8, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "8-bit", .value = 8 }, + { .description = "16-bit", .value = 16 }, + { .description = "" } }, }, { - "speed", "Transfer Speed", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Standard", 0 }, - { "High-Speed", 1 }, - { "" } + .name = "speed", + .description = "Transfer Speed", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Standard", .value = 0 }, + { .description = "High-Speed", .value = 1 }, + { .description = "" } } }, { - "size", "Memory Size", CONFIG_SPINNER, "", 128, "", - { 0, 8192, 128 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 128, + .file_filter = "", + .spinner = { + .min = 0, + .max = 8192, + .step = 128 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -1162,50 +1437,83 @@ static const device_t rampage_device = { static const device_config_t iab_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x0258, "", { 0 }, - { - { "208H", 0x0208 }, - { "218H", 0x0218 }, - { "258H", 0x0258 }, - { "268H", 0x0268 }, - { "2A8H", 0x02A8 }, - { "2B8H", 0x02B8 }, - { "2E8H", 0x02E8 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0258, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "208H", .value = 0x0208 }, + { .description = "218H", .value = 0x0218 }, + { .description = "258H", .value = 0x0258 }, + { .description = "268H", .value = 0x0268 }, + { .description = "2A8H", .value = 0x02A8 }, + { .description = "2B8H", .value = 0x02B8 }, + { .description = "2E8H", .value = 0x02E8 }, + { .description = "" } }, }, { - "frame", "Frame Address", CONFIG_HEX20, "", 0, "", { 0 }, - { - { "Disabled", 0x00000 }, - { "C000H", 0xC0000 }, - { "D000H", 0xD0000 }, - { "E000H", 0xE0000 }, - { "" } + .name = "frame", + .description = "Frame Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "C000H", .value = 0xC0000 }, + { .description = "D000H", .value = 0xD0000 }, + { .description = "E000H", .value = 0xE0000 }, + { .description = "" } }, }, { - "width", "I/O Width", CONFIG_SELECTION, "", 8, "", { 0 }, - { - { "8-bit", 8 }, - { "16-bit", 16 }, - { "" } + .name = "width", + .description = "I/O Width", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 8, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "8-bit", .value = 8 }, + { .description = "16-bit", .value = 16 }, + { .description = "" } }, }, { - "speed", "Transfer Speed", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Standard", 0 }, - { "High-Speed", 1 }, - { "" } + .name = "speed", + .description = "Transfer Speed", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Standard", .value = 0 }, + { .description = "High-Speed", .value = 1 }, + { .description = "" } } }, { - "size", "Memory Size", CONFIG_SPINNER, "", 128, "", - { 0, 8192, 128 }, - { { 0 } } + .name = "size", + .description = "Memory Size", + .type = CONFIG_SPINNER, + .default_string = "", + .default_int = 128, + .file_filter = "", + .spinner = { + .min = 0, + .max = 8192, + .step = 128 + }, + .selection = { { 0 } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/device/mouse_bus.c b/src/device/mouse_bus.c index f201c4f1f..2a098a22b 100644 --- a/src/device/mouse_bus.c +++ b/src/device/mouse_bus.c @@ -696,71 +696,120 @@ bm_init(const device_t *info) static const device_config_t lt_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x23c, "", { 0 }, { - { "0x230", 0x230 }, - { "0x234", 0x234 }, - { "0x238", 0x238 }, - { "0x23C", 0x23c }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x23c, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x230", .value = 0x230 }, + { .description = "0x234", .value = 0x234 }, + { .description = "0x238", .value = 0x238 }, + { .description = "0x23C", .value = 0x23c }, + { .description = "" } } }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 5", 5 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "" } } }, { - "hz", "Hz", CONFIG_SELECTION, "", 45, "", { 0 }, { - { "Non-timed (original)", 0 }, - { "30 Hz (JMP2 = 1)", 30 }, - { "45 Hz (JMP2 not populated)", 45 }, - { "60 Hz (JMP 2 = 2)", 60 }, - { "" } + .name = "hz", + .description = "Hz", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 45, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Non-timed (original)", .value = 0 }, + { .description = "30 Hz (JMP2 = 1)", .value = 30 }, + { .description = "45 Hz (JMP2 not populated)", .value = 45 }, + { .description = "60 Hz (JMP 2 = 2)", .value = 60 }, + { .description = "" } } }, { - "buttons", "Buttons", CONFIG_SELECTION, "", 2, "", { 0 }, { - { "Two", 2 }, - { "Three", 3 }, - { "" } + .name = "buttons", + .description = "Buttons", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 2, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Two", .value = 2 }, + { .description = "Three", .value = 3 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; static const device_config_t ms_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x23c, "", { 0 }, { - { "0x230", 0x230 }, - { "0x234", 0x234 }, - { "0x238", 0x238 }, - { "0x23C", 0x23c }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x23c, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x230", .value = 0x230 }, + { .description = "0x234", .value = 0x234 }, + { .description = "0x238", .value = 0x238 }, + { .description = "0x23C", .value = 0x23c }, + { .description = "" } } }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 5", 5 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "" } } }, { - "buttons", "Buttons", CONFIG_SELECTION, "", 2, "", { 0 }, { - { "Two", 2 }, - { "Three", 3 }, - { "" } + .name = "buttons", + .description = "Buttons", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 2, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Two", .value = 2 }, + { .description = "Three", .value = 3 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/device/mouse_ps2.c b/src/device/mouse_ps2.c index 8757f01ee..cd4225e11 100644 --- a/src/device/mouse_ps2.c +++ b/src/device/mouse_ps2.c @@ -332,15 +332,22 @@ ps2_close(void *priv) static const device_config_t ps2_config[] = { // clang-format off { - "buttons", "Buttons", CONFIG_SELECTION, "", 2, "", { 0 }, { - { "Two", 2 }, - { "Three", 3 }, - { "Wheel", 4 }, - { "" } + .name = "buttons", + .description = "Buttons", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 2, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Two", .value = 2 }, + { .description = "Three", .value = 3 }, + { .description = "Wheel", .value = 4 }, + { .description = "" } } }, { - "", "", -1 + .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/device/mouse_serial.c b/src/device/mouse_serial.c index 71d628558..68b570565 100644 --- a/src/device/mouse_serial.c +++ b/src/device/mouse_serial.c @@ -828,50 +828,76 @@ sermouse_init(const device_t *info) return(dev); } - static const device_config_t mssermouse_config[] = { // clang-format off { - "port", "Serial Port", CONFIG_SELECTION, "", 0, "", { 0 }, { - { "COM1", 0 }, - { "COM2", 1 }, - { "COM3", 2 }, - { "COM4", 3 }, - { "" } + .name = "port", + .description = "Serial Port", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "COM1", .value = 0 }, + { .description = "COM2", .value = 1 }, + { .description = "COM3", .value = 2 }, + { .description = "COM4", .value = 3 }, + { .description = "" } } }, { - "buttons", "Buttons", CONFIG_SELECTION, "", 2, "", { 0 }, { - { "Two", 2 }, - { "Three", 3 }, - { "Wheel", 4 }, - { "" } + .name = "buttons", + .description = "Buttons", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 2, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Two", .value = 2 }, + { .description = "Three", .value = 3 }, + { .description = "Wheel", .value = 4 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; - static const device_config_t ltsermouse_config[] = { // clang-format off { - "port", "Serial Port", CONFIG_SELECTION, "", 0, "", { 0 }, { - { "COM1", 0 }, - { "COM2", 1 }, - { "COM3", 2 }, - { "COM4", 3 }, - { "" } + .name = "port", + .description = "Serial Port", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "COM1", .value = 0 }, + { .description = "COM2", .value = 1 }, + { .description = "COM3", .value = 2 }, + { .description = "COM4", .value = 3 }, + { .description = "" } } }, { - "buttons", "Buttons", CONFIG_SELECTION, "", 2, "", { 0 }, { - { "Two", 2 }, - { "Three", 3 }, - { "" } + .name = "buttons", + .description = "Buttons", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 2, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Two", .value = 2 }, + { .description = "Three", .value = 3 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/device/postcard.c b/src/device/postcard.c index 3fb06680d..22598613f 100644 --- a/src/device/postcard.c +++ b/src/device/postcard.c @@ -139,7 +139,6 @@ postcard_close(UNUSED(void *priv)) NULL, NULL, NULL, postcard_write, NULL, NULL, NULL); } - const device_t postcard_device = { .name = "POST Card", .internal_name = "postcard", diff --git a/src/discord.c b/src/discord.c index 7a9dc1fec..12a5a0396 100644 --- a/src/discord.c +++ b/src/discord.c @@ -88,6 +88,8 @@ discord_update_activity(int paused) if (paren) *(paren - 1) = '\0'; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-truncation" if (strlen(vm_name) < 100) { snprintf(activity.details, sizeof(activity.details), "Running \"%s\"", vm_name); @@ -98,6 +100,7 @@ discord_update_activity(int paused) strncpy(activity.details, strchr(machine_getname(), ']') + 2, sizeof(activity.details) - 1); snprintf(activity.state, sizeof(activity.state), "%s/%s", cpufamily, cpu_s->name); } +#pragma GCC diagnostic pop activity.timestamps.start = time(NULL); diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index fb9ef7479..ff284b231 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -18,8 +18,6 @@ * Copyright 2016-2019 Miran Grca. * Copyright 2017-2019 Fred N. van Kempen. */ -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include #include @@ -843,7 +841,6 @@ wd1007vse1_available(void) return(rom_present(BIOS_FILE)); } - const device_t esdi_at_wd1007vse1_device = { .name = "Western Digital WD1007V-SE1 (ESDI)", .internal_name = "esdi_at", diff --git a/src/disk/hdc_esdi_mca.c b/src/disk/hdc_esdi_mca.c index d3c2b9e88..3c29a9265 100644 --- a/src/disk/hdc_esdi_mca.c +++ b/src/disk/hdc_esdi_mca.c @@ -1178,7 +1178,6 @@ esdi_available(void) return(rom_present(BIOS_FILE_L) && rom_present(BIOS_FILE_H)); } - const device_t esdi_ps2_device = { .name = "IBM PS/2 ESDI Fixed Disk Adapter (MCA)", .internal_name = "esdi_mca", diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index d0ca2c84e..f80662c82 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -17,9 +17,6 @@ * Copyright 2008-2020 Sarah Walker. * Copyright 2016-2020 Miran Grca. */ -#define __USE_LARGEFILE64 -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE #include #include #include @@ -3062,7 +3059,6 @@ ide_close(void *priv) } } - const device_t ide_isa_device = { .name = "ISA PC/AT IDE Controller", .internal_name = "ide_isa", @@ -3150,42 +3146,54 @@ const device_t ide_pci_2ch_device = { // clang-format off static const device_config_t ide_ter_config[] = { { - "irq", "IRQ", CONFIG_SELECTION, "", 10, "", { 0 }, - { - { "Plug and Play", -1 }, - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "IRQ 9", 9 }, - { "IRQ 10", 10 }, - { "IRQ 11", 11 }, - { "IRQ 12", 12 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 10, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Plug and Play", .value = -1 }, + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "IRQ 9", .value = 9 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 12", .value = 12 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t ide_qua_config[] = { { - "irq", "IRQ", CONFIG_SELECTION, "", 11, "", { 0 }, - { - { "Plug and Play", -1 }, - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "IRQ 9", 9 }, - { "IRQ 10", 10 }, - { "IRQ 11", 11 }, - { "IRQ 12", 12 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 11, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Plug and Play", .value = -1 }, + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "IRQ 9", .value = 9 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 12", .value = 12 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on diff --git a/src/disk/hdc_ide_cmd640.c b/src/disk/hdc_ide_cmd640.c index dec8fac18..79c6e4f97 100644 --- a/src/disk/hdc_ide_cmd640.c +++ b/src/disk/hdc_ide_cmd640.c @@ -491,7 +491,6 @@ cmd640_init(const device_t *info) return dev; } - const device_t ide_cmd640_vlb_device = { .name = "CMD PCI-0640B VLB", .internal_name = "ide_cmd640_vlb", diff --git a/src/disk/hdc_ide_cmd646.c b/src/disk/hdc_ide_cmd646.c index 960a07b16..da721f3b6 100644 --- a/src/disk/hdc_ide_cmd646.c +++ b/src/disk/hdc_ide_cmd646.c @@ -406,7 +406,6 @@ cmd646_init(const device_t *info) return dev; } - const device_t ide_cmd646_device = { .name = "CMD PCI-0646", .internal_name = "ide_cmd646", diff --git a/src/disk/hdc_ide_opti611.c b/src/disk/hdc_ide_opti611.c index e53971768..2cbf8e1a2 100644 --- a/src/disk/hdc_ide_opti611.c +++ b/src/disk/hdc_ide_opti611.c @@ -311,7 +311,6 @@ opti611_init(const device_t *info) return dev; } - const device_t ide_opti611_vlb_device = { .name = "OPTi 82C611/82C611A VLB", .internal_name = "ide_opti611_vlb", diff --git a/src/disk/hdc_ide_sff8038i.c b/src/disk/hdc_ide_sff8038i.c index 7caecc37d..f15cc6dcb 100644 --- a/src/disk/hdc_ide_sff8038i.c +++ b/src/disk/hdc_ide_sff8038i.c @@ -584,7 +584,6 @@ static void return dev; } - const device_t sff8038i_device = { .name = "SFF-8038i IDE Bus Master", diff --git a/src/disk/hdc_st506_at.c b/src/disk/hdc_st506_at.c index c510f5319..aff35bc76 100644 --- a/src/disk/hdc_st506_at.c +++ b/src/disk/hdc_st506_at.c @@ -20,9 +20,6 @@ * Copyright 2008-2019 Sarah Walker. * Copyright 2017-2019 Fred N. van Kempen. */ -#define __USE_LARGEFILE64 -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE #include #include #include @@ -767,7 +764,6 @@ mfm_close(void *priv) ui_sb_update_icon(SB_HDD|HDD_BUS_MFM, 0); } - const device_t st506_at_wd1003_device = { .name = "WD1003 AT MFM/RLL Controller", .internal_name = "st506_at", diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index 4a4bb3395..e8c43fdc1 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -67,9 +67,6 @@ * Boston, MA 02111-1307 * USA. */ -#define __USE_LARGEFILE64 -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE #include #include #include @@ -1638,122 +1635,194 @@ wd1004a_27x_available(void) // clang-format off static const device_config_t dtc_config[] = { { - "bios_addr", "BIOS address", CONFIG_HEX20, "", 0xc8000, "", { 0 }, - { - { "Disabled", 0x00000 }, - { "C800H", 0xc8000 }, - { "CA00H", 0xca000 }, - { "D800H", 0xd8000 }, - { "F400H", 0xf4000 }, - { "" } + .name = "bios_addr", + .description = "BIOS address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xc8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "CA00H", .value = 0xca000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "F400H", .value = 0xf4000 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t st11_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x0320, "", { 0 }, - { - { "320H", 0x0320 }, - { "324H", 0x0324 }, - { "328H", 0x0328 }, - { "32CH", 0x032c }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0320, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "320H", .value = 0x0320 }, + { .description = "324H", .value = 0x0324 }, + { .description = "328H", .value = 0x0328 }, + { .description = "32CH", .value = 0x032c }, + { .description = "" } } }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 5", 5 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "" } } }, { - "bios_addr", "BIOS address", CONFIG_HEX20, "", 0xc8000, "", { 0 }, - { - { "Disabled", 0x00000 }, - { "C800H", 0xc8000 }, - { "D000H", 0xd0000 }, - { "D800H", 0xd8000 }, - { "E000H", 0xe0000 }, - { "" } + .name = "bios_addr", + .description = "BIOS address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xc8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "D000H", .value = 0xd0000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "E000H", .value = 0xe0000 }, + { .description = "" } } }, { - "revision", "Board Revision", CONFIG_SELECTION, "", 19, "", { 0 }, - { - { "Rev. 05 (v1.7)", 5 }, - { "Rev. 19 (v2.0)", 19 }, - { "" } + .name = "revision", + .description = "Board Revision", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 19, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Rev. 05 (v1.7)", .value = 5 }, + { .description = "Rev. 19 (v2.0)", .value = 19 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t wd_config[] = { { - "bios_addr", "BIOS address", CONFIG_HEX20, "", 0xc8000, "", { 0 }, - { - { "Disabled", 0x00000 }, - { "C800H", 0xc8000 }, - { "" } + .name = "bios_addr", + .description = "BIOS address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xc8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "" } } }, { - "base", "Address", CONFIG_HEX16, "", 0x0320, "", { 0 }, - { - { "320H", 0x0320 }, - { "324H", 0x0324 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0320, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "320H", .value = 0x0320 }, + { .description = "324H", .value = 0x0324 }, + { .description = "" } } }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 5", 5 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t wd_rll_config[] = { { - "bios_addr", "BIOS address", CONFIG_HEX20, "", 0xc8000, "", { 0 }, - { - { "Disabled", 0x00000 }, - { "C800H", 0xc8000 }, - { "" } + .name = "bios_addr", + .description = "BIOS address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xc8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "" } } }, { - "base", "Address", CONFIG_HEX16, "", 0x0320, "", { 0 }, - { - { "320H", 0x0320 }, - { "324H", 0x0324 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0320, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "320H", .value = 0x0320 }, + { .description = "324H", .value = 0x0324 }, + { .description = "" } } }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 5", 5 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "" } } }, { - "translate", "Translate 26 -> 17", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Off", 0 }, - { "On", 1 }, - { "" } + .name = "translate", + .description = "Translate 26 -> 17", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Off", .value = 0 }, + { .description = "On", .value = 1 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t wd1004a_config[] = { @@ -1799,7 +1868,7 @@ static const device_config_t wd1004a_config[] = { { .description = "" } } }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t wd1004_rll_config[] = { @@ -1864,7 +1933,7 @@ static const device_config_t wd1004_rll_config[] = { { .description = "" } } }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index 754a4114a..28990bbdb 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -84,9 +84,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define __USE_LARGEFILE64 -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE #include #include #include @@ -1102,34 +1099,51 @@ xta_close(void *priv) free(dev); } - static const device_config_t wdxt150_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x0320, "", { 0 }, /*W2*/ - { - { "320H", 0x0320 }, - { "324H", 0x0324 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0320, + .file_filter = "", + .spinner = { 0 }, /*W2*/ + .selection = { + { .description = "320H", .value = 0x0320 }, + { .description = "324H", .value = 0x0324 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, /*W3*/ - { - { "IRQ 5", 5 }, - { "IRQ 4", 4 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, /*W3*/ + .selection = { + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "" } }, }, { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0xc8000, "", { 0 }, /*W1*/ - { - { "C800H", 0xc8000 }, - { "CA00H", 0xca000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xc8000, + .file_filter = "", + .spinner = { 0 }, /*W1*/ + .selection = { + { .description = "C800H", .value = 0xc8000 }, + { .description = "CA00H", .value = 0xca000 }, + { .description = "" } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format off }; diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 51c8dbf4a..34805db2b 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -259,7 +259,6 @@ xtide_at_close(void *priv) free(xtide); } - const device_t xtide_device = { .name = "PC/XT XTIDE", .internal_name = "xtide", diff --git a/src/disk/hdd_image.c b/src/disk/hdd_image.c index f52be646c..eff860804 100644 --- a/src/disk/hdd_image.c +++ b/src/disk/hdd_image.c @@ -16,8 +16,6 @@ * Copyright 2016-2018 Miran Grca. * Copyright 2017,2018 Fred N. van Kempen. */ -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include #include @@ -29,6 +27,7 @@ #include #define HAVE_STDARG_H #include <86box/86box.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/random.h> #include <86box/hdd.h> @@ -78,7 +77,7 @@ hdd_image_log(const char *fmt, ...) int image_is_hdi(const char *s) { - if (! strcasecmp(plat_get_extension((char *) s), "HDI")) + if (! strcasecmp(path_get_extension((char *) s), "HDI")) return 1; else return 0; @@ -92,7 +91,7 @@ image_is_hdx(const char *s, int check_signature) uint64_t filelen; uint64_t signature; - if (! strcasecmp(plat_get_extension((char *) s), "HDX")) { + if (! strcasecmp(path_get_extension((char *) s), "HDX")) { if (check_signature) { f = plat_fopen(s, "rb"); if (!f) @@ -126,7 +125,7 @@ image_is_vhd(const char *s, int check_signature) { FILE* f; - if (! strcasecmp(plat_get_extension((char *) s), "VHD")) { + if (! strcasecmp(path_get_extension((char *) s), "VHD")) { if (check_signature) { f = plat_fopen(s, "rb"); if (!f) @@ -253,7 +252,7 @@ hdd_image_load(int id) memset(empty_sector, 0, sizeof(empty_sector)); if (fn) { - plat_path_normalize(fn); + path_normalize(fn); } diff --git a/src/disk/mo.c b/src/disk/mo.c index a07349e59..d30cf9d94 100644 --- a/src/disk/mo.c +++ b/src/disk/mo.c @@ -33,6 +33,7 @@ #include <86box/device.h> #include <86box/scsi_device.h> #include <86box/nvr.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/ui.h> #include <86box/hdc.h> @@ -332,7 +333,7 @@ mo_load_abort(mo_t *dev) int image_is_mdi(const char *s) { - if (! strcasecmp(plat_get_extension((char *) s), "MDI")) + if (! strcasecmp(path_get_extension((char *) s), "MDI")) return 1; else return 0; diff --git a/src/floppy/fdc_magitronic.c b/src/floppy/fdc_magitronic.c index a27e19748..2250c9a4b 100644 --- a/src/floppy/fdc_magitronic.c +++ b/src/floppy/fdc_magitronic.c @@ -114,14 +114,20 @@ static int b215_available(void) static const device_config_t b215_config[] = { // clang-format off { - "bios_addr", "BIOS Address:", CONFIG_HEX20, "", 0xca000, "", { 0 }, - { - { "CA00H", 0xca000 }, - { "CC00H", 0xcc000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address:", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xca000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "CA00H", .value = 0xca000 }, + { .description = "CC00H", .value = 0xcc000 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -138,4 +144,3 @@ const device_t fdc_b215_device = { .force_redraw = NULL, .config = b215_config }; - diff --git a/src/floppy/fdc_pii15xb.c b/src/floppy/fdc_pii15xb.c index 2e865ec56..42b72885f 100644 --- a/src/floppy/fdc_pii15xb.c +++ b/src/floppy/fdc_pii15xb.c @@ -124,16 +124,22 @@ static int pii_158_available(void) static const device_config_t pii_config[] = { // clang-format off { - "bios_addr", "BIOS Address:", CONFIG_HEX20, "", 0xce000, "", { 0 }, - { - { "Disabled", 0 }, - { "CA00H", 0xca000 }, - { "CC00H", 0xcc000 }, - { "CE00H", 0xce000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address:", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xce000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "CA00H", .value = 0xca000 }, + { .description = "CC00H", .value = 0xcc000 }, + { .description = "CE00H", .value = 0xce000 }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/floppy/fdd.c b/src/floppy/fdd.c index 1344c3f02..2f3dd4fc9 100644 --- a/src/floppy/fdd.c +++ b/src/floppy/fdd.c @@ -26,6 +26,7 @@ #define HAVE_STDARG_H #include <86box/86box.h> #include <86box/timer.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/ui.h> #include <86box/fdd.h> @@ -485,7 +486,7 @@ fdd_load(int drive, char *fn) if (!fn) return; - p = plat_get_extension(fn); + p = path_get_extension(fn); if (!p) return; f = plat_fopen(fn, "rb"); diff --git a/src/floppy/fdd_imd.c b/src/floppy/fdd_imd.c index 5315f7e97..cd76e6204 100644 --- a/src/floppy/fdd_imd.c +++ b/src/floppy/fdd_imd.c @@ -148,8 +148,6 @@ track_is_xdf(int drive, int side, int track) int max_high_id, expected_high_count, expected_low_count; uint8_t *r_map; uint8_t *n_map; - char *data_base; - char *cur_data; effective_sectors = xdf_sectors = high_sectors = low_sectors = 0; @@ -162,7 +160,6 @@ track_is_xdf(int drive, int side, int track) (dev->tracks[track][side].params[3] != 19)) return(0); r_map = (uint8_t *)(dev->buffer + dev->tracks[track][side].r_map_offs); - data_base = dev->buffer + dev->tracks[track][side].data_offs; if (! track) { if (dev->tracks[track][side].params[4] != 2) return(0); @@ -197,7 +194,6 @@ track_is_xdf(int drive, int side, int track) n_map = (uint8_t *) (dev->buffer + dev->tracks[track][side].n_map_offs); - cur_data = data_base; for (i = 0; i < dev->tracks[track][side].params[3]; i++) { effective_sectors++; if (!(r_map[i]) && !(n_map[i])) @@ -207,7 +203,6 @@ track_is_xdf(int drive, int side, int track) xdf_sectors++; dev->xdf_ordered_pos[(int) r_map[i]][side] = i; } - cur_data += (128 << ((uint32_t) n_map[i])); } if ((effective_sectors == 3) && (xdf_sectors == 3)) { diff --git a/src/floppy/fdd_img.c b/src/floppy/fdd_img.c index a8704e7ff..722a25af9 100644 --- a/src/floppy/fdd_img.c +++ b/src/floppy/fdd_img.c @@ -33,6 +33,7 @@ #include <86box/86box.h> #include <86box/timer.h> #include <86box/config.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/fdd.h> #include <86box/fdd_86f.h> @@ -644,7 +645,7 @@ img_load(int drive, char *fn) int size; int i; - ext = plat_get_extension(fn); + ext = path_get_extension(fn); d86f_unregister(drive); diff --git a/src/gdbstub.c b/src/gdbstub.c index 20103c4cd..8ef15d7c8 100644 --- a/src/gdbstub.c +++ b/src/gdbstub.c @@ -27,6 +27,7 @@ #else # include # include +# include #endif #define HAVE_STDARG_H #include <86box/86box.h> @@ -37,6 +38,7 @@ #include <86box/io.h> #include <86box/mem.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/gdbstub.h> #define FAST_RESPONSE(s) \ @@ -954,7 +956,7 @@ e14: /* Add our supported features to the end. */ if (client->response_pos < (sizeof(client->response) - 1)) client->response_pos += snprintf(&client->response[client->response_pos], sizeof(client->response) - client->response_pos, - "PacketSize=%X;swbreak+;hwbreak+;qXfer:features:read+", sizeof(client->packet) - 1); + "PacketSize=%lX;swbreak+;hwbreak+;qXfer:features:read+", sizeof(client->packet) - 1); break; } else if (!strcmp(client->response, "Xfer")) { /* Read the transfer object. */ @@ -1101,6 +1103,7 @@ unknown: case 'z': /* remove break/watchpoint */ case 'Z': /* insert break/watchpoint */ + { gdbstub_breakpoint_t *breakpoint, *prev_breakpoint = NULL, **first_breakpoint; /* Parse breakpoint type. */ @@ -1222,6 +1225,7 @@ unknown: /* Respond positively. */ goto ok; + } } end: /* Send response. */ @@ -1655,7 +1659,11 @@ gdbstub_init() .sin_port = htons(port) }; if (bind(gdbstub_socket, (struct sockaddr *) &bind_addr, sizeof(bind_addr)) == -1) { +#ifdef _WIN32 pclog("GDB Stub: Failed to bind on port %d (%d)\n", port, WSAGetLastError()); +#else + pclog("GDB Stup: Failed to bind on port %d (%d)\n", port, errno); +#endif gdbstub_socket = -1; return; } diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 62aaddc99..8b84100fd 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -42,6 +42,9 @@ #ifdef MAX #undef MAX #endif +#ifdef ABS +#undef ABS +#endif #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) @@ -123,7 +126,6 @@ extern int confirm_reset, /* (C) enable reset confirmation */ confirm_exit, /* (C) enable exit confirmation */ confirm_save; /* (C) enable save confirmation */ extern int enable_discord; /* (C) enable Discord integration */ -extern int enable_crashdump; /* (C) enable crash dump */ extern int is_pentium; /* TODO: Move back to cpu/cpu.h when it's figured out, how to remove that hack from the ET4000/W32p. */ diff --git a/src/include/86box/device.h b/src/include/86box/device.h index afd7c3731..04cc071c4 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -90,7 +90,7 @@ typedef struct { const char *default_string; int default_int; const char *file_filter; - device_config_spinner_t spinner; + const device_config_spinner_t spinner; const device_config_selection_t selection[16]; } device_config_t; diff --git a/src/include/86box/gdbstub.h b/src/include/86box/gdbstub.h index 49eed2c45..4b2f8630a 100644 --- a/src/include/86box/gdbstub.h +++ b/src/include/86box/gdbstub.h @@ -16,6 +16,7 @@ */ #ifndef EMU_GDBSTUB_H #define EMU_GDBSTUB_H +#include #include <86box/mem.h> #define GDBSTUB_MEM_READ 0 diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index e8bda30b7..85a287e1a 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -22,76 +22,122 @@ #ifndef EMU_MACHINE_H # define EMU_MACHINE_H - /* Machine feature flags. */ -// #define MACHINE_PC 0x00000000 /* PC architecture */ -/* Feature flags for features. */ -#define MACHINE_NONMI 0x00000001 /* sys does not have NMI's */ +#define MACHINE_BUS_NONE 0x00000000 /* sys has no bus */ /* Feature flags for BUS'es. */ -#define MACHINE_BUS_ISA 0x00000004 /* sys has ISA bus */ -#define MACHINE_BUS_ISA16 0x00000008 /* sys has ISA16 bus - PC/AT architecture */ -#define MACHINE_BUS_CBUS 0x00000010 /* sys has C-BUS bus */ -#define MACHINE_BUS_PS2 0x00000020 /* system has PS/2 keyboard and mouse ports */ -#define MACHINE_BUS_EISA 0x00000040 /* sys has EISA bus */ -#define MACHINE_BUS_VLB 0x00000080 /* sys has VL bus */ -#define MACHINE_BUS_MCA 0x00000100 /* sys has MCA bus */ -#define MACHINE_BUS_PCI 0x00000200 /* sys has PCI bus */ -#define MACHINE_BUS_PCMCIA 0x00000400 /* sys has PCMCIA bus */ -#define MACHINE_BUS_AGP 0x00000800 /* sys has AGP bus */ -#define MACHINE_BUS_AC97 0x00080000 /* sys has AC97 bus (ACR/AMR/CNR slot) */ +#define MACHINE_BUS_ISA 0x00000001 /* sys has ISA bus */ +#define MACHINE_BUS_CARTRIDGE 0x00000002 /* sys has two cartridge bays */ +#define MACHINE_BUS_ISA16 0x00000004 /* sys has ISA16 bus - PC/AT architecture */ +#define MACHINE_BUS_CBUS 0x00000008 /* sys has C-BUS bus */ +#define MACHINE_BUS_PS2 0x00000010 /* system has PS/2 keyboard and mouse ports */ +#define MACHINE_BUS_EISA 0x00000020 /* sys has EISA bus */ +#define MACHINE_BUS_VLB 0x00000040 /* sys has VL bus */ +#define MACHINE_BUS_MCA 0x00000080 /* sys has MCA bus */ +#define MACHINE_BUS_PCI 0x00000100 /* sys has PCI bus */ +#define MACHINE_BUS_PCMCIA 0x00000200 /* sys has PCMCIA bus */ +#define MACHINE_BUS_AGP 0x00000400 /* sys has AGP bus */ +#define MACHINE_BUS_AC97 0x00000800 /* sys has AC97 bus (ACR/AMR/CNR slot) */ +/* Aliases. */ +#define MACHINE_CARTRIDGE (MACHINE_BUS_CARTRIDGE) /* sys has two cartridge bays */ /* Combined flags. */ -#define MACHINE_PC 0x00000004 /* sys is PC/XT-compatible (ISA) */ -#define MACHINE_AT 0x0000000C /* sys is AT-compatible (ISA + ISA16) */ -#define MACHINE_PC98 0x00000010 /* sys is NEC PC-98x1 series */ -#define MACHINE_EISA 0x0000004C /* sys is AT-compatible with EISA */ -#define MACHINE_VLB 0x0000008C /* sys is AT-compatible with VLB */ -#define MACHINE_VLB98 0x00000090 /* sys is NEC PC-98x1 series with VLB (did that even exist?) */ -#define MACHINE_VLBE 0x000000CC /* sys is AT-compatible with EISA and VLB */ -#define MACHINE_MCA 0x00000100 /* sys is MCA */ -#define MACHINE_PCI 0x0000020C /* sys is AT-compatible with PCI */ -#define MACHINE_PCI98 0x00000210 /* sys is NEC PC-98x1 series with PCI */ -#define MACHINE_PCIE 0x0000024C /* sys is AT-compatible with PCI, and EISA */ -#define MACHINE_PCIV 0x0000028C /* sys is AT-compatible with PCI and VLB */ -#define MACHINE_PCIVE 0x000002CC /* sys is AT-compatible with PCI, VLB, and EISA */ -#define MACHINE_PCMCIA 0x00000400 /* sys is AT-compatible laptop with PCMCIA */ -#define MACHINE_AGP 0x00000A0C /* sys is AT-compatible with AGP */ -#define MACHINE_AGP98 0x00000A10 /* sys is NEC PC-98x1 series with AGP (did that even exist?) */ -/* Feature flags for miscellaneous internal devices. */ -#define MACHINE_VIDEO 0x00001000 /* sys has int video */ -#define MACHINE_VIDEO_ONLY 0x00002000 /* sys has fixed video */ -#define MACHINE_MOUSE 0x00004000 /* sys has int mouse */ -#define MACHINE_SOUND 0x00008000 /* sys has int sound */ -#define MACHINE_FDC 0x00010000 /* sys has int FDC */ -#define MACHINE_NIC 0x00020000 /* sys has int NIC */ -#define MACHINE_GAMEPORT 0x00040000 /* sys has int game port */ -/* Combined flags. */ -#define MACHINE_VIDEO_FIXED 0x00003000 /* sys has fixed int video */ -/* Feature flags for internal storage controllers. */ -#define MACHINE_HDC 0x07FC0000 /* sys has int HDC */ -#define MACHINE_MFM 0x00100000 /* sys has int MFM/RLL */ -#define MACHINE_XTA 0x00200000 /* sys has int XTA */ -#define MACHINE_ESDI 0x00400000 /* sys has int ESDI */ -#define MACHINE_IDE_PRI 0x00800000 /* sys has int pri IDE/ATAPI */ -#define MACHINE_IDE_SEC 0x01000000 /* sys has int sec IDE/ATAPI */ -#define MACHINE_IDE_TER 0x02000000 /* sys has int ter IDE/ATAPI */ -#define MACHINE_IDE_QUA 0x04000000 /* sys has int qua IDE/ATAPI */ -#define MACHINE_SCSI_PRI 0x08000000 /* sys has int pri SCSI */ -#define MACHINE_SCSI_SEC 0x10000000 /* sys has int sec SCSI */ -#define MACHINE_USB 0x20000000 /* sys has int USB */ -/* Combined flags. */ -#define MACHINE_IDE 0x00800000 /* sys has int single IDE/ATAPI - mark as pri IDE/ATAPI */ -#define MACHINE_IDE_DUAL 0x01800000 /* sys has int dual IDE/ATAPI - mark as both pri and sec IDE/ATAPI */ -#define MACHINE_IDE_QUAD 0x07800000 /* sys has int quad IDE/ATAPI - mark as dual + both ter and and qua IDE/ATAPI */ -#define MACHINE_SCSI 0x08000000 /* sys has int single SCSI - mark as pri SCSI */ -#define MACHINE_SCSI_DUAL 0x18000000 /* sys has int dual SCSI - mark as both pri and sec SCSI */ -#define MACHINE_CARTRIDGE 0x20000000 /* sys has two cartridge bays */ +#define MACHINE_PC (MACHINE_BUS_ISA) /* sys is PC/XT-compatible (ISA) */ +#define MACHINE_AT (MACHINE_BUS_ISA | MACHINE_BUS_ISA16) /* sys is AT-compatible (ISA + ISA16) */ +#define MACHINE_PC98 (MACHINE_BUS_CBUS) /* sys is NEC PC-98x1 series */ +#define MACHINE_EISA (MACHINE_BUS_EISA | MACHINE_AT) /* sys is AT-compatible with EISA */ +#define MACHINE_VLB (MACHINE_BUS_VLB | MACHINE_AT) /* sys is AT-compatible with VLB */ +#define MACHINE_VLB98 (MACHINE_BUS_VLB | MACHINE_PC98) /* sys is NEC PC-98x1 series with VLB (did that even exist?) */ +#define MACHINE_VLBE (MACHINE_BUS_VLB | MACHINE_EISA) /* sys is AT-compatible with EISA and VLB */ +#define MACHINE_MCA (MACHINE_BUS_MCA) /* sys is MCA */ +#define MACHINE_PCI (MACHINE_BUS_PCI | MACHINE_AT) /* sys is AT-compatible with PCI */ +#define MACHINE_PCI98 (MACHINE_BUS_PCI | MACHINE_PC98) /* sys is NEC PC-98x1 series with PCI */ +#define MACHINE_PCIE (MACHINE_BUS_PCI | MACHINE_EISA) /* sys is AT-compatible with PCI, and EISA */ +#define MACHINE_PCIV (MACHINE_BUS_PCI | MACHINE_VLB) /* sys is AT-compatible with PCI and VLB */ +#define MACHINE_PCIVE (MACHINE_BUS_PCI | MACHINE_VLBE) /* sys is AT-compatible with PCI, VLB, and EISA */ +#define MACHINE_PCMCIA (MACHINE_BUS_PCMCIA | MACHINE_AT) /* sys is AT-compatible laptop with PCMCIA */ +#define MACHINE_AGP (MACHINE_BUS_AGP | MACHINE_PCI) /* sys is AT-compatible with AGP */ +#define MACHINE_AGP98 (MACHINE_BUS_AGP | MACHINE_PCI98) /* sys is NEC PC-98x1 series with AGP (did that even exist?) */ -#define IS_ARCH(m, a) ((machines[m].flags & (a)) ? 1 : 0) -#define IS_AT(m) (((machines[m].flags & 0x00000FC8) && !(machines[m].flags & MACHINE_PC98)) ? 1 : 0) +#define MACHINE_PCJR (MACHINE_PC | MACHINE_CARTRIDGE) /* sys is PCjr */ +#define MACHINE_PS2 (MACHINE_AT | MACHINE_BUS_PS2) /* sys is PS/2 */ +#define MACHINE_PS2_MCA (MACHINE_MCA | MACHINE_BUS_PS2) /* sys is MCA PS/2 */ +#define MACHINE_PS2_VLB (MACHINE_VLB | MACHINE_BUS_PS2) /* sys is VLB PS/2 */ +#define MACHINE_PS2_PCI (MACHINE_PCI | MACHINE_BUS_PS2) /* sys is PCI PS/2 */ +#define MACHINE_PS2_PCIV (MACHINE_PCIV | MACHINE_BUS_PS2) /* sys is VLB/PCI PS/2 */ +#define MACHINE_PS2_AGP (MACHINE_AGP | MACHINE_BUS_PS2) /* sys is AGP PS/2 */ +#define MACHINE_PS2_A97 (MACHINE_PS2_AGP | MACHINE_BUS_AC97) /* sys is AGP/AC97 PS/2 */ +#define MACHINE_PS2_NOISA (MACHINE_PS2_AGP & ~MACHINE_AT) /* sys is AGP PS/2 without ISA */ +#define MACHINE_PS2_NOI97 (MACHINE_PS2_A97 & ~MACHINE_AT) /* sys is AGP/AC97 PS/2 without ISA */ +/* Feature flags for miscellaneous internal devices. */ +#define MACHINE_FLAGS_NONE 0x00000000 /* sys has no int devices */ +#define MACHINE_VIDEO 0x00000001 /* sys has int video */ +#define MACHINE_VIDEO_ONLY 0x00000002 /* sys has fixed video */ +#define MACHINE_MOUSE 0x00000004 /* sys has int mouse */ +#define MACHINE_FDC 0x00000008 /* sys has int FDC */ +#define MACHINE_LPT_PRI 0x00000010 /* sys has int pri LPT */ +#define MACHINE_LPT_SEC 0x00000020 /* sys has int sec LPT */ +#define MACHINE_UART_PRI 0x00000040 /* sys has int pri UART */ +#define MACHINE_UART_SEC 0x00000080 /* sys has int sec UART */ +#define MACHINE_UART_TER 0x00000100 /* sys has int ter UART */ +#define MACHINE_UART_QUA 0x00000200 /* sys has int qua UART */ +#define MACHINE_GAMEPORT 0x00000400 /* sys has int game port */ +#define MACHINE_SOUND 0x00000800 /* sys has int sound */ +#define MACHINE_NIC 0x00001000 /* sys has int NIC */ +#define MACHINE_MODEM 0x00002000 /* sys has int modem */ +/* Feature flags for advanced devices. */ +#define MACHINE_APM 0x00004000 /* sys has APM */ +#define MACHINE_ACPI 0x00008000 /* sys has ACPI */ +#define MACHINE_HWM 0x00010000 /* sys has hw monitor */ +/* Combined flags. */ +#define MACHINE_VIDEO_FIXED (MACHINE_VIDEO | MACHINE_VIDEO_ONLY) /* sys has fixed int video */ +#define MACHINE_SUPER_IO (MACHINE_FDC | MACHINE_LPT_PRI | MACHINE_UART_PRI | MACHINE_UART_SEC) +#define MACHINE_SUPER_IO_GAME (MACHINE_SUPER_IO | MACHINE_GAMEPORT) +#define MACHINE_SUPER_IO_DUAL (MACHINE_SUPER_IO | MACHINE_LPT_SEC | MACHINE_UART_TER | MACHINE_UART_QUA) +#define MACHINE_AV (MACHINE_VIDEO | MACHINE_SOUND) /* sys has video and sound */ +#define MACHINE_AG (MACHINE_SOUND | MACHINE_GAMEPORT) /* sys has sound and game port */ +/* Feature flags for internal storage controllers. */ +#define MACHINE_HDC 0x03FE0000 /* sys has int HDC */ +#define MACHINE_MFM 0x00020000 /* sys has int MFM/RLL */ +#define MACHINE_XTA 0x00040000 /* sys has int XTA */ +#define MACHINE_ESDI 0x00080000 /* sys has int ESDI */ +#define MACHINE_IDE_PRI 0x00100000 /* sys has int pri IDE/ATAPI */ +#define MACHINE_IDE_SEC 0x00200000 /* sys has int sec IDE/ATAPI */ +#define MACHINE_IDE_TER 0x00400000 /* sys has int ter IDE/ATAPI */ +#define MACHINE_IDE_QUA 0x00800000 /* sys has int qua IDE/ATAPI */ +#define MACHINE_SCSI_PRI 0x01000000 /* sys has int pri SCSI */ +#define MACHINE_SCSI_SEC 0x02000000 /* sys has int sec SCSI */ +#define MACHINE_USB_PRI 0x04000000 /* sys has int pri USB */ +#define MACHINE_USB_SEC 0x08000000 /* sys has int sec USB */ +/* Combined flags. */ +#define MACHINE_IDE (MACHINE_IDE_PRI) /* sys has int single IDE/ATAPI - mark as pri IDE/ATAPI */ +#define MACHINE_IDE_DUAL (MACHINE_IDE_PRI | MACHINE_IDE_SEC) /* sys has int dual IDE/ATAPI - mark as both pri and sec IDE/ATAPI */ +#define MACHINE_IDE_DUALTQ (MACHINE_IDE_TER | MACHINE_IDE_QUA) +#define MACHINE_IDE_QUAD (MACHINE_IDE_DUAL | MACHINE_IDE_DUALTQ) /* sys has int quad IDE/ATAPI - mark as dual + both ter and and qua IDE/ATAPI */ +#define MACHINE_SCSI (MACHINE_SCSI_PRI) /* sys has int single SCSI - mark as pri SCSI */ +#define MACHINE_SCSI_DUAL (MACHINE_SCSI_PRI | MACHINE_SCSI_SEC) /* sys has int dual SCSI - mark as both pri and sec SCSI */ +#define MACHINE_USB (MACHINE_USB_PRI) +#define MACHINE_USB_DUAL (MACHINE_USB_PRI | MACHINE_USB_SEC) +/* Special combined flags. */ +#define MACHINE_PIIX (MACHINE_IDE_DUAL) +#define MACHINE_PIIX3 (MACHINE_PIIX | MACHINE_USB) +/* TODO: ACPI flag. */ +#define MACHINE_PIIX4 (MACHINE_PIIX3 | MACHINE_ACPI) + +#define IS_ARCH(m, a) ((machines[m].bus_flags & (a)) ? 1 : 0) +#define IS_AT(m) (((machines[m].bus_flags & (MACHINE_BUS_ISA16 | MACHINE_BUS_EISA | MACHINE_BUS_VLB | MACHINE_BUS_MCA | MACHINE_BUS_PCI | MACHINE_BUS_PCMCIA | MACHINE_BUS_AGP | MACHINE_BUS_AC97)) && !(machines[m].bus_flags & MACHINE_PC98)) ? 1 : 0) #define CPU_BLOCK(...) (const uint8_t[]) {__VA_ARGS__, 0} #define MACHINE_MULTIPLIER_FIXED -1, -1 +#define CPU_BLOCK_NONE 0 +#define CPU_BLOCK_QDI_FMB CPU_BLOCK(CPU_WINCHIP, CPU_WINCHIP2, CPU_Cx6x86, CPU_Cx6x86L, CPU_Cx6x86MX) +#define CPU_BLOCK_SOYO_4SAW2 CPU_BLOCK(CPU_i486SX, CPU_i486DX, CPU_Am486SX, CPU_Am486DX) + +/* Make sure it's always an invalid value to avoid misdetections. */ +#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64) +#define MACHINE_AVAILABLE 0xffffffffffffffffULL +#else +#define MACHINE_AVAILABLE 0xffffffff +#endif enum { MACHINE_TYPE_NONE = 0, @@ -121,69 +167,130 @@ enum { MACHINE_TYPE_MAX }; +enum { + MACHINE_CHIPSET_NONE = 0, + MACHINE_CHIPSET_DISCRETE, + MACHINE_CHIPSET_PROPRIETARY, + MACHINE_CHIPSET_GC100A, + MACHINE_CHIPSET_GC103, + MACHINE_CHIPSET_HT18, + MACHINE_CHIPSET_ACC_2168, + MACHINE_CHIPSET_ALI_M1217, + MACHINE_CHIPSET_ALI_M6117, + MACHINE_CHIPSET_ALI_M1409, + MACHINE_CHIPSET_ALI_M1429, + MACHINE_CHIPSET_ALI_M1429G, + MACHINE_CHIPSET_ALI_M1489, + MACHINE_CHIPSET_ALI_ALADDIN_IV_PLUS, + MACHINE_CHIPSET_ALI_ALADDIN_V, + MACHINE_CHIPSET_ALI_ALADDIN_PRO_II, + MACHINE_CHIPSET_SCAT, + MACHINE_CHIPSET_NEAT, + MACHINE_CHIPSET_CT_386, + MACHINE_CHIPSET_CT_CS4031, + MACHINE_CHIPSET_CONTAQ_82C596, + MACHINE_CHIPSET_CONTAQ_82C597, + MACHINE_CHIPSET_IMS_8848, + MACHINE_CHIPSET_INTEL_82335, + MACHINE_CHIPSET_INTEL_420TX, + MACHINE_CHIPSET_INTEL_420ZX, + MACHINE_CHIPSET_INTEL_420EX, + MACHINE_CHIPSET_INTEL_430LX, + MACHINE_CHIPSET_INTEL_430NX, + MACHINE_CHIPSET_INTEL_430FX, + MACHINE_CHIPSET_INTEL_430HX, + MACHINE_CHIPSET_INTEL_430VX, + MACHINE_CHIPSET_INTEL_430TX, + MACHINE_CHIPSET_INTEL_450KX, + MACHINE_CHIPSET_INTEL_440FX, + MACHINE_CHIPSET_INTEL_440EX, + MACHINE_CHIPSET_INTEL_440LX, + MACHINE_CHIPSET_INTEL_440BX, + MACHINE_CHIPSET_INTEL_440ZX, + MACHINE_CHIPSET_INTEL_440GX, + MACHINE_CHIPSET_OPTI_283, + MACHINE_CHIPSET_OPTI_291, + MACHINE_CHIPSET_OPTI_493, + MACHINE_CHIPSET_OPTI_495, + MACHINE_CHIPSET_OPTI_499, + MACHINE_CHIPSET_OPTI_895_802G, + MACHINE_CHIPSET_OPTI_547_597, + MACHINE_CHIPSET_SARC_RC2016A, + MACHINE_CHIPSET_SIS_310, + MACHINE_CHIPSET_SIS_401, + MACHINE_CHIPSET_SIS_460, + MACHINE_CHIPSET_SIS_461, + MACHINE_CHIPSET_SIS_471, + MACHINE_CHIPSET_SIS_496, + MACHINE_CHIPSET_SIS_501, + MACHINE_CHIPSET_SIS_5511, + MACHINE_CHIPSET_SIS_5571, + MACHINE_CHIPSET_SMSC_VICTORYBX_66, + MACHINE_CHIPSET_STPC_CLIENT, + MACHINE_CHIPSET_STPC_CONSUMER_II, + MACHINE_CHIPSET_STPC_ELITE, + MACHINE_CHIPSET_STPC_ATLAS, + MACHINE_CHIPSET_SYMPHONY_SL82C460, + MACHINE_CHIPSET_UMC_UM82C480, + MACHINE_CHIPSET_UMC_UM82C491, + MACHINE_CHIPSET_UMC_UM8881, + MACHINE_CHIPSET_UMC_UM8890BF, + MACHINE_CHIPSET_VIA_VT82C495, + MACHINE_CHIPSET_VIA_VT82C496G, + MACHINE_CHIPSET_VIA_APOLLO_VPX, + MACHINE_CHIPSET_VIA_APOLLO_VP3, + MACHINE_CHIPSET_VIA_APOLLO_MVP3, + MACHINE_CHIPSET_VIA_APOLLO_PRO, + MACHINE_CHIPSET_VIA_APOLLO_PRO_133, + MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, + MACHINE_CHIPSET_VLSI_SCAMP, + MACHINE_CHIPSET_VLSI_VL82C480, + MACHINE_CHIPSET_VLSI_VL82C481, + MACHINE_CHIPSET_VLSI_VL82C486, + MACHINE_CHIPSET_WD76C10, + MACHINE_CHIPSET_MAX +}; -typedef struct _machine_type_ { +typedef struct _machine_filter_ { const char *name; const char id; -} machine_type_t; +} machine_filter_t; - -#ifdef NEW_STRUCT typedef struct _machine_ { - const char *name; - const char *internal_name; - const char type; + const char *name; + const char *internal_name; + uint32_t type; + uint32_t chipset; + int (*init)(const struct _machine_ *); + uintptr_t pad, pad0, pad1, pad2; + uint32_t cpu_package; + const uint8_t *cpu_block; + uint32_t cpu_min_bus; + uint32_t cpu_max_bus; + uint16_t cpu_min_voltage; + uint16_t cpu_max_voltage; + float cpu_min_multi; + float cpu_max_multi; + uintptr_t bus_flags; + uintptr_t flags; + uint32_t min_ram, max_ram; + int ram_granularity; + int nvrmask; #ifdef EMU_DEVICE_H - const device_t *device; + const device_t *(*get_device)(void); + const device_t *(*get_vid_device)(void); #else - void *device; -#endif - struct { - const char *name; -#ifdef EMU_CPU_H - CPU *cpus; -#else - void *cpus; -#endif - } cpu[5]; - int flags; - uint32_t min_ram, max_ram; - int ram_granularity; - int nvrmask; -} machine_t; -#else -typedef struct _machine_ { - const char *name; - const char *internal_name; - const char type; - uint32_t cpu_package; - const uint8_t *cpu_block; - uint32_t cpu_min_bus; - uint32_t cpu_max_bus; - uint16_t cpu_min_voltage; - uint16_t cpu_max_voltage; - double cpu_min_multi; - double cpu_max_multi; - int flags; - uint32_t min_ram, max_ram; - int ram_granularity; - int nvrmask; - int (*init)(const struct _machine_ *); -#ifdef EMU_DEVICE_H - const device_t *(*get_device)(void); -#else - void *get_device; + void *get_device; + void *get_vid_device; #endif } machine_t; -#endif - /* Global variables. */ -extern const machine_type_t machine_types[]; -extern const machine_t machines[]; -extern int bios_only; -extern int machine; - +extern const machine_filter_t machine_types[], + machine_chipsets[]; +extern const machine_t machines[]; +extern int bios_only; +extern int machine; /* Core functions. */ extern int machine_count(void); @@ -197,15 +304,15 @@ extern void machine_init(void); extern const device_t *machine_getdevice(int m); #endif extern char *machine_get_internal_name_ex(int m); -extern int machine_get_nvrmask(int m); -extern int machine_has_flags(int m, int flags); -extern int machine_has_bus(int m, int bus_flags); -extern int machine_has_cartridge(int m); -extern int machine_get_min_ram(int m); -extern int machine_get_max_ram(int m); -extern int machine_get_ram_granularity(int m); -extern int machine_get_type(int m); -extern void machine_close(void); +extern int machine_get_nvrmask(int m); +extern int machine_has_flags(int m, int flags); +extern int machine_has_bus(int m, int bus_flags); +extern int machine_has_cartridge(int m); +extern int machine_get_min_ram(int m); +extern int machine_get_max_ram(int m); +extern int machine_get_ram_granularity(int m); +extern int machine_get_type(int m); +extern void machine_close(void); /* Initialization functions for boards and systems. */ @@ -407,7 +514,9 @@ extern int machine_at_cmdpc_init(const machine_t *); extern int machine_at_portableii_init(const machine_t *); extern int machine_at_portableiii_init(const machine_t *); extern int machine_at_portableiii386_init(const machine_t *); +#if defined(DEV_BRANCH) && defined(USE_DESKPRO386) extern int machine_at_deskpro386_init(const machine_t *); +#endif #ifdef EMU_DEVICE_H extern const device_t *at_cpqiii_get_device(void); #endif @@ -513,7 +622,7 @@ extern int machine_at_i430vx_init(const machine_t *); extern int machine_at_nupro592_init(const machine_t *); extern int machine_at_tx97_init(const machine_t *); -#if defined(DEV_BRANCH) && defined(NO_SIO) +#if defined(DEV_BRANCH) && defined(USE_AN430TX) extern int machine_at_an430tx_init(const machine_t *); #endif extern int machine_at_ym430tx_init(const machine_t *); @@ -749,5 +858,4 @@ extern int machine_xt_xi8088_init(const machine_t *); extern const device_t *xi8088_get_device(void); #endif - #endif /*EMU_MACHINE_H*/ diff --git a/src/include/86box/nvr.h b/src/include/86box/nvr.h index 7fc445be3..1788fc91b 100644 --- a/src/include/86box/nvr.h +++ b/src/include/86box/nvr.h @@ -93,6 +93,8 @@ extern const device_t ps_nvr_device; extern const device_t amstrad_nvr_device; extern const device_t ibmat_nvr_device; extern const device_t piix4_nvr_device; +extern const device_t ps_no_nmi_nvr_device; +extern const device_t amstrad_no_nmi_nvr_device; extern const device_t ami_1992_nvr_device; extern const device_t ami_1994_nvr_device; extern const device_t ami_1995_nvr_device; diff --git a/src/include/86box/path.h b/src/include/86box/path.h new file mode 100644 index 000000000..85cb0814d --- /dev/null +++ b/src/include/86box/path.h @@ -0,0 +1,7 @@ +extern void path_get_dirname(char *dest, const char *path); +extern char *path_get_filename(char *s); +extern char *path_get_extension(char *s); +extern void path_append_filename(char *dest, const char *s1, const char *s2); +extern void path_slash(char *path); +extern void path_normalize(char *path); +extern int path_abs(char *path); \ No newline at end of file diff --git a/src/include/86box/plat.h b/src/include/86box/plat.h index ad7006165..1f787da9e 100644 --- a/src/include/86box/plat.h +++ b/src/include/86box/plat.h @@ -105,15 +105,6 @@ extern int plat_chdir(char *path); extern void plat_tempfile(char *bufp, char *prefix, char *suffix); extern void plat_get_exe_name(char *s, int size); extern void plat_init_rom_paths(); -extern char *plat_get_basename(const char *path); -extern void plat_get_dirname(char *dest, const char *path); -extern char *plat_get_filename(char *s); -extern char *plat_get_extension(char *s); -extern void plat_append_filename(char *dest, const char *s1, const char *s2); -extern void plat_put_backslash(char *s); -extern void plat_path_slash(char *path); -extern void plat_path_normalize(char *path); -extern int plat_path_abs(char *path); extern int plat_dir_check(char *path); extern int plat_dir_create(char *path); extern void *plat_mmap(size_t size, uint8_t executable); @@ -169,47 +160,6 @@ extern int ioctl_open(uint8_t id, char d); extern void ioctl_reset(uint8_t id); extern void ioctl_close(uint8_t id); -#ifdef __APPLE__ -#define thread_t plat_thread_t -#define event_t plat_event_t -#define mutex_t plat_mutex_t - -#define thread_create plat_thread_create -#define thread_wait plat_thread_wait -#define thread_create_event plat_thread_create_event -#define thread_set_event plat_thread_set_event -#define thread_reset_event plat_thread_reset_event -#define thread_wait_event plat_thread_wait_event -#define thread_destroy_event plat_thread_destroy_event - -#define thread_create_mutex plat_thread_create_mutex -#define thread_create_mutex_with_spin_count plat_thread_create_mutex_with_spin_count -#define thread_close_mutex plat_thread_close_mutex -#define thread_wait_mutex plat_thread_wait_mutex -#define thread_release_mutex plat_thread_release_mutex -#endif - -/* Thread support. */ -typedef void thread_t; -typedef void event_t; -typedef void mutex_t; - -extern thread_t *thread_create(void (*thread_func)(void *param), void *param); -extern int thread_wait(thread_t *arg); -extern event_t *thread_create_event(void); -extern void thread_set_event(event_t *arg); -extern void thread_reset_event(event_t *arg); -extern int thread_wait_event(event_t *arg, int timeout); -extern void thread_destroy_event(event_t *arg); - -#define MUTEX_DEFAULT_SPIN_COUNT 1024 - -extern mutex_t *thread_create_mutex(void); -extern void thread_close_mutex(mutex_t *arg); -extern int thread_test_mutex(mutex_t *arg); -extern int thread_wait_mutex(mutex_t *arg); -extern int thread_release_mutex(mutex_t *mutex); - /* Other stuff. */ extern void startblit(void); extern void endblit(void); diff --git a/src/include/86box/rom.h b/src/include/86box/rom.h index 04fe94422..30c7c0561 100644 --- a/src/include/86box/rom.h +++ b/src/include/86box/rom.h @@ -42,13 +42,13 @@ typedef struct { typedef struct rom_path_t { - char rom_path[1024]; + char path[1024]; struct rom_path_t* next; } rom_path_t; extern rom_path_t rom_paths; -extern void add_rom_path(const char* path); +extern void rom_add_path(const char* path); extern uint8_t rom_read(uint32_t addr, void *p); extern uint16_t rom_readw(uint32_t addr, void *p); diff --git a/src/include/86box/thread.h b/src/include/86box/thread.h new file mode 100644 index 000000000..a34dbefb5 --- /dev/null +++ b/src/include/86box/thread.h @@ -0,0 +1,46 @@ +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __APPLE__ +#define thread_t plat_thread_t +#define event_t plat_event_t +#define mutex_t plat_mutex_t + +#define thread_create plat_thread_create +#define thread_wait plat_thread_wait +#define thread_create_event plat_thread_create_event +#define thread_set_event plat_thread_set_event +#define thread_reset_event plat_thread_reset_event +#define thread_wait_event plat_thread_wait_event +#define thread_destroy_event plat_thread_destroy_event + +#define thread_create_mutex plat_thread_create_mutex +#define thread_create_mutex_with_spin_count plat_thread_create_mutex_with_spin_count +#define thread_close_mutex plat_thread_close_mutex +#define thread_wait_mutex plat_thread_wait_mutex +#define thread_release_mutex plat_thread_release_mutex +#endif + +/* Thread support. */ +typedef void thread_t; +typedef void event_t; +typedef void mutex_t; + +extern thread_t *thread_create(void (*thread_func)(void *param), void *param); +extern int thread_wait(thread_t *arg); +extern event_t *thread_create_event(void); +extern void thread_set_event(event_t *arg); +extern void thread_reset_event(event_t *arg); +extern int thread_wait_event(event_t *arg, int timeout); +extern void thread_destroy_event(event_t *arg); + +extern mutex_t *thread_create_mutex(void); +extern void thread_close_mutex(mutex_t *arg); +extern int thread_test_mutex(mutex_t *arg); +extern int thread_wait_mutex(mutex_t *arg); +extern int thread_release_mutex(mutex_t *mutex); + +#ifdef __cplusplus +} +#endif diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 1502fba2d..5109207d0 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -158,7 +158,7 @@ typedef struct svga_t /*Force CRTC to dword mode, regardless of CR14/CR17. Required for S3 enhanced mode*/ int force_dword_mode; - + int force_old_addr; int remap_required; diff --git a/src/include/86box/vid_voodoo_codegen_x86-64.h b/src/include/86box/vid_voodoo_codegen_x86-64.h index fa973c5ff..632eacfb4 100644 --- a/src/include/86box/vid_voodoo_codegen_x86-64.h +++ b/src/include/86box/vid_voodoo_codegen_x86-64.h @@ -20,6 +20,11 @@ #define LOD_MASK (LOD_TMIRROR_S | LOD_TMIRROR_T) +/* Suppress a false positive warning on gcc that causes excessive build log spam */ +#if __GNUC__ >= 10 +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + typedef struct voodoo_x86_data_t { uint8_t code_block[BLOCK_SIZE]; diff --git a/src/include/86box/vid_voodoo_codegen_x86.h b/src/include/86box/vid_voodoo_codegen_x86.h index e1afdd163..6bde2c0c6 100644 --- a/src/include/86box/vid_voodoo_codegen_x86.h +++ b/src/include/86box/vid_voodoo_codegen_x86.h @@ -20,6 +20,11 @@ #define LOD_MASK (LOD_TMIRROR_S | LOD_TMIRROR_T) +/* Suppress a false positive warning on gcc that causes excessive build log spam */ +#if __GNUC__ >= 10 +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + typedef struct voodoo_x86_data_t { uint8_t code_block[BLOCK_SIZE]; diff --git a/src/include/86box/win.h b/src/include/86box/win.h index 5e9f67b36..bb5a78990 100644 --- a/src/include/86box/win.h +++ b/src/include/86box/win.h @@ -120,7 +120,6 @@ extern uint8_t filterindex; extern void ResizeWindowByClientArea(HWND hwnd, int width, int height); -extern void InitCrashDump(void); /* Emulator start/stop support functions. */ extern void do_start(void); diff --git a/src/include_make/86box/version.h b/src/include_make/86box/version.h index 1dc91bfeb..8bf418791 100644 --- a/src/include_make/86box/version.h +++ b/src/include_make/86box/version.h @@ -20,11 +20,11 @@ #define EMU_NAME "86Box" #define EMU_NAME_W LSTR(EMU_NAME) -#define EMU_VERSION "3.3" +#define EMU_VERSION "3.4" #define EMU_VERSION_W LSTR(EMU_VERSION) -#define EMU_VERSION_EX "3.30" +#define EMU_VERSION_EX "3.40" #define EMU_VERSION_MAJ 3 -#define EMU_VERSION_MIN 3 +#define EMU_VERSION_MIN 4 #define EMU_VERSION_PATCH 0 #define EMU_BUILD_NUM 0 diff --git a/src/mac/CMakeLists.txt b/src/mac/CMakeLists.txt index ae3837f0e..2fdc2363a 100644 --- a/src/mac/CMakeLists.txt +++ b/src/mac/CMakeLists.txt @@ -29,7 +29,7 @@ else() endif() target_link_libraries(86Box "-framework AppKit") -target_sources(86Box PRIVATE macOSXGlue.m ${APP_ICON_MACOSX}) +target_sources(86Box PRIVATE ${APP_ICON_MACOSX}) # Make sure the icon is copied to the bundle set_source_files_properties(${APP_ICON_MACOSX} @@ -48,7 +48,6 @@ configure_file(Info.plist.in Info.plist @ONLY) set_target_properties(86Box PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist) -set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "-o linker-signed") -set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES") -set(XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-") +#set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES") +#set(XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-") #set(XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_SOURCE_DIR}/mac/codesign/dev/app.entitlements) diff --git a/src/machine/CMakeLists.txt b/src/machine/CMakeLists.txt index f642903ae..62bd5c61f 100644 --- a/src/machine/CMakeLists.txt +++ b/src/machine/CMakeLists.txt @@ -24,15 +24,19 @@ add_library(mch OBJECT machine.c machine_table.c m_xt.c m_xt_compaq.c m_at_sockets7.c m_at_socket8.c m_at_slot1.c m_at_slot2.c m_at_socket370.c m_at_misc.c) +if(AN430TX) + target_compile_definitions(mch PRIVATE USE_AN430TX) +endif() + +if(DESKPRO386) + target_compile_definitions(mch PRIVATE USE_DESKPRO386) +endif() + if(LASERXT) target_sources(mch PRIVATE m_xt_laserxt.c) target_compile_definitions(mch PRIVATE USE_LASERXT) endif() -if(NO_SIO) - target_compile_definitions(mch PRIVATE NO_SIO) -endif() - if(OPEN_AT) target_compile_definitions(mch PRIVATE USE_OPEN_AT) endif() diff --git a/src/machine/m_amstrad.c b/src/machine/m_amstrad.c index 511855ce9..e05d0d23e 100644 --- a/src/machine/m_amstrad.c +++ b/src/machine/m_amstrad.c @@ -669,7 +669,6 @@ vid_speed_change_1512(void *priv) recalc_timings_1512(vid); } - device_config_t vid_1512_config[] = { { .name = "display_type", @@ -720,7 +719,7 @@ device_config_t vid_1512_config[] = { { .description = "" } } }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_t vid_1512_device = { @@ -903,7 +902,7 @@ device_config_t vid_1640_config[] = { { .description = "" } } }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_t vid_1640_device = { @@ -1788,7 +1787,7 @@ device_config_t vid_200_config[] = { { .description = "" } } }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_t vid_200_device = { @@ -1892,7 +1891,7 @@ device_config_t vid_ppc512_config[] = { .default_string = "", .default_int = 0 }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_t vid_ppc512_device = { @@ -1930,7 +1929,7 @@ device_config_t vid_pc2086_config[] = { { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_t vid_pc2086_device = { @@ -1968,7 +1967,7 @@ device_config_t vid_pc3086_config[] = { { .description = "" } } }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_t vid_pc3086_device = { @@ -2348,7 +2347,16 @@ machine_amstrad_init(const machine_t *model, int type) memset(ams, 0x00, sizeof(amstrad_t)); ams->type = type; - device_add(&amstrad_nvr_device); + switch(type) { + case AMS_PC200: + case AMS_PPC512: + device_add(&amstrad_no_nmi_nvr_device); + break; + + default: + device_add(&amstrad_nvr_device); + break; + } machine_common_init(model); diff --git a/src/machine/m_at_compaq.c b/src/machine/m_at_compaq.c index 851230bc8..4f7181616 100644 --- a/src/machine/m_at_compaq.c +++ b/src/machine/m_at_compaq.c @@ -716,7 +716,7 @@ const device_config_t compaq_plasma_config[] = { { .description = "" } } }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_t compaq_plasma_device = { @@ -893,6 +893,7 @@ machine_at_portableiii386_init(const machine_t *model) return ret; } +#if defined(DEV_BRANCH) && defined(USE_DESKPRO386) int machine_at_deskpro386_init(const machine_t *model) { @@ -908,3 +909,4 @@ machine_at_deskpro386_init(const machine_t *model) return ret; } +#endif diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 39d872bd6..117f2cea8 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -689,7 +689,7 @@ machine_at_tx97_init(const machine_t *model) } -#if defined(DEV_BRANCH) && defined(NO_SIO) +#if defined(DEV_BRANCH) && defined(USE_AN430TX) int machine_at_an430tx_init(const machine_t *model) { diff --git a/src/machine/m_europc.c b/src/machine/m_europc.c index 921feda2b..2c035ded1 100644 --- a/src/machine/m_europc.c +++ b/src/machine/m_europc.c @@ -678,10 +678,10 @@ static const device_config_t europc_config[] = { .selection = { { .description = "Disabled (250h)", .value = 0 }, { .description = "Enabled (350h)", .value = 1 }, - { "" } + { .description = "" } }, }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; const device_t europc_device = { diff --git a/src/machine/m_pcjr.c b/src/machine/m_pcjr.c index c6b38d572..4836da1bc 100644 --- a/src/machine/m_pcjr.c +++ b/src/machine/m_pcjr.c @@ -784,7 +784,7 @@ static const device_config_t pcjr_config[] = { { .description = "" } } }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_t pcjr_device = { diff --git a/src/machine/m_ps1_hdc.c b/src/machine/m_ps1_hdc.c index 5cba0e8b5..e7cff2478 100644 --- a/src/machine/m_ps1_hdc.c +++ b/src/machine/m_ps1_hdc.c @@ -82,9 +82,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define __USE_LARGEFILE64 -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE #include #include #include diff --git a/src/machine/m_ps2_mca.c b/src/machine/m_ps2_mca.c index f74f03dad..094487d37 100644 --- a/src/machine/m_ps2_mca.c +++ b/src/machine/m_ps2_mca.c @@ -401,7 +401,10 @@ static void model_50_write(uint16_t port, uint8_t val) static void model_55sx_mem_recalc(void) { - int i, j, state, enabled_mem = 0; + int i, j, state; +#ifdef ENABLE_PS2_MCA_LOG + int enabled_mem = 0; +#endif int base = 0, remap_size = (ps2.option[3] & 0x10) ? 384 : 256; int bit_mask = 0x00, max_rows = 4; int bank_to_rows[16] = { 4, 2, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0 }; @@ -424,14 +427,18 @@ static void model_55sx_mem_recalc(void) if (ps2.memory_bank[i] & (1 << j)) { ps2_mca_log("Set memory at %06X-%06X to internal\n", (base * 1024), (base * 1024) + (((base > 0) ? 1024 : 640) * 1024) - 1); mem_set_mem_state(base * 1024, ((base > 0) ? 1024 : 640) * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL); +#ifdef ENABLE_PS2_MCA_LOG enabled_mem += 1024; +#endif bit_mask |= (1 << (j + (i << 2))); } base += 1024; } } +#ifdef ENABLE_PS2_MCA_LOG ps2_mca_log("Enabled memory: %i kB (%02X)\n", enabled_mem, bit_mask); +#endif if (ps2.option[3] & 0x10) { @@ -1348,7 +1355,7 @@ machine_ps2_common_init(const machine_t *model) dma16_init(); ps2_dma_init(); - device_add(&ps_nvr_device); + device_add(&ps_no_nmi_nvr_device); pic2_init(); pit_ps2_init(); diff --git a/src/machine/m_tandy.c b/src/machine/m_tandy.c index 894cae784..39e5fe844 100644 --- a/src/machine/m_tandy.c +++ b/src/machine/m_tandy.c @@ -1157,7 +1157,7 @@ static const device_config_t vid_config[] = { { .description = "" } } }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_t vid_device = { diff --git a/src/machine/m_xt_olivetti.c b/src/machine/m_xt_olivetti.c index 9cb6bfc68..a8743cfc5 100644 --- a/src/machine/m_xt_olivetti.c +++ b/src/machine/m_xt_olivetti.c @@ -586,7 +586,6 @@ m19_vid_init(m19_vid_t *vid) device_context_restore(); } - const device_t m24_kbd_device = { .name = "Olivetti M24 keyboard and mouse", .internal_name = "m24_kbd", @@ -616,7 +615,7 @@ const device_config_t m19_vid_config[] = { { .description = "Green Monochrome", .value = 1 }, { .description = "Amber Monochrome", .value = 2 }, { .description = "Gray Monochrome", .value = 3 }, - { .description = "" } + { .description = "" } } }, { @@ -626,7 +625,7 @@ const device_config_t m19_vid_config[] = { .default_string = "", .default_int = 1, }, - { .name = "", .description = "", .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; const device_t m19_vid_device = { diff --git a/src/machine/m_xt_t1000_vid.c b/src/machine/m_xt_t1000_vid.c index b2dcce64d..817b54042 100644 --- a/src/machine/m_xt_t1000_vid.c +++ b/src/machine/m_xt_t1000_vid.c @@ -745,16 +745,9 @@ static const device_config_t t1000_config[] = { .name = "display_language", .description = "Language", .type = CONFIG_SELECTION, - .selection = - { - { - .description = "USA", - .value = 0 - }, - { - .description = "Danish", - .value = 1 - } + .selection = { + { .description = "USA", .value = 0 }, + { .description = "Danish", .value = 1 } }, .default_int = 0 }, @@ -763,7 +756,8 @@ static const device_config_t t1000_config[] = { .description = "Enable backlight", .type = CONFIG_BINARY, .default_string = "", - .default_int = 1 }, + .default_int = 1 + }, { .name = "invert", .description = "Invert colors", @@ -771,7 +765,7 @@ static const device_config_t t1000_config[] = { .default_string = "", .default_int = 0 }, - { .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; const device_t t1000_video_device = { diff --git a/src/machine/m_xt_xi8088.c b/src/machine/m_xt_xi8088.c index ea778a023..ef5d45163 100644 --- a/src/machine/m_xt_xi8088.c +++ b/src/machine/m_xt_xi8088.c @@ -160,7 +160,7 @@ static const device_config_t xi8088_config[] = { .type = CONFIG_BINARY, .default_int = 0 }, - { .type = -1 } + { .name = "", .description = "", .type = CONFIG_END } }; const device_t xi8088_device = { diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index feddea136..373b75bb2 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -1,25 +1,25 @@ /* - * 86Box A hypervisor and IBM PC system emulator that specializes in - * running old operating systems and software designed for IBM - * PC systems and compatibles from 1981 through fairly recent - * system designs based on the PCI bus. + * 86Box A hypervisor and IBM PC system emulator that specializes in + * running old operating systems and software designed for IBM + * PC systems and compatibles from 1981 through fairly recent + * system designs based on the PCI bus. * - * This file is part of the 86Box distribution. + * This file is part of the 86Box distribution. * - * Handling of the emulated machines. + * Handling of the emulated machines. * - * NOTES: OpenAT wip for 286-class machine with open BIOS. - * PS2_M80-486 wip, pending receipt of TRM's for machine. + * NOTES: OpenAT wip for 286-class machine with open BIOS. + * PS2_M80-486 wip, pending receipt of TRM's for machine. * * * - * Authors: Sarah Walker, - * Miran Grca, - * Fred N. van Kempen, + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, * - * Copyright 2008-2020 Sarah Walker. - * Copyright 2016-2020 Miran Grca. - * Copyright 2017-2020 Fred N. van Kempen. + * Copyright 2008-2020 Sarah Walker. + * Copyright 2016-2020 Miran Grca. + * Copyright 2017-2020 Fred N. van Kempen. */ #include #include @@ -32,300 +32,379 @@ #include <86box/device.h> #include <86box/machine.h> - -const machine_type_t machine_types[] = { - { "None", MACHINE_TYPE_NONE }, - { "8088", MACHINE_TYPE_8088 }, - { "8086", MACHINE_TYPE_8086 }, - { "80286", MACHINE_TYPE_286 }, - { "i386SX", MACHINE_TYPE_386SX }, - { "486SLC", MACHINE_TYPE_486SLC }, - { "i386DX", MACHINE_TYPE_386DX }, - { "i386DX/i486", MACHINE_TYPE_386DX_486 }, - { "i486 (Socket 168 and 1)", MACHINE_TYPE_486 }, - { "i486 (Socket 2)", MACHINE_TYPE_486_S2 }, - { "i486 (Socket 3)", MACHINE_TYPE_486_S3 }, - { "i486 (Miscellaneous)", MACHINE_TYPE_486_MISC }, - { "Socket 4", MACHINE_TYPE_SOCKET4 }, - { "Socket 5", MACHINE_TYPE_SOCKET5 }, - { "Socket 7 (Single Voltage)", MACHINE_TYPE_SOCKET7_3V }, - { "Socket 7 (Dual Voltage)", MACHINE_TYPE_SOCKET7 }, - { "Super Socket 7", MACHINE_TYPE_SOCKETS7 }, - { "Socket 8", MACHINE_TYPE_SOCKET8 }, - { "Slot 1", MACHINE_TYPE_SLOT1 }, - { "Slot 1/2", MACHINE_TYPE_SLOT1_2 }, - { "Slot 1/Socket 370", MACHINE_TYPE_SLOT1_370 }, - { "Slot 2", MACHINE_TYPE_SLOT2 }, - { "Socket 370", MACHINE_TYPE_SOCKET370 }, - { "Miscellaneous", MACHINE_TYPE_MISC } +const machine_filter_t machine_types[] = { + { "None", MACHINE_TYPE_NONE }, + { "8088", MACHINE_TYPE_8088 }, + { "8086", MACHINE_TYPE_8086 }, + { "80286", MACHINE_TYPE_286 }, + { "i386SX", MACHINE_TYPE_386SX }, + { "486SLC", MACHINE_TYPE_486SLC }, + { "i386DX", MACHINE_TYPE_386DX }, + { "i386DX/i486", MACHINE_TYPE_386DX_486 }, + { "i486 (Socket 168 and 1)", MACHINE_TYPE_486 }, + { "i486 (Socket 2)", MACHINE_TYPE_486_S2 }, + { "i486 (Socket 3)", MACHINE_TYPE_486_S3 }, + { "i486 (Miscellaneous)", MACHINE_TYPE_486_MISC }, + { "Socket 4", MACHINE_TYPE_SOCKET4 }, + { "Socket 5", MACHINE_TYPE_SOCKET5 }, + { "Socket 7 (Single Voltage)", MACHINE_TYPE_SOCKET7_3V }, + { "Socket 7 (Dual Voltage)", MACHINE_TYPE_SOCKET7 }, + { "Super Socket 7", MACHINE_TYPE_SOCKETS7 }, + { "Socket 8", MACHINE_TYPE_SOCKET8 }, + { "Slot 1", MACHINE_TYPE_SLOT1 }, + { "Slot 1/2", MACHINE_TYPE_SLOT1_2 }, + { "Slot 1/Socket 370", MACHINE_TYPE_SLOT1_370 }, + { "Slot 2", MACHINE_TYPE_SLOT2 }, + { "Socket 370", MACHINE_TYPE_SOCKET370 }, + { "Miscellaneous", MACHINE_TYPE_MISC } }; +const machine_filter_t machine_chipsets[] = { + { "None", MACHINE_CHIPSET_NONE }, + { "Discrete", MACHINE_CHIPSET_DISCRETE }, + { "Proprietary", MACHINE_CHIPSET_PROPRIETARY }, + { "Headland GC100A", MACHINE_CHIPSET_GC100A }, + { "Headland GC103", MACHINE_CHIPSET_GC103 }, + { "Headland HT18", MACHINE_CHIPSET_HT18 }, + { "ACC 2168", MACHINE_CHIPSET_ACC_2168 }, + { "ALi M1217", MACHINE_CHIPSET_ALI_M1217 }, + { "ALi M6117", MACHINE_CHIPSET_ALI_M6117 }, + { "ALi M1409", MACHINE_CHIPSET_ALI_M1409 }, + { "ALi M1429", MACHINE_CHIPSET_ALI_M1429 }, + { "ALi M1429G", MACHINE_CHIPSET_ALI_M1429G }, + { "ALi M1489", MACHINE_CHIPSET_ALI_M1489 }, + { "ALi ALADDiN IV+", MACHINE_CHIPSET_ALI_ALADDIN_IV_PLUS }, + { "ALi ALADDiN V", MACHINE_CHIPSET_ALI_ALADDIN_V }, + { "ALi ALADDiN-PRO II", MACHINE_CHIPSET_ALI_ALADDIN_PRO_II }, + { "C&T 82C235 SCAT", MACHINE_CHIPSET_SCAT }, + { "C&T CS8121 NEAT", MACHINE_CHIPSET_NEAT }, + { "C&T 386", MACHINE_CHIPSET_CT_386 }, + { "C&T CS4031", MACHINE_CHIPSET_CT_CS4031 }, + { "Contaq 82C596", MACHINE_CHIPSET_CONTAQ_82C596 }, + { "Contaq 82C597", MACHINE_CHIPSET_CONTAQ_82C597 }, + { "IMS 8848", MACHINE_CHIPSET_IMS_8848 }, + { "Intel 82335", MACHINE_CHIPSET_INTEL_82335 }, + { "Intel 420TX", MACHINE_CHIPSET_INTEL_420TX }, + { "Intel 420ZX", MACHINE_CHIPSET_INTEL_420ZX }, + { "Intel 420EX", MACHINE_CHIPSET_INTEL_420EX }, + { "Intel 430LX", MACHINE_CHIPSET_INTEL_430LX }, + { "Intel 430NX", MACHINE_CHIPSET_INTEL_430NX }, + { "Intel 430FX", MACHINE_CHIPSET_INTEL_430FX }, + { "Intel 430HX", MACHINE_CHIPSET_INTEL_430HX }, + { "Intel 430VX", MACHINE_CHIPSET_INTEL_430VX }, + { "Intel 430TX", MACHINE_CHIPSET_INTEL_430TX }, + { "Intel 450KX", MACHINE_CHIPSET_INTEL_450KX }, + { "Intel 440FX", MACHINE_CHIPSET_INTEL_440FX }, + { "Intel 440LX", MACHINE_CHIPSET_INTEL_440LX }, + { "Intel 440EX", MACHINE_CHIPSET_INTEL_440EX }, + { "Intel 440BX", MACHINE_CHIPSET_INTEL_440BX }, + { "Intel 440ZX", MACHINE_CHIPSET_INTEL_440ZX }, + { "Intel 440GX", MACHINE_CHIPSET_INTEL_440GX }, + { "OPTi 283", MACHINE_CHIPSET_OPTI_283 }, + { "OPTi 291", MACHINE_CHIPSET_OPTI_291 }, + { "OPTi 493", MACHINE_CHIPSET_OPTI_493 }, + { "OPTi 495", MACHINE_CHIPSET_OPTI_495 }, + { "OPTi 499", MACHINE_CHIPSET_OPTI_499 }, + { "OPTi 895/802G", MACHINE_CHIPSET_OPTI_895_802G }, + { "OPTi 547/597", MACHINE_CHIPSET_OPTI_547_597 }, + { "SARC RC2016A", MACHINE_CHIPSET_SARC_RC2016A }, + { "SiS 310", MACHINE_CHIPSET_SIS_310 }, + { "SiS 401", MACHINE_CHIPSET_SIS_401 }, + { "SiS 460", MACHINE_CHIPSET_SIS_460 }, + { "SiS 461", MACHINE_CHIPSET_SIS_461 }, + { "SiS 471", MACHINE_CHIPSET_SIS_471 }, + { "SiS 496", MACHINE_CHIPSET_SIS_496 }, + { "SiS 501", MACHINE_CHIPSET_SIS_501 }, + { "SiS 5511", MACHINE_CHIPSET_SIS_5511 }, + { "SiS 5571", MACHINE_CHIPSET_SIS_5571 }, + { "SMSC VictoryBX-66", MACHINE_CHIPSET_SMSC_VICTORYBX_66 }, + { "STPC Client", MACHINE_CHIPSET_STPC_CLIENT }, + { "STPC Consumer-II", MACHINE_CHIPSET_STPC_CONSUMER_II }, + { "STPC Elite", MACHINE_CHIPSET_STPC_ELITE }, + { "STPC Atlas", MACHINE_CHIPSET_STPC_ATLAS }, + { "Symphony SL82C460 Haydn II", MACHINE_CHIPSET_SYMPHONY_SL82C460 }, + { "UMC UM82C480", MACHINE_CHIPSET_UMC_UM82C480 }, + { "UMC UM82C491", MACHINE_CHIPSET_UMC_UM82C491 }, + { "UMC UM8881", MACHINE_CHIPSET_UMC_UM8881 }, + { "UMC UM8890BF", MACHINE_CHIPSET_UMC_UM8890BF }, + { "VIA VT82C495", MACHINE_CHIPSET_VIA_VT82C495 }, + { "VIA VT82C496G", MACHINE_CHIPSET_VIA_VT82C496G }, + { "VIA Apollo VPX", MACHINE_CHIPSET_VIA_APOLLO_VPX }, + { "VIA Apollo VP3", MACHINE_CHIPSET_VIA_APOLLO_VP3 }, + { "VIA Apollo MVP3", MACHINE_CHIPSET_VIA_APOLLO_MVP3 }, + { "VIA Apollo Pro", MACHINE_CHIPSET_VIA_APOLLO_PRO }, + { "VIA Apollo Pro 133", MACHINE_CHIPSET_VIA_APOLLO_PRO_133 }, + { "VIA Apollo Pro 133A", MACHINE_CHIPSET_VIA_APOLLO_PRO_133A }, + { "VLSI SCAMP", MACHINE_CHIPSET_VLSI_SCAMP }, + { "VLSI VL82C480", MACHINE_CHIPSET_VLSI_VL82C480 }, + { "VLSI VL82C481", MACHINE_CHIPSET_VLSI_VL82C481 }, + { "VLSI VL82C486", MACHINE_CHIPSET_VLSI_VL82C486 }, + { "WD76C10", MACHINE_CHIPSET_WD76C10 } +}; /* Machines to add before machine freeze: - PCChips M773 (440BX + SMSC with AMI BIOS); - - Rise R418 (was removed on my end, has to be re-added); - TMC Mycomp PCI54ST; - Zeos Quadtel 486. NOTE: The AMI MegaKey tests were done on a real Intel Advanced/ATX - (thanks, MrKsoft for running my AMIKEY.COM on it), but the - technical specifications of the other Intel machines confirm - that the other boards also have the MegaKey. + (thanks, MrKsoft for running my AMIKEY.COM on it), but the + technical specifications of the other Intel machines confirm + that the other boards also have the MegaKey. NOTE: The later (ie. not AMI Color) Intel AMI BIOS'es execute a - sequence of commands (B8, BA, BB) during one of the very first - phases of POST, in a way that is only valid on the AMIKey-3 - KBC firmware, that includes the Classic PCI/ED (Ninja) BIOS - which otherwise does not execute any AMI KBC commands, which - indicates that the sequence is a leftover of whatever AMI - BIOS (likely a laptop one since the AMIKey-3 is a laptop KBC - firmware!) Intel forked. + sequence of commands (B8, BA, BB) during one of the very first + phases of POST, in a way that is only valid on the AMIKey-3 + KBC firmware, that includes the Classic PCI/ED (Ninja) BIOS + which otherwise does not execute any AMI KBC commands, which + indicates that the sequence is a leftover of whatever AMI + BIOS (likely a laptop one since the AMIKey-3 is a laptop KBC + firmware!) Intel forked. NOTE: The VIA VT82C42N returns 0x46 ('F') in command 0xA1 (so it - emulates the AMI KF/AMIKey KBC firmware), and 0x42 ('B') in - command 0xAF. - The version on the VIA VT82C686B southbridge also returns - 'F' in command 0xA1, but 0x45 ('E') in command 0xAF. - The version on the VIA VT82C586B southbridge also returns - 'F' in command 0xA1, but 0x44 ('D') in command 0xAF. - The version on the VIA VT82C586A southbridge also returns - 'F' in command 0xA1, but 0x43 ('C') in command 0xAF. + emulates the AMI KF/AMIKey KBC firmware), and 0x42 ('B') in + command 0xAF. + The version on the VIA VT82C686B southbridge also returns + 'F' in command 0xA1, but 0x45 ('E') in command 0xAF. + The version on the VIA VT82C586B southbridge also returns + 'F' in command 0xA1, but 0x44 ('D') in command 0xAF. + The version on the VIA VT82C586A southbridge also returns + 'F' in command 0xA1, but 0x43 ('C') in command 0xAF. NOTE: The AMI MegaKey commands blanked in the technical reference - are CC and and C4, which are Set P14 High and Set P14 Low, - respectively. Also, AMI KBC command C1, mysteriously missing - from the technical references of AMI MegaKey and earlier, is - Write Input Port, same as on AMIKey-3. - - Machines to remove: - - Hedaka HED-919. + are CC and and C4, which are Set P14 High and Set P14 Low, + respectively. Also, AMI KBC command C1, mysteriously missing + from the technical references of AMI MegaKey and earlier, is + Write Input Port, same as on AMIKey-3. */ const machine_t machines[] = { /* 8088 Machines */ - { "[8088] IBM PC (1981)", "ibmpc", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 16, 64, 16, 0, machine_pc_init, NULL }, - { "[8088] IBM PC (1982)", "ibmpc82", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 256, 64, 0, machine_pc82_init, NULL }, - { "[8088] IBM PCjr", "ibmpcjr", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 4772728, 4772728, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO_FIXED | MACHINE_CARTRIDGE, 128, 640, 128, 0, machine_pcjr_init, pcjr_get_device }, - { "[8088] IBM XT (1982)", "ibmxt", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 256, 64, 0, machine_xt_init, NULL }, - { "[8088] IBM XT (1986)", "ibmxt86", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 256, 640, 64, 0, machine_xt86_init, NULL }, - { "[8088] American XT Computer", "americxt", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 640, 64, 0, machine_xt_americxt_init, NULL }, - { "[8088] AMI XT clone", "amixt", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 640, 64, 0, machine_xt_amixt_init, NULL }, - { "[8088] Columbia Data Products MPC-1600", "mpc1600", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 512, 64, 0, machine_xt_mpc1600_init, NULL }, - { "[8088] Compaq Portable", "portable", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 640, 128, 0, machine_xt_compaq_portable_init, NULL }, - { "[8088] DTK PIM-TB10-Z", "dtk", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 640, 64, 0, machine_xt_dtk_init, NULL }, - { "[8088] Eagle PC Spirit", "pcspirit", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 640, 64, 0, machine_xt_pcspirit_init, NULL }, - { "[8088] Generic XT clone", "genxt", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 640, 64, 0, machine_genxt_init, NULL }, - { "[8088] Juko ST", "jukopc", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 640, 64, 0, machine_xt_jukopc_init, NULL }, - { "[8088] Multitech PC-500", "pc500", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 640, 64, 0, machine_xt_pc500_init, NULL }, - { "[8088] Multitech PC-700", "pc700", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 640, 64, 0, machine_xt_pc700_init, NULL }, - { "[8088] NCR PC4i", "pc4i", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 256, 640, 256, 0, machine_xt_pc4i_init, NULL }, - { "[8088] Olivetti M19", "m19", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 4772728, 7159092, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO_FIXED, 256, 640, 256, 0, machine_xt_m19_init, m19_get_device }, - { "[8088] OpenXT", "openxt", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 640, 64, 0, machine_xt_openxt_init, NULL }, - { "[8088] Philips P3105/NMS9100", "p3105", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_XTA, 256, 768, 256, 0, machine_xt_p3105_init, NULL }, - { "[8088] Phoenix XT clone", "pxxt", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 640, 64, 0, machine_xt_pxxt_init, NULL }, - { "[8088] Schneider EuroPC", "europc", MACHINE_TYPE_8088, CPU_PKG_8088_EUROPC, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_XTA | MACHINE_MOUSE, 512, 640, 128, 15, machine_europc_init, NULL }, - { "[8088] Super PC/Turbo XT", "pcxt", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 640, 64, 0, machine_xt_pcxt_init, NULL }, - { "[8088] Tandy 1000", "tandy", MACHINE_TYPE_8088, CPU_PKG_8088_EUROPC, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO_FIXED, 128, 640, 128, 0, machine_tandy_init, tandy1k_get_device }, - { "[8088] Tandy 1000 HX", "tandy1000hx", MACHINE_TYPE_8088, CPU_PKG_8088_EUROPC, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO_FIXED, 256, 640, 128, 0, machine_tandy1000hx_init, tandy1k_hx_get_device }, - { "[8088] Toshiba T1000", "t1000", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO, 512, 1280, 768, 63, machine_xt_t1000_init, t1000_get_device }, - { "[8088] Vendex HeadStart Turbo 888-XT","vendex", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 256, 768, 256, 0, machine_xt_vendex_init, NULL }, + { "[8088] IBM PC (1981)", "ibmpc", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_pc_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 16, 64, 16, 0, NULL, NULL }, + { "[8088] IBM PC (1982)", "ibmpc82", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_pc82_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 256, 64, 0, NULL, NULL }, + { "[8088] IBM PCjr", "ibmpcjr", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_pcjr_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 4772728, 4772728, 0, 0, 0, 0, MACHINE_PCJR, MACHINE_VIDEO_FIXED, 128, 640, 128, 0, pcjr_get_device, NULL }, + { "[8088] IBM XT (1982)", "ibmxt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 256, 64, 0, NULL, NULL }, + { "[8088] IBM XT (1986)", "ibmxt86", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt86_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 256, 640, 64, 0, NULL, NULL }, + { "[8088] American XT Computer", "americxt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_americxt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL }, + { "[8088] AMI XT clone", "amixt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_amixt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL }, + { "[8088] Columbia Data Products MPC-1600", "mpc1600", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_mpc1600_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 512, 64, 0, NULL, NULL }, + { "[8088] Compaq Portable", "portable", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_compaq_portable_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL }, + { "[8088] DTK PIM-TB10-Z", "dtk", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_dtk_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL }, + { "[8088] Eagle PC Spirit", "pcspirit", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_pcspirit_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 64, 0, NULL, NULL }, + { "[8088] Generic XT clone", "genxt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_genxt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL }, + { "[8088] Juko ST", "jukopc", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_jukopc_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL }, + { "[8088] Multitech PC-500", "pc500", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_pc500_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 64, 0, NULL, NULL }, + { "[8088] Multitech PC-700", "pc700", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_pc700_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 64, 0, NULL, NULL }, + { "[8088] NCR PC4i", "pc4i", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_pc4i_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 256, 640, 256, 0, NULL, NULL }, + { "[8088] Olivetti M19", "m19", MACHINE_TYPE_8088, MACHINE_CHIPSET_PROPRIETARY, machine_xt_m19_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 4772728, 7159092, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 256, 640, 256, 0, m19_get_device, NULL }, + { "[8088] OpenXT", "openxt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_openxt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL }, + { "[8088] Philips P3105/NMS9100", "p3105", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_p3105_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_XTA, 256, 768, 256, 0, NULL, NULL }, + { "[8088] Phoenix XT clone", "pxxt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_pxxt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL }, + { "[8088] Schneider EuroPC", "europc", MACHINE_TYPE_8088, MACHINE_CHIPSET_PROPRIETARY, machine_europc_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088_EUROPC, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_XTA | MACHINE_MOUSE, 512, 640, 128, 15, NULL, NULL }, + { "[8088] Super PC/Turbo XT", "pcxt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_pcxt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL }, + { "[8088] Tandy 1000", "tandy", MACHINE_TYPE_8088, MACHINE_CHIPSET_PROPRIETARY, machine_tandy_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088_EUROPC, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 128, 640, 128, 0, tandy1k_get_device, NULL }, + { "[8088] Tandy 1000 HX", "tandy1000hx", MACHINE_TYPE_8088, MACHINE_CHIPSET_PROPRIETARY, machine_tandy1000hx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088_EUROPC, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 256, 640, 128, 0, tandy1k_hx_get_device, NULL }, + { "[8088] Toshiba T1000", "t1000", MACHINE_TYPE_8088, MACHINE_CHIPSET_PROPRIETARY, machine_xt_t1000_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO, 512, 1280, 768, 63, t1000_get_device, NULL }, + { "[8088] Vendex HeadStart Turbo 888-XT", "vendex", MACHINE_TYPE_8088, MACHINE_CHIPSET_PROPRIETARY, machine_xt_vendex_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 256, 768, 256, 0, NULL, NULL }, #if defined(DEV_BRANCH) && defined(USE_LASERXT) - { "[8088] VTech Laser Turbo XT", "ltxt", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 256, 640, 256, 0, machine_xt_laserxt_init, NULL }, + { "[8088] VTech Laser Turbo XT", "ltxt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_laserxt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 256, 640, 256, 0,NULL, NULL }, #endif /* Has a standard PS/2 KBC (so, use IBM PS/2 Type 1). */ - { "[8088] Xi8088", "xi8088", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2, 64, 1024, 128, 127, machine_xt_xi8088_init, xi8088_get_device }, - { "[8088] Z-NIX PC-1600", "znic", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 64, 640, 64, 0, machine_xt_znic_init, NULL }, - { "[8088] Zenith Data Systems Z-151/152/161","zdsz151", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 640, 64, 0, machine_xt_z151_init, NULL }, - { "[8088] Zenith Data Systems Z-159", "zdsz159", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 640, 64, 0, machine_xt_z159_init, NULL }, - { "[8088] Zenith Data Systems SupersPort (Z-184)","zdsupers", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO_FIXED, 128, 640, 128, 0, machine_xt_z184_init, z184_get_device }, - { "[GC100A] Philips P3120", "p3120", MACHINE_TYPE_8088, CPU_PKG_8088, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_XTA, 256, 768, 256, 0, machine_xt_p3120_init, NULL }, + { "[8088] Xi8088", "xi8088", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_xi8088_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_FLAGS_NONE, 64, 1024, 128, 127, xi8088_get_device, NULL }, + { "[8088] Z-NIX PC-1600", "znic", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_znic_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL }, + { "[8088] Zenith Data Systems Z-151/152/161", "zdsz151", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z151_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 64, 0, NULL, NULL }, + { "[8088] Zenith Data Systems Z-159", "zdsz159", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z159_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 64, 0, NULL, NULL }, + { "[8088] Zenith Data Systems SupersPort (Z-184)", "zdsupers", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z184_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 128, 640, 128, 0, z184_get_device, NULL }, + { "[GC100A] Philips P3120", "p3120", MACHINE_TYPE_8088, MACHINE_CHIPSET_GC100A, machine_xt_p3120_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_XTA, 256, 768, 256, 0, NULL, NULL }, /* 8086 Machines */ - { "[8086] Amstrad PC1512", "pc1512", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 8000000, 8000000, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 512, 640, 128, 63, machine_pc1512_init, pc1512_get_device }, - { "[8086] Amstrad PC1640", "pc1640", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO | MACHINE_MOUSE, 640, 640, 640, 63, machine_pc1640_init, pc1640_get_device }, - { "[8086] Amstrad PC2086", "pc2086", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, machine_pc2086_init, pc2086_get_device }, - { "[8086] Amstrad PC3086", "pc3086", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, machine_pc3086_init, pc3086_get_device }, - { "[8086] Amstrad PC20(0)", "pc200", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO | MACHINE_MOUSE | MACHINE_NONMI, 512, 640, 128, 63, machine_pc200_init, pc200_get_device }, - { "[8086] Amstrad PPC512/640", "ppc512", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO | MACHINE_MOUSE | MACHINE_NONMI, 512, 640, 128, 63, machine_ppc512_init, ppc512_get_device }, - { "[8086] Compaq Deskpro", "deskpro", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 640, 128, 0, machine_xt_compaq_deskpro_init, NULL }, - { "[8086] Olivetti M21/24/24SP", "m24", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO | MACHINE_MOUSE, 128, 640, 128, 0, machine_xt_m24_init, m24_get_device }, + { "[8086] Amstrad PC1512", "pc1512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 8000000, 8000000, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 512, 640, 128, 63, pc1512_get_device, NULL }, + { "[8086] Amstrad PC1640", "pc1640", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 640, 640, 640, 63, pc1640_get_device, NULL }, + { "[8086] Amstrad PC2086", "pc2086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc2086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc2086_get_device, NULL }, + { "[8086] Amstrad PC3086", "pc3086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc3086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc3086_get_device, NULL }, + { "[8086] Amstrad PC20(0)", "pc200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, pc200_get_device, NULL }, + { "[8086] Amstrad PPC512/640", "ppc512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_ppc512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, ppc512_get_device, NULL }, + { "[8086] Compaq Deskpro", "deskpro", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_compaq_deskpro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL }, + { "[8086] Olivetti M21/24/24SP", "m24", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_m24_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 128, 640, 128, 0, m24_get_device, NULL }, /* Has Olivetti KBC firmware. */ - { "[8086] Olivetti M240", "m240", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 640, 128, 0, machine_xt_m240_init, NULL }, - { "[8086] Schetmash Iskra-3104", "iskra3104", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 128, 640, 128, 0, machine_xt_iskra3104_init, NULL }, - { "[8086] Tandy 1000 SL/2", "tandy1000sl2", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO_FIXED, 512, 768, 128, 0, machine_tandy1000sl2_init, tandy1k_sl_get_device }, - { "[8086] Victor V86P", "v86p", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO, 512, 1024, 128, 127, machine_v86p_init, NULL }, - { "[8086] Toshiba T1200", "t1200", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC | MACHINE_VIDEO, 1024, 2048,1024, 63, machine_xt_t1200_init, t1200_get_device }, + { "[8086] Olivetti M240", "m240", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_m240_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL }, + { "[8086] Schetmash Iskra-3104", "iskra3104", MACHINE_TYPE_8086, MACHINE_CHIPSET_DISCRETE, machine_xt_iskra3104_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL }, + { "[8086] Tandy 1000 SL/2", "tandy1000sl2", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_tandy1000sl2_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 512, 768, 128, 0, tandy1k_sl_get_device, NULL }, + { "[8086] Victor V86P", "v86p", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_v86p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO, 512, 1024, 128, 127, NULL, NULL }, + { "[8086] Toshiba T1200", "t1200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_t1200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO, 1024, 2048,1024, 63, t1200_get_device, NULL }, #if defined(DEV_BRANCH) && defined(USE_LASERXT) - { "[8086] VTech Laser XT3", "lxt3", MACHINE_TYPE_8086, CPU_PKG_8086, 0, 0, 0, 0, 0, 0, 0, MACHINE_PC, 256, 640, 256, 0, machine_xt_lxt3_init, NULL }, + { "[8086] VTech Laser XT3", "lxt3", MACHINE_TYPE_8086, MACHINE_CHIPSET_DISCRETE, machine_xt_lxt3_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 256, 640, 256, 0, NULL, NULL }, #endif /* 286 AT machines */ /* Has IBM AT KBC firmware. */ - { "[ISA] IBM AT", "ibmat", MACHINE_TYPE_286, CPU_PKG_286, 0, 6000000, 8000000, 0, 0, 0, 0, MACHINE_AT, 256, 15872, 128, 63, machine_at_ibm_init, NULL }, + { "[ISA] IBM AT", "ibmat", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_ibm_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 6000000, 8000000, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 256, 15872, 128, 63, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[ISA] IBM PS/1 model 2011", "ibmps1es", MACHINE_TYPE_286, CPU_PKG_286, 0, 10000000, 10000000, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_XTA | MACHINE_VIDEO_FIXED, 512, 16384, 512, 63, machine_ps1_m2011_init, NULL }, + { "[ISA] IBM PS/1 model 2011", "ibmps1es", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_ps1_m2011_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 10000000, 10000000, 0, 0, 0, 0, MACHINE_PS2, MACHINE_XTA | MACHINE_VIDEO_FIXED, 512, 16384, 512, 63, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[ISA] IBM PS/2 model 30-286", "ibmps2_m30_286", MACHINE_TYPE_286, CPU_PKG_286 | CPU_PKG_486SLC_IBM, 0, 10000000, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_XTA | MACHINE_VIDEO_FIXED, 1024, 16384,1024, 127, machine_ps2_m30_286_init, NULL }, + { "[ISA] IBM PS/2 model 30-286", "ibmps2_m30_286", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_ps2_m30_286_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286 | CPU_PKG_486SLC_IBM, CPU_BLOCK_NONE, 10000000, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_XTA | MACHINE_VIDEO_FIXED, 1024, 16384,1024, 127, NULL, NULL }, /* Has IBM AT KBC firmware. */ - { "[ISA] IBM XT Model 286", "ibmxt286", MACHINE_TYPE_286, CPU_PKG_286, 0, 6000000, 6000000, 0, 0, 0, 0, MACHINE_AT, 256, 15872, 128, 127, machine_at_ibmxt286_init, NULL }, + { "[ISA] IBM XT Model 286", "ibmxt286", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_ibmxt286_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 6000000, 6000000, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 256, 15872, 128, 127, NULL, NULL }, /* AMI BIOS for a chipset-less machine, most likely has AMI 'F' KBC firmware. */ - { "[ISA] AMI IBM AT", "ibmatami", MACHINE_TYPE_286, CPU_PKG_286, 0, 6000000, 8000000, 0, 0, 0, 0, MACHINE_AT, 256, 15872, 128, 63, machine_at_ibmatami_init, NULL }, + { "[ISA] AMI IBM AT", "ibmatami", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_ibmatami_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 6000000, 8000000, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 256, 15872, 128, 63, NULL, NULL }, /* Uses Commodore (CBM) KBC firmware, to be implemented as identical to the IBM AT KBC firmware unless evidence emerges of any proprietary commands. */ - { "[ISA] Commodore PC 30 III", "cmdpc30", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 640, 16384, 128, 127, machine_at_cmdpc_init, NULL }, + { "[ISA] Commodore PC 30 III", "cmdpc30", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_cmdpc_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 640, 16384, 128, 127, NULL, NULL }, /* Uses Compaq KBC firmware. */ - { "[ISA] Compaq Portable II", "portableii", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 640, 16384, 128, 127, machine_at_portableii_init, NULL }, + { "[ISA] Compaq Portable II", "portableii", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_portableii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 640, 16384, 128, 127, NULL, NULL }, /* Uses Compaq KBC firmware. */ - { "[ISA] Compaq Portable III", "portableiii", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_VIDEO, 640, 16384, 128, 127, machine_at_portableiii_init, at_cpqiii_get_device }, + { "[ISA] Compaq Portable III", "portableiii", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_portableiii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_VIDEO, 640, 16384, 128, 127, at_cpqiii_get_device, NULL }, /* Has IBM AT KBC firmware. */ - { "[ISA] MR BIOS 286 clone", "mr286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 512, 16384, 128, 127, machine_at_mr286_init, NULL }, + { "[ISA] MR BIOS 286 clone", "mr286", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_mr286_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 512, 16384, 128, 127, NULL, NULL }, /* Has IBM AT KBC firmware. */ - { "[ISA] NCR PC8/810/710/3390/3392", "pc8", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_pc8_init, NULL }, + { "[ISA] NCR PC8/810/710/3390/3392", "pc8", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_pc8_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 16384, 128, 127, NULL, NULL }, #if defined(DEV_BRANCH) && defined(USE_OLIVETTI) /* Has Olivetti KBC firmware. */ - { "[ISA] Olivetti M290", "m290", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 640, 16384, 128, 127, machine_at_m290_init, NULL }, + { "[ISA] Olivetti M290", "m290", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_m290_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 640, 16384, 128, 127, NULL, NULL }, #endif #if defined(DEV_BRANCH) && defined(USE_OPEN_AT) /* Has IBM AT KBC firmware. */ - { "[ISA] OpenAT", "openat", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 256, 15872, 128, 63, machine_at_openat_init, NULL }, + { "[ISA] OpenAT", "openat", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_openat_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 256, 15872, 128, 63, NULL, NULL }, #endif /* Has IBM AT KBC firmware. */ - { "[ISA] Phoenix IBM AT", "ibmatpx", MACHINE_TYPE_286, CPU_PKG_286, 0, 6000000, 8000000, 0, 0, 0, 0, MACHINE_AT, 256, 15872, 128, 63, machine_at_ibmatpx_init, NULL }, + { "[ISA] Phoenix IBM AT", "ibmatpx", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_ibmatpx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 6000000, 8000000, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 256, 15872, 128, 63, NULL, NULL }, /* Has Quadtel KBC firmware. */ - { "[ISA] Quadtel IBM AT", "ibmatquadtel", MACHINE_TYPE_286, CPU_PKG_286, 0, 6000000, 8000000, 0, 0, 0, 0, MACHINE_AT, 256, 15872, 128, 63, machine_at_ibmatquadtel_init, NULL }, + { "[ISA] Quadtel IBM AT", "ibmatquadtel", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_ibmatquadtel_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 6000000, 8000000, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 256, 15872, 128, 63, NULL, NULL }, /* This has a Siemens proprietary KBC which is completely undocumented. */ - { "[ISA] Siemens PCD-2L", "siemens", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 256, 15872, 128, 63, machine_at_siemens_init, NULL }, + { "[ISA] Siemens PCD-2L", "siemens", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_siemens_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 256, 15872, 128, 63, NULL, NULL }, /* This has Toshiba's proprietary KBC, which is already implemented. */ - { "[ISA] Toshiba T3100e", "t3100e", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE | MACHINE_VIDEO_FIXED, 1024, 5120, 256, 63, machine_at_t3100e_init, NULL }, + { "[ISA] Toshiba T3100e", "t3100e", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_t3100e_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO_FIXED, 1024, 5120, 256, 63, NULL, NULL }, /* Has Quadtel KBC firmware. */ - { "[GC103] Quadtel 286 clone", "quadt286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_quadt286_init, NULL }, + { "[GC103] Quadtel 286 clone", "quadt286", MACHINE_TYPE_286, MACHINE_CHIPSET_GC103, machine_at_quadt286_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 16384, 128, 127, NULL, NULL }, /* Most likely has AMI 'F' KBC firmware. */ - { "[GC103] TriGem 286M", "tg286m", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 512, 8192, 128, 127, machine_at_tg286m_init, NULL }, + { "[GC103] TriGem 286M", "tg286m", MACHINE_TYPE_286, MACHINE_CHIPSET_GC103, machine_at_tg286m_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 512, 8192, 128, 127, NULL, NULL }, /* This has "AMI KEYBOARD BIOS", most likely 'F'. */ - { "[NEAT] DataExpert 286", "ami286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 8192, 128, 127, machine_at_neat_ami_init, NULL }, + { "[NEAT] DataExpert 286", "ami286", MACHINE_TYPE_286, MACHINE_CHIPSET_NEAT, machine_at_neat_ami_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 8192, 128, 127, NULL, NULL }, /* Has IBM AT KBC firmware. */ - { "[NEAT] NCR 3302", "3302", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_VIDEO, 512, 16384, 128, 127, machine_at_3302_init, NULL }, + { "[NEAT] NCR 3302", "3302", MACHINE_TYPE_286, MACHINE_CHIPSET_NEAT, machine_at_3302_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_VIDEO, 512, 16384, 128, 127, NULL, NULL }, /* Has IBM AT KBC firmware. */ - { "[NEAT] Phoenix 286 clone", "px286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_px286_init, NULL }, + { "[NEAT] Phoenix 286 clone", "px286", MACHINE_TYPE_286, MACHINE_CHIPSET_NEAT, machine_at_px286_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 16384, 128, 127, NULL, NULL }, /* Has Chips & Technologies KBC firmware. */ - { "[SCAT] GW-286CT GEAR", "gw286ct", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 512, 16384, 128, 127, machine_at_gw286ct_init, NULL }, + { "[SCAT] GW-286CT GEAR", "gw286ct", MACHINE_TYPE_286, MACHINE_CHIPSET_SCAT, machine_at_gw286ct_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 512, 16384, 128, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[SCAT] Goldstar GDC-212M", "gdc212m", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE | MACHINE_BUS_PS2, 512, 4096, 512, 127, machine_at_gdc212m_init, NULL }, + { "[SCAT] Goldstar GDC-212M", "gdc212m", MACHINE_TYPE_286, MACHINE_CHIPSET_SCAT, machine_at_gdc212m_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE, 512, 4096, 512, 127, NULL, NULL }, /* Has a VIA VT82C42N KBC. */ - { "[SCAT] Hyundai Solomon 286KP", "award286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_award286_init, NULL }, + { "[SCAT] Hyundai Solomon 286KP", "award286", MACHINE_TYPE_286, MACHINE_CHIPSET_SCAT, machine_at_award286_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 16384, 128, 127, NULL, NULL }, /* Has a VIA VT82C42N KBC. */ - { "[SCAT] Hyundai Super-286TR", "super286tr", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_super286tr_init, NULL }, + { "[SCAT] Hyundai Super-286TR", "super286tr", MACHINE_TYPE_286, MACHINE_CHIPSET_SCAT, machine_at_super286tr_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 16384, 128, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[SCAT] Samsung SPC-4200P", "spc4200p", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2, 512, 2048, 128, 127, machine_at_spc4200p_init, NULL }, + { "[SCAT] Samsung SPC-4200P", "spc4200p", MACHINE_TYPE_286, MACHINE_CHIPSET_SCAT, machine_at_spc4200p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_FLAGS_NONE, 512, 2048, 128, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[SCAT] Samsung SPC-4216P", "spc4216p", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2, 1024, 5120,1024, 127, machine_at_spc4216p_init, NULL }, + { "[SCAT] Samsung SPC-4216P", "spc4216p", MACHINE_TYPE_286, MACHINE_CHIPSET_SCAT, machine_at_spc4216p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_FLAGS_NONE, 1024, 5120,1024, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[SCAT] Samsung SPC-4620P", "spc4620p", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_VIDEO, 1024, 5120,1024, 127, machine_at_spc4620p_init, NULL }, + { "[SCAT] Samsung SPC-4620P", "spc4620p", MACHINE_TYPE_286, MACHINE_CHIPSET_SCAT, machine_at_spc4620p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_VIDEO, 1024, 5120,1024, 127, NULL, NULL }, /* Has IBM AT KBC firmware. */ - { "[SCAT] Samsung Deskmaster 286", "deskmaster286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_deskmaster286_init, NULL }, + { "[SCAT] Samsung Deskmaster 286", "deskmaster286", MACHINE_TYPE_286, MACHINE_CHIPSET_SCAT, machine_at_deskmaster286_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 16384, 128, 127, NULL, NULL }, /* 286 machines that utilize the MCA bus */ /* Has IBM PS/2 Type 2 KBC firmware. */ - { "[MCA] IBM PS/2 model 50", "ibmps2_m50", MACHINE_TYPE_286, CPU_PKG_286 | CPU_PKG_486SLC_IBM, 0, 10000000, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 1024, 10240,1024, 63, machine_ps2_model_50_init, NULL }, + { "[MCA] IBM PS/2 model 50", "ibmps2_m50", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_ps2_model_50_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286 | CPU_PKG_486SLC_IBM, CPU_BLOCK_NONE, 10000000, 0, 0, 0, 0, 0, MACHINE_PS2_MCA, MACHINE_VIDEO, 1024, 10240, 1024, 63, NULL, NULL }, /* 386SX machines */ /* ISA slots available because an official IBM expansion for that existed. */ /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[ISA] IBM PS/1 model 2121", "ibmps1_2121", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 2048, 6144,1024, 63, machine_ps1_m2121_init, NULL }, + { "[ISA] IBM PS/1 model 2121", "ibmps1_2121", MACHINE_TYPE_386SX, MACHINE_CHIPSET_PROPRIETARY, machine_ps1_m2121_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 6144,1024, 63, NULL, NULL }, /* Has IBM AT KBC firmware. */ - { "[ISA] NCR PC916SX", "pc916sx", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 1024, 16384, 128, 127, machine_at_pc916sx_init, NULL }, + { "[ISA] NCR PC916SX", "pc916sx", MACHINE_TYPE_386SX, MACHINE_CHIPSET_DISCRETE, machine_at_pc916sx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 16384, 128, 127, NULL, NULL }, /* Has Quadtel KBC firmware. */ - { "[ISA] QTC-SXM KT X20T02/HI", "quadt386sx", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 1024, 16384, 128, 127, machine_at_quadt386sx_init, NULL }, + { "[ISA] QTC-SXM KT X20T02/HI", "quadt386sx", MACHINE_TYPE_386SX, MACHINE_CHIPSET_DISCRETE, machine_at_quadt386sx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 16384, 128, 127, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[ALi M1217] Acrosser AR-B1374", "arb1374", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 32768,1024, 127, machine_at_arb1374_init, NULL }, + { "[ALi M1217] Acrosser AR-B1374", "arb1374", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_arb1374_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE, 1024, 32768,1024, 127, NULL, NULL }, /* Has the AMIKey KBC firmware, which is an updated 'F' type. */ - { "[ALi M1217] AAEON SBC-350A", "sbc350a", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 16384, 1024, 127, machine_at_sbc350a_init, NULL }, + { "[ALi M1217] AAEON SBC-350A", "sbc350a", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_sbc350a_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE, 1024, 16384, 1024, 127, NULL, NULL }, /* Has an AMI KBC firmware, the only photo of this is too low resolution for me to read what's on the KBC chip, so I'm going to assume AMI 'F' based on the other known HT18 AMI BIOS strings. */ - { "[ALi M1217] Flytech 386", "flytech386", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, machine_at_flytech386_init, at_flytech386_get_device }, + { "[ALi M1217] Flytech 386", "flytech386", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_flytech386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, at_flytech386_get_device, NULL }, /* I'm going to assume this has a standard/generic IBM-compatible AT KBC firmware until the board is identified. */ - { "[ALi M1217] MR BIOS 386SX clone", "mr1217", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, machine_at_mr1217_init, NULL }, + { "[ALi M1217] MR BIOS 386SX clone", "mr1217", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_mr1217_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[ALi M6117] Acrosser PJ-A511M", "pja511m", MACHINE_TYPE_386SX, CPU_PKG_M6117, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_pja511m_init, NULL }, + { "[ALi M6117] Acrosser PJ-A511M", "pja511m", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M6117, machine_at_pja511m_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_M6117, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[ALi M6117] Protech ProX-1332", "prox1332", MACHINE_TYPE_386SX, CPU_PKG_M6117, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_prox1332_init, NULL }, + { "[ALi M6117] Protech ProX-1332", "prox1332", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M6117, machine_at_prox1332_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_M6117, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL }, /* Has an AMI KBC firmware, the only photo of this is too low resolution for me to read what's on the KBC chip, so I'm going to assume AMI 'F' based on the other known HT18 AMI BIOS strings. */ - { "[HT18] AMA-932J", "ama932j", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE | MACHINE_VIDEO, 512, 8192, 128, 127, machine_at_ama932j_init, at_ama932j_get_device }, + { "[HT18] AMA-932J", "ama932j", MACHINE_TYPE_386SX, MACHINE_CHIPSET_HT18, machine_at_ama932j_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 512, 8192, 128, 127, at_ama932j_get_device, NULL }, /* Has an unknown KBC firmware with commands B8 and BB in the style of Phoenix MultiKey and AMIKey-3(!), but also commands E1 and EA with unknown functions. */ - { "[Intel 82335] ADI 386SX", "adi386sx", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 8192, 128, 127, machine_at_adi386sx_init, NULL }, + { "[Intel 82335] ADI 386SX", "adi386sx", MACHINE_TYPE_386SX, MACHINE_CHIPSET_INTEL_82335, machine_at_adi386sx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 8192, 128, 127, NULL, NULL }, /* Has an AMI Keyboard BIOS PLUS KBC firmware ('8'). */ - { "[Intel 82335] Shuttle 386SX", "shuttle386sx", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 8192, 128, 127, machine_at_shuttle386sx_init, NULL }, + { "[Intel 82335] Shuttle 386SX", "shuttle386sx", MACHINE_TYPE_386SX, MACHINE_CHIPSET_INTEL_82335, machine_at_shuttle386sx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 8192, 128, 127, NULL, NULL }, /* Uses Commodore (CBM) KBC firmware, to be implemented as identical to the IBM PS/2 Type 1 KBC firmware unless evidence emerges of any proprietary commands. */ - { "[NEAT] Commodore SL386SX-16", "cmdsl386sx16", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 8192, 512, 127, machine_at_cmdsl386sx16_init, NULL }, + { "[NEAT] Commodore SL386SX-16", "cmdsl386sx16", MACHINE_TYPE_386SX, MACHINE_CHIPSET_NEAT, machine_at_cmdsl386sx16_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE, 1024, 8192, 512, 127, NULL, NULL }, /* Has IBM AT KBC firmware. */ - { "[NEAT] DTK 386SX clone", "dtk386", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 8192, 128, 127, machine_at_neat_init, NULL }, + { "[NEAT] DTK 386SX clone", "dtk386", MACHINE_TYPE_386SX, MACHINE_CHIPSET_NEAT, machine_at_neat_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 8192, 128, 127, NULL, NULL }, /* Has IBM AT KBC firmware. */ - { "[OPTi 291] DTK PPM-3333P", "awardsx", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 1024, 16384, 1024, 127, machine_at_awardsx_init, NULL }, + { "[OPTi 291] DTK PPM-3333P", "awardsx", MACHINE_TYPE_386SX, MACHINE_CHIPSET_OPTI_291, machine_at_awardsx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 16384, 1024, 127, NULL, NULL }, /* Uses Commodore (CBM) KBC firmware, to be implemented as identical to the IBM PS/2 Type 1 KBC firmware unless evidence emerges of any proprietary commands. */ - { "[SCAMP] Commodore SL386SX-25", "cmdsl386sx25", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 1024, 8192, 512, 127, machine_at_cmdsl386sx25_init, at_cmdsl386sx25_get_device }, + { "[SCAMP] Commodore SL386SX-25", "cmdsl386sx25", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_cmdsl386sx25_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 8192, 512, 127, at_cmdsl386sx25_get_device, NULL }, /* The closest BIOS string I find to this one's, differs only in one part, and ends in -8, so I'm going to assume that this, too, has an AMI '8' (AMI Keyboard BIOS Plus) KBC firmware. */ - { "[SCAMP] DataExpert 386SX", "dataexpert386sx", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 10000000, 25000000, 0, 0, 0, 0, MACHINE_AT, 1024, 16384, 1024, 127, machine_at_dataexpert386sx_init, NULL }, + { "[SCAMP] DataExpert 386SX", "dataexpert386sx", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_dataexpert386sx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 10000000, 25000000, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 16384, 1024, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[SCAMP] Samsung SPC-6033P", "spc6033p", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 2048, 12288, 2048, 127, machine_at_spc6033p_init, at_spc6033p_get_device }, + { "[SCAMP] Samsung SPC-6033P", "spc6033p", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_spc6033p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 12288, 2048, 127, at_spc6033p_get_device, NULL }, /* Has an unknown AMI KBC firmware, I'm going to assume 'F' until a photo or real hardware BIOS string is found. */ - { "[SCAT] KMX-C-02", "kmxc02", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 512, 127, machine_at_kmxc02_init, NULL }, + { "[SCAT] KMX-C-02", "kmxc02", MACHINE_TYPE_386SX, MACHINE_CHIPSET_SCAT, machine_at_kmxc02_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 16384, 512, 127, NULL, NULL }, /* Has Quadtel KBC firmware. */ - { "[WD76C10] Amstrad MegaPC", "megapc", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 1024, 32768, 1024, 127, machine_at_wd76c10_init, NULL }, + { "[WD76C10] Amstrad MegaPC", "megapc", MACHINE_TYPE_386SX, MACHINE_CHIPSET_WD76C10, machine_at_wd76c10_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 32768, 1024, 127, NULL, NULL }, /* 386SX machines which utilize the MCA bus */ /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[MCA] IBM PS/2 model 55SX", "ibmps2_m55sx", MACHINE_TYPE_386SX, CPU_PKG_386SX, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 1024, 8192, 1024, 63, machine_ps2_model_55sx_init, NULL }, + { "[MCA] IBM PS/2 model 55SX", "ibmps2_m55sx", MACHINE_TYPE_386SX, MACHINE_CHIPSET_PROPRIETARY, machine_ps2_model_55sx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_MCA, MACHINE_VIDEO, 1024, 8192, 1024, 63, NULL, NULL }, /* 486SLC machines */ /* 486SLC machines with just the ISA slot */ /* Has AMIKey H KBC firmware. */ - { "[OPTi 283] RYC Leopard LX", "rycleopardlx", MACHINE_TYPE_486SLC, CPU_PKG_486SLC_IBM, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 1024, 16384, 1024, 127, machine_at_rycleopardlx_init, NULL }, + { "[OPTi 283] RYC Leopard LX", "rycleopardlx", MACHINE_TYPE_486SLC, MACHINE_CHIPSET_OPTI_283, machine_at_rycleopardlx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_486SLC_IBM, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 16384, 1024, 127, NULL, NULL }, /* 386DX machines */ - { "[ACC 2168] AMI 386DX clone", "acc386", MACHINE_TYPE_386DX, CPU_PKG_386DX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 1024, 16384, 1024, 127, machine_at_acc386_init, NULL }, + { "[ACC 2168] AMI 386DX clone", "acc386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_ACC_2168, machine_at_acc386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 16384, 1024, 127, NULL, NULL }, /* Has an AMI Keyboard BIOS PLUS KBC firmware ('8'). */ - { "[C&T 386] ECS 386/32", "ecs386", MACHINE_TYPE_386DX, CPU_PKG_386DX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 1024, 16384, 1024, 127, machine_at_ecs386_init, NULL }, + { "[C&T 386] ECS 386/32", "ecs386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_CT_386, machine_at_ecs386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 16384, 1024, 127, NULL, NULL }, /* Has IBM AT KBC firmware. */ - { "[C&T 386] Samsung SPC-6000A", "spc6000a", MACHINE_TYPE_386DX, CPU_PKG_386DX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_spc6000a_init, NULL }, + { "[C&T 386] Samsung SPC-6000A", "spc6000a", MACHINE_TYPE_386DX, MACHINE_CHIPSET_CT_386, machine_at_spc6000a_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL }, /* Uses Compaq KBC firmware. */ - { "[ISA] Compaq Deskpro 386", "deskpro386", MACHINE_TYPE_386DX, CPU_PKG_386DX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 1024, 14336, 1024, 127, machine_at_deskpro386_init, NULL }, - { "[ISA] Compaq Portable III (386)", "portableiii386", MACHINE_TYPE_386DX, CPU_PKG_386DX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE | MACHINE_VIDEO, 1024, 14336, 1024, 127, machine_at_portableiii386_init, at_cpqiii_get_device }, +#if defined(DEV_BRANCH) && defined(USE_DESKPRO386) + { "[ISA] Compaq Deskpro 386", "deskpro386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_deskpro386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 1024, 14336, 1024, 127, NULL, NULL }, +#endif + { "[ISA] Compaq Portable III (386)", "portableiii386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_portableiii386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 1024, 14336, 1024, 127, at_cpqiii_get_device, NULL }, /* Has IBM AT KBC firmware. */ - { "[ISA] Micronics 09-00021", "micronics386", MACHINE_TYPE_386DX, CPU_PKG_386DX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 8192, 128, 127, machine_at_micronics386_init, NULL }, + { "[ISA] Micronics 09-00021", "micronics386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_micronics386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 8192, 128, 127, NULL, NULL }, /* Has AMIKey F KBC firmware. */ - { "[SiS 310] ASUS ISA-386C", "asus386", MACHINE_TYPE_386DX, CPU_PKG_386DX, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 1024, 65536, 1024, 127, machine_at_asus386_init, NULL }, + { "[SiS 310] ASUS ISA-386C", "asus386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_SIS_310, machine_at_asus386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 65536, 1024, 127, NULL, NULL }, /* 386DX machines which utilize the MCA bus */ /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[MCA] IBM PS/2 model 70 (type 3)", "ibmps2_m70_type3", MACHINE_TYPE_386DX, CPU_PKG_386DX | CPU_PKG_486BL, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 2048, 65536, 2048, 63, machine_ps2_model_70_type3_init, NULL }, + { "[MCA] IBM PS/2 model 70 (type 3)", "ibmps2_m70_type3", MACHINE_TYPE_386DX, MACHINE_CHIPSET_PROPRIETARY, machine_ps2_model_70_type3_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX | CPU_PKG_486BL, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_MCA, MACHINE_VIDEO, 2048, 65536, 2048, 63, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[MCA] IBM PS/2 model 80 (type 2)", "ibmps2_m80", MACHINE_TYPE_386DX, CPU_PKG_386DX | CPU_PKG_486BL | CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 1024, 65536, 1024, 63, machine_ps2_model_80_init, NULL }, + { "[MCA] IBM PS/2 model 80 (type 2)", "ibmps2_m80", MACHINE_TYPE_386DX, MACHINE_CHIPSET_PROPRIETARY, machine_ps2_model_80_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX | CPU_PKG_486BL | CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_MCA, MACHINE_VIDEO, 1024, 65536, 1024, 63, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[MCA] IBM PS/2 model 80 (type 3)", "ibmps2_m80_type3", MACHINE_TYPE_386DX, CPU_PKG_386DX | CPU_PKG_486BL | CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_MCA | MACHINE_BUS_PS2 | MACHINE_VIDEO, 2048, 65536, 2048, 63, machine_ps2_model_80_axx_init, NULL }, + { "[MCA] IBM PS/2 model 80 (type 3)", "ibmps2_m80_type3", MACHINE_TYPE_386DX, MACHINE_CHIPSET_PROPRIETARY, machine_ps2_model_80_axx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX | CPU_PKG_486BL | CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_MCA, MACHINE_VIDEO, 2048, 65536, 2048, 63, NULL, NULL }, /* 386DX/486 machines */ /* The BIOS sends commands C9 without a parameter and D5, both of which are Phoenix MultiKey commands. */ - { "[OPTi 495] Award 486 clone", "award495", MACHINE_TYPE_386DX_486, CPU_PKG_386DX | CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_opti495_init, NULL }, + { "[OPTi 495] Award 486 clone", "award495", MACHINE_TYPE_386DX_486, MACHINE_CHIPSET_OPTI_495, machine_at_opti495_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX | CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL }, /* Has AMIKey F KBC firmware. */ - { "[OPTi 495] DataExpert SX495", "ami495", MACHINE_TYPE_386DX_486, CPU_PKG_386DX | CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_opti495_ami_init, NULL }, + { "[OPTi 495] DataExpert SX495", "ami495", MACHINE_TYPE_386DX_486, MACHINE_CHIPSET_OPTI_495, machine_at_opti495_ami_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX | CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL }, /* Has AMIKey F KBC firmware (it's just the MR BIOS for the above machine). */ - { "[OPTi 495] DataExpert SX495 (MR BIOS)", "mr495", MACHINE_TYPE_386DX_486, CPU_PKG_386DX | CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_opti495_mr_init, NULL }, + { "[OPTi 495] DataExpert SX495 (MR BIOS)", "mr495", MACHINE_TYPE_386DX_486, MACHINE_CHIPSET_OPTI_495, machine_at_opti495_mr_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX | CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL }, /* 486 machines - Socket 1 */ /* Has JetKey 5 KBC Firmware which looks like it is a clone of AMIKey type F. @@ -333,161 +412,161 @@ const machine_t machines[] = { supposedly sends command EF. The board was also seen in 2003 with a -H string - perhaps someone swapped the KBC? */ - { "[ALi M1429] Olystar LIL1429", "ali1429", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_ali1429_init, NULL }, + { "[ALi M1429] Olystar LIL1429", "ali1429", MACHINE_TYPE_486, MACHINE_CHIPSET_ALI_M1429, machine_at_ali1429_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL }, /* Has JetKey 5 KBC Firmware - but the BIOS string ends in a hardcoded -F, and the BIOS also explicitly expects command A1 to return a 'F', so it looks like the JetKey 5 is a clone of AMIKey type F. */ - { "[CS4031] AMI 486 CS4031", "cs4031", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB, 1024, 65536, 1024, 127, machine_at_cs4031_init, NULL }, + { "[CS4031] AMI 486 CS4031", "cs4031", MACHINE_TYPE_486, MACHINE_CHIPSET_CT_CS4031, machine_at_cs4031_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_FLAGS_NONE, 1024, 65536, 1024, 127, NULL, NULL }, /* Uses some variant of Phoenix MultiKey/42 as the Intel 8242 chip has a Phoenix copyright. */ - { "[OPTi 895] Mylex MVI486", "mvi486", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE_DUAL, 1024, 65536, 1024, 127, machine_at_mvi486_init, NULL }, + { "[OPTi 895] Mylex MVI486", "mvi486", MACHINE_TYPE_486, MACHINE_CHIPSET_OPTI_895_802G, machine_at_mvi486_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE_DUAL, 1024, 65536, 1024, 127, NULL, NULL }, /* Has AMI KF KBC firmware. */ - { "[SiS 401] ASUS ISA-486", "isa486", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_isa486_init, NULL }, + { "[SiS 401] ASUS ISA-486", "isa486", MACHINE_TYPE_486, MACHINE_CHIPSET_SIS_401, machine_at_isa486_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 1024, 65536, 1024, 127, NULL, NULL }, /* Has AMIKey H KBC firmware, per the screenshot in "How computers & MS-DOS work". */ - { "[SiS 401] Chaintech 433SC", "sis401", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_sis401_init, NULL }, + { "[SiS 401] Chaintech 433SC", "sis401", MACHINE_TYPE_486, MACHINE_CHIPSET_SIS_401, machine_at_sis401_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 1024, 65536, 1024, 127, NULL, NULL }, /* Has AMIKey F KBC firmware, per a photo of a monitor with the BIOS screen on eBay. */ - { "[SiS 460] ABIT AV4", "av4", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_av4_init, NULL }, + { "[SiS 460] ABIT AV4", "av4", MACHINE_TYPE_486, MACHINE_CHIPSET_SIS_460, machine_at_av4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 65536, 1024, 127, NULL, NULL }, /* Has a MR (!) KBC firmware, which is a clone of the standard IBM PS/2 KBC firmware. */ - { "[SiS 471] SiS VL-BUS 471 REV. A1", "px471", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024,131072, 1024, 127, machine_at_px471_init, NULL }, + { "[SiS 471] SiS VL-BUS 471 REV. A1", "px471", MACHINE_TYPE_486, MACHINE_CHIPSET_SIS_471, machine_at_px471_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 131072, 1024, 127, NULL, NULL }, /* The chip is a Lance LT38C41, a clone of the Intel 8041, and the BIOS sends commands BC, BD, and C9 which exist on both AMIKey and Phoenix MultiKey/42, but it does not write a byte after C9, which is consistent with AMIKey, so this must have some form of AMIKey. */ - { "[VIA VT82C495] FIC 486-VC-HD", "486vchd", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 1024, 64512, 1024, 127, machine_at_486vchd_init, NULL }, + { "[VIA VT82C495] FIC 486-VC-HD", "486vchd", MACHINE_TYPE_486, MACHINE_CHIPSET_VIA_VT82C495, machine_at_486vchd_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 64512, 1024, 127, NULL, NULL }, /* According to Deksor on the Win3x.org forum, the BIOS string ends in a -0, indicating an unknown KBC firmware. But it does send the AMIKey get version command, so it must expect an AMIKey. */ - { "[VLSI 82C480] HP Vectra 486VL", "vect486vl", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, machine_at_vect486vl_init, at_vect486vl_get_device }, + { "[VLSI 82C480] HP Vectra 486VL", "vect486vl", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C480, machine_at_vect486vl_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_vect486vl_get_device, NULL }, /* Has a standard IBM PS/2 KBC firmware or a clone thereof. */ - { "[VLSI 82C481] Siemens Nixdorf D824", "d824", MACHINE_TYPE_486, CPU_PKG_SOCKET1, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, machine_at_d824_init, at_d824_get_device }, + { "[VLSI 82C481] Siemens Nixdorf D824", "d824", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C481, machine_at_d824_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_d824_get_device, NULL }, /* 486 machines - Socket 2 */ /* 486 machines with just the ISA slot */ /* Uses some variant of Phoenix MultiKey/42 as the BIOS sends keyboard controller command C7 (OR input byte with received data byte). */ - { "[ACC 2168] Packard Bell PB410A", "pb410a", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 4096, 36864, 1024, 127, machine_at_pb410a_init, NULL }, + { "[ACC 2168] Packard Bell PB410A", "pb410a", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ACC_2168, machine_at_pb410a_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 4096, 36864, 1024, 127, NULL, NULL }, /* Uses an ACER/NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware (V4.01H). */ - { "[ALi M1429G] Acer A1G", "acera1g", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 4096, 36864, 1024, 127, machine_at_acera1g_init, at_acera1g_get_device }, + { "[ALi M1429G] Acer A1G", "acera1g", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ALI_M1429G, machine_at_acera1g_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE_DUAL | MACHINE_VIDEO, 4096, 36864, 1024, 127, at_acera1g_get_device, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[ALi M1429G] Kaimei SA-486 VL-BUS M.B.", "win486", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_winbios1429_init, NULL }, + { "[ALi M1429G] Kaimei SA-486 VL-BUS M.B.", "win486", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ALI_M1429G, machine_at_winbios1429_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL }, /* Uses an Intel KBC with Phoenix MultiKey KBC firmware. */ - { "[SiS 461] DEC DECpc LPV", "decpclpv", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 32768, 1024, 127, machine_at_decpclpv_init, NULL }, + { "[SiS 461] DEC DECpc LPV", "decpclpv", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_SIS_461, machine_at_decpclpv_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 32768, 1024, 127, NULL, NULL }, /* Uses an NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware. */ - { "[SiS 461] Acer V10", "acerv10", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 32768, 1024, 127, machine_at_acerv10_init, NULL }, + { "[SiS 461] Acer V10", "acerv10", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_SIS_461, machine_at_acerv10_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 32768, 1024, 127, NULL, NULL }, /* The BIOS does not send any non-standard keyboard controller commands and wants a PS/2 mouse, so it's an IBM PS/2 KBC (Type 1) firmware. */ - { "[SiS 461] IBM PS/ValuePoint 433DX/Si", "valuepoint433", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 1024, 65536, 1024, 127, machine_at_valuepoint433_init, NULL }, + { "[SiS 461] IBM PS/ValuePoint 433DX/Si", "valuepoint433", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_SIS_461, machine_at_valuepoint433_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 65536, 1024, 127, NULL, NULL }, /* The BIOS string ends in -U, unless command 0xA1 (AMIKey get version) returns an 'F', in which case, it ends in -F, so it has an AMIKey F KBC firmware. The photo of the board shows an AMIKey KBC which is indeed F. */ - { "[SiS 471] ABit AB-AH4", "win471", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_win471_init, NULL }, + { "[SiS 471] ABit AB-AH4", "win471", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_SIS_471, machine_at_win471_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 65536, 1024, 127, NULL, NULL }, /* 486 machines - Socket 3 */ /* 486 machines with just the ISA slot */ /* Has AMI MegaKey KBC firmware. */ - { "[Contaq 82C597] Green-B", "greenb", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB, 1024, 65536, 1024, 127, machine_at_greenb_init, NULL }, + { "[Contaq 82C597] Green-B", "greenb", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_CONTAQ_82C597, machine_at_greenb_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_FLAGS_NONE, 1024, 65536, 1024, 127, NULL, NULL }, /* Has a VIA VT82C42N KBC. */ - { "[OPTi 895] Jetway J-403TG", "403tg", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB, 1024, 65536, 1024, 127, machine_at_403tg_init, NULL }, + { "[OPTi 895] Jetway J-403TG", "403tg", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_OPTI_895_802G, machine_at_403tg_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_FLAGS_NONE, 1024, 65536, 1024, 127, NULL, NULL }, /* Has JetKey 5 KBC Firmware which looks like it is a clone of AMIKey type F. */ - { "[OPTi 895] Jetway J-403TG Rev D", "403tg_d", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB, 1024, 65536, 1024, 127, machine_at_403tg_d_init, NULL }, + { "[OPTi 895] Jetway J-403TG Rev D", "403tg_d", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_OPTI_895_802G, machine_at_403tg_d_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_FLAGS_NONE, 1024, 65536, 1024, 127, NULL, NULL }, /* Has JetKey 5 KBC Firmware which looks like it is a clone of AMIKey type F. */ - { "[OPTi 895] Jetway J-403TG Rev D (MR BIOS)","403tg_d_mr", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB, 1024, 65536, 1024, 127, machine_at_403tg_d_mr_init, NULL }, + { "[OPTi 895] Jetway J-403TG Rev D (MR BIOS)", "403tg_d_mr", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_OPTI_895_802G, machine_at_403tg_d_mr_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_FLAGS_NONE, 1024, 65536, 1024, 127, NULL, NULL }, /* Has AMIKey H keyboard BIOS. */ - { "[SiS 471] AOpen Vi15G", "vi15g", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_vi15g_init, NULL }, + { "[SiS 471] AOpen Vi15G", "vi15g", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_471, machine_at_vi15g_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 65536, 1024, 127, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[SiS 471] ASUS VL/I-486SV2G (GX4)", "vli486sv2g", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 65536, 1024, 127, machine_at_vli486sv2g_init, NULL }, + { "[SiS 471] ASUS VL/I-486SV2G (GX4)", "vli486sv2g", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_471, machine_at_vli486sv2g_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_VLB, MACHINE_IDE_DUAL, 1024, 65536, 1024, 127, NULL, NULL }, /* Has JetKey 5 KBC Firmware which looks like it is a clone of AMIKey type F. */ - { "[SiS 471] DTK PKM-0038S E-2", "dtk486", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_dtk486_init, NULL }, + { "[SiS 471] DTK PKM-0038S E-2", "dtk486", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_471, machine_at_dtk486_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 65536, 1024, 127, NULL, NULL }, /* Unknown Epox VLB Socket 3 board, has AMIKey F keyboard BIOS. */ - { "[SiS 471] Epox 486SX/DX Green", "ami471", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_ami471_init, NULL }, + { "[SiS 471] Epox 486SX/DX Green", "ami471", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_471, machine_at_ami471_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 65536, 1024, 127, NULL, NULL }, /* 486 machines which utilize the PCI bus */ /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[ALi M1489] AAEON SBC-490", "sbc490", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 65536, 1024, 255, machine_at_sbc490_init, at_sbc490_get_device }, + { "[ALi M1489] AAEON SBC-490", "sbc490", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_sbc490_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 65536, 1024, 255, at_sbc490_get_device, NULL }, /* Has the ALi M1487/9's on-chip keyboard controller which clones a standard AT KBC. */ - { "[ALi M1489] ABIT AB-PB4", "abpb4", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, machine_at_abpb4_init, NULL }, + { "[ALi M1489] ABIT AB-PB4", "abpb4", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_abpb4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, NULL, NULL }, /* Has the ALi M1487/9's on-chip keyboard controller which clones a standard AT KBC. The BIOS string always ends in -U, but the BIOS will send AMIKey commands 0xCA and 0xCB if command 0xA1 returns a letter in the 0x5x or 0x7x ranges, so I'm going to give it an AMI 'U' KBC. */ - { "[ALi M1489] AMI WinBIOS 486 PCI", "win486pci", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, machine_at_win486pci_init, NULL }, + { "[ALi M1489] AMI WinBIOS 486 PCI", "win486pci", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_win486pci_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, NULL, NULL }, /* Has the ALi M1487/9's on-chip keyboard controller which clones a standard AT KBC. The known BIOS string ends in -E, and the BIOS returns whatever command 0xA1 returns (but only if command 0xA1 is instant response), so said ALi keyboard controller likely returns 'E'. */ - { "[ALi M1489] MSI MS-4145", "ms4145", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, machine_at_ms4145_init, NULL }, + { "[ALi M1489] MSI MS-4145", "ms4145", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_ms4145_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, NULL, NULL }, /* Has an ALi M5042 keyboard controller with Phoenix MultiKey/42 v1.40 firmware. */ - { "[ALi M1489] ESA TF-486", "tf486", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, machine_at_tf486_init, NULL }, + { "[ALi M1489] ESA TF-486", "tf486", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_tf486_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[OPTi 802G] IBM PC 330 (type 6573)", "pc330_6573", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3_PC330, 0, 25000000, 33333333, 0, 0, 2.0, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_pc330_6573_init, NULL }, + { "[OPTi 802G] IBM PC 330 (type 6573)", "pc330_6573", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_OPTI_895_802G, machine_at_pc330_6573_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3_PC330, CPU_BLOCK_NONE, 25000000, 33333333, 0, 0, 2.0, 3.0, MACHINE_PS2_PCI, MACHINE_IDE, 1024, 65536, 1024, 127, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[i420EX] ASUS PVI-486AP4", "486ap4", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 131072, 1024, 127, machine_at_486ap4_init, NULL }, + { "[i420EX] ASUS PVI-486AP4", "486ap4", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_INTEL_420EX, machine_at_486ap4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCIV, MACHINE_IDE_DUAL, 1024, 131072, 1024, 127, NULL, NULL }, /* This has the Phoenix MultiKey KBC firmware. */ - { "[i420EX] Intel Classic/PCI ED", "ninja", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 131072, 1024, 127, machine_at_ninja_init, NULL }, + { "[i420EX] Intel Classic/PCI ED", "ninja", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_INTEL_420EX, machine_at_ninja_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 1024, 131072, 1024, 127, NULL, NULL }, + /* I'm going to assume this as an AMIKey-2 like the other two 486SP3's. */ + { "[i420TX] ASUS PCI/I-486SP3", "486sp3", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_INTEL_420TX, machine_at_486sp3_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL | MACHINE_SCSI, 1024, 131072, 1024, 127, NULL, NULL }, + /* This has the Phoenix MultiKey KBC firmware. */ + { "[i420TX] Intel Classic/PCI", "alfredo", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_INTEL_420TX, machine_at_alfredo_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. Also has a SST 29EE010 Flash chip. */ - { "[i420ZX] ASUS PCI/I-486SP3G", "486sp3g", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_SCSI, 1024, 131072, 1024, 127, machine_at_486sp3g_init, NULL }, - /* I'm going to assume this as an AMIKey-2 like the other two 486SP3's. */ - { "[i420TX] ASUS PCI/I-486SP3", "486sp3", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL | MACHINE_SCSI, 1024, 131072, 1024, 127, machine_at_486sp3_init, NULL }, - /* This has the Phoenix MultiKey KBC firmware. */ - { "[i420TX] Intel Classic/PCI", "alfredo", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_alfredo_init, NULL }, + { "[i420ZX] ASUS PCI/I-486SP3G", "486sp3g", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_INTEL_420ZX, machine_at_486sp3g_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_SCSI, 1024, 131072, 1024, 127, NULL, NULL }, /* This most likely has a standalone AMI Megakey 1993, which is type 'P', like the below Tekram board. */ - { "[IMS 8848] J-Bond PCI400C-B", "pci400cb", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_pci400cb_init, NULL }, + { "[IMS 8848] J-Bond PCI400C-B", "pci400cb", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_IMS_8848, machine_at_pci400cb_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* This has a standalone AMI Megakey 1993, which is type 'P'. */ - { "[IMS 8848] Tekram G486IP", "g486ip", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_g486ip_init, NULL }, + { "[IMS 8848] Tekram G486IP", "g486ip", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_IMS_8848, machine_at_g486ip_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[SiS 496] ASUS PVI-486SP3C", "486sp3c", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_486sp3c_init, NULL }, + { "[SiS 496] ASUS PVI-486SP3C", "486sp3c", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_496, machine_at_486sp3c_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCIV, MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[SiS 496] Lucky Star LS-486E", "ls486e", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, machine_at_ls486e_init, NULL }, + { "[SiS 496] Lucky Star LS-486E", "ls486e", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_496, machine_at_ls486e_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, NULL, NULL }, /* The BIOS does not send a single non-standard KBC command, so it has a standard PS/2 KBC. */ - { "[SiS 496] Micronics M4Li", "m4li", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 131072, 1024, 127, machine_at_m4li_init, NULL }, + { "[SiS 496] Micronics M4Li", "m4li", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_496, machine_at_m4li_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 1024, 131072, 1024, 127, NULL, NULL }, /* Has a BestKey KBC which clones AMI type 'H'. */ - { "[SiS 496] Rise Computer R418", "r418", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_r418_init, NULL }, + { "[SiS 496] Rise Computer R418", "r418", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_496, machine_at_r418_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, NULL, NULL }, /* This has a Holtek KBC and the BIOS does not send a single non-standard KBC command, so it must be an ASIC that clones the standard IBM PS/2 KBC. */ - { "[SiS 496] Soyo 4SAW2", "4saw2", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, CPU_BLOCK(CPU_i486SX, CPU_i486DX, CPU_Am486SX, CPU_Am486DX), 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_4saw2_init, NULL }, + { "[SiS 496] Soyo 4SAW2", "4saw2", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_496, machine_at_4saw2_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_SOYO_4SAW2, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCIV, MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, NULL, NULL }, /* According to MrKsoft, his real 4DPS has an AMIKey-2, which is an updated version of type 'H'. */ - { "[SiS 496] Zida Tomato 4DP", "4dps", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_4dps_init, NULL }, + { "[SiS 496] Zida Tomato 4DP", "4dps", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_SIS_496, machine_at_4dps_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, NULL, NULL }, /* This has the UMC 88xx on-chip KBC. */ - { "[UMC 8881] A-Trend ATC-1415", "atc1415", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, machine_at_atc1415_init, NULL }, + { "[UMC 8881] A-Trend ATC-1415", "atc1415", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_UMC_UM8881, machine_at_atc1415_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[UMC 8881] ECS Elite UM8810PAIO", "ecs486", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, machine_at_ecs486_init, NULL }, + { "[UMC 8881] ECS Elite UM8810PAIO", "ecs486", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_UMC_UM8881, machine_at_ecs486_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, NULL, NULL }, /* Has AMIKey Z(!) KBC firmware. */ - { "[UMC 8881] Epson Action PC 2600", "actionpc2600", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 262144, 1024, 255, machine_at_actionpc2600_init, NULL }, + { "[UMC 8881] Epson Action PC 2600", "actionpc2600", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_UMC_UM8881, machine_at_actionpc2600_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 262144, 1024, 255, NULL, NULL }, /* This has the UMC 88xx on-chip KBC. All the copies of the BIOS string I can find, end in in -H, so the UMC on-chip KBC likely emulates the AMI 'H' KBC firmware. */ - { "[UMC 8881] PC Chips M919", "m919", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_VLB | MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, machine_at_m919_init, NULL }, + { "[UMC 8881] PC Chips M919", "m919", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_UMC_UM8881, machine_at_m919_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCIV, MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. Uses a mysterious I/O port C05. */ - { "[UMC 8881] Samsung SPC7700P-LW", "spc7700plw", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, machine_at_spc7700plw_init, NULL }, + { "[UMC 8881] Samsung SPC7700P-LW", "spc7700plw", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_UMC_UM8881, machine_at_spc7700plw_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, NULL, NULL }, /* This has a Holtek KBC. */ - { "[UMC 8881] Shuttle HOT-433A", "hot433", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 262144, 1024, 255, machine_at_hot433_init, NULL }, + { "[UMC 8881] Shuttle HOT-433A", "hot433", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_UMC_UM8881, machine_at_hot433_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 262144, 1024, 255, NULL, NULL }, /* Has a VIA VT82C406 KBC+RTC that likely has identical commands to the VT82C42N. */ - { "[VIA VT82C496G] DFI G486VPA", "g486vpa", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, machine_at_g486vpa_init, NULL }, + { "[VIA VT82C496G] DFI G486VPA", "g486vpa", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_VIA_VT82C496G, machine_at_g486vpa_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCIV, MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, NULL, NULL }, /* Has a VIA VT82C42N KBC. */ - { "[VIA VT82C496G] FIC VIP-IO2", "486vipio2", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, machine_at_486vipio2_init, NULL }, + { "[VIA VT82C496G] FIC VIP-IO2", "486vipio2", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_VIA_VT82C496G, machine_at_486vipio2_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCIV, MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, NULL, NULL }, /* 486 machines - Miscellaneous */ /* 486 machines which utilize the PCI bus */ /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[STPC Client] ITOX STAR", "itoxstar", MACHINE_TYPE_486_MISC, CPU_PKG_STPC, 0, 66666667, 75000000, 0, 0, 1.0, 1.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 255, machine_at_itoxstar_init, NULL }, + { "[STPC Client] ITOX STAR", "itoxstar", MACHINE_TYPE_486_MISC, MACHINE_CHIPSET_STPC_CLIENT, machine_at_itoxstar_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_STPC, CPU_BLOCK_NONE, 66666667, 75000000, 0, 0, 1.0, 1.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 255, NULL, NULL }, /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[STPC Consumer-II] Acrosser AR-B1423C", "arb1423c", MACHINE_TYPE_486_MISC, CPU_PKG_STPC, 0, 66666667, 66666667, 0, 0, 2.0, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 32768, 163840, 8192, 255, machine_at_arb1423c_init, NULL }, + { "[STPC Consumer-II] Acrosser AR-B1423C", "arb1423c", MACHINE_TYPE_486_MISC, MACHINE_CHIPSET_STPC_CONSUMER_II, machine_at_arb1423c_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_STPC, CPU_BLOCK_NONE, 66666667, 66666667, 0, 0, 2.0, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 32768, 163840, 8192, 255, NULL, NULL }, /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[STPC Consumer-II] Acrosser AR-B1479", "arb1479", MACHINE_TYPE_486_MISC, CPU_PKG_STPC, 0, 66666667, 66666667, 0, 0, 2.0, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 32768, 163840, 8192, 255, machine_at_arb1479_init, NULL }, + { "[STPC Consumer-II] Acrosser AR-B1479", "arb1479", MACHINE_TYPE_486_MISC, MACHINE_CHIPSET_STPC_CONSUMER_II, machine_at_arb1479_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_STPC, CPU_BLOCK_NONE, 66666667, 66666667, 0, 0, 2.0, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 32768, 163840, 8192, 255, NULL, NULL }, /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[STPC Elite] Advantech PCM-9340", "pcm9340", MACHINE_TYPE_486_MISC, CPU_PKG_STPC, 0, 66666667, 66666667, 0, 0, 2.0, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 32768, 98304, 8192, 255, machine_at_pcm9340_init, NULL }, + { "[STPC Elite] Advantech PCM-9340", "pcm9340", MACHINE_TYPE_486_MISC, MACHINE_CHIPSET_STPC_ELITE, machine_at_pcm9340_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_STPC, CPU_BLOCK_NONE, 66666667, 66666667, 0, 0, 2.0, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 32768, 98304, 8192, 255, NULL, NULL }, /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[STPC Atlas] AAEON PCM-5330", "pcm5330", MACHINE_TYPE_486_MISC, CPU_PKG_STPC, 0, 66666667, 66666667, 0, 0, 2.0, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 32768, 131072,32768, 255, machine_at_pcm5330_init, NULL }, + { "[STPC Atlas] AAEON PCM-5330", "pcm5330", MACHINE_TYPE_486_MISC, MACHINE_CHIPSET_STPC_ATLAS, machine_at_pcm5330_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_STPC, CPU_BLOCK_NONE, 66666667, 66666667, 0, 0, 2.0, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 32768, 131072,32768, 255, NULL, NULL }, /* Socket 4 machines */ /* 430LX */ @@ -496,469 +575,473 @@ const machine_t machines[] = { connector. The boot block for BIOS recovery requires an unknown bit on port 805h to be clear. */ - { "[i430LX] AMI Excalibur PCI Pentium", "excaliburpci", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_excaliburpci_init, NULL }, + { "[i430LX] AMI Excalibur PCI Pentium", "excaliburpci", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_excaliburpci_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* Has AMIKey F KBC firmware (AMIKey). */ - { "[i430LX] ASUS P/I-P5MP3", "p5mp3", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE, 2048, 196608, 2048, 127, machine_at_p5mp3_init, NULL }, + { "[i430LX] ASUS P/I-P5MP3", "p5mp3", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_p5mp3_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE, 2048, 196608, 2048, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[i430LX] Dell Dimension XPS P60", "dellxp60", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE, 2048, 131072, 2048, 127, machine_at_dellxp60_init, NULL }, + { "[i430LX] Dell Dimension XPS P60", "dellxp60", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_dellxp60_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE, 2048, 131072, 2048, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[i430LX] Dell OptiPlex 560/L", "opti560l", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_opti560l_init, NULL }, + { "[i430LX] Dell OptiPlex 560/L", "opti560l", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_opti560l_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* This has the Phoenix MultiKey KBC firmware. This is basically an Intel Batman (*NOT* Batman's Revenge) with a fancier POST screen */ - { "[i430LX] AMBRA DP60 PCI", "ambradp60", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_ambradp60_init, NULL }, + { "[i430LX] AMBRA DP60 PCI", "ambradp60", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_ambradp60_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[i430LX] IBM PS/ValuePoint P60", "valuepointp60", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_valuepointp60_init, NULL }, + { "[i430LX] IBM PS/ValuePoint P60", "valuepointp60", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_valuepointp60_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* This has the Phoenix MultiKey KBC firmware. */ - { "[i430LX] Intel Premiere/PCI", "revenge", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_revenge_init, NULL }, + { "[i430LX] Intel Premiere/PCI", "revenge", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_revenge_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* Has AMI MegaKey KBC firmware. */ - { "[i430LX] Micro Star 586MC1", "586mc1", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_586mc1_init, NULL }, + { "[i430LX] Micro Star 586MC1", "586mc1", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_586mc1_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* This has the Phoenix MultiKey KBC firmware. */ - { "[i430LX] Packard Bell PB520R", "pb520r", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 139264, 2048, 127, machine_at_pb520r_init, at_pb520r_get_device }, + { "[i430LX] Packard Bell PB520R", "pb520r", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_pb520r_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 139264, 2048, 127, at_pb520r_get_device, NULL }, /* OPTi 596/597 */ /* This uses an AMI KBC firmware in PS/2 mode (it sends command A5 with the PS/2 "Load Security" meaning), most likely MegaKey as it sends command AF (Set Extended Controller RAM) just like the later Intel AMI BIOS'es. */ - { "[OPTi 597] AMI Excalibur VLB", "excalibur", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 60000000, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_VLB | MACHINE_BUS_PS2 | MACHINE_IDE, 2048, 65536, 2048, 127, machine_at_excalibur_init, NULL }, + { "[OPTi 597] AMI Excalibur VLB", "excalibur", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_OPTI_547_597, machine_at_excalibur_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 60000000, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_VLB, MACHINE_IDE, 2048, 65536, 2048, 127, NULL, NULL }, /* OPTi 596/597/822 */ /* This has AMIKey 'F' KBC firmware. */ - { "[OPTi 597] Supermicro P5VL-PCI", "p5vl", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_VLB, 8192, 131072, 8192, 127, machine_at_p5vl_init, NULL }, + { "[OPTi 597] Supermicro P5VL-PCI", "p5vl", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_OPTI_547_597, machine_at_p5vl_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCIV, MACHINE_FLAGS_NONE, 8192, 131072, 8192, 127, NULL, NULL }, /* SiS 50x */ /* This has some form of AMI MegaKey as it uses keyboard controller command 0xCC. */ - { "[SiS 501] AMI Excalibur PCI-II Pentium ISA","excaliburpci2", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_excaliburpci2_init, NULL }, + { "[SiS 501] AMI Excalibur PCI-II Pentium ISA", "excaliburpci2", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_SIS_501, machine_at_excaliburpci2_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[SiS 501] ASUS PCI/I-P5SP4", "p5sp4", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_p5sp4_init, NULL }, + { "[SiS 501] ASUS PCI/I-P5SP4", "p5sp4", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_SIS_501, machine_at_p5sp4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* Socket 5 machines */ /* 430NX */ /* This has the Phoenix MultiKey KBC firmware. */ - { "[i430NX] Intel Premiere/PCI II", "plato", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3520, 3520, 1.5, 1.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_plato_init, NULL }, + { "[i430NX] Intel Premiere/PCI II", "plato", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430NX, machine_at_plato_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3520, 3520, 1.5, 1.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* This has the Phoenix MultiKey KBC firmware. This is basically an Intel Premiere/PCI II with a fancier POST screen. */ - { "[i430NX] AMBRA DP90 PCI", "ambradp90", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 1.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_ambradp90_init, NULL }, + { "[i430NX] AMBRA DP90 PCI", "ambradp90", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430NX, machine_at_ambradp90_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 1.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* Has AMI MegaKey KBC firmware. */ - { "[i430NX] Gigabyte GA-586IP", "430nx", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 60000000, 66666667, 3520, 3520, 1.5, 1.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_430nx_init, NULL }, + { "[i430NX] Gigabyte GA-586IP", "430nx", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430NX, machine_at_430nx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 66666667, 3520, 3520, 1.5, 1.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL }, /* 430FX */ /* Uses an ACER/NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware (V5.0). */ - { "[i430FX] Acer V30", "acerv30", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_acerv30_init, NULL }, + { "[i430FX] Acer V30", "acerv30", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430FX, machine_at_acerv30_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* Has AMIKey F KBC firmware. */ - { "[i430FX] AMI Apollo", "apollo", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_apollo_init, NULL }, + { "[i430FX] AMI Apollo", "apollo", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430FX, machine_at_apollo_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* Has AMIKey H KBC firmware. */ - { "[i430FX] DataExpert EXP8551", "exp8551", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_exp8551_init, NULL }, + { "[i430FX] DataExpert EXP8551", "exp8551", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430FX, machine_at_exp8551_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i430FX] Intel Advanced/ZP", "zappa", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_zappa_init, NULL }, + { "[i430FX] Intel Advanced/ZP", "zappa", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430FX, machine_at_zappa_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* The BIOS sends KBC command B3 which indicates an AMI (or VIA VT82C42N) KBC. */ - { "[i430FX] NEC PowerMate V", "powermatev", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_powermatev_init, NULL }, + { "[i430FX] NEC PowerMate V", "powermatev", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430FX, machine_at_powermatev_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* Has a VIA VT82C42N KBC. */ - { "[i430FX] PC Partner MB500N", "mb500n", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_mb500n_init, NULL }, + { "[i430FX] PC Partner MB500N", "mb500n", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430FX, machine_at_mb500n_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* Has AMIKey Z(!) KBC firmware. */ - { "[i430FX] TriGem Hawk", "hawk", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_hawk_init, NULL }, + { "[i430FX] TriGem Hawk", "hawk", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_INTEL_430FX, machine_at_hawk_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* OPTi 596/597 */ /* This uses an AMI KBC firmware in PS/2 mode (it sends command A5 with the PS/2 "Load Security" meaning), most likely MegaKey as it sends command AF (Set Extended Controller RAM) just like the later Intel AMI BIOS'es. */ - { "[OPTi 597] TMC PAT54PV", "pat54pv", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_K5, CPU_5K86), 50000000, 66666667, 3520, 3520, 1.5, 1.5, MACHINE_VLB, 2048, 65536, 2048, 127, machine_at_pat54pv_init, NULL }, + { "[OPTi 597] TMC PAT54PV", "pat54pv", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_OPTI_547_597, machine_at_pat54pv_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_K5, CPU_5K86), 50000000, 66666667, 3520, 3520, 1.5, 1.5, MACHINE_VLB, MACHINE_FLAGS_NONE, 2048, 65536, 2048, 127, NULL, NULL }, /* OPTi 596/597/822 */ - { "[OPTi 597] Shuttle HOT-543", "hot543", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3520, 3520, 1.5, 2.0, MACHINE_PCI | MACHINE_VLB, 8192, 131072, 8192, 127, machine_at_hot543_init, NULL }, + { "[OPTi 597] Shuttle HOT-543", "hot543", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_OPTI_547_597, machine_at_hot543_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3520, 3520, 1.5, 2.0, MACHINE_PCIV, MACHINE_FLAGS_NONE, 8192, 131072, 8192, 127, NULL, NULL }, /* SiS 85C50x */ /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[SiS 501] ASUS PCI/I-P54SP4", "p54sp4", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_K5, CPU_5K86), 40000000, 66666667, 3380, 3520, 1.5, 1.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_p54sp4_init, NULL }, + { "[SiS 501] ASUS PCI/I-P54SP4", "p54sp4", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_SIS_501, machine_at_p54sp4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_K5, CPU_5K86), 40000000, 66666667, 3380, 3520, 1.5, 1.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[SiS 501] BCM SQ-588", "sq588", MACHINE_TYPE_SOCKET5, CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_PENTIUMMMX), 50000000, 66666667, 3520, 3520, 1.5, 1.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_sq588_init, NULL }, + { "[SiS 501] BCM SQ-588", "sq588", MACHINE_TYPE_SOCKET5, MACHINE_CHIPSET_SIS_501, machine_at_sq588_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_PENTIUMMMX), 50000000, 66666667, 3520, 3520, 1.5, 1.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* Socket 7 (Single Voltage) machines */ /* 430FX */ /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[i430FX] ASUS P/I-P54TP4XE", "p54tp4xe", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3600, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_p54tp4xe_init, NULL }, + { "[i430FX] ASUS P/I-P54TP4XE", "p54tp4xe", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_p54tp4xe_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3600, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[i430FX] ASUS P/I-P54TP4XE (MR BIOS)", "p54tp4xe_mr", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3600, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_p54tp4xe_mr_init, NULL }, + { "[i430FX] ASUS P/I-P54TP4XE (MR BIOS)", "p54tp4xe_mr", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_p54tp4xe_mr_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3600, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i430FX] Gateway 2000 Thor", "gw2katx", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_gw2katx_init, NULL }, + { "[i430FX] Gateway 2000 Thor", "gw2katx", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_gw2katx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* The BIOS does not send a single non-standard KBC command, but the board has a SMC Super I/O chip with on-chip KBC and AMI MegaKey KBC firmware. */ - { "[i430FX] HP Vectra VL 5 Series 4", "vectra54", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 511, machine_at_vectra54_init, at_vectra54_get_device }, + { "[i430FX] HP Vectra VL 5 Series 4", "vectra54", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_vectra54_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 511, at_vectra54_get_device, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i430FX] Intel Advanced/ATX", "thor", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, machine_at_thor_init, at_thor_get_device }, + { "[i430FX] Intel Advanced/ATX", "thor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_thor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_thor_get_device, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i430FX] Intel Advanced/ATX (MR BIOS)", "mrthor", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_mrthor_init, at_mrthor_get_device }, + { "[i430FX] Intel Advanced/ATX (MR BIOS)", "mrthor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_mrthor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, at_mrthor_get_device, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i430FX] Intel Advanced/EV", "endeavor", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, machine_at_endeavor_init, at_endeavor_get_device }, + { "[i430FX] Intel Advanced/EV", "endeavor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_endeavor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_endeavor_get_device, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[i430FX] MSI MS-5119", "ms5119", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_ms5119_init, NULL }, + { "[i430FX] MSI MS-5119", "ms5119", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_ms5119_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* This most likely uses AMI MegaKey KBC firmware as well due to having the same Super I/O chip (that has the KBC firmware on it) as eg. the Advanced/EV. */ - { "[i430FX] Packard Bell PB640", "pb640", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, machine_at_pb640_init, at_pb640_get_device }, + { "[i430FX] Packard Bell PB640", "pb640", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_pb640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_pb640_get_device, NULL }, /* Has an AMI 'H' KBC firmware (1992). */ - { "[i430FX] QDI FMB", "fmb", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_WINCHIP, CPU_WINCHIP2, CPU_Cx6x86, CPU_Cx6x86L, CPU_Cx6x86MX), 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_fmb_init, NULL }, + { "[i430FX] QDI FMB", "fmb", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_fmb_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_QDI_FMB, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* 430HX */ /* I can't determine what KBC firmware this has, but given that the Acer V35N and V60 have Phoenix MultiKey KBC firmware on the chip, I'm going to assume so does the M3A. */ - { "[i430HX] Acer M3A", "acerm3a", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3300, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 196608, 8192, 127, machine_at_acerm3a_init, NULL }, + { "[i430HX] Acer M3A", "acerm3a", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430HX, machine_at_acerm3a_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3300, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 196608, 8192, 127, NULL, NULL }, /* Has AMIKey F KBC firmware. */ - { "[i430HX] AOpen AP53", "ap53", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3450, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_ap53_init, NULL }, + { "[i430HX] AOpen AP53", "ap53", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430HX, machine_at_ap53_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3450, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* [TEST] Has a VIA 82C42N KBC, with AMIKey F KBC firmware. */ - { "[i430HX] Biostar MB-8500TUC", "8500tuc", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_8500tuc_init, NULL }, + { "[i430HX] Biostar MB-8500TUC", "8500tuc", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430HX, machine_at_8500tuc_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* [TEST] Unable to determine what KBC this has. A list on a Danish site shows the BIOS as having a -0 string, indicating non-AMI KBC firmware. */ - { "[i430HX] Supermicro P55T2S", "p55t2s", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3300, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 127, machine_at_p55t2s_init, NULL }, + { "[i430HX] Supermicro P55T2S", "p55t2s", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430HX, machine_at_p55t2s_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3300, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 786432, 8192, 127, NULL, NULL }, /* 430VX */ /* Has AMIKey H KBC firmware (AMIKey-2). */ - { "[i430VX] ECS P5VX-B", "p5vxb", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_p5vxb_init, NULL }, + { "[i430VX] ECS P5VX-B", "p5vxb", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430VX, machine_at_p5vxb_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i430VX] Gateway 2000 Tigereye", "gw2kte", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_gw2kte_init, NULL }, + { "[i430VX] Gateway 2000 Tigereye", "gw2kte", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430VX, machine_at_gw2kte_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* SiS 5511 */ /* Has AMIKey H KBC firmware (AMIKey-2). */ - { "[SiS 5511] AOpen AP5S", "ap5s", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_ap5s_init, NULL }, + { "[SiS 5511] AOpen AP5S", "ap5s", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_SIS_5511, machine_at_ap5s_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* Socket 7 (Dual Voltage) machines */ /* 430HX */ /* Has SST flash and the SMC FDC73C935's on-chip KBC with Phoenix MultiKey firmware. */ - { "[i430HX] Acer V35N", "acerv35n", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_Cx6x86MX), 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 196608, 8192, 127, machine_at_acerv35n_init, NULL }, + { "[i430HX] Acer V35N", "acerv35n", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430HX, machine_at_acerv35n_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_Cx6x86MX), 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 196608, 8192, 127, NULL, NULL }, /* Has AMIKey H KBC firmware (AMIKey-2). */ - { "[i430HX] ASUS P/I-P55T2P4", "p55t2p4", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 83333333, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 262144, 8192, 127, machine_at_p55t2p4_init, NULL }, + { "[i430HX] ASUS P/I-P55T2P4", "p55t2p4", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430HX, machine_at_p55t2p4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 83333333, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 127, NULL, NULL }, /* Has the SMC FDC73C935's on-chip KBC with Phoenix MultiKey firmware. */ - { "[i430HX] Micronics M7S-Hi", "m7shi", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 511, machine_at_m7shi_init, NULL }, + { "[i430HX] Micronics M7S-Hi", "m7shi", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430HX, machine_at_m7shi_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 511, NULL, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i430HX] Intel TC430HX", "tc430hx", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 255, machine_at_tc430hx_init, NULL }, + { "[i430HX] Intel TC430HX", "tc430hx", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430HX, machine_at_tc430hx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 255, NULL, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i430HX] Toshiba Equium 5200D", "equium5200", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 196608, 8192, 127, machine_at_equium5200_init, NULL }, + { "[i430HX] Toshiba Equium 5200D", "equium5200", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430HX, machine_at_equium5200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 196608, 8192, 127, NULL, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . Yes, this is an Intel AMI BIOS with a fancy splash screen. */ - { "[i430HX] Sony Vaio PCV-90", "pcv90", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 196608, 8192, 127, machine_at_pcv90_init, NULL }, + { "[i430HX] Sony Vaio PCV-90", "pcv90", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430HX, machine_at_pcv90_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 196608, 8192, 127, NULL, NULL }, /* The base board has AMIKey-2 (updated 'H') KBC firmware. */ - { "[i430HX] ASUS P/I-P65UP5 (C-P55T2D)", "p65up5_cp55t2d", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_p65up5_cp55t2d_init, NULL }, + { "[i430HX] ASUS P/I-P65UP5 (C-P55T2D)", "p65up5_cp55t2d", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430HX, machine_at_p65up5_cp55t2d_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* 430VX */ /* This has the VIA VT82C42N KBC. */ - { "[i430VX] AOpen AP5VM", "ap5vm", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2600, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_SCSI, 8192, 131072, 8192, 127, machine_at_ap5vm_init, NULL }, + { "[i430VX] AOpen AP5VM", "ap5vm", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_ap5vm_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2600, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_SCSI, 8192, 131072, 8192, 127, NULL, NULL }, /* Has AMIKey H KBC firmware (AMIKey-2). */ - { "[i430VX] ASUS P/I-P55TVP4", "p55tvp4", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_p55tvp4_init, NULL }, + { "[i430VX] ASUS P/I-P55TVP4", "p55tvp4", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_p55tvp4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* The BIOS does not send a single non-standard KBC command, so it must have a standard IBM PS/2 KBC firmware or a clone thereof. */ - { "[i430VX] Azza PT-5IV", "5ivg", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_5ivg_init, NULL }, + { "[i430VX] Azza PT-5IV", "5ivg", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_5ivg_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* [TEST] Has AMIKey 'F' KBC firmware. */ - { "[i430VX] Biostar MB-8500TVX-A", "8500tvxa", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2600, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_8500tvxa_init, NULL }, + { "[i430VX] Biostar MB-8500TVX-A", "8500tvxa", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_8500tvxa_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2600, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* The BIOS does not send a single non-standard KBC command, but the board has a SMC Super I/O chip with on-chip KBC and AMI MegaKey KBC firmware. */ - { "[i430VX] Compaq Presario 2240", "presario2240", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, machine_at_presario2240_init, at_presario2240_get_device }, + { "[i430VX] Compaq Presario 2240", "presario2240", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario2240_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario2240_get_device, NULL }, /* This most likely has AMI MegaKey as above. */ - { "[i430VX] Compaq Presario 4500", "presario4500", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, machine_at_presario4500_init, at_presario4500_get_device }, + { "[i430VX] Compaq Presario 4500", "presario4500", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario4500_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario4500_get_device, NULL }, /* The BIOS sends KBC command CB which is an AMI KBC command, so it has an AMI KBC firmware. */ - { "[i430VX] Epox P55-VA", "p55va", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_p55va_init, NULL }, + { "[i430VX] Epox P55-VA", "p55va", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_p55va_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* The BIOS does not send a single non-standard KBC command. */ - { "[i430VX] HP Brio 80xx", "brio80xx", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 66666667, 66666667, 2200, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_brio80xx_init, NULL }, + { "[i430VX] HP Brio 80xx", "brio80xx", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_brio80xx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 66666667, 2200, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i430VX] Packard Bell PB680", "pb680", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_pb680_init, NULL }, + { "[i430VX] Packard Bell PB680", "pb680", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_pb680_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* This has the AMIKey 'H' firmware, possibly AMIKey-2. Photos show it with a BestKey, so it likely clones the behavior of AMIKey 'H'. */ - { "[i430VX] PC Partner MB520N", "mb520n", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2600, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_mb520n_init, NULL }, + { "[i430VX] PC Partner MB520N", "mb520n", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_mb520n_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2600, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* This has a Holtek KBC and the BIOS does not send a single non-standard KBC command, so it must be an ASIC that clones the standard IBM PS/2 KBC. */ - { "[i430VX] Shuttle HOT-557", "430vx", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_GAMEPORT, 8192, 131072, 8192, 127, machine_at_i430vx_init, NULL }, + { "[i430VX] Shuttle HOT-557", "430vx", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_i430vx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_GAMEPORT, 8192, 131072, 8192, 127, NULL, NULL }, /* 430TX */ /* The BIOS sends KBC command B8, CA, and CB, so it has an AMI KBC firmware. */ - { "[i430TX] ADLink NuPRO-592", "nupro592", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 66666667, 66666667, 1900, 2800, 1.5, 5.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, machine_at_nupro592_init, NULL }, + { "[i430TX] ADLink NuPRO-592", "nupro592", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_nupro592_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 66666667, 1900, 2800, 1.5, 5.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, /* This has the AMIKey KBC firmware, which is an updated 'F' type (YM430TX is based on the TX97). */ - { "[i430TX] ASUS TX97", "tx97", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 75000000, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, machine_at_tx97_init, NULL }, -#if defined(DEV_BRANCH) && defined(NO_SIO) + { "[i430TX] ASUS TX97", "tx97", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_tx97_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 75000000, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, +#if defined(DEV_BRANCH) && defined(USE_AN430TX) /* This has the Phoenix MultiKey KBC firmware. */ - { "[i430TX] Intel AN430TX", "an430tx", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 60000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, machine_at_an430tx_init, NULL }, + { "[i430TX] Intel AN430TX", "an430tx", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_an430tx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, #endif /* This has the AMIKey KBC firmware, which is an updated 'F' type. */ - { "[i430TX] Intel YM430TX", "ym430tx", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 60000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, machine_at_ym430tx_init, NULL }, + { "[i430TX] Intel YM430TX", "ym430tx", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_ym430tx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, /* The BIOS sends KBC command BB and expects it to output a byte, which is AMI KBC behavior. */ - { "[i430TX] PC Partner MB540N", "mb540n", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 60000000, 66666667, 2700, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, machine_at_mb540n_init, NULL }, + { "[i430TX] PC Partner MB540N", "mb540n", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_mb540n_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 66666667, 2700, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, /* [TEST] Has AMIKey 'H' KBC firmware. */ - { "[i430TX] Supermicro P5MMS98", "p5mms98", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2100, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, machine_at_p5mms98_init, NULL }, + { "[i430TX] Supermicro P5MMS98", "p5mms98", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_p5mms98_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2100, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, /* Apollo VPX */ /* Has the VIA VT82C586B southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA VPX] FIC VA-502", "ficva502", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 75000000, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_ficva502_init, NULL }, + { "[VIA VPX] FIC VA-502", "ficva502", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_VIA_APOLLO_VPX, machine_at_ficva502_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 75000000, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* Apollo VP3 */ /* Has the VIA VT82C586B southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA VP3] FIC PA-2012", "ficpa2012", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 55000000, 75000000, 2100, 3520, 1.5, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 127, machine_at_ficpa2012_init, NULL }, + { "[VIA VP3] FIC PA-2012", "ficpa2012", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_VIA_APOLLO_VP3, machine_at_ficpa2012_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 55000000, 75000000, 2100, 3520, 1.5, 5.5, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 127, NULL, NULL }, /* SiS 5571 */ /* Has the SiS 5571 chipset with on-chip KBC. */ - { "[SiS 5571] Rise R534F", "r534f", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 55000000, 83333333, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 393216, 8192, 127, machine_at_r534f_init, NULL }, + { "[SiS 5571] Rise R534F", "r534f", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_SIS_5571, machine_at_r534f_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 55000000, 83333333, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 393216, 8192, 127, NULL, NULL }, /* Has the SiS 5571 chipset with on-chip KBC. */ - { "[SiS 5571] MSI MS-5146", "ms5146", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 75000000, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 262144, 8192, 127, machine_at_ms5146_init, NULL }, + { "[SiS 5571] MSI MS-5146", "ms5146", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_SIS_5571, machine_at_ms5146_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 75000000, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 127, NULL, NULL }, /* ALi ALADDiN IV+ */ /* Has the ALi M1543 southbridge with on-chip KBC. */ - { "[ALi ALADDiN IV+] PC Chips M560", "m560", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 83333333, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_m560_init, NULL }, + { "[ALi ALADDiN IV+] PC Chips M560", "m560", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_ALI_ALADDIN_IV_PLUS, machine_at_m560_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 83333333, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL }, /* Has the ALi M1543 southbridge with on-chip KBC. */ - { "[ALi ALADDiN IV+] MSI MS-5164", "ms5164", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 60000000, 83333333, 2100, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_ms5164_init, NULL }, + { "[ALi ALADDiN IV+] MSI MS-5164", "ms5164", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_ALI_ALADDIN_IV_PLUS, machine_at_ms5164_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 83333333, 2100, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, /* Super Socket 7 machines */ /* ALi ALADDiN V */ /* Has the ALi M1543C southbridge with on-chip KBC. */ - { "[ALi ALADDiN V] ASUS P5A", "p5a", MACHINE_TYPE_SOCKETS7, CPU_PKG_SOCKET5_7, 0, 60000000, 120000000, 2000, 3520, 1.5, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024,1572864, 8192, 255, machine_at_p5a_init, NULL }, + { "[ALi ALADDiN V] ASUS P5A", "p5a", MACHINE_TYPE_SOCKETS7, MACHINE_CHIPSET_ALI_ALADDIN_V, machine_at_p5a_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 120000000, 2000, 3520, 1.5, 5.5, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 1024, 1572864, 8192, 255, NULL, NULL }, /* Is the exact same as the Matsonic MS6260S. Has the ALi M1543C southbridge with on-chip KBC. */ - { "[ALi ALADDiN V] PC Chips M579", "m579", MACHINE_TYPE_SOCKETS7, CPU_PKG_SOCKET5_7, 0, 66666667, 100000000, 2000, 3520, 1.5, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024,1572864, 8192, 255, machine_at_m579_init, NULL }, + { "[ALi ALADDiN V] PC Chips M579", "m579", MACHINE_TYPE_SOCKETS7, MACHINE_CHIPSET_ALI_ALADDIN_V, machine_at_m579_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 100000000, 2000, 3520, 1.5, 5.5, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 1024, 1572864, 8192, 255, NULL, NULL }, /* Has the ALi M1543C southbridge with on-chip KBC. */ - { "[ALi ALADDiN V] Gigabyte GA-5AA", "5aa", MACHINE_TYPE_SOCKETS7, CPU_PKG_SOCKET5_7, 0, 66666667, 140000000, 1300, 3520, 1.5, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024,1572864, 8192, 255, machine_at_5aa_init, NULL }, + { "[ALi ALADDiN V] Gigabyte GA-5AA", "5aa", MACHINE_TYPE_SOCKETS7, MACHINE_CHIPSET_ALI_ALADDIN_V, machine_at_5aa_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 140000000, 1300, 3520, 1.5, 5.5, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 1024, 1572864, 8192, 255, NULL, NULL }, /* Has the ALi M1543C southbridge with on-chip KBC. */ - { "[ALi ALADDiN V] Gigabyte GA-5AX", "5ax", MACHINE_TYPE_SOCKETS7, CPU_PKG_SOCKET5_7, 0, 66666667, 140000000, 1300, 3520, 1.5, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024,1572864, 8192, 255, machine_at_5ax_init, NULL }, + { "[ALi ALADDiN V] Gigabyte GA-5AX", "5ax", MACHINE_TYPE_SOCKETS7, MACHINE_CHIPSET_ALI_ALADDIN_V, machine_at_5ax_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 140000000, 1300, 3520, 1.5, 5.5, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 1024, 1572864, 8192, 255, NULL, NULL }, /* Apollo MVP3 */ /* Has the VIA VT82C586B southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA MVP3] AOpen AX59 Pro", "ax59pro", MACHINE_TYPE_SOCKETS7, CPU_PKG_SOCKET5_7, 0, 66666667, 124242424, 1300, 3520, 1.5, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_ax59pro_init, NULL }, + { "[VIA MVP3] AOpen AX59 Pro", "ax59pro", MACHINE_TYPE_SOCKETS7, MACHINE_CHIPSET_VIA_APOLLO_MVP3, machine_at_ax59pro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 124242424, 1300, 3520, 1.5, 5.5, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, /* Has the VIA VT82C586B southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA MVP3] FIC VA-503+", "ficva503p", MACHINE_TYPE_SOCKETS7, CPU_PKG_SOCKET5_7, 0, 66666667, 124242424, 2000, 3200, 1.5, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_mvp3_init, NULL }, + { "[VIA MVP3] FIC VA-503+", "ficva503p", MACHINE_TYPE_SOCKETS7, MACHINE_CHIPSET_VIA_APOLLO_MVP3, machine_at_mvp3_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 124242424, 2000, 3200, 1.5, 5.5, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, /* Has the VIA VT82C686A southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA MVP3] FIC VA-503A", "ficva503a", MACHINE_TYPE_SOCKETS7, CPU_PKG_SOCKET5_7, 0, 66666667, 124242424, 1800, 3100, 1.5, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_BUS_AC97 | MACHINE_IDE_DUAL | MACHINE_SOUND, 8192, 786432, 8192, 255, machine_at_ficva503a_init, NULL }, + { "[VIA MVP3] FIC VA-503A", "ficva503a", MACHINE_TYPE_SOCKETS7, MACHINE_CHIPSET_VIA_APOLLO_MVP3, machine_at_ficva503a_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 124242424, 1800, 3100, 1.5, 5.5, MACHINE_PS2_A97, MACHINE_IDE_DUAL | MACHINE_SOUND, 8192, 786432, 8192, 255, NULL, NULL }, /* Has the VIA VT82C686A southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA MVP3] Soyo 5EMA PRO", "5emapro", MACHINE_TYPE_SOCKETS7, CPU_PKG_SOCKET5_7, 0, 66666667, 124242424, 2000, 3520, 1.5, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_5emapro_init, NULL }, + { "[VIA MVP3] Soyo 5EMA PRO", "5emapro", MACHINE_TYPE_SOCKETS7, MACHINE_CHIPSET_VIA_APOLLO_MVP3, machine_at_5emapro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 124242424, 2000, 3520, 1.5, 5.5, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL }, /* Socket 8 machines */ /* 450KX */ /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[i450KX] ASUS P/I-P6RP4", "p6rp4", MACHINE_TYPE_SOCKET8, CPU_PKG_SOCKET8, 0, 60000000, 66666667, 2100, 3500, 1.5, 8.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_p6rp4_init, NULL }, + { "[i450KX] ASUS P/I-P6RP4", "p6rp4", MACHINE_TYPE_SOCKET8, MACHINE_CHIPSET_INTEL_450KX, machine_at_p6rp4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET8, CPU_BLOCK_NONE, 60000000, 66666667, 2100, 3500, 1.5, 8.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* 440FX */ /* Has the SMC FDC73C935's on-chip KBC with Phoenix MultiKey firmware. */ - { "[i440FX] Acer V60N", "acerv60n", MACHINE_TYPE_SOCKET8, CPU_PKG_SOCKET8, 0, 60000000, 66666667, 2500, 3500, 1.5, 8.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_acerv60n_init, NULL }, + { "[i440FX] Acer V60N", "acerv60n", MACHINE_TYPE_SOCKET8, MACHINE_CHIPSET_INTEL_440FX, machine_at_acerv60n_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET8, CPU_BLOCK_NONE, 60000000, 66666667, 2500, 3500, 1.5, 8.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* The base board has AMIKey-2 (updated 'H') KBC firmware. */ - { "[i440FX] ASUS P/I-P65UP5 (C-P6ND)", "p65up5_cp6nd", MACHINE_TYPE_SOCKET8, CPU_PKG_SOCKET8, 0, 60000000, 66666667, 2100, 3500, 1.5, 8.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 127, machine_at_p65up5_cp6nd_init, NULL }, + { "[i440FX] ASUS P/I-P65UP5 (C-P6ND)", "p65up5_cp6nd", MACHINE_TYPE_SOCKET8, MACHINE_CHIPSET_INTEL_440FX, machine_at_p65up5_cp6nd_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET8, CPU_BLOCK_NONE, 60000000, 66666667, 2100, 3500, 1.5, 8.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 127, NULL, NULL }, /* The MB-8600TTX has an AMIKey 'F' KBC firmware, so I'm going to assume so does the MB-8600TTC until someone can actually identify it. */ - { "[i440FX] Biostar MB-8600TTC", "8600ttc", MACHINE_TYPE_SOCKET8, CPU_PKG_SOCKET8, 0, 50000000, 66666667, 2900, 3300, 2.0, 5.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 127, machine_at_8600ttc_init, NULL }, - { "[i440FX] Gigabyte GA-686NX", "686nx", MACHINE_TYPE_SOCKET8, CPU_PKG_SOCKET8, 0, 60000000, 66666667, 2100, 3500, 2.0, 5.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_686nx_init, NULL }, + { "[i440FX] Biostar MB-8600TTC", "8600ttc", MACHINE_TYPE_SOCKET8, MACHINE_CHIPSET_INTEL_440FX, machine_at_8600ttc_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET8, CPU_BLOCK_NONE, 50000000, 66666667, 2900, 3300, 2.0, 5.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 127, NULL, NULL }, + { "[i440FX] Gigabyte GA-686NX", "686nx", MACHINE_TYPE_SOCKET8, MACHINE_CHIPSET_INTEL_440FX, machine_at_686nx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET8, CPU_BLOCK_NONE, 60000000, 66666667, 2100, 3500, 2.0, 5.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i440FX] Intel AP440FX", "ap440fx", MACHINE_TYPE_SOCKET8, CPU_PKG_SOCKET8, 0, 60000000, 66666667, 2100, 3500, 2.0, 3.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_ap440fx_init, NULL }, + { "[i440FX] Intel AP440FX", "ap440fx", MACHINE_TYPE_SOCKET8, MACHINE_CHIPSET_INTEL_440FX, machine_at_ap440fx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET8, CPU_BLOCK_NONE, 60000000, 66666667, 2100, 3500, 2.0, 3.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL }, /* According to tests from real hardware: This has AMI MegaKey KBC firmware on the PC87306 Super I/O chip, command 0xA1 returns '5'. Command 0xA0 copyright string: (C)1994 AMI . */ - { "[i440FX] Intel VS440FX", "vs440fx", MACHINE_TYPE_SOCKET8, CPU_PKG_SOCKET8, 0, 60000000, 66666667, 2100, 3500, 2.0, 3.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_vs440fx_init, NULL }, + { "[i440FX] Intel VS440FX", "vs440fx", MACHINE_TYPE_SOCKET8, MACHINE_CHIPSET_INTEL_440FX, machine_at_vs440fx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET8, CPU_BLOCK_NONE, 60000000, 66666667, 2100, 3500, 2.0, 3.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* Has the SMC FDC73C935's on-chip KBC with Phoenix MultiKey firmware. */ - { "[i440FX] Micronics M6Mi", "m6mi", MACHINE_TYPE_SOCKET8, CPU_PKG_SOCKET8, 0, 60000000, 66666667, 2900, 3300, 1.5, 8.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 127, machine_at_m6mi_init, NULL }, + { "[i440FX] Micronics M6Mi", "m6mi", MACHINE_TYPE_SOCKET8, MACHINE_CHIPSET_INTEL_440FX, machine_at_m6mi_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET8, CPU_BLOCK_NONE, 60000000, 66666667, 2900, 3300, 1.5, 8.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 786432, 8192, 127, NULL, NULL }, /* I found a BIOS string of it that ends in -S, but it could be a typo for -5 (there's quite a few AMI BIOS strings around with typo'd KBC codes), so I'm going to give it an AMI MegaKey. */ - { "[i440FX] PC Partner MB600N", "mb600n", MACHINE_TYPE_SOCKET8, CPU_PKG_SOCKET8, 0, 60000000, 66666667, 2100, 3500, 1.5, 8.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, machine_at_mb600n_init, NULL }, + { "[i440FX] PC Partner MB600N", "mb600n", MACHINE_TYPE_SOCKET8, MACHINE_CHIPSET_INTEL_440FX, machine_at_mb600n_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET8, CPU_BLOCK_NONE, 60000000, 66666667, 2100, 3500, 1.5, 8.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 127, NULL, NULL }, /* Slot 1 machines */ /* ALi ALADDiN V */ /* Has the ALi M1543C southbridge with on-chip KBC. */ - { "[ALi ALADDiN-PRO II] PC Chips M729", "m729", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024,1572864, 8192, 255, machine_at_m729_init, NULL }, + { "[ALi ALADDiN-PRO II] PC Chips M729", "m729", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_ALI_ALADDIN_PRO_II, machine_at_m729_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 1024, 1572864, 8192, 255, NULL, NULL }, /* 440FX */ /* The base board has AMIKey-2 (updated 'H') KBC firmware. */ - { "[i440FX] ASUS P/I-P65UP5 (C-PKND)", "p65up5_cpknd", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 50000000, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 127, machine_at_p65up5_cpknd_init, NULL }, + { "[i440FX] ASUS P/I-P65UP5 (C-PKND)", "p65up5_cpknd", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440FX, machine_at_p65up5_cpknd_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 50000000, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 127, NULL, NULL }, /* This has a Holtek KBC and the BIOS does not send a single non-standard KBC command, so it must be an ASIC that clones the standard IBM PS/2 KBC. */ - { "[i440FX] ASUS KN97", "kn97", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 60000000, 83333333, 1800, 3500, 1.5, 8.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 127, machine_at_kn97_init, NULL }, + { "[i440FX] ASUS KN97", "kn97", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440FX, machine_at_kn97_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 60000000, 83333333, 1800, 3500, 1.5, 8.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 786432, 8192, 127, NULL, NULL }, /* 440LX */ /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440LX] ABIT LX6", "lx6", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 60000000, 100000000, 1500, 3500, 2.0, 5.5, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_lx6_init, NULL }, + { "[i440LX] ABIT LX6", "lx6", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440LX, machine_at_lx6_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 60000000, 100000000, 1500, 3500, 2.0, 5.5, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, /* Has a SM(S)C FDC37C935 Super I/O chip with on-chip KBC with Phoenix MultiKey KBC firmware. */ - { "[i440LX] Micronics Spitfire", "spitfire", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_spitfire_init, NULL }, + { "[i440LX] Micronics Spitfire", "spitfire", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440LX, machine_at_spitfire_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, /* 440EX */ /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440EX] QDI EXCELLENT II", "p6i440e2", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 83333333, 1800, 3500, 3.0, 8.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 255, machine_at_p6i440e2_init, NULL }, + { "[i440EX] QDI EXCELLENT II", "p6i440e2", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440EX, machine_at_p6i440e2_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 83333333, 1800, 3500, 3.0, 8.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 524288, 8192, 255, NULL, NULL }, /* 440BX */ /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] ASUS P2B-LS", "p2bls", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 50000000, 112121212, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_p2bls_init, NULL }, + { "[i440BX] ASUS P2B-LS", "p2bls", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_p2bls_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 50000000, 112121212, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] ASUS P3B-F", "p3bf", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_p3bf_init, NULL }, + { "[i440BX] ASUS P3B-F", "p3bf", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_p3bf_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] ABIT BF6", "bf6", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 133333333, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_bf6_init, NULL }, + { "[i440BX] ABIT BF6", "bf6", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_bf6_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 133333333, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL }, /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] AOpen AX6BC", "ax6bc", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 112121212, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_ax6bc_init, NULL }, + { "[i440BX] AOpen AX6BC", "ax6bc", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_ax6bc_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 112121212, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL }, /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] Gigabyte GA-686BX", "686bx", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_686bx_init, NULL }, + { "[i440BX] Gigabyte GA-686BX", "686bx", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_686bx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, NULL, NULL }, /* Has a SM(S)C FDC37M60x Super I/O chip with on-chip KBC with most likely AMIKey-2 KBC firmware. */ - { "[i440BX] HP Vectra VEi 8", "vei8", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_vei8_init, NULL }, + { "[i440BX] HP Vectra VEi 8", "vei8", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_vei8_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, NULL, NULL }, /* Has a National Semiconductors PC87309 Super I/O chip with on-chip KBC with most likely AMIKey-2 KBC firmware. */ - { "[i440BX] Tyan Tsunami ATX", "s1846", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 112121212, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_SOUND, 8192,1048576, 8192, 255, machine_at_s1846_init, at_s1846_get_device }, + { "[i440BX] Tyan Tsunami ATX", "s1846", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1846_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 112121212, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 8192,1048576, 8192, 255, at_s1846_get_device, NULL }, /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] Supermicro P6SBA", "p6sba", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_p6sba_init, NULL }, + { "[i440BX] Supermicro P6SBA", "p6sba", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_p6sba_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL }, /* 440ZX */ /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440ZX] MSI MS-6168", "ms6168", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_SOUND,8192, 524288, 8192, 255, machine_at_ms6168_init, at_ms6168_get_device }, + { "[i440ZX] MSI MS-6168", "ms6168", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_ms6168_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_ms6168_get_device, NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440ZX] Packard Bell Bora Pro", "borapro", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_SOUND,8192, 524288, 8192, 255, machine_at_borapro_init, at_borapro_get_device }, + { "[i440ZX] Packard Bell Bora Pro", "borapro", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_borapro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_borapro_get_device, NULL }, /* SMSC VictoryBX-66 */ /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[SMSC VictoryBX-66] A-Trend ATC6310BXII","atc6310bxii", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_atc6310bxii_init, NULL }, + { "[SMSC VictoryBX-66] A-Trend ATC6310BXII", "atc6310bxii", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_SMSC_VICTORYBX_66, machine_at_atc6310bxii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL }, /* VIA Apollo Pro */ /* Has the VIA VT82C596B southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA Apollo Pro] FIC KA-6130", "ficka6130", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 255, machine_at_ficka6130_init, NULL }, + { "[VIA Apollo Pro] FIC KA-6130", "ficka6130", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_VIA_APOLLO_PRO, machine_at_ficka6130_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 524288, 8192, 255, NULL, NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[VIA Apollo Pro 133] ASUS P3V133", "p3v133", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1572864, 8192, 255, machine_at_p3v133_init, NULL }, + { "[VIA Apollo Pro 133] ASUS P3V133", "p3v133", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_VIA_APOLLO_PRO_133, machine_at_p3v133_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1572864, 8192, 255, NULL, NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[VIA Apollo Pro 133A] ASUS P3V4X", "p3v4x", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,2097152, 8192, 255, machine_at_p3v4x_init, NULL }, + { "[VIA Apollo Pro 133A] ASUS P3V4X", "p3v4x", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_p3v4x_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 2097152, 8192, 255, NULL, NULL }, /* Slot 1/2 machines */ /* 440GX */ /* Has a National Semiconductors PC87309 Super I/O chip with on-chip KBC with most likely AMIKey-2 KBC firmware. */ - { "[i440GX] Freeway FW-6400GX", "fw6400gx", MACHINE_TYPE_SLOT1_2, CPU_PKG_SLOT1 | CPU_PKG_SLOT2, 0, 100000000, 150000000, 1800, 3500, 3.0, 8.0, (MACHINE_AGP & ~MACHINE_AT) | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 16384,2080768,16384, 511, machine_at_fw6400gx_init, NULL }, + { "[i440GX] Freeway FW-6400GX", "fw6400gx", MACHINE_TYPE_SLOT1_2, MACHINE_CHIPSET_INTEL_440GX, machine_at_fw6400gx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1 | CPU_PKG_SLOT2, CPU_BLOCK_NONE, 100000000, 150000000, 1800, 3500, 3.0, 8.0, MACHINE_PS2_NOISA, MACHINE_IDE_DUAL, 16384, 2080768, 16384, 511, NULL, NULL }, /* Slot 1/Socket 370 machines */ /* 440BX */ /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] Tyan Trinity 371", "s1857", MACHINE_TYPE_SLOT1_370, CPU_PKG_SLOT1 | CPU_PKG_SOCKET370, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_s1857_init, at_s1857_get_device }, + { "[i440BX] Tyan Trinity 371", "s1857", MACHINE_TYPE_SLOT1_370, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1857_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1 | CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, at_s1857_get_device, NULL }, /* Slot 2 machines */ /* 440GX */ /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440GX] Gigabyte GA-6GXU", "6gxu", MACHINE_TYPE_SLOT2, CPU_PKG_SLOT2, 0, 100000000, 133333333, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 16384,2097152,16384, 511, machine_at_6gxu_init, NULL }, + { "[i440GX] Gigabyte GA-6GXU", "6gxu", MACHINE_TYPE_SLOT2, MACHINE_CHIPSET_INTEL_440GX, machine_at_6gxu_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT2, CPU_BLOCK_NONE, 100000000, 133333333, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 16384,2097152,16384, 511, NULL, NULL }, /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440GX] Supermicro S2DGE", "s2dge", MACHINE_TYPE_SLOT2, CPU_PKG_SLOT2, 0, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 16384,2097152,16384, 511, machine_at_s2dge_init, NULL }, + { "[i440GX] Supermicro S2DGE", "s2dge", MACHINE_TYPE_SLOT2, MACHINE_CHIPSET_INTEL_440GX, machine_at_s2dge_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT2, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 16384,2097152,16384, 511, NULL, NULL }, /* PGA370 machines */ /* 440LX */ /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440LX] Supermicro 370SLM", "s370slm", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 100000000, 1800, 3500, MACHINE_MULTIPLIER_FIXED, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_s370slm_init, NULL }, + { "[i440LX] Supermicro 370SLM", "s370slm", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_INTEL_440LX, machine_at_s370slm_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL }, /* 440BX */ /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] AEWIN AW-O671R", "awo671r", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, /* limits assumed */ MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 255, machine_at_awo671r_init, NULL }, + { "[i440BX] AEWIN AW-O671R", "awo671r", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_INTEL_440BX, machine_at_awo671r_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, /* limits assumed */ MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 524288, 8192, 255, NULL, NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] ASUS CUBX", "cubx", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_cubx_init, NULL }, + { "[i440BX] ASUS CUBX", "cubx", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_INTEL_440BX, machine_at_cubx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] AmazePC AM-BX133", "ambx133", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, /* limits assumed */ MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_ambx133_init, NULL }, + { "[i440BX] AmazePC AM-BX133", "ambx133", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_INTEL_440BX, machine_at_ambx133_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, /* limits assumed */ MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL }, /* 440ZX */ /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440ZX] Soltek SL-63A1", "63a1", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 524288, 8192, 255, machine_at_63a1_init, NULL }, + { "[i440ZX] Soltek SL-63A1", "63a1", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_INTEL_440ZX, machine_at_63a1_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 524288, 8192, 255, NULL, NULL }, /* SMSC VictoryBX-66 */ /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[SMSC VictoryBX-66] A-Trend ATC7020BXII","atc7020bxii", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_atc7020bxii_init, NULL }, + { "[SMSC VictoryBX-66] A-Trend ATC7020BXII", "atc7020bxii", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_SMSC_VICTORYBX_66, machine_at_atc7020bxii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, /* VIA Apollo Pro */ /* Has the VIA VT82C586B southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA Apollo Pro] PC Partner APAS3", "apas3", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_apas3_init, NULL }, + { "[VIA Apollo Pro] PC Partner APAS3", "apas3", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO, machine_at_apas3_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[VIA Apollo Pro 133] ECS P6BAP", "p6bap", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1572864, 8192, 255, machine_at_p6bap_init, NULL }, + { "[VIA Apollo Pro 133] ECS P6BAP", "p6bap", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133, machine_at_p6bap_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 1572864, 8192, 255, NULL, NULL }, /* Has the VIA VT82C686B southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA Apollo Pro 133A] Acorp 6VIA90AP", "6via90ap", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 150000000, 1300, 3500, MACHINE_MULTIPLIER_FIXED, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_BUS_AC97 | MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_GAMEPORT, 16384,3145728, 8192, 255, machine_at_6via90ap_init, NULL }, + { "[VIA Apollo Pro 133A] Acorp 6VIA90AP", "6via90ap", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_6via90ap_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_A97, MACHINE_IDE_DUAL | MACHINE_AG, 16384, 3145728, 8192, 255, NULL, NULL }, /* Has the VIA VT82C686B southbridge with on-chip KBC identical to the VIA VT82C42N. */ - { "[VIA Apollo Pro 133A] ASUS CUV4X-LS", "cuv4xls", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 150000000, 1300, 3500, 1.5, 8.0, (MACHINE_AGP & ~MACHINE_AT) | MACHINE_BUS_PS2 | MACHINE_BUS_AC97 | MACHINE_IDE_DUAL | MACHINE_SOUND, 16384,4194304, 8192, 255, machine_at_cuv4xls_init, at_cuv4xls_get_device }, + { "[VIA Apollo Pro 133A] ASUS CUV4X-LS", "cuv4xls", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_cuv4xls_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_NOI97, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 4194304, 8192, 255, at_cuv4xls_get_device, NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[VIA Apollo Pro 133A] BCM GT694VA", "gt694va", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_SOUND, 16384,3145728, 8192, 255, machine_at_gt694va_init, at_gt694va_get_device }, + { "[VIA Apollo Pro 133A] BCM GT694VA", "gt694va", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_gt694va_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 3145728, 8192, 255, at_gt694va_get_device, NULL }, /* Miscellaneous/Fake/Hypervisor machines */ /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ - { "[i440BX] Microsoft Virtual PC 2007", "vpc2007", MACHINE_TYPE_MISC, CPU_PKG_SLOT1, CPU_BLOCK(CPU_PENTIUM2, CPU_CYRIX3S), 0, 66666667, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_vpc2007_init, NULL }, + { "[i440BX] Microsoft Virtual PC 2007", "vpc2007", MACHINE_TYPE_MISC, MACHINE_CHIPSET_INTEL_440BX, machine_at_vpc2007_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK(CPU_PENTIUM2, CPU_CYRIX3S), 0, 66666667, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL }, - { NULL, NULL, MACHINE_TYPE_NONE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL } + { NULL, NULL, MACHINE_TYPE_NONE, MACHINE_CHIPSET_NONE, NULL, 0, 0, MACHINE_AVAILABLE, 0 , 0, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_BUS_NONE, MACHINE_FLAGS_NONE, 0, 0, 0, 0, NULL, NULL } }; - int machine_count(void) { return((sizeof(machines) / sizeof(machine_t)) - 1); } - char * machine_getname(void) { return((char *)machines[machine].name); } - char * machine_getname_ex(int m) { return((char *)machines[m].name); } - const device_t * machine_getdevice(int m) { if (machines[m].get_device) - return(machines[m].get_device()); + return(machines[m].get_device()); return(NULL); } +const device_t * +machine_getviddevice(int m) +{ + if (machines[m].get_vid_device) + return(machines[m].get_vid_device()); + + return(NULL); +} char * machine_get_internal_name(void) @@ -966,49 +1049,42 @@ machine_get_internal_name(void) return((char *)machines[machine].internal_name); } - char * machine_get_internal_name_ex(int m) { return((char *)machines[m].internal_name); } - int machine_get_nvrmask(int m) { return(machines[m].nvrmask); } - int machine_has_flags(int m, int flags) { return(machines[m].flags & flags); } - int machine_has_bus(int m, int bus_flags) { - return(machines[m].flags & bus_flags); + return(machines[m].bus_flags & bus_flags); } - int machine_has_cartridge(int m) { - return(machine_has_flags(m, MACHINE_CARTRIDGE) ? 1 : 0); + return(machine_has_bus(m, MACHINE_CARTRIDGE) ? 1 : 0); } - int machine_get_min_ram(int m) { return(machines[m].min_ram); } - int machine_get_max_ram(int m) { @@ -1019,30 +1095,27 @@ machine_get_max_ram(int m) #endif } - int machine_get_ram_granularity(int m) { return(machines[m].ram_granularity); } - int machine_get_type(int m) { return(machines[m].type); } - int machine_get_machine_from_internal_name(char *s) { int c = 0; while (machines[c].init != NULL) { - if (!strcmp(machines[c].internal_name, (const char *)s)) - return(c); - c++; + if (!strcmp(machines[c].internal_name, (const char *)s)) + return(c); + c++; } return(0); diff --git a/src/mem/mem.c b/src/mem/mem.c index bdb0c4cdb..4a54c72f2 100644 --- a/src/mem/mem.c +++ b/src/mem/mem.c @@ -2210,8 +2210,6 @@ void mem_invalidate_range(uint32_t start_addr, uint32_t end_addr) { #ifdef USE_NEW_DYNAREC - int byte_offset; - uint64_t byte_mask; page_t *p; start_addr &= ~PAGE_MASK_MASK; diff --git a/src/mem/rom.c b/src/mem/rom.c index 3dcbfe568..62b03bc11 100644 --- a/src/mem/rom.c +++ b/src/mem/rom.c @@ -33,6 +33,7 @@ #include "cpu.h" #include <86box/mem.h> #include <86box/rom.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/machine.h> #include <86box/m_xt_xi8088.h> @@ -57,47 +58,59 @@ rom_log(const char *fmt, ...) #define rom_log(fmt, ...) #endif +void +rom_add_path(const char* path) +{ + char cwd[1024] = { 0 }; + + rom_path_t* rom_path = &rom_paths; + + if (rom_paths.path[0] != '\0') + { + // Iterate to the end of the list. + while (rom_path->next != NULL) { + rom_path = rom_path->next; + } + + // Allocate the new entry. + rom_path = rom_path->next = calloc(1, sizeof(rom_path_t)); + } + + // Save the path, turning it into absolute if needed. + if (!path_abs((char*) path)) { + plat_getcwd(cwd, sizeof(cwd)); + path_slash(cwd); + snprintf(rom_path->path, sizeof(rom_path->path), "%s%s", cwd, path); + } else { + snprintf(rom_path->path, sizeof(rom_path->path), "%s", path); + } + + // Ensure the path ends with a separator. + path_slash(rom_path->path); +} + FILE * rom_fopen(char *fn, char *mode) { char temp[1024]; - char *fn2; + rom_path_t *rom_path; + FILE *fp = NULL; - if ((strstr(fn, "roms/") == fn) || (strstr(fn, "roms\\") == fn)) { - /* Relative path */ - fn2 = (char *) malloc(strlen(fn) + 1); - memcpy(fn2, fn, strlen(fn) + 1); + if (strstr(fn, "roms/") == fn) { + /* Relative path */ + for (rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) { + path_append_filename(temp, rom_path->path, fn + 5); - if (rom_paths.next) { - rom_path_t* cur_rom_path = &rom_paths; - memset(fn2, 0x00, strlen(fn) + 1); - memcpy(fn2, &(fn[5]), strlen(fn) - 4); - - while (cur_rom_path->next) { - memset(temp, 0, sizeof(temp)); - plat_append_filename(temp, cur_rom_path->rom_path, fn2); - if (rom_present(temp)) { - break; + if ((fp = plat_fopen(temp, mode)) != NULL) { + return fp; } - cur_rom_path = cur_rom_path->next; } - } else { - /* Make sure to make it a backslash, just in case there's malformed - code calling us that assumes Windows. */ - if (fn2[4] == '\\') - fn2[4] = '/'; - plat_append_filename(temp, exe_path, fn2); - } - - free(fn2); - fn2 = NULL; - - return(plat_fopen(temp, mode)); + return fp; } else { - /* Absolute path */ - return(plat_fopen(fn, mode)); + /* Absolute path */ + return plat_fopen(fn, mode); } } @@ -105,54 +118,30 @@ rom_fopen(char *fn, char *mode) int rom_getfile(char *fn, char *s, int size) { - char temp[1024] = {'\0'}; - char *fn2; - int retval = 0; + char temp[1024]; + rom_path_t *rom_path; - if ((strstr(fn, "roms/") == fn) || (strstr(fn, "roms\\") == fn)) { - /* Relative path */ - fn2 = (char *) malloc(strlen(fn) + 1); - memcpy(fn2, fn, strlen(fn) + 1); + if (strstr(fn, "roms/") == fn) { + /* Relative path */ + for (rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) { + path_append_filename(temp, rom_path->path, fn + 5); - if (rom_paths.next) { - rom_path_t* cur_rom_path = &rom_paths; - memset(fn2, 0x00, strlen(fn) + 1); - memcpy(fn2, &(fn[5]), strlen(fn) - 4); - - while (cur_rom_path->next) { - memset(temp, 0, sizeof(temp)); - plat_append_filename(temp, cur_rom_path->rom_path, fn2); if (rom_present(temp)) { strncpy(s, temp, size); - retval = 1; - break; + return 1; } - cur_rom_path = cur_rom_path->next; } - } else { - /* Make sure to make it a backslash, just in case there's malformed - code calling us that assumes Windows. */ - if (fn2[4] == '\\') - fn2[4] = '/'; - plat_append_filename(temp, exe_path, fn2); - if (rom_present(temp)) { - strncpy(s, temp, size); - retval = 1; - } - } - - free(fn2); - fn2 = NULL; + return 0; } else { /* Absolute path */ if (rom_present(fn)) { strncpy(s, fn, size); - retval = 1; + return 1; } - } - return(retval); + return 0; + } } @@ -163,8 +152,8 @@ rom_present(char *fn) f = rom_fopen(fn, "rb"); if (f != NULL) { - (void)fclose(f); - return(1); + (void)fclose(f); + return(1); } return(0); diff --git a/src/mem/spd.c b/src/mem/spd.c index 96df99867..aab1511d6 100644 --- a/src/mem/spd.c +++ b/src/mem/spd.c @@ -405,7 +405,7 @@ void spd_write_drbs_with_ext(uint8_t *regs, uint8_t reg_min, uint8_t reg_max, uint8_t drb_unit) { uint8_t row, dimm, drb; - uint16_t size, row_val, rows[SPD_MAX_SLOTS]; + uint16_t size, row_val = 0, rows[SPD_MAX_SLOTS]; int shift; /* No SPD: split SIMMs into pairs as if they were "DIMM"s. */ diff --git a/src/network/net_3c503.c b/src/network/net_3c503.c index 03d224a4a..bb2ed1628 100644 --- a/src/network/net_3c503.c +++ b/src/network/net_3c503.c @@ -635,59 +635,88 @@ threec503_nic_close(void *priv) free(dev); } - static const device_config_t threec503_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 }, - { - { "0x250", 0x250 }, - { "0x280", 0x280 }, - { "0x2a0", 0x2a0 }, - { "0x2e0", 0x2e0 }, - { "0x300", 0x300 }, - { "0x310", 0x310 }, - { "0x330", 0x330 }, - { "0x350", 0x350 }, - { "", 0 } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x300, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x250", .value = 0x250 }, + { .description = "0x280", .value = 0x280 }, + { .description = "0x2a0", .value = 0x2a0 }, + { .description = "0x2e0", .value = 0x2e0 }, + { .description = "0x300", .value = 0x300 }, + { .description = "0x310", .value = 0x310 }, + { .description = "0x330", .value = 0x330 }, + { .description = "0x350", .value = 0x350 }, + { .description = "", .value = 0 } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 5", 5 }, - { "", 0 } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "", .value = 0 } }, }, { - "dma", "DMA", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { "DMA 1", 1 }, - { "DMA 2", 2 }, - { "DMA 3", 3 }, - { "", 0 } + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "DMA 1", .value = 1 }, + { .description = "DMA 2", .value = 2 }, + { .description = "DMA 3", .value = 3 }, + { .description = "", .value = 0 } }, }, { - "mac", "MAC Address", CONFIG_MAC, "", -1, "", { 0 }, - { - { "", 0 } + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "", .value = 0 } }, }, { - "bios_addr", "BIOS address", CONFIG_HEX20, "", 0xCC000, "", { 0 }, - { - { "DC00", 0xDC000 }, - { "D800", 0xD8000 }, - { "C800", 0xC8000 }, - { "CC00", 0xCC000 }, - { "", 0 } + .name = "bios_addr", + .description = "BIOS address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xCC000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "DC00", .value = 0xDC000 }, + { .description = "D800", .value = 0xD8000 }, + { .description = "C800", .value = 0xC8000 }, + { .description = "CC00", .value = 0xCC000 }, + { .description = "", .value = 0 } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format off }; diff --git a/src/network/net_dp8390.c b/src/network/net_dp8390.c index 7dfcf8c34..819412454 100644 --- a/src/network/net_dp8390.c +++ b/src/network/net_dp8390.c @@ -1110,7 +1110,6 @@ dp8390_close(void *priv) } } - const device_t dp8390_device = { .name = "DP8390 Network Interface Controller", .internal_name = "dp8390", diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 1161a5a9c..5c0a7ba61 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -1142,86 +1142,152 @@ nic_close(void *priv) // clang-format off static const device_config_t ne1000_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 }, - { - { "0x280", 0x280 }, - { "0x300", 0x300 }, - { "0x320", 0x320 }, - { "0x340", 0x340 }, - { "0x360", 0x360 }, - { "0x380", 0x380 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x300, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x280", .value = 0x280 }, + { .description = "0x300", .value = 0x300 }, + { .description = "0x320", .value = 0x320 }, + { .description = "0x340", .value = 0x340 }, + { .description = "0x360", .value = 0x360 }, + { .description = "0x380", .value = 0x380 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "IRQ 10", 10 }, - { "IRQ 11", 11 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "" } }, }, - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t ne2000_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 }, - { - { "0x280", 0x280 }, - { "0x300", 0x300 }, - { "0x320", 0x320 }, - { "0x340", 0x340 }, - { "0x360", 0x360 }, - { "0x380", 0x380 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x300, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x280", .value = 0x280 }, + { .description = "0x300", .value = 0x300 }, + { .description = "0x320", .value = 0x320 }, + { .description = "0x340", .value = 0x340 }, + { .description = "0x360", .value = 0x360 }, + { .description = "0x380", .value = 0x380 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 10, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "IRQ 10", 10 }, - { "IRQ 11", 11 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 10, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "" } }, }, - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, { - "bios_addr", "BIOS address", CONFIG_HEX20, "", 0, "", { 0 }, - { - { "Disabled", 0x00000 }, - { "D000", 0xD0000 }, - { "D800", 0xD8000 }, - { "C800", 0xC8000 }, - { "" } + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { + .name = "bios_addr", + .description = "BIOS address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "D000", .value = 0xD0000 }, + { .description = "D800", .value = 0xD8000 }, + { .description = "C800", .value = 0xC8000 }, + { .description = "" } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t rtl8019as_config[] = { - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t rtl8029as_config[] = { - { "bios", "Enable BIOS", CONFIG_BINARY, "", 0 }, - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "bios", + .description = "Enable BIOS", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t mca_mac_config[] = { - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on diff --git a/src/network/net_pcap.c b/src/network/net_pcap.c index 52573907b..c76b62581 100644 --- a/src/network/net_pcap.c +++ b/src/network/net_pcap.c @@ -55,6 +55,7 @@ #include <86box/device.h> #include <86box/plat.h> #include <86box/plat_dynld.h> +#include <86box/thread.h> #include <86box/network.h> @@ -122,6 +123,7 @@ static const unsigned char *(*f_pcap_next)(void *,void *); static int (*f_pcap_sendpacket)(void *,const unsigned char *,int); static void (*f_pcap_close)(void *); +static int (*f_pcap_setnonblock)(void*, int, char*); static dllimp_t pcap_imports[] = { { "pcap_lib_version", &f_pcap_lib_version }, { "pcap_findalldevs", &f_pcap_findalldevs }, @@ -132,6 +134,7 @@ static dllimp_t pcap_imports[] = { { "pcap_next", &f_pcap_next }, { "pcap_sendpacket", &f_pcap_sendpacket }, { "pcap_close", &f_pcap_close }, + { "pcap_setnonblock", &f_pcap_setnonblock }, { NULL, NULL }, }; @@ -382,6 +385,9 @@ net_pcap_reset(const netcard_t *card, uint8_t *mac) pcap_log(" Unable to open device: %s!\n", network_host); return(-1); } + if (f_pcap_setnonblock((void*)pcap, 1, errbuf) != 0) + pcap_log("PCAP: failed nonblock %s\n", errbuf); + pcap_log("PCAP: interface: %s\n", network_host); /* Create a MAC address based packet filter. */ diff --git a/src/network/net_pcnet.c b/src/network/net_pcnet.c index 6dd22315d..047624dad 100644 --- a/src/network/net_pcnet.c +++ b/src/network/net_pcnet.c @@ -3078,68 +3078,116 @@ pcnet_close(void *priv) // clang-format off static const device_config_t pcnet_pci_config[] = { - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t pcnet_isa_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 }, - { - { "0x300", 0x300 }, - { "0x320", 0x320 }, - { "0x340", 0x340 }, - { "0x360", 0x360 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x300, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x300", .value = 0x300 }, + { .description = "0x320", .value = 0x320 }, + { .description = "0x340", .value = 0x340 }, + { .description = "0x360", .value = 0x360 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 5", 5 }, - { "IRQ 9", 9 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 9", .value = 9 }, + { .description = "" } }, }, { - "dma", "DMA channel", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "DMA 3", 3 }, - { "DMA 5", 5 }, - { "DMA 6", 6 }, - { "DMA 7", 7 }, - { "" } + .name = "dma", + .description = "DMA channel", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "DMA 3", .value = 3 }, + { .description = "DMA 5", .value = 5 }, + { .description = "DMA 6", .value = 6 }, + { .description = "DMA 7", .value = 7 }, + { .description = "" } }, }, - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t pcnet_vlb_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 }, - { - { "0x300", 0x300 }, - { "0x320", 0x320 }, - { "0x340", 0x340 }, - { "0x360", 0x360 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x300, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x300", .value = 0x300 }, + { .description = "0x320", .value = 0x320 }, + { .description = "0x340", .value = 0x340 }, + { .description = "0x360", .value = 0x360 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 5", 5 }, - { "IRQ 9", 9 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 9", .value = 9 }, + { .description = "" } }, }, - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on diff --git a/src/network/net_plip.c b/src/network/net_plip.c index e8e7df008..6da355632 100644 --- a/src/network/net_plip.c +++ b/src/network/net_plip.c @@ -490,7 +490,6 @@ plip_close(void *priv) free(priv); } - const lpt_device_t lpt_plip_device = { .name = "Parallel Line Internet Protocol", .internal_name = "plip", diff --git a/src/network/net_slirp.c b/src/network/net_slirp.c index fc4afcf78..bc7c68783 100644 --- a/src/network/net_slirp.c +++ b/src/network/net_slirp.c @@ -30,6 +30,7 @@ #include <86box/86box.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/network.h> #include <86box/machine.h> #include <86box/timer.h> diff --git a/src/network/net_wd8003.c b/src/network/net_wd8003.c index be6c46905..81e6d91ec 100644 --- a/src/network/net_wd8003.c +++ b/src/network/net_wd8003.c @@ -738,156 +738,246 @@ wd_close(void *priv) // clang-format off static const device_config_t wd8003_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 }, - { - { "0x240", 0x240 }, - { "0x280", 0x280 }, - { "0x300", 0x300 }, - { "0x380", 0x380 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x300, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x240", .value = 0x240 }, + { .description = "0x280", .value = 0x280 }, + { .description = "0x300", .value = 0x300 }, + { .description = "0x380", .value = 0x380 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "" } }, }, { - "ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 }, - { - { "C800", 0xC8000 }, - { "CC00", 0xCC000 }, - { "D000", 0xD0000 }, - { "D400", 0xD4000 }, - { "D800", 0xD8000 }, - { "DC00", 0xDC000 }, - { "" } + .name = "ram_addr", + .description = "RAM address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xD0000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "C800", .value = 0xC8000 }, + { .description = "CC00", .value = 0xCC000 }, + { .description = "D000", .value = 0xD0000 }, + { .description = "D400", .value = 0xD4000 }, + { .description = "D800", .value = 0xD8000 }, + { .description = "DC00", .value = 0xDC000 }, + { .description = "" } }, }, - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t wd8003eb_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 }, - { - { "0x200", 0x200 }, - { "0x220", 0x220 }, - { "0x240", 0x240 }, - { "0x260", 0x260 }, - { "0x280", 0x280 }, - { "0x2A0", 0x2A0 }, - { "0x2C0", 0x2C0 }, - { "0x300", 0x300 }, - { "0x340", 0x340 }, - { "0x380", 0x380 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x280, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x200", .value = 0x200 }, + { .description = "0x220", .value = 0x220 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x260", .value = 0x260 }, + { .description = "0x280", .value = 0x280 }, + { .description = "0x2A0", .value = 0x2A0 }, + { .description = "0x2C0", .value = 0x2C0 }, + { .description = "0x300", .value = 0x300 }, + { .description = "0x340", .value = 0x340 }, + { .description = "0x380", .value = 0x380 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { "IRQ 2/9", 9 }, - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 7", 7 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2/9", .value = 9 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "" } }, }, { - "ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 }, - { - { "C000", 0xC0000 }, - { "C400", 0xC4000 }, - { "C800", 0xC8000 }, - { "CC00", 0xCC000 }, - { "D000", 0xD0000 }, - { "D400", 0xD4000 }, - { "D800", 0xD8000 }, - { "DC00", 0xDC000 }, - { "" } + .name = "ram_addr", + .description = "RAM address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xD0000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "C000", .value = 0xC0000 }, + { .description = "C400", .value = 0xC4000 }, + { .description = "C800", .value = 0xC8000 }, + { .description = "CC00", .value = 0xCC000 }, + { .description = "D000", .value = 0xD0000 }, + { .description = "D400", .value = 0xD4000 }, + { .description = "D800", .value = 0xD8000 }, + { .description = "DC00", .value = 0xDC000 }, + { .description = "" } }, }, { - "ram_size", "RAM size", CONFIG_SELECTION, "", 8192, "", { 0 }, - { - { "8 kB", 8192 }, - { "32 kB", 32768 }, - { "" } + .name = "ram_size", + .description = "RAM size", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 8192, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "8 kB", .value = 8192 }, + { .description = "32 kB", .value = 32768 }, + { .description = "" } }, }, - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; /* WD8013EBT configuration and defaults set according to this site: http://www.stack.nl/~marcolz/network/wd80x3.html#WD8013EBT */ static const device_config_t wd8013_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 }, - { - { "0x200", 0x200 }, - { "0x220", 0x220 }, - { "0x240", 0x240 }, - { "0x260", 0x260 }, - { "0x280", 0x280 }, - { "0x2A0", 0x2A0 }, - { "0x2C0", 0x2C0 }, - { "0x300", 0x300 }, - { "0x340", 0x340 }, - { "0x380", 0x380 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x280, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x200", .value = 0x200 }, + { .description = "0x220", .value = 0x220 }, + { .description = "0x240", .value = 0x240 }, + { .description = "0x260", .value = 0x260 }, + { .description = "0x280", .value = 0x280 }, + { .description = "0x2A0", .value = 0x2A0 }, + { .description = "0x2C0", .value = 0x2C0 }, + { .description = "0x300", .value = 0x300 }, + { .description = "0x340", .value = 0x340 }, + { .description = "0x380", .value = 0x380 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { "IRQ 2/9", 9 }, - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "IRQ 10", 10 }, - { "IRQ 11", 11 }, - { "IRQ 15", 15 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2/9", .value = 9 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 15", .value = 15 }, + { .description = "" } }, }, { - "ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 }, - { - { "C000", 0xC0000 }, - { "C400", 0xC4000 }, - { "C800", 0xC8000 }, - { "CC00", 0xCC000 }, - { "D000", 0xD0000 }, - { "D400", 0xD4000 }, - { "D800", 0xD8000 }, - { "DC00", 0xDC000 }, - { "" } + .name = "ram_addr", + .description = "RAM address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xD0000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "C000", .value = 0xC0000 }, + { .description = "C400", .value = 0xC4000 }, + { .description = "C800", .value = 0xC8000 }, + { .description = "CC00", .value = 0xCC000 }, + { .description = "D000", .value = 0xD0000 }, + { .description = "D400", .value = 0xD4000 }, + { .description = "D800", .value = 0xD8000 }, + { .description = "DC00", .value = 0xDC000 }, + { .description = "" } }, }, { - "ram_size", "RAM size", CONFIG_SELECTION, "", 16384, "", { 0 }, - { - { "16 kB", 16384 }, - { "64 kB", 65536 }, - { "" } + .name = "ram_size", + .description = "RAM size", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 16384, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "16 kB", .value = 16384 }, + { .description = "64 kB", .value = 65536 }, + { .description = "" } }, }, - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t mca_mac_config[] = { - { "mac", "MAC Address", CONFIG_MAC, "", -1 }, - { "", "", -1 } + { + .name = "mac", + .description = "MAC Address", + .type = CONFIG_MAC, + .default_string = "", + .default_int = -1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on diff --git a/src/network/network.c b/src/network/network.c index cb81ea154..49915024a 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -61,6 +61,7 @@ #include <86box/device.h> #include <86box/timer.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/ui.h> #include <86box/network.h> #include <86box/net_3c503.h> @@ -541,12 +542,12 @@ network_reset(void) network_log("NETWORK: set up for %s, card='%s'\n", (network_type==NET_TYPE_SLIRP)?"SLiRP":"Pcap", - net_cards[network_card].name); + net_cards[network_card].device->name); /* Add the (new?) card to the I/O system. */ if (net_cards[network_card].device) { network_log("NETWORK: adding device '%s'\n", - net_cards[network_card].name); + net_cards[network_card].device->name); device_add(net_cards[network_card].device); } } diff --git a/src/nvr.c b/src/nvr.c index 7f44981c2..b73aa6fa7 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -58,6 +58,7 @@ #include <86box/machine.h> #include <86box/mem.h> #include <86box/timer.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/nvr.h> @@ -213,7 +214,7 @@ nvr_path(char *str) plat_dir_create(temp); /* Now append the actual filename. */ - plat_path_slash(temp); + path_slash(temp); strcat(temp, str); return(temp); diff --git a/src/nvr_at.c b/src/nvr_at.c index d7b1a780f..b164d948d 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -290,11 +290,12 @@ #define RTC_REGS 14 /* number of registers */ -#define FLAG_AMI_1992_HACK 0x01 -#define FLAG_AMI_1994_HACK 0x02 -#define FLAG_AMI_1995_HACK 0x04 -#define FLAG_P6RP4_HACK 0x08 -#define FLAG_PIIX4 0x10 +#define FLAG_NO_NMI 0x01 +#define FLAG_AMI_1992_HACK 0x02 +#define FLAG_AMI_1994_HACK 0x04 +#define FLAG_AMI_1995_HACK 0x08 +#define FLAG_P6RP4_HACK 0x10 +#define FLAG_PIIX4 0x20 typedef struct { @@ -667,8 +668,7 @@ nvr_write(uint16_t addr, uint8_t val, void *priv) local->addr[addr_id] = (local->addr[addr_id] & 0x7f) | 0x80; if (local->bank[addr_id] > 0) local->addr[addr_id] = (local->addr[addr_id] & 0x7f) | (0x80 * local->bank[addr_id]); - if (!(machines[machine].flags & MACHINE_MCA) && - !(machines[machine].flags & MACHINE_NONMI)) + if (!(local->flags & FLAG_NO_NMI)) nmi_mask = (~val & 0x80); } } @@ -1033,12 +1033,16 @@ nvr_at_init(const device_t *info) nvr->irq = 8; local->cent = RTC_CENTURY_PS; local->def = 0x00; + if (info->local & 8) + local->flags |= FLAG_NO_NMI; break; case 3: /* Amstrad PC's */ nvr->irq = 1; local->cent = RTC_CENTURY_AT; local->def = 0xff; + if (info->local & 8) + local->flags |= FLAG_NO_NMI; break; case 4: /* IBM AT */ @@ -1204,6 +1208,26 @@ const device_t piix4_nvr_device = { .config = NULL }; +const device_t ps_no_nmi_nvr_device = { + "PS/1 or PS/2 NVRAM (No NMI)", + "ps1_nvr", + DEVICE_PS2, + 10, + nvr_at_init, nvr_at_close, nvr_at_reset, + { NULL }, nvr_at_speed_changed, + NULL +}; + +const device_t amstrad_no_nmi_nvr_device = { + "Amstrad NVRAM (No NMI)", + "amstrad_nvr", + DEVICE_ISA | DEVICE_AT, + 11, + nvr_at_init, nvr_at_close, nvr_at_reset, + { NULL }, nvr_at_speed_changed, + NULL +}; + const device_t ami_1992_nvr_device = { .name = "AMI Color 1992 PC/AT NVRAM", .internal_name = "ami_1992_nvr", diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index d290e295f..ec07dc95f 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -63,6 +63,7 @@ #include <86box/mem.h> #include <86box/rom.h> #include <86box/pit.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/plat_dynld.h> #include <86box/ui.h> @@ -88,6 +89,8 @@ #ifdef _WIN32 # define PATH_FREETYPE_DLL "freetype.dll" +#elif defined __APPLE__ +# define PATH_FREETYPE_DLL "libfreetype.dylib" #else # define PATH_FREETYPE_DLL "libfreetype.so.6" #endif @@ -594,7 +597,7 @@ update_font(escp_t *dev) /* Create a full pathname for the ROM file. */ strcpy(path, dev->fontpath); - plat_path_slash(path); + path_slash(path); strcat(path, fn); escp_log("Temp file=%s\n", path); @@ -2060,14 +2063,14 @@ escp_init(void *lpt) } strcpy(dev->fontpath, exe_path); - plat_path_slash(dev->fontpath); + path_slash(dev->fontpath); strcat(dev->fontpath, "roms/printer/fonts/"); /* Create the full path for the page images. */ - plat_append_filename(dev->pagepath, usr_path, "printer"); + path_append_filename(dev->pagepath, usr_path, "printer"); if (! plat_dir_check(dev->pagepath)) plat_dir_create(dev->pagepath); - plat_path_slash(dev->pagepath); + path_slash(dev->pagepath); dev->page_width = PAGE_WIDTH; dev->page_height = PAGE_HEIGHT; diff --git a/src/printer/prt_ps.c b/src/printer/prt_ps.c index e90e19e82..231707897 100644 --- a/src/printer/prt_ps.c +++ b/src/printer/prt_ps.c @@ -27,6 +27,7 @@ #include <86box/lpt.h> #include <86box/timer.h> #include <86box/pit.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/plat_dynld.h> #include <86box/ui.h> @@ -152,7 +153,7 @@ convert_to_pdf(ps_t *dev) char input_fn[1024], output_fn[1024], *gsargv[9]; strcpy(input_fn, dev->printer_path); - plat_path_slash(input_fn); + path_slash(input_fn); strcat(input_fn, dev->filename); strcpy(output_fn, input_fn); @@ -206,7 +207,7 @@ write_buffer(ps_t *dev, bool finish) plat_tempfile(dev->filename, NULL, ".ps"); strcpy(path, dev->printer_path); - plat_path_slash(path); + path_slash(path); strcat(path, dev->filename); fp = plat_fopen(path, "a"); @@ -365,10 +366,10 @@ ps_init(void *lpt) /* Cache print folder path. */ memset(dev->printer_path, 0x00, sizeof(dev->printer_path)); - plat_append_filename(dev->printer_path, usr_path, "printer"); + path_append_filename(dev->printer_path, usr_path, "printer"); if (!plat_dir_check(dev->printer_path)) plat_dir_create(dev->printer_path); - plat_path_slash(dev->printer_path); + path_slash(dev->printer_path); timer_add(&dev->pulse_timer, pulse_timer, dev, 0); timer_add(&dev->timeout_timer, timeout_timer, dev, 0); diff --git a/src/printer/prt_text.c b/src/printer/prt_text.c index 7c791227f..c57a4fef3 100644 --- a/src/printer/prt_text.c +++ b/src/printer/prt_text.c @@ -60,6 +60,7 @@ #include <86box/device.h> #include <86box/timer.h> #include <86box/pit.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/lpt.h> #include <86box/printer.h> @@ -150,10 +151,10 @@ dump_page(prnt_t *dev) /* Create the full path for this file. */ memset(path, 0x00, sizeof(path)); - plat_append_filename(path, usr_path, "printer"); + path_append_filename(path, usr_path, "printer"); if (! plat_dir_check(path)) plat_dir_create(path); - plat_path_slash(path); + path_slash(path); strcat(path, dev->filename); /* Create the file. */ diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index a62032537..053cf691d 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -22,6 +22,14 @@ endif() find_package(Threads REQUIRED) find_package(Qt${QT_MAJOR} COMPONENTS Core Widgets Network OpenGL REQUIRED) find_package(Qt${QT_MAJOR}LinguistTools REQUIRED) +# TODO: Is this the correct way to do this, and is it required on any +# other platforms or with Qt 5? +if(APPLE AND USE_QT6) + find_package(Qt6Gui/Qt6QCocoaIntegrationPlugin REQUIRED) + find_package(Qt6Widgets/Qt6QMacStylePlugin REQUIRED) + find_package(Qt6Gui/Qt6QICOPlugin REQUIRED) + find_package(Qt6Gui/Qt6QICNSPlugin REQUIRED) +endif() add_library(plat STATIC qt.c @@ -232,17 +240,13 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE) set(INSTALL_CMAKE_DIR "${prefix}/Resources") # using the install_qt5_plugin to add Qt plugins into the macOS app bundle - if (USE_QT6) - install_qt5_plugin("Qt6::QCocoaIntegrationPlugin" QT_PLUGINS ${prefix}) - else() - install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS ${prefix}) - install_qt5_plugin("Qt5::QMacStylePlugin" QT_PLUGINS ${prefix}) - install_qt5_plugin("Qt5::QICOPlugin" QT_PLUGINS ${prefix}) - install_qt5_plugin("Qt5::QICNSPlugin" QT_PLUGINS ${prefix}) - endif() - + install_qt5_plugin("Qt${QT_MAJOR}::QCocoaIntegrationPlugin" QT_PLUGINS ${prefix}) + install_qt5_plugin("Qt${QT_MAJOR}::QMacStylePlugin" QT_PLUGINS ${prefix}) + install_qt5_plugin("Qt${QT_MAJOR}::QICOPlugin" QT_PLUGINS ${prefix}) + install_qt5_plugin("Qt${QT_MAJOR}::QICNSPlugin" QT_PLUGINS ${prefix}) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - "[Paths]\nPlugins = ${_qt_plugin_dir}\n") + "[Paths]\nPlugins = PlugIns\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" DESTINATION "${INSTALL_CMAKE_DIR}") @@ -253,8 +257,8 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE) endforeach() endif() - # Append Qt's lib folder which is two levels above Qt5Widgets_DIR - list(APPEND DIRS "${Qt5Widgets_DIR}/../..") + # Append Qt's lib folder which is two levels above Qt*Widgets_DIR + list(APPEND DIRS "${Qt${QT_MAJOR}Widgets_DIR}/../..") include(InstallRequiredSystemLibraries) diff --git a/src/qt/TODO b/src/qt/TODO deleted file mode 100644 index a8b0b4970..000000000 --- a/src/qt/TODO +++ /dev/null @@ -1 +0,0 @@ -* Joystick support diff --git a/src/qt/evdev_mouse.cpp b/src/qt/evdev_mouse.cpp index c04c8c8d6..8d708d3a1 100644 --- a/src/qt/evdev_mouse.cpp +++ b/src/qt/evdev_mouse.cpp @@ -56,7 +56,7 @@ void evdev_thread_func() { while (!stopped) { - for (int i = 0; i < evdev_mice.size(); i++) + for (unsigned int i = 0; i < evdev_mice.size(); i++) { struct input_event ev; int rc = libevdev_next_event(evdev_mice[i].second, LIBEVDEV_READ_FLAG_NORMAL, &ev); @@ -67,7 +67,7 @@ void evdev_thread_func() } } } - for (int i = 0; i < evdev_mice.size(); i++) + for (unsigned int i = 0; i < evdev_mice.size(); i++) { libevdev_free(evdev_mice[i].second); close(evdev_mice[i].first); diff --git a/src/qt/qt_deviceconfig.cpp b/src/qt/qt_deviceconfig.cpp index faf5a6ddc..0b2047785 100644 --- a/src/qt/qt_deviceconfig.cpp +++ b/src/qt/qt_deviceconfig.cpp @@ -117,7 +117,7 @@ void DeviceConfig::ConfigureDevice(const _device_* device, int instance, Setting cbox->setObjectName(config->name); auto* model = cbox->model(); int currentIndex = -1; - int selected; + int selected = 0; switch (config->type) { case CONFIG_SELECTION: selected = config_get_int(device_context.name, const_cast(config->name), config->default_int); @@ -130,7 +130,7 @@ void DeviceConfig::ConfigureDevice(const _device_* device, int instance, Setting break; } - for (auto* sel = config->selection; (sel->description != nullptr) && (strlen(sel->description) > 0); ++sel) { + for (auto* sel = config->selection; (sel != nullptr) && (sel->description != nullptr) && (strlen(sel->description) > 0); ++sel) { int row = Models::AddEntry(model, sel->description, sel->value); if (selected == sel->value) { currentIndex = row; diff --git a/src/qt/qt_harddiskdialog.cpp b/src/qt/qt_harddiskdialog.cpp index b7a44d952..dd598af46 100644 --- a/src/qt/qt_harddiskdialog.cpp +++ b/src/qt/qt_harddiskdialog.cpp @@ -564,7 +564,7 @@ void HarddiskDialog::onExistingFileSelected(const QString &fileName) { else if (((size % 3072) == 0) && (size <= 53477376)) heads = 6; else { - int i; + uint32_t i; for (i = 5; i < 16; i++) { if (((size % (i << 9)) == 0) && (size <= ((i * 17) << 19))) break; diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index fe249874b..3058ca59f 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -82,6 +82,14 @@ extern "C" { #undef KeyRelease #endif +#ifdef Q_OS_MACOS +// The namespace is required to avoid clashing typedefs; we only use this +// header for its #defines anyway. +namespace IOKit { + #include +} +#endif + #ifdef __HAIKU__ #include #include @@ -199,18 +207,12 @@ MainWindow::MainWindow(QWidget *parent) : qt_mouse_capture(mouse_capture); if (mouse_capture) { this->grabKeyboard(); -#ifdef WAYLAND - if (QGuiApplication::platformName().contains("wayland")) { - wl_mouse_capture(this->windowHandle()); - } -#endif + if (ui->stackedWidget->mouse_capture) + ui->stackedWidget->mouse_capture(this->windowHandle()); } else { this->releaseKeyboard(); -#ifdef WAYLAND - if (QGuiApplication::platformName().contains("wayland")) { - wl_mouse_uncapture(); - } -#endif + if (ui->stackedWidget->mouse_uncapture) + ui->stackedWidget->mouse_uncapture(); } }); @@ -507,10 +509,8 @@ void MainWindow::closeEvent(QCloseEvent *event) { } qt_nvr_save(); config_save(); -#if defined __unix__ && !defined __HAIKU__ - extern void xinput2_exit(); - if (QApplication::platformName() == "xcb") xinput2_exit(); -#endif + if (ui->stackedWidget->mouse_exit) + ui->stackedWidget->mouse_exit(); event->accept(); } @@ -617,6 +617,7 @@ void MainWindow::on_actionSettings_triggered() { plat_pause(currentPause); } +#if defined(__unix__) && !defined(__HAIKU__) std::array x11_to_xt_base { 0, @@ -944,7 +945,9 @@ std::array x11_to_xt_vnc 0x14B, 0x14D, }; +#endif +#ifdef Q_OS_MACOS std::array darwin_to_xt { 0x1E, @@ -1076,7 +1079,9 @@ std::array darwin_to_xt 0x148, 0, }; +#endif +#if defined(__unix__) && !defined(__HAIKU__) static std::unordered_map evdev_to_xt = { {96, 0x11C}, @@ -1096,6 +1101,7 @@ static std::unordered_map evdev_to_xt = {110, 0x152}, {111, 0x153} }; +#endif #ifdef __HAIKU__ static std::unordered_map be_to_xt = @@ -1208,14 +1214,16 @@ static std::unordered_map be_to_xt = }; #endif +#if defined(__unix__) && !defined(__HAIKU__) static std::array& selected_keycode = x11_to_xt_base; +#endif uint16_t x11_keycode_to_keysym(uint32_t keycode) { uint16_t finalkeycode = 0; #if defined(Q_OS_WINDOWS) finalkeycode = (keycode & 0xFFFF); -#elif defined(__APPLE__) +#elif defined(Q_OS_MACOS) finalkeycode = darwin_to_xt[keycode]; #elif defined(__HAIKU__) finalkeycode = be_to_xt[keycode]; @@ -1252,6 +1260,68 @@ uint16_t x11_keycode_to_keysym(uint32_t keycode) return finalkeycode; } +#ifdef Q_OS_MACOS +// These modifiers are listed as "device-dependent" in IOLLEvent.h, but +// that's followed up with "(really?)". It's the only way to distinguish +// left and right modifiers with Qt 6 on macOS, so let's just roll with it. +static std::unordered_map mac_modifiers_to_xt = { + {NX_DEVICELCTLKEYMASK, 0x1D}, + {NX_DEVICELSHIFTKEYMASK, 0x2A}, + {NX_DEVICERSHIFTKEYMASK, 0x36}, + {NX_DEVICELCMDKEYMASK, 0x15B}, + {NX_DEVICERCMDKEYMASK, 0x15C}, + {NX_DEVICELALTKEYMASK, 0x38}, + {NX_DEVICERALTKEYMASK, 0x138}, + {NX_DEVICE_ALPHASHIFT_STATELESS_MASK, 0x3A}, + {NX_DEVICERCTLKEYMASK, 0x11D}, +}; + +void MainWindow::processMacKeyboardInput(bool down, const QKeyEvent* event) { + // Per QTBUG-69608 (https://bugreports.qt.io/browse/QTBUG-69608), + // QKeyEvents QKeyEvents for presses/releases of modifiers on macOS give + // nativeVirtualKey() == 0 (at least in Qt 6). Handle this by manually + // processing the nativeModifiers(). We need to check whether the key() is + // a known modifier because because kVK_ANSI_A is also 0, so the + // nativeVirtualKey() == 0 condition is ambiguous... + if (event->nativeVirtualKey() == 0 + && (event->key() == Qt::Key_Shift + || event->key() == Qt::Key_Control + || event->key() == Qt::Key_Meta + || event->key() == Qt::Key_Alt + || event->key() == Qt::Key_AltGr + || event->key() == Qt::Key_CapsLock)) { + // We only process one modifier at a time since events from Qt seem to + // always be non-coalesced (NX_NONCOALESCEDMASK is always set). + uint32_t changed_modifiers = last_modifiers ^ event->nativeModifiers(); + for (auto const& pair : mac_modifiers_to_xt) { + if (changed_modifiers & pair.first) { + last_modifiers ^= pair.first; + keyboard_input(down, pair.second); + return; + } + } + + // Caps Lock seems to be delivered as a single key press event when + // enabled and a single key release event when disabled, so we can't + // detect Caps Lock being held down; just send an infinitesimally-long + // press and release as a compromise. + // + // The event also doesn't get delivered if you turn Caps Lock off after + // turning it on when the window isn't focused. Doing better than this + // probably requires bypassing Qt input processing. + // + // It's possible that other lock keys get delivered in this way, but + // standard Apple keyboards don't have them, so this is untested. + if (event->key() == Qt::Key_CapsLock) { + keyboard_input(1, 0x3A); + keyboard_input(0, 0x3A); + } + } else { + keyboard_input(down, x11_keycode_to_keysym(event->nativeVirtualKey())); + } +} +#endif + void MainWindow::on_actionFullscreen_triggered() { if (video_fullscreen > 0) { showNormal(); @@ -1370,8 +1440,8 @@ void MainWindow::keyPressEvent(QKeyEvent* event) { if (send_keyboard_input && !(kbd_req_capture && !mouse_capture && !video_fullscreen)) { -#ifdef __APPLE__ - keyboard_input(1, x11_keycode_to_keysym(event->nativeVirtualKey())); +#ifdef Q_OS_MACOS + processMacKeyboardInput(true, event); #else keyboard_input(1, x11_keycode_to_keysym(event->nativeScanCode())); #endif @@ -1397,8 +1467,8 @@ void MainWindow::keyReleaseEvent(QKeyEvent* event) if (!send_keyboard_input) return; -#ifdef __APPLE__ - keyboard_input(0, x11_keycode_to_keysym(event->nativeVirtualKey())); +#ifdef Q_OS_MACOS + processMacKeyboardInput(false, event); #else keyboard_input(0, x11_keycode_to_keysym(event->nativeScanCode())); #endif diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index 5b155079c..84d08f8ed 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -118,6 +118,11 @@ private: std::unique_ptr status; std::shared_ptr mm; +#ifdef Q_OS_MACOS + uint32_t last_modifiers = 0; + void processMacKeyboardInput(bool down, const QKeyEvent* event); +#endif + /* If main window should send keyboard input */ bool send_keyboard_input = true; bool shownonce = false; diff --git a/src/qt/qt_mediamenu.cpp b/src/qt/qt_mediamenu.cpp index 6b81e0d79..5b0dffe47 100644 --- a/src/qt/qt_mediamenu.cpp +++ b/src/qt/qt_mediamenu.cpp @@ -190,7 +190,7 @@ void MediaMenu::cassetteMount(const QString& filename, bool wp) { if (! filename.isEmpty()) { QByteArray filenameBytes = filename.toUtf8(); - strncpy(cassette_fname, filenameBytes.data(), sizeof(cassette_fname)); + strncpy(cassette_fname, filenameBytes.data(), sizeof(cassette_fname) - 1); pc_cas_set_fname(cassette, cassette_fname); } @@ -340,6 +340,9 @@ void MediaMenu::floppyExportTo86f(int i) { void MediaMenu::floppyUpdateMenu(int i) { QString name = floppyfns[i]; + if (!floppyMenus.contains(i)) + return; + auto* menu = floppyMenus[i]; auto childs = menu->children(); @@ -419,6 +422,8 @@ void MediaMenu::cdromReload(int i) { void MediaMenu::cdromUpdateMenu(int i) { QString name = cdrom[i].image_path; + if (!cdromMenus.contains(i)) + return; auto* menu = cdromMenus[i]; auto childs = menu->children(); @@ -524,6 +529,8 @@ void MediaMenu::zipReload(int i) { void MediaMenu::zipUpdateMenu(int i) { QString name = zip_drives[i].image_path; QString prev_name = zip_drives[i].prev_image_path; + if (!zipMenus.contains(i)) + return; auto* menu = zipMenus[i]; auto childs = menu->children(); @@ -621,6 +628,8 @@ void MediaMenu::moReload(int i) { void MediaMenu::moUpdateMenu(int i) { QString name = mo_drives[i].image_path; QString prev_name = mo_drives[i].prev_image_path; + if (!moMenus.contains(i)) + return; auto* menu = moMenus[i]; auto childs = menu->children(); diff --git a/src/qt/qt_newfloppydialog.cpp b/src/qt/qt_newfloppydialog.cpp index 30b0fb674..576798e54 100644 --- a/src/qt/qt_newfloppydialog.cpp +++ b/src/qt/qt_newfloppydialog.cpp @@ -446,11 +446,6 @@ bool NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_s uint32_t total_size = 0; uint32_t total_sectors = 0; uint32_t sector_bytes = 0; - uint32_t root_dir_bytes = 0; - uint32_t fat_size = 0; - uint32_t fat1_offs = 0; - uint32_t fat2_offs = 0; - uint32_t zero_bytes = 0; uint16_t base = 0x1000; uint32_t pbar_max = 0; @@ -466,11 +461,6 @@ bool NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_s if (total_sectors > ZIP_SECTORS) total_sectors = ZIP_250_SECTORS; total_size = total_sectors * sector_bytes; - root_dir_bytes = (disk_size.root_dir_entries << 5); - fat_size = (disk_size.spfat * sector_bytes); - fat1_offs = sector_bytes; - fat2_offs = fat1_offs + fat_size; - zero_bytes = fat2_offs + fat_size + root_dir_bytes; pbar_max = total_size; if (type == FileType::Zdi) { diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index 916a0aedb..2c2f1ea87 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -87,6 +88,7 @@ extern "C" { #include <86box/gameport.h> #include <86box/timer.h> #include <86box/nvr.h> +#include <86box/path.h> #include <86box/plat_dynld.h> #include <86box/mem.h> #include <86box/rom.h> @@ -139,7 +141,7 @@ void plat_get_exe_name(char *s, int size) memcpy(s, exepath_temp.data(), std::min((qsizetype)exepath_temp.size(),(qsizetype)size)); - plat_path_slash(s); + path_slash(s); } uint32_t @@ -182,7 +184,12 @@ plat_dir_check(char *path) int plat_getcwd(char *bufp, int max) { +#ifdef __APPLE__ + /* Working directory for .app bundles is undefined. */ + strncpy(bufp, exe_path, max); +#else CharPointer(bufp, max) = QDir::currentPath().toUtf8(); +#endif return 0; } @@ -194,14 +201,14 @@ plat_get_basename(const char *path) } void -plat_get_dirname(char *dest, const char *path) +path_get_dirname(char *dest, const char *path) { QFileInfo fi(path); CharPointer(dest, -1) = fi.dir().path().toUtf8(); } char * -plat_get_extension(char *s) +path_get_extension(char *s) { auto len = strlen(s); auto idx = QByteArray::fromRawData(s, len).lastIndexOf('.'); @@ -212,7 +219,7 @@ plat_get_extension(char *s) } char * -plat_get_filename(char *s) +path_get_filename(char *s) { #ifdef Q_OS_WINDOWS int c = strlen(s) - 1; @@ -234,7 +241,7 @@ plat_get_filename(char *s) } int -plat_path_abs(char *path) +path_abs(char *path) { #ifdef Q_OS_WINDOWS if ((path[1] == ':') || (path[0] == '\\') || (path[0] == '/')) @@ -247,7 +254,7 @@ plat_path_abs(char *path) } void -plat_path_normalize(char* path) +path_normalize(char* path) { #ifdef Q_OS_WINDOWS while (*path++ != 0) @@ -258,7 +265,7 @@ plat_path_normalize(char* path) } void -plat_path_slash(char *path) +path_slash(char *path) { auto len = strlen(path); auto separator = '/'; @@ -266,14 +273,14 @@ plat_path_slash(char *path) path[len] = separator; path[len+1] = 0; } - plat_path_normalize(path); + path_normalize(path); } void -plat_append_filename(char *dest, const char *s1, const char *s2) +path_append_filename(char *dest, const char *s1, const char *s2) { strcpy(dest, s1); - plat_path_slash(dest); + path_slash(dest); strcat(dest, s2); } @@ -526,11 +533,6 @@ size_t c16stombs(char dst[], const uint16_t src[], int len) #define LIB_NAME_FREETYPE "libfreetype" #define MOUSE_CAPTURE_KEYSEQ "CTRL-END" #endif -#ifdef Q_OS_MACOS -#define ROMDIR "~/Library/Application Support/net.86box.86box/roms" -#else -#define ROMDIR "roms" -#endif QMap ProgSettings::translatedstrings; @@ -556,7 +558,7 @@ void ProgSettings::reloadStrings() translatedstrings[IDS_2128] = QCoreApplication::translate("", "Hardware not available").toStdWString(); translatedstrings[IDS_2142] = QCoreApplication::translate("", "Monitor in sleep mode").toStdWString(); translatedstrings[IDS_2120] = QCoreApplication::translate("", "No ROMs found").toStdWString(); - translatedstrings[IDS_2056] = QCoreApplication::translate("", "86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory.").replace("roms", ROMDIR).toStdWString(); + translatedstrings[IDS_2056] = QCoreApplication::translate("", "86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory.").toStdWString(); auto flsynthstr = QCoreApplication::translate("", " is required for FluidSynth MIDI output."); if (flsynthstr.contains("libfluidsynth")) @@ -596,59 +598,22 @@ plat_chdir(char *path) void plat_init_rom_paths() { -#if defined __APPLE__ - QDir::root().mkpath(QStringLiteral("%1/Documents/86Box/roms/").arg(QDir::homePath())); - add_rom_path(QStringLiteral("%1/Documents/86Box/roms/").arg(QDir::homePath()).toUtf8().constData()); -#elif !defined _WIN32 - if (getenv("XDG_DATA_HOME")) { - char xdg_rom_path[1024 + 1] = { 0 }; - strncpy(xdg_rom_path, getenv("XDG_DATA_HOME"), 1024); - plat_path_slash(xdg_rom_path); - strncat(xdg_rom_path, "86Box/", 1024); + auto paths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); - if (!plat_dir_check(xdg_rom_path)) - plat_dir_create(xdg_rom_path); - strcat(xdg_rom_path, "roms/"); +#ifdef _WIN32 + // HACK: The standard locations returned for GenericDataLocation include + // the EXE path and a `data` directory within it as the last two entries. - if (!plat_dir_check(xdg_rom_path)) - plat_dir_create(xdg_rom_path); - add_rom_path(xdg_rom_path); - } else { - char home_rom_path[1024] = { 0 }; - snprintf(home_rom_path, 1024, "%s/.local/share/86Box/", getenv("HOME") ? getenv("HOME") : QDir::homePath().toUtf8().constData()); - - if (!plat_dir_check(home_rom_path)) - plat_dir_create(home_rom_path); - strcat(home_rom_path, "roms/"); - - if (!plat_dir_check(home_rom_path)) - plat_dir_create(home_rom_path); - add_rom_path(home_rom_path); - } - if (getenv("XDG_DATA_DIRS")) { - char* xdg_rom_paths = strdup(getenv("XDG_DATA_DIRS")); - char* xdg_rom_paths_orig = xdg_rom_paths; - char* cur_xdg_rom_path = NULL; - if (xdg_rom_paths) { - while (xdg_rom_paths[strlen(xdg_rom_paths) - 1] == ':') { - xdg_rom_paths[strlen(xdg_rom_paths) - 1] = '\0'; - } - QStringList path_list = QString(xdg_rom_paths).split(":"); - for (auto& cur_path : path_list) { - if (cur_path.right(1) != '/') - cur_path.push_back('/'); - add_rom_path((cur_path + "86Box/roms").toUtf8().constData()); - } - } - free(xdg_rom_paths_orig); - } else { - add_rom_path("/usr/local/share/86Box/roms/"); - add_rom_path("/usr/share/86Box/roms/"); - } -#elif _WIN32 - auto appDataDir = QDir(qEnvironmentVariable("LOCALAPPDATA")); - appDataDir.mkdir("86Box"); - appDataDir.mkdir("86Box/roms"); - add_rom_path((appDataDir.path().replace("\\","/") + "/86Box/roms").toUtf8().constData()); + // Remove the entries as we don't need them. + paths.removeLast(); + paths.removeLast(); #endif + + for (auto& path : paths) { +#ifdef __APPLE__ + rom_add_path(QDir(path).filePath("net.86Box.86Box/roms").toUtf8().constData()); +#else + rom_add_path(QDir(path).filePath("86Box/roms").toUtf8().constData()); +#endif + } } diff --git a/src/qt/qt_rendererstack.cpp b/src/qt/qt_rendererstack.cpp index c77e76474..3e20f1f40 100644 --- a/src/qt/qt_rendererstack.cpp +++ b/src/qt/qt_rendererstack.cpp @@ -50,21 +50,45 @@ RendererStack::RendererStack(QWidget *parent) ui->setupUi(this); #if defined __unix__ && !defined __HAIKU__ -# ifdef WAYLAND - if (QApplication::platformName().contains("wayland")) { - wl_init(); + char *mouse_type = getenv("EMU86BOX_MOUSE"), auto_mouse_type[16]; + if (!mouse_type || (mouse_type[0] == '\0') || !stricmp(mouse_type, "auto")) { + if (QApplication::platformName().contains("wayland")) + strcpy(auto_mouse_type, "wayland"); + else if (QApplication::platformName() == "eglfs") + strcpy(auto_mouse_type, "evdev"); + else if (QApplication::platformName() == "xcb") + strcpy(auto_mouse_type, "xinput2"); + else + auto_mouse_type[0] = '\0'; + mouse_type = auto_mouse_type; } + +# ifdef WAYLAND + if (!stricmp(mouse_type, "wayland")) { + this->mouse_init = wl_init; + this->mouse_poll = wl_mouse_poll; + this->mouse_capture = wl_mouse_capture; + this->mouse_uncapture = wl_mouse_uncapture; + } else # endif # ifdef EVDEV_INPUT - if (QApplication::platformName() == "eglfs") { - evdev_init(); - } + if (!stricmp(mouse_type, "evdev")) { + this->mouse_init = evdev_init; + this->mouse_poll = evdev_mouse_poll; + } else # endif - if (QApplication::platformName() == "xcb") { + if (!stricmp(mouse_type, "xinput2")) { extern void xinput2_init(); - xinput2_init(); + extern void xinput2_poll(); + extern void xinput2_exit(); + this->mouse_init = xinput2_init; + this->mouse_poll = xinput2_poll; + this->mouse_exit = xinput2_exit; } #endif + + if (this->mouse_init) + this->mouse_init(); } RendererStack::~RendererStack() @@ -104,23 +128,9 @@ RendererStack::mousePoll() mousedata.deltax = mousedata.deltay = mousedata.deltaz = 0; mouse_buttons = mousedata.mousebuttons; -# if defined __unix__ && !defined __HAIKU__ -# ifdef WAYLAND - if (QApplication::platformName().contains("wayland")) - wl_mouse_poll(); -# endif - -# ifdef EVDEV_INPUT - if (QApplication::platformName() == "eglfs") - evdev_mouse_poll(); - else -# endif - if (QApplication::platformName() == "xcb") { - extern void xinput2_poll(); - xinput2_poll(); - } -# endif /* defined __unix__ */ -#endif /* !defined __APPLE__ */ + if (this->mouse_poll) + this->mouse_poll(); +#endif /* !defined __APPLE__ */ } int ignoreNextMouseEvent = 1; @@ -174,7 +184,7 @@ RendererStack::mouseMoveEvent(QMouseEvent *event) event->ignore(); return; } -#ifdef __APPLE__ +#if defined __APPLE__ || defined _WIN32 event->accept(); return; #else diff --git a/src/qt/qt_rendererstack.hpp b/src/qt/qt_rendererstack.hpp index 9133a4927..89f300ada 100644 --- a/src/qt/qt_rendererstack.hpp +++ b/src/qt/qt_rendererstack.hpp @@ -64,6 +64,12 @@ public: rendererWindow->onResize(width, height); } + void (*mouse_init)() = nullptr; + void (*mouse_poll)() = nullptr; + void (*mouse_capture)(QWindow *window) = nullptr; + void (*mouse_uncapture)() = nullptr; + void (*mouse_exit)() = nullptr; + signals: void blitToRenderer(int buf_idx, int x, int y, int w, int h); void rendererChanged(); diff --git a/src/qt/qt_settingsharddisks.cpp b/src/qt/qt_settingsharddisks.cpp index 43cd3fc9c..df9c6b1dc 100644 --- a/src/qt/qt_settingsharddisks.cpp +++ b/src/qt/qt_settingsharddisks.cpp @@ -151,7 +151,7 @@ void SettingsHarddisks::save() { hdd[i].spt = idx.siblingAtColumn(ColumnSectors).data().toUInt(); QByteArray fileName = idx.siblingAtColumn(ColumnFilename).data(Qt::UserRole).toString().toUtf8(); - strncpy(hdd[i].fn, fileName.data(), sizeof(hdd[i].fn)); + strncpy(hdd[i].fn, fileName.data(), sizeof(hdd[i].fn) - 1); hdd[i].priv = nullptr; } } @@ -247,12 +247,14 @@ static void addDriveFromDialog(Ui::SettingsHarddisks* ui, const HarddiskDialog& QByteArray fn = dlg.fileName().toUtf8(); hard_disk_t hd; + memset(&hd, 0, sizeof(hd)); + hd.bus = dlg.bus(); hd.channel = dlg.channel(); hd.tracks = dlg.cylinders(); hd.hpc = dlg.heads(); hd.spt = dlg.sectors(); - strncpy(hd.fn, fn.data(), sizeof(hd.fn)); + strncpy(hd.fn, fn.data(), sizeof(hd.fn) - 1); addRow(ui->tableView->model(), &hd); ui->tableView->resizeColumnsToContents(); diff --git a/src/qt/qt_softwarerenderer.cpp b/src/qt/qt_softwarerenderer.cpp index a6cca1152..850e8369a 100644 --- a/src/qt/qt_softwarerenderer.cpp +++ b/src/qt/qt_softwarerenderer.cpp @@ -60,7 +60,7 @@ void SoftwareRenderer::onBlit(int buf_idx, int x, int y, int w, int h) { cur_image = buf_idx; buf_usage[(buf_idx + 1) % 2].clear(); - + source.setRect(x, y, w, h); update(); } diff --git a/src/qt/xinput2_mouse.cpp b/src/qt/xinput2_mouse.cpp index 0c31f6ca0..07791b5ba 100644 --- a/src/qt/xinput2_mouse.cpp +++ b/src/qt/xinput2_mouse.cpp @@ -48,7 +48,6 @@ int xi2flides[2] = { 0, 0 }; static Display* disp = nullptr; static QThread* procThread = nullptr; -static bool xi2childinit = false; static XIEventMask ximask; static std::atomic exitfromthread = false; static std::atomic xi2_mouse_x = 0, xi2_mouse_y = 0, xi2_mouse_abs_x = 0, xi2_mouse_abs_y = 0; @@ -106,7 +105,6 @@ void xinput2_proc() if (XGetEventData(disp, cookie) && cookie->type == GenericEvent && cookie->extension == xi2opcode) { switch (cookie->evtype) { case XI_RawMotion: { - static int ss = 0; const XIRawEvent *rawev = (const XIRawEvent*)cookie->data; double relative_coords[2] = { 0., 0. }; parse_valuators(rawev->raw_values,rawev->valuators.mask, diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index 9fac11764..cdf1f1a56 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -1141,181 +1141,258 @@ aha_init(const device_t *info) // clang-format off static const device_config_t aha_154xb_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x334, "", { 0 }, - { - { "None", 0 }, - { "0x330", 0x330 }, - { "0x334", 0x334 }, - { "0x230", 0x230 }, - { "0x234", 0x234 }, - { "0x130", 0x130 }, - { "0x134", 0x134 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x334, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "None", .value = 0 }, + { .description = "0x330", .value = 0x330 }, + { .description = "0x334", .value = 0x334 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x234", .value = 0x234 }, + { .description = "0x130", .value = 0x130 }, + { .description = "0x134", .value = 0x134 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 11, "", { 0 }, - { - { "IRQ 9", 9 }, - { "IRQ 10", 10 }, - { "IRQ 11", 11 }, - { "IRQ 12", 12 }, - { "IRQ 14", 14 }, - { "IRQ 15", 15 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 11, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 9", .value = 9 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 12", .value = 12 }, + { .description = "IRQ 14", .value = 14 }, + { .description = "IRQ 15", .value = 15 }, + { .description = "" } }, }, { - "dma", "DMA channel", CONFIG_SELECTION, "", 6, "", { 0 }, - { - { "DMA 5", 5 }, - { "DMA 6", 6 }, - { "DMA 7", 7 }, - { "" } + .name = "dma", + .description = "DMA channel", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 6, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "DMA 5", .value = 5 }, + { .description = "DMA 6", .value = 6 }, + { .description = "DMA 7", .value = 7 }, + { .description = "" } }, }, { - "hostid", "Host ID", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { "0", 0 }, - { "1", 1 }, - { "2", 2 }, - { "3", 3 }, - { "4", 4 }, - { "5", 5 }, - { "6", 6 }, - { "7", 7 }, - { "" } + .name = "hostid", + .description = "Host ID", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0", .value = 0 }, + { .description = "1", .value = 1 }, + { .description = "2", .value = 2 }, + { .description = "3", .value = 3 }, + { .description = "4", .value = 4 }, + { .description = "5", .value = 5 }, + { .description = "6", .value = 6 }, + { .description = "7", .value = 7 }, + { .description = "" } }, }, { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0, "", { 0 }, - { - { "Disabled", 0 }, - { "C800H", 0xc8000 }, - { "D000H", 0xd0000 }, - { "D800H", 0xd8000 }, - { "DC00H", 0xdc000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "D000H", .value = 0xd0000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "DC00H", .value = 0xdc000 }, + { .description = "" } }, }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t aha_154x_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x334, "", { 0 }, - { - { "None", 0 }, - { "0x330", 0x330 }, - { "0x334", 0x334 }, - { "0x230", 0x230 }, - { "0x234", 0x234 }, - { "0x130", 0x130 }, - { "0x134", 0x134 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x334, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "None", .value = 0 }, + { .description = "0x330", .value = 0x330 }, + { .description = "0x334", .value = 0x334 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x234", .value = 0x234 }, + { .description = "0x130", .value = 0x130 }, + { .description = "0x134", .value = 0x134 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 11, "", { 0 }, - { - { "IRQ 9", 9 }, - { "IRQ 10", 10 }, - { "IRQ 11", 11 }, - { "IRQ 12", 12 }, - { "IRQ 14", 14 }, - { "IRQ 15", 15 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 11, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 9", .value = 9 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 12", .value = 12 }, + { .description = "IRQ 14", .value = 14 }, + { .description = "IRQ 15", .value = 15 }, + { .description = "" } }, }, { - "dma", "DMA channel", CONFIG_SELECTION, "", 6, "", { 0 }, - { - { "DMA 5", 5 }, - { "DMA 6", 6 }, - { "DMA 7", 7 }, - { "" } + .name = "dma", + .description = "DMA channel", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 6, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "DMA 5", .value = 5 }, + { .description = "DMA 6", .value = 6 }, + { .description = "DMA 7", .value = 7 }, + { .description = "" } }, }, { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0, "", { 0 }, - { - { "Disabled", 0 }, - { "C800H", 0xc8000 }, - { "D000H", 0xd0000 }, - { "D800H", 0xd8000 }, - { "DC00H", 0xdc000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "D000H", .value = 0xd0000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "DC00H", .value = 0xdc000 }, + { .description = "" } }, }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } }; - static const device_config_t aha_154xcf_config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x334, "", { 0 }, - { - { "None", 0 }, - { "0x330", 0x330 }, - { "0x334", 0x334 }, - { "0x230", 0x230 }, - { "0x234", 0x234 }, - { "0x130", 0x130 }, - { "0x134", 0x134 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x334, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "None", .value = 0 }, + { .description = "0x330", .value = 0x330 }, + { .description = "0x334", .value = 0x334 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x234", .value = 0x234 }, + { .description = "0x130", .value = 0x130 }, + { .description = "0x134", .value = 0x134 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 11, "", { 0 }, - { - { "IRQ 9", 9 }, - { "IRQ 10", 10 }, - { "IRQ 11", 11 }, - { "IRQ 12", 12 }, - { "IRQ 14", 14 }, - { "IRQ 15", 15 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 11, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 9", .value = 9 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 12", .value = 12 }, + { .description = "IRQ 14", .value = 14 }, + { .description = "IRQ 15", .value = 15 }, + { .description = "" } }, }, { - "dma", "DMA channel", CONFIG_SELECTION, "", 6, "", { 0 }, - { - { "DMA 5", 5 }, - { "DMA 6", 6 }, - { "DMA 7", 7 }, - { "" } + .name = "dma", + .description = "DMA channel", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 6, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "DMA 5", .value = 5 }, + { .description = "DMA 6", .value = 6 }, + { .description = "DMA 7", .value = 7 }, + { .description = "" } }, }, { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0, "", { 0 }, - { - { "Disabled", 0 }, - { "C800H", 0xc8000 }, - { "CC00H", 0xcc000 }, - { "D000H", 0xd0000 }, - { "D400H", 0xd4000 }, - { "D800H", 0xd8000 }, - { "DC00H", 0xdc000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "CC00H", .value = 0xcc000 }, + { .description = "D000H", .value = 0xd0000 }, + { .description = "D400H", .value = 0xd4000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "DC00H", .value = 0xdc000 }, + { .description = "" } }, }, { - "fdc_addr", "FDC address", CONFIG_HEX16, "", 0, "", { 0 }, - { - { "None", 0 }, - { "0x3f0", FDC_PRIMARY_ADDR }, - { "0x370", FDC_SECONDARY_ADDR }, - { "" } + .name = "fdc_addr", + .description = "FDC address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "None", .value = 0 }, + { .description = "0x3f0", .value = FDC_PRIMARY_ADDR }, + { .description = "0x370", .value = FDC_SECONDARY_ADDR }, + { .description = "" } }, }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index 79a019821..e8c4dde57 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -1805,54 +1805,84 @@ buslogic_init(const device_t *info) // clang-format off static const device_config_t BT_ISA_Config[] = { { - "base", "Address", CONFIG_HEX16, "", 0x334, "", { 0 }, - { - { "0x330", 0x330 }, - { "0x334", 0x334 }, - { "0x230", 0x230 }, - { "0x234", 0x234 }, - { "0x130", 0x130 }, - { "0x134", 0x134 }, - { "", 0 } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x334, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "0x330", .value = 0x330 }, + { .description = "0x334", .value = 0x334 }, + { .description = "0x230", .value = 0x230 }, + { .description = "0x234", .value = 0x234 }, + { .description = "0x130", .value = 0x130 }, + { .description = "0x134", .value = 0x134 }, + { .description = "", .value = 0 } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 11, "", { 0 }, - { - { "IRQ 9", 9 }, - { "IRQ 10", 10 }, - { "IRQ 11", 11 }, - { "IRQ 12", 12 }, - { "IRQ 14", 14 }, - { "IRQ 15", 15 }, - { "", 0 } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 11, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 9", .value = 9 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 12", .value = 12 }, + { .description = "IRQ 14", .value = 14 }, + { .description = "IRQ 15", .value = 15 }, + { .description = "", 0 } }, }, { - "dma", "DMA channel", CONFIG_SELECTION, "", 6, "", { 0 }, - { - { "DMA 5", 5 }, - { "DMA 6", 6 }, - { "DMA 7", 7 }, - { "", 0 } + .name = "dma", + .description = "DMA channel", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 6, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "DMA 5", .value = 5 }, + { .description = "DMA 6", .value = 6 }, + { .description = "DMA 7", .value = 7 }, + { .description = "", .value = 0 } }, }, { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0, "", { 0 }, - { - { "Disabled", 0 }, - { "C800H", 0xc8000 }, - { "D000H", 0xd0000 }, - { "D800H", 0xd8000 }, - { "", 0 } + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "D000H", .value = 0xd0000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "", .value = 0 } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t BT958D_Config[] = { - { "bios", "Enable BIOS", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "bios", + .description = "Enable BIOS", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on diff --git a/src/scsi/scsi_ncr5380.c b/src/scsi/scsi_ncr5380.c index 1fa91f8c7..1b05b1a88 100644 --- a/src/scsi/scsi_ncr5380.c +++ b/src/scsi/scsi_ncr5380.c @@ -1594,116 +1594,180 @@ corel_ls2000_available(void) // clang-format off static const device_config_t ncr5380_mmio_config[] = { { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0xD8000, "", { 0 }, - { - { "C800H", 0xc8000 }, - { "CC00H", 0xcc000 }, - { "D800H", 0xd8000 }, - { "DC00H", 0xdc000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xD8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "C800H", .value = 0xc8000 }, + { .description = "CC00H", .value = 0xcc000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "DC00H", .value = 0xdc000 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "" } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t rancho_config[] = { { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0xD8000, "", { 0 }, - { - { "C800H", 0xc8000 }, - { "CC00H", 0xcc000 }, - { "D800H", 0xd8000 }, - { "DC00H", 0xdc000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xD8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "C800H", .value = 0xc8000 }, + { .description = "CC00H", .value = 0xcc000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "DC00H", .value = 0xdc000 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "" } }, }, { - "bios_ver", "BIOS Version", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "8.20R", 1 }, - { "8.10R", 0 }, - { "" } + .name = "bios_ver", + .description = "BIOS Version", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "8.20R", .value = 1 }, + { .description = "8.10R", .value = 0 }, + { .description = "" } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t t130b_config[] = { { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0xD8000, "", { 0 }, - { - { "Disabled", 0 }, - { "C800H", 0xc8000 }, - { "CC00H", 0xcc000 }, - { "D800H", 0xd8000 }, - { "DC00H", 0xdc000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xD8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "CC00H", .value = 0xcc000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "DC00H", .value = 0xdc000 }, + { .description = "" } }, }, { - "base", "Address", CONFIG_HEX16, "", 0x0350, "", { 0 }, - { - { "240H", 0x0240 }, - { "250H", 0x0250 }, - { "340H", 0x0340 }, - { "350H", 0x0350 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0350, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "240H", .value = 0x0240 }, + { .description = "250H", .value = 0x0250 }, + { .description = "340H", .value = 0x0340 }, + { .description = "350H", .value = 0x0350 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "" } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t t128_config[] = { { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0xD8000, "", { 0 }, - { - { "C800H", 0xc8000 }, - { "CC00H", 0xcc000 }, - { "D800H", 0xd8000 }, - { "DC00H", 0xdc000 }, - { "" } + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xD8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "C800H", .value = 0xc8000 }, + { .description = "CC00H", .value = 0xcc000 }, + { .description = "D800H", .value = 0xd8000 }, + { .description = "DC00H", .value = 0xdc000 }, + { .description = "" } }, }, { - "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "" } + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner ={ 0 }, + .selection = { + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "" } }, }, { - "boot", "Enable Boot ROM", CONFIG_BINARY, "", 1 + .name = "boot", + .description = "Enable Boot ROM", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on diff --git a/src/scsi/scsi_ncr53c8xx.c b/src/scsi/scsi_ncr53c8xx.c index f438a342c..999948648 100644 --- a/src/scsi/scsi_ncr53c8xx.c +++ b/src/scsi/scsi_ncr53c8xx.c @@ -2636,15 +2636,21 @@ ncr53c8xx_close(void *priv) static const device_config_t ncr53c8xx_pci_config[] = { // clang-format off { - "bios", "BIOS", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "SDMS 4.x BIOS", 2 }, - { "SDMS 3.x BIOS", 1 }, - { "Disable BIOS", 0 }, - { "" } + .name = "bios", + .description = "BIOS", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "SDMS 4.x BIOS", .value = 2 }, + { .description = "SDMS 3.x BIOS", .value = 1 }, + { .description = "Disable BIOS", .value = 0 }, + { .description = "" } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/scsi/scsi_pcscsi.c b/src/scsi/scsi_pcscsi.c index 74011b21b..57fcc2469 100644 --- a/src/scsi/scsi_pcscsi.c +++ b/src/scsi/scsi_pcscsi.c @@ -2002,11 +2002,13 @@ esp_close(void *priv) static const device_config_t bios_enable_config[] = { // clang-format off { - "bios", "Enable BIOS", CONFIG_BINARY, "", 0 + .name = "bios", + .description = "Enable BIOS", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/scsi/scsi_spock.c b/src/scsi/scsi_spock.c index f00782983..8b5bde94a 100644 --- a/src/scsi/scsi_spock.c +++ b/src/scsi/scsi_spock.c @@ -1159,14 +1159,20 @@ spock_available(void) static const device_config_t spock_rom_config[] = { // clang-format off { - "bios_ver", "BIOS Version", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "1991 BIOS (>1GB)", 1 }, - { "1990 BIOS", 0 }, - { "" } + .name = "bios_ver", + .description = "BIOS Version", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "1991 BIOS (>1GB)", .value = 1 }, + { .description = "1990 BIOS", .value = 0 }, + { .description = "" } }, }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/midi_fluidsynth.c b/src/sound/midi_fluidsynth.c index 1af4bb2c1..749c74b9f 100644 --- a/src/sound/midi_fluidsynth.c +++ b/src/sound/midi_fluidsynth.c @@ -15,6 +15,7 @@ # include <86box/midi.h> # include <86box/plat.h> # include <86box/plat_dynld.h> +# include <86box/thread.h> # include <86box/sound.h> # include <86box/ui.h> @@ -541,9 +542,7 @@ static const device_config_t fluidsynth_config[] = { }, .default_int = 2 }, - { - .type = -1 - } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/midi_mt32.c b/src/sound/midi_mt32.c index 5b19aa018..bb86210f3 100644 --- a/src/sound/midi_mt32.c +++ b/src/sound/midi_mt32.c @@ -9,6 +9,7 @@ #include <86box/mem.h> #include <86box/midi.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/rom.h> #include <86box/sound.h> #include <86box/ui.h> @@ -368,9 +369,7 @@ static const device_config_t mt32_config[] = { .type = CONFIG_BINARY, .default_int = 1 }, - { - .type = -1 - } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/midi_rtmidi.cpp b/src/sound/midi_rtmidi.cpp index 5eaf5a964..43f0695ee 100644 --- a/src/sound/midi_rtmidi.cpp +++ b/src/sound/midi_rtmidi.cpp @@ -234,57 +234,73 @@ rtmidi_in_get_dev_name(int num, char *s) static const device_config_t system_midi_config[] = { { - "midi", "MIDI out device", CONFIG_MIDI_OUT, "", 0 + .name = "midi", + .description = "MIDI out device", + .type = CONFIG_MIDI_OUT, + .default_string = "", + .default_int = 0 }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t midi_input_config[] = { { - "midi_input", "MIDI in device", CONFIG_MIDI_IN, "", 0 + .name = "midi_input", + .description = "MIDI in device", + .type = CONFIG_MIDI_IN, + .default_string = "", + .default_int = 0 }, { - "realtime", "MIDI Real time", CONFIG_BINARY, "", 0 + .name = "realtime", + .description = "MIDI Real time", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 }, { - "thruchan", "MIDI Thru", CONFIG_BINARY, "", 1 + .name = "thruchan", + .description = "MIDI Thru", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 }, { - "clockout", "MIDI Clockout", CONFIG_BINARY, "", 1 + .name = "clockout", + .description = "MIDI Clockout", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } }; const device_t rtmidi_output_device = { - SYSTEM_MIDI_NAME, - SYSTEM_MIDI_INTERNAL_NAME, - 0, 0, - rtmidi_output_init, - rtmidi_output_close, - NULL, - { rtmidi_out_get_num_devs }, - NULL, - NULL, - system_midi_config + .name = SYSTEM_MIDI_NAME, + .internal_name = SYSTEM_MIDI_INTERNAL_NAME, + .flags = 0, + .local = 0, + .init = rtmidi_output_init, + .close = rtmidi_output_close, + .reset = NULL, + { .available = rtmidi_out_get_num_devs }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = system_midi_config }; - -const device_t rtmidi_input_device = -{ - MIDI_INPUT_NAME, - MIDI_INPUT_INTERNAL_NAME, - 0, 0, - rtmidi_input_init, - rtmidi_input_close, - NULL, - { rtmidi_in_get_num_devs }, - NULL, - NULL, - midi_input_config +const device_t rtmidi_input_device = { + .name = MIDI_INPUT_NAME, + .internal_name = MIDI_INPUT_INTERNAL_NAME, + .flags = 0, + .local = 0, + .init = rtmidi_input_init, + .close = rtmidi_input_close, + .reset = NULL, + { .available = rtmidi_in_get_num_devs }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = midi_input_config }; } diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index 2a82b3b85..652c672e2 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -982,10 +982,28 @@ adgold_close(void *p) static const device_config_t adgold_config[] = { // clang-format off - { "gameport", "Enable Game port", CONFIG_BINARY, "", 1 }, - { "surround", "Surround module", CONFIG_BINARY, "", 1 }, - { "receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "gameport", + .description = "Enable Game port", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "surround", + .description = "Surround module", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input", + .description = "Receive input (MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index 5a64d3579..251fda72f 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -2055,46 +2055,54 @@ es1371_speed_changed(void *p) static const device_config_t es1371_config[] = { // clang-format off { - .name = "codec", - .description = "CODEC", - .type = CONFIG_SELECTION, - .selection = { - { - .description = "Asahi Kasei AK4540", - .value = AC97_CODEC_AK4540 - }, { - .description = "Crystal CS4297", - .value = AC97_CODEC_CS4297 - }, { - .description = "Crystal CS4297A", - .value = AC97_CODEC_CS4297A - }, { - .description = "SigmaTel STAC9708", - .value = AC97_CODEC_STAC9708 - }, { - .description = "SigmaTel STAC9721", - .value = AC97_CODEC_STAC9721 - } - }, - .default_int = AC97_CODEC_CS4297A + .name = "codec", + .description = "CODEC", + .type = CONFIG_SELECTION, + .selection = { + { + .description = "Asahi Kasei AK4540", + .value = AC97_CODEC_AK4540 + }, + { + .description = "Crystal CS4297", + .value = AC97_CODEC_CS4297 + }, + { + .description = "Crystal CS4297A", + .value = AC97_CODEC_CS4297A + }, + { + .description = "SigmaTel STAC9708", + .value = AC97_CODEC_STAC9708 + }, + { + .description = "SigmaTel STAC9721", + .value = AC97_CODEC_STAC9721 + } + }, + .default_int = AC97_CODEC_CS4297A }, { - "receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 + .name = "receive_input", + .description = "Receive input (MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; static const device_config_t es1371_onboard_config[] = { // clang-format off { - "receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 + .name = "receive_input", + .description = "Receive input (MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/snd_azt2316a.c b/src/sound/snd_azt2316a.c index ede159219..a72e1dbe5 100644 --- a/src/sound/snd_azt2316a.c +++ b/src/sound/snd_azt2316a.c @@ -1251,12 +1251,29 @@ static const device_config_t azt1605_config[] = { .default_int = 0 }, { - "addr", "SB Address", CONFIG_HEX16, "", 0, "", { 0 }, - { - { "0x220", 0x220 }, - { "0x240", 0x240 }, - { "Use EEPROM setting", 0 }, - { "" } + .name = "addr", + .description = "SB Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "Use EEPROM setting", + .value = 0 + }, + { + .description = "" + } } }, { @@ -1328,10 +1345,28 @@ static const device_config_t azt1605_config[] = { }, .default_int = 0 }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -1341,8 +1376,7 @@ static const device_config_t azt2316a_config[] = { .name = "codec", .description = "CODEC", .type = CONFIG_SELECTION, - .selection = - { + .selection = { { .description = "CS4248", .value = AD1848_TYPE_CS4248 @@ -1361,20 +1395,36 @@ static const device_config_t azt2316a_config[] = { .default_int = 0 }, { - "addr", "SB Address", CONFIG_HEX16, "", 0, "", { 0 }, - { - { "0x220", 0x220 }, - { "0x240", 0x240 }, - { "Use EEPROM setting", 0 }, - { "" } + .name = "addr", + .description = "SB Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "Use EEPROM setting", + .value = 0 + }, + { + .description = "" + } } }, { .name = "wss_irq", .description = "WSS IRQ", .type = CONFIG_SELECTION, - .selection = - { + .selection = { { .description = "IRQ 11", .value = 11 @@ -1397,8 +1447,7 @@ static const device_config_t azt2316a_config[] = { .name = "wss_dma", .description = "WSS DMA", .type = CONFIG_SELECTION, - .selection = - { + .selection = { { .description = "DMA 0", .value = 0 @@ -1417,10 +1466,28 @@ static const device_config_t azt2316a_config[] = { }, .default_int = 0 }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/snd_cmi8x38.c b/src/sound/snd_cmi8x38.c index 1b08e57f3..4ce76508e 100644 --- a/src/sound/snd_cmi8x38.c +++ b/src/sound/snd_cmi8x38.c @@ -1446,16 +1446,34 @@ cmi8x38_close(void *priv) static const device_config_t cmi8x38_config[] = { // clang-format off - { "receive_input", "Receive input (MPU-401)", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "receive_input", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; static const device_config_t cmi8738_config[] = { // clang-format off - { "six_channel", "6CH variant (6-channel)", CONFIG_BINARY, "", 1 }, - { "receive_input", "Receive input (MPU-401)", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "six_channel", + .description = "6CH variant (6-channel)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/snd_cms.c b/src/sound/snd_cms.c index 2be54f4fc..50b05dd48 100644 --- a/src/sound/snd_cms.c +++ b/src/sound/snd_cms.c @@ -189,20 +189,44 @@ cms_close(void *p) static const device_config_t cms_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, - { - { "0x210", 0x210 }, - { "0x220", 0x220 }, - { "0x230", 0x230 }, - { "0x240", 0x240 }, - { "0x250", 0x250 }, - { "0x260", 0x260 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x220, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x210", + .value = 0x210 + }, + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x230", + .value = 0x230 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "0x250", + .value = 0x250 + }, + { + .description = "0x260", + .value = 0x260 + }, + { + .description = "" + } } }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index a70798555..293be8915 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -1204,37 +1204,94 @@ gus_speed_changed(void *p) static const device_config_t gus_config[] = { // clang-format off { - "type", "GUS type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Classic", GUS_CLASSIC }, + .name = "type", + .description = "GUS type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "Classic", + .value = GUS_CLASSIC + }, #if defined(DEV_BRANCH) && defined(USE_GUSMAX) - { "MAX", GUS_MAX }, + { + .description = "MAX", + .value = GUS_MAX + }, #endif - { NULL } + { NULL } }, }, { - "base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, - { - { "210H", 0x210 }, - { "220H", 0x220 }, - { "230H", 0x230 }, - { "240H", 0x240 }, - { "250H", 0x250 }, - { "260H", 0x260 }, + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x220, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "210H", + .value = 0x210 + }, + { + .description = "220H", + .value = 0x220 + }, + { + .description = "230H", + .value = 0x230 + }, + { + .description = "240H", + .value = 0x240 + }, + { + .description = "250H", + .value = 0x250 + }, + { + .description = "260H", + .value = 0x260 + }, }, }, { - "gus_ram", "Onboard RAM", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "256 KB", 0 }, - { "512 KB", 1 }, - { "1 MB", 2 }, - { NULL } + .name = "gus_ram", + "Onboard RAM", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "256 KB", + .value = 0 + }, + { + .description = "512 KB", + .value = 1 + }, + { + .description = "1 MB", + .value = 2 + }, + { NULL } } }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } // clang-format off }; diff --git a/src/sound/snd_mpu401.c b/src/sound/snd_mpu401.c index 7b4a12aa3..6ee107923 100644 --- a/src/sound/snd_mpu401.c +++ b/src/sound/snd_mpu401.c @@ -1806,30 +1806,87 @@ mpu401_standalone_close(void *priv) static const device_config_t mpu401_standalone_config[] = { // clang-format off { - "base", "MPU-401 Address", CONFIG_HEX16, "", 0x330, "", { 0 }, - { - { "0x220", 0x220 }, - { "0x230", 0x230 }, - { "0x240", 0x240 }, - { "0x250", 0x250 }, - { "0x300", 0x300 }, - { "0x320", 0x320 }, - { "0x330", 0x330 }, - { "0x340", 0x340 }, - { "0x350", 0x350 }, - { "" } + .name = "base", + .description = "MPU-401 Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x330, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x230", + .value = 0x230 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "0x250", + .value = 0x250 + }, + { + .description = "0x300", + .value = 0x300 + }, + { + .description = "0x320", + .value = 0x320 + }, + { + .description = "0x330", + .value = 0x330 + }, + { + .description = "0x340", + .value = 0x340 + }, + { + .description = "0x350", + .value = 0x350 + }, + { .description = "" } } }, { - "irq", "MPU-401 IRQ", CONFIG_SELECTION, "", 2, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 4", 4 }, - { "IRQ 5", 5 }, - { "IRQ 6", 6 }, - { "IRQ 7", 7 }, - { "" } + .name = "irq", + .description = "MPU-401 IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 2, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "IRQ 2", + .value = 2 + }, + { + .description = "IRQ 3", + .value = 3 + }, + { + .description = "IRQ 4", + .value = 4 + }, + { + .description = "IRQ 5", + .value = 5 + }, + { + .description = "IRQ 6", + .value = 6 + }, + { + .description = "IRQ 7", + .value = 7 + }, + { .description = "" } } }, { @@ -1838,7 +1895,7 @@ static const device_config_t mpu401_standalone_config[] = { .type = CONFIG_BINARY, .default_int = 1 }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; @@ -1850,9 +1907,7 @@ static const device_config_t mpu401_standalone_mca_config[] = { .type = CONFIG_BINARY, .default_int = 1 }, - { - "", "", -1 - } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 2929baec1..41efc4218 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -239,15 +239,30 @@ pssj_close(void *p) static const device_config_t pssj_isa_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x2C0, "", { 0 }, - { - { "0x0C0", 0x0C0 }, - { "0x1E0", 0x1E0 }, - { "0x2C0", 0x2C0 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x2C0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x0C0", + .value = 0x0C0 + }, + { + .description = "0x1E0", + .value = 0x1E0 + }, + { + .description = "0x2C0", + .value = 0x2C0 + }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; #endif @@ -277,7 +292,7 @@ const device_t pssj_1e0_device = { { .available = NULL }, .speed_changed = NULL, .force_redraw = NULL, - .config = NULL + .config = NULL }; #if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 9d80ef65c..247455036 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -2049,377 +2049,1177 @@ sb_speed_changed(void *p) // clang-format off static const device_config_t sb_config[] = { - { "base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, - { - { "0x210", 0x210 }, - { "0x220", 0x220 }, - { "0x230", 0x230 }, - { "0x240", 0x240 }, - { "0x250", 0x250 }, - { "0x260", 0x260 }, - { "" } + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x220, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x210", + .value = 0x210 + }, + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x230", + .value = 0x230 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "0x250", + .value = 0x250 + }, + { + .description = "0x260", + .value = 0x260 }, + { .description = "" } } }, - { "irq", "IRQ", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "" } + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "IRQ 2", + .value = 2 + }, + { + .description = "IRQ 3", + .value = 3 + }, + { + .description = "IRQ 5", + .value = 5 + }, + { + .description = "IRQ 7", + .value = 7 + }, + { .description = "" } } }, - { "dma", "DMA", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "DMA 1", 1 }, - { "DMA 3", 3 }, - { "" } + { + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "DMA 1", + .value = 1 + }, + { + .description = "DMA 3", + .value = 3 + }, + { "" } } }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb15_config[] = { - { "base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, - { - { "0x210", 0x210 }, - { "0x220", 0x220 }, - { "0x230", 0x230 }, - { "0x240", 0x240 }, - { "0x250", 0x250 }, - { "0x260", 0x260 }, - { "" } + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x220, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x210", + .value = 0x210 + }, + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x230", + .value = 0x230 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "0x250", + .value = 0x250 + }, + { + .description = "0x260", + .value = 0x260 + }, + { + .description = "" } } }, - { "irq", "IRQ", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "" } + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "IRQ 2", + .value = 2 + }, + { + .description = "IRQ 3", + .value = 3 + }, + { + .description = "IRQ 5", + .value = 5 + }, + { + .description = "IRQ 7", + .value = 7 + }, + { .description = "" } } }, - { "dma", "DMA", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "DMA 1", 1 }, - { "DMA 3", 3 }, - { "" } + { + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "DMA 1", + .value = 1 + }, + { + .description = "DMA 3", + .value = 3 + }, + { .description = "" } } }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "cms", "Enable CMS", CONFIG_BINARY, "", 0 }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "cms", + .description = "Enable CMS", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb2_config[] = { - { "base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, - { - { "0x220", 0x220 }, - { "0x240", 0x240 }, - { "0x260", 0x260 }, - { "" } + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x220, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "0x260", + .value = 0x260 + }, + { .description = "" } } }, - { "mixaddr", "Mixer", CONFIG_HEX16, "", 0, "", { 0 }, - { - { "Disabled", 0 }, - { "0x220", 0x220 }, - { "0x240", 0x240 }, - { "0x250", 0x250 }, - { "0x260", 0x260 }, - { "" } + { + .name = "mixaddr", + .description = "Mixer", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "Disabled", + .value = 0 + }, + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "0x250", + .value = 0x250 + }, + { + .description = "0x260", + .value = 0x260 + }, + { .description = "" } } }, - { "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "" } + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "IRQ 2", + .value = 2 + }, + { + .description = "IRQ 3", + .value = 3 + }, + { + .description = "IRQ 5", + .value = 5 + }, + { + .description = "IRQ 7", + .value = 7 + }, + { .description = "" } } }, - { "dma", "DMA", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "DMA 1", 1 }, - { "DMA 3", 3 }, - { "" } + { + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "DMA 1", + .value = 1 + }, + { + .description = "DMA 3", + .value = 3 + }, + { .description = "" } } }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "cms", "Enable CMS", CONFIG_BINARY, "", 0 }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "cms", + .description = "Enable CMS", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_mcv_config[] = { - { "irq", "IRQ", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 3", 3 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "" } + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "IRQ 2", + .value = 2 + }, + { + .description = "IRQ 3", + .value = 3 + }, + { + .description = "IRQ 5", + .value = 5 + }, + { + .description = "IRQ 7", + .value = 7 + }, + { .description = "" } } }, - { "dma", "DMA", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "DMA 1", 1 }, - { "DMA 3", 3 }, - { "" } + { + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "DMA 1", + .value = 1 + }, + { + .description = "DMA 3", + .value = 3 + }, + { .description = "" } } }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_pro_config[] = { - { "base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, - { - { "0x220", 0x220 }, - { "0x240", 0x240 }, - { "" } + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x220, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x240", + .value = 0x240 + }, + { .description = "" } } }, - { "irq", "IRQ", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "IRQ 10", 10 }, - { "" } + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "IRQ 2", + .value = 2 + }, + { + .description = "IRQ 5", + .value = 5 + }, + { + .description = "IRQ 7", + .value = 7 + }, + { + .description = "IRQ 10", + .value = 10 + }, + { .description = "" } } }, - { "dma", "DMA", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "DMA 0", 0 }, - { "DMA 1", 1 }, - { "DMA 3", 3 }, - { "" } + { + .name = "dma", + .description = "DMA", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "DMA 0", + .value = 0 + }, + { + .description = "DMA 1", + .value = 1 + }, + { + .description = "DMA 3", + .value = 3 + }, + { .description = "" } } }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_16_config[] = { - { "base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, - { - { "0x220", 0x220 }, - { "0x240", 0x240 }, - { "0x260", 0x260 }, - { "0x280", 0x280 }, - { "" } + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x220, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "0x260", + .value = 0x260 + }, + { + .description = "0x280", + .value = 0x280 + }, + { .description = "" } } }, - { "base401", "MPU-401 Address", CONFIG_HEX16, "", 0x330, "", { 0 }, - { - { "Disabled", 0 }, - { "0x300", 0x300 }, - { "0x330", 0x330 }, - { "" } + { + .name = "base401", + .description = "MPU-401 Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x330, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "Disabled", + .value = 0 + }, + { + .description = "0x300", + .value = 0x300 + }, + { + .description = "0x330", + .value = 0x330 + }, + { .description = "" } } }, - { "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "IRQ 10", 10 }, - { "" } + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "IRQ 2", + .value = 2 + }, + { + .description = "IRQ 5", + .value = 5 + }, + { + .description = "IRQ 7", + .value = 7 + }, + { + .description = "IRQ 10", + .value = 10 + }, + { .description = "" } } }, - { "dma", "Low DMA channel", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "DMA 0", 0 }, - { "DMA 1", 1 }, - { "DMA 3", 3 }, - { "" } + { + .name = "dma", + .description = "Low DMA channel", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "DMA 0", + .value = 0 + }, + { + .description = "DMA 1", + .value = 1 + }, + { + .description = "DMA 3", + .value = 3 + }, + { .description = "" } } }, - { "dma16", "High DMA channel", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "DMA 5", 5 }, - { "DMA 6", 6 }, - { "DMA 7", 7 }, - { "" } + { + .name = "dma16", + .description = "High DMA channel", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "DMA 5", + .value = 5 + }, + { + .description = "DMA 6", + .value = 6 + }, + { + .description = "DMA 7", + .value = 7 + }, + { .description = "" } } }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_16_pnp_config[] = { - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_32_pnp_config[] = { - { "onboard_ram", "Onboard RAM", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "None", 0 }, - { "512 KB", 512 }, - { "2 MB", 2048 }, - { "8 MB", 8192 }, - { "28 MB", 28672 }, - { "" } + { + .name = "onboard_ram", + .description = "Onboard RAM", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "None", + .value = 0 + }, + { + .description = "512 KB", + .value = 512 + }, + { + .description = "2 MB", + .value = 2048 + }, + { + .description = "8 MB", + .value = 8192 + }, + { + .description = "28 MB", + .value = 28672 + }, + { .description = "" } } }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe32_config[] = { - { "base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, - { - { "0x220", 0x220 }, - { "0x240", 0x240 }, - { "0x260", 0x260 }, - { "0x280", 0x280 }, - { "" } + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x220, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x220", + .value = 0x220 + }, + { + .description = "0x240", + .value = 0x240 + }, + { + .description = "0x260", + .value = 0x260 + }, + { + .description = "0x280", + .value = 0x280 + }, + { .description = "" } } }, - { "emu_base", "EMU8000 Address", CONFIG_HEX16, "", 0x620, "", { 0 }, - { - { "0x620", 0x620 }, - { "0x640", 0x640 }, - { "0x660", 0x660 }, - { "0x680", 0x680 }, + { + .name = "emu_base", + .description = "EMU8000 Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x620, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x620", + .value = 0x620 + }, + { + .description = "0x640", + .value = 0x640 + }, + { + .description = "0x660", + .value = 0x660 + }, + { + .description = "0x680", + .value = 0x680 + }, { .description = ""} } }, - { "base401", "MPU-401 Address", CONFIG_HEX16, "", 0x330, "", { 0 }, - { - { "Disabled", 0 }, - { "0x300", 0x300 }, - { "0x330", 0x330 }, - { "" } + { + .name = "base401", + .description = "MPU-401 Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x330, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "Disabled", + .value = 0 + }, + { + .description = "0x300", + .value = 0x300 + }, + { + .description = "0x330", + .value = 0x330 + }, + { .description = "" } } }, - { "irq", "IRQ", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "IRQ 2", 2 }, - { "IRQ 5", 5 }, - { "IRQ 7", 7 }, - { "IRQ 10", 10 }, - { "" } + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "IRQ 2", + .value = 2 + }, + { + .description = "IRQ 5", + .value = 5 + }, + { + .description = "IRQ 7", + .value = 7 + }, + { + .description = "IRQ 10", + .value = 10 + }, + { .description = "" } } }, - { "dma", "Low DMA channel", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "DMA 0", 0 }, - { "DMA 1", 1 }, - { "DMA 3", 3 }, - { "" } + { + .name = "dma", + .description = "Low DMA channel", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "DMA 0", + .value = 0 + }, + { + .description = "DMA 1", + .value = 1 + }, + { + .description = "DMA 3", + .value = 3 + }, + { .description = "" } } }, - { "dma16", "High DMA channel", CONFIG_SELECTION, "", 5, "", { 0 }, - { - { "DMA 5", 5 }, - { "DMA 6", 6 }, - { "DMA 7", 7 }, - { "" } + { + .name = "dma16", + .description = "High DMA channel", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "DMA 5", + .value = 5 + }, + { + .description = "DMA 6", + .value = 6 + }, + { + .description = "DMA 7", + .value = 7 + }, + { .description = "" } } }, - { "onboard_ram", "Onboard RAM", CONFIG_SELECTION, "", 512, "", { 0 }, - { - { "None", 0 }, - { "512 KB", 512 }, - { "2 MB", 2048 }, - { "8 MB", 8192 }, - { "28 MB", 28672 }, - { "" } + { + .name = "onboard_ram", + .description = "Onboard RAM", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 512, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "None", + .value = 0 + }, + { + .description = "512 KB", + .value = 512 + }, + { + .description = "2 MB", + .value = 2048 + }, + { + .description = "8 MB", + .value = 8192 + }, + { + .description = "28 MB", + .value = 28672 + }, + { "" } } }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe32_pnp_config[] = { - { "onboard_ram", "Onboard RAM", CONFIG_SELECTION, "", 512, "", { 0 }, - { - { "None", 0 }, - { "512 KB", 512 }, - { "2 MB", 2048 }, - { "8 MB", 8192 }, - { "28 MB", 28672 }, - { "" } + { + .name = "onboard_ram", + .description = "Onboard RAM", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 512, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "None", + .value = 0 + }, + { + .description = "512 KB", + .value = 512 + }, + { + .description = "2 MB", + .value = 2048 + }, + { + .description = "8 MB", + .value = 8192 + }, + { + .description = "28 MB", + .value = 28672 + }, + { .description = "" } } }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe64_value_config[] = { - { "onboard_ram", "Onboard RAM", CONFIG_SELECTION, "", 512, "", { 0 }, - { - { "512 KB", 512 }, - { "1 MB", 1024 }, - { "2 MB", 2048 }, - { "4 MB", 4096 }, - { "8 MB", 8192 }, - { "12 MB", 12288 }, - { "16 MB", 16384 }, - { "20 MB", 20480 }, - { "24 MB", 24576 }, - { "28 MB", 28672 }, - { "" } + { + .name = "onboard_ram", + .description = "Onboard RAM", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 512, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "512 KB", + .value = 512 + }, + { + .description = "1 MB", + .value = 1024 + }, + { + .description = "2 MB", + .value = 2048 + }, + { + .description = "4 MB", + .value = 4096 + }, + { + .description = "8 MB", + .value = 8192 + }, + { + .description = "12 MB", + .value = 12288 + }, + { + .description = "16 MB", + .value = 16384 + }, + { + .description = "20 MB", + .value = 20480 + }, + { + .description = "24 MB", + .value = 24576 + }, + { + .description = "28 MB", + .value = 28672 + }, + { .description = "" } } }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe64_config[] = { - { "onboard_ram", "Onboard RAM", CONFIG_SELECTION, "", 1024, "", { 0 }, - { - { "1 MB", 1024 }, - { "2 MB", 2048 }, - { "4 MB", 4096 }, - { "8 MB", 8192 }, - { "12 MB", 12288 }, - { "16 MB", 16384 }, - { "20 MB", 20480 }, - { "24 MB", 24576 }, - { "28 MB", 28672 }, - { "" } + { + .name = "onboard_ram", + .description = "Onboard RAM", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 1024, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "1 MB", + .value = 1024 + }, + { + .description = "2 MB", + .value = 2048 + }, + { + .description = "4 MB", + .value = 4096 + }, + { + .description = "8 MB", + .value = 8192 + }, + { + .description = "12 MB", + .value = 12288 + }, + { + .description = "16 MB", + .value = 16384 + }, + { + .description = "20 MB", + .value = 20480 + }, + { + .description = "24 MB", + .value = 24576 + }, + { + .description = "28 MB", + .value = 28672 + }, + { .description = "" } } }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } }; static const device_config_t sb_awe64_gold_config[] = { - { "onboard_ram", "Onboard RAM", CONFIG_SELECTION, "", 4096, "", { 0 }, - { - { "4 MB", 4096 }, - { "8 MB", 8192 }, - { "12 MB", 12288 }, - { "16 MB", 16384 }, - { "20 MB", 20480 }, - { "24 MB", 24576 }, - { "28 MB", 28672 }, - { "" } + { + .name = "onboard_ram", + .description = "Onboard RAM", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 4096, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "4 MB", + .value = 4096 + }, + { + .description = "8 MB", + .value = 8192 + }, + { + .description = "12 MB", + .value = 12288 + }, + { + .description = "16 MB", + .value = 16384 + }, + { + .description = "20 MB", + .value = 20480 + }, + { + .description = "24 MB", + .value = 24576 + }, + { + .description = "28 MB", + .value = 28672 + }, + { .description = "" } } }, - { "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, - { "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, - { "", "", -1 } + { + .name = "receive_input", + .description = "Receive input (SB MIDI)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { + .name = "receive_input401", + .description = "Receive input (MPU-401)", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = CONFIG_END } }; // clang-format on diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index ad2581b33..125eff4d6 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -247,15 +247,30 @@ sn76489_device_close(void *p) static const device_config_t tndy_config[] = { // clang-format off { - "base", "Address", CONFIG_HEX16, "", 0x0C0, "", { 0 }, - { - { "0x0C0", 0x0C0 }, - { "0x1E0", 0x1E0 }, - { "0x2C0", 0x2C0 }, - { "" } + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0C0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x0C0", + .value = 0x0C0 + }, + { + .description = "0x1E0", + .value = 0x1E0 + }, + { + .description = "0x2C0", + .value = 0x2C0 + }, + { .description = "" } } }, - { "", "", -1 } + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; #endif diff --git a/src/sound/snd_ssi2001.c b/src/sound/snd_ssi2001.c index 127968d96..211091dfa 100644 --- a/src/sound/snd_ssi2001.c +++ b/src/sound/snd_ssi2001.c @@ -92,13 +92,32 @@ ssi2001_close(void *p) static const device_config_t ssi2001_config[] = { // clang-format off - { "base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 }, - { - { "0x280", 0x280 }, - { "0x2A0", 0x2A0 }, - { "0x2C0", 0x2C0 }, - { "0x2E0", 0x2E0 }, - { "" } + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x280, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x280", + .value = 0x280 + }, + { + .description = "0x2A0", + .value = 0x2A0 + }, + { + .description = "0x2C0", + .value = 0x2C0 + }, + { + .description = "0x2E0", + .value = 0x2E0 + }, + { .description = "" } } }, { "gameport", "Enable Game port", CONFIG_BINARY, "", 1 }, diff --git a/src/sound/snd_wss.c b/src/sound/snd_wss.c index aafb7cbeb..8df4791c6 100644 --- a/src/sound/snd_wss.c +++ b/src/sound/snd_wss.c @@ -228,17 +228,42 @@ wss_speed_changed(void *priv) static const device_config_t wss_config[] = { // clang-format off - { "base", "Address", CONFIG_HEX16, "", 0x530, "", { 0 }, - { - { "0x530", 0x530 }, - { "0x604", 0x604 }, - { "0xe80", 0xe80 }, - { "0xf40", 0xf40 }, - { "" } + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x530, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { + .description = "0x530", + .value = 0x530 + }, + { + .description = "0x604", + .value = 0x604 + }, + { + .description = "0xe80", + .value = 0xe80 + }, + { + .description = "0xf40", + .value = 0xf40 + }, + { .description = "" } } }, - { "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "opl", + .description = "Enable OPL", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 + }, + { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; diff --git a/src/sound/sound.c b/src/sound/sound.c index 5110b9c59..ec9e51f91 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -33,6 +33,7 @@ #include <86box/machine.h> #include <86box/midi.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/snd_ac97.h> #include <86box/snd_azt2316a.h> #include <86box/timer.h> diff --git a/src/thread.cpp b/src/thread.cpp index 1003dd871..6a7af25b8 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -3,6 +3,7 @@ #include #include <86box/plat.h> +#include <86box/thread.h> struct event_cpp11_t { diff --git a/src/unix/CMakeLists.txt b/src/unix/CMakeLists.txt index 1712288d2..6d1c01a34 100644 --- a/src/unix/CMakeLists.txt +++ b/src/unix/CMakeLists.txt @@ -28,3 +28,7 @@ target_link_libraries(86Box Threads::Threads) add_library(ui OBJECT unix_sdl.c unix_cdrom.c) target_compile_definitions(ui PUBLIC _FILE_OFFSET_BITS=64) target_link_libraries(ui ${CMAKE_DL_LIBS}) + +if(APPLE) + target_sources(plat PRIVATE macOSXGlue.m) +endif() diff --git a/src/unix/assets/86Box.spec b/src/unix/assets/86Box.spec index 8db7b6854..4809db3e8 100644 --- a/src/unix/assets/86Box.spec +++ b/src/unix/assets/86Box.spec @@ -15,7 +15,7 @@ %global romver 20220319 Name: 86Box -Version: 3.3 +Version: 3.4 Release: 1%{?dist} Summary: Classic PC emulator License: GPLv2+ diff --git a/src/mac/macOSXGlue.h b/src/unix/macOSXGlue.h similarity index 100% rename from src/mac/macOSXGlue.h rename to src/unix/macOSXGlue.h diff --git a/src/mac/macOSXGlue.m b/src/unix/macOSXGlue.m similarity index 99% rename from src/mac/macOSXGlue.m rename to src/unix/macOSXGlue.m index d23c9abb8..b170dea5f 100644 --- a/src/mac/macOSXGlue.m +++ b/src/unix/macOSXGlue.m @@ -15,12 +15,12 @@ void getDefaultROMPath(char* Path) inDomains:NSUserDomainMask]; NSURL* appSupportDir = nil; NSURL* appDirectory = nil; - + if ([possibleURLs count] >= 1) { // Use the first directory (if multiple are returned) appSupportDir = [possibleURLs objectAtIndex:0]; } - + // If a valid app support directory exists, add the // app's bundle ID to it to specify the final directory. if (appSupportDir) { @@ -29,7 +29,7 @@ void getDefaultROMPath(char* Path) appDirectory=[appDirectory URLByAppendingPathComponent:@"roms"]; } // create ~/Library/Application Support/... stuff - + NSError* theError = nil; if (![sharedFM createDirectoryAtURL:appDirectory withIntermediateDirectories:YES attributes:nil error:&theError]) @@ -37,7 +37,7 @@ void getDefaultROMPath(char* Path) // Handle the error. NSLog(@"Error creating user library rom path"); } else NSLog(@"Create user rom path sucessfull"); - + strcpy(Path,[appDirectory fileSystemRepresentation]); // return appDirectory; } diff --git a/src/unix/unix.c b/src/unix/unix.c index 5f6429b89..a7ef1abe7 100644 --- a/src/unix/unix.c +++ b/src/unix/unix.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include <86box/86box.h> @@ -26,8 +27,10 @@ #include <86box/keyboard.h> #include <86box/mouse.h> #include <86box/config.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/plat_dynld.h> +#include <86box/thread.h> #include <86box/device.h> #include <86box/gameport.h> #include <86box/unix_sdl.h> @@ -36,6 +39,10 @@ #include <86box/ui.h> #include <86box/gdbstub.h> +#ifdef __APPLE__ +#include "macOSXGlue.h" +#endif + static int first_use = 1; static uint64_t StartingTime; static uint64_t Frequency; @@ -288,24 +295,24 @@ plat_fopen64(const char *path, const char *mode) } int -plat_path_abs(char *path) +path_abs(char *path) { return path[0] == '/'; } void -plat_path_normalize(char* path) +path_normalize(char* path) { /* No-op. */ } void -plat_path_slash(char *path) +path_slash(char *path) { if ((path[strlen(path)-1] != '/')) { strcat(path, "/"); } - plat_path_normalize(path); + path_normalize(path); } void @@ -332,7 +339,7 @@ plat_get_basename(const char *path) return((char *)path); } char * -plat_get_filename(char *s) +path_get_filename(char *s) { int c = strlen(s) - 1; @@ -347,7 +354,7 @@ plat_get_filename(char *s) char * -plat_get_extension(char *s) +path_get_extension(char *s) { int c = strlen(s) - 1; @@ -365,10 +372,10 @@ plat_get_extension(char *s) void -plat_append_filename(char *dest, const char *s1, const char *s2) +path_append_filename(char *dest, const char *s1, const char *s2) { strcpy(dest, s1); - plat_path_slash(dest); + path_slash(dest); strcat(dest, s2); } @@ -480,7 +487,7 @@ ui_sb_update_text() } void -plat_get_dirname(char *dest, const char *path) +path_get_dirname(char *dest, const char *path) { int c = (int)strlen(path); char *ptr; @@ -753,7 +760,7 @@ plat_init_rom_paths() if (getenv("XDG_DATA_HOME")) { char xdg_rom_path[1024] = { 0 }; strncpy(xdg_rom_path, getenv("XDG_DATA_HOME"), 1024); - plat_path_slash(xdg_rom_path); + path_slash(xdg_rom_path); strncat(xdg_rom_path, "86Box/", 1024); if (!plat_dir_check(xdg_rom_path)) @@ -762,7 +769,7 @@ plat_init_rom_paths() if (!plat_dir_check(xdg_rom_path)) plat_dir_create(xdg_rom_path); - add_rom_path(xdg_rom_path); + rom_add_path(xdg_rom_path); } else { char home_rom_path[1024] = { 0 }; snprintf(home_rom_path, 1024, "%s/.local/share/86Box/", getenv("HOME") ? getenv("HOME") : getpwuid(getuid())->pw_dir); @@ -773,7 +780,7 @@ plat_init_rom_paths() if (!plat_dir_check(home_rom_path)) plat_dir_create(home_rom_path); - add_rom_path(home_rom_path); + rom_add_path(home_rom_path); } if (getenv("XDG_DATA_DIRS")) { char* xdg_rom_paths = strdup(getenv("XDG_DATA_DIRS")); @@ -786,23 +793,20 @@ plat_init_rom_paths() while ((cur_xdg_rom_path = local_strsep(&xdg_rom_paths, ";")) != NULL) { char real_xdg_rom_path[1024] = { '\0' }; strcat(real_xdg_rom_path, cur_xdg_rom_path); - plat_path_slash(real_xdg_rom_path); + path_slash(real_xdg_rom_path); strcat(real_xdg_rom_path, "86Box/roms/"); - add_rom_path(real_xdg_rom_path); + rom_add_path(real_xdg_rom_path); } } free(xdg_rom_paths_orig); } else { - add_rom_path("/usr/local/share/86Box/roms/"); - add_rom_path("/usr/share/86Box/roms/"); + rom_add_path("/usr/local/share/86Box/roms/"); + rom_add_path("/usr/share/86Box/roms/"); } #else - char home_rom_path[1024] = { '\0' }; - snprintf(home_rom_path, 1024, "%s/Documents/86Box/", getenv("HOME") ? getenv("HOME") : getpwuid(getuid())->pw_dir); - plat_dir_create(home_rom_path); - strcat(home_rom_path, "roms/"); - plat_dir_create(home_rom_path); - add_rom_path(home_rom_path); + char default_rom_path[1024] = { '\0 '}; + getDefaultROMPath(default_rom_path); + rom_path_add(default_rom_path); #endif } diff --git a/src/unix/unix_thread.c b/src/unix/unix_thread.c index 564b1943b..dc7625e12 100644 --- a/src/unix/unix_thread.c +++ b/src/unix/unix_thread.c @@ -5,6 +5,7 @@ #include #include <86box/86box.h> #include <86box/plat.h> +#include <86box/thread.h> typedef struct event_pthread_t diff --git a/src/video/CMakeLists.txt b/src/video/CMakeLists.txt index b3182afe8..3e1ffcc71 100644 --- a/src/video/CMakeLists.txt +++ b/src/video/CMakeLists.txt @@ -47,9 +47,3 @@ add_library(voodoo OBJECT vid_voodoo.c vid_voodoo_banshee.c if(NOT MSVC AND (ARCH STREQUAL "i386" OR ARCH STREQUAL "x86_64")) target_compile_options(voodoo PRIVATE "-msse2") endif() - -# Suppress GCC false positive warnings in vid_voodoo_codegen_x86[-64].h -# that cause ~3000 lines to be output into the logs each time -if(CMAKE_C_COMPILER_ID STREQUAL "GNU") - target_compile_options(voodoo PRIVATE "-Wstringop-overflow=0") -endif() diff --git a/src/video/vid_ati28800.c b/src/video/vid_ati28800.c index a305c80c0..87abb7da8 100644 --- a/src/video/vid_ati28800.c +++ b/src/video/vid_ati28800.c @@ -708,29 +708,61 @@ ati28800_force_redraw(void *priv) // clang-format off static const device_config_t ati28800_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 512, "", { 0 }, - { - { "256 kB", 256 }, - { "512 kB", 512 }, - { "1 MB", 1024 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 512, + .selection = { + { + .description = "256 kB", + .value = 256 + }, + { + .description = "512 kB", + .value = 512 + }, + { + .description = "1 MB", + .value = 1024 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; #if defined(DEV_BRANCH) && defined(USE_XL24) static const device_config_t ati28800_wonderxl_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 512, "", { 0 }, - { - { "256 kB", 256 }, - { "512 kB", 512 }, - { "1 MB", 1024 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 512, + .selection = { + { + .description = "256 kB", + .value = 256 + }, + { + .description = "512 kB", + .value = 512 + }, + { + .description = "1 MB", + .value = 1024 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; #endif // clang-format on diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index db111fa37..2fe70c322 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -31,6 +31,7 @@ #include <86box/pci.h> #include <86box/rom.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/i2c.h> #include <86box/vid_ddc.h> @@ -1283,7 +1284,7 @@ void mach64_blit(uint32_t cpu_dat, int count, mach64_t *mach64) case OP_RECT: while (count) { - uint32_t src_dat, dest_dat; + uint32_t src_dat = 0, dest_dat; uint32_t host_dat = 0; uint32_t old_dest_dat; int mix = 0; @@ -3684,27 +3685,56 @@ void mach64_force_redraw(void *p) // clang-format off static const device_config_t mach64gx_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 }, - { - { "1 MB", 1 }, - { "2 MB", 2 }, - { "4 MB", 4 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 4, + .selection = { + { + .description = "1 MB", + .value = 1 + }, + { + .description = "2 MB", + .value = 2 + }, + { + .description = "4 MB", + .value = 4 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; static const device_config_t mach64vt2_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 }, - { - { "2 MB", 2 }, - { "4 MB", 4 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 4, + .selection = { + { + .description = "2 MB", + .value = 2 + }, + { + .description = "4 MB", + .value = 4 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; // clang-format on diff --git a/src/video/vid_cga.c b/src/video/vid_cga.c index 3a0eacc96..9369f1451 100644 --- a/src/video/vid_cga.c +++ b/src/video/vid_cga.c @@ -578,37 +578,82 @@ cga_speed_changed(void *p) // clang-format off const device_config_t cga_config[] = { { - "display_type", "Display type", CONFIG_SELECTION, "", CGA_RGB, "", { 0 }, - { - { "RGB", CGA_RGB }, - { "Composite", CGA_COMPOSITE }, - { "" } + .name = "display_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_int = CGA_RGB, + .selection = { + { + .description = "RGB", + .value = CGA_RGB + }, + { + .description = "Composite", + .value = CGA_COMPOSITE + }, + { + .description = "" + } } }, { - "composite_type", "Composite type", CONFIG_SELECTION, "", COMPOSITE_OLD, "", { 0 }, - { - { "Old", COMPOSITE_OLD }, - { "New", COMPOSITE_NEW }, - { "" } + .name = "composite_type", + .description = "Composite type", + .type = CONFIG_SELECTION, + .default_int = COMPOSITE_OLD, + .selection = { + { + .description = "Old", + .value = COMPOSITE_OLD + }, + { + .description = "New", + .value = COMPOSITE_NEW + }, + { + .description = "" + } } }, { - "rgb_type", "RGB type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Color", 0 }, - { "Green Monochrome", 1 }, - { "Amber Monochrome", 2 }, - { "Gray Monochrome", 3 }, - { "Color (no brown)", 4 }, - { "" } + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_int = 0, + .selection = { + { + .description = "Color", + .value = 0 + }, + { + .description = "Green Monochrome", + .value = 1 + }, + { + .description = "Amber Monochrome", + .value = 2 + }, + { + .description = "Gray Monochrome", + .value = 3 + }, + { + .description = "Color (no brown)", + .value = 4 + }, + { + .description = "" + } } }, { - "snow_enabled", "Snow emulation", CONFIG_BINARY, "", 1 + .name = "snow_enabled", + .description = "Snow emulation", + .type = CONFIG_BINARY, + .default_int = 1 }, { - "", "", -1 + .type = CONFIG_END } }; // clang-format on diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index a39b9aea4..8c8474f97 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -546,14 +546,8 @@ gd54xx_overlay_draw(svga_t *svga, int displine) int bpp = svga->bpp; int bytesperpix = (bpp + 7) / 8; uint8_t *src2 = &svga->vram[(svga->ma - (svga->hdisp * bytesperpix)) & svga->vram_display_mask]; - int w = gd54xx->overlay.r2sdz; int occl, ckval; - if (gd54xx->overlay.mode == 2) - w *= 4; - else - w *= 2; - p = &((uint32_t *)buffer32->line[displine])[gd54xx->overlay.region1size + svga->x_add]; src2 += gd54xx->overlay.region1size * bytesperpix; @@ -4304,7 +4298,7 @@ static const device_config_t gd542x_config[] = { .default_int = 512 }, { - .type = -1 + .type = CONFIG_END } }; @@ -4333,7 +4327,7 @@ static const device_config_t gd5426_config[] = { .default_int = 2048 }, { - .type = -1 + .type = CONFIG_END } }; @@ -4362,7 +4356,7 @@ static const device_config_t gd5428_onboard_config[] = { .default_int = 2048 }, { - .type = -1 + .type = CONFIG_END } }; @@ -4387,7 +4381,7 @@ static const device_config_t gd5429_config[] = { .default_int = 2 }, { - .type = -1 + .type = CONFIG_END } }; @@ -4412,7 +4406,7 @@ static const device_config_t gd5440_onboard_config[] = { .default_int = 2 }, { - .type = -1 + .type = CONFIG_END } }; @@ -4441,7 +4435,7 @@ static const device_config_t gd5434_config[] = { .default_int = 4 }, { - .type = -1 + .type = CONFIG_END } }; @@ -4470,7 +4464,7 @@ static const device_config_t gd5434_onboard_config[] = { .default_int = 4 }, { - .type = -1 + .type = CONFIG_END } }; diff --git a/src/video/vid_colorplus.c b/src/video/vid_colorplus.c index bd68c43b9..2dc2d2308 100644 --- a/src/video/vid_colorplus.c +++ b/src/video/vid_colorplus.c @@ -427,27 +427,55 @@ void colorplus_speed_changed(void *p) cga_recalctimings(&colorplus->cga); } - static const device_config_t colorplus_config[] = { // clang-format off { - "display_type", "Display type", CONFIG_SELECTION, "", CGA_RGB, "", { 0 }, - { - { "RGB", CGA_RGB }, - { "Composite", CGA_COMPOSITE }, - { "" } + .name = "display_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_int = CGA_RGB, + .selection = { + { + .description = "RGB", + .value = CGA_RGB + }, + { + .description = "Composite", + .value = CGA_COMPOSITE + }, + { + .description = "" + } } }, { - "composite_type", "Composite type", CONFIG_SELECTION, "", COMPOSITE_OLD, "", { 0 }, - { - { "Old", COMPOSITE_OLD }, - { "New", COMPOSITE_NEW }, - { "" } + .name = "composite_type", + .description = "Composite type", + .type = CONFIG_SELECTION, + .default_int = COMPOSITE_OLD, + .selection = { + { + .description = "Old", + .value = COMPOSITE_OLD + }, + { + .description = "New", + .value = COMPOSITE_NEW + }, + { + .description = "" + } } }, - { "snow_enabled", "Snow emulation", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "snow_enabled", + .description = "Snow emulation", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_ega.c b/src/video/vid_ega.c index 41a34ef09..e76c68afa 100644 --- a/src/video/vid_ega.c +++ b/src/video/vid_ega.c @@ -1179,13 +1179,30 @@ ega_speed_changed(void *p) static const device_config_t ega_config[] = { // clang-format off { - "memory", "Memory size", CONFIG_SELECTION, "", 256, "", { 0 }, - { - { "32 kB", 32 }, - { "64 kB", 64 }, - { "128 kB", 128 }, - { "256 kB", 256 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 256, + .selection = { + { + .description = "32 kB", + .value = 32 + }, + { + .description = "64 kB", + .value = 64 + }, + { + .description = "128 kB", + .value = 128 + }, + { + .description = "256 kB", + .value = 256 + }, + { + .description = "" + } } }, { @@ -1228,7 +1245,7 @@ static const device_config_t ega_config[] = { .default_int = 9 }, { - .type = -1 + .type = CONFIG_END } // clang-format on }; diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index 119c0b0ed..c18a422a3 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -807,15 +807,31 @@ et4000_kasan_available(void) static const device_config_t et4000_config[] = { // clang-format off { - "memory", "Memory size", CONFIG_SELECTION, "", 1024, "", { 0 }, - { - { "256 KB", 256 }, - { "512 KB", 512 }, - { "1 MB", 1024 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 1024, + .selection = { + { + .description = "256 KB", + .value = 256 + }, + { + .description = "512 KB", + .value = 512 + }, + { + .description = "1 MB", + .value = 1024 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index e318e2099..80c48b15f 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -120,7 +120,7 @@ typedef struct et4000w32p_t uint32_t base[3]; uint8_t ctrl; } mmu; - + volatile int busy; } et4000w32p_t; @@ -176,7 +176,7 @@ et4000w32p_out(uint16_t addr, uint8_t val, void *p) uint8_t old; uint32_t add2addr = 0; - if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) + if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) addr ^= 0x60; switch (addr) { @@ -318,12 +318,12 @@ et4000w32p_in(uint16_t addr, void *p) et4000w32p_t *et4000 = (et4000w32p_t *)p; svga_t *svga = &et4000->svga; - if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) + if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) addr ^= 0x60; switch (addr) { case 0x3c5: - if ((svga->seqaddr & 0xf) == 7) + if ((svga->seqaddr & 0xf) == 7) return svga->seqregs[svga->seqaddr & 0xf] | 4; break; @@ -466,7 +466,7 @@ et4000w32p_recalctimings(svga_t *svga) } et4000->adjust_cursor = 0; - + switch (svga->bpp) { case 15: case 16: svga->hdisp >>= 1; @@ -501,10 +501,10 @@ et4000w32p_recalctimings(svga_t *svga) } switch (svga->gdcreg[5] & 0x60) { - case 0x00: + case 0x00: if (et4000->rev == 5) svga->ma_latch++; - + if (svga->seqregs[1] & 8) /* Low res (320) */ svga->render = svga_render_4bpp_lowres; else @@ -674,7 +674,7 @@ et4000w32p_accel_write_fifo(et4000w32p_t *et4000, uint32_t addr, uint8_t val) et4000->acl.queued.dest_off = (et4000->acl.queued.dest_off & 0x00ff) | ((val & 0x0f) << 8); break; case 0x8e: - if (et4000->type >= ET4000W32P_REVC) + if (et4000->type >= ET4000W32P_REVC) et4000->acl.queued.pixel_depth = val & 0x30; else et4000->acl.queued.vbus = val & 0x03; @@ -747,7 +747,7 @@ et4000w32p_accel_write_fifo(et4000w32p_t *et4000, uint32_t addr, uint8_t val) } } break; - case 0xa4: + case 0xa4: et4000->acl.queued.mix_addr = (et4000->acl.queued.mix_addr & 0xFFFFFF00) | val; break; case 0xa5: @@ -829,7 +829,7 @@ et4000w32p_accel_write_mmu(et4000w32p_t *et4000, uint32_t addr, uint8_t val, uin et4000->acl.cpu_input_num = 0; } - + if ((et4000->acl.internal.ctrl_routing & 7) == 4) /*CPU data is X Count*/ et4000w32_blit(val | (et4000->acl.queued.count_x << 8), 0, 0, 0xffffffff, et4000); if ((et4000->acl.internal.ctrl_routing & 7) == 5) /*CPU data is Y Count*/ @@ -863,7 +863,7 @@ et4000w32p_mmu_write(uint32_t addr, uint8_t val, void *p) et4000w32p_accel_write_fifo(et4000, addr & 0x7fff, val); } else { switch (addr & 0xff) { - case 0x00: + case 0x00: et4000->mmu.base[0] = (et4000->mmu.base[0] & 0x3fff00) | val; break; case 0x01: @@ -911,7 +911,7 @@ et4000w32p_mmu_read(uint32_t addr, void *p) et4000w32p_t *et4000 = (et4000w32p_t *)p; svga_t *svga = &et4000->svga; uint8_t temp; - + switch (addr & 0x6000) { case 0x0000: /* MMU 0 */ case 0x2000: /* MMU 1 */ @@ -933,7 +933,7 @@ et4000w32p_mmu_read(uint32_t addr, void *p) if ((addr & 0x1fff) + et4000->mmu.base[et4000->bank] >= svga->vram_max) return 0xff; - + return svga->vram[(addr & 0x1fff) + et4000->mmu.base[et4000->bank]]; case 0x6000: @@ -1001,8 +1001,8 @@ et4000w32p_mmu_read(uint32_t addr, void *p) return et4000->acl.internal.dest_off & 0xff; case 0x8d: return et4000->acl.internal.dest_off >> 8; - case 0x8e: - if (et4000->type >= ET4000W32P_REVC) + case 0x8e: + if (et4000->type >= ET4000W32P_REVC) return et4000->acl.internal.pixel_depth; else return et4000->acl.internal.vbus; @@ -1036,7 +1036,7 @@ et4000w32_blit_start(et4000w32p_t *et4000) { et4000->acl.x_count = et4000->acl.internal.count_x; et4000->acl.y_count = et4000->acl.internal.count_y; - + et4000->acl.pattern_addr = et4000->acl.internal.pattern_addr; et4000->acl.source_addr = et4000->acl.internal.source_addr; et4000->acl.dest_addr = et4000->acl.internal.dest_addr; @@ -1098,9 +1098,9 @@ et4000w32p_blit_start(et4000w32p_t *et4000) et4000->acl.internal.pos_x = et4000->acl.internal.pos_y = 0; et4000->acl.pattern_x = et4000->acl.source_x = et4000->acl.pattern_y = et4000->acl.source_y = 0; et4000->acl.status |= ACL_XYST; - + et4000w32_log("ACL status XYST set\n"); - if ((!(et4000->acl.internal.ctrl_routing & 7) || (et4000->acl.internal.ctrl_routing & 4)) && !(et4000->acl.internal.ctrl_routing & 0x40)) + if ((!(et4000->acl.internal.ctrl_routing & 7) || (et4000->acl.internal.ctrl_routing & 4)) && !(et4000->acl.internal.ctrl_routing & 0x40)) et4000->acl.status |= ACL_SSO; if (et4000w32_wrap_x[et4000->acl.internal.pattern_wrap & 7]) { @@ -1497,7 +1497,7 @@ et4000w32_blit(int count, int cpu_input, uint32_t src_dat, uint32_t mix_dat, et4 /*Write the data*/ svga->vram[et4000->acl.dest_addr & et4000->vram_mask] = out; svga->changedvram[(et4000->acl.dest_addr & et4000->vram_mask) >> 12] = changeframecount; - + if (et4000->acl.internal.xy_dir & 1) { et4000->acl.dest_addr--; et4000->acl.pattern_x--; @@ -1515,7 +1515,7 @@ et4000w32_blit(int count, int cpu_input, uint32_t src_dat, uint32_t mix_dat, et4 if (et4000->acl.source_x >= (et4000w32_wrap_x[et4000->acl.internal.source_wrap & 7] + 1)) et4000->acl.source_x -= (et4000w32_wrap_x[et4000->acl.internal.source_wrap & 7] + 1); } - + et4000->acl.x_count--; if (et4000->acl.x_count == 0xffff) { et4000->acl.x_count = et4000->acl.internal.count_x; @@ -1604,14 +1604,14 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32 et4000w32_log("%06X %02X ", et4000->acl.mix_addr, svga->vram[(et4000->acl.mix_addr >> 3) & et4000->vram_mask]); } else { mixdat = mix & 1; - mix >>= 1; + mix >>= 1; mix |= 0x80000000; } et4000->acl.mix_addr++; rop = mixdat ? et4000->acl.internal.rop_fg : et4000->acl.internal.rop_bg; - + ROPMIX(rop, dest, pattern, source, out); - + et4000w32_log("%06X = %02X\n", et4000->acl.dest_addr & et4000->vram_mask, out); if (!(et4000->acl.internal.ctrl_routing & 0x40)) { svga->vram[et4000->acl.dest_addr & et4000->vram_mask] = out; @@ -1627,9 +1627,9 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32 if (et4000->acl.internal.xy_dir & 1) et4000w32_decx(1, et4000); else et4000w32_incx(1, et4000); } else { - if (et4000->acl.internal.xy_dir & 1) + if (et4000->acl.internal.xy_dir & 1) et4000w32_incx((et4000->acl.internal.pixel_depth >> 4) & 3, et4000); - else + else et4000w32_decx((et4000->acl.internal.pixel_depth >> 4) & 3, et4000); et4000->acl.pix_pos = 0; @@ -1692,15 +1692,15 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32 sdat >>= 8; } else source = svga->vram[(et4000->acl.source_addr + et4000->acl.source_x) & et4000->vram_mask]; - + dest = svga->vram[et4000->acl.dest_addr & et4000->vram_mask]; out = 0; - + if ((et4000->acl.internal.ctrl_routing & 0xa) == 8) { mixdat = svga->vram[(et4000->acl.mix_addr >> 3) & et4000->vram_mask] & (1 << (et4000->acl.mix_addr & 7)); } else { mixdat = mix & 1; - mix >>= 1; + mix >>= 1; mix |= 0x80000000; } @@ -1708,7 +1708,7 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32 ROPMIX(rop, dest, pattern, source, out); - if (!(et4000->acl.internal.ctrl_routing & 0x40)) { + if (!(et4000->acl.internal.ctrl_routing & 0x40)) { svga->vram[et4000->acl.dest_addr & et4000->vram_mask] = out; svga->changedvram[(et4000->acl.dest_addr & et4000->vram_mask) >> 12] = changeframecount; } else { @@ -1720,7 +1720,7 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32 et4000w32_decx(1, et4000); else et4000w32_incx(1, et4000); - + et4000->acl.x_count--; if (et4000->acl.x_count == 0xffff) { if (et4000->acl.internal.xy_dir & 2) { @@ -1748,7 +1748,7 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32 return; if (et4000->acl.internal.ctrl_routing & 0x40) { - if (et4000->acl.cpu_dat_pos & 3) + if (et4000->acl.cpu_dat_pos & 3) et4000->acl.cpu_dat_pos += 4 - (et4000->acl.cpu_dat_pos & 3); return; } @@ -1770,7 +1770,7 @@ et4000w32p_hwcursor_draw(svga_t *svga, int displine) int minus_width = 0; uint8_t dat; offset = svga->hwcursor_latch.xoff; - + if (et4000->type == ET4000W32) { switch (svga->bpp) { case 8: @@ -1916,12 +1916,12 @@ et4000w32p_pci_write(int func, int addr, uint8_t val, void *p) et4000w32p_recalcmapping(et4000); break; - case 0x13: - et4000->linearbase &= 0x00c00000; + case 0x13: + et4000->linearbase &= 0x00c00000; et4000->linearbase |= (et4000->pci_regs[0x13] << 24); svga->crtc[0x30] &= 3; svga->crtc[0x30] |= ((et4000->linearbase & 0x3f000000) >> 22); - et4000w32p_recalcmapping(et4000); + et4000w32p_recalcmapping(et4000); break; case 0x30: case 0x31: case 0x32: case 0x33: @@ -1954,7 +1954,7 @@ et4000w32p_init(const device_t *info) et4000->pci = (info->flags & DEVICE_PCI) ? 0x80 : 0x00; et4000->vlb = (info->flags & DEVICE_VLB) ? 0x40 : 0x00; - + /*The ET4000/W32i ISA BIOS seems to not support 2MB of VRAM*/ if ((info->local == ET4000W32) || ((info->local == ET4000W32I) && !(et4000->vlb))) vram_size = 1; @@ -1986,14 +1986,14 @@ et4000w32p_init(const device_t *info) case ET4000W32: /* ET4000/W32 */ et4000->rev = 0; - + rom_init(&et4000->bios_rom, BIOS_ROM_PATH_W32, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); et4000->svga.ramdac = device_add(&tseng_ics5301_ramdac_device); et4000->svga.clock_gen = et4000->svga.ramdac; et4000->svga.getclock = sdac_getclock; - break; + break; case ET4000W32I: /* ET4000/W32i rev B */ @@ -2001,7 +2001,7 @@ et4000w32p_init(const device_t *info) if (et4000->vlb) { rom_init(&et4000->bios_rom, BIOS_ROM_PATH_W32I_VLB, 0xc0000, 0x8000, 0x7fff, 0, - MEM_MAPPING_EXTERNAL); + MEM_MAPPING_EXTERNAL); } else { rom_init(&et4000->bios_rom, BIOS_ROM_PATH_W32I_ISA, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); @@ -2193,14 +2193,27 @@ et4000w32p_force_redraw(void *p) static const device_config_t et4000w32p_config[] = { // clang-format off { - "memory", "Memory size", CONFIG_SELECTION, "", 2, "", { 0 }, - { - { "1 MB", 1 }, - { "2 MB", 2 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 2, + .selection = { + { + .description = "1 MB", + .value = 1 + }, + { + .description = "2 MB", + .value = 2 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_hercules.c b/src/video/vid_hercules.c index bc69a785a..d310fa419 100644 --- a/src/video/vid_hercules.c +++ b/src/video/vid_hercules.c @@ -608,21 +608,44 @@ speed_changed(void *priv) recalc_timings(dev); } - static const device_config_t hercules_config[] = { // clang-format off { - "rgb_type", "Display type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Default", 0 }, - { "Green", 1 }, - { "Amber", 2 }, - { "Gray", 3 }, - { "" } + .name = "rgb_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_int = 0, + .selection = { + { + .description = "Default", + .value = 0 + }, + { + .description = "Green", + .value = 1 + }, + { + .description = "Amber", + .value = 2 + }, + { + .description = "Gray", + .value = 3 + }, + { + .description = "" + } } }, - { "blend", "Blend", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "blend", + .description = "Blend", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_herculesplus.c b/src/video/vid_herculesplus.c index ad30a6393..ba981e06a 100644 --- a/src/video/vid_herculesplus.c +++ b/src/video/vid_herculesplus.c @@ -265,7 +265,7 @@ draw_char_rom(herculesplus_t *dev, int x, uint8_t chr, uint8_t attr) static void draw_char_ram4(herculesplus_t *dev, int x, uint8_t chr, uint8_t attr) { - unsigned ull, val, ifg, ibg, cfg; + unsigned ull, val, ibg, cfg; const uint8_t *fnt; int i, elg, blk; int cw = HERCULESPLUS_CW; @@ -280,17 +280,13 @@ draw_char_ram4(herculesplus_t *dev, int x, uint8_t chr, uint8_t attr) /* MDA-compatible attributes */ ibg = 0; - ifg = 7; if ((attr & 0x77) == 0x70) { /* Invert */ - ifg = 0; ibg = 7; } if (attr & 8) - ifg |= 8; /* High intensity FG */ if (attr & 0x80) ibg |= 8; /* High intensity BG */ if ((attr & 0x77) == 0) /* Blank */ - ifg = ibg; ull = ((attr & 0x07) == 1) ? 13 : 0xffff; if (dev->crtc[HERCULESPLUS_CRTC_XMODE] & HERCULESPLUS_XMODE_90COL) elg = 0; @@ -693,21 +689,44 @@ speed_changed(void *priv) recalc_timings(dev); } - static const device_config_t herculesplus_config[] = { // clang-format off { - "rgb_type", "Display type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Default", 0 }, - { "Green", 1 }, - { "Amber", 2 }, - { "Gray", 3 }, - { "" } + .name = "rgb_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_int = 0, + .selection = { + { + .description = "Default", + .value = 0 + }, + { + .description = "Green", + .value = 1 + }, + { + .description = "Amber", + .value = 2 + }, + { + .description = "Gray", + .value = 3 + }, + { + .description = "" + } } }, - { "blend", "Blend", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "blend", + .description = "Blend", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index a2b7fbcb1..a9b54c1f0 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -1621,44 +1621,88 @@ ht216_force_redraw(void *p) ht216->svga.fullchange = changeframecount; } - static const device_config_t v7_vga_1024i_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 512, "", { 0 }, - { - { "256 kB", 256 }, - { "512 kB", 512 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 512, + .selection = { + { + .description = "256 kB", + .value = 256 + }, + { + .description = "512 kB", + .value = 512 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; // clang-format off static const device_config_t ht216_32_standalone_config[] = { { - "monitor_type", "Monitor type", CONFIG_SELECTION, "", 0x18, "", { 0 }, - { - { "Mono Interlaced", 0x00 }, - { "Mono Non-Interlaced", 0x08 }, - { "Color Interlaced", 0x10 }, - { "Color Non-Interlaced", 0x18 }, - { "" } + .name = "monitor_type", + .description = "Monitor type", + .type = CONFIG_SELECTION, + .default_int = 0x18, + .selection = { + { + .description = "Mono Interlaced", + .value = 0x00 + }, + { + .description = "Mono Non-Interlaced", + .value = 0x08 + }, + { + .description = "Color Interlaced", + .value = 0x10 + }, + { + .description = "Color Non-Interlaced", + .value = 0x18 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; static const device_config_t radius_svga_multiview_config[] = { { - "extensions", "Extensions", CONFIG_SELECTION, "", 0x00, "", { 0 }, - { - { "Extensions Enabled", 0x00 }, - { "Extensions Disabled", 0x02 }, - { "" } + .name = "extensions", + .description = "Extensions", + .type = CONFIG_SELECTION, + .default_int = 0x00, + .selection = { + { + .description = "Extensions Enabled", + .value = 0x00 + }, + { + .description = "Extensions Disabled", + .value = 0x02 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; // clang-format on @@ -1729,8 +1773,7 @@ const device_t radius_svga_multiview_isa_device = { { .available = radius_svga_multiview_available }, .speed_changed = ht216_speed_changed, .force_redraw = ht216_force_redraw, - radius_svga_multiview_config, - .config = NULL + .config = radius_svga_multiview_config }; const device_t radius_svga_multiview_mca_device = { diff --git a/src/video/vid_im1024.c b/src/video/vid_im1024.c index 96ce1ce6a..932faecb7 100644 --- a/src/video/vid_im1024.c +++ b/src/video/vid_im1024.c @@ -62,6 +62,7 @@ #include <86box/device.h> #include <86box/pit.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_pgc.h> diff --git a/src/video/vid_mda.c b/src/video/vid_mda.c index 83987ef83..abd6c7c88 100644 --- a/src/video/vid_mda.c +++ b/src/video/vid_mda.c @@ -330,16 +330,35 @@ void mda_speed_changed(void *p) static const device_config_t mda_config[] = { // clang-format off { - "rgb_type", "Display type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Default", 0 }, - { "Green", 1 }, - { "Amber", 2 }, - { "Gray", 3 }, - { "" } + .name = "rgb_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_int = 0, + .selection = { + { + .description = "Default", + .value = 0 + }, + { + .description = "Green", + .value = 1 + }, + { + .description = "Amber", + .value = 2 + }, + { + .description = "Gray", + .value = 3 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index ea365e2ba..87ed16ba5 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -27,6 +27,7 @@ #include <86box/device.h> #include <86box/dma.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/i2c.h> #include <86box/vid_ddc.h> @@ -5336,7 +5337,6 @@ mystique_force_redraw(void *p) mystique->svga.fullchange = changeframecount; } - static const device_config_t mystique_config[] = { // clang-format off { @@ -5363,7 +5363,9 @@ static const device_config_t mystique_config[] = { }, .default_int = 8 }, - { .type = -1 } + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_nga.c b/src/video/vid_nga.c index 4d500b178..befe01671 100644 --- a/src/video/vid_nga.c +++ b/src/video/vid_nga.c @@ -598,42 +598,94 @@ nga_init(const device_t *info) return nga; } - const device_config_t nga_config[] = { // clang-format off { - "rgb_type", "RGB type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Color", 0 }, - { "Green Monochrome", 1 }, - { "Amber Monochrome", 2 }, - { "Gray Monochrome", 3 }, - { "Color (no brown)", 4 }, - { "" } + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_int = 0, + .selection = { + { + .description = "Color", + .value = 0 + }, + { + .description = "Green Monochrome", + .value = 1 + }, + { + .description = "Amber Monochrome", + .value = 2 + }, + { + .description = "Gray Monochrome", + .value = 3 + }, + { + .description = "Color (no brown)", + .value = 4 + }, + { + .description = "" + } } }, { - "snow_enabled", "Snow emulation", CONFIG_BINARY, "", 1 + .name = "snow_enabled", + .description = "Snow emulation", + .type = CONFIG_BINARY, + .default_int = 1 }, { - "memory", "Memory size", CONFIG_SELECTION, "", 64, "", { 0 }, - { - { "32 KB", 32 }, - { "64 KB", 64 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 64, + .selection = { + { + .description = "32 KB", + .value = 32 + }, + { + .description = "64 KB", + .value = 64 + }, + { + .description = "" + } } }, { - "charset", "Character set", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "U.S. English", 0 }, - { "Scandinavian", 1 }, - { "Other languages", 2 }, - { "E.F. Hutton", 3 }, - { "" } + .name = "charset", + .description = "Character set", + .type = CONFIG_SELECTION, + .default_int = 0, + .selection = { + { + .description = "U.S. English", + .value = 0 + }, + { + .description = "Scandinavian", + .value = 1 + }, + { + .description = "Other languages", + .value = 2 + }, + { + .description = "E.F. Hutton", + .value = 3 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_oak_oti.c b/src/video/vid_oak_oti.c index fb1945aa7..210afc2b2 100644 --- a/src/video/vid_oak_oti.c +++ b/src/video/vid_oak_oti.c @@ -500,43 +500,84 @@ oti067_m300_available(void) return(rom_present(BIOS_067_M300_08_PATH)); } - // clang-format off static const device_config_t oti067_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 512, "", { 0 }, - { - { "256 kB", 256 }, - { "512 kB", 512 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 512, + .selection = { + { + .description = "256 kB", + .value = 256 + }, + { + .description = "512 kB", + .value = 512 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; static const device_config_t oti067_ama932j_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 256, "", { 0 }, - { - { "256 kB", 256 }, - { "512 kB", 512 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 256, + .selection = { + { + .description = "256 kB", + .value = 256 + }, + { + .description = "512 kB", + .value = 512 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; static const device_config_t oti077_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 1024, "", { 0 }, - { - { "256 kB", 256 }, - { "512 kB", 512 }, - { "1 MB", 1024 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 1024, + .selection = { + { + .description = "256 kB", + .value = 256 + }, + { + .description = "512 kB", + .value = 512 + }, + { + .description = "1 MB", + .value = 1024 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; // clang-format on diff --git a/src/video/vid_ogc.c b/src/video/vid_ogc.c index 9e751948f..0487d691d 100644 --- a/src/video/vid_ogc.c +++ b/src/video/vid_ogc.c @@ -639,17 +639,41 @@ const device_config_t ogc_m24_config[] = { // clang-format off { /* Olivetti / ATT compatible displays */ - "rgb_type", "RGB type", CONFIG_SELECTION, "", CGA_RGB, "", { 0 }, - { - { "Color", 0 }, - { "Green Monochrome", 1 }, - { "Amber Monochrome", 2 }, - { "Gray Monochrome", 3 }, - { "" } + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_int = CGA_RGB, + .selection = { + { + .description = "Color", + .value = 0 + }, + { + .description = "Green Monochrome", + .value = 1 + }, + { + .description = "Amber Monochrome", + .value = 2 + }, + { + .description = "Gray Monochrome", + .value = 3 + }, + { + .description = "" + } } }, - { "snow_enabled", "Snow emulation", CONFIG_BINARY, "", 1, }, - { "", "", -1 } + { + .name = "snow_enabled", + .description = "Snow emulation", + .type = CONFIG_BINARY, + .default_int = 1, + }, + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_paradise.c b/src/video/vid_paradise.c index c64afb7d5..59b9f2247 100644 --- a/src/video/vid_paradise.c +++ b/src/video/vid_paradise.c @@ -717,126 +717,139 @@ void paradise_force_redraw(void *p) paradise->svga.fullchange = changeframecount; } -const device_t paradise_pvga1a_pc2086_device = -{ - "Paradise PVGA1A (Amstrad PC2086)", - "pvga1a_pc2086", - 0, - PVGA1A, - paradise_pvga1a_pc2086_init, - paradise_close, - NULL, - { NULL }, - paradise_speed_changed, - paradise_force_redraw, - NULL +const device_t paradise_pvga1a_pc2086_device = { + .name = "Paradise PVGA1A (Amstrad PC2086)", + .internal_name = "pvga1a_pc2086", + .flags = 0, + .local = PVGA1A, + .init = paradise_pvga1a_pc2086_init, + .close = paradise_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = paradise_speed_changed, + .force_redraw = paradise_force_redraw, + .config = NULL }; -const device_t paradise_pvga1a_pc3086_device = -{ - "Paradise PVGA1A (Amstrad PC3086)", - "pvga1a_pc3086", - 0, - PVGA1A, - paradise_pvga1a_pc3086_init, - paradise_close, - NULL, - { NULL }, - paradise_speed_changed, - paradise_force_redraw, - NULL +const device_t paradise_pvga1a_pc3086_device = { + .name = "Paradise PVGA1A (Amstrad PC3086)", + .internal_name = "pvga1a_pc3086", + .flags = 0, + .local = PVGA1A, + .init = paradise_pvga1a_pc3086_init, + .close = paradise_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = paradise_speed_changed, + .force_redraw = paradise_force_redraw, + .config = NULL }; -static const device_config_t paradise_pvga1a_config[] = -{ - { - "memory", "Memory size", CONFIG_SELECTION, "", 512, "", { 0 }, - { - { - "256 kB", 256 - }, - { - "512 kB", 512 - }, - { - "" - } - } - }, - { - "", "", -1 +static const device_config_t paradise_pvga1a_config[] = { + { + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 512, + .selection = { + { + .description = "256 kB", + .value = 256 + }, + { + .description = "512 kB", + .value = 512 + }, + { + .description = "" + } } + }, + { + .type = CONFIG_END + } }; -const device_t paradise_pvga1a_ncr3302_device = -{ - "Paradise PVGA1A (NCR 3302)", - "pvga1a_ncr3302", - 0, - PVGA1A, - paradise_pvga1a_ncr3302_init, - paradise_close, - NULL, - { NULL }, - paradise_speed_changed, - paradise_force_redraw, - paradise_pvga1a_config +const device_t paradise_pvga1a_ncr3302_device = { + .name = "Paradise PVGA1A (NCR 3302)", + .internal_name = "pvga1a_ncr3302", + .flags = 0, + .local = PVGA1A, + .init = paradise_pvga1a_ncr3302_init, + .close = paradise_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = paradise_speed_changed, + .force_redraw = paradise_force_redraw, + .config = paradise_pvga1a_config }; -const device_t paradise_pvga1a_device = -{ - "Paradise PVGA1A", - "pvga1a", - DEVICE_ISA, - PVGA1A, - paradise_pvga1a_standalone_init, - paradise_close, - NULL, - { paradise_pvga1a_standalone_available }, - paradise_speed_changed, - paradise_force_redraw, - paradise_pvga1a_config +const device_t paradise_pvga1a_device = { + .name = "Paradise PVGA1A", + .internal_name = "pvga1a", + .flags = DEVICE_ISA, + .local = PVGA1A, + .init = paradise_pvga1a_standalone_init, + .close = paradise_close, + .reset = NULL, + { .available = paradise_pvga1a_standalone_available }, + .speed_changed = paradise_speed_changed, + .force_redraw = paradise_force_redraw, + .config = paradise_pvga1a_config }; -const device_t paradise_wd90c11_megapc_device = -{ - "Paradise WD90C11 (Amstrad MegaPC)", - "wd90c11_megapc", - 0, - WD90C11, - paradise_wd90c11_megapc_init, - paradise_close, - NULL, - { NULL }, - paradise_speed_changed, - paradise_force_redraw, - NULL + +const device_t paradise_wd90c11_megapc_device = { + .name = "Paradise WD90C11 (Amstrad MegaPC)", + .internal_name = "wd90c11_megapc", + .flags = 0, + .local = WD90C11, + .init = paradise_wd90c11_megapc_init, + .close = paradise_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = paradise_speed_changed, + .force_redraw = paradise_force_redraw, + .config = NULL }; -const device_t paradise_wd90c11_device = -{ - "Paradise WD90C11-LR", - "wd90c11", - DEVICE_ISA, - WD90C11, - paradise_wd90c11_standalone_init, - paradise_close, - NULL, - { paradise_wd90c11_standalone_available }, - paradise_speed_changed, - paradise_force_redraw, - NULL + +const device_t paradise_wd90c11_device = { + .name = "Paradise WD90C11-LR", + .internal_name = "wd90c11", + .flags = DEVICE_ISA, + .local = WD90C11, + .init = paradise_wd90c11_standalone_init, + .close = paradise_close, + .reset = NULL, + { .available = paradise_wd90c11_standalone_available }, + .speed_changed = paradise_speed_changed, + .force_redraw = paradise_force_redraw, + .config = NULL }; static const device_config_t paradise_wd90c30_config[] = { // clang-format off { - "memory", "Memory size", CONFIG_SELECTION, "", 1024, "", { 0 }, - { - { "512 kB", 512 }, - { "1 MB", 1024 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 1024, + .selection = { + { + .description = "512 kB", + .value = 512 + }, + { + .description = "1 MB", + .value = 1024 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_pgc.c b/src/video/vid_pgc.c index 3d64b9eaf..e956cb12e 100644 --- a/src/video/vid_pgc.c +++ b/src/video/vid_pgc.c @@ -87,6 +87,7 @@ #include <86box/device.h> #include <86box/pit.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_cga.h> #include <86box/vid_pgc.h> diff --git a/src/video/vid_rtg310x.c b/src/video/vid_rtg310x.c index 7c046782a..2eb82626b 100644 --- a/src/video/vid_rtg310x.c +++ b/src/video/vid_rtg310x.c @@ -361,15 +361,31 @@ rtg_available(void) static const device_config_t rtg_config[] = { // clang-format off { - "memory", "Memory size", CONFIG_SELECTION, "", 1024, "", { 0 }, - { - { "256 KB", 256 }, - { "512 KB", 512 }, - { "1 MB", 1024 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 1024, + .selection = { + { + .description = "256 KB", + .value = 256 + }, + { + .description = "512 KB", + .value = 512 + }, + { + .description = "1 MB", + .value = 1024 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } // clang-format on }; @@ -379,8 +395,8 @@ const device_t realtek_rtg3106_device = { .flags = DEVICE_ISA | DEVICE_AT, .local = 2, .init = rtg_init, - .close = rtg_close, - .reset = NULL, + .close = rtg_close, + .reset = NULL, { .available = rtg_available }, .speed_changed = rtg_speed_changed, .force_redraw = rtg_force_redraw, diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index c9fd1f41a..406f6a20e 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -30,6 +30,7 @@ #include <86box/pci.h> #include <86box/rom.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/i2c.h> #include <86box/vid_ddc.h> @@ -406,7 +407,7 @@ dword_remap(svga_t *svga, uint32_t in_addr) { if (svga->packed_chain4 || svga->force_old_addr) return in_addr; - + return ((in_addr << 2) & 0x3fff0) | ((in_addr >> 14) & 0xc) | (in_addr & ~0x3fffc); @@ -415,8 +416,8 @@ static __inline uint32_t dword_remap_w(svga_t *svga, uint32_t in_addr) { if (svga->packed_chain4 || svga->force_old_addr) - return in_addr; - + return in_addr; + return ((in_addr << 2) & 0x1fff8) | ((in_addr >> 14) & 0x6) | (in_addr & ~0x1fffe); @@ -425,8 +426,8 @@ static __inline uint32_t dword_remap_l(svga_t *svga, uint32_t in_addr) { if (svga->packed_chain4 || svga->force_old_addr) - return in_addr; - + return in_addr; + return ((in_addr << 2) & 0xfffc) | ((in_addr >> 14) & 0x3) | (in_addr & ~0xffff); @@ -3379,7 +3380,7 @@ s3_updatemapping(s3_t *s3) } else { if (s3->chip >= S3_TRIO64V) svga->fb_only = 0; - + mem_mapping_disable(&s3->linear_mapping); } @@ -7611,67 +7612,144 @@ static void s3_force_redraw(void *p) static const device_config_t s3_orchid_86c911_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 1, "", { 0 }, - { - { "512 KB", 0 }, - { "1 MB", 1 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 1, + .selection = { + { + .description = "512 KB", + .value = 0 + }, + { + .description = "1 MB", + .value = 1 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; static const device_config_t s3_9fx_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 2, "", { 0 }, - { - { "1 MB", 1 }, - { "2 MB", 2 }, + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 2, + .selection = { + { + .description = "1 MB", + .value = 1 + }, + { + .description = "2 MB", + .value = 2 + }, /*Trio64 also supports 4 MB, however the Number Nine BIOS does not*/ - { "" } + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; static const device_config_t s3_phoenix_trio32_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 2, "", { 0 }, - { - { "512 KB", 0 }, - { "1 MB", 1 }, - { "2 MB", 2 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 2, + .selection = { + { + .description = "512 KB", + .value = 0 + }, + { + .description = "1 MB", + .value = 1 + }, + { + .description = "2 MB", + .value = 2 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; static const device_config_t s3_standard_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 }, - { - { "1 MB", 1 }, - { "2 MB", 2 }, - { "4 MB", 4 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 4, + .selection = { + { + .description = "1 MB", + .value = 1 + }, + { + .description = "2 MB", + .value = 2 + }, + { + .description = "4 MB", + .value = 4 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; static const device_config_t s3_968_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 }, - { - { "1 MB", 1 }, - { "2 MB", 2 }, - { "4 MB", 4 }, - { "8 MB", 8 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 4, + .selection = { + { + .description = "1 MB", + .value = 1 + }, + { + .description = "2 MB", + .value = 2 + }, + { + .description = "4 MB", + .value = 4 + }, + { + .description = "8 MB", + .value = 8 + }, + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } }; const device_t s3_orchid_86c911_isa_device = { diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index eec18bf32..dd1c03fa4 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -32,6 +32,7 @@ #include <86box/rom.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/i2c.h> #include <86box/vid_ddc.h> @@ -117,10 +118,10 @@ typedef struct s3d_t { uint32_t cmd_set; int clip_l, clip_r, clip_t, clip_b; - + uint32_t dest_base; uint32_t dest_str; - + uint32_t z_base; uint32_t z_str; @@ -136,14 +137,14 @@ typedef struct s3d_t int32_t TdWdX, TdWdY; uint32_t tws; - + int32_t TdDdX, TdDdY; uint32_t tds; - + int16_t TdGdX, TdBdX, TdRdX, TdAdX; int16_t TdGdY, TdBdY, TdRdY, TdAdY; uint32_t tgs, tbs, trs, tas; - + uint32_t TdXdY12; uint32_t txend12; uint32_t TdXdY01; @@ -161,9 +162,9 @@ typedef struct virge_t mem_mapping_t linear_mapping; mem_mapping_t mmio_mapping; mem_mapping_t new_mmio_mapping; - + rom_t bios_rom; - + svga_t svga; uint8_t bank; @@ -195,7 +196,7 @@ typedef struct virge_t uint32_t hwc_fg_col, hwc_bg_col; int hwc_col_stack_pos; - + struct { uint32_t src_base; @@ -212,21 +213,21 @@ typedef struct virge_t int r_width, r_height; int rsrc_x, rsrc_y; int rdest_x, rdest_y; - + int lxend0, lxend1; int32_t ldx; uint32_t lxstart, lystart; int lycnt; int line_dir; - + int src_x, src_y; int dest_x, dest_y; int w, h; uint8_t rop; - + int data_left_count; uint32_t data_left; - + uint32_t pattern_8[8*8]; uint32_t pattern_16[8*8]; uint32_t pattern_24[8*8]; @@ -240,14 +241,14 @@ typedef struct virge_t uint32_t pycnt; uint32_t dest_l, dest_r; } s3d; - + s3d_t s3d_tri; s3d_t s3d_buffer[RB_SIZE]; int s3d_read_idx, s3d_write_idx; int s3d_busy; int render_idx; - + struct { uint32_t pri_ctrl; @@ -273,9 +274,9 @@ typedef struct virge_t uint32_t pri_size; uint32_t sec_start; uint32_t sec_size; - + int sdif; - + int pri_x, pri_y, pri_w, pri_h; int sec_x, sec_y, sec_w, sec_h; } streams; @@ -285,7 +286,7 @@ typedef struct virge_t uint32_t dma_ptr; uint64_t blitter_time; volatile int fifo_slot; - + pc_timer_t tri_timer; int virge_busy, local; @@ -297,7 +298,7 @@ typedef struct virge_t uint8_t serialport; void *i2c, *ddc; - + int waiting; } virge_t; @@ -324,29 +325,29 @@ enum { CMD_SET_AE = 1, CMD_SET_HC = (1 << 1), - + CMD_SET_FORMAT_MASK = (7 << 2), CMD_SET_FORMAT_8 = (0 << 2), CMD_SET_FORMAT_16 = (1 << 2), CMD_SET_FORMAT_24 = (2 << 2), - + CMD_SET_MS = (1 << 6), CMD_SET_IDS = (1 << 7), CMD_SET_MP = (1 << 8), CMD_SET_TP = (1 << 9), - + CMD_SET_ITA_MASK = (3 << 10), CMD_SET_ITA_BYTE = (0 << 10), CMD_SET_ITA_WORD = (1 << 10), CMD_SET_ITA_DWORD = (2 << 10), - + CMD_SET_ZUP = (1 << 23), - + CMD_SET_ZB_MODE = (3 << 24), CMD_SET_XP = (1 << 25), CMD_SET_YP = (1 << 26), - + CMD_SET_COMMAND_MASK = (15 << 27) }; @@ -440,7 +441,7 @@ static void render_thread(void *param) { virge_t *virge = (virge_t *)param; - + while (virge->render_thread_run) { thread_wait_event(virge->wake_render_thread, -1); thread_reset_event(virge->wake_render_thread); @@ -467,9 +468,9 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) uint8_t old; uint32_t cursoraddr; - if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) + if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) addr ^= 0x60; - + switch (addr) { case 0x3c5: @@ -495,7 +496,7 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) return; } break; - + case 0x3d4: svga->crtcreg = val; return; @@ -503,7 +504,7 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) if ((svga->crtcreg < 7) && (svga->crtc[0x11] & 0x80)) return; if ((svga->crtcreg == 7) && (svga->crtc[0x11] & 0x80)) - val = (svga->crtc[7] & ~0x10) | (val & 0x10); + val = (svga->crtc[7] & ~0x10) | (val & 0x10); if ((svga->crtcreg >= 0x20) && (svga->crtcreg < 0x40) && (svga->crtcreg != 0x36) && (svga->crtcreg != 0x38) && (svga->crtcreg != 0x39) && ((svga->crtc[0x38] & 0xcc) != 0x48)) @@ -516,10 +517,10 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) return; old = svga->crtc[svga->crtcreg]; svga->crtc[svga->crtcreg] = val; - + if (svga->crtcreg > 0x18) s3_virge_log("OUTB VGA reg = %02x, val = %02x\n", svga->crtcreg, val); - + switch (svga->crtcreg) { case 0x31: @@ -528,11 +529,11 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) case 0x32: s3_virge_update_irqs(virge); break; - + case 0x69: virge->ma_ext = val & 0x1f; break; - + case 0x35: virge->bank = (virge->bank & 0x70) | (val & 0xf); if (svga->chain4) @@ -555,12 +556,12 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) else svga->write_bank = svga->read_bank = virge->bank << 14; break; - + case 0x3a: if (val & 0x10) svga->gdcreg[5] |= 0x40; /*Horrible cheat*/ break; - + case 0x45: svga->hwcursor.ena = val & 1; break; @@ -573,7 +574,7 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) cursoraddr = (virge->memory_size == 8) ? 0x1fff : 0x0fff; svga->hwcursor.addr = ((((svga->crtc[0x4c] << 8) | svga->crtc[0x4d]) & cursoraddr) * 1024) + (svga->hwcursor.yoff * 16); break; - + case 0x4a: switch (virge->hwc_col_stack_pos) { @@ -614,12 +615,12 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) svga->dpms = (svga->seqregs[0x0d] & 0x50) || (svga->crtc[0x56] & 0x06); old = ~val; /* force recalc */ break; - + case 0x5c: if ((val & 0xa0) == 0x80) i2c_gpio_set(virge->i2c, !!(val & 0x40), !!(val & 0x10)); break; - + case 0x67: switch (val >> 4) { @@ -630,7 +631,7 @@ static void s3_virge_out(uint16_t addr, uint8_t val, void *p) default: svga->bpp = 8; break; } break; - + case 0xaa: i2c_gpio_set(virge->i2c, !!(val & SERIAL_PORT_SCW), !!(val & SERIAL_PORT_SDW)); break; @@ -660,8 +661,8 @@ static uint8_t s3_virge_in(uint16_t addr, void *p) virge_t *virge = (virge_t *)p; svga_t *svga = &virge->svga; uint8_t ret; - - if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) + + if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) addr ^= 0x60; switch (addr) @@ -671,7 +672,7 @@ static uint8_t s3_virge_in(uint16_t addr, void *p) ret = 0xff; else ret = svga_in(addr, svga); - break; + break; case 0x3c5: if (svga->seqaddr >= 8) @@ -690,7 +691,7 @@ static uint8_t s3_virge_in(uint16_t addr, void *p) { case 0x2d: ret = virge->virge_id_high; break; /*Extended chip ID*/ case 0x2e: ret = virge->virge_id_low; break; /*New chip ID*/ - case 0x2f: ret = virge->virge_rev; break; + case 0x2f: ret = virge->virge_rev; break; case 0x30: ret = virge->virge_id; break; /*Chip ID*/ case 0x31: ret = (svga->crtc[0x31] & 0xcf) | ((virge->ma_ext & 3) << 4); break; case 0x33: ret = (svga->crtc[0x33] | 0x04); break; @@ -724,16 +725,16 @@ static uint8_t s3_virge_in(uint16_t addr, void *p) } else ret = svga->crtc[0xaa]; break; - + default: ret = svga->crtc[svga->crtcreg]; break; } break; - + default: ret = svga_in(addr, svga); - break; + break; } return ret; } @@ -741,7 +742,7 @@ static uint8_t s3_virge_in(uint16_t addr, void *p) static void s3_virge_recalctimings(svga_t *svga) { virge_t *virge = (virge_t *)svga->p; - + svga->hdisp = svga->hdisp_old; if (svga->crtc[0x5d] & 0x01) svga->htotal += 0x100; @@ -759,36 +760,36 @@ static void s3_virge_recalctimings(svga_t *svga) if (((svga->miscout >> 2) & 3) == 3) { int n = svga->seqregs[0x12] & 0x1f; int r = (svga->seqregs[0x12] >> 5); - - if (virge->chip == S3_VIRGEVX || virge->chip == S3_VIRGEDX) + + if (virge->chip == S3_VIRGEVX || virge->chip == S3_VIRGEDX) r &= 7; else if (virge->chip >= S3_VIRGEGX2) r &= 10; else r &= 3; - + int m = svga->seqregs[0x13] & 0x7f; double freq = (((double)m + 2) / (((double)n + 2) * (double)(1 << r))) * 14318184.0; svga->clock = (cpuclock * (float)(1ull << 32)) / freq; } - + if ((svga->crtc[0x67] & 0xc) != 0xc) /*VGA mode*/ - { + { svga->fb_only = 0; svga->ma_latch |= (virge->ma_ext << 16); if (svga->crtc[0x51] & 0x30) svga->rowoffset += (svga->crtc[0x51] & 0x30) << 4; else if (svga->crtc[0x43] & 0x04) svga->rowoffset += 0x100; if (!svga->rowoffset) svga->rowoffset = 256; - + svga->lowres = !((svga->gdcreg[5] & 0x40) && (svga->crtc[0x3a] & 0x10)); if ((svga->gdcreg[5] & 0x40) && (svga->crtc[0x3a] & 0x10)) { switch (svga->bpp) { - case 8: - svga->render = svga_render_8bpp_highres; + case 8: + svga->render = svga_render_8bpp_highres; break; - case 15: + case 15: svga->render = svga_render_15bpp_highres; if (virge->chip != S3_VIRGEVX && virge->chip < S3_VIRGEGX2) { @@ -796,12 +797,12 @@ static void s3_virge_recalctimings(svga_t *svga) svga->hdisp >>= 1; } break; - case 16: + case 16: svga->render = svga_render_16bpp_highres; if (virge->chip != S3_VIRGEVX && virge->chip < S3_VIRGEGX2) { svga->htotal >>= 1; - svga->hdisp >>= 1; + svga->hdisp >>= 1; } break; case 24: @@ -809,7 +810,7 @@ static void s3_virge_recalctimings(svga_t *svga) if (virge->chip != S3_VIRGEVX && virge->chip < S3_VIRGEGX2) svga->rowoffset = (svga->rowoffset * 3) / 4; /*Hack*/ break; - case 32: + case 32: svga->render = svga_render_32bpp_highres; break; } @@ -820,16 +821,16 @@ static void s3_virge_recalctimings(svga_t *svga) else /*Streams mode*/ { svga->fb_only = 1; - + if (virge->streams.buffer_ctrl & 1) svga->ma_latch = virge->streams.pri_fb1 >> 2; else svga->ma_latch = virge->streams.pri_fb0 >> 2; - + svga->hdisp = virge->streams.pri_w + 1; if (virge->streams.pri_h < svga->dispend) svga->dispend = virge->streams.pri_h; - + svga->overlay.x = virge->streams.sec_x - virge->streams.pri_x; svga->overlay.y = virge->streams.sec_y - virge->streams.pri_y; svga->overlay.ysize = virge->streams.sec_h; @@ -846,21 +847,21 @@ static void s3_virge_recalctimings(svga_t *svga) switch ((virge->streams.pri_ctrl >> 24) & 0x7) { case 0: /*RGB-8 (CLUT)*/ - svga->render = svga_render_8bpp_highres; + svga->render = svga_render_8bpp_highres; break; - case 3: /*KRGB-16 (1.5.5.5)*/ + case 3: /*KRGB-16 (1.5.5.5)*/ svga->htotal >>= 1; - svga->render = svga_render_15bpp_highres; + svga->render = svga_render_15bpp_highres; break; - case 5: /*RGB-16 (5.6.5)*/ + case 5: /*RGB-16 (5.6.5)*/ svga->htotal >>= 1; - svga->render = svga_render_16bpp_highres; + svga->render = svga_render_16bpp_highres; break; - case 6: /*RGB-24 (8.8.8)*/ - svga->render = svga_render_24bpp_highres; + case 6: /*RGB-24 (8.8.8)*/ + svga->render = svga_render_24bpp_highres; break; case 7: /*XRGB-32 (X.8.8.8)*/ - svga->render = svga_render_32bpp_highres; + svga->render = svga_render_32bpp_highres; break; } svga->vram_display_mask = virge->vram_mask; @@ -880,7 +881,7 @@ static void s3_virge_updatemapping(virge_t *virge) return; } - s3_virge_log("Update mapping - bank %02X ", svga->gdcreg[6] & 0xc); + s3_virge_log("Update mapping - bank %02X ", svga->gdcreg[6] & 0xc); /*Banked framebuffer*/ switch (svga->gdcreg[6] & 0xc) { /*VGA mapping*/ case 0x0: /*128k at A0000*/ @@ -900,7 +901,7 @@ static void s3_virge_updatemapping(virge_t *virge) svga->banked_mask = 0x7fff; break; } - + virge->linear_base = (svga->crtc[0x5a] << 16) | (svga->crtc[0x59] << 24); s3_virge_log("Linear framebuffer %02X, linear base = %08x, display mask = %08x\n", svga->crtc[0x58] & 0x17, virge->linear_base, svga->vram_display_mask); @@ -936,7 +937,7 @@ static void s3_virge_updatemapping(virge_t *virge) } else { virge->linear_base &= 0xfc000000; } - + mem_mapping_set_addr(&virge->linear_mapping, virge->linear_base, virge->linear_size); } svga->fb_only = 1; @@ -944,7 +945,7 @@ static void s3_virge_updatemapping(virge_t *virge) mem_mapping_disable(&virge->linear_mapping); svga->fb_only = 0; } - + s3_virge_log("Memory mapped IO %02X\n", svga->crtc[0x53] & 0x38); /* Memory mapped I/O. */ @@ -984,8 +985,8 @@ s3_virge_mmio_fifo_write(uint32_t addr, uint8_t val, virge_t *virge) case 0x859c: virge->cmd_dma = val; break; - } - } + } + } } static void @@ -1004,7 +1005,7 @@ s3_virge_mmio_fifo_write_w(uint32_t addr, uint16_t val, virge_t *virge) static void s3_virge_mmio_fifo_write_l(uint32_t addr, uint32_t val, virge_t *virge) -{ +{ if ((addr & 0xfffc) < 0x8000) { if (virge->s3d.cmd_set & CMD_SET_MS) s3_virge_bitblt(virge, 32, ((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24)); @@ -1016,7 +1017,7 @@ s3_virge_mmio_fifo_write_l(uint32_t addr, uint32_t val, virge_t *virge) case 0x8590: virge->cmd_dma_base = val; break; - + case 0x8594: virge->dma_ptr = val; break; @@ -1027,7 +1028,7 @@ s3_virge_mmio_fifo_write_l(uint32_t addr, uint32_t val, virge_t *virge) case 0x859c: virge->cmd_dma = val; break; - + case 0xa000: case 0xa004: case 0xa008: case 0xa00c: case 0xa010: case 0xa014: case 0xa018: case 0xa01c: case 0xa020: case 0xa024: case 0xa028: case 0xa02c: @@ -1069,7 +1070,7 @@ s3_virge_mmio_fifo_write_l(uint32_t addr, uint32_t val, virge_t *virge) virge->s3d.pattern_8[y*8 + x + 1] = val >> 8; virge->s3d.pattern_8[y*8 + x + 2] = val >> 16; virge->s3d.pattern_8[y*8 + x + 3] = val >> 24; - + x = (addr >> 1) & 6; y = (addr >> 4) & 7; virge->s3d.pattern_16[y*8 + x] = val & 0xffff; @@ -1195,7 +1196,7 @@ s3_virge_mmio_fifo_write_l(uint32_t addr, uint32_t val, virge_t *virge) if (virge->s3d.cmd_set & CMD_SET_AE) s3_virge_bitblt(virge, -1, 0); break; - + case 0xb0f4: case 0xb4f4: virge->s3d_tri.fog_b = val & 0xff; virge->s3d_tri.fog_g = (val >> 8) & 0xff; @@ -1299,7 +1300,7 @@ s3_virge_mmio_fifo_write_l(uint32_t addr, uint32_t val, virge_t *virge) virge->s3d_tri.tas = (val >> 16) & 0xffff; virge->s3d_tri.trs = val & 0xffff; break; - + case 0xb554: virge->s3d_tri.TdZdX = val; break; @@ -1362,7 +1363,7 @@ s3_virge_mmio_read(uint32_t addr, void *p) if (virge->fifo_slot) virge->fifo_slot--; return ret; - + case 0x83b0: case 0x83b1: case 0x83b2: case 0x83b3: case 0x83b4: case 0x83b5: case 0x83b6: case 0x83b7: case 0x83b8: case 0x83b9: case 0x83ba: case 0x83bb: @@ -1376,10 +1377,10 @@ s3_virge_mmio_read(uint32_t addr, void *p) case 0x83d8: case 0x83d9: case 0x83da: case 0x83db: case 0x83dc: case 0x83dd: case 0x83de: case 0x83df: return s3_virge_in(addr & 0x3ff, virge); - + case 0x859c: return virge->cmd_dma; - + case 0xff20: case 0xff21: ret = virge->serialport & ~(SERIAL_PORT_SCR | SERIAL_PORT_SDR); if ((virge->serialport & SERIAL_PORT_SCW) && i2c_gpio_get_scl(virge->i2c)) @@ -1395,9 +1396,9 @@ s3_virge_mmio_read_w(uint32_t addr, void *p) { virge_t *virge = (virge_t *)p; uint16_t ret = 0xffff; - + s3_virge_log("[%04X:%08X]: MMIO ReadW addr = %04x\n", CS, cpu_state.pc, addr & 0xfffe); - + switch (addr & 0xfffe) { case 0x8504: if (!virge->fifo_slot) @@ -1408,10 +1409,10 @@ s3_virge_mmio_read_w(uint32_t addr, void *p) ret |= 0x30; /*A bit of a workaround at the moment.*/ s3_virge_update_irqs(virge); return ret; - + case 0x859c: return virge->cmd_dma; - + default: return s3_virge_mmio_read(addr, virge) | (s3_virge_mmio_read(addr + 1, virge) << 8); @@ -1494,7 +1495,7 @@ s3_virge_mmio_read_l(uint32_t addr, void *p) break; case 0x81fc: ret = virge->streams.sec_size; - break; + break; case 0x8504: if (virge->s3d_busy || virge->fifo_slot) { @@ -1511,7 +1512,7 @@ s3_virge_mmio_read_l(uint32_t addr, void *p) virge->fifo_slot--; s3_virge_update_irqs(virge); break; - + case 0x8590: ret = virge->cmd_dma_base; break; @@ -1523,7 +1524,7 @@ s3_virge_mmio_read_l(uint32_t addr, void *p) case 0x859c: ret = virge->cmd_dma; break; - + case 0xa4d4: ret = virge->s3d.src_base; break; @@ -1569,11 +1570,11 @@ s3_virge_mmio_read_l(uint32_t addr, void *p) case 0xa50c: ret = (virge->s3d.rdest_x << 16) | virge->s3d.rdest_y; break; - + default: ret = s3_virge_mmio_read(addr, virge) | (s3_virge_mmio_read(addr + 1, virge) << 8) | - (s3_virge_mmio_read(addr + 2, virge) << 16) | + (s3_virge_mmio_read(addr + 2, virge) << 16) | (s3_virge_mmio_read(addr + 3, virge) << 24); break; } @@ -1627,7 +1628,7 @@ s3_virge_mmio_write_w(uint32_t addr, uint16_t val, void *p) if ((addr & 0xfffe) == 0x83d4) { s3_virge_mmio_write(addr, val, virge); s3_virge_mmio_write(addr + 1, val >> 8, virge); - } + } } } @@ -1635,12 +1636,12 @@ static void s3_virge_mmio_write_l(uint32_t addr, uint32_t val, void *p) { virge_t *virge = (virge_t *)p; - svga_t *svga = &virge->svga; - + svga_t *svga = &virge->svga; + s3_virge_log("[%04X:%08X]: MMIO WriteL addr = %04x, val = %04x\n", CS, cpu_state.pc, addr & 0xfffc, val); if (((addr & 0xfffc) >= 0x8590) || ((addr & 0xfffc) < 0x8000)) if ((addr & 0xfffc) == 0xff20) - s3_virge_mmio_write(addr, val, virge); + s3_virge_mmio_write(addr, val, virge); else { s3_virge_mmio_fifo_write_l(addr, val, virge); } @@ -1735,38 +1736,38 @@ s3_virge_mmio_write_l(uint32_t addr, uint32_t val, void *p) case 0x81f0: virge->streams.pri_start = val; virge->streams.pri_x = (val >> 16) & 0x7ff; - virge->streams.pri_y = val & 0x7ff; + virge->streams.pri_y = val & 0x7ff; svga_recalctimings(svga); svga->fullchange = changeframecount; break; case 0x81f4: virge->streams.pri_size = val; virge->streams.pri_w = (val >> 16) & 0x7ff; - virge->streams.pri_h = val & 0x7ff; + virge->streams.pri_h = val & 0x7ff; svga_recalctimings(svga); svga->fullchange = changeframecount; break; case 0x81f8: virge->streams.sec_start = val; virge->streams.sec_x = (val >> 16) & 0x7ff; - virge->streams.sec_y = val & 0x7ff; + virge->streams.sec_y = val & 0x7ff; svga_recalctimings(svga); svga->fullchange = changeframecount; break; case 0x81fc: virge->streams.sec_size = val; virge->streams.sec_w = (val >> 16) & 0x7ff; - virge->streams.sec_h = val & 0x7ff; + virge->streams.sec_h = val & 0x7ff; svga_recalctimings(svga); svga->fullchange = changeframecount; break; - + case 0x8504: virge->subsys_stat &= ~(val & 0xff); virge->subsys_cntl = (val >> 8); s3_virge_update_irqs(virge); break; - + case 0x850c: virge->advfunc_cntl = val & 0xff; s3_virge_updatemapping(virge); @@ -1810,7 +1811,7 @@ s3_virge_mmio_write_l(uint32_t addr, uint32_t val, void *p) y > s3d_tri->clip_b)) \ update = 0; \ } - + #define MIX() \ { \ @@ -1862,7 +1863,7 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) uint32_t source = 0, dest = 0, pattern; uint32_t out = 0; int update; - + switch (virge->s3d.cmd_set & CMD_SET_FORMAT_MASK) { case CMD_SET_FORMAT_8: @@ -1893,7 +1894,7 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) } if (virge->s3d.cmd_set & CMD_SET_MP) pattern_data = mono_pattern; - + switch (virge->s3d.cmd_set & CMD_SET_ITA_MASK) { case CMD_SET_ITA_BYTE: @@ -1938,7 +1939,7 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) virge->s3d.h = virge->s3d.r_height; virge->s3d.rop = (virge->s3d.cmd_set >> 17) & 0xff; virge->s3d.data_left_count = 0; - + s3_virge_log("BitBlt start src_x=%i,src_y=%i,dest_x=%i,dest_y=%i,w=%i,h=%i,rop=%02X,src_base=%x,dest_base=%x\n", virge->s3d.src_x, virge->s3d.src_y, @@ -1949,7 +1950,7 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) virge->s3d.rop, virge->s3d.src_base, virge->s3d.dest_base); - + if (virge->s3d.cmd_set & CMD_SET_IDS) return; } @@ -2020,7 +2021,7 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) WRITE(dest_addr, out); } - + virge->s3d.src_x += x_inc; virge->s3d.src_x &= 0x7ff; virge->s3d.dest_x += x_inc; @@ -2034,7 +2035,7 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) virge->s3d.src_y += y_inc; virge->s3d.dest_y += y_inc; virge->s3d.h--; - + switch (virge->s3d.cmd_set & (CMD_SET_MS | CMD_SET_IDS)) { case CMD_SET_IDS: @@ -2054,10 +2055,10 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) } } else - virge->s3d.w--; + virge->s3d.w--; } break; - + case CMD_SET_COMMAND_RECTFILL: /*No source, pattern = pat_fg_clr*/ if (count == -1) @@ -2069,7 +2070,7 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) virge->s3d.w = virge->s3d.r_width; virge->s3d.h = virge->s3d.r_height; virge->s3d.rop = (virge->s3d.cmd_set >> 17) & 0xff; - + s3_virge_log("RctFll start %i,%i %i,%i %02X %08x\n", virge->s3d.dest_x, virge->s3d.dest_y, virge->s3d.w, @@ -2115,11 +2116,11 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) } } else - virge->s3d.w--; + virge->s3d.w--; count--; } break; - + case CMD_SET_COMMAND_LINE: if (count == -1) { @@ -2133,7 +2134,7 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) int x; int new_x; int first_pixel = 1; - + x = virge->s3d.dest_x >> 20; if (virge->s3d.h == virge->s3d.lycnt && @@ -2146,11 +2147,11 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) else new_x = (virge->s3d.dest_x + virge->s3d.ldx) >> 20; - + if ((virge->s3d.line_dir && x > new_x) || (!virge->s3d.line_dir && x < new_x)) goto skip_line; - + do { uint32_t dest_addr = virge->s3d.dest_base + (x * x_mul) + (virge->s3d.dest_y * virge->s3d.dest_str); @@ -2179,7 +2180,7 @@ static void s3_virge_bitblt(virge_t *virge, int count, uint32_t cpu_dat) WRITE(dest_addr, out); } - + if (x < new_x) x++; else if (x > new_x) @@ -2225,7 +2226,7 @@ skip_line: WRITE(dest_addr, out); } - + x = (x + xdir) & 0x7ff; } while (x != (xend + xdir)); @@ -2274,21 +2275,21 @@ typedef struct s3d_state_t int32_t r, g, b, a, u, v, d, w; int32_t base_r, base_g, base_b, base_a, base_u, base_v, base_d, base_w; - + uint32_t base_z; uint32_t tbu, tbv; uint32_t cmd_set; int max_d; - + uint16_t *texture[10]; - + uint32_t tex_bdr_clr; - + int32_t x1, x2; int y; - + rgba_t dest_rgba; } s3d_state_t; @@ -2296,7 +2297,7 @@ typedef struct s3d_texture_state_t { int level; int texture_shift; - + int32_t u, v; } s3d_texture_state_t; @@ -2392,7 +2393,7 @@ static void tex_ARGB8888_nowrap(s3d_state_t *state, s3d_texture_state_t *texture static void tex_sample_normal(s3d_state_t *state) { s3d_texture_state_t texture_state; - + texture_state.level = state->max_d; texture_state.texture_shift = 18 + (9 - texture_state.level); texture_state.u = state->u + state->tbu; @@ -2430,12 +2431,12 @@ static void tex_sample_normal_filter(s3d_state_t *state) texture_state.u = state->u + state->tbu + tex_offset; texture_state.v = state->v + state->tbv + tex_offset; tex_read(state, &texture_state, &tex_samples[3]); - + d[0] = (256 - du) * (256 - dv); d[1] = du * (256 - dv); d[2] = (256 - du) * dv; d[3] = du * dv; - + state->dest_rgba.r = (tex_samples[0].r * d[0] + tex_samples[1].r * d[1] + tex_samples[2].r * d[2] + tex_samples[3].r * d[3]) >> 16; state->dest_rgba.g = (tex_samples[0].g * d[0] + tex_samples[1].g * d[1] + tex_samples[2].g * d[2] + tex_samples[3].g * d[3]) >> 16; state->dest_rgba.b = (tex_samples[0].b * d[0] + tex_samples[1].b * d[1] + tex_samples[2].b * d[2] + tex_samples[3].b * d[3]) >> 16; @@ -2469,7 +2470,7 @@ static void tex_sample_mipmap_filter(s3d_state_t *state) texture_state.level = 0; texture_state.texture_shift = 18 + (9 - texture_state.level); tex_offset = 1 << texture_state.texture_shift; - + texture_state.u = state->u + state->tbu; texture_state.v = state->v + state->tbv; tex_read(state, &texture_state, &tex_samples[0]); @@ -2492,7 +2493,7 @@ static void tex_sample_mipmap_filter(s3d_state_t *state) d[1] = du * (256 - dv); d[2] = (256 - du) * dv; d[3] = du * dv; - + state->dest_rgba.r = (tex_samples[0].r * d[0] + tex_samples[1].r * d[1] + tex_samples[2].r * d[2] + tex_samples[3].r * d[3]) >> 16; state->dest_rgba.g = (tex_samples[0].g * d[0] + tex_samples[1].g * d[1] + tex_samples[2].g * d[2] + tex_samples[3].g * d[3]) >> 16; state->dest_rgba.b = (tex_samples[0].b * d[0] + tex_samples[1].b * d[1] + tex_samples[2].b * d[2] + tex_samples[3].b * d[3]) >> 16; @@ -2506,9 +2507,9 @@ static void tex_sample_persp_normal(s3d_state_t *state) if (state->w) w = (int32_t)(((1ULL << 27) << 19) / (int64_t)state->w); - + texture_state.level = state->max_d; - texture_state.texture_shift = 18 + (9 - texture_state.level); + texture_state.texture_shift = 18 + (9 - texture_state.level); texture_state.u = (int32_t)(((int64_t)state->u * (int64_t)w) >> (12 + state->max_d)) + state->tbu; texture_state.v = (int32_t)(((int64_t)state->v * (int64_t)w) >> (12 + state->max_d)) + state->tbv; @@ -2533,7 +2534,7 @@ static void tex_sample_persp_normal_filter(s3d_state_t *state) texture_state.level = state->max_d; texture_state.texture_shift = 18 + (9 - texture_state.level); tex_offset = 1 << texture_state.texture_shift; - + texture_state.u = u; texture_state.v = v; tex_read(state, &texture_state, &tex_samples[0]); @@ -2556,7 +2557,7 @@ static void tex_sample_persp_normal_filter(s3d_state_t *state) d[1] = du * (256 - dv); d[2] = (256 - du) * dv; d[3] = du * dv; - + state->dest_rgba.r = (tex_samples[0].r * d[0] + tex_samples[1].r * d[1] + tex_samples[2].r * d[2] + tex_samples[3].r * d[3]) >> 16; state->dest_rgba.g = (tex_samples[0].g * d[0] + tex_samples[1].g * d[1] + tex_samples[2].g * d[2] + tex_samples[3].g * d[3]) >> 16; state->dest_rgba.b = (tex_samples[0].b * d[0] + tex_samples[1].b * d[1] + tex_samples[2].b * d[2] + tex_samples[3].b * d[3]) >> 16; @@ -2570,9 +2571,9 @@ static void tex_sample_persp_normal_375(s3d_state_t *state) if (state->w) w = (int32_t)(((1ULL << 27) << 19) / (int64_t)state->w); - + texture_state.level = state->max_d; - texture_state.texture_shift = 18 + (9 - texture_state.level); + texture_state.texture_shift = 18 + (9 - texture_state.level); texture_state.u = (int32_t)(((int64_t)state->u * (int64_t)w) >> (8 + state->max_d)) + state->tbu; texture_state.v = (int32_t)(((int64_t)state->v * (int64_t)w) >> (8 + state->max_d)) + state->tbv; @@ -2593,7 +2594,7 @@ static void tex_sample_persp_normal_filter_375(s3d_state_t *state) u = (int32_t)(((int64_t)state->u * (int64_t)w) >> (8 + state->max_d)) + state->tbu; v = (int32_t)(((int64_t)state->v * (int64_t)w) >> (8 + state->max_d)) + state->tbv; - + texture_state.level = state->max_d; texture_state.texture_shift = 18 + (9 - texture_state.level); tex_offset = 1 << texture_state.texture_shift; @@ -2620,7 +2621,7 @@ static void tex_sample_persp_normal_filter_375(s3d_state_t *state) d[1] = du * (256 - dv); d[2] = (256 - du) * dv; d[3] = du * dv; - + state->dest_rgba.r = (tex_samples[0].r * d[0] + tex_samples[1].r * d[1] + tex_samples[2].r * d[2] + tex_samples[3].r * d[3]) >> 16; state->dest_rgba.g = (tex_samples[0].g * d[0] + tex_samples[1].g * d[1] + tex_samples[2].g * d[2] + tex_samples[3].g * d[3]) >> 16; state->dest_rgba.b = (tex_samples[0].b * d[0] + tex_samples[1].b * d[1] + tex_samples[2].b * d[2] + tex_samples[3].b * d[3]) >> 16; @@ -2635,7 +2636,7 @@ static void tex_sample_persp_mipmap(s3d_state_t *state) if (state->w) w = (int32_t)(((1ULL << 27) << 19) / (int64_t)state->w); - + texture_state.level = (state->d < 0) ? state->max_d : state->max_d - ((state->d >> 27) & 0xf); if (texture_state.level < 0) texture_state.level = 0; @@ -2660,7 +2661,7 @@ static void tex_sample_persp_mipmap_filter(s3d_state_t *state) u = (int32_t)(((int64_t)state->u * (int64_t)w) >> (12 + state->max_d)) + state->tbu; v = (int32_t)(((int64_t)state->v * (int64_t)w) >> (12 + state->max_d)) + state->tbv; - + texture_state.level = (state->d < 0) ? state->max_d : state->max_d - ((state->d >> 27) & 0xf); if (texture_state.level < 0) texture_state.level = 0; @@ -2689,7 +2690,7 @@ static void tex_sample_persp_mipmap_filter(s3d_state_t *state) d[1] = du * (256 - dv); d[2] = (256 - du) * dv; d[3] = du * dv; - + state->dest_rgba.r = (tex_samples[0].r * d[0] + tex_samples[1].r * d[1] + tex_samples[2].r * d[2] + tex_samples[3].r * d[3]) >> 16; state->dest_rgba.g = (tex_samples[0].g * d[0] + tex_samples[1].g * d[1] + tex_samples[2].g * d[2] + tex_samples[3].g * d[3]) >> 16; state->dest_rgba.b = (tex_samples[0].b * d[0] + tex_samples[1].b * d[1] + tex_samples[2].b * d[2] + tex_samples[3].b * d[3]) >> 16; @@ -2703,7 +2704,7 @@ static void tex_sample_persp_mipmap_375(s3d_state_t *state) if (state->w) w = (int32_t)(((1ULL << 27) << 19) / (int64_t)state->w); - + texture_state.level = (state->d < 0) ? state->max_d : state->max_d - ((state->d >> 27) & 0xf); if (texture_state.level < 0) texture_state.level = 0; @@ -2728,13 +2729,13 @@ static void tex_sample_persp_mipmap_filter_375(s3d_state_t *state) u = (int32_t)(((int64_t)state->u * (int64_t)w) >> (8 + state->max_d)) + state->tbu; v = (int32_t)(((int64_t)state->v * (int64_t)w) >> (8 + state->max_d)) + state->tbv; - + texture_state.level = (state->d < 0) ? state->max_d : state->max_d - ((state->d >> 27) & 0xf); if (texture_state.level < 0) texture_state.level = 0; texture_state.texture_shift = 18 + (9 - texture_state.level); tex_offset = 1 << texture_state.texture_shift; - + texture_state.u = u; texture_state.v = v; tex_read(state, &texture_state, &tex_samples[0]); @@ -2757,7 +2758,7 @@ static void tex_sample_persp_mipmap_filter_375(s3d_state_t *state) d[1] = du * (256 - dv); d[2] = (256 - du) * dv; d[3] = du * dv; - + state->dest_rgba.r = (tex_samples[0].r * d[0] + tex_samples[1].r * d[1] + tex_samples[2].r * d[2] + tex_samples[3].r * d[3]) >> 16; state->dest_rgba.g = (tex_samples[0].g * d[0] + tex_samples[1].g * d[1] + tex_samples[2].g * d[2] + tex_samples[3].g * d[3]) >> 16; state->dest_rgba.b = (tex_samples[0].b * d[0] + tex_samples[1].b * d[1] + tex_samples[2].b * d[2] + tex_samples[3].b * d[3]) >> 16; @@ -2781,7 +2782,7 @@ static void tex_sample_persp_mipmap_filter_375(s3d_state_t *state) b = ((b) < 0) ? 0 : 0xff; \ if ((a) & ~0xff) \ a = ((a) < 0) ? 0 : 0xff; - + #define CLAMP_RGB(r, g, b) do \ { \ if ((r) < 0) \ @@ -2846,11 +2847,11 @@ static void dest_pixel_lit_texture_reflection(s3d_state_t *state) static void dest_pixel_lit_texture_modulate(s3d_state_t *state) { int r = state->r >> 7, g = state->g >> 7, b = state->b >> 7, a = state->a >> 7; - + tex_sample(state); - + CLAMP_RGBA(r, g, b, a); - + state->dest_rgba.r = ((state->dest_rgba.r) * r) >> 8; state->dest_rgba.g = ((state->dest_rgba.g) * g) >> 8; state->dest_rgba.b = ((state->dest_rgba.b) * b) >> 8; @@ -2865,13 +2866,13 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 uint8_t *vram = (uint8_t *)svga->vram; int x_dir = s3d_tri->tlr ? 1 : -1; - + int use_z = !(s3d_tri->cmd_set & CMD_SET_ZB_MODE); int y_count = yc; - + int bpp = (s3d_tri->cmd_set >> 2) & 7; - + uint32_t dest_offset = 0, z_offset = 0; uint32_t src_col; @@ -2889,7 +2890,7 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 int update; uint16_t src_z = 0; - + if (s3d_tri->cmd_set & CMD_SET_HC) { if (state->y < s3d_tri->clip_t) @@ -2897,10 +2898,10 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 if (state->y > s3d_tri->clip_b) { int diff_y = state->y - s3d_tri->clip_b; - + if (diff_y > y_count) diff_y = y_count; - + state->base_u += (s3d_tri->TdUdY * diff_y); state->base_v += (s3d_tri->TdVdY * diff_y); state->base_z += (s3d_tri->TdZdY * diff_y); @@ -2923,7 +2924,7 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 dest_offset = s3d_tri->dest_base + (state->y * s3d_tri->dest_str); z_offset = s3d_tri->z_base + (state->y * s3d_tri->z_str); - + while (y_count > 0) { x = (state->x1 + ((1 << 20) - 1)) >> 20; @@ -2965,7 +2966,7 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 if (x < s3d_tri->clip_l) { int diff_x = s3d_tri->clip_l - x; - + z += (s3d_tri->TdZdX * diff_x); state->u += (s3d_tri->TdUdX * diff_x); state->v += (s3d_tri->TdVdX * diff_x); @@ -2975,7 +2976,7 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 state->a += (s3d_tri->TdAdX * diff_x); state->d += (s3d_tri->TdDdX * diff_x); state->w += (s3d_tri->TdWdX * diff_x); - + x = s3d_tri->clip_l; } } @@ -2990,7 +2991,7 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 if (x > s3d_tri->clip_r) { int diff_x = x - s3d_tri->clip_r; - + z += (s3d_tri->TdZdX * diff_x); state->u += (s3d_tri->TdUdX * diff_x); state->v += (s3d_tri->TdVdX * diff_x); @@ -3000,7 +3001,7 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 state->a += (s3d_tri->TdAdX * diff_x); state->d += (s3d_tri->TdDdX * diff_x); state->w += (s3d_tri->TdWdX * diff_x); - + x = s3d_tri->clip_r; } } @@ -3013,7 +3014,7 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 x &= 0xfff; xe &= 0xfff; - + while (x != xe) { update = 1; _x = x; _y = state->y; @@ -3105,7 +3106,7 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 switch (bpp) { - case 0: /*8 bpp*/ + case 0: /*8 bpp*/ /*Not implemented yet*/ break; case 1: /*16 bpp*/ @@ -3139,13 +3140,13 @@ static void tri(virge_t *virge, s3d_t *s3d_tri, s3d_state_t *state, int yc, int3 state->w += s3d_tri->TdWdX; dest_addr += x_offset; z_addr += xz_offset; - + x = (x + x_dir) & 0xfff; } } y_count--; - + tri_skip_line: state->x1 += dx1; state->x2 += dx2; @@ -3188,11 +3189,11 @@ static void s3_virge_triangle(virge_t *virge, s3d_t *s3d_tri) state.tbu = s3d_tri->tbu << 11; state.tbv = s3d_tri->tbv << 11; - + state.max_d = (s3d_tri->cmd_set >> 8) & 15; - + state.tex_bdr_clr = s3d_tri->tex_bdr_clr; - + state.cmd_set = s3d_tri->cmd_set; state.base_u = s3d_tri->tus; @@ -3204,7 +3205,7 @@ static void s3_virge_triangle(virge_t *virge, s3d_t *s3d_tri) state.base_a = (int32_t)s3d_tri->tas; state.base_d = s3d_tri->tds; state.base_w = s3d_tri->tws; - + tex_base = s3d_tri->tex_base; for (c = 9; c >= 0; c--) { @@ -3243,8 +3244,8 @@ static void s3_virge_triangle(virge_t *virge, s3d_t *s3d_tri) default: s3_virge_log("bad triangle type %x\n", (s3d_tri->cmd_set >> 27) & 0xf); return; - } - + } + switch (((s3d_tri->cmd_set >> 12) & 7) | ((s3d_tri->cmd_set & (1 << 29)) ? 8 : 0)) { case 0: case 1: @@ -3284,7 +3285,7 @@ static void s3_virge_triangle(virge_t *virge, s3d_t *s3d_tri) tex_sample = virge->bilinear_enabled ? tex_sample_persp_normal_filter : tex_sample_persp_normal; break; } - + switch ((s3d_tri->cmd_set >> 5) & 7) { case 0: @@ -3308,9 +3309,9 @@ static void s3_virge_triangle(virge_t *virge, s3d_t *s3d_tri) tri(virge, s3d_tri, &state, s3d_tri->ty01, s3d_tri->TdXdY02, s3d_tri->TdXdY01); state.x2 = s3d_tri->txend12; tri(virge, s3d_tri, &state, s3d_tri->ty12, s3d_tri->TdXdY02, s3d_tri->TdXdY12); - + end_time = plat_timer_read(); - + virge->blitter_time += end_time - start_time; } @@ -3328,17 +3329,17 @@ static void s3_virge_hwcursor_draw(svga_t *svga, int displine) svga->hwcursor_latch.addr += 16; switch (svga->bpp) - { + { case 15: fg = video_15to32[virge->hwc_fg_col & 0xffff]; bg = video_15to32[virge->hwc_bg_col & 0xffff]; break; - + case 16: fg = video_16to32[virge->hwc_fg_col & 0xffff]; bg = video_16to32[virge->hwc_bg_col & 0xffff]; break; - + case 24: case 32: fg = virge->hwc_fg_col; bg = virge->hwc_bg_col; @@ -3364,7 +3365,7 @@ static void s3_virge_hwcursor_draw(svga_t *svga, int displine) if (dat[0] & 0x8000) buffer32->line[displine][offset + svga->x_add] = (dat[1] & 0x8000) ? fg : bg; } - + offset++; dat[0] <<= 1; dat[1] <<= 1; @@ -3382,7 +3383,7 @@ static void s3_virge_hwcursor_draw(svga_t *svga, int displine) else if (dat[1] & 0x8000) buffer32->line[displine][offset + svga->x_add] ^= 0xffffff; } - + offset++; dat[0] <<= 1; dat[1] <<= 1; @@ -3631,7 +3632,7 @@ static void s3_virge_overlay_draw(svga_t *svga, int displine) int x; uint32_t *p; uint8_t *src = &svga->vram[svga->overlay_latch.addr]; - + p = &(buffer32->line[displine][offset + svga->x_add]); if ((offset + virge->streams.sec_w) > virge->streams.pri_w) @@ -3640,7 +3641,7 @@ static void s3_virge_overlay_draw(svga_t *svga, int displine) x_size = virge->streams.sec_w + 1; OVERLAY_SAMPLE(); - + for (x = 0; x < x_size; x++) { *p++ = r[x_read] | (g[x_read] << 8) | (b[x_read] << 16); @@ -3673,22 +3674,22 @@ static uint8_t s3_virge_pci_read(int func, int addr, void *p) switch (addr) { case 0x00: ret = 0x33; break; /*'S3'*/ case 0x01: ret = 0x53; break; - + case 0x02: ret = virge->virge_id_low; break; case 0x03: ret = virge->virge_id_high; break; case PCI_REG_COMMAND: ret = virge->pci_regs[PCI_REG_COMMAND] & 0x27; break; - + case 0x07: ret = virge->pci_regs[0x07] & 0x36; break; - + case 0x08: ret = virge->virge_rev; break; /*Revision ID*/ case 0x09: ret = 0; break; /*Programming interface*/ - + case 0x0a: ret = 0x00; break; /*Supports VGA interface*/ case 0x0b: ret = 0x03; break; case 0x0d: ret = virge->pci_regs[0x0d] & 0xf8; break; - + case 0x10: ret = 0x00; break;/*Linear frame buffer address*/ case 0x11: ret = 0x00; break; case 0x12: ret = 0x00; break; @@ -3707,12 +3708,12 @@ static uint8_t s3_virge_pci_read(int func, int addr, void *p) case 0x34: ret = (virge->chip >= S3_VIRGEGX2) ? 0xdc : 0x00; break; case 0x3c: ret = virge->pci_regs[0x3c]; break; - + case 0x3d: ret = PCI_INTA; break; /*INTA*/ - + case 0x3e: ret = 0x04; break; case 0x3f: ret = 0xff; break; - + case 0x80: ret = 0x02; break; /* AGP capability */ case 0x81: ret = 0x00; break; case 0x82: ret = 0x10; break; /* assumed AGP 1.0 */ @@ -3746,8 +3747,8 @@ static void s3_virge_pci_write(int func, int addr, uint8_t val, void *p) case 0x00: case 0x01: case 0x02: case 0x03: case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x3d: case 0x3e: case 0x3f: - return; - + return; + case PCI_REG_COMMAND: if (val & PCI_COMMAND_IO) { @@ -3757,12 +3758,12 @@ static void s3_virge_pci_write(int func, int addr, uint8_t val, void *p) else io_removehandler(0x03c0, 0x0020, s3_virge_in, NULL, NULL, s3_virge_out, NULL, NULL, virge); virge->pci_regs[PCI_REG_COMMAND] = val & 0x27; - s3_virge_updatemapping(virge); + s3_virge_updatemapping(virge); return; case 0x07: virge->pci_regs[0x07] = val & 0x3e; return; - case 0x0d: + case 0x0d: virge->pci_regs[0x0d] = val & 0xf8; return; @@ -3786,7 +3787,7 @@ static void s3_virge_pci_write(int func, int addr, uint8_t val, void *p) mem_mapping_disable(&virge->bios_rom.mapping); } return; - case 0x3c: + case 0x3c: virge->pci_regs[0x3c] = val; return; @@ -3834,7 +3835,7 @@ static void s3_virge_reset(void *priv) virge->pci_regs[0x06] = 0; virge->pci_regs[0x07] = 2; virge->pci_regs[0x32] = 0x0c; - virge->pci_regs[0x3d] = 1; + virge->pci_regs[0x3d] = 1; virge->pci_regs[0x3e] = 4; virge->pci_regs[0x3f] = 0xff; @@ -3888,7 +3889,7 @@ static void s3_virge_reset(void *priv) else virge->svga.crtc[0x36] = 2 | (0 << 2) | (1 << 4) | (0 << 5); break; - } + } if (virge->local == S3_VIRGE_GX) virge->svga.crtc[0x36] |= (1 << 2); } @@ -3917,8 +3918,8 @@ static void *s3_virge_init(const device_t *info) virge->memory_size = 4; else virge->memory_size = device_get_config_int("memory"); - - + + switch(info->local) { case S3_VIRGE_325: bios_fn = ROM_VIRGE_325; @@ -3966,7 +3967,7 @@ static void *s3_virge_init(const device_t *info) rom_init(&virge->bios_rom, (char *) bios_fn, 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL); else rom_init(&virge->bios_rom, (char *) bios_fn, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); - + mem_mapping_disable(&virge->bios_rom.mapping); mem_mapping_add(&virge->linear_mapping, 0, 0, svga_read_linear, @@ -4004,10 +4005,10 @@ static void *s3_virge_init(const device_t *info) virge->pci_regs[0x06] = 0; virge->pci_regs[0x07] = 2; virge->pci_regs[0x32] = 0x0c; - virge->pci_regs[0x3d] = 1; + virge->pci_regs[0x3d] = 1; virge->pci_regs[0x3e] = 4; virge->pci_regs[0x3f] = 0xff; - + virge->virge_rev = 0; virge->virge_id = 0xe1; virge->is_agp = !!(info->flags & DEVICE_AGP); @@ -4106,11 +4107,11 @@ static void *s3_virge_init(const device_t *info) else virge->svga.crtc[0x36] = 2 | (0 << 2) | (1 << 4) | (0 << 5); break; - } + } if (info->local == S3_VIRGE_GX) virge->svga.crtc[0x36] |= (1 << 2); } - + virge->svga.crtc[0x37] = 1 | (7 << 5); virge->svga.crtc[0x53] = 8; @@ -4118,7 +4119,7 @@ static void *s3_virge_init(const device_t *info) virge->i2c = i2c_gpio_init("ddc_s3_virge"); virge->ddc = ddc_init(i2c_gpio_get_bus(virge->i2c)); - + virge->svga.force_old_addr = 1; virge->wake_render_thread = thread_create_event(); @@ -4128,9 +4129,9 @@ static void *s3_virge_init(const device_t *info) virge->render_thread = thread_create(render_thread, virge); timer_add(&virge->tri_timer, s3_virge_tri_timer, virge, 0); - + virge->local = info->local; - + return virge; } @@ -4149,7 +4150,7 @@ static void s3_virge_close(void *p) ddc_close(virge->ddc); i2c_gpio_close(virge->i2c); - + free(virge); } @@ -4206,7 +4207,7 @@ static int s3_trio3d2x_available(void) static void s3_virge_speed_changed(void *p) { virge_t *virge = (virge_t *)p; - + svga_recalctimings(&virge->svga); } @@ -4219,51 +4220,135 @@ static void s3_virge_force_redraw(void *p) static const device_config_t s3_virge_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 }, - { - { "2 MB", 2 }, - { "4 MB", 4 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 4, + .selection = { + { + .description = "2 MB", + .value = 2 + }, + { + .description = "4 MB", + .value = 4 + }, + { + .description = "" + } } }, - { "bilinear", "Bilinear filtering", CONFIG_BINARY, "", 1 }, - { "dithering", "Dithering", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .name = "dithering", + .description = "Dithering", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .type = CONFIG_END + } }; static const device_config_t s3_virge_stb_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 }, - { - { "2 MB", 2 }, - { "4 MB", 4 }, - { "8 MB", 8 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 4, + .selection = { + { + .description = "2 MB", + .value = 2 + }, + { + .description = "4 MB", + .value = 4 + }, + { + .description = "8 MB", + .value = 8 + }, + { + .description = "" + } } }, - { "bilinear", "Bilinear filtering", CONFIG_BINARY, "", 1 }, - { "dithering", "Dithering", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .name = "dithering", + .description = "Dithering", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .type = CONFIG_END + } }; static const device_config_t s3_virge_357_config[] = { - { "bilinear", "Bilinear filtering", CONFIG_BINARY, "", 1 }, - { "dithering", "Dithering", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .name = "dithering", + .description = "Dithering", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .type = CONFIG_END + } }; static const device_config_t s3_trio3d2x_config[] = { { - "memory", "Memory size", CONFIG_SELECTION, "", 4, "", { 0 }, - { - { "4 MB", 4 }, - { "8 MB", 8 }, - { "" } + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 4, + .selection = { + { + .description = "4 MB", + .value = 4 + }, + { + .description = "8 MB", + .value = 8 + }, + { + .description = "" + } } }, - { "bilinear", "Bilinear filtering", CONFIG_BINARY, "", 1 }, - { "dithering", "Dithering", CONFIG_BINARY, "", 1 }, - { "", "", -1 } + { + .name = "bilinear", + .description = "Bilinear filtering", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .name = "dithering", + .description = "Dithering", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .type = CONFIG_END + } }; const device_t s3_virge_325_pci_device = { diff --git a/src/video/vid_sc1148x_ramdac.c b/src/video/vid_sc1148x_ramdac.c index fcd314743..202147d14 100644 --- a/src/video/vid_sc1148x_ramdac.c +++ b/src/video/vid_sc1148x_ramdac.c @@ -42,12 +42,11 @@ void sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga) { sc1148x_ramdac_t *ramdac = (sc1148x_ramdac_t *) p; - uint8_t rs = (addr & 0x03); - rs |= ((!!rs2) << 2); - int oldbpp = 0; + uint8_t rs = (addr & 0x03) | ((!!rs2) << 2); + int oldbpp = 0; - switch (addr) { - case 0x3c6: + switch (rs) { + case 2: case 6: switch (ramdac->state) { case 4: ramdac->state = 0; @@ -84,8 +83,7 @@ sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga) } break; - case 0x3c7: case 0x3c8: - case 0x3c9: + default: ramdac->state = 0; svga_out(addr, val, svga); break; @@ -97,12 +95,10 @@ uint8_t sc1148x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga) { sc1148x_ramdac_t *ramdac = (sc1148x_ramdac_t *) p; - uint8_t ret = 0xff; - uint8_t rs = (addr & 0x03); - rs |= ((!!rs2) << 2); + uint8_t ret = 0xff, rs = (addr & 0x03) | ((!!rs2) << 2); - switch (addr) { - case 0x3c6: + switch (rs) { + case 2: case 6: switch (ramdac->state) { case 1: case 2: case 3: @@ -120,8 +116,7 @@ sc1148x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga) } break; - case 0x3c7: case 0x3c8: - case 0x3c9: + default: ret = svga_in(addr, svga); ramdac->state = 0; break; diff --git a/src/video/vid_sigma.c b/src/video/vid_sigma.c index bddce455c..a6372ad00 100644 --- a/src/video/vid_sigma.c +++ b/src/video/vid_sigma.c @@ -880,39 +880,103 @@ sigma_speed_changed(void *p) sigma_recalctimings(sigma); } - device_config_t sigma_config[] = { // clang-format off { - "rgb_type", "RGB type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { "Color", 0 }, - { "Green Monochrome", 1 }, - { "Amber Monochrome", 2 }, - { "Gray Monochrome", 3 }, - { "Color (no brown)", 4 }, - { "" } + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_int = 0, + .selection = { + { + .description = "Color", + .value = 0 + }, + { + .description = "Green Monochrome", + .value = 1 + }, + { + .description = "Amber Monochrome", + .value = 2 + }, + { + .description = "Gray Monochrome", + .value = 3 + }, + { + .description = "Color (no brown)", + .value = 4 + }, + { + .description = "" + } } }, - { "enable_nmi", "Enable NMI for CGA emulation", CONFIG_BINARY, "", 1 }, { - "bios_addr", "BIOS Address", CONFIG_HEX20, "", 0xc0000, "", { 0 }, - { - { "C000H", 0xc0000 }, - { "C800H", 0xc8000 }, - { "CC00H", 0xcc000 }, - { "D000H", 0xd0000 }, - { "D400H", 0xd4000 }, - { "D800H", 0xd8000 }, - { "DC00H", 0xdc000 }, - { "E000H", 0xe0000 }, - { "E400H", 0xe4000 }, - { "E800H", 0xe8000 }, - { "EC00H", 0xec000 }, - { "" } + .name = "enable_nmi", + .description = "Enable NMI for CGA emulation", + .type = CONFIG_BINARY, + .default_int = 1 + }, + { + .name = "bios_addr", + .description = "BIOS Address", + .type = CONFIG_HEX20, + .default_int = 0xc0000, + .selection = { + { + .description = "C000H", + .value = 0xc0000 + }, + { + .description = "C800H", + .value = 0xc8000 + }, + { + .description = "CC00H", + .value = 0xcc000 + }, + { + .description = "D000H", + .value = 0xd0000 + }, + { + .description = "D400H", + .value = 0xd4000 + }, + { + .description = "D800H", + .value = 0xd8000 + }, + { + .description = "DC00H", + .value = 0xdc000 + }, + { + .description = "E000H", + .value = 0xe0000 + }, + { + .description = "E400H", + .value = 0xe4000 + }, + { + .description = "E800H", + .value = 0xe8000 + }, + { + .description = "EC00H", + .value = 0xec000 + }, + { + .description = "" + } }, }, - { "", "", -1 } + { + .type = CONFIG_END + } // clang-format on }; diff --git a/src/video/vid_svga_render.c b/src/video/vid_svga_render.c index 2d23231be..ca9c3b3f1 100644 --- a/src/video/vid_svga_render.c +++ b/src/video/vid_svga_render.c @@ -396,94 +396,94 @@ svga_render_2bpp_lowres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - if (svga->force_old_addr) { - changed_offset = ((svga->ma << 1) + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12; - - if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + if (svga->force_old_addr) { + changed_offset = ((svga->ma << 1) + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12; - if (svga->firstline_draw == 2000) - svga->firstline_draw = svga->displine; - svga->lastline_draw = svga->displine; + if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) { + p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - for (x = 0; x <= (svga->hdisp + svga->scrollcache); x += 16) { - addr = svga->ma; + if (svga->firstline_draw == 2000) + svga->firstline_draw = svga->displine; + svga->lastline_draw = svga->displine; - if (!(svga->crtc[0x17] & 0x40)) { - addr = (addr << 1) & svga->vram_mask; - addr &= ~7; + for (x = 0; x <= (svga->hdisp + svga->scrollcache); x += 16) { + addr = svga->ma; - if ((svga->crtc[0x17] & 0x20) && (svga->ma & 0x20000)) - addr |= 4; + if (!(svga->crtc[0x17] & 0x40)) { + addr = (addr << 1) & svga->vram_mask; + addr &= ~7; - if (!(svga->crtc[0x17] & 0x20) && (svga->ma & 0x8000)) - addr |= 4; - } + if ((svga->crtc[0x17] & 0x20) && (svga->ma & 0x20000)) + addr |= 4; - if (!(svga->crtc[0x17] & 0x01)) - addr = (addr & ~0x8000) | ((svga->sc & 1) ? 0x8000 : 0); - - if (!(svga->crtc[0x17] & 0x02)) - addr = (addr & ~0x10000) | ((svga->sc & 2) ? 0x10000 : 0); - - dat[0] = svga->vram[addr]; - dat[1] = svga->vram[addr | 0x1]; - if (svga->seqregs[1] & 4) - svga->ma += 2; - else - svga->ma += 4; - svga->ma &= svga->vram_mask; - if (svga->crtc[0x17] & 0x80) { - p[0] = p[1] = svga->pallook[svga->egapal[(dat[0] >> 6) & 3]]; - p[2] = p[3] = svga->pallook[svga->egapal[(dat[0] >> 4) & 3]]; - p[4] = p[5] = svga->pallook[svga->egapal[(dat[0] >> 2) & 3]]; - p[6] = p[7] = svga->pallook[svga->egapal[dat[0] & 3]]; - p[8] = p[9] = svga->pallook[svga->egapal[(dat[1] >> 6) & 3]]; - p[10] = p[11] = svga->pallook[svga->egapal[(dat[1] >> 4) & 3]]; - p[12] = p[13] = svga->pallook[svga->egapal[(dat[1] >> 2) & 3]]; - p[14] = p[15] = svga->pallook[svga->egapal[dat[1] & 3]]; - } else - memset(p, 0x00, 16 * sizeof(uint32_t)); - p += 16; + if (!(svga->crtc[0x17] & 0x20) && (svga->ma & 0x8000)) + addr |= 4; } + + if (!(svga->crtc[0x17] & 0x01)) + addr = (addr & ~0x8000) | ((svga->sc & 1) ? 0x8000 : 0); + + if (!(svga->crtc[0x17] & 0x02)) + addr = (addr & ~0x10000) | ((svga->sc & 2) ? 0x10000 : 0); + + dat[0] = svga->vram[addr]; + dat[1] = svga->vram[addr | 0x1]; + if (svga->seqregs[1] & 4) + svga->ma += 2; + else + svga->ma += 4; + svga->ma &= svga->vram_mask; + if (svga->crtc[0x17] & 0x80) { + p[0] = p[1] = svga->pallook[svga->egapal[(dat[0] >> 6) & 3]]; + p[2] = p[3] = svga->pallook[svga->egapal[(dat[0] >> 4) & 3]]; + p[4] = p[5] = svga->pallook[svga->egapal[(dat[0] >> 2) & 3]]; + p[6] = p[7] = svga->pallook[svga->egapal[dat[0] & 3]]; + p[8] = p[9] = svga->pallook[svga->egapal[(dat[1] >> 6) & 3]]; + p[10] = p[11] = svga->pallook[svga->egapal[(dat[1] >> 4) & 3]]; + p[12] = p[13] = svga->pallook[svga->egapal[(dat[1] >> 2) & 3]]; + p[14] = p[15] = svga->pallook[svga->egapal[dat[1] & 3]]; + } else + memset(p, 0x00, 16 * sizeof(uint32_t)); + p += 16; } - } else { - changed_addr = svga->remap_func(svga, svga->ma); + } + } else { + changed_addr = svga->remap_func(svga, svga->ma); - if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { - p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; + if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { + p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - if (svga->firstline_draw == 2000) - svga->firstline_draw = svga->displine; - svga->lastline_draw = svga->displine; + if (svga->firstline_draw == 2000) + svga->firstline_draw = svga->displine; + svga->lastline_draw = svga->displine; - for (x = 0; x <= (svga->hdisp + svga->scrollcache); x += 16) { - addr = svga->remap_func(svga, svga->ma); + for (x = 0; x <= (svga->hdisp + svga->scrollcache); x += 16) { + addr = svga->remap_func(svga, svga->ma); - dat[0] = svga->vram[addr]; - dat[1] = svga->vram[addr | 0x1]; - if (svga->seqregs[1] & 4) - svga->ma += 2; - else - svga->ma += 4; + dat[0] = svga->vram[addr]; + dat[1] = svga->vram[addr | 0x1]; + if (svga->seqregs[1] & 4) + svga->ma += 2; + else + svga->ma += 4; - svga->ma &= svga->vram_mask; + svga->ma &= svga->vram_mask; - if (svga->crtc[0x17] & 0x80) { - p[0] = p[1] = svga->pallook[svga->egapal[(dat[0] >> 6) & 3]]; - p[2] = p[3] = svga->pallook[svga->egapal[(dat[0] >> 4) & 3]]; - p[4] = p[5] = svga->pallook[svga->egapal[(dat[0] >> 2) & 3]]; - p[6] = p[7] = svga->pallook[svga->egapal[dat[0] & 3]]; - p[8] = p[9] = svga->pallook[svga->egapal[(dat[1] >> 6) & 3]]; - p[10] = p[11] = svga->pallook[svga->egapal[(dat[1] >> 4) & 3]]; - p[12] = p[13] = svga->pallook[svga->egapal[(dat[1] >> 2) & 3]]; - p[14] = p[15] = svga->pallook[svga->egapal[dat[1] & 3]]; - } else - memset(p, 0x00, 16 * sizeof(uint32_t)); + if (svga->crtc[0x17] & 0x80) { + p[0] = p[1] = svga->pallook[svga->egapal[(dat[0] >> 6) & 3]]; + p[2] = p[3] = svga->pallook[svga->egapal[(dat[0] >> 4) & 3]]; + p[4] = p[5] = svga->pallook[svga->egapal[(dat[0] >> 2) & 3]]; + p[6] = p[7] = svga->pallook[svga->egapal[dat[0] & 3]]; + p[8] = p[9] = svga->pallook[svga->egapal[(dat[1] >> 6) & 3]]; + p[10] = p[11] = svga->pallook[svga->egapal[(dat[1] >> 4) & 3]]; + p[12] = p[13] = svga->pallook[svga->egapal[(dat[1] >> 2) & 3]]; + p[14] = p[15] = svga->pallook[svga->egapal[dat[1] & 3]]; + } else + memset(p, 0x00, 16 * sizeof(uint32_t)); - p += 16; - } + p += 16; } + } } } @@ -500,7 +500,7 @@ svga_render_2bpp_highres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - if (svga->force_old_addr) { + if (svga->force_old_addr) { changed_offset = ((svga->ma << 1) + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12; if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) { @@ -551,7 +551,7 @@ svga_render_2bpp_highres(svga_t *svga) p += 8; } } - } else { + } else { changed_addr = svga->remap_func(svga, svga->ma); if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) { @@ -587,8 +587,8 @@ svga_render_2bpp_highres(svga_t *svga) p += 8; } - } - } + } + } } @@ -666,7 +666,7 @@ svga_render_4bpp_lowres(svga_t *svga) if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -722,7 +722,7 @@ svga_render_4bpp_lowres(svga_t *svga) p += 16; } - } + } } else { changed_addr = svga->remap_func(svga, svga->ma); @@ -767,7 +767,7 @@ svga_render_4bpp_lowres(svga_t *svga) p += 16; } - } + } } } @@ -784,14 +784,14 @@ svga_render_4bpp_highres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { changed_offset = (svga->ma + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12; if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) { p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -847,7 +847,7 @@ svga_render_4bpp_highres(svga_t *svga) p += 8; } - } + } } else { changed_addr = svga->remap_func(svga, svga->ma); @@ -908,12 +908,12 @@ svga_render_8bpp_lowres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -981,12 +981,12 @@ svga_render_8bpp_highres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -1172,12 +1172,12 @@ svga_render_15bpp_lowres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -1253,12 +1253,12 @@ svga_render_15bpp_highres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -1282,7 +1282,7 @@ svga_render_15bpp_highres(svga_t *svga) } else memset(&(p[x]), 0x00, 8 * sizeof(uint32_t)); } - svga->ma += x << 1; + svga->ma += x << 1; svga->ma &= svga->vram_display_mask; } } else { @@ -1453,7 +1453,7 @@ svga_render_16bpp_lowres(svga_t *svga) } else memset(&(p[(x << 1)]), 0x00, 8 * sizeof(uint32_t)); } - svga->ma += x << 1; + svga->ma += x << 1; svga->ma &= svga->vram_display_mask; } } else { @@ -1496,7 +1496,7 @@ svga_render_16bpp_lowres(svga_t *svga) svga->ma += 4; } svga->ma &= svga->vram_display_mask; - } + } } } @@ -1511,12 +1511,12 @@ svga_render_16bpp_highres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -1540,9 +1540,9 @@ svga_render_16bpp_highres(svga_t *svga) } else memset(&(p[x]), 0x00, 8 * sizeof(uint32_t)); } - svga->ma += x << 1; + svga->ma += x << 1; svga->ma &= svga->vram_display_mask; - } + } } else { changed_addr = svga->remap_func(svga, svga->ma); @@ -1590,7 +1590,7 @@ svga_render_16bpp_highres(svga_t *svga) } } svga->ma &= svga->vram_display_mask; - } + } } } @@ -1606,13 +1606,13 @@ svga_render_24bpp_lowres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { if ((svga->displine + svga->y_add) < 0) return; if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -1621,7 +1621,7 @@ svga_render_24bpp_lowres(svga_t *svga) fg = svga->vram[svga->ma] | (svga->vram[svga->ma + 1] << 8) | (svga->vram[svga->ma + 2] << 16); else fg = 0x00000000; - svga->ma += 3; + svga->ma += 3; svga->ma &= svga->vram_display_mask; buffer32->line[svga->displine + svga->y_add][(x << 1) + svga->x_add] = buffer32->line[svga->displine + svga->y_add][(x << 1) + 1 + svga->x_add] = fg; @@ -1690,12 +1690,12 @@ svga_render_24bpp_highres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -1718,7 +1718,7 @@ svga_render_24bpp_highres(svga_t *svga) svga->ma += 12; } svga->ma &= svga->vram_display_mask; - } + } } else { changed_addr = svga->remap_func(svga, svga->ma); @@ -1766,7 +1766,7 @@ svga_render_24bpp_highres(svga_t *svga) } } svga->ma &= svga->vram_display_mask; - } + } } } @@ -1781,10 +1781,10 @@ svga_render_32bpp_lowres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) { - if (svga->firstline_draw == 2000) + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -1847,12 +1847,12 @@ svga_render_32bpp_highres(svga_t *svga) if ((svga->displine + svga->y_add) < 0) return; - + if (svga->force_old_addr) { if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->changedvram[(svga->ma >> 12) + 2] || svga->fullchange) { p = &buffer32->line[svga->displine + svga->y_add][svga->x_add]; - - if (svga->firstline_draw == 2000) + + if (svga->firstline_draw == 2000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine; @@ -1863,7 +1863,7 @@ svga_render_32bpp_highres(svga_t *svga) dat = 0x00000000; p[x] = dat & 0xffffff; } - svga->ma += 4; + svga->ma += 4; svga->ma &= svga->vram_display_mask; } } else { diff --git a/src/video/vid_table.c b/src/video/vid_table.c index 02d5ad81c..c38154388 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -47,31 +47,31 @@ static video_timings_t timing_default = {VIDEO_ISA, 8, 16, 32, 8, 16, 32}; static int was_reset = 0; - static const device_t vid_none_device = { - "None", - "none", - 0, - 0, - NULL, - NULL, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "None", + .internal_name = "none", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; static const device_t vid_internal_device = { - "Internal", - "internal", - 0, - 0, - NULL, - NULL, NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "Internal", + .internal_name = "internal", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; static const VIDEO_CARD diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index c6eb5ff8c..9cf7e1ff7 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -3193,7 +3193,7 @@ static const device_config_t tgui9440_config[] = { .default_int = 2 }, { - .type = -1 + .type = CONFIG_END } }; @@ -3222,7 +3222,7 @@ static const device_config_t tgui96xx_config[] = { .default_int = 4 }, { - .type = -1 + .type = CONFIG_END } }; // clang-format on diff --git a/src/video/vid_tvga.c b/src/video/vid_tvga.c index 6842ea362..8d488552e 100644 --- a/src/video/vid_tvga.c +++ b/src/video/vid_tvga.c @@ -446,16 +446,32 @@ void tvga_force_redraw(void *p) static const device_config_t tvga_config[] = { // clang-format off { - "memory", "Memory size", CONFIG_SELECTION, "", 1024, "", { 0 }, - { - { "256 kB", 256 }, - { "512 kB", 512 }, - { "1 MB", 1024 }, + .name = "memory", + .description = "Memory size", + .type = CONFIG_SELECTION, + .default_int = 1024, + .selection = { + { + .description = "256 kB", + .value = 256 + }, + { + .description = "512 kB", + .value = 512 + }, + { + .description = "1 MB", + .value = 1024 + }, /*Chip supports 2mb, but drivers are buggy*/ - { "" } + { + .description = "" + } } }, - { "", "", -1 } + { + .type = CONFIG_END + } // clang-format off }; diff --git a/src/video/vid_voodoo.c b/src/video/vid_voodoo.c index 76e6c4009..df3d59076 100644 --- a/src/video/vid_voodoo.c +++ b/src/video/vid_voodoo.c @@ -32,6 +32,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> @@ -1418,22 +1419,22 @@ static const device_config_t voodoo_config[] = { }, #endif { - .type = -1 + .type = CONFIG_END } // clang-format on }; const device_t voodoo_device = { - "3DFX Voodoo Graphics", - "voodoo", - DEVICE_PCI, - 0, - voodoo_init, - voodoo_close, - NULL, - { NULL }, - voodoo_speed_changed, - voodoo_force_blit, - voodoo_config + .name = "3DFX Voodoo Graphics", + .internal_name = "voodoo", + .flags = DEVICE_PCI, + .local = 0, + .init = voodoo_init, + .close = voodoo_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = voodoo_speed_changed, + .force_redraw = voodoo_force_blit, + .config = voodoo_config }; diff --git a/src/video/vid_voodoo_banshee.c b/src/video/vid_voodoo_banshee.c index b314cc152..020cb65a4 100644 --- a/src/video/vid_voodoo_banshee.c +++ b/src/video/vid_voodoo_banshee.c @@ -32,6 +32,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/i2c.h> #include <86box/vid_ddc.h> @@ -2601,8 +2602,7 @@ static void banshee_pci_write(int func, int addr, uint8_t val, void *p) } // clang-format off -static const device_config_t banshee_sgram_config[] = -{ +static const device_config_t banshee_sgram_config[] = { { .name = "memory", .description = "Memory size", @@ -2672,12 +2672,11 @@ static const device_config_t banshee_sgram_config[] = }, #endif { - .type = -1 + .type = CONFIG_END } }; -static const device_config_t banshee_sdram_config[] = -{ +static const device_config_t banshee_sdram_config[] = { { .name = "bilinear", .description = "Bilinear filtering", @@ -2728,7 +2727,7 @@ static const device_config_t banshee_sdram_config[] = }, #endif { - .type = -1 + .type = CONFIG_END } }; // clang-format on @@ -2954,123 +2953,114 @@ static void banshee_force_redraw(void *p) banshee->svga.fullchange = changeframecount; } - -const device_t voodoo_banshee_device = -{ - "3dfx Voodoo Banshee", - "voodoo_banshee_pci", - DEVICE_PCI, - 0, - banshee_init, - banshee_close, - NULL, - { banshee_available }, - banshee_speed_changed, - banshee_force_redraw, - banshee_sgram_config +const device_t voodoo_banshee_device = { + .name = "3dfx Voodoo Banshee", + .internal_name = "voodoo_banshee_pci", + .flags = DEVICE_PCI, + .local = 0, + .init = banshee_init, + .close = banshee_close, + .reset = NULL, + { .available = banshee_available }, + .speed_changed = banshee_speed_changed, + .force_redraw = banshee_force_redraw, + banshee_sgram_config }; -const device_t creative_voodoo_banshee_device = -{ - "Creative 3D Blaster Banshee", - "ctl3d_banshee_pci", - DEVICE_PCI, - 0, - creative_banshee_init, - banshee_close, - NULL, - { creative_banshee_available }, - banshee_speed_changed, - banshee_force_redraw, - banshee_sdram_config +const device_t creative_voodoo_banshee_device = { + .name = "Creative 3D Blaster Banshee", + .internal_name = "ctl3d_banshee_pci", + .flags = DEVICE_PCI, + .local = 0, + .init = creative_banshee_init, + .close = banshee_close, + .reset = NULL, + { .available = creative_banshee_available }, + .speed_changed = banshee_speed_changed, + .force_redraw = banshee_force_redraw, + banshee_sdram_config }; -const device_t voodoo_3_2000_device = -{ - "3dfx Voodoo3 2000", - "voodoo3_2k_pci", - DEVICE_PCI, - 0, - v3_2000_init, - banshee_close, - NULL, - { v3_2000_available }, - banshee_speed_changed, - banshee_force_redraw, - banshee_sdram_config +const device_t voodoo_3_2000_device = { + .name = "3dfx Voodoo3 2000", + .internal_name = "voodoo3_2k_pci", + .flags = DEVICE_PCI, + .local = 0, + .init = v3_2000_init, + .close = banshee_close, + .reset = NULL, + { .available = v3_2000_available }, + .speed_changed = banshee_speed_changed, + .force_redraw = banshee_force_redraw, + banshee_sdram_config }; -const device_t voodoo_3_2000_agp_device = -{ - "3dfx Voodoo3 2000", - "voodoo3_2k_agp", - DEVICE_AGP, - 0, - v3_2000_agp_init, - banshee_close, - NULL, - { v3_2000_agp_available }, - banshee_speed_changed, - banshee_force_redraw, - banshee_sdram_config +const device_t voodoo_3_2000_agp_device = { + .name = "3dfx Voodoo3 2000", + .internal_name = "voodoo3_2k_agp", + .flags = DEVICE_AGP, + .local = 0, + .init = v3_2000_agp_init, + .close = banshee_close, + .reset = NULL, + { .available = v3_2000_agp_available }, + .speed_changed = banshee_speed_changed, + .force_redraw = banshee_force_redraw, + banshee_sdram_config }; -const device_t voodoo_3_2000_agp_onboard_8m_device = -{ - "3dfx Voodoo3 2000 (On-Board 8MB SGRAM)", - "voodoo3_2k_agp_onboard_8m", - DEVICE_AGP, - 8, - v3_2000_agp_onboard_init, - banshee_close, - NULL, - { NULL }, - banshee_speed_changed, - banshee_force_redraw, - banshee_sdram_config +const device_t voodoo_3_2000_agp_onboard_8m_device = { + .name = "3dfx Voodoo3 2000 (On-Board 8MB SGRAM)", + .internal_name = "voodoo3_2k_agp_onboard_8m", + .flags = DEVICE_AGP, + .local = 8, + .init = v3_2000_agp_onboard_init, + .close = banshee_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = banshee_speed_changed, + .force_redraw = banshee_force_redraw, + banshee_sdram_config }; -const device_t voodoo_3_3000_device = -{ - "3dfx Voodoo3 3000", - "voodoo3_3k_pci", - DEVICE_PCI, - 0, - v3_3000_init, - banshee_close, - NULL, - { v3_3000_available }, - banshee_speed_changed, - banshee_force_redraw, - banshee_sdram_config +const device_t voodoo_3_3000_device = { + .name = "3dfx Voodoo3 3000", + .internal_name = "voodoo3_3k_pci", + .flags = DEVICE_PCI, + .local = 0, + .init = v3_3000_init, + .close = banshee_close, + .reset = NULL, + { .available = v3_3000_available }, + .speed_changed = banshee_speed_changed, + .force_redraw = banshee_force_redraw, + banshee_sdram_config }; -const device_t voodoo_3_3000_agp_device = -{ - "3dfx Voodoo3 3000", - "voodoo3_3k_agp", - DEVICE_AGP, - 0, - v3_3000_agp_init, - banshee_close, - NULL, - { v3_3000_agp_available }, - banshee_speed_changed, - banshee_force_redraw, - banshee_sdram_config +const device_t voodoo_3_3000_agp_device = { + .name = "3dfx Voodoo3 3000", + .internal_name = "voodoo3_3k_agp", + .flags = DEVICE_AGP, + .local = 0, + .init = v3_3000_agp_init, + .close = banshee_close, + .reset = NULL, + { .available = v3_3000_agp_available }, + .speed_changed = banshee_speed_changed, + .force_redraw = banshee_force_redraw, + banshee_sdram_config }; -const device_t velocity_100_agp_device = -{ - "3dfx Velocity 100", - "velocity100_agp", - DEVICE_AGP, - 0, - velocity_100_agp_init, - banshee_close, - NULL, - { velocity_100_available }, - banshee_speed_changed, - banshee_force_redraw, - banshee_sdram_config +const device_t velocity_100_agp_device = { + .name = "3dfx Velocity 100", + .internal_name = "velocity100_agp", + .flags = DEVICE_AGP, + .local = 0, + .init = velocity_100_agp_init, + .close = banshee_close, + .reset = NULL, + { .available = velocity_100_available }, + .speed_changed = banshee_speed_changed, + .force_redraw = banshee_force_redraw, + banshee_sdram_config }; diff --git a/src/video/vid_voodoo_banshee_blitter.c b/src/video/vid_voodoo_banshee_blitter.c index 4d8ba2518..4062acb3a 100644 --- a/src/video/vid_voodoo_banshee_blitter.c +++ b/src/video/vid_voodoo_banshee_blitter.c @@ -24,6 +24,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> diff --git a/src/video/vid_voodoo_blitter.c b/src/video/vid_voodoo_blitter.c index f60ed2c0b..94fb9dfa1 100644 --- a/src/video/vid_voodoo_blitter.c +++ b/src/video/vid_voodoo_blitter.c @@ -30,6 +30,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> diff --git a/src/video/vid_voodoo_display.c b/src/video/vid_voodoo_display.c index a52249bee..8e4e952d2 100644 --- a/src/video/vid_voodoo_display.c +++ b/src/video/vid_voodoo_display.c @@ -29,6 +29,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> diff --git a/src/video/vid_voodoo_fb.c b/src/video/vid_voodoo_fb.c index b9ccad399..3ab482bff 100644 --- a/src/video/vid_voodoo_fb.c +++ b/src/video/vid_voodoo_fb.c @@ -29,6 +29,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> diff --git a/src/video/vid_voodoo_fifo.c b/src/video/vid_voodoo_fifo.c index fcc87af11..013c21db3 100644 --- a/src/video/vid_voodoo_fifo.c +++ b/src/video/vid_voodoo_fifo.c @@ -29,6 +29,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> diff --git a/src/video/vid_voodoo_reg.c b/src/video/vid_voodoo_reg.c index 796f0aac7..797fa130f 100644 --- a/src/video/vid_voodoo_reg.c +++ b/src/video/vid_voodoo_reg.c @@ -29,6 +29,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> diff --git a/src/video/vid_voodoo_render.c b/src/video/vid_voodoo_render.c index 751c91d09..362f45abe 100644 --- a/src/video/vid_voodoo_render.c +++ b/src/video/vid_voodoo_render.c @@ -29,6 +29,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> diff --git a/src/video/vid_voodoo_setup.c b/src/video/vid_voodoo_setup.c index e8722608f..92a984c87 100644 --- a/src/video/vid_voodoo_setup.c +++ b/src/video/vid_voodoo_setup.c @@ -29,6 +29,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> diff --git a/src/video/vid_voodoo_texture.c b/src/video/vid_voodoo_texture.c index 80bf53d23..784ea17fe 100644 --- a/src/video/vid_voodoo_texture.c +++ b/src/video/vid_voodoo_texture.c @@ -29,6 +29,7 @@ #include <86box/timer.h> #include <86box/device.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> #include <86box/vid_voodoo_common.h> diff --git a/src/video/video.c b/src/video/video.c index a950369c4..f58b29c84 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -66,7 +66,9 @@ #include <86box/rom.h> #include <86box/config.h> #include <86box/timer.h> +#include <86box/path.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/vid_svga.h> @@ -404,12 +406,12 @@ video_screenshot(uint32_t *buf, int start_x, int start_y, int row_len) memset(fn, 0, sizeof(fn)); memset(path, 0, sizeof(path)); - plat_append_filename(path, usr_path, SCREENSHOT_PATH); + path_append_filename(path, usr_path, SCREENSHOT_PATH); if (! plat_dir_check(path)) plat_dir_create(path); - plat_path_slash(path); + path_slash(path); plat_tempfile(fn, NULL, ".png"); strcat(path, fn); diff --git a/src/win/86Box.manifest b/src/win/86Box.manifest index 045e12dbf..58f2d4194 100644 --- a/src/win/86Box.manifest +++ b/src/win/86Box.manifest @@ -43,7 +43,7 @@ - + diff --git a/src/win/CMakeLists.txt b/src/win/CMakeLists.txt index fc2e3314b..7452f82dc 100644 --- a/src/win/CMakeLists.txt +++ b/src/win/CMakeLists.txt @@ -16,7 +16,7 @@ enable_language(RC) add_library(plat OBJECT win.c win_dynld.c win_cdrom.c win_keyboard.c - win_crashdump.c win_mouse.c) + win_mouse.c) add_library(ui OBJECT win_ui.c win_icon.c win_stbar.c win_sdl.c win_dialog.c win_about.c win_settings.c win_devconf.c win_snd_gain.c win_specify_dim.c win_new_floppy.c diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 44f0807db..c9726d37f 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -37,9 +37,15 @@ ifeq ($(DEV_BUILD), y) ifndef AMD_K5 AMD_K5 := y endif + ifndef AN430TX + AN430TX := y + endif ifndef CYRIX_6X86 CYRIX_6X86 := y endif + ifndef DESKPRO386 + DESKPRO386 := y + endif ifndef GUSMAX GUSMAX := y endif @@ -58,8 +64,8 @@ ifeq ($(DEV_BUILD), y) ifndef MGA MGA := y endif - ifndef NO_SIO - NO_SIO := y + ifndef OLIVETTI + OLIVETTI := y endif ifndef OPEN_AT OPEN_AT := y @@ -70,21 +76,15 @@ ifeq ($(DEV_BUILD), y) ifndef SIO_DETECT SIO_DETECT := y endif - ifndef VGAWONDER - VGAWONDER := y - endif ifndef TANDY_ISA TANDY_ISA := y endif - ifndef VNC - VNC := y + ifndef VGAWONDER + VGAWONDER := y endif ifndef XL24 XL24 := y endif - ifndef OLIVETTI - OLIVETTI := y - endif ifndef NEW_KBC NEW_KBC := n endif @@ -98,9 +98,15 @@ else ifndef AMD_K5 AMD_K5 := n endif + ifndef AN430TX + AN430TX := n + endif ifndef CYRIX_6X86 CYRIX_6X86 := n endif + ifndef DESKPRO386 + DESKPRO386 := n + endif ifndef GUSMAX GUSMAX := n endif @@ -119,8 +125,8 @@ else ifndef MGA MGA := n endif - ifndef NO_SIO - NO_SIO := n + ifndef OLIVETTI + OLIVETTI := n endif ifndef OPEN_AT OPEN_AT := n @@ -131,21 +137,15 @@ else ifndef SIO_DETECT SIO_DETECT := n endif - ifndef VGAWONDER - VGAWONDER := n - endif ifndef TANDY_ISA TANDY_ISA := n endif - ifndef VNC - VNC := n + ifndef VGAWONDER + VGAWONDER := n endif ifndef XL24 XL24 := n endif - ifndef OLIVETTI - OLIVETTI := n - endif ifndef NEW_KBC NEW_KBC := n endif @@ -182,6 +182,9 @@ endif ifndef MUNT MUNT := y endif +ifndef VNC + VNC := n +endif ifndef NEW_DYNAREC NEW_DYNAREC := n endif @@ -427,10 +430,18 @@ ifeq ($(AMD_K5), y) OPTS += -DUSE_AMD_K5 endif +ifeq ($(AN430TX), y) +OPTS += -DUSE_AN430TX +endif + ifeq ($(CYRIX_6X86), y) OPTS += -DUSE_CYRIX_6X86 endif +ifeq ($(DESKPRO386), y) +OPTS += -DUSE_DESKPRO386 +endif + ifeq ($(GUSMAX), y) OPTS += -DUSE_GUSMAX endif @@ -457,10 +468,6 @@ OPTS += -DUSE_MGA DEVBROBJ += vid_mga.o endif -ifeq ($(NO_SIO), y) -OPTS += -DNO_SIO -endif - ifeq ($(OPEN_AT), y) OPTS += -DUSE_OPEN_AT endif @@ -720,7 +727,6 @@ VOODOOOBJ := vid_voodoo.o vid_voodoo_banshee.o \ PLATOBJ := win.o \ win_dynld.o \ win_cdrom.o win_keyboard.o \ - win_crashdump.o \ win_mouse.o UIOBJ := win_ui.o win_icon.o win_stbar.o discord.o \ diff --git a/src/win/win.c b/src/win/win.c index 06db20bad..cd938217e 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -47,8 +47,10 @@ #include <86box/video.h> #include <86box/mem.h> #include <86box/rom.h> +#include <86box/path.h> #define GLOBAL #include <86box/plat.h> +#include <86box/thread.h> #include <86box/ui.h> #ifdef USE_VNC # include <86box/vnc.h> @@ -493,10 +495,6 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow) return(1); } - /* Enable crash dump services. */ - if (enable_crashdump) - InitCrashDump(); - /* Create console window. */ if (force_debug) { CreateConsole(1); @@ -740,14 +738,14 @@ plat_remove(char *path) } void -plat_path_normalize(char* path) +path_normalize(char* path) { /* No-op */ } /* Make sure a path ends with a trailing (back)slash. */ void -plat_path_slash(char *path) +path_slash(char *path) { if ((path[strlen(path)-1] != '\\') && (path[strlen(path)-1] != '/')) { @@ -758,7 +756,7 @@ plat_path_slash(char *path) /* Check if the given path is absolute or not. */ int -plat_path_abs(char *path) +path_abs(char *path) { if ((path[1] == ':') || (path[0] == '\\') || (path[0] == '/')) return(1); @@ -785,7 +783,7 @@ plat_get_basename(const char *path) /* Return the 'directory' element of a pathname. */ void -plat_get_dirname(char *dest, const char *path) +path_get_dirname(char *dest, const char *path) { int c = (int)strlen(path); char *ptr; @@ -808,7 +806,7 @@ plat_get_dirname(char *dest, const char *path) char * -plat_get_filename(char *s) +path_get_filename(char *s) { int c = strlen(s) - 1; @@ -823,7 +821,7 @@ plat_get_filename(char *s) char * -plat_get_extension(char *s) +path_get_extension(char *s) { int c = strlen(s) - 1; @@ -841,10 +839,10 @@ plat_get_extension(char *s) void -plat_append_filename(char *dest, const char *s1, const char *s2) +path_append_filename(char *dest, const char *s1, const char *s2) { strcpy(dest, s1); - plat_path_slash(dest); + path_slash(dest); strcat(dest, s2); } @@ -917,22 +915,22 @@ plat_init_rom_paths() { wchar_t appdata_dir[1024] = { L'\0' }; - if (_wgetenv("LOCALAPPDATA") && _wgetenv("LOCALAPPDATA")[0] != L'\0') { + if (_wgetenv(L"LOCALAPPDATA") && _wgetenv(L"LOCALAPPDATA")[0] != L'\0') { char appdata_dir_a[1024] = { '\0' }; size_t len = 0; - wcsncpy(appdata_dir, _wgetenv("LOCALAPPDATA"), 1024); + wcsncpy(appdata_dir, _wgetenv(L"LOCALAPPDATA"), 1024); len = wcslen(appdata_dir); if (appdata_dir[len - 1] != L'\\') { appdata_dir[len] = L'\\'; appdata_dir[len + 1] = L'\0'; } - wcscat(appdata_dir, "86box"); + wcscat(appdata_dir, L"86box"); CreateDirectoryW(appdata_dir, NULL); - wcscat(appdata_dir, "\\roms"); + wcscat(appdata_dir, L"\\roms"); CreateDirectoryW(appdata_dir, NULL); - wcscat(appdata_dir, "\\"); + wcscat(appdata_dir, L"\\"); c16stombs(appdata_dir_a, appdata_dir, 1024); - add_rom_path(appdata_dir_a); + rom_add_path(appdata_dir_a); } } diff --git a/src/win/win_crashdump.c b/src/win/win_crashdump.c deleted file mode 100644 index 1da7a49b1..000000000 --- a/src/win/win_crashdump.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - * 86Box A hypervisor and IBM PC system emulator that specializes in - * running old operating systems and software designed for IBM - * PC systems and compatibles from 1981 through fairly recent - * system designs based on the PCI bus. - * - * This file is part of the 86Box distribution. - * - * Handle generation of crash-dump reports. - * - * - * - * Authors: Riley - * Miran Grca, - * Fred N. van Kempen, - * - * Copyright 2016,2017 Riley. - * Copyright 2016,2017 Miran Grca. - * Copyright 2017 Fred N. van Kempen. - */ -#define _WIN32_WINNT 0x0501 -#include -#include -#include -#include -#include -#include -#include <86box/86box.h> -#include <86box/plat.h> -#include <86box/win.h> - - -#define ExceptionHandlerBufferSize (10240) - - -static PVOID hExceptionHandler; -static char *ExceptionHandlerBuffer, - *CurrentBufferPointer; - - -LONG CALLBACK MakeCrashDump(PEXCEPTION_POINTERS ExceptionInfo) -{ - SYSTEMTIME SystemTime; - HANDLE hDumpFile; - char *BufPtr; - - /* - * Win32-specific functions will be used wherever possible, - * just in case the C stdlib-equivalents try to allocate - * memory. - * (The Win32-specific functions are generally just wrappers - * over NT system calls anyway.) - */ - if ((ExceptionInfo->ExceptionRecord->ExceptionCode >> 28) != 0xC) { - /* - * ExceptionCode is not a fatal exception (high 4b of - * ntstatus = 0xC) Not going to crash, let's not make - * a crash dump. - */ - return(EXCEPTION_CONTINUE_SEARCH); - } - - /* - * So, the program is about to crash. Oh no what do? - * Let's create a crash dump file as a debugging-aid. - * - * First, get the path to the executable. - */ - GetModuleFileName(NULL,ExceptionHandlerBuffer,ExceptionHandlerBufferSize); - if (GetLastError() != ERROR_SUCCESS) { - /* Could not get full path, create in current directory. */ - BufPtr = ExceptionHandlerBuffer; - } else { - /* - * Walk through the string backwards looking for the - * last backslash, so as to remove the "86Box.exe" - * filename from the string. - */ - BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)]; - for (; BufPtr > ExceptionHandlerBuffer; BufPtr--) { - if (BufPtr[0] == '\\') { - /* Found backslash, terminate the string after it. */ - BufPtr[1] = 0; - break; - } - } - - BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)]; - } - - /* - * What would a good filename be? - * - * It should contain the current date and time so as - * to be (hopefully!) unique. - */ - GetSystemTime(&SystemTime); - sprintf(CurrentBufferPointer, - "86box-%d%02d%02d-%02d-%02d-%02d-%03d.dmp", - SystemTime.wYear, - SystemTime.wMonth, - SystemTime.wDay, - SystemTime.wHour, - SystemTime.wMinute, - SystemTime.wSecond, - SystemTime.wMilliseconds); - - /* Now the filename is in the buffer, the file can be created. */ - hDumpFile = CreateFile( - ExceptionHandlerBuffer, // The filename of the file to open. - GENERIC_WRITE, // The permissions to request. - 0, // Make sure other processes can't - // touch the crash dump at all - // while it's open. - NULL, // Leave the security descriptor - // undefined, it doesn't matter. - OPEN_ALWAYS, // Opens the file if it exists, - // creates a new file if it doesn't. - FILE_ATTRIBUTE_NORMAL, // File attributes / etc don't matter. - NULL); // A template file is not being used. - - /* Check to make sure the file was actually created. */ - if (hDumpFile == INVALID_HANDLE_VALUE) { - /* CreateFile() failed, so just do nothing more. */ - return(EXCEPTION_CONTINUE_SEARCH); - } - - /* - * Write the data we were passed out in a human-readable format. - * - * Get the name of the module where the exception occurred. - */ - HMODULE hMods[1024]; - MODULEINFO modInfo; - HMODULE ipModule = 0; - DWORD cbNeeded; - - /* Try to get a list of all loaded modules. */ - if (EnumProcessModules(GetCurrentProcess(), - hMods, sizeof(hMods), &cbNeeded)) { - /* Got it, now walk through all modules.. */ - for (DWORD i = 0; i < (cbNeeded / sizeof(HMODULE)); i++) { - /* For each module, get the module information. */ - GetModuleInformation(GetCurrentProcess(), - hMods[i], &modInfo, sizeof(MODULEINFO)); - /* If the exception address is in the range of this module.. */ - if ( (ExceptionInfo->ExceptionRecord->ExceptionAddress >= modInfo.lpBaseOfDll) && - (ExceptionInfo->ExceptionRecord->ExceptionAddress < (void*)((char*)modInfo.lpBaseOfDll + modInfo.SizeOfImage))) { - /* ...this is the module we're looking for! */ - ipModule = hMods[i]; - break; - } - } - } - - /* Start to put the crash-dump string into the buffer. */ - sprintf(ExceptionHandlerBuffer, - "#\r\n# %s\r\n#\r\n" - "# Crash on %d-%02d-%02d at %02d:%02d:%02d.%03d\r\n#\r\n" - "\r\n" - "Exception details:\r\n" - " NTSTATUS code: 0x%08lx\r\n Address: 0x%p", - emu_version, - SystemTime.wYear, SystemTime.wMonth, SystemTime.wDay, - SystemTime.wHour, SystemTime.wMinute, SystemTime.wSecond, - SystemTime.wMilliseconds, - ExceptionInfo->ExceptionRecord->ExceptionCode, - (void *)ExceptionInfo->ExceptionRecord->ExceptionAddress); - - /* - * If we found the correct module, get the full path to - * the module the exception occured at and include it. - */ - BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)]; - if (ipModule != 0) { - sprintf(BufPtr," ["); - GetModuleFileName(ipModule, &BufPtr[2], - ExceptionHandlerBufferSize - strlen(ExceptionHandlerBuffer)); - if (GetLastError() == ERROR_SUCCESS) { - BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)]; - sprintf(BufPtr,"]"); - BufPtr += 1; - } - } - - sprintf(BufPtr, - "\r\nNumber of parameters: %lu\r\nException parameters: ", - ExceptionInfo->ExceptionRecord->NumberParameters); - - for (int i = 0; i < ExceptionInfo->ExceptionRecord->NumberParameters; i++) { - BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)]; - sprintf(BufPtr,"0x%p ", - (void *)ExceptionInfo->ExceptionRecord->ExceptionInformation[i]); - } - BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer) - 1]; - -#if defined(__i386__) && !defined(__x86_64) - PCONTEXT Registers = ExceptionInfo->ContextRecord; - - /* This binary is being compiled for x86, include a register dump. */ - sprintf(BufPtr, - "\r\n\r\nRegister dump:\r\n\r\n" - "EIP:0x%08lx\r\n" - "EAX:0x%08lx EBX:0x%08lx ECX:0x%08lx EDX:0x%08lx\r\n" - "EBP:0x%08lx ESP:0x%08lx ESI:0x%08lx EDI:0x%08lx\r\n\r\n", - Registers->Eip, - Registers->Eax, Registers->Ebx, Registers->Ecx, Registers->Edx, - Registers->Ebp, Registers->Esp, Registers->Esi, Registers->Edi); -#else - /* Register dump not supported by this architecture. */ - /* (MinGW headers seem to lack the x64 CONTEXT structure definition) */ - sprintf(BufPtr, "\r\n"); -#endif - - /* Write the string to disk. */ - WriteFile(hDumpFile, ExceptionHandlerBuffer, - strlen(ExceptionHandlerBuffer), NULL, NULL); - - /* Close the file. */ - CloseHandle(hDumpFile); - - /* Return, therefore causing the crash. */ - return(EXCEPTION_CONTINUE_SEARCH); -} - - -void -InitCrashDump(void) -{ - /* - * An exception handler should not allocate memory, - * so allocate 10kb for it to use if it gets called, - * an amount which should be more than enough. - */ - ExceptionHandlerBuffer = malloc(ExceptionHandlerBufferSize); - CurrentBufferPointer = ExceptionHandlerBuffer; - - /* - * Register the exception handler. - * Zero first argument means this exception handler gets - * called last, therefore, crash dump is only made, when - * a crash is going to happen. - */ - hExceptionHandler = AddVectoredExceptionHandler(0, MakeCrashDump); -} diff --git a/src/win/win_devconf.c b/src/win/win_devconf.c index 42197ff33..804762af6 100644 --- a/src/win/win_devconf.c +++ b/src/win/win_devconf.c @@ -45,7 +45,10 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) { HWND h; - int val_int, id, c, d, num; + int val_int, id, c, d; +#ifdef USE_RTMIDI + int num; +#endif int changed, cid; const device_config_t *config; const device_config_selection_t *selection; @@ -81,7 +84,7 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) (char *) config->name, config->default_int); c = 0; - while (selection->description && selection->description[0]) { + while (selection && selection->description && selection->description[0]) { mbstowcs(lptsTemp, selection->description, strlen(selection->description) + 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lptsTemp); @@ -146,7 +149,7 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) (char *) config->name, config->default_int); c = 0; - while (selection->description && selection->description[0]) { + while (selection && selection->description && selection->description[0]) { mbstowcs(lptsTemp, selection->description, strlen(selection->description) + 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lptsTemp); @@ -163,7 +166,7 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) (char *) config->name, config->default_int); c = 0; - while (selection->description && selection->description[0]) { + while (selection && selection->description && selection->description[0]) { mbstowcs(lptsTemp, selection->description, strlen(selection->description) + 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lptsTemp); @@ -391,6 +394,8 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) id++; break; case CONFIG_SELECTION: + case CONFIG_HEX16: + case CONFIG_HEX20: case CONFIG_MIDI_OUT: case CONFIG_MIDI_IN: case CONFIG_SPINNER: diff --git a/src/win/win_icon.c b/src/win/win_icon.c index e118276f1..c11125ecd 100644 --- a/src/win/win_icon.c +++ b/src/win/win_icon.c @@ -23,6 +23,7 @@ #include #include <86box/86box.h> #include <86box/config.h> +#include <86box/path.h> #include <86box/plat.h> #include <86box/ui.h> #include <86box/win.h> @@ -116,10 +117,10 @@ void win_get_icons_path(char* path_root) if (rom_path[0]) strcpy(roms_root, rom_path); else - plat_append_filename(roms_root, exe_path, "roms"); + path_append_filename(roms_root, exe_path, "roms"); - plat_append_filename(path_root, roms_root, "icons"); - plat_path_slash(path_root); + path_append_filename(path_root, roms_root, "icons"); + path_slash(path_root); } void win_load_icon_set() @@ -137,13 +138,13 @@ void win_load_icon_set() win_get_icons_path(path_root); strcat(path_root, icon_set); - plat_path_slash(path_root); + path_slash(path_root); int i, count = sizeof(icon_files) / sizeof(_ICON_DATA), x = win_get_system_metrics(SM_CXSMICON, dpi), y = win_get_system_metrics(SM_CYSMICON, dpi); for (i = 0; i < count; i++) { - plat_append_filename(temp, path_root, icon_files[i].filename); + path_append_filename(temp, path_root, icon_files[i].filename); mbstoc16s(wtemp, temp, strlen(temp) + 1); HICON ictemp; diff --git a/src/win/win_opengl.c b/src/win/win_opengl.c index 5670fafa2..b1dab78ca 100644 --- a/src/win/win_opengl.c +++ b/src/win/win_opengl.c @@ -54,6 +54,7 @@ typedef LONG atomic_flag; #include <86box/86box.h> #include <86box/plat.h> +#include <86box/thread.h> #include <86box/video.h> #include <86box/win.h> #include <86box/language.h> diff --git a/src/win/win_thread.c b/src/win/win_thread.c index 2bb8a6cf5..1ad0fc469 100644 --- a/src/win/win_thread.c +++ b/src/win/win_thread.c @@ -29,6 +29,7 @@ #include #include <86box/86box.h> #include <86box/plat.h> +#include <86box/thread.h> typedef struct { diff --git a/vcpkg.json b/vcpkg.json index 920dc07e6..495ac2eac 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "86box", - "version-string": "3.3", + "version-string": "3.4", "homepage": "https://86box.net/", "documentation": "http://86box.readthedocs.io/", "license": "GPL-2.0-or-later",