diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 8542e317d..26ee36593 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -103,9 +103,9 @@ def gitClone(repository, branch) { if (env.GIT_STASHED != 'true' || env.NODE_NAME != 'debian.citadel') { /* Catch network issues in clone. */ try { - /* Perform clone/checkout, making sure to update the changelog only once - to avoid inaccurate entries from new commits pushed inbetween clones. */ - def scmVars = checkout(poll: true, + /* Perform clone/checkout, making sure to set poll and changelog only + once to avoid interference from new commits pushed inbetween clones. */ + def scmVars = checkout(poll: env.GIT_STASHED != 'true', changelog: env.GIT_STASHED != 'true', scm: [$class: 'GitSCM', branches: [[name: branch]], diff --git a/CMakeLists.txt b/CMakeLists.txt index 561e1eeda..542d446cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ if(MUNT_EXTERNAL) endif() project(86Box - VERSION 3.6 + VERSION 3.7.1 DESCRIPTION "Emulator of x86-based systems" HOMEPAGE_URL "https://86box.net" LANGUAGES C CXX) diff --git a/bumpversion.sh b/bumpversion.sh index 7fb0e96eb..31ebf154b 100644 --- a/bumpversion.sh +++ b/bumpversion.sh @@ -17,10 +17,9 @@ # Parse arguments. newversion="$1" -romversion="$2" if [ -z "$(echo "$newversion" | grep '\.')" ] then - echo '[!] Usage: bumpversion.sh x.y[.z] [romversion]' + echo '[!] Usage: bumpversion.sh x.y[.z]' exit 1 fi shift @@ -32,13 +31,6 @@ newversion_patch=$(echo "$newversion" | cut -d. -f3) [ -z "$newversion_patch" ] && newversion_patch=0 -if [ -z "${romversion}" ]; then - # Get the latest ROM release from the GitHub API. - romversion=$(curl --silent "https://api.github.com/repos/86Box/roms/releases/latest" | - grep '"tag_name":' | - sed -E 's/.*"([^"]+)".*/\1/') -fi - # Switch to the repository root directory. cd "$(dirname "$0")" || exit @@ -69,7 +61,6 @@ patch_file src/include_make/*/version.h EMU_VERSION_PATCH 's/(#\s*define\s+EMU_V patch_file src/include_make/*/version.h COPYRIGHT_YEAR 's/(#\s*define\s+COPYRIGHT_YEAR\s+)[0-9]+/\1'"$(date +%Y)"'/' patch_file src/include_make/*/version.h EMU_DOCS_URL 's/(#\s*define\s+EMU_DOCS_URL\s+"https:\/\/[^\/]+\/en\/v)[^\/]+/\1'"$newversion_maj.$newversion_min"'/' patch_file src/unix/assets/*.spec Version 's/(Version:\s+)[0-9].+/\1'"$newversion"'/' -patch_file src/unix/assets/*.spec '%global romver' 's/(^%global\ romver\s+)[0-9]{8}/\1'"$romversion"'/' patch_file src/unix/assets/*.spec 'changelog version' 's/(^[*]\s.*>\s+)[0-9].+/\1'"$newversion"-1'/' patch_file src/unix/assets/*.spec 'changelog date' 's/(^[*]\s)[a-zA-Z]{3}\s[a-zA-Z]{3}\s[0-9]{2}\s[0-9]{4}/\1'"$(pretty_date)"'/' patch_file src/unix/assets/*.metainfo.xml release 's/( #include <86box/cdrom_image.h> #include <86box/plat.h> +#include <86box/scsi.h> #include <86box/scsi_device.h> #include <86box/sound.h> diff --git a/src/config.c b/src/config.c index 8d488936e..2a2f58c6c 100644 --- a/src/config.c +++ b/src/config.c @@ -72,6 +72,9 @@ #include <86box/snd_opl.h> +static int cx, cy, cw, ch; + + typedef struct _list_ { struct _list_ *next; } list_t; @@ -611,9 +614,45 @@ load_general(void) enable_discord = !!config_get_int(cat, "enable_discord", 0); + open_dir_usr_path = config_get_int(cat, "open_dir_usr_path", 0); + video_framerate = config_get_int(cat, "video_gl_framerate", -1); video_vsync = config_get_int(cat, "video_gl_vsync", 0); strncpy(video_shader, config_get_string(cat, "video_gl_shader", ""), sizeof(video_shader)); + + window_remember = config_get_int(cat, "window_remember", 0); + if (window_remember) { + p = config_get_string(cat, "window_coordinates", NULL); + if (p == NULL) + p = "0, 0, 0, 0"; + sscanf(p, "%i, %i, %i, %i", &cw, &ch, &cx, &cy); + } else { + cw = ch = cx = cy = 0; + config_delete_var(cat, "window_remember"); + } + + config_delete_var(cat, "window_coordinates"); +} + +/* Load monitor section. */ +static void +load_monitor(int monitor_index) +{ + char cat[512], temp[512]; + char *p = NULL; + + sprintf(cat, "Monitor #%i", monitor_index + 1); + sprintf(temp, "%i, %i, %i, %i", cx, cy, cw, ch); + + p = config_get_string(cat, "window_coordinates", NULL); + + if (p == NULL) + p = temp; + + if (window_remember) + sscanf(p, "%i, %i, %i, %i", + &monitor_settings[monitor_index].mon_window_x, &monitor_settings[monitor_index].mon_window_y, + &monitor_settings[monitor_index].mon_window_w, &monitor_settings[monitor_index].mon_window_h); } /* Load "Machine" section. */ @@ -936,47 +975,6 @@ load_video(void) gfxcard_2 = video_get_video_from_internal_name(p); } -static void -load_monitor(int monitor_index) -{ - char monitor_config_name[sizeof("Monitor #") + 12] = { [0] = 0 }; - char *ptr = NULL; - - if (monitor_index == 0) { - /* Migrate configs */ - ptr = config_get_string("General", "window_coordinates", NULL); - - config_delete_var("General", "window_coordinates"); - } - snprintf(monitor_config_name, sizeof(monitor_config_name), "Monitor #%i", monitor_index + 1); - if (!ptr) - ptr = config_get_string(monitor_config_name, "window_coordinates", "0, 0, 0, 0"); - if (window_remember || (vid_resize & 2)) - sscanf(ptr, "%i, %i, %i, %i", - &monitor_settings[monitor_index].mon_window_x, &monitor_settings[monitor_index].mon_window_y, - &monitor_settings[monitor_index].mon_window_w, &monitor_settings[monitor_index].mon_window_h); -} - -static void -save_monitor(int monitor_index) -{ - char monitor_config_name[sizeof("Monitor #") + 12] = { [0] = 0 }; - char saved_coordinates[12 * 4 + 8 + 1] = { [0] = 0 }; - - snprintf(monitor_config_name, sizeof(monitor_config_name), "Monitor #%i", monitor_index + 1); - if (!(monitor_settings[monitor_index].mon_window_x == 0 - && monitor_settings[monitor_index].mon_window_y == 0 - && monitor_settings[monitor_index].mon_window_w == 0 - && monitor_settings[monitor_index].mon_window_h == 0) - && (window_remember || (vid_resize & 2))) { - snprintf(saved_coordinates, sizeof(saved_coordinates), "%i, %i, %i, %i", monitor_settings[monitor_index].mon_window_x, monitor_settings[monitor_index].mon_window_y, - monitor_settings[monitor_index].mon_window_w, monitor_settings[monitor_index].mon_window_h); - - config_set_string(monitor_config_name, "window_coordinates", saved_coordinates); - } else - config_delete_var(monitor_config_name, "window_coordinates"); -} - /* Load "Input Devices" section. */ static void load_input_devices(void) @@ -2380,6 +2378,11 @@ save_general(void) else config_delete_var(cat, "enable_discord"); + if (open_dir_usr_path) + config_set_int(cat, "open_dir_usr_path", open_dir_usr_path); + else + config_delete_var(cat, "open_dir_usr_path"); + if (video_framerate != -1) config_set_int(cat, "video_gl_framerate", video_framerate); else @@ -2396,6 +2399,24 @@ save_general(void) delete_section_if_empty(cat); } +/* Save monitor section. */ +static void +save_monitor(int monitor_index) +{ + char cat[sizeof("Monitor #") + 12] = { [0] = 0 }; + char temp[512]; + + snprintf(cat, sizeof(cat), "Monitor #%i", monitor_index + 1); + if (window_remember) { + sprintf(temp, "%i, %i, %i, %i", + monitor_settings[monitor_index].mon_window_x, monitor_settings[monitor_index].mon_window_y, + monitor_settings[monitor_index].mon_window_w, monitor_settings[monitor_index].mon_window_h); + + config_set_string(cat, "window_coordinates", temp); + } else + config_delete_var(cat, "window_coordinates"); +} + /* Save "Machine" section. */ static void save_machine(void) @@ -2767,7 +2788,7 @@ save_storage_controllers(void) delete_section_if_empty(cat); - if (cassette_enable == 1) + if (cassette_enable == 0) config_delete_var(cat, "cassette_enabled"); else config_set_int(cat, "cassette_enabled", cassette_enable); diff --git a/src/cpu/386_common.c b/src/cpu/386_common.c index 6c09e588a..92360a248 100644 --- a/src/cpu/386_common.c +++ b/src/cpu/386_common.c @@ -1481,10 +1481,16 @@ checkio(uint32_t port) } +#ifdef OLD_DIVEXCP #define divexcp() { \ x386_common_log("Divide exception at %04X(%06X):%04X\n",CS,cs,cpu_state.pc); \ x86_int(0); \ } +#else +#define divexcp() { \ + x86de(NULL, 0); \ +} +#endif int diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 46b9faf5c..e08178a9b 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -382,10 +382,10 @@ cpu_set(void) is_am486 = (cpu_s->cpu_type == CPU_ENH_Am486DX); is_am486dxl = (cpu_s->cpu_type == CPU_Am486DXL); - is6117 = !strcmp(cpu_f->manufacturer, "ALi"); + is6117 = !strcmp(cpu_f->manufacturer, "ALi"); - cpu_isintel = !strcmp(cpu_f->manufacturer, "Intel"); - cpu_iscyrix = !strcmp(cpu_f->manufacturer, "Cyrix") || !strcmp(cpu_f->manufacturer, "ST"); + cpu_isintel = !strcmp(cpu_f->manufacturer, "Intel"); + cpu_iscyrix = !strcmp(cpu_f->manufacturer, "Cyrix") || !strcmp(cpu_f->manufacturer, "ST"); /* SL-Enhanced Intel 486s have the same SMM save state table layout as Pentiums, and the WinChip datasheet claims those are Pentium-compatible as well. AMD Am486DXL/DXL2 also has compatible SMM, or would if not for it's different SMBase*/ @@ -398,6 +398,8 @@ cpu_set(void) is_cxsmm = (!strcmp(cpu_f->manufacturer, "Cyrix") || !strcmp(cpu_f->manufacturer, "ST")) && (cpu_s->cpu_type >= CPU_Cx486S); + cpu_isintel = cpu_isintel || !strcmp(cpu_f->manufacturer, "AMD"); + hasfpu = (fpu_type != FPU_NONE); hascache = (cpu_s->cpu_type >= CPU_486SLC) || (cpu_s->cpu_type == CPU_IBM386SLC) || (cpu_s->cpu_type == CPU_IBM486SLC) || (cpu_s->cpu_type == CPU_IBM486BL); diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index d866acdf6..ba0bfd390 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -675,6 +675,7 @@ extern void hardresetx86(void); extern void x86_int(int num); extern void x86_int_sw(int num); extern int x86_int_sw_rm(int num); +extern void x86de(char *s, uint16_t error); extern void x86gpf(char *s, uint16_t error); extern void x86np(char *s, uint16_t error); extern void x86ss(char *s, uint16_t error); diff --git a/src/cpu/x86.h b/src/cpu/x86.h index b9726dc57..32a3317ea 100644 --- a/src/cpu/x86.h +++ b/src/cpu/x86.h @@ -1,4 +1,4 @@ -#define ABRT_MASK 0x7f +#define ABRT_MASK 0x3f /*An 'expected' exception is one that would be expected to occur on every execution of this code path; eg a GPF due to being in v86 mode. An 'unexpected' exception is one that would be unlikely to occur on the next exception, eg a page fault may be @@ -71,7 +71,8 @@ enum ABRT_NP = 0xB, ABRT_SS = 0xC, ABRT_GPF = 0xD, - ABRT_PF = 0xE + ABRT_PF = 0xE, + ABRT_DE = 0x40 /* INT 0, but we have to distinguish it from ABRT_NONE. */ }; diff --git a/src/cpu/x86_ops_bcd.h b/src/cpu/x86_ops_bcd.h index 385d63cd7..b37b6a6df 100644 --- a/src/cpu/x86_ops_bcd.h +++ b/src/cpu/x86_ops_bcd.h @@ -31,7 +31,14 @@ static int opAAD(uint32_t fetchdat) static int opAAM(uint32_t fetchdat) { int base = getbytef(); - if (!base || !cpu_isintel) base = 10; + + if (base == 0) { + x86de(NULL, 0); + return 1; + } + + if (!cpu_isintel) base = 10; + AH = AL / base; AL %= base; setznp16(AX); diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index e103f0247..c9398dd69 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -165,6 +165,14 @@ x86_doabrt(int x86_abrt) } +void +x86de(char *s, uint16_t error) +{ + cpu_state.abrt = ABRT_DE; + abrt_error = error; +} + + void x86gpf(char *s, uint16_t error) { diff --git a/src/device.c b/src/device.c index 331305f2d..c69acaad0 100644 --- a/src/device.c +++ b/src/device.c @@ -331,17 +331,14 @@ device_get_priv(const device_t *d) int device_available(const device_t *d) { - device_config_t *config; - device_config_bios_t *bios; + device_config_t *config = NULL; + device_config_bios_t *bios = NULL; int bf, roms_present = 0; int i = 0; -#ifdef RELEASE_BUILD - if (d->flags & DEVICE_NOT_WORKING) return(0); -#endif if (d != NULL) { config = (device_config_t *) d->config; - if (config != NULL) { + if (config != NULL) { while (config->type != -1) { if (config->type == CONFIG_BIOS) { bios = (device_config_bios_t *) config->bios; @@ -362,9 +359,9 @@ device_available(const device_t *d) } } - /* No CONFIG_BIOS field present, use the classic available(). */ + /* No CONFIG_BIOS field present, use the classic available(). */ if (d->available != NULL) - return(d->available()); + return(d->available()); else return(1); } diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index 8bb436a0c..5d38088ed 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -1438,7 +1438,7 @@ write64_ami(void *priv, uint8_t val) case 0xa6: /* read clock */ if ((dev->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_NOREF) { kbd_log("ATkbc: AMI - read clock\n"); - add_data(dev, !!(dev->ami_stat & 1)); + add_to_kbc_queue_front(dev, (dev->ami_stat & 1) ? 0xff : 0x00, 0, 0x00); return 0; } break; @@ -1462,7 +1462,7 @@ write64_ami(void *priv, uint8_t val) case 0xa9: /* read cache */ if ((dev->flags & KBC_TYPE_MASK) < KBC_TYPE_PS2_NOREF) { kbd_log("ATkbc: AMI - read cache\n"); - add_data(dev, !!(dev->ami_stat & 2)); + add_to_kbc_queue_front(dev, (dev->ami_stat & 2) ? 0xff : 0x00, 0, 0x00); return 0; } break; @@ -1535,7 +1535,7 @@ write64_ami(void *priv, uint8_t val) * (allow command D1 to change bits 2/3 of the output port) */ kbd_log("ATkbc: AMI - unblock KBC lines P22 and P23\n"); - dev->output_locked = 1; + dev->ami_flags &= 0xfb; return 0; case 0xc9: @@ -1544,7 +1544,7 @@ write64_ami(void *priv, uint8_t val) * (disallow command D1 from changing bits 2/3 of the port) */ kbd_log("ATkbc: AMI - block KBC lines P22 and P23\n"); - dev->output_locked = 1; + dev->ami_flags |= 0x04; return 0; case 0xcc: @@ -1796,7 +1796,9 @@ kbd_write(uint16_t port, uint8_t val, void *priv) case 0xd1: /* write output port */ kbd_log("ATkbc: write output port\n"); - if (dev->output_locked) { + /* Bit 2 of AMI flags is P22-P23 blocked (1 = yes, 0 = no), + discovered by reverse-engineering the AOpeN Vi15G BIOS. */ + if (dev->ami_flags & 0x04) { /*If keyboard controller lines P22-P23 are blocked, we force them to remain unchanged.*/ val &= ~0x0c; @@ -2259,6 +2261,7 @@ kbd_reset(void *priv) set_scancode_map(dev); dev->ami_flags = ((dev->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_NOREF) ? 0x01 : 0x00; + dev->ami_stat |= 0x02; } diff --git a/src/disk/hdc_esdi_mca.c b/src/disk/hdc_esdi_mca.c index e0859697f..72db74359 100644 --- a/src/disk/hdc_esdi_mca.c +++ b/src/disk/hdc_esdi_mca.c @@ -60,12 +60,14 @@ * Copyright 2008-2018 Sarah Walker. * Copyright 2017,2018 Fred N. van Kempen. */ + #include #include #include #include #include #include +#include #define HAVE_STDARG_H #include <86box/86box.h> #include <86box/device.h> @@ -80,19 +82,16 @@ #include <86box/hdc.h> #include <86box/hdd.h> - /* These are hardwired. */ -#define ESDI_IOADDR_PRI 0x3510 -#define ESDI_IOADDR_SEC 0x3518 -#define ESDI_IRQCHAN 14 +#define ESDI_IOADDR_PRI 0x3510 +#define ESDI_IOADDR_SEC 0x3518 +#define ESDI_IRQCHAN 14 -#define BIOS_FILE_L "roms/hdd/esdi/90x8969.bin" -#define BIOS_FILE_H "roms/hdd/esdi/90x8970.bin" - - -#define ESDI_TIME 512 -#define CMD_ADAPTER 0 +#define BIOS_FILE_L "roms/hdd/esdi/90x8969.bin" +#define BIOS_FILE_H "roms/hdd/esdi/90x8970.bin" +#define ESDI_TIME 512.0 +#define CMD_ADAPTER 0 typedef struct esdi_drive_t { int spt, hpc; @@ -103,128 +102,123 @@ typedef struct esdi_drive_t { } drive_t; typedef struct esdi_t { - int8_t dma; + int8_t dma; - uint32_t bios; - rom_t bios_rom; + uint32_t bios; + rom_t bios_rom; - uint8_t basic_ctrl; - uint8_t status; - uint8_t irq_status; - int irq_in_progress; - int cmd_req_in_progress; - int cmd_pos; - uint16_t cmd_data[4]; - int cmd_dev; + uint8_t basic_ctrl; + uint8_t status; + uint8_t irq_status; + int irq_in_progress; + int cmd_req_in_progress; + int cmd_pos; + uint16_t cmd_data[4]; + int cmd_dev; - int status_pos, - status_len; + int status_pos, + status_len; - uint16_t status_data[256]; + uint16_t status_data[256]; - int data_pos; - uint16_t data[256]; + int data_pos; + uint16_t data[256]; - uint16_t sector_buffer[256][256]; + uint16_t sector_buffer[256][256]; - int sector_pos; - int sector_count; + int sector_pos; + int sector_count; - int command; - int cmd_state; + int command; + int cmd_state; - int in_reset; - uint64_t callback; - pc_timer_t timer; + int in_reset; + pc_timer_t timer; - uint32_t rba; + uint32_t rba; struct { int req_in_progress; - } cmds[3]; + } cmds[3]; - drive_t drives[2]; + drive_t drives[2]; - uint8_t pos_regs[8]; + uint8_t pos_regs[8]; } esdi_t; -#define STATUS_DMA_ENA (1 << 7) -#define STATUS_IRQ_PENDING (1 << 6) -#define STATUS_CMD_IN_PROGRESS (1 << 5) -#define STATUS_BUSY (1 << 4) -#define STATUS_STATUS_OUT_FULL (1 << 3) -#define STATUS_CMD_IR_FULL (1 << 2) -#define STATUS_TRANSFER_REQ (1 << 1) -#define STATUS_IRQ (1 << 0) +#define STATUS_DMA_ENA (1 << 7) +#define STATUS_IRQ_PENDING (1 << 6) +#define STATUS_CMD_IN_PROGRESS (1 << 5) +#define STATUS_BUSY (1 << 4) +#define STATUS_STATUS_OUT_FULL (1 << 3) +#define STATUS_CMD_IR_FULL (1 << 2) +#define STATUS_TRANSFER_REQ (1 << 1) +#define STATUS_IRQ (1 << 0) -#define CTRL_RESET (1 << 7) -#define CTRL_DMA_ENA (1 << 1) -#define CTRL_IRQ_ENA (1 << 0) +#define CTRL_RESET (1 << 7) +#define CTRL_DMA_ENA (1 << 1) +#define CTRL_IRQ_ENA (1 << 0) -#define IRQ_HOST_ADAPTER (7 << 5) -#define IRQ_DEVICE_0 (0 << 5) -#define IRQ_CMD_COMPLETE_SUCCESS 0x1 -#define IRQ_RESET_COMPLETE 0xa -#define IRQ_DATA_TRANSFER_READY 0xb -#define IRQ_CMD_COMPLETE_FAILURE 0xc +#define IRQ_HOST_ADAPTER (7 << 5) +#define IRQ_DEVICE_0 (0 << 5) +#define IRQ_CMD_COMPLETE_SUCCESS 0x1 +#define IRQ_RESET_COMPLETE 0xa +#define IRQ_DATA_TRANSFER_READY 0xb +#define IRQ_CMD_COMPLETE_FAILURE 0xc -#define ATTN_DEVICE_SEL (7 << 5) -#define ATTN_HOST_ADAPTER (7 << 5) -#define ATTN_DEVICE_0 (0 << 5) -#define ATTN_DEVICE_1 (1 << 5) -#define ATTN_REQ_MASK 0x0f -#define ATTN_CMD_REQ 1 -#define ATTN_EOI 2 -#define ATTN_RESET 4 +#define ATTN_DEVICE_SEL (7 << 5) +#define ATTN_HOST_ADAPTER (7 << 5) +#define ATTN_DEVICE_0 (0 << 5) +#define ATTN_DEVICE_1 (1 << 5) +#define ATTN_REQ_MASK 0x0f +#define ATTN_CMD_REQ 1 +#define ATTN_EOI 2 +#define ATTN_RESET 4 -#define CMD_SIZE_4 (1 << 14) +#define CMD_SIZE_4 (1 << 14) -#define CMD_DEVICE_SEL (7 << 5) -#define CMD_MASK 0x1f -#define CMD_READ 0x01 -#define CMD_WRITE 0x02 -#define CMD_READ_VERIFY 0x03 -#define CMD_WRITE_VERIFY 0x04 -#define CMD_SEEK 0x05 -#define CMD_GET_DEV_STATUS 0x08 -#define CMD_GET_DEV_CONFIG 0x09 -#define CMD_GET_POS_INFO 0x0a -#define CMD_FORMAT_UNIT 0x16 -#define CMD_FORMAT_PREPARE 0x17 +#define CMD_DEVICE_SEL (7 << 5) +#define CMD_MASK 0x1f +#define CMD_READ 0x01 +#define CMD_WRITE 0x02 +#define CMD_READ_VERIFY 0x03 +#define CMD_WRITE_VERIFY 0x04 +#define CMD_SEEK 0x05 +#define CMD_GET_DEV_STATUS 0x08 +#define CMD_GET_DEV_CONFIG 0x09 +#define CMD_GET_POS_INFO 0x0a +#define CMD_FORMAT_UNIT 0x16 +#define CMD_FORMAT_PREPARE 0x17 -#define STATUS_LEN(x) ((x) << 8) -#define STATUS_DEVICE(x) ((x) << 5) +#define STATUS_LEN(x) ((x) << 8) +#define STATUS_DEVICE(x) ((x) << 5) #define STATUS_DEVICE_HOST_ADAPTER (7 << 5) - #ifdef ENABLE_ESDI_MCA_LOG int esdi_mca_do_log = ENABLE_ESDI_MCA_LOG; - static void esdi_mca_log(const char *fmt, ...) { va_list ap; if (esdi_mca_do_log) { - va_start(ap, fmt); - pclog_ex(fmt, ap); - va_end(ap); + va_start(ap, fmt); + pclog_ex(fmt, ap); + va_end(ap); } } #else -#define esdi_mca_log(fmt, ...) +# define esdi_mca_log(fmt, ...) #endif - static __inline void set_irq(esdi_t *dev) { if (dev->basic_ctrl & CTRL_IRQ_ENA) - picint(1 << 14); + picint(1 << 14); } - static __inline void clear_irq(esdi_t *dev) { @@ -232,26 +226,30 @@ clear_irq(esdi_t *dev) } static void -esdi_mca_set_callback(esdi_t *dev, uint64_t callback) +esdi_mca_set_callback(esdi_t *dev, double callback) { if (!dev) { - return; + return; } if (callback) { - dev->callback = callback; - timer_on_auto(&dev->timer, dev->callback); - } else { - dev->callback = 0; - timer_stop(&dev->timer); - } + timer_on_auto(&dev->timer, callback); + } else { + timer_stop(&dev->timer); + } } +static double +esdi_mca_get_xfer_time(esdi_t *esdi, int size) +{ + /* 390.625 us per sector at 10 Mbit/s = 1280 kB/s. */ + return (3125.0 / 8.0) * (double)size; +} static void cmd_unsupported(esdi_t *dev) { - dev->status_len = 9; + dev->status_len = 9; dev->status_data[0] = dev->command | STATUS_LEN(9) | dev->cmd_dev; dev->status_data[1] = 0x0f03; /*Attention error, command not supported*/ dev->status_data[2] = 0x0002; /*Interface fault*/ @@ -262,17 +260,17 @@ cmd_unsupported(esdi_t *dev) dev->status_data[7] = 0; dev->status_data[8] = 0; - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_FAILURE; + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_FAILURE; dev->irq_in_progress = 1; set_irq(dev); + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); } - static void device_not_present(esdi_t *dev) { - dev->status_len = 9; + dev->status_len = 9; dev->status_data[0] = dev->command | STATUS_LEN(9) | dev->cmd_dev; dev->status_data[1] = 0x0c11; /*Command failed, internal hardware error*/ dev->status_data[2] = 0x000b; /*Selection error*/ @@ -283,17 +281,17 @@ device_not_present(esdi_t *dev) dev->status_data[7] = 0; dev->status_data[8] = 0; - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_FAILURE; + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_FAILURE; dev->irq_in_progress = 1; set_irq(dev); + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); } - static void rba_out_of_range(esdi_t *dev) { - dev->status_len = 9; + dev->status_len = 9; dev->status_data[0] = dev->command | STATUS_LEN(9) | dev->cmd_dev; dev->status_data[1] = 0x0e01; /*Command block error, invalid parameter*/ dev->status_data[2] = 0x0007; /*RBA out of range*/ @@ -304,834 +302,863 @@ rba_out_of_range(esdi_t *dev) dev->status_data[7] = 0; dev->status_data[8] = 0; - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_FAILURE; + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_FAILURE; dev->irq_in_progress = 1; set_irq(dev); + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); } - static void complete_command_status(esdi_t *dev) { dev->status_len = 7; if (dev->cmd_dev == ATTN_DEVICE_0) - dev->status_data[0] = CMD_READ | STATUS_LEN(7) | STATUS_DEVICE(0); + dev->status_data[0] = CMD_READ | STATUS_LEN(7) | STATUS_DEVICE(0); else - dev->status_data[0] = CMD_READ | STATUS_LEN(7) | STATUS_DEVICE(1); - dev->status_data[1] = 0x0000; /*Error bits*/ - dev->status_data[2] = 0x1900; /*Device status*/ - dev->status_data[3] = 0; /*Number of blocks left to do*/ - dev->status_data[4] = (dev->rba-1) & 0xffff; /*Last RBA processed*/ - dev->status_data[5] = (dev->rba-1) >> 8; + dev->status_data[0] = CMD_READ | STATUS_LEN(7) | STATUS_DEVICE(1); + dev->status_data[1] = 0x0000; /*Error bits*/ + dev->status_data[2] = 0x1900; /*Device status*/ + dev->status_data[3] = 0; /*Number of blocks left to do*/ + dev->status_data[4] = (dev->rba - 1) & 0xffff; /*Last RBA processed*/ + dev->status_data[5] = (dev->rba - 1) >> 8; dev->status_data[6] = 0; /*Number of blocks requiring error recovery*/ + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); } -#define ESDI_ADAPTER_ONLY() do \ - { \ - if (dev->cmd_dev != ATTN_HOST_ADAPTER) \ - { \ - cmd_unsupported(dev); \ - return; \ - } \ - } while (0) - -#define ESDI_DRIVE_ONLY() do \ - { \ - if (dev->cmd_dev != ATTN_DEVICE_0 && dev->cmd_dev != ATTN_DEVICE_1) \ - { \ - cmd_unsupported(dev); \ - return; \ - } \ - if (dev->cmd_dev == ATTN_DEVICE_0) \ - drive = &dev->drives[0]; \ - else \ - drive = &dev->drives[1]; \ - } while (0) +#define ESDI_ADAPTER_ONLY() \ + do { \ + if (dev->cmd_dev != ATTN_HOST_ADAPTER) { \ + cmd_unsupported(dev); \ + return; \ + } \ + } while (0) +#define ESDI_DRIVE_ONLY() \ + do { \ + if (dev->cmd_dev != ATTN_DEVICE_0 && dev->cmd_dev != ATTN_DEVICE_1) { \ + cmd_unsupported(dev); \ + return; \ + } \ + if (dev->cmd_dev == ATTN_DEVICE_0) \ + drive = &dev->drives[0]; \ + else \ + drive = &dev->drives[1]; \ + } while (0) static void esdi_callback(void *priv) { - esdi_t *dev = (esdi_t *)priv; + esdi_t *dev = (esdi_t *) priv; drive_t *drive; - int val; + int val; + double cmd_time = 0.0; esdi_mca_set_callback(dev, 0); /* If we are returning from a RESET, handle this first. */ if (dev->in_reset) { - dev->in_reset = 0; - dev->status = STATUS_IRQ; - dev->irq_status = IRQ_HOST_ADAPTER | IRQ_RESET_COMPLETE; + dev->in_reset = 0; + dev->status = STATUS_IRQ; + dev->irq_status = IRQ_HOST_ADAPTER | IRQ_RESET_COMPLETE; - return; + return; } switch (dev->command) { - case CMD_READ: - ESDI_DRIVE_ONLY(); + case CMD_READ: + ESDI_DRIVE_ONLY(); - if (! drive->present) { - device_not_present(dev); + if (!drive->present) { + device_not_present(dev); + return; + } + + switch (dev->cmd_state) { + case 0: + dev->rba = (dev->cmd_data[2] | (dev->cmd_data[3] << 16)) & 0x0fffffff; + + dev->sector_pos = 0; + dev->sector_count = dev->cmd_data[1]; + + if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) { + rba_out_of_range(dev); return; - } + } - switch (dev->cmd_state) { - case 0: - dev->rba = (dev->cmd_data[2] | (dev->cmd_data[3] << 16)) & 0x0fffffff; + dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; + dev->irq_status = dev->cmd_dev | IRQ_DATA_TRANSFER_READY; + dev->irq_in_progress = 1; + set_irq(dev); - dev->sector_pos = 0; - dev->sector_count = dev->cmd_data[1]; + dev->cmd_state = 1; + esdi_mca_set_callback(dev, ESDI_TIME); + dev->data_pos = 0; + break; - if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) { - rba_out_of_range(dev); - return; - } - - dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; - dev->irq_status = dev->cmd_dev | IRQ_DATA_TRANSFER_READY; - dev->irq_in_progress = 1; - set_irq(dev); - - dev->cmd_state = 1; - esdi_mca_set_callback(dev, ESDI_TIME); - dev->data_pos = 0; - break; - - case 1: - if (!(dev->basic_ctrl & CTRL_DMA_ENA)) { - esdi_mca_set_callback(dev, ESDI_TIME); - return; - } - - while (dev->sector_pos < dev->sector_count) { - if (! dev->data_pos) { - if (dev->rba >= drive->sectors) - fatal("Read past end of drive\n"); - hdd_image_read(drive->hdd_num, dev->rba, 1, (uint8_t *)dev->data); - ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 1); - } - - while (dev->data_pos < 256) { - val = dma_channel_write(dev->dma, dev->data[dev->data_pos]); - - if (val == DMA_NODATA) { - esdi_mca_set_callback(dev, ESDI_TIME); - return; - } - - dev->data_pos++; - } - - dev->data_pos = 0; - dev->sector_pos++; - dev->rba++; - } - - dev->status = STATUS_CMD_IN_PROGRESS; - dev->cmd_state = 2; - esdi_mca_set_callback(dev, ESDI_TIME); - break; - - case 2: - complete_command_status(dev); - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - } - break; - - case CMD_WRITE: - case CMD_WRITE_VERIFY: - ESDI_DRIVE_ONLY(); - if (! drive->present) { - device_not_present(dev); + case 1: + if (!(dev->basic_ctrl & CTRL_DMA_ENA)) { + esdi_mca_set_callback(dev, ESDI_TIME); return; - } + } - switch (dev->cmd_state) { - case 0: - dev->rba = (dev->cmd_data[2] | (dev->cmd_data[3] << 16)) & 0x0fffffff; + while (dev->sector_pos < dev->sector_count) { + if (!dev->data_pos) { + if (dev->rba >= drive->sectors) + fatal("Read past end of drive\n"); + hdd_image_read(drive->hdd_num, dev->rba, 1, (uint8_t *) dev->data); + cmd_time += hdd_timing_read(&hdd[drive->hdd_num], dev->rba, 1); + cmd_time += esdi_mca_get_xfer_time(dev, 1); + } - dev->sector_pos = 0; - dev->sector_count = dev->cmd_data[1]; + while (dev->data_pos < 256) { + val = dma_channel_write(dev->dma, dev->data[dev->data_pos]); - if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) { - rba_out_of_range(dev); - return; - } - - dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; - dev->irq_status = dev->cmd_dev | IRQ_DATA_TRANSFER_READY; - dev->irq_in_progress = 1; - set_irq(dev); - - dev->cmd_state = 1; - esdi_mca_set_callback(dev, ESDI_TIME); - dev->data_pos = 0; - break; - - case 1: - if (! (dev->basic_ctrl & CTRL_DMA_ENA)) { - esdi_mca_set_callback(dev, ESDI_TIME); - return; - } - - while (dev->sector_pos < dev->sector_count) { - while (dev->data_pos < 256) { - val = dma_channel_read(dev->dma); - - if (val == DMA_NODATA) { - esdi_mca_set_callback(dev, ESDI_TIME); - return; - } - - dev->data[dev->data_pos++] = val & 0xffff; - } - - if (dev->rba >= drive->sectors) - fatal("Write past end of drive\n"); - hdd_image_write(drive->hdd_num, dev->rba, 1, (uint8_t *)dev->data); - dev->rba++; - dev->sector_pos++; - ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, - dev->cmd_dev == ATTN_DEVICE_0 ? 0 : 1); - - dev->data_pos = 0; - } - - dev->status = STATUS_CMD_IN_PROGRESS; - dev->cmd_state = 2; - esdi_mca_set_callback(dev, ESDI_TIME); - break; - - case 2: - complete_command_status(dev); - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - } - break; - - case CMD_READ_VERIFY: - ESDI_DRIVE_ONLY(); - - if (! drive->present) { - device_not_present(dev); - return; - } - - if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) { - rba_out_of_range(dev); - return; - } - - dev->rba += dev->sector_count; - complete_command_status(dev); - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - - case CMD_SEEK: - ESDI_DRIVE_ONLY(); - - if (! drive->present) { - device_not_present(dev); - return; - } - - complete_command_status(dev); - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - - case CMD_GET_DEV_STATUS: - ESDI_DRIVE_ONLY(); - - if (! drive->present) { - device_not_present(dev); - return; - } - - if ((dev->status & STATUS_IRQ) || dev->irq_in_progress) - fatal("IRQ in progress %02x %i\n", dev->status, dev->irq_in_progress); - - dev->status_len = 9; - dev->status_data[0] = CMD_GET_DEV_STATUS | STATUS_LEN(9) | STATUS_DEVICE_HOST_ADAPTER; - dev->status_data[1] = 0x0000; /*Error bits*/ - dev->status_data[2] = 0x1900; /*Device status*/ - dev->status_data[3] = 0; /*ESDI Standard Status*/ - dev->status_data[4] = 0; /*ESDI Vendor Unique Status*/ - dev->status_data[5] = 0; - dev->status_data[6] = 0; - dev->status_data[7] = 0; - dev->status_data[8] = 0; - - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - - case CMD_GET_DEV_CONFIG: - ESDI_DRIVE_ONLY(); - - if (! drive->present) { - device_not_present(dev); - return; - } - - if ((dev->status & STATUS_IRQ) || dev->irq_in_progress) - fatal("IRQ in progress %02x %i\n", dev->status, dev->irq_in_progress); - - dev->status_len = 6; - dev->status_data[0] = CMD_GET_DEV_CONFIG | STATUS_LEN(6) | STATUS_DEVICE_HOST_ADAPTER; - dev->status_data[1] = 0x10; /*Zero defect*/ - dev->status_data[2] = drive->sectors & 0xffff; - dev->status_data[3] = drive->sectors >> 16; - dev->status_data[4] = drive->tracks; - dev->status_data[5] = drive->hpc | (drive->spt << 16); - - esdi_mca_log("CMD_GET_DEV_CONFIG %i %04x %04x %04x %04x %04x %04x\n", - drive->sectors, - dev->status_data[0], dev->status_data[1], - dev->status_data[2], dev->status_data[3], - dev->status_data[4], dev->status_data[5]); - - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - - case CMD_GET_POS_INFO: - ESDI_ADAPTER_ONLY(); - - if ((dev->status & STATUS_IRQ) || dev->irq_in_progress) - fatal("IRQ in progress %02x %i\n", dev->status, dev->irq_in_progress); - - dev->status_len = 5; - dev->status_data[0] = CMD_GET_POS_INFO | STATUS_LEN(5) | STATUS_DEVICE_HOST_ADAPTER; - dev->status_data[1] = 0xffdd; /*MCA ID*/ - dev->status_data[2] = dev->pos_regs[3] | - (dev->pos_regs[2] << 8); - dev->status_data[3] = 0xff; - dev->status_data[4] = 0xff; - - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = IRQ_HOST_ADAPTER | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - - case 0x10: - ESDI_ADAPTER_ONLY(); - switch (dev->cmd_state) { - case 0: - dev->sector_pos = 0; - dev->sector_count = dev->cmd_data[1]; - if (dev->sector_count > 256) - fatal("Write sector buffer count %04x\n", dev->cmd_data[1]); - - dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; - dev->irq_status = IRQ_HOST_ADAPTER | IRQ_DATA_TRANSFER_READY; - dev->irq_in_progress = 1; - set_irq(dev); - - dev->cmd_state = 1; - esdi_mca_set_callback(dev, ESDI_TIME); - dev->data_pos = 0; - break; - - case 1: - if (! (dev->basic_ctrl & CTRL_DMA_ENA)) { - esdi_mca_set_callback(dev, ESDI_TIME); - return; - } - while (dev->sector_pos < dev->sector_count) { - while (dev->data_pos < 256) { - val = dma_channel_read(dev->dma); - - if (val == DMA_NODATA) { - esdi_mca_set_callback(dev, ESDI_TIME); - return; - } - - dev->data[dev->data_pos++] = val & 0xffff;; - } - - memcpy(dev->sector_buffer[dev->sector_pos++], dev->data, 512); - dev->data_pos = 0; - } - - dev->status = STATUS_CMD_IN_PROGRESS; - dev->cmd_state = 2; - esdi_mca_set_callback(dev, ESDI_TIME); - break; - - case 2: - dev->status = STATUS_IRQ; - dev->irq_status = IRQ_HOST_ADAPTER | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - } - break; - - case 0x11: - ESDI_ADAPTER_ONLY(); - switch (dev->cmd_state) { - case 0: - dev->sector_pos = 0; - dev->sector_count = dev->cmd_data[1]; - if (dev->sector_count > 256) - fatal("Read sector buffer count %04x\n", dev->cmd_data[1]); - - dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; - dev->irq_status = IRQ_HOST_ADAPTER | IRQ_DATA_TRANSFER_READY; - dev->irq_in_progress = 1; - set_irq(dev); - - dev->cmd_state = 1; - esdi_mca_set_callback(dev, ESDI_TIME); - dev->data_pos = 0; - break; - - case 1: - if (! (dev->basic_ctrl & CTRL_DMA_ENA)) { - esdi_mca_set_callback(dev, ESDI_TIME); - return; - } - - while (dev->sector_pos < dev->sector_count) { - if (! dev->data_pos) - memcpy(dev->data, dev->sector_buffer[dev->sector_pos++], 512); - while (dev->data_pos < 256) { - val = dma_channel_write(dev->dma, dev->data[dev->data_pos]); - - if (val == DMA_NODATA) { - esdi_mca_set_callback(dev, ESDI_TIME); - return; - } - - dev->data_pos++; - } - - dev->data_pos = 0; - } - - dev->status = STATUS_CMD_IN_PROGRESS; - dev->cmd_state = 2; - esdi_mca_set_callback(dev, ESDI_TIME); - break; - - case 2: - dev->status = STATUS_IRQ; - dev->irq_status = IRQ_HOST_ADAPTER | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - } - break; - - case 0x12: - ESDI_ADAPTER_ONLY(); - if ((dev->status & STATUS_IRQ) || dev->irq_in_progress) - fatal("IRQ in progress %02x %i\n", dev->status, dev->irq_in_progress); - - dev->status_len = 2; - dev->status_data[0] = 0x12 | STATUS_LEN(5) | STATUS_DEVICE_HOST_ADAPTER; - dev->status_data[1] = 0; - - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = IRQ_HOST_ADAPTER | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - - case CMD_FORMAT_UNIT: - case CMD_FORMAT_PREPARE: - ESDI_DRIVE_ONLY(); - - if (! drive->present) { - device_not_present(dev); - return; - } - - switch (dev->cmd_state) { - case 0: - dev->rba = (dev->cmd_data[2] | (dev->cmd_data[3] << 16)) & 0x0fffffff; - - dev->sector_count = dev->cmd_data[1]; - - if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) { - rba_out_of_range(dev); - return; + if (val == DMA_NODATA) { + esdi_mca_set_callback(dev, ESDI_TIME + cmd_time); + return; } - dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; - dev->irq_status = dev->cmd_dev | IRQ_DATA_TRANSFER_READY; - dev->irq_in_progress = 1; - set_irq(dev); + dev->data_pos++; + } - dev->cmd_state = 1; - esdi_mca_set_callback(dev, ESDI_TIME); - break; + dev->data_pos = 0; + dev->sector_pos++; + dev->rba++; + } - case 1: - if (!(dev->basic_ctrl & CTRL_DMA_ENA)) { - esdi_mca_set_callback(dev, ESDI_TIME); - return; + dev->status = STATUS_CMD_IN_PROGRESS; + dev->cmd_state = 2; + esdi_mca_set_callback(dev, cmd_time); + break; + + case 2: + complete_command_status(dev); + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + break; + } + break; + + case CMD_WRITE: + case CMD_WRITE_VERIFY: + ESDI_DRIVE_ONLY(); + if (!drive->present) { + device_not_present(dev); + return; + } + + switch (dev->cmd_state) { + case 0: + dev->rba = (dev->cmd_data[2] | (dev->cmd_data[3] << 16)) & 0x0fffffff; + + dev->sector_pos = 0; + dev->sector_count = dev->cmd_data[1]; + + if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) { + rba_out_of_range(dev); + return; + } + + dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; + dev->irq_status = dev->cmd_dev | IRQ_DATA_TRANSFER_READY; + dev->irq_in_progress = 1; + set_irq(dev); + + dev->cmd_state = 1; + esdi_mca_set_callback(dev, ESDI_TIME); + dev->data_pos = 0; + break; + + case 1: + if (!(dev->basic_ctrl & CTRL_DMA_ENA)) { + esdi_mca_set_callback(dev, ESDI_TIME); + return; + } + + while (dev->sector_pos < dev->sector_count) { + while (dev->data_pos < 256) { + val = dma_channel_read(dev->dma); + + if (val == DMA_NODATA) { + esdi_mca_set_callback(dev, ESDI_TIME + cmd_time); + return; } - hdd_image_zero(drive->hdd_num, dev->rba, dev->sector_count); - ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 1); + dev->data[dev->data_pos++] = val & 0xffff; + } - dev->status = STATUS_CMD_IN_PROGRESS; - dev->cmd_state = 2; - esdi_mca_set_callback(dev, ESDI_TIME); - break; + if (dev->rba >= drive->sectors) + fatal("Write past end of drive\n"); + hdd_image_write(drive->hdd_num, dev->rba, 1, (uint8_t *) dev->data); + cmd_time += hdd_timing_write(&hdd[drive->hdd_num], dev->rba, 1); + cmd_time += esdi_mca_get_xfer_time(dev, 1); + dev->rba++; + dev->sector_pos++; + dev->data_pos = 0; + } - case 2: - complete_command_status(dev); - dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; - dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; - dev->irq_in_progress = 1; - set_irq(dev); - break; - } - break; + dev->status = STATUS_CMD_IN_PROGRESS; + dev->cmd_state = 2; + esdi_mca_set_callback(dev, cmd_time); + break; - default: - fatal("BAD COMMAND %02x %i\n", dev->command, dev->cmd_dev); + case 2: + complete_command_status(dev); + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + break; + } + break; + + case CMD_READ_VERIFY: + ESDI_DRIVE_ONLY(); + + if (!drive->present) { + device_not_present(dev); + return; + } + + switch (dev->cmd_state) { + case 0: + dev->rba = (dev->cmd_data[2] | (dev->cmd_data[3] << 16)) & 0x0fffffff; + dev->sector_count = dev->cmd_data[1]; + + if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) { + rba_out_of_range(dev); + return; + } + + cmd_time = hdd_timing_read(&hdd[drive->hdd_num], dev->rba, dev->sector_count); + esdi_mca_set_callback(dev, ESDI_TIME + cmd_time); + dev->cmd_state = 1; + break; + + case 1: + complete_command_status(dev); + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + break; + } + break; + + case CMD_SEEK: + ESDI_DRIVE_ONLY(); + + if (!drive->present) { + device_not_present(dev); + return; + } + + if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) { + rba_out_of_range(dev); + return; + } + + switch (dev->cmd_state) { + case 0: + dev->rba = (dev->cmd_data[2] | (dev->cmd_data[3] << 16)) & 0x0fffffff; + cmd_time = hdd_seek_get_time(&hdd[drive->hdd_num], dev->rba, HDD_OP_SEEK, 0, 0.0); + esdi_mca_set_callback(dev, ESDI_TIME + cmd_time); + dev->cmd_state = 1; + break; + + case 1: + complete_command_status(dev); + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + break; + } + break; + + case CMD_GET_DEV_STATUS: + ESDI_DRIVE_ONLY(); + + if (!drive->present) { + device_not_present(dev); + return; + } + + if ((dev->status & STATUS_IRQ) || dev->irq_in_progress) + fatal("IRQ in progress %02x %i\n", dev->status, dev->irq_in_progress); + + dev->status_len = 9; + dev->status_data[0] = CMD_GET_DEV_STATUS | STATUS_LEN(9) | STATUS_DEVICE_HOST_ADAPTER; + dev->status_data[1] = 0x0000; /*Error bits*/ + dev->status_data[2] = 0x1900; /*Device status*/ + dev->status_data[3] = 0; /*ESDI Standard Status*/ + dev->status_data[4] = 0; /*ESDI Vendor Unique Status*/ + dev->status_data[5] = 0; + dev->status_data[6] = 0; + dev->status_data[7] = 0; + dev->status_data[8] = 0; + + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); + break; + + case CMD_GET_DEV_CONFIG: + ESDI_DRIVE_ONLY(); + + if (!drive->present) { + device_not_present(dev); + return; + } + + if ((dev->status & STATUS_IRQ) || dev->irq_in_progress) + fatal("IRQ in progress %02x %i\n", dev->status, dev->irq_in_progress); + + dev->status_len = 6; + dev->status_data[0] = CMD_GET_DEV_CONFIG | STATUS_LEN(6) | STATUS_DEVICE_HOST_ADAPTER; + dev->status_data[1] = 0x10; /*Zero defect*/ + dev->status_data[2] = drive->sectors & 0xffff; + dev->status_data[3] = drive->sectors >> 16; + dev->status_data[4] = drive->tracks; + dev->status_data[5] = drive->hpc | (drive->spt << 16); + + esdi_mca_log("CMD_GET_DEV_CONFIG %i %04x %04x %04x %04x %04x %04x\n", + drive->sectors, + dev->status_data[0], dev->status_data[1], + dev->status_data[2], dev->status_data[3], + dev->status_data[4], dev->status_data[5]); + + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); + break; + + case CMD_GET_POS_INFO: + ESDI_ADAPTER_ONLY(); + + if ((dev->status & STATUS_IRQ) || dev->irq_in_progress) + fatal("IRQ in progress %02x %i\n", dev->status, dev->irq_in_progress); + + dev->status_len = 5; + dev->status_data[0] = CMD_GET_POS_INFO | STATUS_LEN(5) | STATUS_DEVICE_HOST_ADAPTER; + dev->status_data[1] = 0xffdd; /*MCA ID*/ + dev->status_data[2] = dev->pos_regs[3] | (dev->pos_regs[2] << 8); + dev->status_data[3] = 0xff; + dev->status_data[4] = 0xff; + + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = IRQ_HOST_ADAPTER | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); + break; + + case 0x10: + ESDI_ADAPTER_ONLY(); + switch (dev->cmd_state) { + case 0: + dev->sector_pos = 0; + dev->sector_count = dev->cmd_data[1]; + if (dev->sector_count > 256) + fatal("Write sector buffer count %04x\n", dev->cmd_data[1]); + + dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; + dev->irq_status = IRQ_HOST_ADAPTER | IRQ_DATA_TRANSFER_READY; + dev->irq_in_progress = 1; + set_irq(dev); + + dev->cmd_state = 1; + esdi_mca_set_callback(dev, ESDI_TIME); + dev->data_pos = 0; + break; + + case 1: + if (!(dev->basic_ctrl & CTRL_DMA_ENA)) { + esdi_mca_set_callback(dev, ESDI_TIME); + return; + } + while (dev->sector_pos < dev->sector_count) { + while (dev->data_pos < 256) { + val = dma_channel_read(dev->dma); + + if (val == DMA_NODATA) { + esdi_mca_set_callback(dev, ESDI_TIME); + return; + } + + dev->data[dev->data_pos++] = val & 0xffff; + ; + } + + memcpy(dev->sector_buffer[dev->sector_pos++], dev->data, 512); + dev->data_pos = 0; + } + + dev->status = STATUS_CMD_IN_PROGRESS; + dev->cmd_state = 2; + esdi_mca_set_callback(dev, ESDI_TIME); + break; + + case 2: + dev->status = STATUS_IRQ; + dev->irq_status = IRQ_HOST_ADAPTER | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); + break; + } + break; + + case 0x11: + ESDI_ADAPTER_ONLY(); + switch (dev->cmd_state) { + case 0: + dev->sector_pos = 0; + dev->sector_count = dev->cmd_data[1]; + if (dev->sector_count > 256) + fatal("Read sector buffer count %04x\n", dev->cmd_data[1]); + + dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; + dev->irq_status = IRQ_HOST_ADAPTER | IRQ_DATA_TRANSFER_READY; + dev->irq_in_progress = 1; + set_irq(dev); + + dev->cmd_state = 1; + esdi_mca_set_callback(dev, ESDI_TIME); + dev->data_pos = 0; + break; + + case 1: + if (!(dev->basic_ctrl & CTRL_DMA_ENA)) { + esdi_mca_set_callback(dev, ESDI_TIME); + return; + } + + while (dev->sector_pos < dev->sector_count) { + if (!dev->data_pos) + memcpy(dev->data, dev->sector_buffer[dev->sector_pos++], 512); + while (dev->data_pos < 256) { + val = dma_channel_write(dev->dma, dev->data[dev->data_pos]); + + if (val == DMA_NODATA) { + esdi_mca_set_callback(dev, ESDI_TIME); + return; + } + + dev->data_pos++; + } + + dev->data_pos = 0; + } + + dev->status = STATUS_CMD_IN_PROGRESS; + dev->cmd_state = 2; + esdi_mca_set_callback(dev, ESDI_TIME); + break; + + case 2: + dev->status = STATUS_IRQ; + dev->irq_status = IRQ_HOST_ADAPTER | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); + break; + } + break; + + case 0x12: + ESDI_ADAPTER_ONLY(); + if ((dev->status & STATUS_IRQ) || dev->irq_in_progress) + fatal("IRQ in progress %02x %i\n", dev->status, dev->irq_in_progress); + + dev->status_len = 2; + dev->status_data[0] = 0x12 | STATUS_LEN(5) | STATUS_DEVICE_HOST_ADAPTER; + dev->status_data[1] = 0; + + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = IRQ_HOST_ADAPTER | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 0); + break; + + case CMD_FORMAT_UNIT: + case CMD_FORMAT_PREPARE: + ESDI_DRIVE_ONLY(); + + if (!drive->present) { + device_not_present(dev); + return; + } + + switch (dev->cmd_state) { + case 0: + dev->rba = (dev->cmd_data[2] | (dev->cmd_data[3] << 16)) & 0x0fffffff; + + dev->sector_count = dev->cmd_data[1]; + + if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) { + rba_out_of_range(dev); + return; + } + + dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ; + dev->irq_status = dev->cmd_dev | IRQ_DATA_TRANSFER_READY; + dev->irq_in_progress = 1; + set_irq(dev); + + dev->cmd_state = 1; + esdi_mca_set_callback(dev, ESDI_TIME); + break; + + case 1: + if (!(dev->basic_ctrl & CTRL_DMA_ENA)) { + esdi_mca_set_callback(dev, ESDI_TIME); + return; + } + + hdd_image_zero(drive->hdd_num, dev->rba, dev->sector_count); + + dev->status = STATUS_CMD_IN_PROGRESS; + dev->cmd_state = 2; + esdi_mca_set_callback(dev, ESDI_TIME); + break; + + case 2: + complete_command_status(dev); + dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL; + dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS; + dev->irq_in_progress = 1; + set_irq(dev); + break; + } + break; + + default: + fatal("BAD COMMAND %02x %i\n", dev->command, dev->cmd_dev); } } - static uint8_t esdi_read(uint16_t port, void *priv) { - esdi_t *dev = (esdi_t *)priv; + esdi_t *dev = (esdi_t *) priv; uint8_t ret = 0xff; switch (port & 7) { - case 2: /*Basic status register*/ - ret = dev->status; - break; + case 2: /*Basic status register*/ + ret = dev->status; + break; - case 3: /*IRQ status*/ - dev->status &= ~STATUS_IRQ; - ret = dev->irq_status; - break; + case 3: /*IRQ status*/ + dev->status &= ~STATUS_IRQ; + ret = dev->irq_status; + break; - default: - fatal("esdi_read port=%04x\n", port); + default: + fatal("esdi_read port=%04x\n", port); } - return(ret); + return (ret); } - static void esdi_write(uint16_t port, uint8_t val, void *priv) { - esdi_t *dev = (esdi_t *)priv; + esdi_t *dev = (esdi_t *) priv; esdi_mca_log("ESDI: wr(%04x, %02x)\n", port & 7, val); switch (port & 7) { - case 2: /*Basic control register*/ - if ((dev->basic_ctrl & CTRL_RESET) && !(val & CTRL_RESET)) { - dev->in_reset = 1; - esdi_mca_set_callback(dev, ESDI_TIME * 50); - dev->status = STATUS_BUSY; - } - dev->basic_ctrl = val; + case 2: /*Basic control register*/ + if ((dev->basic_ctrl & CTRL_RESET) && !(val & CTRL_RESET)) { + dev->in_reset = 1; + esdi_mca_set_callback(dev, ESDI_TIME * 50); + dev->status = STATUS_BUSY; + } + dev->basic_ctrl = val; - if (! (dev->basic_ctrl & CTRL_IRQ_ENA)) - picintc(1 << 14); - break; + if (!(dev->basic_ctrl & CTRL_IRQ_ENA)) + picintc(1 << 14); + break; - case 3: /*Attention register*/ - switch (val & ATTN_DEVICE_SEL) { - case ATTN_HOST_ADAPTER: - switch (val & ATTN_REQ_MASK) { - case ATTN_CMD_REQ: - if (dev->cmd_req_in_progress) - fatal("Try to start command on in_progress adapter\n"); - dev->cmd_req_in_progress = 1; - dev->cmd_dev = ATTN_HOST_ADAPTER; - dev->status |= STATUS_BUSY; - dev->cmd_pos = 0; - dev->status_pos = 0; - break; + case 3: /*Attention register*/ + switch (val & ATTN_DEVICE_SEL) { + case ATTN_HOST_ADAPTER: + switch (val & ATTN_REQ_MASK) { + case ATTN_CMD_REQ: + if (dev->cmd_req_in_progress) + fatal("Try to start command on in_progress adapter\n"); + dev->cmd_req_in_progress = 1; + dev->cmd_dev = ATTN_HOST_ADAPTER; + dev->status |= STATUS_BUSY; + dev->cmd_pos = 0; + dev->status_pos = 0; + break; - case ATTN_EOI: - dev->irq_in_progress = 0; - dev->status &= ~STATUS_IRQ; - clear_irq(dev); - break; + case ATTN_EOI: + dev->irq_in_progress = 0; + dev->status &= ~STATUS_IRQ; + clear_irq(dev); + break; - case ATTN_RESET: - dev->in_reset = 1; - esdi_mca_set_callback(dev, ESDI_TIME * 50); - dev->status = STATUS_BUSY; - break; + case ATTN_RESET: + dev->in_reset = 1; + esdi_mca_set_callback(dev, ESDI_TIME * 50); + dev->status = STATUS_BUSY; + break; - default: - fatal("Bad attention request %02x\n", val); - } - break; + default: + fatal("Bad attention request %02x\n", val); + } + break; - case ATTN_DEVICE_0: - switch (val & ATTN_REQ_MASK) { - case ATTN_CMD_REQ: - if (dev->cmd_req_in_progress) - fatal("Try to start command on in_progress device0\n"); - dev->cmd_req_in_progress = 1; - dev->cmd_dev = ATTN_DEVICE_0; - dev->status |= STATUS_BUSY; - dev->cmd_pos = 0; - dev->status_pos = 0; - break; + case ATTN_DEVICE_0: + switch (val & ATTN_REQ_MASK) { + case ATTN_CMD_REQ: + if (dev->cmd_req_in_progress) + fatal("Try to start command on in_progress device0\n"); + dev->cmd_req_in_progress = 1; + dev->cmd_dev = ATTN_DEVICE_0; + dev->status |= STATUS_BUSY; + dev->cmd_pos = 0; + dev->status_pos = 0; + break; - case ATTN_EOI: - dev->irq_in_progress = 0; - dev->status &= ~STATUS_IRQ; - clear_irq(dev); - break; + case ATTN_EOI: + dev->irq_in_progress = 0; + dev->status &= ~STATUS_IRQ; + clear_irq(dev); + break; - default: - fatal("Bad attention request %02x\n", val); - } - break; + default: + fatal("Bad attention request %02x\n", val); + } + break; - case ATTN_DEVICE_1: - switch (val & ATTN_REQ_MASK) { - case ATTN_CMD_REQ: - if (dev->cmd_req_in_progress) - fatal("Try to start command on in_progress device0\n"); - dev->cmd_req_in_progress = 1; - dev->cmd_dev = ATTN_DEVICE_1; - dev->status |= STATUS_BUSY; - dev->cmd_pos = 0; - dev->status_pos = 0; - break; + case ATTN_DEVICE_1: + switch (val & ATTN_REQ_MASK) { + case ATTN_CMD_REQ: + if (dev->cmd_req_in_progress) + fatal("Try to start command on in_progress device0\n"); + dev->cmd_req_in_progress = 1; + dev->cmd_dev = ATTN_DEVICE_1; + dev->status |= STATUS_BUSY; + dev->cmd_pos = 0; + dev->status_pos = 0; + break; - case ATTN_EOI: - dev->irq_in_progress = 0; - dev->status &= ~STATUS_IRQ; - clear_irq(dev); - break; + case ATTN_EOI: + dev->irq_in_progress = 0; + dev->status &= ~STATUS_IRQ; + clear_irq(dev); + break; - default: - fatal("Bad attention request %02x\n", val); - } - break; + default: + fatal("Bad attention request %02x\n", val); + } + break; - default: - fatal("Attention to unknown device %02x\n", val); - } - break; + default: + fatal("Attention to unknown device %02x\n", val); + } + break; - default: - fatal("esdi_write port=%04x val=%02x\n", port, val); + default: + fatal("esdi_write port=%04x val=%02x\n", port, val); } } - static uint16_t esdi_readw(uint16_t port, void *priv) { - esdi_t *dev = (esdi_t *)priv; + esdi_t *dev = (esdi_t *) priv; uint16_t ret = 0xffff; switch (port & 7) { - case 0: /*Status Interface Register*/ - if (dev->status_pos >= dev->status_len) - return(0); - ret = dev->status_data[dev->status_pos++]; if (dev->status_pos >= dev->status_len) { - dev->status &= ~STATUS_STATUS_OUT_FULL; - dev->status_pos = dev->status_len = 0; - } - break; + case 0: /*Status Interface Register*/ + if (dev->status_pos >= dev->status_len) + return (0); + ret = dev->status_data[dev->status_pos++]; + if (dev->status_pos >= dev->status_len) { + dev->status &= ~STATUS_STATUS_OUT_FULL; + dev->status_pos = dev->status_len = 0; + } + break; - default: - fatal("esdi_readw port=%04x\n", port); + default: + fatal("esdi_readw port=%04x\n", port); } - return(ret); + return (ret); } - static void esdi_writew(uint16_t port, uint16_t val, void *priv) { - esdi_t *dev = (esdi_t *)priv; + esdi_t *dev = (esdi_t *) priv; esdi_mca_log("ESDI: wrw(%04x, %04x)\n", port & 7, val); switch (port & 7) { - case 0: /*Command Interface Register*/ - if (dev->cmd_pos >= 4) - fatal("CIR pos 4\n"); - dev->cmd_data[dev->cmd_pos++] = val; - if (((dev->cmd_data[0] & CMD_SIZE_4) && dev->cmd_pos == 4) || - (!(dev->cmd_data[0] & CMD_SIZE_4) && dev->cmd_pos == 2)) { - dev->cmd_pos = 0; - dev->cmd_req_in_progress = 0; - dev->cmd_state = 0; + case 0: /*Command Interface Register*/ + if (dev->cmd_pos >= 4) + fatal("CIR pos 4\n"); + dev->cmd_data[dev->cmd_pos++] = val; + if (((dev->cmd_data[0] & CMD_SIZE_4) && dev->cmd_pos == 4) || (!(dev->cmd_data[0] & CMD_SIZE_4) && dev->cmd_pos == 2)) { + dev->cmd_pos = 0; + dev->cmd_req_in_progress = 0; + dev->cmd_state = 0; - if ((dev->cmd_data[0] & CMD_DEVICE_SEL) != dev->cmd_dev) - fatal("Command device mismatch with attn\n"); - dev->command = dev->cmd_data[0] & CMD_MASK; - esdi_mca_set_callback(dev, ESDI_TIME); - dev->status = STATUS_BUSY; - dev->data_pos = 0; - } - break; + if ((dev->cmd_data[0] & CMD_DEVICE_SEL) != dev->cmd_dev) + fatal("Command device mismatch with attn\n"); + dev->command = dev->cmd_data[0] & CMD_MASK; + esdi_mca_set_callback(dev, ESDI_TIME); + dev->status = STATUS_BUSY; + dev->data_pos = 0; + ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 1); + } + break; - default: - fatal("esdi_writew port=%04x val=%04x\n", port, val); + default: + fatal("esdi_writew port=%04x val=%04x\n", port, val); } } - static uint8_t esdi_mca_read(int port, void *priv) { - esdi_t *dev = (esdi_t *)priv; + esdi_t *dev = (esdi_t *) priv; esdi_mca_log("ESDI: mcard(%04x)\n", port); - return(dev->pos_regs[port & 7]); + return (dev->pos_regs[port & 7]); } - static void esdi_mca_write(int port, uint8_t val, void *priv) { - esdi_t *dev = (esdi_t *)priv; + esdi_t *dev = (esdi_t *) priv; esdi_mca_log("ESDI: mcawr(%04x, %02x) pos[2]=%02x pos[3]=%02x\n", - port, val, dev->pos_regs[2], dev->pos_regs[3]); + port, val, dev->pos_regs[2], dev->pos_regs[3]); if (port < 0x102) - return; + return; /* Save the new value. */ dev->pos_regs[port & 7] = val; io_removehandler(ESDI_IOADDR_PRI, 8, - esdi_read, esdi_readw, NULL, - esdi_write, esdi_writew, NULL, dev); + esdi_read, esdi_readw, NULL, + esdi_write, esdi_writew, NULL, dev); mem_mapping_disable(&dev->bios_rom.mapping); - switch(dev->pos_regs[2] & 0x3c) { - case 0x14: - dev->dma = 5; - break; - case 0x18: - dev->dma = 6; - break; - case 0x1c: - dev->dma = 7; - break; - case 0x00: - dev->dma = 0; - break; - case 0x04: - dev->dma = 1; - break; - case 0x0c: - dev->dma = 3; - break; - case 0x10: - dev->dma = 4; - break; + switch (dev->pos_regs[2] & 0x3c) { + case 0x14: + dev->dma = 5; + break; + case 0x18: + dev->dma = 6; + break; + case 0x1c: + dev->dma = 7; + break; + case 0x00: + dev->dma = 0; + break; + case 0x04: + dev->dma = 1; + break; + case 0x0c: + dev->dma = 3; + break; + case 0x10: + dev->dma = 4; + break; } if (dev->pos_regs[2] & 1) { - io_sethandler(ESDI_IOADDR_PRI, 8, - esdi_read, esdi_readw, NULL, - esdi_write, esdi_writew, NULL, dev); + io_sethandler(ESDI_IOADDR_PRI, 8, + esdi_read, esdi_readw, NULL, + esdi_write, esdi_writew, NULL, dev); - if (!(dev->pos_regs[3] & 8)) { - mem_mapping_enable(&dev->bios_rom.mapping); - mem_mapping_set_addr(&dev->bios_rom.mapping, - ((dev->pos_regs[3] & 7) * 0x4000) + 0xc0000, 0x4000); - } + if (!(dev->pos_regs[3] & 8)) { + mem_mapping_enable(&dev->bios_rom.mapping); + mem_mapping_set_addr(&dev->bios_rom.mapping, + ((dev->pos_regs[3] & 7) * 0x4000) + 0xc0000, 0x4000); + } - /* Say hello. */ - esdi_mca_log("ESDI: I/O=3510, IRQ=14, DMA=%d, BIOS @%05X\n", - dev->dma, dev->bios); + /* Say hello. */ + esdi_mca_log("ESDI: I/O=3510, IRQ=14, DMA=%d, BIOS @%05X\n", + dev->dma, dev->bios); } } - static uint8_t esdi_mca_feedb(void *priv) { - esdi_t *dev = (esdi_t *)priv; + esdi_t *dev = (esdi_t *) priv; return (dev->pos_regs[2] & 1); } - static void * esdi_init(const device_t *info) { drive_t *drive; - esdi_t *dev; - int c, i; + esdi_t *dev; + int c, i; dev = malloc(sizeof(esdi_t)); - if (dev == NULL) return(NULL); + if (dev == NULL) + return (NULL); memset(dev, 0x00, sizeof(esdi_t)); /* Mark as unconfigured. */ dev->irq_status = 0xff; rom_init_interleaved(&dev->bios_rom, - BIOS_FILE_H, BIOS_FILE_L, - 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL); + BIOS_FILE_H, BIOS_FILE_L, + 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL); mem_mapping_disable(&dev->bios_rom.mapping); dev->drives[0].present = dev->drives[1].present = 0; - for (c=0,i=0; idrives[hdd[i].esdi_channel]; + for (c = 0, i = 0; i < HDD_NUM; i++) { + if ((hdd[i].bus == HDD_BUS_ESDI) && (hdd[i].esdi_channel < ESDI_NUM)) { + /* This is an ESDI drive. */ + drive = &dev->drives[hdd[i].esdi_channel]; - /* Try to load an image for the drive. */ - if (! hdd_image_load(i)) { - /* Nope. */ - drive->present = 0; - continue; - } + /* Try to load an image for the drive. */ + if (!hdd_image_load(i)) { + /* Nope. */ + drive->present = 0; + continue; + } - /* OK, so fill in geometry info. */ - drive->spt = hdd[i].spt; - drive->hpc = hdd[i].hpc; - drive->tracks = hdd[i].tracks; - drive->sectors = hdd_image_get_last_sector(i) + 1; - drive->hdd_num = i; + hdd_preset_apply(i); - /* Mark drive as present. */ - drive->present = 1; - } + /* OK, so fill in geometry info. */ + drive->spt = hdd[i].spt; + drive->hpc = hdd[i].hpc; + drive->tracks = hdd[i].tracks; + drive->sectors = hdd_image_get_last_sector(i) + 1; + drive->hdd_num = i; - if (++c >= ESDI_NUM) break; + /* Mark drive as present. */ + drive->present = 1; + } + + if (++c >= ESDI_NUM) + break; } /* Set the MCA ID for this controller, 0xFFDD. */ @@ -1147,47 +1174,45 @@ esdi_init(const device_t *info) dev->status = STATUS_BUSY; /* Set the reply timer. */ - timer_add(&dev->timer, esdi_callback, dev, 0); + timer_add(&dev->timer, esdi_callback, dev, 0); - return(dev); + return (dev); } - static void esdi_close(void *priv) { - esdi_t *dev = (esdi_t *)priv; + esdi_t *dev = (esdi_t *) priv; drive_t *drive; - int d; + int d; dev->drives[0].present = dev->drives[1].present = 0; - for (d=0; d<2; d++) { - drive = &dev->drives[d]; + for (d = 0; d < 2; d++) { + drive = &dev->drives[d]; - hdd_image_close(drive->hdd_num); + hdd_image_close(drive->hdd_num); } free(dev); } - static int esdi_available(void) { - return(rom_present(BIOS_FILE_L) && rom_present(BIOS_FILE_H)); + 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)", + .name = "IBM PS/2 ESDI Fixed Disk Adapter (MCA)", .internal_name = "esdi_mca", - .flags = DEVICE_MCA, - .local = 0, - .init = esdi_init, - .close = esdi_close, - .reset = NULL, + .flags = DEVICE_MCA, + .local = 0, + .init = esdi_init, + .close = esdi_close, + .reset = NULL, { .available = esdi_available }, .speed_changed = NULL, - .force_redraw = NULL, - .config = NULL + .force_redraw = NULL, + .config = NULL }; diff --git a/src/disk/mo.c b/src/disk/mo.c index d30cf9d94..18e49b2d7 100644 --- a/src/disk/mo.c +++ b/src/disk/mo.c @@ -31,6 +31,7 @@ #include <86box/config.h> #include <86box/timer.h> #include <86box/device.h> +#include <86box/scsi.h> #include <86box/scsi_device.h> #include <86box/nvr.h> #include <86box/path.h> diff --git a/src/disk/zip.c b/src/disk/zip.c index 1f45e4737..a4e124fee 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -27,6 +27,7 @@ #include <86box/config.h> #include <86box/timer.h> #include <86box/device.h> +#include <86box/scsi.h> #include <86box/scsi_device.h> #include <86box/nvr.h> #include <86box/plat.h> diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 93a9fa0a1..ca7fbb99c 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -137,6 +137,7 @@ extern int fm_driver; /* (C) select FM sound driver */ extern char exe_path[2048]; /* path (dir) of executable */ extern char usr_path[1024]; /* path (dir) of user data */ extern char cfg_path[1024]; /* full path of config file */ +extern int open_dir_usr_path; /* default file open dialog directory of usr_path */ #ifndef USE_NEW_DYNAREC extern FILE *stdlog; /* file to log output to */ #endif diff --git a/src/include/86box/device.h b/src/include/86box/device.h index 47f9b2448..948c4b03b 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -54,7 +54,6 @@ #define CONFIG_BIOS 11 enum { - DEVICE_NOT_WORKING = 1, /* does not currently work correctly and will be disabled in a release build */ DEVICE_PCJR = 2, /* requires an IBM PCjr */ DEVICE_AT = 4, /* requires an AT-compatible system */ DEVICE_PS2 = 8, /* requires a PS/1 or PS/2 system */ @@ -70,6 +69,17 @@ enum { DEVICE_LPT = 0x2000 /* requires a parallel port */ }; + +#define BIOS_NORMAL 0 +#define BIOS_INTERLEAVED 1 +#define BIOS_INTERLEAVED_SINGLEFILE 2 +#define BIOS_INTERLEAVED_QUAD 3 +#define BIOS_INTERLEAVED_QUAD_SINGLEFILE 4 +#define BIOS_INTEL_AMI 5 +#define BIOS_INTERLEAVED_INVERT 8 +#define BIOS_HIGH_BIT_INVERT 16 + + typedef struct { const char *description; int value; @@ -80,6 +90,8 @@ typedef struct { const char *internal_name; int bios_type; int files_no; + uint32_t local, size; + void *dev1, *dev2; const char **files; } device_config_bios_t; diff --git a/src/include/86box/hdc_ide.h b/src/include/86box/hdc_ide.h index 9e2539359..1deb6dd86 100644 --- a/src/include/86box/hdc_ide.h +++ b/src/include/86box/hdc_ide.h @@ -19,6 +19,9 @@ #ifndef EMU_IDE_H # define EMU_IDE_H +#define IDE_BUS_MAX 4 +#define IDE_CHAN_MAX 2 + #define HDC_PRIMARY_BASE 0x01F0 #define HDC_PRIMARY_SIDE 0x03F6 #define HDC_PRIMARY_IRQ 14 diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 27e44584d..a7fe477ae 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -322,6 +322,9 @@ extern int machine_get_machine_from_internal_name(char *s); extern void machine_init(void); #ifdef EMU_DEVICE_H extern const device_t *machine_getdevice(int m); +extern const device_t *machine_getviddevice(int m); +extern const device_t *machine_getsnddevice(int m); +extern const device_t *machine_getnetdevice(int m); #endif extern char *machine_get_internal_name_ex(int m); extern int machine_get_nvrmask(int m); diff --git a/src/include/86box/scsi.h b/src/include/86box/scsi.h index 03de1a4ac..b0af25e44 100644 --- a/src/include/86box/scsi.h +++ b/src/include/86box/scsi.h @@ -21,7 +21,13 @@ #ifndef EMU_SCSI_H # define EMU_SCSI_H -extern int scsi_card_current[4]; +/* Configuration. */ +#define SCSI_BUS_MAX 4 /* currently we support up to 4 controllers */ + +#define SCSI_ID_MAX 16 /* 16 on wide buses */ +#define SCSI_LUN_MAX 8 /* always 8 */ + +extern int scsi_card_current[SCSI_BUS_MAX]; extern int scsi_card_available(int card); #ifdef EMU_DEVICE_H diff --git a/src/include/86box/scsi_device.h b/src/include/86box/scsi_device.h index 6b6600d8e..f1a2a4728 100644 --- a/src/include/86box/scsi_device.h +++ b/src/include/86box/scsi_device.h @@ -21,10 +21,6 @@ # define SCSI_DEVICE_H /* Configuration. */ -#define SCSI_BUS_MAX 4 /* currently we support up to 4 controllers */ - -#define SCSI_ID_MAX 16 /* 16 on wide buses */ -#define SCSI_LUN_MAX 8 /* always 8 */ #define SCSI_LUN_USE_CDB 0xff @@ -361,8 +357,9 @@ typedef struct { #define SCSI_REMOVABLE_DISK 0x8000 #define SCSI_REMOVABLE_CDROM 0x8005 +#ifdef EMU_SCSI_H extern scsi_device_t scsi_devices[SCSI_BUS_MAX][SCSI_ID_MAX]; - +#endif /* EMU_SCSI_H */ extern int cdrom_add_error_and_subchannel(uint8_t *b, int real_sector_type); extern int cdrom_LBAtoMSF_accurate(void); diff --git a/src/include/86box/video.h b/src/include/86box/video.h index 3a1cb0d77..8661fcef8 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -326,6 +326,7 @@ extern const device_t gd5428_onboard_device; extern const device_t gd5429_isa_device; extern const device_t gd5429_vlb_device; extern const device_t gd5430_diamond_speedstar_pro_se_a8_vlb_device; +extern const device_t gd5430_vlb_device; extern const device_t gd5430_pci_device; extern const device_t gd5434_isa_device; extern const device_t gd5434_diamond_speedstar_64_a3_isa_device; diff --git a/src/include_make/86box/version.h b/src/include_make/86box/version.h index 63e675c1e..4fccf12f7 100644 --- a/src/include_make/86box/version.h +++ b/src/include_make/86box/version.h @@ -20,12 +20,12 @@ #define EMU_NAME "86Box" #define EMU_NAME_W LSTR(EMU_NAME) -#define EMU_VERSION "3.6" +#define EMU_VERSION "3.7.1" #define EMU_VERSION_W LSTR(EMU_VERSION) #define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */ #define EMU_VERSION_MAJ 3 -#define EMU_VERSION_MIN 6 -#define EMU_VERSION_PATCH 0 +#define EMU_VERSION_MIN 7 +#define EMU_VERSION_PATCH 1 #define EMU_BUILD_NUM 0 @@ -40,7 +40,7 @@ #define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest" #define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL) #ifdef RELEASE_BUILD -# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v3.6/" +# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v3.7/" #else # define EMU_DOCS_URL "https://86box.readthedocs.io" #endif diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index d524e4c4a..fb4186c4e 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -568,12 +568,6 @@ machine_at_scamp_common_init(const machine_t *model, int is_ps2) device_add(&vlsi_scamp_device); } -const device_t * -at_cmdsl386sx25_get_device(void) -{ - return &gd5402_onboard_device; -} - int machine_at_cmdsl386sx25_init(const machine_t *model) { @@ -609,12 +603,6 @@ machine_at_dataexpert386sx_init(const machine_t *model) return ret; } -const device_t * -at_spc6033p_get_device(void) -{ - return &ati28800k_spc6033p_device; -} - int machine_at_spc6033p_init(const machine_t *model) { @@ -719,12 +707,6 @@ machine_at_flytech386_init(const machine_t *model) return ret; } -const device_t * -at_flytech386_get_device(void) -{ - return &tvga8900d_device; -} - int machine_at_mr1217_init(const machine_t *model) { diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index 1204384a5..8f361ba78 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -634,12 +634,6 @@ machine_at_ms6168_common_init(const machine_t *model) } } -const device_t * -at_ms6168_get_device(void) -{ - return &voodoo_3_2000_agp_onboard_8m_device; -} - int machine_at_borapro_init(const machine_t *model) { diff --git a/src/machine/m_xt_t1000.c b/src/machine/m_xt_t1000.c index afad725a3..526833a98 100644 --- a/src/machine/m_xt_t1000.c +++ b/src/machine/m_xt_t1000.c @@ -902,12 +902,6 @@ machine_xt_t1000_init(const machine_t *model) return ret; } -const device_t * -t1200_get_device(void) -{ - return (&t1200_video_device); -} - int machine_xt_t1200_init(const machine_t *model) { diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index ebde0627d..9f02a9aa2 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -236,7 +236,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] IBM PC (1982)", @@ -270,7 +272,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] IBM PCjr", @@ -304,7 +308,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &pcjr_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] IBM XT (1982)", @@ -338,7 +344,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] IBM XT (1986)", @@ -372,7 +380,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] American XT Computer", @@ -406,7 +416,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] AMI XT clone", @@ -440,7 +452,45 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, + { + .name = "[8088] Bondwell BW230", + .internal_name = "bw230", + .type = MACHINE_TYPE_8088, + .chipset = MACHINE_CHIPSET_DISCRETE, + .init = machine_xt_bw230_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_8088, + .block = CPU_BLOCK_NONE, + .min_bus = 0, + .max_bus = 0, + .min_voltage = 0, + .max_voltage = 0, + .min_multi = 0, + .max_multi = 0 + }, + .bus_flags = MACHINE_PC, + .flags = MACHINE_FLAGS_NONE, + .ram = { + .min = 64, + .max = 640, + .step = 64 + }, + .nvrmask = 0, + .kbc = KBC_IBM_PC_XT, + .kbc_p1 = 0xff00, + .gpio = 0xffffffff, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Columbia Data Products MPC-1600", @@ -474,7 +524,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Compaq Portable", @@ -508,7 +560,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] DTK PIM-TB10-Z", @@ -542,7 +596,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Eagle PC Spirit", @@ -576,7 +632,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Generic XT clone", @@ -610,7 +668,117 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, + { + .name = "[8088] Hyosung Topstar 88T", + .internal_name = "top88", + .type = MACHINE_TYPE_8088, + .chipset = MACHINE_CHIPSET_DISCRETE, + .init = machine_xt_top88_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_8088, + .block = CPU_BLOCK_NONE, + .min_bus = 0, + .max_bus = 0, + .min_voltage = 0, + .max_voltage = 0, + .min_multi = 0, + .max_multi = 0 + }, + .bus_flags = MACHINE_PC, + .flags = MACHINE_FLAGS_NONE, + .ram = { + .min = 128, + .max = 640, + .step = 64 + }, + .nvrmask = 0, + .kbc = KBC_IBM_PC_XT, + .kbc_p1 = 0xff00, + .gpio = 0xffffffff, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, + { + .name = "[8088] Hyundai SUPER-16T", + .internal_name = "super16t", + .type = MACHINE_TYPE_8088, + .chipset = MACHINE_CHIPSET_DISCRETE, + .init = machine_xt_super16t_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_8088, + .block = CPU_BLOCK_NONE, + .min_bus = 4772728, + .max_bus = 7159092, + .min_voltage = 0, + .max_voltage = 0, + .min_multi = 0, + .max_multi = 0 + }, + .bus_flags = MACHINE_PC, + .flags = MACHINE_FLAGS_NONE, + .ram = { + .min = 128, + .max = 640, + .step = 64 + }, + .nvrmask = 0, + .kbc = KBC_IBM_PC_XT, + .kbc_p1 = 0xff00, + .gpio = 0xffffffff, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, + { + .name = "[8088] Hyundai SUPER-16TE", + .internal_name = "super16te", + .type = MACHINE_TYPE_8088, + .chipset = MACHINE_CHIPSET_DISCRETE, + .init = machine_xt_super16te_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_8088, + .block = CPU_BLOCK_NONE, + .min_bus = 0, + .max_bus = 10000000, + .min_voltage = 0, + .max_voltage = 0, + .min_multi = 0, + .max_multi = 0 + }, + .bus_flags = MACHINE_PC, + .flags = MACHINE_FLAGS_NONE, + .ram = { + .min = 128, + .max = 640, + .step = 64 + }, + .nvrmask = 0, + .kbc = KBC_IBM_PC_XT, + .kbc_p1 = 0xff00, + .gpio = 0xffffffff, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Juko ST", @@ -644,7 +812,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Kaypro PC", @@ -678,7 +848,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Multitech PC-500", @@ -712,7 +884,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Multitech PC-700", @@ -746,7 +920,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] NCR PC4i", @@ -780,7 +956,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Olivetti M19", @@ -814,7 +992,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &m19_vid_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] OpenXT", @@ -848,7 +1028,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Philips P3105/NMS9100", @@ -882,7 +1064,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Phoenix XT clone", @@ -916,7 +1100,45 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, + { + .name = "[8088] Sanyo SX-16", + .internal_name = "sansx16", + .type = MACHINE_TYPE_8088, + .chipset = MACHINE_CHIPSET_DISCRETE, + .init = machine_xt_sansx16_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_8088, + .block = CPU_BLOCK_NONE, + .min_bus = 0, + .max_bus = 0, + .min_voltage = 0, + .max_voltage = 0, + .min_multi = 0, + .max_multi = 0 + }, + .bus_flags = MACHINE_PC, + MACHINE_FLAGS_NONE, + .ram = { + .min = 256, + .max = 640, + .step = 256 + }, + .nvrmask = 0, + .kbc = KBC_IBM_PC_XT, + .kbc_p1 = 0xff00, + .gpio = 0xffffffff, + .device = NULL, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Schneider EuroPC", @@ -950,7 +1172,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Super PC/Turbo XT", @@ -984,7 +1208,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Tandy 1000", @@ -1018,7 +1244,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &vid_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Tandy 1000 HX", @@ -1052,7 +1280,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &vid_device_hx, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Toshiba T1000", @@ -1086,7 +1316,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &t1000_video_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Vendex HeadStart Turbo 888-XT", @@ -1120,7 +1352,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #if defined(DEV_BRANCH) && defined(USE_LASERXT) { @@ -1155,7 +1389,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #endif /* Has a standard PS/2 KBC (so, use IBM PS/2 Type 1). */ @@ -1191,7 +1427,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff04, .gpio = 0xffffffff, .device = &xi8088_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Z-NIX PC-1600", @@ -1225,7 +1463,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Zenith Data Systems Z-151/152/161", @@ -1259,7 +1499,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Zenith Data Systems Z-159", @@ -1293,7 +1535,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8088] Zenith Data Systems SupersPort (Z-184)", @@ -1327,7 +1571,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &cga_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[GC100A] Philips P3120", @@ -1361,7 +1607,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 8086 Machines */ @@ -1397,7 +1645,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &vid_1512_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Amstrad PC1640", @@ -1431,7 +1681,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &vid_1640_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Amstrad PC2086", @@ -1465,7 +1717,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &vid_pc2086_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Amstrad PC3086", @@ -1499,7 +1753,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &vid_pc3086_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Amstrad PC20(0)", @@ -1533,7 +1789,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &vid_200_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Amstrad PPC512/640", @@ -1567,7 +1825,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &vid_ppc512_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Compaq Deskpro", @@ -1601,7 +1861,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Olivetti M21/24/24SP", @@ -1635,7 +1897,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &ogc_m24_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has Olivetti KBC firmware. */ { @@ -1670,7 +1934,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff04, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Schetmash Iskra-3104", @@ -1704,7 +1970,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Tandy 1000 SL/2", @@ -1738,7 +2006,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &vid_device_sl, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Victor V86P", @@ -1772,7 +2042,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[8086] Toshiba T1200", @@ -1806,7 +2078,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = &t1200_video_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #if defined(DEV_BRANCH) && defined(USE_LASERXT) @@ -1842,7 +2116,9 @@ const machine_t machines[] = { .kbc_p1 = 0xff00, .gpio = 0xffffffff, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #endif @@ -1880,7 +2156,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -1915,7 +2193,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -1950,7 +2230,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -1985,7 +2267,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* AMI BIOS for a chipset-less machine, most likely has AMI 'F' KBC firmware. */ { @@ -2020,7 +2304,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Uses Commodore (CBM) KBC firmware, to be implemented as identical to the IBM AT KBC firmware unless evidence emerges of any proprietary commands. */ @@ -2056,7 +2342,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Uses Compaq KBC firmware. */ { @@ -2091,7 +2379,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Uses Compaq KBC firmware. */ { @@ -2126,7 +2416,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &compaq_plasma_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -2161,7 +2453,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -2196,7 +2490,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #if defined(DEV_BRANCH) && defined(USE_OLIVETTI) /* Has Olivetti KBC firmware. */ @@ -2232,7 +2528,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #endif #if defined(DEV_BRANCH) && defined(USE_OPEN_AT) @@ -2269,7 +2567,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #endif /* Has IBM AT KBC firmware. */ @@ -2305,7 +2605,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has Quadtel KBC firmware. */ { @@ -2340,7 +2642,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has a Siemens proprietary KBC which is completely undocumented. */ { @@ -2375,7 +2679,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has Toshiba's proprietary KBC, which is already implemented. */ { @@ -2410,7 +2716,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has Quadtel KBC firmware. */ { @@ -2445,7 +2753,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Most likely has AMI 'F' KBC firmware. */ { @@ -2480,7 +2790,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has "AMI KEYBOARD BIOS", most likely 'F'. */ { @@ -2515,7 +2827,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -2550,7 +2864,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -2585,7 +2901,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has Chips & Technologies KBC firmware. */ { @@ -2620,7 +2938,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -2655,7 +2975,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a VIA VT82C42N KBC. */ { @@ -2690,7 +3012,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a VIA VT82C42N KBC. */ { @@ -2725,7 +3049,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -2760,7 +3086,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -2795,7 +3123,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -2830,7 +3160,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -2865,7 +3197,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 286 machines that utilize the MCA bus */ @@ -2902,7 +3236,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 2 KBC firmware. */ { @@ -2937,7 +3273,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 386SX machines */ @@ -2975,7 +3313,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -3010,7 +3350,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has Quadtel KBC firmware. */ { @@ -3045,7 +3387,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -3080,7 +3424,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the AMIKey KBC firmware, which is an updated 'F' type. */ { @@ -3115,7 +3461,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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' @@ -3152,7 +3500,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &tvga8900d_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* I'm going to assume this has a standard/generic IBM-compatible AT KBC firmware until the board is identified. */ @@ -3188,7 +3538,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -3223,7 +3575,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -3258,7 +3612,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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' @@ -3295,7 +3651,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &oti067_ama932j_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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 @@ -3332,7 +3690,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has an AMI Keyboard BIOS PLUS KBC firmware ('8'). */ { .name = "[Intel 82335] Shuttle 386SX", @@ -3366,7 +3726,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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 @@ -3403,7 +3765,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -3438,7 +3802,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -3473,7 +3839,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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 @@ -3510,7 +3878,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &gd5402_onboard_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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' @@ -3547,7 +3917,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -3582,7 +3954,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &ati28800k_spc6033p_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has an unknown AMI KBC firmware, I'm going to assume 'F' until a photo or real hardware BIOS string is found. */ @@ -3618,7 +3992,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has Quadtel KBC firmware. */ { @@ -3653,7 +4029,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 386SX machines which utilize the MCA bus */ @@ -3690,7 +4068,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -3725,7 +4105,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 486SLC machines */ @@ -3763,7 +4145,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 386DX machines */ @@ -3799,7 +4183,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has an AMI Keyboard BIOS PLUS KBC firmware ('8'). */ { @@ -3834,7 +4220,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -3869,7 +4257,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Uses Compaq KBC firmware. */ #if defined(DEV_BRANCH) && defined(USE_DESKPRO386) @@ -3905,7 +4295,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #endif { @@ -3940,7 +4332,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &compaq_plasma_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM AT KBC firmware. */ { @@ -3975,7 +4369,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey F KBC firmware. */ { @@ -4010,7 +4406,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 386DX machines which utilize the MCA bus */ @@ -4047,7 +4445,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 386DX/486 machines */ @@ -4085,7 +4485,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey F KBC firmware. */ { @@ -4120,7 +4522,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey F KBC firmware (it's just the MR BIOS for the above machine). */ { @@ -4155,7 +4559,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -4190,7 +4596,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -4225,7 +4633,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 486 machines - Socket 1 */ @@ -4266,7 +4676,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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 @@ -4303,7 +4715,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Uses some variant of Phoenix MultiKey/42 as the Intel 8242 chip has a Phoenix copyright. */ @@ -4339,7 +4753,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMI KF KBC firmware. */ { @@ -4374,7 +4790,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey H KBC firmware, per the screenshot in "How computers & MS-DOS work". */ { @@ -4409,7 +4827,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey F KBC firmware, per a photo of a monitor with the BIOS screen on eBay. */ @@ -4445,7 +4865,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a MR (!) KBC firmware, which is a clone of the standard IBM PS/2 KBC firmware. */ { @@ -4480,7 +4902,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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, @@ -4518,7 +4942,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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 @@ -4555,7 +4981,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &gd5428_onboard_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a standard IBM PS/2 KBC firmware or a clone thereof. */ { @@ -4590,7 +5018,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &gd5428_onboard_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 486 machines - Socket 2 */ @@ -4629,7 +5059,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Uses an ACER/NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware (V4.01H). */ { @@ -4664,7 +5096,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &gd5428_onboard_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -4699,7 +5133,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Uses an Intel KBC with Phoenix MultiKey KBC firmware. */ { @@ -4734,7 +5170,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &s3_86c805_onboard_vlb_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Uses an NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware. */ { @@ -4769,7 +5207,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -4805,7 +5245,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. @@ -4842,7 +5284,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 486 machines - Socket 3 */ @@ -4880,7 +5324,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a VIA VT82C42N KBC. */ { @@ -4915,7 +5361,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has JetKey 5 KBC Firmware which looks like it is a clone of AMIKey type F. */ { @@ -4950,7 +5398,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has JetKey 5 KBC Firmware which looks like it is a clone of AMIKey type F. */ { @@ -4985,7 +5435,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey H keyboard BIOS. */ { @@ -5020,7 +5472,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -5055,7 +5509,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has JetKey 5 KBC Firmware which looks like it is a clone of AMIKey type F. */ { @@ -5090,7 +5546,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Unknown Epox VLB Socket 3 board, has AMIKey F keyboard BIOS. */ { @@ -5125,7 +5583,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 486 machines which utilize the PCI bus */ @@ -5162,7 +5622,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &tgui9440_onboard_pci_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the ALi M1487/9's on-chip keyboard controller which clones a standard AT KBC. */ @@ -5198,7 +5660,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the ALi M1487/9's on-chip keyboard controller which clones a standard AT KBC. @@ -5237,7 +5701,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the ALi M1487/9's on-chip keyboard controller which clones a standard AT KBC. @@ -5276,7 +5742,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has an ALi M5042 keyboard controller with Phoenix MultiKey/42 v1.40 firmware. */ { @@ -5311,7 +5779,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -5346,7 +5816,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -5381,7 +5853,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has the Phoenix MultiKey KBC firmware. */ { @@ -5416,7 +5890,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* I'm going to assume this as an AMIKey-2 like the other two 486SP3's. */ { @@ -5451,7 +5927,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has the Phoenix MultiKey KBC firmware. */ { @@ -5486,7 +5964,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. Also has a SST 29EE010 Flash chip. */ @@ -5522,7 +6002,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This most likely has a standalone AMI Megakey 1993, which is type 'P', like the below Tekram board. */ { @@ -5557,7 +6039,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has a standalone AMI Megakey 1993, which is type 'P'. */ { @@ -5592,7 +6076,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -5627,7 +6113,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -5662,7 +6150,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* The BIOS does not send a single non-standard KBC command, so it has a standard PS/2 KBC. */ { @@ -5697,7 +6187,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a BestKey KBC which clones AMI type 'H'. */ { @@ -5732,7 +6224,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -5768,7 +6262,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* According to MrKsoft, his real 4DPS has an AMIKey-2, which is an updated version of type 'H'. */ @@ -5804,7 +6300,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has the UMC 88xx on-chip KBC. */ { @@ -5839,7 +6337,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -5874,7 +6374,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey Z(!) KBC firmware. */ { @@ -5909,7 +6411,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -5945,7 +6449,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. Uses a mysterious I/O port C05. */ { @@ -5980,7 +6486,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has a Holtek KBC. */ { @@ -6015,7 +6523,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a VIA VT82C406 KBC+RTC that likely has identical commands to the VT82C42N. */ { @@ -6050,7 +6560,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a VIA VT82C42N KBC. */ { @@ -6085,7 +6597,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 486 machines - Miscellaneous */ @@ -6124,7 +6638,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -6160,7 +6676,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -6196,7 +6714,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -6232,7 +6752,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -6268,7 +6790,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Socket 4 machines */ @@ -6310,7 +6834,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey F KBC firmware (AMIKey). */ { @@ -6345,7 +6871,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -6380,7 +6908,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -6415,7 +6945,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has the Phoenix MultiKey KBC firmware. This is basically an Intel Batman (*NOT* Batman's Revenge) with a fancier @@ -6452,7 +6984,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ { @@ -6487,7 +7021,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has the Phoenix MultiKey KBC firmware. */ { @@ -6522,7 +7058,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMI MegaKey KBC firmware. */ { @@ -6557,7 +7095,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has the Phoenix MultiKey KBC firmware. */ { @@ -6592,7 +7132,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &gd5434_onboard_pci_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* OPTi 596/597 */ @@ -6631,7 +7173,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* OPTi 596/597/822 */ @@ -6668,7 +7212,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* SiS 50x */ @@ -6705,7 +7251,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -6740,7 +7288,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Socket 5 machines */ @@ -6778,7 +7328,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has the Phoenix MultiKey KBC firmware. This is basically an Intel Premiere/PCI II with a fancier POST screen. */ @@ -6814,7 +7366,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMI MegaKey KBC firmware. */ { @@ -6849,7 +7403,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 430FX */ @@ -6886,7 +7442,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey F KBC firmware. */ { @@ -6921,7 +7479,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey H KBC firmware. */ { @@ -6956,7 +7516,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -6993,7 +7555,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* The BIOS sends KBC command B3 which indicates an AMI (or VIA VT82C42N) KBC. */ { @@ -7028,7 +7592,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a VIA VT82C42N KBC. */ { @@ -7063,7 +7629,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey Z(!) KBC firmware. */ { @@ -7098,7 +7666,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* OPTi 596/597 */ @@ -7137,7 +7707,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* OPTi 596/597/822 */ @@ -7173,7 +7745,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* SiS 85C50x */ @@ -7210,7 +7784,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -7245,7 +7821,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Socket 7 (Single Voltage) machines */ @@ -7283,7 +7861,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -7318,7 +7898,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -7355,7 +7937,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -7391,7 +7975,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &s3_phoenix_trio64_onboard_pci_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -7428,7 +8014,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &s3_phoenix_trio64vplus_onboard_pci_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -7465,7 +8053,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &s3_phoenix_trio64vplus_onboard_pci_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -7502,7 +8092,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &s3_phoenix_trio64_onboard_pci_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { @@ -7537,7 +8129,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -7573,7 +8167,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &gd5440_onboard_pci_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has an AMI 'H' KBC firmware (1992). */ { @@ -7608,7 +8204,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 430HX */ @@ -7647,7 +8245,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey F KBC firmware. */ { @@ -7682,7 +8282,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* [TEST] Has a VIA 82C42N KBC, with AMIKey F KBC firmware. */ { @@ -7717,7 +8319,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -7753,7 +8357,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 430VX */ @@ -7790,7 +8396,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -7827,7 +8435,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* SiS 5511 */ @@ -7864,7 +8474,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Socket 7 (Dual Voltage) machines */ @@ -7902,7 +8514,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey H KBC firmware (AMIKey-2). */ { @@ -7937,7 +8551,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the SMC FDC73C935's on-chip KBC with Phoenix MultiKey firmware. */ { @@ -7972,7 +8588,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -8009,7 +8627,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -8046,7 +8666,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -8084,7 +8706,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* The base board has AMIKey-2 (updated 'H') KBC firmware. */ { @@ -8119,7 +8743,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 430VX */ @@ -8156,7 +8782,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has AMIKey H KBC firmware (AMIKey-2). */ { @@ -8191,7 +8819,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -8227,7 +8857,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* [TEST] Has AMIKey 'F' KBC firmware. */ { @@ -8262,7 +8894,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -8298,7 +8932,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &s3_trio64v2_dx_onboard_pci_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This most likely has AMI MegaKey as above. */ { @@ -8333,7 +8969,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &s3_trio64v2_dx_onboard_pci_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* The BIOS sends KBC command CB which is an AMI KBC command, so it has an AMI KBC firmware. */ { @@ -8368,7 +9006,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* The BIOS does not send a single non-standard KBC command. */ { @@ -8403,7 +9043,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -8440,7 +9082,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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'. */ @@ -8476,7 +9120,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -8512,7 +9158,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 430TX */ @@ -8549,7 +9197,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* This has the AMIKey KBC firmware, which is an updated 'F' type (YM430TX is based on the TX97). */ { @@ -8584,7 +9234,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #if defined(DEV_BRANCH) && defined(USE_AN430TX) /* This has the Phoenix MultiKey KBC firmware. */ @@ -8620,7 +9272,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, #endif /* This has the AMIKey KBC firmware, which is an updated 'F' type. */ @@ -8656,7 +9310,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* The BIOS sends KBC command BB and expects it to output a byte, which is AMI KBC behavior. */ { @@ -8691,7 +9347,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Award BIOS, PS2, EDO, SDRAM, 4 PCI, 4 ISA, VIA VT82C42N KBC */ { @@ -8726,7 +9384,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* [TEST] Has AMIKey 'H' KBC firmware. */ { @@ -8761,7 +9421,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Apollo VPX */ @@ -8799,7 +9461,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Apollo VP3 */ @@ -8837,7 +9501,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* SiS 5571 */ @@ -8874,7 +9540,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the SiS 5571 chipset with on-chip KBC. */ { @@ -8909,7 +9577,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* ALi ALADDiN IV+ */ @@ -8946,7 +9616,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the ALi M1543 southbridge with on-chip KBC. */ { @@ -8981,7 +9653,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Super Socket 7 machines */ @@ -9019,7 +9693,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Is the exact same as the Matsonic MS6260S. Has the ALi M1543C southbridge with on-chip KBC. */ @@ -9055,7 +9731,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the ALi M1543C southbridge with on-chip KBC. */ { @@ -9090,7 +9768,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the ALi M1543C southbridge with on-chip KBC. */ { @@ -9125,7 +9805,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Apollo MVP3 */ @@ -9163,7 +9845,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the VIA VT82C586B southbridge with on-chip KBC identical to the VIA VT82C42N. */ @@ -9199,7 +9883,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the VIA VT82C686A southbridge with on-chip KBC identical to the VIA VT82C42N. */ @@ -9235,7 +9921,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the VIA VT82C686A southbridge with on-chip KBC identical to the VIA VT82C42N. */ @@ -9271,7 +9959,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Socket 8 machines */ @@ -9309,7 +9999,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 440FX */ @@ -9346,7 +10038,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* The base board has AMIKey-2 (updated 'H') KBC firmware. */ { @@ -9381,7 +10075,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -9417,7 +10113,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, { .name = "[i440FX] Gigabyte GA-686NX", @@ -9451,7 +10149,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -9488,7 +10188,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_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'. @@ -9525,7 +10227,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the SMC FDC73C935's on-chip KBC with Phoenix MultiKey firmware. */ { @@ -9560,7 +10264,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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 @@ -9597,7 +10303,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Slot 1 machines */ @@ -9635,7 +10343,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 440FX */ @@ -9672,7 +10382,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = 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. */ @@ -9708,7 +10420,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 440LX */ @@ -9746,7 +10460,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a SM(S)C FDC37C935 Super I/O chip with on-chip KBC with Phoenix MultiKey KBC firmware. */ @@ -9782,7 +10498,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 440EX */ @@ -9820,7 +10538,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 440BX */ @@ -9858,7 +10578,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -9894,7 +10616,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -9930,7 +10654,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -9966,7 +10692,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10002,7 +10730,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a SM(S)C FDC37M60x Super I/O chip with on-chip KBC with most likely AMIKey-2 KBC firmware. */ @@ -10038,7 +10768,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a National Semiconductors PC87309 Super I/O chip with on-chip KBC with most likely AMIKey-2 KBC firmware. */ @@ -10074,7 +10806,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &es1371_onboard_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10110,7 +10844,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 440ZX */ @@ -10148,7 +10884,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &voodoo_3_2000_agp_onboard_8m_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10184,7 +10922,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &voodoo_3_2000_agp_onboard_8m_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* SMSC VictoryBX-66 */ @@ -10222,7 +10962,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* VIA Apollo Pro */ @@ -10260,7 +11002,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10296,7 +11040,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10332,7 +11078,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Slot 1/2 machines */ @@ -10371,7 +11119,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Slot 1/Socket 370 machines */ @@ -10410,7 +11160,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &es1371_onboard_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Slot 2 machines */ @@ -10449,7 +11201,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10485,7 +11239,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* PGA370 machines */ @@ -10524,7 +11280,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 440BX */ @@ -10562,7 +11320,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10598,7 +11358,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10634,7 +11396,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* 440ZX */ @@ -10672,7 +11436,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* SMSC VictoryBX-66 */ @@ -10710,7 +11476,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* VIA Apollo Pro */ @@ -10748,7 +11516,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10784,7 +11554,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the VIA VT82C686B southbridge with on-chip KBC identical to the VIA VT82C42N. */ @@ -10820,7 +11592,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has the VIA VT82C686B southbridge with on-chip KBC identical to the VIA VT82C42N. */ @@ -10856,7 +11630,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &cmi8738_onboard_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ @@ -10892,7 +11668,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = &es1371_onboard_device, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Miscellaneous/Fake/Hypervisor machines */ @@ -10930,7 +11708,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL }, /* Intel ICH2 */ @@ -11067,7 +11847,9 @@ const machine_t machines[] = { .kbc_p1 = 0, .gpio = 0, .device = NULL, - .vid_device = NULL + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL } }; @@ -11142,6 +11924,24 @@ machine_getviddevice(int m) return(NULL); } +const device_t * +machine_getsnddevice(int m) +{ + if (machines[m].snd_device) + return(machines[m].snd_device); + + return(NULL); +} + +const device_t * +machine_getnetdevice(int m) +{ + if (machines[m].net_device) + return(machines[m].net_device); + + return(NULL); +} + char * machine_get_internal_name(void) { diff --git a/src/nvr_at.c b/src/nvr_at.c index fc5ae4bde..bb4c38b85 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -1050,7 +1050,9 @@ nvr_at_init(const device_t *info) if (info->local == 12) { local->def = 0x00; local->flags |= FLAG_AMI_1992_HACK; - } else + } else if (info->local == 20) + local->def = 0x00; + else local->def = 0xff; nvr->irq = 8; local->cent = RTC_CENTURY_AT; @@ -1297,3 +1299,17 @@ const device_t p6rp4_nvr_device = { .force_redraw = NULL, .config = NULL }; + +const device_t amstrad_megapc_nvr_device = { + .name = "Amstrad MegapC NVRAM", + .internal_name = "amstrad_megapc_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 20, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/pic.c b/src/pic.c index 306b3e049..e33ad69a7 100644 --- a/src/pic.c +++ b/src/pic.c @@ -436,6 +436,7 @@ pic_read(uint16_t addr, void *priv) dev->data_bus = dev->irr; #endif if (dev->ocw3 & 0x04) { + dev->interrupt &= ~0x20; /* Freeze the interrupt until the poll is over. */ if (dev->int_pending) { dev->data_bus = 0x80 | (dev->interrupt & 7); pic_acknowledge(dev); @@ -516,6 +517,8 @@ pic_write(uint16_t addr, uint8_t val, void *priv) update_pending(); } else if (val & 0x08) { dev->ocw3 = val; + if (dev->ocw3 & 0x04) + dev->interrupt |= 0x20; /* Freeze the interrupt until the poll is over. */ if (dev->ocw3 & 0x40) dev->special_mask_mode = !!(dev->ocw3 & 0x20); } else { @@ -726,10 +729,25 @@ pic_irq_ack(void) { int ret; + /* Needed for Xi8088. */ + if ((pic.ack_bytes == 0) && pic.int_pending && pic_slave_on(&pic, pic.interrupt)) { + if (!pic.slaves[pic.interrupt]->int_pending) { + /* If we are on AT, IRQ 2 is pending, and we cannot find a pending IRQ on PIC 2, fatal out. */ + fatal("IRQ %i pending on AT without a pending IRQ on PIC %i (normal)\n", pic.interrupt, pic.interrupt); + exit(-1); + return -1; + } + + pic.interrupt |= 0x40; /* Mark slave pending. */ + } + ret = pic_irq_ack_read(&pic, pic.ack_bytes); pic.ack_bytes = (pic.ack_bytes + 1) % (pic_i86_mode(&pic) ? 2 : 3); if (pic.ack_bytes == 0) { + /* Needed for Xi8088. */ + if (pic.interrupt & 0x40) + pic2.interrupt = 0x17; pic.interrupt = 0x17; update_pending(); } diff --git a/src/pit_fast.c b/src/pit_fast.c index 704cfd68c..758183d5e 100644 --- a/src/pit_fast.c +++ b/src/pit_fast.c @@ -145,6 +145,8 @@ pitf_dump_and_disable_timer(ctrf_t *ctr) { if (ctr->using_timer && timer_is_enabled(&ctr->timer)) { ctr->count = pitf_read_timer(ctr); + if (ctr->m == 2) + ctr->count--; /* Don't store the offset from pitf_read_timer */ timer_disable(&ctr->timer); } } diff --git a/src/qt/qt_d3d9renderer.cpp b/src/qt/qt_d3d9renderer.cpp index cb2d0a25a..e7ef16f77 100644 --- a/src/qt/qt_d3d9renderer.cpp +++ b/src/qt/qt_d3d9renderer.cpp @@ -1,3 +1,4 @@ +#include "qt_mainwindow.hpp" #include "qt_d3d9renderer.hpp" #include #include @@ -139,7 +140,7 @@ void D3D9Renderer::resizeEvent(QResizeEvent *event) void D3D9Renderer::blit(int x, int y, int w, int h) { - if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (monitors[m_monitor_index].target_buffer == NULL) || surfaceInUse) { + if (blitDummied || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (monitors[m_monitor_index].target_buffer == NULL) || surfaceInUse) { video_blit_complete_monitor(m_monitor_index); return; } diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index c30304eb8..a74958511 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -289,6 +289,7 @@ int main(int argc, char* argv[]) { cpu_thread_run = 0; main_thread->join(); pc_close(nullptr); + endblit(); socket.close(); return ret; diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 7da72e569..00ebb578e 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -123,6 +123,8 @@ filter_result keyb_filter(BMessage *message, BHandler **target, BMessageFilter * static BMessageFilter* filter; #endif +std::atomic blitDummied{false}; + extern void qt_mouse_capture(int); extern "C" void qt_blit(int x, int y, int w, int h, int monitor_index); @@ -648,6 +650,11 @@ MainWindow::~MainWindow() { void MainWindow::showEvent(QShowEvent *event) { if (shownonce) return; shownonce = true; + if (window_remember) { + if (window_w == 0) window_w = 320; + if (window_h == 0) window_h = 200; + } + if (window_remember && !QApplication::platformName().contains("wayland")) { setGeometry(window_x, window_y, window_w, window_h + menuBar()->height() + (hide_status_bar ? 0 : statusBar()->height()) + (hide_tool_bar ? 0 : ui->toolBar->height())); } @@ -1474,7 +1481,7 @@ void MainWindow::on_actionFullscreen_triggered() { questionbox.exec(); config_save(); - /* (re-capture mouse after dialog. */ + /* (re-capture mouse after dialog). */ if (wasCaptured) emit setMouseCapture(true); } @@ -1594,7 +1601,7 @@ void MainWindow::keyPressEvent(QKeyEvent* event) void MainWindow::blitToWidget(int x, int y, int w, int h, int monitor_index) { if (monitor_index >= 1) { - if (renderers[monitor_index]) renderers[monitor_index]->blit(x, y, w, h); + if (!blitDummied && renderers[monitor_index] && renderers[monitor_index]->isVisible()) renderers[monitor_index]->blit(x, y, w, h); else video_blit_complete_monitor(monitor_index); } else ui->stackedWidget->blit(x, y, w, h); @@ -1915,6 +1922,8 @@ void MainWindow::on_actionHiDPI_scaling_triggered() void MainWindow::on_actionHide_status_bar_triggered() { + auto w = ui->stackedWidget->width(); + auto h = ui->stackedWidget->height(); hide_status_bar ^= 1; ui->actionHide_status_bar->setChecked(hide_status_bar); statusBar()->setVisible(!hide_status_bar); @@ -1926,13 +1935,16 @@ void MainWindow::on_actionHide_status_bar_triggered() } else { int vid_resize_orig = vid_resize; vid_resize = 0; - emit resizeContents(monitors[0].mon_scrnsz_x, monitors[0].mon_scrnsz_y); + emit resizeContents(w, h); vid_resize = vid_resize_orig; + if (vid_resize == 1) setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); } } void MainWindow::on_actionHide_tool_bar_triggered() { + auto w = ui->stackedWidget->width(); + auto h = ui->stackedWidget->height(); hide_tool_bar ^= 1; ui->actionHide_tool_bar->setChecked(hide_tool_bar); ui->toolBar->setVisible(!hide_tool_bar); @@ -1944,8 +1956,9 @@ void MainWindow::on_actionHide_tool_bar_triggered() } else { int vid_resize_orig = vid_resize; vid_resize = 0; - emit resizeContents(monitors[0].mon_scrnsz_x, monitors[0].mon_scrnsz_y); + emit resizeContents(w, h); vid_resize = vid_resize_orig; + if (vid_resize == 1) setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); } } @@ -2045,7 +2058,9 @@ void MainWindow::on_actionMCA_devices_triggered() void MainWindow::on_actionShow_non_primary_monitors_triggered() { - show_second_monitors ^= 1; + show_second_monitors = (int)ui->actionShow_non_primary_monitors->isChecked(); + + blitDummied = true; if (show_second_monitors) { for (int monitor_index = 1; monitor_index < MONITORS_NUM; monitor_index++) { @@ -2073,5 +2088,7 @@ void MainWindow::on_actionShow_non_primary_monitors_triggered() } } } + + blitDummied = false; } diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index 49300e72b..0f8a5ecd2 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -12,6 +12,8 @@ class MediaMenu; class RendererStack; +extern std::atomic blitDummied; + namespace Ui { class MainWindow; } @@ -146,6 +148,7 @@ private: friend class SpecifyDimensions; friend class ProgSettings; friend class RendererCommon; + friend class RendererStack; // For UI variable access by non-primary renderer windows. }; #endif // QT_MAINWINDOW_HPP diff --git a/src/qt/qt_mediamenu.cpp b/src/qt/qt_mediamenu.cpp index ebfe68bef..a4fcb5113 100644 --- a/src/qt/qt_mediamenu.cpp +++ b/src/qt/qt_mediamenu.cpp @@ -28,6 +28,7 @@ #include extern "C" { +#include <86box/86box.h> #include <86box/config.h> #include <86box/device.h> #include <86box/timer.h> @@ -114,13 +115,12 @@ void MediaMenu::refresh(QMenu *parentMenu) { cdromMutePos = menu->children().count(); menu->addAction(tr("&Mute"), [this, i]() { cdromMute(i); })->setCheckable(true); menu->addSeparator(); - cdromEmptyPos = menu->children().count(); - menu->addAction(tr("E&mpty"), [this, i]() { cdromEject(i); })->setCheckable(true); + menu->addAction(tr("&Image..."), [this, i]() { cdromMount(i); })->setCheckable(false); cdromReloadPos = menu->children().count(); menu->addAction(tr("&Reload previous image"), [this, i]() { cdromReload(i); }); menu->addSeparator(); cdromImagePos = menu->children().count(); - menu->addAction(tr("&Image"), [this, i]() { cdromMount(i); })->setCheckable(true); + menu->addAction(tr("E&ject"), [this, i]() { cdromEject(i); })->setCheckable(false); cdromMenus[i] = menu; cdromUpdateMenu(i); }); @@ -173,7 +173,7 @@ void MediaMenu::cassetteNewImage() { void MediaMenu::cassetteSelectImage(bool wp) { auto filename = QFileDialog::getOpenFileName(parentWidget, QString(), - QString(), + getMediaOpenDirectory(), tr("Cassette images") % util::DlgFilter({ "pcm","raw","wav","cas" }) % tr("All files") % @@ -247,7 +247,7 @@ void MediaMenu::cartridgeSelectImage(int i) { auto filename = QFileDialog::getOpenFileName( parentWidget, QString(), - QString(), + getMediaOpenDirectory(), tr("Cartridge images") % util::DlgFilter({ "a","b","jrc" }) % tr("All files") % @@ -291,7 +291,7 @@ void MediaMenu::floppySelectImage(int i, bool wp) { auto filename = QFileDialog::getOpenFileName( parentWidget, QString(), - QString(), + getMediaOpenDirectory(), tr("All images") % util::DlgFilter({ "0??","1??","??0","86f","bin","cq?","d??","flp","hdm","im?","json","td0","*fd?","mfm","xdf" }) % tr("Advanced sector images") % @@ -343,6 +343,7 @@ void MediaMenu::floppyExportTo86f(int i) { void MediaMenu::floppyUpdateMenu(int i) { QString name = floppyfns[i]; + QFileInfo fi(floppyfns[i]); if (!floppyMenus.contains(i)) return; @@ -353,6 +354,7 @@ void MediaMenu::floppyUpdateMenu(int i) { auto* ejectMenu = dynamic_cast(childs[floppyEjectPos]); auto* exportMenu = dynamic_cast(childs[floppyExportPos]); ejectMenu->setEnabled(!name.isEmpty()); + ejectMenu->setText(QString::asprintf(tr("Eject %s").toUtf8().constData(), name.isEmpty() ? QString().toUtf8().constData() : fi.fileName().toUtf8().constData())); exportMenu->setEnabled(!name.isEmpty()); int type = fdd_get_type(i); @@ -400,7 +402,7 @@ void MediaMenu::cdromMount(int i) { auto filename = QFileDialog::getOpenFileName( parentWidget, QString(), - QString(), + getMediaOpenDirectory(), tr("CD-ROM images") % util::DlgFilter({ "iso","cue" }) % tr("All files") % @@ -427,6 +429,10 @@ void MediaMenu::cdromReload(int i) { void MediaMenu::cdromUpdateMenu(int i) { QString name = cdrom[i].image_path; + QString prev_name = cdrom[i].prev_image_path; + QFileInfo fi(cdrom[i].image_path); + QFileInfo fi_prev(cdrom[i].prev_image_path); + if (!cdromMenus.contains(i)) return; auto* menu = cdromMenus[i]; @@ -436,12 +442,12 @@ void MediaMenu::cdromUpdateMenu(int i) { muteMenu->setChecked(cdrom[i].sound_on == 0); auto* imageMenu = dynamic_cast(childs[cdromImagePos]); - auto* emptyMenu = dynamic_cast(childs[cdromEmptyPos]); - imageMenu->setChecked(cdrom[i].host_drive == 200); - emptyMenu->setChecked(cdrom[i].host_drive != 200); + imageMenu->setEnabled(!name.isEmpty()); + imageMenu->setText(QString::asprintf(tr("Eject %s").toUtf8().constData(), name.isEmpty() ? QString().toUtf8().constData() : fi.fileName().toUtf8().constData())); auto* prevMenu = dynamic_cast(childs[cdromReloadPos]); - prevMenu->setEnabled(cdrom[i].prev_host_drive != 0); + prevMenu->setText(QString::asprintf(tr("Reload %s").toUtf8().constData(), prev_name.isEmpty() ? tr("previous image").toUtf8().constData() : fi_prev.fileName().toUtf8().constData())); + prevMenu->setVisible(name.isEmpty() && cdrom[i].prev_host_drive != 0); QString busName = tr("Unknown Bus"); switch (cdrom[i].bus_type) { @@ -571,7 +577,7 @@ void MediaMenu::moSelectImage(int i, bool wp) { auto filename = QFileDialog::getOpenFileName( parentWidget, QString(), - QString(), + getMediaOpenDirectory(), tr("MO images") % util::DlgFilter({ "im?", "mdi" }) % tr("All files") % @@ -656,6 +662,13 @@ void MediaMenu::moUpdateMenu(int i) { menu->setTitle(QString::asprintf(tr("MO %i (%ls): %ls").toUtf8().constData(), i + 1, busName.toStdU16String().data(), name.isEmpty() ? tr("(empty)").toStdU16String().data() : name.toStdU16String().data())); } +QString MediaMenu::getMediaOpenDirectory() { + QString openDirectory; + if (open_dir_usr_path > 0) { + openDirectory = QString::fromUtf8(usr_path); + } + return openDirectory; +} // callbacks from 86box C code extern "C" { diff --git a/src/qt/qt_mediamenu.hpp b/src/qt/qt_mediamenu.hpp index 3c45b2414..9b08d3ee3 100644 --- a/src/qt/qt_mediamenu.hpp +++ b/src/qt/qt_mediamenu.hpp @@ -66,6 +66,8 @@ private: QMap zipMenus; QMap moMenus; + QString getMediaOpenDirectory(); + int cassetteRecordPos; int cassettePlayPos; int cassetteRewindPos; @@ -78,7 +80,6 @@ private: int floppyEjectPos; int cdromMutePos; - int cdromEmptyPos; int cdromReloadPos; int cdromImagePos; diff --git a/src/qt/qt_newfloppydialog.cpp b/src/qt/qt_newfloppydialog.cpp index 576798e54..1581c6e52 100644 --- a/src/qt/qt_newfloppydialog.cpp +++ b/src/qt/qt_newfloppydialog.cpp @@ -187,6 +187,7 @@ void NewFloppyDialog::onCreate() { QProgressDialog progress("Creating floppy image", QString(), 0, 100, this); connect(this, &NewFloppyDialog::fileProgress, &progress, &QProgressDialog::setValue); + connect(this, &NewFloppyDialog::fileProgress, [] { QApplication::processEvents(); }); switch (mediaType_) { case MediaType::Floppy: if (fi.suffix().toLower() == QStringLiteral("86f")) { diff --git a/src/qt/qt_openglrenderer.cpp b/src/qt/qt_openglrenderer.cpp index 7c7cd55fa..3a5f58846 100644 --- a/src/qt/qt_openglrenderer.cpp +++ b/src/qt/qt_openglrenderer.cpp @@ -26,6 +26,14 @@ #include "qt_opengloptionsdialog.hpp" #include "qt_openglrenderer.hpp" +#ifndef GL_MAP_PERSISTENT_BIT +#define GL_MAP_PERSISTENT_BIT 0x0040 +#endif + +#ifndef GL_MAP_COHERENT_BIT +#define GL_MAP_COHERENT_BIT 0x0080 +#endif + OpenGLRenderer::OpenGLRenderer(QWidget *parent) : QWindow(parent->windowHandle()) , renderTimer(new QTimer(this)) @@ -239,10 +247,12 @@ void OpenGLRenderer::initializeExtensions() { #ifndef NO_BUFFER_STORAGE - if (context->hasExtension("GL_ARB_buffer_storage")) { + if (context->hasExtension("GL_ARB_buffer_storage") || context->hasExtension("GL_EXT_buffer_storage")) { hasBufferStorage = true; - glBufferStorage = (PFNGLBUFFERSTORAGEPROC) context->getProcAddress("glBufferStorage"); + glBufferStorage = (PFNGLBUFFERSTORAGEEXTPROC_LOCAL) context->getProcAddress(context->hasExtension("GL_EXT_buffer_storage") ? "glBufferStorageEXT" : "glBufferStorage"); + if (!glBufferStorage) + glBufferStorage = glBufferStorage = (PFNGLBUFFERSTORAGEEXTPROC_LOCAL) context->getProcAddress("glBufferStorage"); } #endif } diff --git a/src/qt/qt_openglrenderer.hpp b/src/qt/qt_openglrenderer.hpp index a27e0fe21..da64ea79b 100644 --- a/src/qt/qt_openglrenderer.hpp +++ b/src/qt/qt_openglrenderer.hpp @@ -39,6 +39,8 @@ #include "qt_opengloptions.hpp" #include "qt_renderercommon.hpp" +typedef void (QOPENGLF_APIENTRYP PFNGLBUFFERSTORAGEEXTPROC_LOCAL) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); + class OpenGLRenderer : public QWindow, protected QOpenGLExtraFunctions, public RendererCommon { Q_OBJECT @@ -103,7 +105,7 @@ private: /* GL_ARB_buffer_storage */ bool hasBufferStorage = false; #ifndef NO_BUFFER_STORAGE - PFNGLBUFFERSTORAGEPROC glBufferStorage = nullptr; + PFNGLBUFFERSTORAGEEXTPROC_LOCAL glBufferStorage = nullptr; #endif private slots: diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index d1f5318ba..8aa85fb9c 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -54,7 +54,6 @@ QElapsedTimer elapsed_timer; static std::atomic_int blitmx_contention = 0; static std::recursive_mutex blitmx; -static thread_local std::unique_lock blit_lock { blitmx, std::defer_lock }; class CharPointer { public: @@ -337,11 +336,15 @@ plat_pause(int p) #endif return; } + if ((p == 0) && (time_sync & TIME_SYNC_ENABLED)) nvr_time_sync(); dopause = p; if (p) { + if (mouse_capture) + plat_mouse_capture(0); + wcsncpy(oldtitle, ui_window_title(NULL), sizeof_w(oldtitle) - 1); wcscpy(title, oldtitle); paused_msg[QObject::tr(" - PAUSED").toWCharArray(paused_msg)] = 0; @@ -469,17 +472,17 @@ void dynld_close(void *handle) void startblit() { blitmx_contention++; - if (blit_lock.try_lock()) { + if (blitmx.try_lock()) { return; } - blit_lock.lock(); + blitmx.lock(); } void endblit() { blitmx_contention--; - blit_lock.unlock(); + blitmx.unlock(); if (blitmx_contention > 0) { // a deadlock has been observed on linux when toggling via video_toggle_option // because the mutex is typically unfair on linux diff --git a/src/qt/qt_progsettings.cpp b/src/qt/qt_progsettings.cpp index b11466c08..0b4f0e955 100644 --- a/src/qt/qt_progsettings.cpp +++ b/src/qt/qt_progsettings.cpp @@ -113,12 +113,14 @@ ProgSettings::ProgSettings(QWidget *parent) : mouseSensitivity = mouse_sensitivity; ui->horizontalSlider->setValue(mouseSensitivity * 100.); + ui->openDirUsrPath->setChecked(open_dir_usr_path > 0); } void ProgSettings::accept() { strcpy(icon_set, ui->comboBox->currentData().toString().toUtf8().data()); lang_id = ui->comboBoxLanguage->currentData().toUInt(); + open_dir_usr_path = ui->openDirUsrPath->isChecked() ? 1 : 0; loadTranslators(QCoreApplication::instance()); reloadStrings(); diff --git a/src/qt/qt_progsettings.ui b/src/qt/qt_progsettings.ui index 11bb39b74..05775489f 100644 --- a/src/qt/qt_progsettings.ui +++ b/src/qt/qt_progsettings.ui @@ -7,7 +7,7 @@ 0 0 458 - 303 + 374 @@ -29,24 +29,14 @@ QLayout::SetFixedSize - - - - Qt::Horizontal + + + + false - - - 40 - 20 - - - - - - - (System Default) + (Default) @@ -58,30 +48,6 @@ - - - - Default - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - Default - - - @@ -89,8 +55,8 @@ - - + + Default @@ -109,25 +75,15 @@ - - - - Language: - - - - - + + Qt::Horizontal - - - 40 - 20 - + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok - + @@ -151,18 +107,72 @@ - - - - false - + + - (Default) + (System Default) + + + + Language: + + + + + + + Default + + + + + + + Default + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + <html><head/><body><p>When selecting media images (CD-ROM, floppy, etc.) the open dialog will start in the same directory as the 86Box configuration file. This setting will likely only make a difference on macOS.</p></body></html> + + + Select media images from program working directory + + + diff --git a/src/qt/qt_rendererstack.cpp b/src/qt/qt_rendererstack.cpp index ef415a82c..273bc4c95 100644 --- a/src/qt/qt_rendererstack.cpp +++ b/src/qt/qt_rendererstack.cpp @@ -32,6 +32,8 @@ #include "qt_mainwindow.hpp" #include "qt_util.hpp" +#include "ui_qt_mainwindow.h" + #include "evdev_mouse.hpp" #include @@ -257,7 +259,7 @@ RendererStack::switchRenderer(Renderer renderer) createRenderer(renderer); disconnect(this, &RendererStack::blit, this, &RendererStack::blitDummy); blitDummied = false; - QTimer::singleShot(1000, this, [this]() { this->blitDummied = false; } ); + QTimer::singleShot(1000, this, [this]() { blitDummied = false; } ); }); rendererWindow->hasBlitFunc() ? current.reset() : current.release()->deleteLater(); @@ -435,7 +437,7 @@ RendererStack::blitRenderer(int x, int y, int w, int h) void RendererStack::blitCommon(int x, int y, int w, int h) { - if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (monitors[m_monitor_index].target_buffer == NULL) || imagebufs.empty() || std::get(imagebufs[currentBuf])->test_and_set() || blitDummied) { + if (blitDummied || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (monitors[m_monitor_index].target_buffer == NULL) || imagebufs.empty() || std::get(imagebufs[currentBuf])->test_and_set()) { video_blit_complete_monitor(m_monitor_index); return; } @@ -459,9 +461,9 @@ RendererStack::blitCommon(int x, int y, int w, int h) void RendererStack::closeEvent(QCloseEvent* event) { - if (cpu_thread_run == 0 || is_quit == 0) { + if (cpu_thread_run == 1 || is_quit == 0) { event->accept(); - show_second_monitors = 0; // TODO: This isn't actually the right fix, so fix this properly. + main_window->ui->actionShow_non_primary_monitors->setChecked(false); return; } event->ignore(); diff --git a/src/qt/qt_rendererstack.hpp b/src/qt/qt_rendererstack.hpp index 6ee1a0433..75cabec49 100644 --- a/src/qt/qt_rendererstack.hpp +++ b/src/qt/qt_rendererstack.hpp @@ -103,7 +103,7 @@ private: RendererCommon *rendererWindow { nullptr }; std::unique_ptr current; - std::atomic directBlitting{false}, blitDummied{false}; + std::atomic directBlitting{false}; }; #endif // QT_RENDERERCONTAINER_HPP diff --git a/src/qt/qt_settingsstoragecontrollers.cpp b/src/qt/qt_settingsstoragecontrollers.cpp index 114654340..7664fdd5f 100644 --- a/src/qt/qt_settingsstoragecontrollers.cpp +++ b/src/qt/qt_settingsstoragecontrollers.cpp @@ -161,6 +161,8 @@ void SettingsStorageControllers::onCurrentMachineChanged(int machineId) { int is_at = IS_AT(machineId); ui->checkBoxTertiaryIDE->setEnabled(is_at > 0); ui->checkBoxQuaternaryIDE->setEnabled(is_at > 0); + ui->checkBoxTertiaryIDE->setChecked(ui->checkBoxTertiaryIDE->isEnabled() && ide_ter_enabled); + ui->checkBoxQuaternaryIDE->setChecked(ui->checkBoxQuaternaryIDE->isEnabled() && ide_qua_enabled); } void SettingsStorageControllers::on_comboBoxHD_currentIndexChanged(int index) { diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index c7e9060e9..e90e0d773 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -27,6 +27,7 @@ #include <86box/config.h> #include <86box/timer.h> #include <86box/device.h> +#include <86box/scsi.h> #include <86box/scsi_device.h> #include <86box/nvr.h> #include <86box/hdc.h> diff --git a/src/scsi/scsi_disk.c b/src/scsi/scsi_disk.c index d3e7b6f11..133c23997 100644 --- a/src/scsi/scsi_disk.c +++ b/src/scsi/scsi_disk.c @@ -25,6 +25,7 @@ #include <86box/nvr.h> #include <86box/hdd.h> #include <86box/hdc.h> +#include <86box/scsi.h> #include <86box/scsi_device.h> #include <86box/hdc_ide.h> #include <86box/plat.h> diff --git a/src/sound/midi_fluidsynth.c b/src/sound/midi_fluidsynth.c index 749c74b9f..79a2bcad6 100644 --- a/src/sound/midi_fluidsynth.c +++ b/src/sound/midi_fluidsynth.c @@ -58,6 +58,7 @@ static int (*f_delete_fluid_synth)(void *synth); static int (*f_fluid_synth_noteon)(void *synth, int chan, int key, int vel); static int (*f_fluid_synth_noteoff)(void *synth, int chan, int key); static int (*f_fluid_synth_cc)(void *synth, int chan, int ctrl, int val); +static int (*f_fluid_synth_channel_pressure)(void *synth, int chan, int val); static int (*f_fluid_synth_sysex)(void *synth, const char *data, int len, char *response, int *response_len, int *handled, int dryrun); static int (*f_fluid_synth_pitch_bend)(void *synth, int chan, int val); static int (*f_fluid_synth_program_change)(void *synth, int chan, int program); @@ -83,6 +84,7 @@ static dllimp_t fluidsynth_imports[] = { { "fluid_synth_noteon", &f_fluid_synth_noteon }, { "fluid_synth_noteoff", &f_fluid_synth_noteoff }, { "fluid_synth_cc", &f_fluid_synth_cc }, + { "fluid_synth_channel_pressure", &f_fluid_synth_channel_pressure }, { "fluid_synth_sysex", &f_fluid_synth_sysex }, { "fluid_synth_pitch_bend", &f_fluid_synth_pitch_bend }, { "fluid_synth_program_change", &f_fluid_synth_program_change }, @@ -199,6 +201,7 @@ fluidsynth_msg(uint8_t *msg) f_fluid_synth_program_change(data->synth, chan, param1); break; case 0xD0: /* Channel Pressure */ + f_fluid_synth_channel_pressure(data->synth, chan, param1); break; case 0xE0: /* Pitch Bend */ f_fluid_synth_pitch_bend(data->synth, chan, (param2 << 7) | param1); diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index 1662598c9..0dd35c049 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -745,7 +745,7 @@ pas16_close(void *p) const device_t pas16_device = { .name = "Pro Audio Spectrum 16", .internal_name = "pas16", - .flags = DEVICE_ISA | DEVICE_NOT_WORKING, + .flags = DEVICE_ISA, .local = 0, .init = pas16_init, .close = pas16_close, diff --git a/src/unix/assets/86Box.spec b/src/unix/assets/86Box.spec index 55df4b7d9..d5fe0a0b1 100644 --- a/src/unix/assets/86Box.spec +++ b/src/unix/assets/86Box.spec @@ -12,17 +12,15 @@ # After a successful build, you can install the RPMs as follows: # sudo dnf install RPMS/$(uname -m)/86Box-3* RPMS/noarch/86Box-roms* -%global romver 20220701 - Name: 86Box -Version: 3.6 +Version: 3.7.1 Release: 1%{?dist} Summary: Classic PC emulator License: GPLv2+ URL: https://86box.net Source0: https://github.com/86Box/86Box/archive/refs/tags/v%%{version}.tar.gz -Source1: https://github.com/86Box/roms/archive/refs/tags/%{romver}.tar.gz +Source1: https://github.com/86Box/roms/archive/refs/tags/%{version}.tar.gz BuildRequires: cmake BuildRequires: desktop-file-utils @@ -34,6 +32,7 @@ BuildRequires: libappstream-glib BuildRequires: libevdev-devel BuildRequires: libXi-devel BuildRequires: ninja-build +BuildRequires: openal-soft-devel BuildRequires: qt5-linguist BuildRequires: qt5-qtconfiguration-devel BuildRequires: qt5-qtbase-private-devel @@ -56,7 +55,7 @@ It supports various models of PCs, graphics and sound cards, and CPUs. %package roms Summary: ROMs for use with 86Box -Version: %{romver} +Version: %{version} License: Proprietary BuildArch: noarch @@ -97,12 +96,9 @@ cp src/unix/assets/net.86box.86Box.metainfo.xml %{buildroot}%{_metainfodir} appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/net.86box.86Box.metainfo.xml # install roms -pushd roms-%{romver} +pushd roms-%{version} mkdir -p %{buildroot}%{_datadir}/%{name}/roms cp -a * %{buildroot}%{_datadir}/%{name}/roms/ - # hack to create symlink in /usr/bin - cd %{buildroot}%{_bindir} - ln -s ../share/%{name}/roms roms popd # files part of the main package @@ -115,10 +111,9 @@ popd # files part of the rom package %files roms -%license roms-%{romver}/LICENSE +%license roms-%{version}/LICENSE %{_datadir}/%{name}/roms -%{_bindir}/roms %changelog -* Fri Jul 01 2022 Robert de Rooy 3.6-1 +* Tue Aug 02 2022 Robert de Rooy 3.7.1-1 - Bump release diff --git a/src/unix/assets/net.86box.86Box.metainfo.xml b/src/unix/assets/net.86box.86Box.metainfo.xml index 982ae9b4d..a4458cfad 100644 --- a/src/unix/assets/net.86box.86Box.metainfo.xml +++ b/src/unix/assets/net.86box.86Box.metainfo.xml @@ -10,7 +10,7 @@ net.86box.86Box.desktop - + diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index c18e4c532..cea6ee807 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -51,9 +51,11 @@ #define BIOS_GD5428_ISA_PATH "roms/video/cirruslogic/5428.bin" #define BIOS_GD5428_MCA_PATH "roms/video/cirruslogic/SVGA141.ROM" #define BIOS_GD5428_PATH "roms/video/cirruslogic/vlbusjapan.BIN" -#define BIOS_GD5428_BOCA_ISA_PATH "roms/video/cirruslogic/boca_gd5428_1.30b.bin" +#define BIOS_GD5428_BOCA_ISA_PATH_1 "roms/video/cirruslogic/boca_gd5428_1.30b_1.bin" +#define BIOS_GD5428_BOCA_ISA_PATH_2 "roms/video/cirruslogic/boca_gd5428_1.30b_2.bin" #define BIOS_GD5429_PATH "roms/video/cirruslogic/5429.vbi" #define BIOS_GD5430_DIAMOND_A8_VLB_PATH "roms/video/cirruslogic/diamondvlbus.bin" +#define BIOS_GD5430_ORCHID_VLB_PATH "roms/video/cirruslogic/orchidvlbus.bin" #define BIOS_GD5430_PATH "roms/video/cirruslogic/pci.bin" #define BIOS_GD5434_DIAMOND_A3_ISA_PATH "roms/video/cirruslogic/Diamond Multimedia SpeedStar 64 v2.02 EPROM Backup from ST M27C256B-12F1.BIN" #define BIOS_GD5434_PATH "roms/video/cirruslogic/gd5434.BIN" @@ -3862,6 +3864,7 @@ static void int id = info->local & 0xff; int vram; char *romfn = NULL; + char *romfn1 = NULL, *romfn2 = NULL; memset(gd54xx, 0, sizeof(gd54xx_t)); gd54xx->pci = !!(info->flags & DEVICE_PCI); @@ -3916,8 +3919,10 @@ static void if (info->local & 0x100) if (gd54xx->vlb) romfn = BIOS_GD5428_DIAMOND_B1_VLB_PATH; - else - romfn = BIOS_GD5428_BOCA_ISA_PATH; + else { + romfn1 = BIOS_GD5428_BOCA_ISA_PATH_1; + romfn2 = BIOS_GD5428_BOCA_ISA_PATH_2; + } else { if (gd54xx->vlb) romfn = BIOS_GD5428_PATH; @@ -3944,6 +3949,8 @@ static void if (info->local & 0x200) { romfn = NULL; gd54xx->has_bios = 0; + } else if (gd54xx->vlb) { + romfn = BIOS_GD5430_ORCHID_VLB_PATH; } else { if (info->local & 0x100) romfn = BIOS_GD5434_DIAMOND_A3_ISA_PATH; @@ -3970,8 +3977,10 @@ static void if (info->local & 0x200) { romfn = NULL; gd54xx->has_bios = 0; - } else if (gd54xx->pci) + } else if (gd54xx->pci) { romfn = BIOS_GD5430_PATH; + } else if ((gd54xx->vlb) && (info->local & 0x100)) + romfn = BIOS_GD5430_ORCHID_VLB_PATH; else romfn = BIOS_GD5430_DIAMOND_A8_VLB_PATH; } @@ -4011,7 +4020,10 @@ static void gd54xx->vram_mask = gd54xx->vram_size - 1; if (romfn) - rom_init(&gd54xx->bios_rom, romfn, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); + rom_init(&gd54xx->bios_rom, romfn, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); + else if (romfn1 && romfn2) + rom_init_interleaved(&gd54xx->bios_rom, BIOS_GD5428_BOCA_ISA_PATH_1, BIOS_GD5428_BOCA_ISA_PATH_2, 0xc0000, + 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); if (info->flags & DEVICE_ISA) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_gd54xx_isa); @@ -4188,7 +4200,7 @@ gd5428_diamond_b1_available(void) static int gd5428_boca_isa_available(void) { - return rom_present(BIOS_GD5428_BOCA_ISA_PATH); + return rom_present(BIOS_GD5428_BOCA_ISA_PATH_1) && rom_present(BIOS_GD5428_BOCA_ISA_PATH_2); } static int @@ -4233,6 +4245,18 @@ gd5434_available(void) return rom_present(BIOS_GD5434_PATH); } +static int +gd5434_isa_available(void) +{ + return rom_present(BIOS_GD5434_PATH); +} + +static int +gd5430_orchid_vlb_available(void) +{ + return rom_present(BIOS_GD5430_ORCHID_VLB_PATH); +} + static int gd5434_diamond_a3_available(void) { @@ -4791,7 +4815,7 @@ const device_t gd5429_vlb_device = { /*According to a Diamond bios file listing and vgamuseum*/ const device_t gd5430_diamond_speedstar_pro_se_a8_vlb_device = { .name = "Cirrus Logic GD5430 (VLB) (Diamond SpeedStar Pro SE Rev. A8)", - .internal_name = "cl_gd5430_vlb", + .internal_name = "cl_gd5430_vlb_diamond", .flags = DEVICE_VLB, .local = CIRRUS_ID_CLGD5430, .init = gd54xx_init, @@ -4803,6 +4827,20 @@ const device_t gd5430_diamond_speedstar_pro_se_a8_vlb_device = { .config = gd5429_config }; +const device_t gd5430_vlb_device = { + .name = "Cirrus Logic GD5430", + .internal_name = "cl_gd5430_vlb", + .flags = DEVICE_VLB, + .local = CIRRUS_ID_CLGD5430 | 0x100, + .init = gd54xx_init, + .close = gd54xx_close, + .reset = gd54xx_reset, + { .available = gd5430_orchid_vlb_available }, + .speed_changed = gd54xx_speed_changed, + .force_redraw = gd54xx_force_redraw, + .config = gd5429_config +}; + const device_t gd5430_pci_device = { .name = "Cirrus Logic GD5430 (PCI)", .internal_name = "cl_gd5430_pci", @@ -4825,7 +4863,7 @@ const device_t gd5434_isa_device = { .init = gd54xx_init, .close = gd54xx_close, .reset = gd54xx_reset, - { .available = gd5434_available }, + { .available = gd5434_isa_available }, .speed_changed = gd54xx_speed_changed, .force_redraw = gd54xx_force_redraw, .config = gd5434_config @@ -4868,7 +4906,7 @@ const device_t gd5434_vlb_device = { .init = gd54xx_init, .close = gd54xx_close, .reset = gd54xx_reset, - { .available = gd5434_available }, + { .available = gd5430_orchid_vlb_available }, .speed_changed = gd54xx_speed_changed, .force_redraw = gd54xx_force_redraw, .config = gd5434_config diff --git a/src/video/vid_oak_oti.c b/src/video/vid_oak_oti.c index 210afc2b2..7572e44b6 100644 --- a/src/video/vid_oak_oti.c +++ b/src/video/vid_oak_oti.c @@ -41,7 +41,7 @@ enum { OTI_037C, OTI_067 = 2, OTI_067_AMA932J, - OTI_067_M300 = 4, + OTI_067_M300 = 4, OTI_077 = 5 }; @@ -342,29 +342,61 @@ oti_pos_in(uint16_t addr, void *p) } +static float +oti_getclock(int clock) +{ + float ret = 0.0; + + switch (clock) { + case 0: + default: + ret = 25175000.0; + break; + case 1: + ret = 28322000.0; + break; + case 4: + ret = 14318000.0; + break; + case 5: + ret = 16257000.0; + break; + case 7: + ret = 35500000.0; + break; + } + +} + + static void oti_recalctimings(svga_t *svga) { oti_t *oti = (oti_t *)svga->p; + int clk_sel = ((svga->miscout >> 2) & 3) | ((oti->regs[0x0d] & 0x20) >> 3); - if (oti->regs[0x14] & 0x08) svga->ma_latch |= 0x10000; + svga->clock = (cpuclock * (double)(1ull << 32)) / oti_getclock(clk_sel); + + if (oti->chip_id > 0) { + if (oti->regs[0x14] & 0x08) svga->ma_latch |= 0x10000; if (oti->regs[0x16] & 0x08) svga->ma_latch |= 0x20000; if (oti->regs[0x14] & 0x01) svga->vtotal += 0x400; if (oti->regs[0x14] & 0x02) svga->dispend += 0x400; if (oti->regs[0x14] & 0x04) svga->vsyncstart += 0x400; + svga->interlace = oti->regs[0x14] & 0x80; + } + if ((oti->regs[0x0d] & 0x0c) && !(oti->regs[0x0d] & 0x10)) svga->rowoffset <<= 1; - svga->interlace = oti->regs[0x14] & 0x80; - - if (svga->bpp == 16) { - svga->render = svga_render_16bpp_highres; - svga->hdisp >>= 1; - } else if (svga->bpp == 15) { - svga->render = svga_render_15bpp_highres; - svga->hdisp >>= 1; - } + if (svga->bpp == 16) { + svga->render = svga_render_16bpp_highres; + svga->hdisp >>= 1; + } else if (svga->bpp == 15) { + svga->render = svga_render_15bpp_highres; + svga->hdisp >>= 1; + } } diff --git a/src/video/vid_table.c b/src/video/vid_table.c index 6935769fd..5f53f4d8a 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -222,6 +222,7 @@ video_cards[] = { { &gd5428_diamond_speedstar_pro_b1_vlb_device }, { &gd5429_vlb_device }, { &gd5430_diamond_speedstar_pro_se_a8_vlb_device }, + { &gd5430_vlb_device }, { &gd5434_vlb_device }, { &s3_metheus_86c928_vlb_device }, { &s3_mirocrystal_8s_805_vlb_device }, diff --git a/src/video/vid_voodoo_fifo.c b/src/video/vid_voodoo_fifo.c index 013c21db3..87260ce54 100644 --- a/src/video/vid_voodoo_fifo.c +++ b/src/video/vid_voodoo_fifo.c @@ -494,6 +494,7 @@ void voodoo_fifo_thread(void *param) switch (header >> 30) { case 0: /*Linear framebuffer (Banshee)*/ + case 1: /*Planar YUV*/ if (voodoo->texture_present[0][(addr & voodoo->texture_mask) >> TEX_DIRTY_SHIFT]) { // voodoo_fifo_log("texture_present at %08x %i\n", addr, (addr & voodoo->texture_mask) >> TEX_DIRTY_SHIFT); diff --git a/src/vnc.c b/src/vnc.c index 768b08b57..46ef21c5d 100644 --- a/src/vnc.c +++ b/src/vnc.c @@ -167,12 +167,12 @@ vnc_display(rfbClientPtr cl) static void -vnc_blit(int x, int y, int w, int h) +vnc_blit(int x, int y, int w, int h, int monitor_index) { uint32_t *p; int yy; - if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL)) + if (monitor_index || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL)) return; for (yy=0; yy> 4, i & 15); settings_add_string(hdlg, IDC_COMBO_HD_ID, (LPARAM) lptsTemp); } - for (i = 0; i < 8; i++) { + for (i = 0; i < (IDE_BUS_MAX * IDE_CHAN_MAX); i++) { wsprintf(lptsTemp, plat_get_string(IDS_4097), i >> 1, i & 1); settings_add_string(hdlg, IDC_COMBO_HD_CHANNEL_IDE, (LPARAM) lptsTemp); } @@ -1989,7 +1989,7 @@ next_free_ide_channel(void) { int64_t i; - for (i = 0; i < 8; i++) { + for (i = 0; i < (IDE_BUS_MAX * IDE_CHAN_MAX); i++) { if (!(ide_tracking & (0xffLL << (i << 3LL)))) return i; } @@ -2002,7 +2002,7 @@ next_free_scsi_id(uint8_t *id) { int64_t i; - for (i = 0; i < 64; i++) { + for (i = 0; i < (SCSI_BUS_MAX * SCSI_ID_MAX); i++) { if (!(scsi_tracking[i >> 3] & (0xffLL << ((i & 0x07) << 3LL)))) { *id = i; return; @@ -2138,7 +2138,7 @@ recalc_next_free_id(HWND hdlg) enable_add = enable_add && !bus_full(&mfm_tracking, 2); enable_add = enable_add && !bus_full(&esdi_tracking, 2); enable_add = enable_add && !bus_full(&xta_tracking, 2); - enable_add = enable_add && !bus_full(&ide_tracking, 8); + enable_add = enable_add && !bus_full(&ide_tracking, IDE_CHAN_MAX); for (i = 0; i < 2; i++) enable_add = enable_add && !bus_full(&(scsi_tracking[i]), 8); @@ -3554,7 +3554,7 @@ win_settings_floppy_drives_recalc_list(HWND hdlg) lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE; lvI.stateMask = lvI.state = 0; - for (i = 0; i < 4; i++) { + for (i = 0; i < FDD_NUM; i++) { lvI.iSubItem = 0; if (temp_fdd_types[i] > 0) { t = fdd_getname(temp_fdd_types[i]); @@ -3600,7 +3600,7 @@ win_settings_cdrom_drives_recalc_list(HWND hdlg) lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE; lvI.stateMask = lvI.iSubItem = lvI.state = 0; - for (i = 0; i < 4; i++) { + for (i = 0; i < CDROM_NUM; i++) { fsid = combo_id_to_format_string_id(temp_cdrom[i].bus_type); lvI.iSubItem = 0; @@ -3947,13 +3947,13 @@ win_settings_zip_drives_init_columns(HWND hdlg) } static int -get_selected_drive(HWND hdlg, int id) +get_selected_drive(HWND hdlg, int id, int max) { int drive = -1; int i, j = 0; HWND h; - for (i = 0; i < 4; i++) { + for (i = 0; i < max; i++) { h = GetDlgItem(hdlg, id); j = ListView_GetItemState(h, i, LVIS_SELECTED); if (j) @@ -4179,12 +4179,12 @@ cdrom_add_locations(HWND hdlg) settings_add_string(hdlg, IDC_COMBO_CD_SPEED, (LPARAM) lptsTemp); } - for (i = 0; i < 64; i++) { + for (i = 0; i < (SCSI_BUS_MAX * SCSI_ID_MAX); i++) { wsprintf(lptsTemp, plat_get_string(IDS_4135), i >> 4, i & 15); settings_add_string(hdlg, IDC_COMBO_CD_ID, (LPARAM) lptsTemp); } - for (i = 0; i < 8; i++) { + for (i = 0; i < (IDE_BUS_MAX * IDE_CHAN_MAX); i++) { wsprintf(lptsTemp, plat_get_string(IDS_4097), i >> 1, i & 1); settings_add_string(hdlg, IDC_COMBO_CD_CHANNEL_IDE, (LPARAM) lptsTemp); } @@ -4245,12 +4245,12 @@ mo_add_locations(HWND hdlg) settings_add_string(hdlg, IDC_COMBO_MO_BUS, win_get_string(combo_id_to_string_id(i))); } - for (i = 0; i < 64; i++) { + for (i = 0; i < (SCSI_BUS_MAX * SCSI_ID_MAX); i++) { wsprintf(lptsTemp, plat_get_string(IDS_4135), i >> 4, i & 15); settings_add_string(hdlg, IDC_COMBO_MO_ID, (LPARAM) lptsTemp); } - for (i = 0; i < 8; i++) { + for (i = 0; i < (IDE_BUS_MAX * IDE_CHAN_MAX); i++) { wsprintf(lptsTemp, plat_get_string(IDS_4097), i >> 1, i & 1); settings_add_string(hdlg, IDC_COMBO_MO_CHANNEL_IDE, (LPARAM) lptsTemp); } @@ -4322,12 +4322,12 @@ zip_add_locations(HWND hdlg) settings_add_string(hdlg, IDC_COMBO_ZIP_BUS, win_get_string(combo_id_to_string_id(i))); } - for (i = 0; i < 64; i++) { + for (i = 0; i < (SCSI_BUS_MAX * SCSI_LUN_MAX) ; i++) { wsprintf(lptsTemp, plat_get_string(IDS_4135), i >> 4, i & 15); settings_add_string(hdlg, IDC_COMBO_ZIP_ID, (LPARAM) lptsTemp); } - for (i = 0; i < 8; i++) { + for (i = 0; i < (IDE_BUS_MAX * IDE_CHAN_MAX); i++) { wsprintf(lptsTemp, plat_get_string(IDS_4097), i >> 1, i & 1); settings_add_string(hdlg, IDC_COMBO_ZIP_CHANNEL_IDE, (LPARAM) lptsTemp); } @@ -4497,7 +4497,7 @@ win_settings_floppy_and_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam if ((((LPNMHDR) lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR) lParam)->idFrom == IDC_LIST_FLOPPY_DRIVES)) { old_sel = lv1_current_sel; - lv1_current_sel = get_selected_drive(hdlg, IDC_LIST_FLOPPY_DRIVES); + lv1_current_sel = get_selected_drive(hdlg, IDC_LIST_FLOPPY_DRIVES, FDD_NUM); if (lv1_current_sel == old_sel) return FALSE; ignore_change = 1; @@ -4507,7 +4507,7 @@ win_settings_floppy_and_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam ignore_change = 0; } else if ((((LPNMHDR) lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR) lParam)->idFrom == IDC_LIST_CDROM_DRIVES)) { old_sel = lv2_current_sel; - lv2_current_sel = get_selected_drive(hdlg, IDC_LIST_CDROM_DRIVES); + lv2_current_sel = get_selected_drive(hdlg, IDC_LIST_CDROM_DRIVES, CDROM_NUM); if (lv2_current_sel == old_sel) return FALSE; ignore_change = 1; @@ -4684,7 +4684,7 @@ win_settings_other_removable_devices_proc(HWND hdlg, UINT message, WPARAM wParam if ((((LPNMHDR) lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR) lParam)->idFrom == IDC_LIST_MO_DRIVES)) { old_sel = lv1_current_sel; - lv1_current_sel = get_selected_drive(hdlg, IDC_LIST_MO_DRIVES); + lv1_current_sel = get_selected_drive(hdlg, IDC_LIST_MO_DRIVES, MO_NUM); if (lv1_current_sel == old_sel) return FALSE; ignore_change = 1; @@ -4707,7 +4707,7 @@ win_settings_other_removable_devices_proc(HWND hdlg, UINT message, WPARAM wParam ignore_change = 0; } else if ((((LPNMHDR) lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR) lParam)->idFrom == IDC_LIST_ZIP_DRIVES)) { old_sel = lv2_current_sel; - lv2_current_sel = get_selected_drive(hdlg, IDC_LIST_ZIP_DRIVES); + lv2_current_sel = get_selected_drive(hdlg, IDC_LIST_ZIP_DRIVES, ZIP_NUM); if (lv2_current_sel == old_sel) return FALSE; ignore_change = 1; diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 4342626a4..96ad662bd 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -1491,13 +1491,15 @@ plat_pause(int p) } if (p) { + if (mouse_capture) + plat_mouse_capture(0); + wcsncpy(oldtitle, ui_window_title(NULL), sizeof_w(oldtitle) - 1); wcscpy(title, oldtitle); wcscat(title, plat_get_string(IDS_2051)); ui_window_title(title); - } else { + } else ui_window_title(oldtitle); - } /* If un-pausing, synchronize the internal clock with the host's time. */ if ((p == 0) && (time_sync & TIME_SYNC_ENABLED)) diff --git a/vcpkg.json b/vcpkg.json index f3b639078..19dd09354 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "86box", - "version-string": "3.6", + "version-string": "3.7.1", "homepage": "https://86box.net/", "documentation": "http://86box.readthedocs.io/", "license": "GPL-2.0-or-later",