diff --git a/cmake/intel-linux-x86_64.cmake b/cmake/intel-linux-x86_64.cmake new file mode 100644 index 000000000..a0c3e5d0b --- /dev/null +++ b/cmake/intel-linux-x86_64.cmake @@ -0,0 +1,20 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file defining GCC compiler flags +# for 64-bit x86 targets. +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + +include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-x86_64.cmake) + +set(CMAKE_C_COMPILER icx) +set(CMAKE_CXX_COMPILER icpx) diff --git a/cmake/llvm-linux-x86_64.cmake b/cmake/llvm-linux-x86_64.cmake new file mode 100644 index 000000000..ccdd7b18e --- /dev/null +++ b/cmake/llvm-linux-x86_64.cmake @@ -0,0 +1,23 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file defining Clang compiler flags +# for 64-bit x86 targets. +# +# Authors: David Hrdlička, +# dob205 +# +# Copyright 2021 David Hrdlička. +# Copyright 2022 dob205. +# + +include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-x86_64.cmake) + +# Use the GCC-compatible Clang executables in order to use our flags +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) diff --git a/src/86box.c b/src/86box.c index 0bcb34626..2bbd39eb8 100644 --- a/src/86box.c +++ b/src/86box.c @@ -174,7 +174,7 @@ int force_43 = 0; /* (C) video * int video_filter_method = 1; /* (C) video */ int video_vsync = 0; /* (C) video */ int video_framerate = -1; /* (C) video */ -bool serial_passthrough_enabled[SERIAL_MAX] = { 0, 0, 0, 0, 0, 0, 0 }; /* (C) activation and kind of +bool serial_passthrough_enabled[SERIAL_MAX - 1] = { 0, 0, 0, 0, 0, 0, 0 }; /* (C) activation and kind of pass-through for serial ports */ int bugger_enabled = 0; /* (C) enable ISAbugger */ int novell_keycard_enabled = 0; /* (C) enable Novell NetWare 2.x key card emulation. */ @@ -586,6 +586,62 @@ delete_nvr_file(uint8_t flash) extern void device_find_all_descs(void); +static void +pc_show_usage(char *s) +{ + char p[4096] = { 0 }; + + sprintf(p, + "\n%sUsage: 86box [options] [cfg-file]\n\n" + "Valid options are:\n\n" + "-? or --help\t\t\t- show this information\n" + "-C or --config path\t\t- set 'path' to be config file\n" +#ifdef _WIN32 + "-D or --debug\t\t\t- force debug output logging\n" +#endif +#if 0 + "-E or --nographic\t\t- forces the old behavior\n" +#endif + "-F or --fullscreen\t\t- start in fullscreen mode\n" + "-G or --lang langid\t\t- start with specified language\n" + "\t\t\t\t (e.g. en-US, or system)\n" +#ifdef _WIN32 + "-H or --hwnd id,hwnd\t\t- sends back the main dialog's hwnd\n" +#endif + "-I or --image d:path\t\t- load 'path' as floppy image on drive d\n" +#ifdef USE_INSTRUMENT + "-J or --instrument name\t- set 'name' to be the profiling instrument\n" +#endif + "-L or --logfile pat\t\t- set 'path' to be the logfile\n" + "-M or --missing\t\t- dump missing machines and video cards\n" + "-N or --noconfirm\t\t- do not ask for confirmation on quit\n" + "-P or --vmpath path\t\t- set 'path' to be root for vm\n" + "-R or --rompath path\t\t- set 'path' to be ROM path\n" +#ifndef USE_SDL_UI + "-S or --settings\t\t\t- show only the settings dialog\n" +#endif + "-T or --testmode\t\t- test mode: execute the test mode entry\n" + "\t\t\t\t point on init/hard reset\n" + "-V or --vmname name\t\t- overrides the name of the running VM\n" + "-W or --nohook\t\t- disables keyboard hook\n" + "\t\t\t\t (compatibility-only outside Windows)\n" + "-X or --clear what\t\t- clears the 'what' (cmos/flash/both)\n" + "-Y or --donothing\t\t- do not show any UI or run the emulation\n" + "-Z or --lastvmpath\t\t- the last parameter is VM path rather\n" + "\t\t\t\t than config\n" + "\nA config file can be specified. If none is, the default file will be used.\n", + (s == NULL) ? "" : s); + +#ifdef _WIN32 + ui_msgbox(MBX_ANSI | ((s == NULL) ? MBX_INFO : MBX_WARNING), p); +#else + if (s == NULL) + pclog(p); + else + ui_msgbox(MBX_ANSI | MBX_WARNING, p); +#endif +} + /* * Perform initial startup of the PC. * @@ -609,6 +665,7 @@ pc_init(int argc, char *argv[]) time_t now; int c; int lvmp = 0; + int deprecated = 1; #ifdef ENABLE_NG int ng = 0; #endif @@ -666,44 +723,7 @@ usage: } } - ui_msgbox(MBX_INFO, L"\nUsage: 86box [options] [cfg-file]\n\n" - "Valid options are:\n\n" - "-? or --help\t\t\t- show this information\n" - "-C or --config path\t\t- set 'path' to be config file\n" -#ifdef _WIN32 - "-D or --debug\t\t\t- force debug output logging\n" -#endif -#if 0 - "-E or --nographic\t\t- forces the old behavior\n" -#endif - "-F or --fullscreen\t\t- start in fullscreen mode\n" - "-G or --lang langid\t\t- start with specified language\n" - "\t\t\t\t (e.g. en-US, or system)\n" -#ifdef _WIN32 - "-H or --hwnd id,hwnd\t\t- sends back the main dialog's hwnd\n" -#endif - "-I or --image d:path\t\t- load 'path' as floppy image on drive d\n" -#ifdef USE_INSTRUMENT - "-J or --instrument name\t- set 'name' to be the profiling instrument\n" -#endif - "-L or --logfile pat\t\t- set 'path' to be the logfile\n" - "-M or --missing\t\t- dump missing machines and video cards\n" - "-N or --noconfirm\t\t- do not ask for confirmation on quit\n" - "-P or --vmpath path\t\t- set 'path' to be root for vm\n" - "-R or --rompath path\t\t- set 'path' to be ROM path\n" -#ifndef USE_SDL_UI - "-S or --settings\t\t\t- show only the settings dialog\n" -#endif - "-T or --testmode\t\t- test mode: execute the test mode entry\n" - "\t\t\t\t point on init/hard reset\n" - "-V or --vmname name\t\t- overrides the name of the running VM\n" - "-W or --nohook\t\t- disables keyboard hook\n" - "\t\t\t\t (compatibility-only outside Windows)\n" - "-X or --clear what\t\t- clears the 'what' (cmos/flash/both)\n" - "-Y or --donothing\t\t- do not show any UI or run the emulation\n" - "-Z or --lastvmpath\t\t- the last parameter is VM path rather\n" - "\t\t\t\t than config\n" - "\nA config file can be specified. If none is, the default file will be used.\n"); + pc_show_usage(NULL); return 0; } else if (!strcasecmp(argv[c], "--lastvmpath") || !strcasecmp(argv[c], "-Z")) { lvmp = 1; @@ -730,6 +750,7 @@ usage: goto usage; ppath = argv[++c]; + deprecated = 0; } else if (!strcasecmp(argv[c], "--rompath") || !strcasecmp(argv[c], "-R")) { if ((c + 1) == argc) goto usage; @@ -741,6 +762,7 @@ usage: goto usage; cfg = argv[++c]; + deprecated = 0; } else if (!strcasecmp(argv[c], "--image") || !strcasecmp(argv[c], "-I")) { if ((c + 1) == argc) goto usage; @@ -839,11 +861,18 @@ usage: ppath = argv[c++]; else cfg = argv[c++]; + + deprecated = 0; } if (c != argc) goto usage; + if (deprecated) + pc_show_usage("Running 86Box without a specified VM path and/or configuration\n" + "file has been deprected. Please specify one or use a manager\n" + "(Avalonia 86 is recommended).\n\n"); + path_slash(usr_path); path_slash(rom_path); diff --git a/src/codegen_new/codegen.h b/src/codegen_new/codegen.h index eecfa249b..0ff6a90d6 100644 --- a/src/codegen_new/codegen.h +++ b/src/codegen_new/codegen.h @@ -306,6 +306,7 @@ struct ir_data_t; x86seg *codegen_generate_ea(struct ir_data_t *ir, x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, uint32_t *op_pc, uint32_t op_32, int stack_offset); extern void codegen_check_seg_read(codeblock_t *block, struct ir_data_t *ir, x86seg *seg); extern void codegen_check_seg_write(codeblock_t *block, struct ir_data_t *ir, x86seg *seg); +extern void codegen_check_regs(void); extern int codegen_purge_purgable_list(void); /*Delete a random code block to free memory. This is obviously quite expensive, and diff --git a/src/codegen_new/codegen_block.c b/src/codegen_new/codegen_block.c index a8ea0e06e..ff82384be 100644 --- a/src/codegen_new/codegen_block.c +++ b/src/codegen_new/codegen_block.c @@ -217,6 +217,7 @@ block_free_list_get(void) void codegen_init(void) { + codegen_check_regs(); codegen_allocator_init(); codegen_backend_init(); diff --git a/src/codegen_new/codegen_reg.c b/src/codegen_new/codegen_reg.c index ba60ab038..75cf25ded 100644 --- a/src/codegen_new/codegen_reg.c +++ b/src/codegen_new/codegen_reg.c @@ -226,6 +226,20 @@ reg_is_native_size(ir_reg_t ir_reg) return 0; } +void +codegen_check_regs(void) +{ + int i = 0; + for (i = 0; i < IREG_COUNT; i++) { + if (ireg_data[i].is_volatile == REG_VOLATILE) + continue; + + if (ireg_data[i].p && ((uintptr_t)ireg_data[i].p - (uintptr_t)&cpu_state) >= sizeof(cpu_state)) { + fatal("Register number %d outside cpu_state!\n", i); + } + } +} + void codegen_reg_reset(void) { diff --git a/src/config.c b/src/config.c index 98923d9cf..52a80763a 100644 --- a/src/config.c +++ b/src/config.c @@ -746,7 +746,7 @@ load_ports(void) char temp[512]; memset(temp, 0, sizeof(temp)); - for (int c = 0; c < SERIAL_MAX; c++) { + for (int c = 0; c < (SERIAL_MAX - 1); c++) { sprintf(temp, "serial%d_enabled", c + 1); com_ports[c].enabled = !!ini_section_get_int(cat, temp, (c >= 2) ? 0 : 1); @@ -1839,7 +1839,7 @@ config_load(void) com_ports[0].enabled = 1; com_ports[1].enabled = 1; - for (i = 2; i < SERIAL_MAX; i++) + for (i = 2; i < (SERIAL_MAX - 1); i++) com_ports[i].enabled = 0; lpt_ports[0].enabled = 1; @@ -2459,7 +2459,7 @@ save_ports(void) ini_section_t cat = ini_find_or_create_section(config, "Ports (COM & LPT)"); char temp[512]; - for (int c = 0; c < SERIAL_MAX; c++) { + for (int c = 0; c < (SERIAL_MAX - 1); c++) { sprintf(temp, "serial%d_enabled", c + 1); if (((c < 2) && com_ports[c].enabled) || ((c >= 2) && !com_ports[c].enabled)) ini_section_delete_var(cat, temp); diff --git a/src/cpu/386_common.c b/src/cpu/386_common.c index c6a759d36..2853e3c9a 100644 --- a/src/cpu/386_common.c +++ b/src/cpu/386_common.c @@ -113,8 +113,6 @@ uint8_t is_smint = 0; uint16_t io_port = 0x0000; uint32_t io_val = 0x00000000; -uint32_t x87_op = 0x00000000; - int opcode_has_modrm[256] = { 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/ diff --git a/src/cpu/808x.c b/src/cpu/808x.c index e98b7de3d..dda688ee1 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -38,6 +38,7 @@ #include <86box/ppi.h> #include <86box/timer.h> #include <86box/gdbstub.h> +#include <86box/plat_fallthrough.h> #include <86box/plat_unused.h> /* Is the CPU 8088 or 8086. */ @@ -3438,10 +3439,13 @@ execx86(int cycs) set_pzs(8); break; case 0xD6: /*SALC*/ - wait(1, 0); - AL = (cpu_state.flags & C_FLAG) ? 0xff : 0x00; - wait(1, 0); - break; + if (!is_nec) { + wait(1, 0); + AL = (cpu_state.flags & C_FLAG) ? 0xff : 0x00; + wait(1, 0); + break; + } + fallthrough; case 0xD7: /*XLATB*/ cpu_state.eaaddr = (BX + AL) & 0xffff; access(4, 8); diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index b76e2d622..b6f5f593c 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -416,6 +416,8 @@ typedef struct { uint16_t eflags; uint32_t _smbase; + + uint32_t x87_op; } cpu_state_t; #define in_smm cpu_state._in_smm @@ -784,7 +786,7 @@ typedef struct { uint32_t smhr; } cyrix_t; -extern uint32_t x87_op; +#define x87_op cpu_state.x87_op extern uint32_t addr64; extern uint32_t addr64_2; diff --git a/src/cpu/x86.c b/src/cpu/x86.c index 97ae19f3a..a8ab9d866 100644 --- a/src/cpu/x86.c +++ b/src/cpu/x86.c @@ -272,6 +272,7 @@ reset_common(int hard) msr.fcr = (1 << 8) | (1 << 9) | (1 << 12) | (1 << 16) | (1 << 19) | (1 << 21); msw = 0; new_ne = 0; + x87_op = 0; ccr0 = ccr1 = ccr2 = ccr3 = ccr4 = ccr5 = ccr6 = ccr7 = 0; ccr4 = 0x85; diff --git a/src/device/mouse.c b/src/device/mouse.c index f7d8c9861..0bf87934d 100644 --- a/src/device/mouse.c +++ b/src/device/mouse.c @@ -83,23 +83,24 @@ static const device_t mouse_internal_device = { static mouse_t mouse_devices[] = { // clang-format off - { &mouse_none_device }, - { &mouse_internal_device }, - { &mouse_logibus_device }, - { &mouse_msinport_device }, + { &mouse_none_device }, + { &mouse_internal_device }, + { &mouse_logibus_device }, + { &mouse_msinport_device }, #ifdef USE_GENIBUS - { &mouse_genibus_device }, + { &mouse_genibus_device }, #endif - { &mouse_mssystems_device }, - { &mouse_msserial_device }, - { &mouse_ltserial_device }, - { &mouse_ps2_device }, + { &mouse_mssystems_device }, + { &mouse_mssystems_bus_device }, + { &mouse_msserial_device }, + { &mouse_ltserial_device }, + { &mouse_ps2_device }, #ifdef USE_WACOM - { &mouse_wacom_device }, - { &mouse_wacom_artpad_device }, + { &mouse_wacom_device }, + { &mouse_wacom_artpad_device }, #endif - { &mouse_mtouch_device }, - { NULL } + { &mouse_mtouch_device }, + { NULL } // clang-format on }; diff --git a/src/device/mouse_serial.c b/src/device/mouse_serial.c index 8ed4865cd..7505cf3a3 100644 --- a/src/device/mouse_serial.c +++ b/src/device/mouse_serial.c @@ -833,10 +833,6 @@ sermouse_close(void *priv) { mouse_t *dev = (mouse_t *) priv; - /* Detach serial port from the mouse. */ - if (dev && dev->serial && dev->serial->sd) - memset(dev->serial->sd, 0, sizeof(serial_device_t)); - free(dev); } @@ -847,7 +843,15 @@ sermouse_init(const device_t *info) mouse_t *dev; void (*rcr_callback)(struct serial_s *serial, void *priv); void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data); - void (*transmit_period_callback)(struct serial_s *serial, void *priv, double transmit_period); + void (*transmit_period_callback)(struct serial_s *serial, void *priv, + double transmit_period); + + if (info->local == MOUSE_TYPE_MSYSTEMSB) { + uintptr_t irqbase = ((device_get_config_int("irq") << 16) | + (device_get_config_hex16("addr") << 20)) | + ns16450_device.local; + device_add_params(&ns16450_device, (void*)irqbase); + } dev = (mouse_t *) calloc(1, sizeof(mouse_t)); dev->name = info->name; @@ -862,7 +866,7 @@ sermouse_init(const device_t *info) if (dev->but > 2) dev->flags |= FLAG_3BTN; - if (info->local == MOUSE_TYPE_MSYSTEMS) { + if (info->local == MOUSE_TYPE_MSYSTEMS || info->local == MOUSE_TYPE_MSYSTEMSB) { dev->format = 0; dev->type = info->local; dev->id_len = 1; @@ -893,7 +897,7 @@ sermouse_init(const device_t *info) } } - dev->port = device_get_config_int("port"); + dev->port = (info->local == MOUSE_TYPE_MSYSTEMSB) ? (SERIAL_MAX - 1) : device_get_config_int("port"); /* Attach a serial port to the mouse. */ rcr_callback = dev->rts_toggle ? sermouse_callback : NULL; @@ -968,6 +972,78 @@ static const device_config_t msssermouse_config[] = { // clang-format on }; +static const device_config_t mssbusmouse_config[] = { + // clang-format off + { + .name = "addr", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = NULL, + .default_int = 0x238, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "0x338", .value = 0x338 }, + { .description = "0x238", .value = 0x238 }, + { .description = "0x3f8", .value = 0x3f8 }, + { .description = "0x2f8", .value = 0x2f8 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 5, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 3", .value = 3 }, + { .description = "IRQ 4", .value = 4 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "IRQ 7", .value = 7 }, + { .description = "IRQ 10", .value = 10 }, + { .description = "IRQ 11", .value = 11 }, + { .description = "IRQ 12", .value = 12 }, + { .description = "IRQ 15", .value = 15 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + { + .name = "buttons", + .description = "Buttons", + .type = CONFIG_SELECTION, + .default_string = NULL, + .default_int = 2, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { + { .description = "Two", .value = 2 }, + { .description = "Three", .value = 3 }, + { .description = "" } + }, + .bios = { { 0 } } + }, + { + .name = "rts_toggle", + .description = "RTS toggle", + .type = CONFIG_BINARY, + .default_string = NULL, + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { { 0 } } + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on + }; + static const device_config_t mssermouse_config[] = { // clang-format off { @@ -1087,6 +1163,20 @@ const device_t mouse_mssystems_device = { .config = msssermouse_config }; +const device_t mouse_mssystems_bus_device = { + .name = "Mouse Systems Bus Mouse", + .internal_name = "mssystems_bus", + .flags = DEVICE_ISA, + .local = MOUSE_TYPE_MSYSTEMSB, + .init = sermouse_init, + .close = sermouse_close, + .reset = NULL, + .available = NULL, + .speed_changed = sermouse_speed_changed, + .force_redraw = NULL, + .config = mssbusmouse_config +}; + const device_t mouse_msserial_device = { .name = "Microsoft Serial Mouse", .internal_name = "msserial", diff --git a/src/device/serial.c b/src/device/serial.c index deb97225a..71be924c1 100644 --- a/src/device/serial.c +++ b/src/device/serial.c @@ -884,10 +884,10 @@ serial_close(void *priv) { serial_t *dev = (serial_t *) priv; - next_inst--; - - if (com_ports[dev->inst].enabled) + if (dev->sd) { + memset(dev->sd, 0, sizeof(serial_device_t)); fifo_close(dev->rcvr_fifo); + } free(dev); } @@ -897,7 +897,7 @@ serial_reset(void *priv) { serial_t *dev = (serial_t *) priv; - if (com_ports[dev->inst].enabled) { + if (dev->sd) { timer_disable(&dev->transmit_timer); timer_disable(&dev->timeout_timer); timer_disable(&dev->receive_timer); @@ -930,16 +930,26 @@ static void * serial_init(const device_t *info) { serial_t *dev = (serial_t *) calloc(1, sizeof(serial_t)); + int orig_inst = next_inst; + + if (info->local & 0xFFF00000) + next_inst = SERIAL_MAX - 1; dev->inst = next_inst; - if (com_ports[next_inst].enabled) { + if (com_ports[next_inst].enabled || (info->local & 0xFFF00000)) { serial_log("Adding serial port %i...\n", next_inst); dev->type = info->local; memset(&(serial_devices[next_inst]), 0, sizeof(serial_device_t)); dev->sd = &(serial_devices[next_inst]); dev->sd->serial = dev; - if (next_inst == 6) + + if (info->local & 0xfff00000) { + dev->base_address = info->local >> 20; + dev->irq = (info->local >> 16) & 0xF; + io_sethandler(dev->base_address, 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, dev); + next_inst = orig_inst; + } else if (next_inst == 6) serial_setup(dev, COM7_ADDR, COM7_IRQ); else if (next_inst == 5) serial_setup(dev, COM6_ADDR, COM6_IRQ); @@ -984,7 +994,8 @@ serial_init(const device_t *info) serial_reset_port(dev); } - next_inst++; + if (!(info->local & 0xfff00000)) + next_inst++; return dev; } @@ -998,7 +1009,7 @@ serial_set_next_inst(int ni) void serial_standalone_init(void) { - while (next_inst < SERIAL_MAX) + while (next_inst < (SERIAL_MAX - 1)) device_add_inst(&ns8250_device, next_inst + 1); }; diff --git a/src/device/serial_passthrough.c b/src/device/serial_passthrough.c index 3ad969006..25db29096 100644 --- a/src/device/serial_passthrough.c +++ b/src/device/serial_passthrough.c @@ -54,7 +54,7 @@ serial_passthrough_log(const char *fmt, ...) void serial_passthrough_init(void) { - for (uint8_t c = 0; c < SERIAL_MAX; c++) { + for (uint8_t c = 0; c < (SERIAL_MAX - 1); c++) { if (serial_passthrough_enabled[c]) { /* Instance n for COM n */ device_add_inst(&serial_passthrough_device, c + 1); diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 7f7723bba..e19665535 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -27,7 +27,7 @@ /* Configuration values. */ #define GFXCARD_MAX 2 -#define SERIAL_MAX 7 +#define SERIAL_MAX 8 #define PARALLEL_MAX 4 #define SCREEN_RES_X 640 #define SCREEN_RES_Y 480 diff --git a/src/include/86box/mouse.h b/src/include/86box/mouse.h index 333849846..8dd3bad2d 100644 --- a/src/include/86box/mouse.h +++ b/src/include/86box/mouse.h @@ -41,6 +41,7 @@ #define MOUSE_TYPE_PS2 11 /* PS/2 series Bus Mouse */ #define MOUSE_TYPE_WACOM 12 /* WACOM tablet */ #define MOUSE_TYPE_WACOMARTP 13 /* WACOM tablet (ArtPad) */ +#define MOUSE_TYPE_MSYSTEMSB 14 /* Mouse Systems bus mouse */ #define MOUSE_TYPE_ONBOARD 0x80 /* Mouse is an on-board version of one of the above. */ @@ -68,6 +69,7 @@ extern const device_t mouse_msinport_device; extern const device_t mouse_genibus_device; # endif extern const device_t mouse_mssystems_device; +extern const device_t mouse_mssystems_bus_device; extern const device_t mouse_msserial_device; extern const device_t mouse_ltserial_device; extern const device_t mouse_ps2_device; diff --git a/src/include/86box/serial_passthrough.h b/src/include/86box/serial_passthrough.h index 7ca6479d6..c5454194a 100644 --- a/src/include/86box/serial_passthrough.h +++ b/src/include/86box/serial_passthrough.h @@ -55,7 +55,7 @@ typedef struct serial_passthrough_s { void *backend_priv; /* Private platform backend data */ } serial_passthrough_t; -extern bool serial_passthrough_enabled[SERIAL_MAX]; +extern bool serial_passthrough_enabled[SERIAL_MAX - 1]; extern const device_t serial_passthrough_device; extern void serial_passthrough_init(void); diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 932aa718a..6de73f9f9 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -315,6 +315,8 @@ typedef struct svga_t { card should not attempt to display anything. */ void (*render_override)(void *priv); void * priv_parent; + + void * local; } svga_t; extern void ibm8514_set_poll(svga_t *svga); diff --git a/src/qt/languages/pt-BR.po b/src/qt/languages/pt-BR.po index 8961f11b8..e33630ccf 100644 --- a/src/qt/languages/pt-BR.po +++ b/src/qt/languages/pt-BR.po @@ -631,7 +631,7 @@ msgid " - PAUSED" msgstr " - PAUSADO" msgid "Press %s to return to windowed mode." -msgstr "Use %s para retornar ao modo janela" +msgstr "Use %s para retornar ao modo janela." msgid "Speed" msgstr "Velocidade" @@ -847,7 +847,7 @@ msgid "86Box v" msgstr "86Box versão" msgid "An emulator of old computers\n\nAuthors: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, and others.\n\nWith previous core contributions from Sarah Walker, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2 or later. See LICENSE for more information." -msgstr "Um emulador de computadores antigos\n\nAutores: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, e outros.\n\nCom contribuições anteriores de Sarah Walker, leilei, JohnElliott, greatpsycho, e outros.\n\nTraduzido por: Altieres Lima da Silva\n\nLançado sob a Licença Pública Geral GNU, versão 2 ou posterior. Veja o arquivo LICENSE para mais informações." +msgstr "Um emulador de computadores antigos\n\nAutores: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, e outros.\n\nCom contribuições anteriores de Sarah Walker, leilei, JohnElliott, greatpsycho, e outros.\n\nTraduzido por: Altieres Lima da Silva, Nelson K. Hennemann Filho\n\nLançado sob a Licença Pública Geral GNU, versão 2 ou posterior. Veja o arquivo LICENSE para mais informações." msgid "Hardware not available" msgstr "Hardware não disponível" @@ -967,13 +967,13 @@ msgid "HDI or HDX images with a sector size other than 512 are not supported." msgstr "Imagens HDI ou HDX com um tamanho de setor que não seja 512 não são suportadas." msgid "Disk image file already exists" -msgstr "Esta imagem existe" +msgstr "A imagem de disco já existe" msgid "Please specify a valid file name." msgstr "Digite um nome de arquivo válido." msgid "Disk image created" -msgstr "A imagem foi criada com sucesso" +msgstr "A imagem de disco foi criada" msgid "Make sure the file exists and is readable." msgstr "Certifique-se de que o arquivo existe e é legível." @@ -982,7 +982,7 @@ msgid "Make sure the file is being saved to a writable directory." msgstr "Certifique-se de que o arquivo está sendo salvo em um diretório gravável." msgid "Disk image too large" -msgstr "A imagem do disco é muito grande" +msgstr "A imagem de disco é muito grande" msgid "Remember to partition and format the newly-created drive." msgstr "Lembre-se de particionar e formatar a unidade recém-criada." @@ -1312,16 +1312,16 @@ msgid "This machine might have been moved or copied." msgstr "Essa máquina pode ter sido movida ou copiada." msgid "In order to ensure proper networking functionality, 86Box needs to know if this machine was moved or copied.\n\nSelect \"I Copied It\" if you are not sure." -msgstr "Para garantir a funcionalidade adequada da rede, o 86Box precisa saber se essa máquina foi movida ou copiada.\n\nSelecione \"A copiei\" se não tiver certeza." +msgstr "Para garantir a funcionalidade adequada da rede, o 86Box precisa saber se essa máquina foi movida ou copiada.\n\nSelecione \"Copiei\" se não tiver certeza." msgid "I Moved It" -msgstr "O movi" +msgstr "Movi" msgid "I Copied It" -msgstr "A copiei" +msgstr "Copiei" msgid "86Box Monitor #" -msgstr "Monitor 86Box " +msgstr "Monitor 86Box #" msgid "No MCA devices." msgstr "Nenhum dispositivo MCA." @@ -1483,7 +1483,7 @@ msgid "MIDI Clockout" msgstr "Saída do relógio MIDI" msgid "SoundFont" -msgstr "Fonte de som" +msgstr "SoundFont" msgid "Output Gain" msgstr "Ganho de saída" @@ -1789,7 +1789,7 @@ msgid "4th Order" msgstr "De 4ª ordem" msgid "7th Order" -msgstr "De 7º order" +msgstr "De 7ª ordem" msgid "Non-timed (original)" msgstr "Sem cronômetro (original)" @@ -1807,10 +1807,10 @@ msgid "Wheel" msgstr "Roda" msgid "Five + Wheel" -msgstr "Cinco + roda" +msgstr "Cinco + Roda" msgid "Five + 2 Wheels" -msgstr "" +msgstr "Cinco + 2 Rodas" msgid "A3 - SMT2 Serial / SMT3(R)V" msgstr "A3 - SMT2 Serial / SMT3(R)V" @@ -2035,7 +2035,7 @@ msgid "Baud Rate of Passthrough" msgstr "Taxa de transmissão de passagem" msgid "Named Pipe (Server)" -msgstr "Tubo nomeado (servidor)" +msgstr "Pipe nomeado (servidor)" msgid "Host Serial Passthrough" msgstr "Passagem da porta serial do host" @@ -2053,28 +2053,28 @@ msgid "High performance impact" msgstr "Alto impacto no desempenho" msgid "[Generic] RAM Disk (max. speed)" -msgstr "[Generic] Disco RAM (velocidade máxima)" +msgstr "[Genérico] Disco RAM (velocidade máxima)" msgid "[Generic] 1989 (3500 RPM)" -msgstr "" +msgstr "[Genérico] 1989 (3500 RPM)" msgid "[Generic] 1992 (3600 RPM)" -msgstr "" +msgstr "[Genérico] 1992 (3600 RPM)" msgid "[Generic] 1994 (4500 RPM)" -msgstr "" +msgstr "[Genérico] 1994 (4500 RPM)" msgid "[Generic] 1996 (5400 RPM)" -msgstr "" +msgstr "[Genérico] 1996 (5400 RPM)" msgid "[Generic] 1997 (5400 RPM)" -msgstr "" +msgstr "[Genérico] 1997 (5400 RPM)" msgid "[Generic] 1998 (5400 RPM)" -msgstr "" +msgstr "[Genérico] 1998 (5400 RPM)" msgid "[Generic] 2000 (7200 RPM)" -msgstr "" +msgstr "[Genérico] 2000 (7200 RPM)" msgid "IBM 8514/A clone (ISA)" msgstr "Clone IBM 8514/A (ISA)" @@ -2095,64 +2095,106 @@ msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for t msgstr "As fontes TrueType no diretório \"roms/printer/fonts\" são necessárias para a emulação da impressora matricial de pontos ESC/P genérica." msgid "Inhibit multimedia keys" -msgstr "" +msgstr "Inibir teclas multimídia" msgid "Ask for confirmation before saving settings" -msgstr "" +msgstr "Perguntar antes de salvar configurações" msgid "Ask for confirmation before hard resetting" -msgstr "" +msgstr "Perguntar antes de reinicialização completa" msgid "Ask for confirmation before quitting" -msgstr "" +msgstr "Perguntar antes de sair" msgid "Display hotkey message when entering full-screen mode" -msgstr "" +msgstr "Mostrar mensagem de atalho quando entrar em tela cheia" msgid "Options" -msgstr "" +msgstr "Opções" msgid "Model" -msgstr "" +msgstr "Modelo" msgid "Model:" -msgstr "" +msgstr "Modelo:" msgid "Failed to initialize Vulkan renderer." -msgstr "" +msgstr "Falha ao inicializar o renderizador Vulkan." msgid "GLSL Error" -msgstr "" +msgstr "Erro GLSL" msgid "Could not load shader: %1" -msgstr "" +msgstr "Impossível carregar o shader: %1" msgid "OpenGL version 3.0 or greater is required. Current GLSL version is %1.%2" -msgstr "" +msgstr "OpenGL versão 3.0 ou superior é exigido. Versão atual GLSL é %1.%2" msgid "Could not load texture: %1" -msgstr "" +msgstr "Impossível carregar a textura: %1" msgid "Could not compile shader:\n\n%1" -msgstr "" +msgstr "Impossível compilar o shader:\n\n%1" msgid "Program not linked:\n\n%1" -msgstr "" +msgstr "Programa não linkado:\n\n%1" msgid "Shader Manager" -msgstr "" +msgstr "Gerenciador de Shader" msgid "Shader Configuration" -msgstr "" +msgstr "Configuração de Shader" msgid "Add" -msgstr "" +msgstr "Adicionar" msgid "Move up" -msgstr "" +msgstr "Mover para cima" msgid "Move down" -msgstr "" +msgstr "Mover para baixo" msgid "Could not load file %1" -msgstr "" +msgstr "Impossível carregar arquivo %1" + +msgid "Key Bindings:" +msgstr "Atalhos:" + +msgid "Action" +msgstr "Ação" + +msgid "Keybind" +msgstr "Atalho" + +msgid "Clear binding" +msgstr "Limpar atalho" + +msgid "Bind" +msgstr "Vincular" + +msgid "Bind Key" +msgstr "Vincular tecla" + +msgid "Enter key combo:" +msgstr "Pressione combinação de teclas:" + +msgid "Send Control+Alt+Del" +msgstr "Enviar Control+Alt+Del" + +msgid "Send Control+Alt+Escape" +msgstr "Enviar Control+Alt+Escape" + +msgid "Toggle fullscreen" +msgstr "Alternar tela cheia" + +msgid "Screenshot" +msgstr "Captura de tela" + +msgid "Release mouse pointer" +msgstr "Liberar ponteiro do mouse" + +msgid "Toggle pause" +msgstr "Alternar pausa" + +msgid "Toggle mute" +msgstr "Alternar mudo" diff --git a/src/qt/qt_deviceconfig.hpp b/src/qt/qt_deviceconfig.hpp index a16c152a6..a5214111f 100644 --- a/src/qt/qt_deviceconfig.hpp +++ b/src/qt/qt_deviceconfig.hpp @@ -23,7 +23,7 @@ public: ~DeviceConfig() override; static void ConfigureDevice(const _device_ *device, int instance = 0, - Settings *settings = nullptr); + Settings *settings = qobject_cast(Settings::settings)); static QString DeviceName(const _device_ *device, const char *internalName, int bus); private: diff --git a/src/qt/qt_settingsdisplay.cpp b/src/qt/qt_settingsdisplay.cpp index b7a930711..fbe6ab5cc 100644 --- a/src/qt/qt_settingsdisplay.cpp +++ b/src/qt/qt_settingsdisplay.cpp @@ -122,22 +122,22 @@ SettingsDisplay::on_pushButtonConfigure_clicked() auto *device = video_card_getdevice(videoCard); if (videoCard == VID_INTERNAL) device = machine_get_vid_device(machineId); - DeviceConfig::ConfigureDevice(device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device); } void SettingsDisplay::on_pushButtonConfigureVoodoo_clicked() { - DeviceConfig::ConfigureDevice(&voodoo_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&voodoo_device); } void SettingsDisplay::on_pushButtonConfigure8514_clicked() { if (machine_has_bus(machineId, MACHINE_BUS_MCA) > 0) { - DeviceConfig::ConfigureDevice(&ibm8514_mca_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&ibm8514_mca_device); } else { - DeviceConfig::ConfigureDevice(&gen8514_isa_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&gen8514_isa_device); } } @@ -145,16 +145,16 @@ void SettingsDisplay::on_pushButtonConfigureXga_clicked() { if (machine_has_bus(machineId, MACHINE_BUS_MCA) > 0) { - DeviceConfig::ConfigureDevice(&xga_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&xga_device); } else { - DeviceConfig::ConfigureDevice(&xga_isa_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&xga_isa_device); } } void SettingsDisplay::on_pushButtonConfigureDa2_clicked() { - DeviceConfig::ConfigureDevice(&ps55da2_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&ps55da2_device); } void @@ -298,5 +298,5 @@ void SettingsDisplay::on_pushButtonConfigureSecondary_clicked() { auto *device = video_card_getdevice(ui->comboBoxVideoSecondary->currentData().toInt()); - DeviceConfig::ConfigureDevice(device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device); } diff --git a/src/qt/qt_settingsinput.cpp b/src/qt/qt_settingsinput.cpp index 695dc43e9..f3729ab3f 100644 --- a/src/qt/qt_settingsinput.cpp +++ b/src/qt/qt_settingsinput.cpp @@ -274,7 +274,7 @@ void SettingsInput::on_pushButtonConfigureMouse_clicked() { int mouseId = ui->comboBoxMouse->currentData().toInt(); - DeviceConfig::ConfigureDevice(mouse_get_device(mouseId), 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(mouse_get_device(mouseId)); } static int diff --git a/src/qt/qt_settingsmachine.cpp b/src/qt/qt_settingsmachine.cpp index 939cd9eb2..8548ca8cc 100644 --- a/src/qt/qt_settingsmachine.cpp +++ b/src/qt/qt_settingsmachine.cpp @@ -347,7 +347,7 @@ SettingsMachine::on_pushButtonConfigure_clicked() // deviceconfig_inst_open int machineId = ui->comboBoxMachine->currentData().toInt(); const auto *device = machine_get_device(machineId); - DeviceConfig::ConfigureDevice(device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device); } void SettingsMachine::on_checkBoxFPUSoftfloat_stateChanged(int state) { diff --git a/src/qt/qt_settingsnetwork.cpp b/src/qt/qt_settingsnetwork.cpp index 9a53411d5..1ea48ee6b 100644 --- a/src/qt/qt_settingsnetwork.cpp +++ b/src/qt/qt_settingsnetwork.cpp @@ -240,7 +240,7 @@ SettingsNetwork::on_pushButtonConf1_clicked() auto *device = network_card_getdevice(netCard); if (netCard == NET_INTERNAL) device = machine_get_net_device(machineId); - DeviceConfig::ConfigureDevice(device, 1, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device, 1); } void @@ -248,7 +248,7 @@ SettingsNetwork::on_pushButtonConf2_clicked() { int netCard = ui->comboBoxNIC2->currentData().toInt(); auto *device = network_card_getdevice(netCard); - DeviceConfig::ConfigureDevice(device, 2, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device, 2); } void @@ -256,7 +256,7 @@ SettingsNetwork::on_pushButtonConf3_clicked() { int netCard = ui->comboBoxNIC3->currentData().toInt(); auto *device = network_card_getdevice(netCard); - DeviceConfig::ConfigureDevice(device, 3, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device, 3); } void @@ -264,5 +264,5 @@ SettingsNetwork::on_pushButtonConf4_clicked() { int netCard = ui->comboBoxNIC4->currentData().toInt(); auto *device = network_card_getdevice(netCard); - DeviceConfig::ConfigureDevice(device, 4, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device, 4); } diff --git a/src/qt/qt_settingsotherperipherals.cpp b/src/qt/qt_settingsotherperipherals.cpp index b780dc1a6..e1920bf47 100644 --- a/src/qt/qt_settingsotherperipherals.cpp +++ b/src/qt/qt_settingsotherperipherals.cpp @@ -159,7 +159,7 @@ SettingsOtherPeripherals::on_comboBoxRTC_currentIndexChanged(int index) void SettingsOtherPeripherals::on_pushButtonConfigureRTC_clicked() { - DeviceConfig::ConfigureDevice(isartc_get_device(ui->comboBoxRTC->currentData().toInt()), 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(isartc_get_device(ui->comboBoxRTC->currentData().toInt())); } void @@ -174,7 +174,7 @@ SettingsOtherPeripherals::on_comboBoxCard1_currentIndexChanged(int index) void SettingsOtherPeripherals::on_pushButtonConfigureCard1_clicked() { - DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard1->currentData().toInt()), 1, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard1->currentData().toInt()), 1); } void @@ -189,7 +189,7 @@ SettingsOtherPeripherals::on_comboBoxCard2_currentIndexChanged(int index) void SettingsOtherPeripherals::on_pushButtonConfigureCard2_clicked() { - DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard2->currentData().toInt()), 2, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard2->currentData().toInt()), 2); } void @@ -204,7 +204,7 @@ SettingsOtherPeripherals::on_comboBoxCard3_currentIndexChanged(int index) void SettingsOtherPeripherals::on_pushButtonConfigureCard3_clicked() { - DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard3->currentData().toInt()), 3, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard3->currentData().toInt()), 3); } void @@ -219,7 +219,7 @@ SettingsOtherPeripherals::on_comboBoxCard4_currentIndexChanged(int index) void SettingsOtherPeripherals::on_pushButtonConfigureCard4_clicked() { - DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard4->currentData().toInt()), 4, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(isamem_get_device(ui->comboBoxCard4->currentData().toInt()), 4); } void diff --git a/src/qt/qt_settingsports.cpp b/src/qt/qt_settingsports.cpp index f68106dc9..7e8f2aeda 100644 --- a/src/qt/qt_settingsports.cpp +++ b/src/qt/qt_settingsports.cpp @@ -58,7 +58,7 @@ SettingsPorts::save() lpt_ports[i].enabled = checkBox->isChecked() ? 1 : 0; } - for (int i = 0; i < SERIAL_MAX; i++) { + for (int i = 0; i < (SERIAL_MAX - 1); i++) { auto *checkBox = findChild(QString("checkBoxSerial%1").arg(i + 1)); auto *checkBoxPass = findChild(QString("checkBoxSerialPassThru%1").arg(i + 1)); if (checkBox != NULL) @@ -118,7 +118,7 @@ SettingsPorts::onCurrentMachineChanged(int machineId) cbox[i]->setEnabled(lpt_ports[i].enabled > 0); } - for (int i = 0; i < SERIAL_MAX; i++) { + for (int i = 0; i < (SERIAL_MAX - 1); i++) { auto *checkBox = findChild(QString("checkBoxSerial%1").arg(i + 1)); auto *checkBoxPass = findChild(QString("checkBoxSerialPassThru%1").arg(i + 1)); auto *buttonPass = findChild(QString("pushButtonSerialPassThru%1").arg(i + 1)); @@ -254,43 +254,43 @@ SettingsPorts::on_checkBoxSerialPassThru7_stateChanged(int state) void SettingsPorts::on_pushButtonSerialPassThru1_clicked() { - DeviceConfig::ConfigureDevice(&serial_passthrough_device, 1, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&serial_passthrough_device, 1); } void SettingsPorts::on_pushButtonSerialPassThru2_clicked() { - DeviceConfig::ConfigureDevice(&serial_passthrough_device, 2, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&serial_passthrough_device, 2); } void SettingsPorts::on_pushButtonSerialPassThru3_clicked() { - DeviceConfig::ConfigureDevice(&serial_passthrough_device, 3, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&serial_passthrough_device, 3); } void SettingsPorts::on_pushButtonSerialPassThru4_clicked() { - DeviceConfig::ConfigureDevice(&serial_passthrough_device, 4, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&serial_passthrough_device, 4); } #if 0 void SettingsPorts::on_pushButtonSerialPassThru5_clicked() { - DeviceConfig::ConfigureDevice(&serial_passthrough_device, 5, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&serial_passthrough_device, 5); } void SettingsPorts::on_pushButtonSerialPassThru6_clicked() { - DeviceConfig::ConfigureDevice(&serial_passthrough_device, 6, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&serial_passthrough_device, 6); } void SettingsPorts::on_pushButtonSerialPassThru7_clicked() { - DeviceConfig::ConfigureDevice(&serial_passthrough_device, 7, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&serial_passthrough_device, 7); } #endif diff --git a/src/qt/qt_settingssound.cpp b/src/qt/qt_settingssound.cpp index 3e1240888..e49e1ae27 100644 --- a/src/qt/qt_settingssound.cpp +++ b/src/qt/qt_settingssound.cpp @@ -232,7 +232,7 @@ SettingsSound::on_pushButtonConfigureSoundCard1_clicked() if (sndCard == SOUND_INTERNAL) device = machine_get_snd_device(machineId); - DeviceConfig::ConfigureDevice(device, 1, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device, 1); } void @@ -252,7 +252,7 @@ SettingsSound::on_pushButtonConfigureSoundCard2_clicked() { int sndCard = ui->comboBoxSoundCard2->currentData().toInt(); const device_t *device = sound_card_getdevice(sndCard); - DeviceConfig::ConfigureDevice(device, 2, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device, 2); } void @@ -273,7 +273,7 @@ SettingsSound::on_pushButtonConfigureSoundCard3_clicked() int sndCard = ui->comboBoxSoundCard3->currentData().toInt(); const device_t *device = sound_card_getdevice(sndCard); - DeviceConfig::ConfigureDevice(device, 3, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device, 3); } void @@ -294,7 +294,7 @@ SettingsSound::on_pushButtonConfigureSoundCard4_clicked() int sndCard = ui->comboBoxSoundCard4->currentData().toInt(); const device_t *device = sound_card_getdevice(sndCard); - DeviceConfig::ConfigureDevice(device, 4, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(device, 4); } void @@ -312,8 +312,7 @@ SettingsSound::on_comboBoxMidiOut_currentIndexChanged(int index) void SettingsSound::on_pushButtonConfigureMidiOut_clicked() { - DeviceConfig::ConfigureDevice(midi_out_device_getdevice(ui->comboBoxMidiOut->currentData().toInt()), 0, - qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(midi_out_device_getdevice(ui->comboBoxMidiOut->currentData().toInt())); } void @@ -331,8 +330,7 @@ SettingsSound::on_comboBoxMidiIn_currentIndexChanged(int index) void SettingsSound::on_pushButtonConfigureMidiIn_clicked() { - DeviceConfig::ConfigureDevice(midi_in_device_getdevice(ui->comboBoxMidiIn->currentData().toInt()), 0, - qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(midi_in_device_getdevice(ui->comboBoxMidiIn->currentData().toInt())); } void @@ -345,7 +343,7 @@ void SettingsSound::on_pushButtonConfigureMPU401_clicked() { if (machine_has_bus(machineId, MACHINE_BUS_MCA) > 0) - DeviceConfig::ConfigureDevice(&mpu401_mca_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&mpu401_mca_device); else - DeviceConfig::ConfigureDevice(&mpu401_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&mpu401_device); } diff --git a/src/qt/qt_settingsstoragecontrollers.cpp b/src/qt/qt_settingsstoragecontrollers.cpp index 6fa5906b5..48fa04892 100644 --- a/src/qt/qt_settingsstoragecontrollers.cpp +++ b/src/qt/qt_settingsstoragecontrollers.cpp @@ -281,31 +281,31 @@ SettingsStorageControllers::on_checkBoxQuaternaryIDE_stateChanged(int arg1) void SettingsStorageControllers::on_pushButtonHD_clicked() { - DeviceConfig::ConfigureDevice(hdc_get_device(ui->comboBoxHD->currentData().toInt()), 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(hdc_get_device(ui->comboBoxHD->currentData().toInt())); } void SettingsStorageControllers::on_pushButtonFD_clicked() { - DeviceConfig::ConfigureDevice(fdc_card_getdevice(ui->comboBoxFD->currentData().toInt()), 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(fdc_card_getdevice(ui->comboBoxFD->currentData().toInt())); } void SettingsStorageControllers::on_pushButtonCDInterface_clicked() { - DeviceConfig::ConfigureDevice(cdrom_interface_get_device(ui->comboBoxCDInterface->currentData().toInt()), 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(cdrom_interface_get_device(ui->comboBoxCDInterface->currentData().toInt())); } void SettingsStorageControllers::on_pushButtonTertiaryIDE_clicked() { - DeviceConfig::ConfigureDevice(&ide_ter_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&ide_ter_device); } void SettingsStorageControllers::on_pushButtonQuaternaryIDE_clicked() { - DeviceConfig::ConfigureDevice(&ide_qua_device, 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(&ide_qua_device); } void @@ -347,25 +347,25 @@ SettingsStorageControllers::on_comboBoxSCSI4_currentIndexChanged(int index) void SettingsStorageControllers::on_pushButtonSCSI1_clicked() { - DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI1->currentData().toInt()), 1, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI1->currentData().toInt()), 1); } void SettingsStorageControllers::on_pushButtonSCSI2_clicked() { - DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI2->currentData().toInt()), 2, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI2->currentData().toInt()), 2); } void SettingsStorageControllers::on_pushButtonSCSI3_clicked() { - DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI3->currentData().toInt()), 3, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI3->currentData().toInt()), 3); } void SettingsStorageControllers::on_pushButtonSCSI4_clicked() { - DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI4->currentData().toInt()), 4, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI4->currentData().toInt()), 4); } void diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index 533ec8fa9..ba4641259 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -961,7 +961,7 @@ ibm8514_accel_in(uint16_t port, svga_t *svga) temp |= INT_GE_BSY; } - if (!dev->fifo_idx) { + if (!dev->fifo_idx && !dev->on) { dev->force_busy = 0; dev->force_busy2 = 0; dev->data_available = 0; diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index 5cbd48623..07fa0a93c 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -866,6 +866,9 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 mach->accel.stepy = 1; } + if (mach->accel.dp_config == 0x4011) + mach->accel.height++; + dev->accel.sy = 0; dev->accel.dest = mach->accel.dst_ge_offset + (dev->accel.dy * mach->accel.dst_pitch); @@ -1172,7 +1175,7 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 mach->accel.sx++; if (mach->accel.sx >= mach->accel.src_width) { mach->accel.sx = 0; - if (mach->accel.src_stepx < 0) + if (mach->accel.src_stepx == -1) dev->accel.cx += mach->accel.src_width; else dev->accel.cx -= mach->accel.src_width; @@ -1196,7 +1199,7 @@ mach_accel_start(int cmd_type, int cpu_input, int count, uint32_t mix_dat, uint3 dev->accel.sx++; if ((dev->accel.sx >= mach->accel.width) || (dev->accel.dx >= 0x600)) { dev->accel.sx = 0; - if (mach->accel.stepx < 0) + if (mach->accel.stepx == -1) dev->accel.dx += mach->accel.width; else dev->accel.dx -= mach->accel.width; @@ -2761,9 +2764,9 @@ ati8514_recalctimings(svga_t *svga) mach_log("ON=%d, vgahdisp=%d.\n", dev->on, svga->hdisp); if (dev->on) { - mach_log("8514/A ON.\n"); - dev->pitch = ((mach->accel.ge_pitch & 0xff) << 3); + mach_log("8514/A ON, pitch=%d.\n", dev->ext_pitch); dev->interlace = !!(dev->disp_cntl & 0x10); + dev->pitch = dev->ext_pitch; dev->rowoffset = dev->ext_crt_pitch; dev->rowcount = !!(dev->disp_cntl & 0x08); dev->accel.ge_offset = (mach->accel.ge_offset_lo | (mach->accel.ge_offset_hi << 16)) << 2; @@ -2865,7 +2868,7 @@ mach_recalctimings(svga_t *svga) if (dev->on) { dev->ma_latch = 0; /*(mach->accel.crt_offset_lo | (mach->accel.crt_offset_hi << 16)) << 2;*/ dev->interlace = !!(dev->disp_cntl & 0x10); - dev->pitch = ((mach->accel.ge_pitch & 0xff) << 3); + dev->pitch = dev->ext_pitch; dev->rowoffset = dev->ext_crt_pitch; dev->rowcount = !!(dev->disp_cntl & 0x08); dev->accel.ge_offset = (mach->accel.ge_offset_lo | (mach->accel.ge_offset_hi << 16)); @@ -3321,6 +3324,7 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u mach_set_resolution(mach, svga); mach32_updatemapping(mach, svga); } else { + dev->ext_pitch = 1024; dev->ext_crt_pitch = 128; mach_set_resolution(mach, svga); } @@ -3456,7 +3460,7 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u case 0xe2e9: case 0xe6e9: - mach_log("Write PORT=%04x, 8514/A=%x, val=%04x, len=%d.\n", port, dev->accel.cmd_back, val, len); + mach_log("Write PORT=%04x, 8514/A=%x, val0=%02x, sy=%d, len=%d, dx=%d, dy=%d.\n", port, dev->accel.cmd_back, val, dev->accel.sy, len, dev->accel.dx, dev->accel.dy); if (len == 1) { if (!dev->accel.cmd_back) { if (mach->accel.cmd_type >= 0) { @@ -3515,8 +3519,11 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u ibm8514_accel_out_fifo(svga, port, val, len); if (len == 2) { if ((dev->accel.multifunc_cntl >> 12) == 5) { - if (!ATI_MACH32) + if (!ATI_MACH32) { + dev->ext_pitch = 1024; dev->ext_crt_pitch = 128; + svga_recalctimings(svga); + } } } break; @@ -3641,9 +3648,9 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u if (len == 2) { dev->_8514crt = 0; - if (!(dev->accel.advfunc_cntl & 0x01)) { + if (!(dev->accel.advfunc_cntl & 0x01) && ATI_MACH32) { dev->on = 1; - dev->vendor_mode = !!ATI_MACH32; + dev->vendor_mode = 1; } } else dev->_8514crt = 1; @@ -3652,7 +3659,7 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u if (ATI_GRAPHICS_ULTRA || ATI_MACH32) mach32_updatemapping(mach, svga); - mach_log("ATI 8514/A: (0x%04x) CRT Pitch, val=0x%02x, crtpitch=%x, len=%d, extended 8514/A mode bpp=%d.\n", port, val, dev->ext_crt_pitch, len, dev->accel_bpp); + mach_log("ATI 8514/A: (0x%04x) CRT Pitch, val=0x%02x, crtpitch=%x, len=%d, extended 8514/A mode bpp=%d, enable_on=%d.\n", port, val, dev->ext_crt_pitch, len, dev->accel_bpp, dev->on); break; case 0x2aee: @@ -3847,6 +3854,7 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u else { WRITE8(port, mach->accel.ge_pitch, val); } + dev->ext_pitch = ((mach->accel.ge_pitch & 0xff) << 3); mach_log("ATI 8514/A: (0x%04x) GE Pitch val=0x%02x.\n", port, val); svga_recalctimings(svga); break; @@ -4742,21 +4750,23 @@ mach_accel_in_call(uint16_t port, mach_t *mach, svga_t *svga, ibm8514_t *dev) } } - if (!dev->fifo_idx) { + if (!dev->fifo_idx && !dev->on) { dev->force_busy = 0; dev->force_busy2 = 0; mach->force_busy = 0; dev->data_available = 0; dev->data_available2 = 0; temp |= INT_FIFO_EMP; + mach_log("Fifo Empty.\n"); } temp |= (dev->subsys_stat | (dev->vram_512k_8514 ? 0x00 : 0x80)); if (mach->accel.ext_ge_config & 0x08) temp |= ((mach->accel.ext_ge_config & 0x07) << 4); else temp |= 0x20; + + mach_log("0x%04x read: Subsystem Status=%02x, monitoralias=%02x.\n", port, temp, mach->accel.ext_ge_config & 0x07); } - mach_log("0x%04x read: Subsystem Status=%02x, monitoralias=%02x.\n", port, temp, mach->accel.ext_ge_config & 0x07); break; /*ATI Mach8/32 specific registers*/ diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index b60f9bdca..4988b3797 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -2263,8 +2263,8 @@ gd54xx_mem_sys_src_write(gd54xx_t *gd54xx, uint8_t val, uint8_t ap) static void gd54xx_write(uint32_t addr, uint8_t val, void *priv) { - gd54xx_t *gd54xx = (gd54xx_t *) priv; - svga_t *svga = &gd54xx->svga; + svga_t *svga = (svga_t *) priv; + gd54xx_t *gd54xx = (gd54xx_t *) svga->local; if (gd54xx->countminusone && !gd54xx->blt.ms_is_dest && !(gd54xx->blt.status & CIRRUS_BLT_PAUSED)) { @@ -2282,16 +2282,16 @@ gd54xx_write(uint32_t addr, uint8_t val, void *priv) static void gd54xx_writew(uint32_t addr, uint16_t val, void *priv) { - gd54xx_t *gd54xx = (gd54xx_t *) priv; - svga_t *svga = &gd54xx->svga; + svga_t *svga = (svga_t *) priv; + gd54xx_t *gd54xx = (gd54xx_t *) svga->local; if (gd54xx->countminusone && !gd54xx->blt.ms_is_dest && !(gd54xx->blt.status & CIRRUS_BLT_PAUSED)) { if ((gd54xx->blt.mode & CIRRUS_BLTMODE_COLOREXPAND) && (gd54xx->blt.modeext & CIRRUS_BLTMODEEXT_DWORDGRANULARITY)) val = (val >> 8) | (val << 8); - gd54xx_write(addr, val, gd54xx); - gd54xx_write(addr + 1, val >> 8, gd54xx); + gd54xx_write(addr, val, svga); + gd54xx_write(addr + 1, val >> 8, svga); return; } @@ -2312,18 +2312,18 @@ gd54xx_writew(uint32_t addr, uint16_t val, void *priv) static void gd54xx_writel(uint32_t addr, uint32_t val, void *priv) { - gd54xx_t *gd54xx = (gd54xx_t *) priv; - svga_t *svga = &gd54xx->svga; + svga_t *svga = (svga_t *) priv; + gd54xx_t *gd54xx = (gd54xx_t *) svga->local; if (gd54xx->countminusone && !gd54xx->blt.ms_is_dest && !(gd54xx->blt.status & CIRRUS_BLT_PAUSED)) { if ((gd54xx->blt.mode & CIRRUS_BLTMODE_COLOREXPAND) && (gd54xx->blt.modeext & CIRRUS_BLTMODEEXT_DWORDGRANULARITY)) val = ((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24); - gd54xx_write(addr, val, gd54xx); - gd54xx_write(addr + 1, val >> 8, gd54xx); - gd54xx_write(addr + 2, val >> 16, gd54xx); - gd54xx_write(addr + 3, val >> 24, gd54xx); + gd54xx_write(addr, val, svga); + gd54xx_write(addr + 1, val >> 8, svga); + gd54xx_write(addr + 2, val >> 16, svga); + gd54xx_write(addr + 3, val >> 24, svga); return; } @@ -2881,8 +2881,8 @@ gd54xx_writel_linear(uint32_t addr, uint32_t val, void *priv) static uint8_t gd54xx_read(uint32_t addr, void *priv) { - gd54xx_t *gd54xx = (gd54xx_t *) priv; - svga_t *svga = &gd54xx->svga; + svga_t *svga = (svga_t *) priv; + gd54xx_t *gd54xx = (gd54xx_t *) svga->local; if (gd54xx->countminusone && gd54xx->blt.ms_is_dest && !(gd54xx->blt.status & CIRRUS_BLT_PAUSED)) @@ -2898,14 +2898,14 @@ gd54xx_read(uint32_t addr, void *priv) static uint16_t gd54xx_readw(uint32_t addr, void *priv) { - gd54xx_t *gd54xx = (gd54xx_t *) priv; - svga_t *svga = &gd54xx->svga; + svga_t *svga = (svga_t *) priv; + gd54xx_t *gd54xx = (gd54xx_t *) svga->local; uint16_t ret; if (gd54xx->countminusone && gd54xx->blt.ms_is_dest && !(gd54xx->blt.status & CIRRUS_BLT_PAUSED)) { - ret = gd54xx_read(addr, priv); - ret |= gd54xx_read(addr + 1, priv) << 8; + ret = gd54xx_read(addr, svga); + ret |= gd54xx_read(addr + 1, svga) << 8; return ret; } @@ -2920,16 +2920,16 @@ gd54xx_readw(uint32_t addr, void *priv) static uint32_t gd54xx_readl(uint32_t addr, void *priv) { - gd54xx_t *gd54xx = (gd54xx_t *) priv; - svga_t *svga = &gd54xx->svga; + svga_t *svga = (svga_t *) priv; + gd54xx_t *gd54xx = (gd54xx_t *) svga->local; uint32_t ret; if (gd54xx->countminusone && gd54xx->blt.ms_is_dest && !(gd54xx->blt.status & CIRRUS_BLT_PAUSED)) { - ret = gd54xx_read(addr, priv); - ret |= gd54xx_read(addr + 1, priv) << 8; - ret |= gd54xx_read(addr + 2, priv) << 16; - ret |= gd54xx_read(addr + 3, priv) << 24; + ret = gd54xx_read(addr, svga); + ret |= gd54xx_read(addr + 1, svga) << 8; + ret |= gd54xx_read(addr + 2, svga) << 16; + ret |= gd54xx_read(addr + 3, svga) << 24; return ret; } @@ -3120,7 +3120,7 @@ gd543x_mmio_write(uint32_t addr, uint8_t val, void *priv) break; } } else if (gd54xx->mmio_vram_overlap) - gd54xx_write(addr, val, gd54xx); + gd54xx_write(addr, val, svga); } static void @@ -3153,8 +3153,8 @@ gd543x_mmio_writew(uint32_t addr, uint16_t val, void *priv) gd543x_mmio_write(addr, val & 0xff, gd54xx); gd543x_mmio_write(addr + 1, val >> 8, gd54xx); } else { - gd54xx_write(addr, val, gd54xx); - gd54xx_write(addr + 1, val >> 8, gd54xx); + gd54xx_write(addr, val, svga); + gd54xx_write(addr + 1, val >> 8, svga); } } } @@ -3178,10 +3178,10 @@ gd543x_mmio_writel(uint32_t addr, uint32_t val, void *priv) gd543x_mmio_write(addr + 2, val >> 16, gd54xx); gd543x_mmio_write(addr + 3, val >> 24, gd54xx); } else { - gd54xx_write(addr, val, gd54xx); - gd54xx_write(addr + 1, val >> 8, gd54xx); - gd54xx_write(addr + 2, val >> 16, gd54xx); - gd54xx_write(addr + 3, val >> 24, gd54xx); + gd54xx_write(addr, val, svga); + gd54xx_write(addr + 1, val >> 8, svga); + gd54xx_write(addr + 2, val >> 16, svga); + gd54xx_write(addr + 3, val >> 24, svga); } } } @@ -3320,7 +3320,7 @@ gd543x_mmio_read(uint32_t addr, void *priv) break; } } else if (gd54xx->mmio_vram_overlap) - ret = gd54xx_read(addr, gd54xx); + ret = gd54xx_read(addr, svga); else if (gd54xx->countminusone && gd54xx->blt.ms_is_dest && !(gd54xx->blt.status & CIRRUS_BLT_PAUSED)) ret = gd54xx_mem_sys_dest_read(gd54xx, 0); @@ -3338,7 +3338,7 @@ gd543x_mmio_readw(uint32_t addr, void *priv) if (gd543x_do_mmio(svga, addr)) ret = gd543x_mmio_read(addr, gd54xx) | (gd543x_mmio_read(addr + 1, gd54xx) << 8); else if (gd54xx->mmio_vram_overlap) - ret = gd54xx_read(addr, gd54xx) | (gd54xx_read(addr + 1, gd54xx) << 8); + ret = gd54xx_read(addr, svga) | (gd54xx_read(addr + 1, svga) << 8); else if (gd54xx->countminusone && gd54xx->blt.ms_is_dest && !(gd54xx->blt.status & CIRRUS_BLT_PAUSED)) { ret = gd543x_mmio_read(addr, priv); @@ -3361,7 +3361,7 @@ gd543x_mmio_readl(uint32_t addr, void *priv) (gd543x_mmio_read(addr + 2, gd54xx) << 16) | (gd543x_mmio_read(addr + 3, gd54xx) << 24); else if (gd54xx->mmio_vram_overlap) - ret = gd54xx_read(addr, gd54xx) | (gd54xx_read(addr + 1, gd54xx) << 8) | + ret = gd54xx_read(addr, svga) | (gd54xx_read(addr + 1, svga) << 8) | (gd54xx_read(addr + 2, gd54xx) << 16) | (gd54xx_read(addr + 3, gd54xx) << 24); else if (gd54xx->countminusone && gd54xx->blt.ms_is_dest && !(gd54xx->blt.status & CIRRUS_BLT_PAUSED)) { @@ -4141,6 +4141,8 @@ gd54xx_reset(void *priv) gd54xx_t *gd54xx = (gd54xx_t *) priv; svga_t *svga = &gd54xx->svga; + pclog("gd54xx_reset()\n"); + memset(svga->crtc, 0x00, sizeof(svga->crtc)); memset(svga->seqregs, 0x00, sizeof(svga->seqregs)); memset(svga->gdcreg, 0x00, sizeof(svga->gdcreg)); @@ -4159,7 +4161,6 @@ gd54xx_reset(void *priv) memset(gd54xx->pci_regs, 0x00, 256); - mem_mapping_set_p(&svga->mapping, gd54xx); mem_mapping_disable(&gd54xx->mmio_mapping); mem_mapping_disable(&gd54xx->linear_mapping); mem_mapping_disable(&gd54xx->aperture2_mapping); @@ -4210,7 +4211,7 @@ gd54xx_reset(void *priv) static void * gd54xx_init(const device_t *info) { - gd54xx_t *gd54xx = malloc(sizeof(gd54xx_t)); + gd54xx_t *gd54xx = calloc(1, sizeof(gd54xx_t)); svga_t *svga = &gd54xx->svga; int id = info->local & 0xff; int vram; @@ -4218,8 +4219,6 @@ gd54xx_init(const device_t *info) const char *romfn1 = NULL; const char *romfn2 = NULL; - memset(gd54xx, 0, sizeof(gd54xx_t)); - gd54xx->pci = !!(info->flags & DEVICE_PCI); gd54xx->vlb = !!(info->flags & DEVICE_VLB); gd54xx->mca = !!(info->flags & DEVICE_MCA); @@ -4475,7 +4474,6 @@ gd54xx_init(const device_t *info) if ((id <= CIRRUS_ID_CLGD5429) || (!gd54xx->pci && !gd54xx->vlb)) mem_mapping_set_base_ignore(&gd54xx->linear_mapping, 0xff000000); - mem_mapping_set_p(&svga->mapping, gd54xx); mem_mapping_disable(&gd54xx->mmio_mapping); mem_mapping_disable(&gd54xx->linear_mapping); mem_mapping_disable(&gd54xx->aperture2_mapping); @@ -4538,6 +4536,8 @@ gd54xx_init(const device_t *info) gd54xx->overlay.colorkeycompare = 0xff; + svga->local = gd54xx; + return gd54xx; } diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index ef21b18df..8fa392891 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -245,6 +245,8 @@ typedef struct s3_t { uint32_t pat_bg_color, pat_fg_color; uint32_t bkgd_color; uint32_t frgd_color; + uint16_t bkgd_color_back; + uint16_t frgd_color_back; uint32_t wrt_mask; uint32_t rd_mask; uint32_t color_cmp; @@ -253,7 +255,8 @@ typedef struct s3_t { uint16_t multifunc_cntl; uint16_t multifunc[16]; uint8_t pix_trans[4]; - uint16_t pix_trans_val; + uint8_t pix_trans_val[2048][2048]; + int pix_trans_inc; int ssv_state; int16_t cx, cy; @@ -281,7 +284,10 @@ typedef struct s3_t { uint8_t bkgd_color_actual[2]; uint8_t wrt_mask_actual[2]; int color_16bit_check; + int color_16bit_check_pixtrans; int16_t minus; + int rd_mask_16bit_check; + int start; /*For non-threaded FIFO*/ int setup_fifo_slot; @@ -611,18 +617,34 @@ s3_accel_out_pixtrans_w(s3_t *s3, uint16_t val) if (((s3->accel.frgd_mix & 0x60) != 0x40) || ((s3->accel.bkgd_mix & 0x60) != 0x40)) { if (s3->accel.cmd & 0x1000) val = (val >> 8) | (val << 8); + s3->accel_start(8, 1, val | (val << 16), 0, s3); } else { - if ((s3->bpp == 0) && s3->color_16bit) + if ((s3->bpp == 0) && s3->color_16bit) { + if (s3->accel.rd_mask_16bit_check) { + if (s3->accel.cur_x & 0x400) + val = (val >> 8) | (val << 8); + } else { + if (s3->accel.cur_x & 0x400) + s3->accel.color_16bit_check_pixtrans = 1; + else + s3->accel.color_16bit_check_pixtrans = 0; + } s3->accel_start(2, 1, 0xffffffff, val | (val << 16), s3); - else + } else s3->accel_start(1, 1, 0xffffffff, val | (val << 16), s3); } } else { if ((s3->bpp == 0) && s3->color_16bit) { - if (s3->accel.cur_x & 0x400) - val = (val >> 8) | (val << 8); - + if (s3->accel.rd_mask_16bit_check) { + if (s3->accel.cur_x & 0x400) + val = (val >> 8) | (val << 8); + } else { + if (s3->accel.cur_x & 0x400) + s3->accel.color_16bit_check_pixtrans = 1; + else + s3->accel.color_16bit_check_pixtrans = 0; + } s3->accel_start(2, 1, 0xffffffff, val | (val << 16), s3); } else s3->accel_start(1, 1, 0xffffffff, val | (val << 16), s3); @@ -638,11 +660,19 @@ s3_accel_out_pixtrans_w(s3_t *s3, uint16_t val) } else s3->accel_start(2, 1, 0xffffffff, val | (val << 16), s3); } else { - if ((s3->bpp == 0) && s3->color_16bit) { - if (s3->accel.cur_x & 0x400) + if (s3->accel.rd_mask_16bit_check) { + if (s3->accel.cmd == 0x53f1) { + if (s3->accel.cur_x & 0x400) + val = (val >> 8) | (val << 8); + + s3->accel_start(2, 1, 0xffffffff, val | (val << 16), s3); + val = (val >> 8) | (val << 8); - } - s3->accel_start(2, 1, 0xffffffff, val | (val << 16), s3); + s3->accel_start(2, 1, 0xffffffff, val | (val << 16), s3); + } else + s3->accel_start(2, 1, 0xffffffff, val | (val << 16), s3); + } else + s3->accel_start(2, 1, 0xffffffff, val | (val << 16), s3); } break; case 0x400: @@ -1037,7 +1067,6 @@ s3_accel_out_fifo(s3_t *s3, uint16_t port, uint8_t val) break; case 0xa549: case 0xa6e9: - s3_log("[%04X:%08X] OUT PORTB=%04x (Foreground Color), val=%02x.\n", CS, cpu_state.pc, port, val); if (s3->bpp == 3) { if ((s3->chip >= S3_86C928) && (s3->chip < S3_VISION964)) { if (s3->accel.multifunc[0xe] & 0x10) @@ -1450,6 +1479,8 @@ s3_accel_out_fifo(s3_t *s3, uint16_t port, uint8_t val) case 0xbee9: s3->accel.multifunc_cntl = (s3->accel.multifunc_cntl & 0xff) | (val << 8); s3->accel.multifunc[s3->accel.multifunc_cntl >> 12] = s3->accel.multifunc_cntl & 0xfff; + if ((s3->accel.multifunc_cntl >> 12) == 5) + s3_log("S3 multifunc_cntl = %d, val = %03x.\n", s3->accel.multifunc_cntl >> 12, s3->accel.multifunc_cntl & 0xfff); break; case 0xd148: @@ -1589,13 +1620,36 @@ s3_accel_out_fifo(s3_t *s3, uint16_t port, uint8_t val) s3->accel_start(1, 1, 0xffffffff, s3->accel.pix_trans[0], s3); } else { if ((s3->bpp == 0) && s3->color_16bit) { - s3->accel.pix_trans[1] = svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx - s3->accel.minus)) & s3->vram_mask]; - if (s3->accel.cur_x & 0x400) { - s3_log("Last Pixel Written=%02x (1024).\n", s3->accel.pix_trans[1]); - s3->accel_start(2, 1, 0xffffffff, s3->accel.pix_trans[1] | (s3->accel.pix_trans[0] << 8), s3); + if (s3->accel.rd_mask_16bit_check) { + s3->accel.pix_trans[1] = svga->vram[dword_remap(svga, (s3->accel.dest + s3->accel.cx - s3->accel.minus)) & s3->vram_mask]; + if (s3->accel.cmd & 0x1000) { + if (s3->accel.cur_x & 0x400) { + s3_log("Last Pixel Written=%02x (1024) reverse.\n", s3->accel.pix_trans[1]); + s3->accel_start(2, 1, 0xffffffff, s3->accel.pix_trans[0] | (s3->accel.pix_trans[1] << 8), s3); + } else { + s3_log("Last Pixel Written=%02x (0) reverse, cx=%d.\n", s3->accel.pix_trans[1], s3->accel.cx, s3->accel.cur_x); + s3->accel_start(2, 1, 0xffffffff, s3->accel.pix_trans[1] | (s3->accel.pix_trans[0] << 8), s3); + } + } else { + if (s3->accel.cur_x & 0x400) { + s3_log("Last Pixel Written=%02x (1024) normal, cx=%d, curx=%d.\n", s3->accel.pix_trans[1], s3->accel.cx, s3->accel.cur_x); + s3->accel_start(2, 1, 0xffffffff, s3->accel.pix_trans[1] | (s3->accel.pix_trans[0] << 8), s3); + } else { + s3_log("Last Pixel Written=%02x (0) normal, cx=%d, curx=%d.\n", s3->accel.pix_trans[1], s3->accel.cx, s3->accel.cur_x); + s3->accel_start(2, 1, 0xffffffff, s3->accel.pix_trans[0] | (s3->accel.pix_trans[1] << 8), s3); + } + } } else { - s3_log("Last Pixel Written=%02x (0).\n", s3->accel.pix_trans[1]); - s3->accel_start(2, 1, 0xffffffff, s3->accel.pix_trans[0] | (s3->accel.pix_trans[1] << 8), s3); + s3->accel.pix_trans_val[s3->accel.cy][s3->accel.cx] = val; + + if (s3->accel.cur_x & 0x400) { + s3->accel.color_16bit_check_pixtrans = 0; + s3_log("%04X:%08X: Last Pixel Written=%04x (1024) normal, cx=%d, cy=%d.\n", CS, cpu_state.pc, s3->accel.pix_trans_val[s3->accel.cy][s3->accel.cx - s3->accel.minus] | (s3->accel.pix_trans_val[s3->accel.cy][s3->accel.cx] << 8), s3->accel.cx, s3->accel.cy); + s3->accel_start(2, 1, 0xffffffff, s3->accel.pix_trans_val[s3->accel.cy][s3->accel.cx - s3->accel.minus] | (s3->accel.pix_trans_val[s3->accel.cy][s3->accel.cx] << 8), s3); + } else { + s3->accel.color_16bit_check_pixtrans = 1; + s3->accel_start(2, 1, 0xffffffff, s3->accel.pix_trans[0], s3); + } } } else s3->accel_start(1, 1, 0xffffffff, s3->accel.pix_trans[0], s3); @@ -2164,7 +2218,7 @@ s3_hwcursor_draw(svga_t *svga, int displine) const s3_t *s3 = (s3_t *) svga->priv; int shift = 1; int width = 16; - uint16_t dat[2] = { 0, 0 }; + uint16_t dat[4] = { 0, 0, 0, 0 }; int xx; int offset = svga->hwcursor_latch.x - svga->hwcursor_latch.xoff; uint32_t fg; @@ -2176,30 +2230,53 @@ s3_hwcursor_draw(svga_t *svga, int displine) case 15: fg = video_15to32[s3->hwc_fg_col & 0xffff]; bg = video_15to32[s3->hwc_bg_col & 0xffff]; - if (s3->chip >= S3_86C928 && s3->chip <= S3_86C805) { - if (s3->card_type != S3_MIROCRYSTAL10SD_805 && s3->card_type != S3_MIROCRYSTAL8S_805) { - if (!(svga->crtc[0x45] & 0x04)) { - shift = 2; - width = 8; + if ((s3->chip >= S3_86C928) && (s3->chip <= S3_86C805)) { + if (!s3->color_16bit) { + if ((s3->card_type != S3_MIROCRYSTAL10SD_805) && (s3->card_type != S3_MIROCRYSTAL8S_805)) { + if (!(svga->crtc[0x45] & 0x04)) { + shift = 2; + width = 8; + } } + } else { + shift = 2; + width = 8; + fg = svga->pallook[svga->crtc[0xe]]; + bg = svga->pallook[svga->crtc[0xf]]; } + } else if (s3->chip <= S3_86C924) { + shift = 2; + width = 8; + fg = svga->pallook[svga->crtc[0xe]]; + bg = svga->pallook[svga->crtc[0xf]]; } break; case 16: fg = video_16to32[s3->hwc_fg_col & 0xffff]; bg = video_16to32[s3->hwc_bg_col & 0xffff]; - if (s3->chip >= S3_86C928 && s3->chip <= S3_86C805) { - if ((s3->card_type != S3_MIROCRYSTAL10SD_805) && (s3->card_type != S3_MIROCRYSTAL8S_805)) { - if (!(svga->crtc[0x45] & 0x04)) { - shift = 2; - width = 8; - } - } else if (s3->card_type == S3_MIROCRYSTAL10SD_805) { - if (!(svga->crtc[0x45] & 0x04)) { - offset <<= 1; + if ((s3->chip >= S3_86C928) && (s3->chip <= S3_86C805)) { + if (!s3->color_16bit) { + if ((s3->card_type != S3_MIROCRYSTAL10SD_805) && (s3->card_type != S3_MIROCRYSTAL8S_805)) { + if (!(svga->crtc[0x45] & 0x04)) { + shift = 2; + width = 8; + } + } else if (s3->card_type == S3_MIROCRYSTAL10SD_805) { + if (!(svga->crtc[0x45] & 0x04)) + offset <<= 1; } + } else { + shift = 2; + width = 8; + fg = svga->pallook[svga->crtc[0xe]]; + bg = svga->pallook[svga->crtc[0xf]]; } + } else if (s3->chip <= S3_86C924) { + shift = 2; + width = 8; + fg = svga->pallook[svga->crtc[0xe]]; + bg = svga->pallook[svga->crtc[0xf]]; } break; @@ -2236,40 +2313,62 @@ s3_hwcursor_draw(svga_t *svga, int displine) for (uint8_t x = 0; x < 64; x += 16) { remapped_addr = dword_remap(svga, real_addr); + if (((svga->bpp == 15) || (svga->bpp == 16)) && s3->color_16bit) { + dat[0] = svga->vram[remapped_addr & s3->vram_mask]; + dat[1] = svga->vram[(remapped_addr + 1) & s3->vram_mask]; + dat[2] = svga->vram[(remapped_addr + 2) & s3->vram_mask]; + dat[3] = svga->vram[(remapped_addr + 3) & s3->vram_mask]; - dat[0] = (svga->vram[remapped_addr & s3->vram_mask] << 8) | svga->vram[(remapped_addr + 1) & s3->vram_mask]; - dat[1] = (svga->vram[(remapped_addr + 2) & s3->vram_mask] << 8) | svga->vram[(remapped_addr + 3) & s3->vram_mask]; - - if (svga->crtc[0x55] & 0x10) { - /*X11*/ - for (xx = 0; xx < 16; xx++) { - if (offset >= 0) { - if (dat[0] & 0x8000) - buffer32->line[displine][offset + svga->x_add] = (dat[1] & 0x8000) ? fg : bg; - } - - offset++; - dat[0] <<= shift; - dat[1] <<= shift; - } - } else { /*Windows*/ - for (xx = 0; xx < width; xx++) { + for (xx = 0; xx < 8; xx++) { if (offset >= 0) { - if (!(dat[0] & 0x8000)) - buffer32->line[displine][offset + svga->x_add] = (dat[1] & 0x8000) ? fg : bg; - else if (dat[1] & 0x8000) + if (!(dat[(xx & 4) ? 2 : 0] & 0x80)) + buffer32->line[displine][offset + svga->x_add] = (dat[(xx & 4) ? 3 : 1] & 0x80) ? fg : bg; + else if (dat[(xx & 4) ? 3 : 1] & 0x80) buffer32->line[displine][offset + svga->x_add] ^= 0xffffff; } offset++; - dat[0] <<= shift; - dat[1] <<= shift; + s3_log("Up: Data0=%04x, Data1=%04x, Data2=%04x, Data3=%04x, xx=%d addr=%06x.\n", dat[0], dat[1], dat[2], dat[3], xx, remapped_addr); + dat[(xx & 4) ? 2 : 0] <<= 2; + dat[(xx & 4) ? 3 : 1] <<= 2; + } + } else { + dat[0] = (svga->vram[remapped_addr & s3->vram_mask] << 8) | svga->vram[(remapped_addr + 1) & s3->vram_mask]; + dat[1] = (svga->vram[(remapped_addr + 2) & s3->vram_mask] << 8) | svga->vram[(remapped_addr + 3) & s3->vram_mask]; + + if (svga->crtc[0x55] & 0x10) { + /*X11*/ + for (xx = 0; xx < 16; xx++) { + if (offset >= 0) { + if (dat[0] & 0x8000) + buffer32->line[displine][offset + svga->x_add] = (dat[1] & 0x8000) ? fg : bg; + } + + offset++; + dat[0] <<= shift; + dat[1] <<= shift; + } + } else { + /*Windows*/ + for (xx = 0; xx < width; xx++) { + if (offset >= 0) { + if (!(dat[0] & 0x8000)) + buffer32->line[displine][offset + svga->x_add] = (dat[1] & 0x8000) ? fg : bg; + else if (dat[1] & 0x8000) + buffer32->line[displine][offset + svga->x_add] ^= 0xffffff; + } + + offset++; + dat[0] <<= shift; + dat[1] <<= shift; + } } } svga->hwcursor_latch.addr += 4; real_addr = s3_hwcursor_convert_addr(svga); } + if (svga->interlace && !svga->hwcursor_oddeven) svga->hwcursor_latch.addr += 16; } @@ -2812,10 +2911,10 @@ s3_out(uint16_t addr, uint8_t val, void *priv) else if (s3->chip == S3_VISION968 && (s3->card_type == S3_SPEA_MERCURY_P64V || s3->card_type == S3_MIROVIDEO40SV_ERGO_968)) { rs3 = !!(svga->crtc[0x55] & 0x02); tvp3026_ramdac_out(addr, rs2, rs3, val, svga->ramdac, svga); - } else if (((s3->chip == S3_86C801) || (s3->chip == S3_86C805) || (s3->chip == S3_86C924)) && + } else if (((s3->chip == S3_86C801) || (s3->chip == S3_86C805)) && ((s3->card_type != S3_MIROCRYSTAL10SD_805) && (s3->card_type != S3_MIROCRYSTAL8S_805))) att49x_ramdac_out(addr, rs2, val, svga->ramdac, svga); - else if (s3->chip == S3_86C911) { + else if (s3->chip <= S3_86C924) { sc1148x_ramdac_out(addr, rs2, val, svga->ramdac, svga); } else if (s3->card_type == S3_NUMBER9_9FX_531) att498_ramdac_out(addr, rs2, val, svga->ramdac, svga); @@ -2916,7 +3015,7 @@ s3_out(uint16_t addr, uint8_t val, void *priv) break; case 0x45: - if (s3->chip == S3_VISION964 || s3->chip == S3_VISION968) + if ((s3->chip == S3_VISION964) || (s3->chip == S3_VISION968)) break; svga->hwcursor.ena = val & 1; break; @@ -2928,7 +3027,7 @@ s3_out(uint16_t addr, uint8_t val, void *priv) case 0x4d: case 0x4e: case 0x4f: - if (s3->chip == S3_VISION964 || s3->chip == S3_VISION968) + if ((s3->chip == S3_VISION964) || (s3->chip == S3_VISION968)) break; svga->hwcursor.x = ((svga->crtc[0x46] << 8) | svga->crtc[0x47]) & 0x7ff; if (svga->bpp == 32) @@ -2937,14 +3036,14 @@ s3_out(uint16_t addr, uint8_t val, void *priv) svga->hwcursor.xoff = svga->crtc[0x4e] & 0x3f; svga->hwcursor.yoff = svga->crtc[0x4f] & 0x3f; svga->hwcursor.addr = ((((svga->crtc[0x4c] << 8) | svga->crtc[0x4d]) & 0xfff) * 1024) + (svga->hwcursor.yoff * 16); - if ((s3->chip >= S3_TRIO32) && svga->bpp == 32) + if ((s3->chip >= S3_TRIO32) && (svga->bpp == 32)) svga->hwcursor.x <<= 1; - else if ((s3->chip >= S3_86C928 && s3->chip <= S3_86C805) && (svga->bpp == 15 || svga->bpp == 16)) { - if ((s3->card_type == S3_MIROCRYSTAL10SD_805) && !(svga->crtc[0x45] & 0x04) && svga->bpp == 16) + else if ((s3->chip >= S3_86C928 && s3->chip <= S3_86C805) && ((svga->bpp == 15) || (svga->bpp == 16))) { + if ((s3->card_type == S3_MIROCRYSTAL10SD_805) && !(svga->crtc[0x45] & 0x04) && (svga->bpp == 16)) svga->hwcursor.x >>= 2; else svga->hwcursor.x >>= 1; - } else if ((s3->chip >= S3_86C928 && s3->chip <= S3_86C805) && (svga->bpp == 24)) + } else if ((s3->chip >= S3_86C928) && (s3->chip <= S3_86C805) && (svga->bpp == 24)) svga->hwcursor.x /= 3; else if ((s3->chip <= S3_86C805) && s3->color_16bit) svga->hwcursor.x >>= 1; @@ -3137,10 +3236,10 @@ s3_in(uint16_t addr, void *priv) else if (s3->chip == S3_VISION968 && (s3->card_type == S3_SPEA_MERCURY_P64V || s3->card_type == S3_MIROVIDEO40SV_ERGO_968)) { rs3 = !!(svga->crtc[0x55] & 0x02); return tvp3026_ramdac_in(addr, rs2, rs3, svga->ramdac, svga); - } else if (((s3->chip == S3_86C801) || (s3->chip == S3_86C805) || (s3->chip == S3_86C924)) && + } else if (((s3->chip == S3_86C801) || (s3->chip == S3_86C805)) && ((s3->card_type != S3_MIROCRYSTAL10SD_805) && (s3->card_type != S3_MIROCRYSTAL8S_805))) return att49x_ramdac_in(addr, rs2, svga->ramdac, svga); - else if (s3->chip == S3_86C911) + else if (s3->chip <= S3_86C924) return sc1148x_ramdac_in(addr, rs2, svga->ramdac, svga); else if (s3->card_type == S3_NUMBER9_9FX_531) return att498_ramdac_in(addr, rs2, svga->ramdac, svga); @@ -3449,7 +3548,8 @@ s3_recalctimings(svga_t *svga) if (s3->chip <= S3_86C805) { s3->color_16bit = !!(svga->crtc[0x43] & 0x08); - if (svga->bpp == 24) + s3_log("Color 16bit=%x, bpp=%d, 256color=%x.\n", s3->color_16bit, svga->bpp, (svga->attrregs[0x10] & 0x40)); + if ((svga->bpp == 24) || (svga->bpp == 8)) s3->color_16bit = 0; if (s3->color_16bit) @@ -5678,11 +5778,15 @@ s3_accel_in_w(uint16_t port, void *priv) if (((s3->accel.frgd_mix & 0x60) != 0x40) || ((s3->accel.bkgd_mix & 0x60) != 0x40)) { if (s3->accel.cmd & 0x1000) temp = (temp >> 8) | (temp << 8); + s3->accel_start(8, 1, temp | (temp << 16), 0, s3); } else { - if ((s3->bpp == 0) && s3->color_16bit) + if ((s3->bpp == 0) && s3->color_16bit) { + if (s3->accel.cur_x & 0x400) + temp = ((temp >> 8) | (temp << 8)) & 0xffff; + s3->accel_start(2, 1, 0xffffffff, temp | (temp << 16), s3); - else + } else s3->accel_start(1, 1, 0xffffffff, temp | (temp << 16), s3); } } else { @@ -5715,6 +5819,7 @@ s3_accel_in_w(uint16_t port, void *priv) } else { if (s3_enable_fifo(s3)) s3_wait_fifo_idle(s3); + temp = s3->accel.short_stroke; } @@ -6472,7 +6577,6 @@ polygon_setup(s3_t *s3) #define MIX \ { \ - old_dest_dat = dest_dat; \ MIX_READ \ dest_dat = (dest_dat & wrt_mask) | (old_dest_dat & ~wrt_mask); \ } @@ -7695,6 +7799,9 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi uint32_t srcbase; uint32_t dstbase; + frgd_mix = (s3->accel.frgd_mix >> 5) & 3; + bkgd_mix = (s3->accel.bkgd_mix >> 5) & 3; + if (((s3->chip >= S3_TRIO64) || (s3->chip == S3_VISION968) || (s3->chip == S3_VISION868)) && (s3->accel.cmd & (1 << 11))) cmd |= 0x08; @@ -7720,32 +7827,6 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if ((s3->accel.cmd & 0x100) && (s3_cpu_src(s3) || (s3_cpu_dest(s3))) && (!cpu_input || (s3_enable_fifo(s3) == 0))) s3->force_busy = 1; - if ((s3->bpp == 0) && s3->color_16bit && !s3->accel.b2e8_pix) { - if (cmd <= 2) { - if (s3->accel.cur_x & 0x400) { - if (s3->accel.cmd != 0x41b3) - wrt_mask = (wrt_mask << 8) & 0xff00; - else - wrt_mask &= 0xff; - - frgd_color = (frgd_color << 8) & 0xff00; - bkgd_color = (bkgd_color << 8) & 0xff00; - } else { - if (clip_r >= 0x400) { - wrt_mask &= 0xff; - frgd_color &= 0xff; - bkgd_color &= 0xff; - } - } - } else if (cmd == 6) { - if (s3->accel.destx_distp & 0x400) { - wrt_mask = (wrt_mask << 8) & 0xff00; - frgd_color = (frgd_color << 8) & 0xff00; - bkgd_color = (bkgd_color << 8) & 0xff00; - } - } - } - if (!cpu_input) s3->accel.dat_count = 0; @@ -7794,13 +7875,10 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi break; } - frgd_mix = (s3->accel.frgd_mix >> 5) & 3; - bkgd_mix = (s3->accel.bkgd_mix >> 5) & 3; - /*Bit 4 of the Command register is the draw yes bit, which enables writing to memory/reading from memory when enabled. When this bit is disabled, no writing to memory/reading from memory is allowed. (This bit is almost meaningless on the NOP command)*/ - s3_log("CMD=%d, full=%04x, s3bpp=%x, multifuncE=%03x, sourcedisplay=%x, mmio=%02x, srcbase=%08x, dstbase=%08x, cpu=%04x, mix=%04x, count=%d, rd_mask=%04x, wrt_mask=%04x, width=%d, s=%d,%d, c=%d,%d, d=%d,%d, 16bitcolor=%x, frgdcolor=%04x, bkgdcolor=%04x, frgdsel=%d, bkgdsel=%d, frgdmix=%02x, svgabpp=%d.\n", cmd, s3->accel.cmd, s3->bpp, s3->accel.multifunc[0x0e], vram_mask, svga->crtc[0x53] & 0x18, srcbase, dstbase, cpu_dat & 0xffff, mix_dat & 0xffff, count, rd_mask, wrt_mask, s3->width, s3->accel.sx, s3->accel.sy, s3->accel.cx, s3->accel.cy, s3->accel.dx, s3->accel.dy, s3->color_16bit, frgd_color, bkgd_color, frgd_mix, bkgd_mix, s3->accel.frgd_mix & 0x0f, svga->bpp); + s3_log("CMD=%d, full=%04x, s3bpp=%x, clr=%d, clb=%d, sourcedisplay=%x, mmio=%02x, srcbase=%08x, dstbase=%08x, cpu=%04x, mix=%04x, count=%d, rd_mask=%04x, wrt_mask=%04x, width=%d, s=%d,%d, c=%d,%d, d=%d,%d, 16bitcolor=%x, frgdcolor=%04x, bkgdcolor=%04x, frgdsel=%d, bkgdsel=%d, frgdmix=%02x, curx=%d, cury=%d, cll=%d, b2e8pix=%x.\n", cmd, s3->accel.cmd, s3->bpp, clip_r, clip_b, vram_mask, svga->crtc[0x53] & 0x18, srcbase, dstbase, cpu_dat & 0xffff, mix_dat & 0xffff, count, rd_mask, wrt_mask, s3->width, s3->accel.sx, s3->accel.sy, s3->accel.cx, s3->accel.cy, s3->accel.dx, s3->accel.dy, s3->color_16bit, frgd_color, bkgd_color, frgd_mix, bkgd_mix, s3->accel.frgd_mix & 0x0f, s3->accel.cur_x, s3->accel.cur_y, clip_l, s3->accel.b2e8_pix); switch (cmd) { case 0: /*NOP (Short Stroke Vectors)*/ @@ -7846,6 +7924,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (update) { READ((s3->accel.cy * s3->width) + s3->accel.cx, dest_dat); + old_dest_dat = dest_dat; MIX if (s3->accel.ssv_draw) { @@ -7911,10 +7990,16 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi case 1: /*Draw line*/ if (!cpu_input) { s3->accel.minus = 0; + s3->accel.color_16bit_check_pixtrans = 0; s3->accel.cx = s3->accel.cur_x & 0xfff; s3->accel.cy = s3->accel.cur_y & 0xfff; s3->accel.sy = s3->accel.maj_axis_pcnt; - if ((s3->bpp == 0) && s3->color_16bit && (s3->accel.cur_x & 0x400)) + if ((s3->bpp == 0) && s3->color_16bit) + s3->accel.rd_mask_16bit_check = ((rd_mask & 0xff00) != 0xff00); + else + s3->accel.rd_mask_16bit_check = 0; + + if ((s3->bpp == 0) && s3->color_16bit && (s3->accel.cur_x & 0x400) && s3->accel.rd_mask_16bit_check) s3->accel.minus = 0x400; if (s3_cpu_src(s3)) @@ -7922,6 +8007,22 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi } if (s3->accel.cmd & 0x08) { /*Radial*/ + if ((s3->bpp == 0) && s3->color_16bit) { + if (s3->accel.rd_mask_16bit_check) { + if (s3->accel.cur_x & 0x400) { + wrt_mask = (s3->accel.wrt_mask_actual[1] << 8); + frgd_color = (s3->accel.frgd_color_actual[1] << 8); + bkgd_color = (s3->accel.bkgd_color_actual[1] << 8); + } else { + wrt_mask = s3->accel.wrt_mask_actual[0]; + frgd_color = s3->accel.frgd_color_actual[0]; + bkgd_color = s3->accel.bkgd_color_actual[0]; + } + rd_mask &= 0x00ff; + } else if (!s3->accel.rd_mask_16bit_check && (s3->accel.cur_x & 0x400)) + break; + } + while (count-- && s3->accel.sy >= 0) { if ((s3->accel.cx & 0xfff) >= clip_l && (s3->accel.cx & 0xfff) <= clip_r && (s3->accel.cy & 0xfff) >= clip_t && (s3->accel.cy & 0xfff) <= clip_b) { switch ((mix_dat & mix_mask) ? frgd_mix : bkgd_mix) { @@ -7960,6 +8061,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (update) { READ((s3->accel.cy * s3->width) + s3->accel.cx - s3->accel.minus, dest_dat); + old_dest_dat = dest_dat; MIX WRITE((s3->accel.cy * s3->width) + s3->accel.cx - s3->accel.minus, dest_dat); @@ -7973,8 +8075,15 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi else cpu_dat >>= 16; - if (!s3->accel.sy) + if (!s3->accel.sy) { + if ((s3->bpp == 0) && s3->color_16bit) { + if (!(s3->accel.cur_x & 0x400)) + s3->accel.color_16bit_check = 1; + else + s3->accel.color_16bit_check = 0; + } break; + } switch (s3->accel.cmd & 0xe0) { case 0x00: @@ -8016,9 +8125,40 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi s3->accel.cur_x = s3->accel.cx & 0xfff; s3->accel.cur_y = s3->accel.cy & 0xfff; } else { /*Bresenham*/ - if (s3->accel.b2e8_pix && s3_cpu_src(s3) && (count == 16)) { /*Stupid undocumented 0xB2E8 on 911/924*/ + if (s3->accel.b2e8_pix && s3_cpu_src(s3) && (count == 16)) { /*Pattern on pixtrans (911/924)*/ count = s3->accel.maj_axis_pcnt + 1; s3->accel.temp_cnt = 16; + if ((s3->bpp == 0) && s3->color_16bit) { + if (s3->accel.rd_mask_16bit_check) { + if (s3->accel.cur_x & 0x400) { + wrt_mask = (s3->accel.wrt_mask_actual[1] << 8); + frgd_color = (s3->accel.frgd_color_actual[1] << 8); + bkgd_color = (s3->accel.bkgd_color_actual[1] << 8); + } else { + wrt_mask = s3->accel.wrt_mask_actual[0]; + frgd_color = s3->accel.frgd_color_actual[0]; + bkgd_color = s3->accel.bkgd_color_actual[0]; + } + rd_mask &= 0x00ff; + } else if (!s3->accel.rd_mask_16bit_check && (s3->accel.cur_x & 0x400)) + break; + } + } else { + if ((s3->bpp == 0) && s3->color_16bit) { + if (s3->accel.rd_mask_16bit_check) { + if (s3->accel.cur_x & 0x400) { + wrt_mask = (s3->accel.wrt_mask_actual[1] << 8); + frgd_color = (s3->accel.frgd_color_actual[1] << 8); + bkgd_color = (s3->accel.bkgd_color_actual[1] << 8); + } else { + wrt_mask = s3->accel.wrt_mask_actual[0]; + frgd_color = s3->accel.frgd_color_actual[0]; + bkgd_color = s3->accel.bkgd_color_actual[0]; + } + rd_mask &= 0x00ff; + } else if (!s3->accel.rd_mask_16bit_check && (s3->accel.cur_x & 0x400)) + break; + } } while (count-- && s3->accel.sy >= 0) { @@ -8064,6 +8204,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (update) { READ((s3->accel.cy * s3->width) + s3->accel.cx - s3->accel.minus, dest_dat); + old_dest_dat = dest_dat; MIX WRITE((s3->accel.cy * s3->width) + s3->accel.cx - s3->accel.minus, dest_dat); @@ -8086,8 +8227,15 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi else cpu_dat >>= 16; - if (!s3->accel.sy) + if (!s3->accel.sy) { + if ((s3->bpp == 0) && s3->color_16bit) { + if (!(s3->accel.cur_x & 0x400)) + s3->accel.color_16bit_check = 1; + else + s3->accel.color_16bit_check = 0; + } break; + } if (s3->accel.cmd & 0x40) { if (s3->accel.cmd & 0x80) @@ -8131,21 +8279,43 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi case 2: /*Rectangle fill*/ if (!cpu_input) /*!cpu_input is trigger to start operation*/ { + s3->accel.start = 0; s3->accel.minus = 0; + s3->accel.color_16bit_check_pixtrans = 0; s3->accel.sx = s3->accel.maj_axis_pcnt & 0xfff; s3->accel.sy = s3->accel.multifunc[0] & 0xfff; s3->accel.cx = s3->accel.cur_x & 0xfff; s3->accel.cy = s3->accel.cur_y & 0xfff; - if ((s3->bpp == 0) && s3->color_16bit && (s3->accel.cur_x & 0x400)) - s3->accel.minus = 0x400; - - if (s3->accel.cur_x & 0x400) - s3_log("Rectangle Fill + 1024 FULLCMD=%04x: frgdcolor=%04x, s(%d,%d), c(%d,%d).\n", s3->accel.cmd, frgd_color, s3->accel.sx, s3->accel.sy, s3->accel.cx, s3->accel.cy); - else - s3_log("Rectangle Fill + 0 FULLCMD=%04x: frgdcolor=%04x, s(%d,%d), c(%d,%d).\n", s3->accel.cmd, frgd_color, s3->accel.sx, s3->accel.sy, s3->accel.cx, s3->accel.cy); s3->accel.dest = dstbase + s3->accel.cy * s3->width; + if ((s3->bpp == 0) && s3->color_16bit) { + s3->accel.rd_mask_16bit_check = ((rd_mask & 0xff00) != 0xff00); + if (s3->accel.rd_mask_16bit_check) { + s3->accel.start = 1; + if (s3->accel.cur_x & 0x400) { + s3->accel.minus = 0x400; + if ((s3->accel.cmd == 0x41b3) && (frgd_mix == 0)) + s3->accel.minus = 0; + } + } else { + if (s3->accel.cmd & 0x100) { + if (!(s3->accel.cmd & 0x200)) { + if (s3->accel.cur_x & 0x400) + s3->accel.minus = 0x400; + else + s3->accel.minus = 0; + } + } + } + } else + s3->accel.rd_mask_16bit_check = 0; + + if (s3->accel.cur_x & 0x400) + s3_log("Rectangle Fill + 1024 FULLCMD=%04x: frgdcolor=%04x, s=%d,%d, c=%d,%d, frmix=%x, bkmix=%x, pixcntl=%02x, m2=%d, m4=%d.\n", s3->accel.cmd, s3->accel.frgd_color_actual[1] << 8, s3->accel.sx, s3->accel.sy, s3->accel.cx, s3->accel.cy, frgd_mix, bkgd_mix, s3->accel.multifunc[0xa] & 0xc0, s3->accel.multifunc[2], s3->accel.multifunc[4]); + else + s3_log("Rectangle Fill + 0 FULLCMD=%04x: frgdcolor=%04x, s=%d,%d, c=%d,%d, frmix=%x, bkmix=%x, pixcntl=%02x, m2=%d, m4=%d.\n", s3->accel.cmd, s3->accel.frgd_color_actual[0], s3->accel.sx, s3->accel.sy, s3->accel.cx, s3->accel.cy, frgd_mix, bkgd_mix, s3->accel.multifunc[0xa] & 0xc0, s3->accel.multifunc[2], s3->accel.multifunc[4]); + if (s3_cpu_src(s3)) { s3->data_available = 0; return; /*Wait for data from CPU*/ @@ -8155,9 +8325,93 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi } } - if (s3->accel.b2e8_pix && s3_cpu_src(s3) && (count == 16)) { /*Stupid undocumented 0xB2E8 on 911/924*/ + + if (s3->accel.b2e8_pix && s3_cpu_src(s3) && (count == 16)) { /*Pattern on pixtrans (911/924)*/ count = s3->accel.maj_axis_pcnt + 1; s3->accel.temp_cnt = 16; + if (s3->accel.rd_mask_16bit_check) { + if (s3->accel.cur_x & 0x400) { + if (s3->accel.start) { + s3->accel.minus = 0x400; + s3->accel.start = 0; + } + wrt_mask = (s3->accel.wrt_mask_actual[1] << 8); + frgd_color = (s3->accel.frgd_color_actual[1] << 8); + bkgd_color = (s3->accel.bkgd_color_actual[1] << 8); + } else { + if (s3->accel.start) { + s3->accel.minus = 0; + s3->accel.start = 0; + } + wrt_mask = s3->accel.wrt_mask_actual[0]; + frgd_color = s3->accel.frgd_color_actual[0]; + bkgd_color = s3->accel.bkgd_color_actual[0]; + } + rd_mask &= 0x00ff; + } else if (!s3->accel.rd_mask_16bit_check && (s3->accel.cur_x & 0x400)) + break; + } else { + if ((s3->bpp == 0) && s3->color_16bit) { + if (s3->accel.cmd == 0x41b3) { + if (frgd_mix != 0) { + if (s3->accel.rd_mask_16bit_check) { + if (s3->accel.cur_x & 0x400) { + wrt_mask = (s3->accel.wrt_mask_actual[1] << 8); + frgd_color = (s3->accel.frgd_color_actual[1] << 8); + bkgd_color = (s3->accel.bkgd_color_actual[1] << 8); + } else { + wrt_mask = s3->accel.wrt_mask_actual[0]; + frgd_color = s3->accel.frgd_color_actual[0]; + bkgd_color = s3->accel.bkgd_color_actual[0]; + } + rd_mask &= 0x00ff; + } else if (!s3->accel.rd_mask_16bit_check && (s3->accel.cur_x & 0x400)) + break; + } + } else { + if (s3->accel.rd_mask_16bit_check) { + rd_mask &= 0x00ff; + if (s3->accel.cmd == 0x53b3) { + if (clip_l & 0x400) { + if (s3->accel.start) { + s3->accel.minus = 0x400; + s3->accel.start = 0; + } + wrt_mask = (s3->accel.wrt_mask_actual[1] << 8); + frgd_color = (s3->accel.frgd_color_actual[1] << 8); + bkgd_color = (s3->accel.bkgd_color_actual[1] << 8); + } else { + if (s3->accel.start) { + s3->accel.minus = 0; + s3->accel.start = 0; + } + wrt_mask = s3->accel.wrt_mask_actual[0]; + frgd_color = s3->accel.frgd_color_actual[0]; + bkgd_color = s3->accel.bkgd_color_actual[0]; + } + } else { + if (s3->accel.cur_x & 0x400) { + wrt_mask = (s3->accel.wrt_mask_actual[1] << 8); + frgd_color = (s3->accel.frgd_color_actual[1] << 8); + bkgd_color = (s3->accel.bkgd_color_actual[1] << 8); + } else { + wrt_mask = s3->accel.wrt_mask_actual[0]; + frgd_color = s3->accel.frgd_color_actual[0]; + bkgd_color = s3->accel.bkgd_color_actual[0]; + } + } + } else { + if ((s3_cpu_src(s3)) && !(s3->accel.cmd & 0x200)) { + s3_log("FIXME: S3 911/924 15/16bpp documentation needed.\n"); + } else { + if (!cpu_input && (s3->accel.cur_x & 0x400)) + break; + else if (cpu_input && (s3->accel.cmd == 0x53b3) && (s3->accel.cur_x & 0x400)) + break; + } + } + } + } } while (count-- && (s3->accel.sy >= 0)) { @@ -8177,7 +8431,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi mix_dat = mix_dat ? mix_mask : 0; } - if (s3_cpu_dest(s3) || ((s3_cpu_src(s3)) && s3->color_16bit && (s3->bpp == 0) && (s3->accel.cmd == 0x41b3))) { + if (s3_cpu_dest(s3)) { READ(s3->accel.dest + s3->accel.cx - s3->accel.minus, src_dat); if (vram_mask) src_dat = ((src_dat & rd_mask) == rd_mask); @@ -8221,17 +8475,18 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (s3_cpu_dest(s3)) { if (vram_mask) { + old_dest_dat = dest_dat; MIX } } else { + old_dest_dat = dest_dat; MIX } if (s3->accel.cmd & 0x10) { - if (s3->accel.cmd == 0x41b3) - s3_log("Full=%04x: Destination=%04x, OldDest=%04x, c=%d,%d.\n", s3->accel.cmd, dest_dat, old_dest_dat, s3->accel.cx, s3->accel.cy); - - WRITE(s3->accel.dest + s3->accel.cx - s3->accel.minus, dest_dat); + if (!s3->accel.color_16bit_check_pixtrans) { + WRITE(s3->accel.dest + s3->accel.cx - s3->accel.minus, dest_dat); + } } } } @@ -8274,9 +8529,25 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi s3->accel.cy &= 0xfff; s3->accel.dest = dstbase + s3->accel.cy * s3->width; + s3->accel.sy--; if (cpu_input) { + if (s3->accel.sy < 0) { + if ((s3->bpp == 0) && s3->color_16bit) { + if ((s3->accel.cmd == 0x53b3) && !s3->accel.b2e8_pix) { + if (!(clip_l & 0x400)) + s3->accel.color_16bit_check = 1; + else + s3->accel.color_16bit_check = 0; + } else { + if (!(s3->accel.cur_x & 0x400)) + s3->accel.color_16bit_check = 1; + else + s3->accel.color_16bit_check = 0; + } + } + } if (s3->accel.b2e8_pix) { s3->accel.cur_x = s3->accel.cx; s3->accel.cur_y = s3->accel.cy; @@ -8284,6 +8555,12 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi return; } if (s3->accel.sy < 0) { + if ((s3->bpp == 0) && s3->color_16bit) { + if (!(s3->accel.cur_x & 0x400)) + s3->accel.color_16bit_check = 1; + else + s3->accel.color_16bit_check = 0; + } s3->accel.cur_x = s3->accel.cx; s3->accel.cur_y = s3->accel.cy; return; @@ -8352,6 +8629,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (update) { READ(s3->accel.dest + s3->accel.poly_x, dest_dat); + old_dest_dat = dest_dat; MIX if (s3->accel.cmd & 0x10) { @@ -8396,10 +8674,17 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi s3->accel.dx = s3->accel.destx_distp & 0xfff; s3->accel.dy = s3->accel.desty_axstp & 0xfff; + s3->accel.rd_mask_16bit_check = ((rd_mask & 0xff00) != 0xff00); - if ((s3->bpp == 0) && s3->color_16bit && (clip_r > 0x3ff) && (s3->accel.destx_distp & 0x400)) + if ((s3->bpp == 0) && s3->color_16bit && (s3->accel.destx_distp & 0x400) && s3->accel.rd_mask_16bit_check) s3->accel.minus = 0x400; + if (s3->accel.destx_distp & 0x400) { + s3_log("BitBLT + 1024 FULLCMD=%04x: frgdcolor=%04x, s=%d,%d, d=%d,%d, frmix=%x, bkmix=%x, pixcntl=%02x.\n", s3->accel.cmd, frgd_color, s3->accel.sx, s3->accel.sy, s3->accel.dx, s3->accel.dy, frgd_mix, bkgd_mix, s3->accel.multifunc[0xa] & 0xc0); + } else { + s3_log("BitBLT + 0 FULLCMD=%04x: frgdcolor=%04x, s=%d,%d, d=%d,%d, frmix=%x, bkmix=%x, pixcntl=%02x.\n", s3->accel.cmd, frgd_color, s3->accel.sx, s3->accel.sy, s3->accel.dx, s3->accel.dy, frgd_mix, bkgd_mix, s3->accel.multifunc[0xa] & 0xc0); + } + s3->accel.cx = s3->accel.cur_x & 0xfff; s3->accel.cy = s3->accel.cur_y & 0xfff; @@ -8411,6 +8696,22 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if ((s3->accel.cmd & 0x100) && !cpu_input) return; /*Wait for data from CPU*/ + if ((s3->bpp == 0) && s3->color_16bit) { + if (s3->accel.rd_mask_16bit_check) { + if (s3->accel.destx_distp & 0x400) { + wrt_mask = (s3->accel.wrt_mask_actual[1] << 8); + frgd_color = (s3->accel.frgd_color_actual[1] << 8); + bkgd_color = (s3->accel.bkgd_color_actual[1] << 8); + } else { + wrt_mask = s3->accel.wrt_mask_actual[0]; + frgd_color = s3->accel.frgd_color_actual[0]; + bkgd_color = s3->accel.bkgd_color_actual[0]; + } + rd_mask &= 0x00ff; + } else if (!s3->accel.rd_mask_16bit_check && (s3->accel.destx_distp & 0x400)) + break; + } + if (!cpu_input && (frgd_mix == 3) && !vram_mask && !(s3->accel.multifunc[0xe] & 0x100) && ((s3->accel.cmd & 0xa0) == 0xa0) && ((s3->accel.frgd_mix & 0xf) == 7) && ((s3->accel.bkgd_mix & 0xf) == 7)) { while (1) { if ((s3->accel.dx >= clip_l) && (s3->accel.dx <= clip_r) && (s3->accel.dy >= clip_t) && (s3->accel.dy <= clip_b)) { @@ -8441,6 +8742,12 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi s3->accel.sy--; if (s3->accel.sy < 0) { + if ((s3->bpp == 0) && s3->color_16bit) { + if (!(s3->accel.destx_distp & 0x400)) + s3->accel.color_16bit_check = 1; + else + s3->accel.color_16bit_check = 0; + } s3->accel.destx_distp = s3->accel.dx; s3->accel.desty_axstp = s3->accel.dy; return; @@ -8493,6 +8800,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (update) { READ(s3->accel.dest + s3->accel.dx - s3->accel.minus, dest_dat); + old_dest_dat = dest_dat; MIX if ((!(s3->accel.cmd & 0x10) && vram_mask) || (s3->accel.cmd & 0x10)) { @@ -8540,10 +8848,25 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi s3->accel.sy--; - if (cpu_input) + if (cpu_input) { + if (s3->accel.sy < 0) { + if ((s3->bpp == 0) && s3->color_16bit) { + if (!(s3->accel.destx_distp & 0x400)) + s3->accel.color_16bit_check = 1; + else + s3->accel.color_16bit_check = 0; + } + } return; + } if (s3->accel.sy < 0) { + if ((s3->bpp == 0) && s3->color_16bit) { + if (!(s3->accel.destx_distp & 0x400)) + s3->accel.color_16bit_check = 1; + else + s3->accel.color_16bit_check = 0; + } s3->accel.destx_distp = s3->accel.dx; s3->accel.desty_axstp = s3->accel.dy; return; @@ -8623,6 +8946,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (update) { READ(s3->accel.dest + s3->accel.dx, dest_dat); + old_dest_dat = dest_dat; MIX if (s3->accel.cmd & 0x10) { @@ -8728,6 +9052,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (update) { READ((s3->accel.cy * s3->width) + s3->accel.cx, dest_dat); + old_dest_dat = dest_dat; MIX if (s3->accel.cmd & 0x10) { @@ -8777,6 +9102,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (update) { READ((s3->accel.cy * s3->width) + s3->accel.cx, dest_dat); + old_dest_dat = dest_dat; MIX if (s3->accel.cmd & 0x10) { @@ -8878,6 +9204,7 @@ s3_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, voi if (update) { READ(s3->accel.dest + s3->accel.poly_x, dest_dat); + old_dest_dat = dest_dat; MIX if (s3->accel.cmd & 0x10) { @@ -9838,7 +10165,7 @@ s3_init(const device_t *info) s3->id_ext_pci = 0; s3->packed_mmio = 0; - svga->ramdac = device_add(&att490_ramdac_device); + svga->ramdac = device_add(&sc11483_ramdac_device); svga->clock_gen = device_add(&ics2494an_305_device); svga->getclock = ics2494_getclock; break;