diff --git a/src/86Box-RB.ico b/src/86Box-RB.ico new file mode 100644 index 000000000..2106da7e4 Binary files /dev/null and b/src/86Box-RB.ico differ diff --git a/src/Makefile.mingw b/src/Makefile.mingw index a91fe441d..6c58d172a 100644 --- a/src/Makefile.mingw +++ b/src/Makefile.mingw @@ -9,7 +9,7 @@ OBJ = 386.o 386_dynarec.o 386_dynarec_ops.o 808x.o acer386sx.o acerm3a.o ali1429 device.o disc.o disc_86f.o disc_fdi.o disc_imd.o disc_img.o disc_random.o disc_td0.o dma.o fdc.o fdc37c665.o fdc37c932fr.o fdd.o fdi2raw.o gameport.o headland.o i82335.o i430hx.o i430lx.o i430fx.o \ i430nx.o i430vx.o i440fx.o ide.o intel.o intel_flash.o io.o jim.o joystick_ch_flightstick_pro.o joystick_standard.o joystick_sw_pad.o joystick_tm_fcs.o keyboard.o keyboard_amstrad.o keyboard_at.o \ keyboard_olim24.o keyboard_pcjr.o keyboard_xt.o lpt.o mcr.o mem.o memregs.o model.o mouse.o mouse_ps2.o \ - mouse_serial.o ne2000.o neat.o nethandler.o nmi.o nvr.o olivetti_m24.o opti495.o pc.o pc87306.o pci.o pic.o piix.o pit.o ppi.o ps1.o rom.o rtc.o \ + mouse_serial.o ne2000.o neat.o nethandler.o nmi.o nvr.o olivetti_m24.o opti495.o pc.o pc87306.o pci.o pic.o piix.o pit.o ppi.o ps1.o ps2.o rom.o rtc.o \ scat.o scsi.o serial.o sis496.o sis85c471.o sio.o sound.o sound_ad1848.o sound_adlib.o sound_adlibgold.o sound_cms.o \ sound_dbopl.o sound_emu8k.o sound_gus.o sound_mpu401_uart.o sound_opl.o sound_pas16.o sound_ps1.o sound_pssj.o sound_resid.o \ sound_sb.o sound_sb_dsp.o sound_sn76489.o sound_speaker.o sound_ssi2001.o sound_wss.o sound_ym7128.o \ diff --git a/src/Makefile.mingw64 b/src/Makefile.mingw64 index 277ffadcb..d9df84dbb 100644 --- a/src/Makefile.mingw64 +++ b/src/Makefile.mingw64 @@ -9,7 +9,7 @@ OBJ = 386.o 386_dynarec.o 386_dynarec_ops.o 808x.o acer386sx.o acerm3a.o ali1429 device.o disc.o disc_86f.o disc_fdi.o disc_imd.o disc_img.o disc_random.o disc_td0.o dma.o fdc.o fdc37c665.o fdc37c932fr.o fdd.o fdi2raw.o gameport.o headland.o i82335.o i430hx.o i430lx.o i430fx.o \ i430nx.o i430vx.o i440fx.o ide.o intel.o intel_flash.o io.o jim.o joystick_ch_flightstick_pro.o joystick_standard.o joystick_sw_pad.o joystick_tm_fcs.o keyboard.o keyboard_amstrad.o keyboard_at.o \ keyboard_olim24.o keyboard_pcjr.o keyboard_xt.o lpt.o mcr.o mem.o memregs.o model.o mouse.o mouse_ps2.o \ - mouse_serial.o ne2000.o neat.o nethandler.o nmi.o nvr.o olivetti_m24.o opti495.o pc.o pc87306.o pci.o pic.o piix.o pit.o ppi.o ps1.o rom.o rtc.o \ + mouse_serial.o ne2000.o neat.o nethandler.o nmi.o nvr.o olivetti_m24.o opti495.o pc.o pc87306.o pci.o pic.o piix.o pit.o ppi.o ps1.o ps2.o rom.o rtc.o \ scat.o scsi.o serial.o sis496.o sis85c471.o sio.o sound.o sound_ad1848.o sound_adlib.o sound_adlibgold.o sound_cms.o \ sound_dbopl.o sound_emu8k.o sound_gus.o sound_mpu401_uart.o sound_opl.o sound_pas16.o sound_ps1.o sound_pssj.o sound_resid.o \ sound_sb.o sound_sb_dsp.o sound_sn76489.o sound_speaker.o sound_ssi2001.o sound_wss.o sound_ym7128.o \ diff --git a/src/cpu.c b/src/cpu.c index af49feb4d..5172c4727 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -228,6 +228,17 @@ CPU cpus_ps1_m2011[] = {"", -1, 0, 0, 0, 0} }; +CPU cpus_ps2_m30_286[] = +{ + /*286*/ + {"286/10", CPU_286, 2, 10000000, 1, 0, 0, 0, 0, 0, 2,2,2,2}, + {"286/12", CPU_286, 3, 12000000, 1, 0, 0, 0, 0, 0, 3,3,3,3}, + {"286/16", CPU_286, 4, 16000000, 1, 0, 0, 0, 0, 0, 3,3,3,3}, + {"286/20", CPU_286, 5, 20000000, 1, 0, 0, 0, 0, 0, 4,4,4,4}, + {"286/25", CPU_286, 6, 25000000, 1, 0, 0, 0, 0, 0, 4,4,4,4}, + {"", -1, 0, 0, 0, 0} +}; + CPU cpus_i386SX[] = { /*i386SX*/ diff --git a/src/cpu.h b/src/cpu.h index a1775ecac..1159caefc 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -110,6 +110,7 @@ extern CPU cpus_pcjr[]; extern CPU cpus_pc1512[]; extern CPU cpus_ibmat[]; extern CPU cpus_ps1_m2011[]; +extern CPU cpus_ps2_m30_286[]; extern CPU cpus_acer[]; extern int cpu_iscyrix; diff --git a/src/ibm.h b/src/ibm.h index e88b108d3..d68e9ede6 100644 --- a/src/ibm.h +++ b/src/ibm.h @@ -397,6 +397,8 @@ enum ROM_AMI386DX_OPTI495, ROM_MR386DX_OPTI495, + ROM_IBMPS2_M30_286, + ROM_DTK486, /*DTK PKM-0038S E-2 / SiS 471 / Award BIOS / SiS 85C471*/ ROM_VLI486SV2G, /*ASUS VL/I-486SV2G / SiS 471 / Award BIOS / SiS 85C471*/ ROM_R418, /*Rise Computer R418 / SiS 496/497 / Award BIOS / SMC FDC37C665*/ @@ -627,3 +629,4 @@ uint8_t trc_read(uint16_t port, void *priv); void trc_write(uint16_t port, uint8_t val, void *priv); void trc_init(); +extern int enable_xtide; diff --git a/src/mem.c b/src/mem.c index def1e8c71..c1e6a101b 100644 --- a/src/mem.c +++ b/src/mem.c @@ -48,6 +48,8 @@ static mem_mapping_t romext_mapping; int shadowbios,shadowbios_write; +int enable_xtide = 0; + static unsigned char isram[0x10000]; static uint8_t ff_array[0x1000]; @@ -132,7 +134,10 @@ int loadbios() } fclose(ff); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } loadfont("roms/pc1512/40078.ic127", 2); return 1; case ROM_PC1640: @@ -149,7 +154,10 @@ int loadbios() f=romfopen("roms/pc1640/40100","rb"); if (!f) break; fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_PC200: f=romfopen("roms/pc200/pc20v2.1","rb"); @@ -162,7 +170,10 @@ int loadbios() } fclose(ff); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } loadfont("roms/pc200/40109.bin", 1); return 1; case ROM_TANDY: @@ -170,7 +181,10 @@ int loadbios() if (!f) break; fread(rom,65536,1,f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_TANDY1000HX: f = romfopen("roms/tandy1000hx/v020000.u12", "rb"); @@ -178,7 +192,10 @@ int loadbios() fread(rom, 0x20000, 1, f); fclose(f); biosmask = 0x1ffff; - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_TANDY1000SL2: f = romfopen("roms/tandy1000sl2/8079047.hu1" ,"rb"); @@ -193,7 +210,10 @@ int loadbios() } fclose(ff); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; /* case ROM_IBMPCJR: f=fopen("pcjr/bios.rom","rb"); @@ -214,14 +234,20 @@ int loadbios() fread(rom + 0x8000, 0x8000, 1, ff); fclose(ff); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; } else { fread(rom,65536,1,f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; } break; @@ -238,14 +264,20 @@ int loadbios() if (!f) break; fread(rom+0xE000,8192,1,f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_DTKXT: f=romfopen("roms/dtk/DTK_ERSO_2.42_2764.bin","rb"); if (!f) break; fread(rom+0xE000,8192,1,f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_OLIM24: f = romfopen("roms/olivetti_m24/olivetti_m24_version_1.43_low.bin" ,"rb"); @@ -258,7 +290,10 @@ int loadbios() } fclose(ff); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_PC2086: @@ -277,7 +312,10 @@ int loadbios() f = romfopen("roms/pc2086/40186.ic171", "rb"); if (!f) break; fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } biosmask = 0x3fff; return 1; @@ -289,7 +327,10 @@ int loadbios() f = romfopen("roms/pc3086/c000.bin", "rb"); if (!f) break; fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } biosmask = 0x3fff; return 1; @@ -398,7 +439,10 @@ int loadbios() fread(rom+0x8000,32768,1,f); fclose(f); // memset(romext,0x63,0x8000); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_IBMPC: @@ -423,7 +467,10 @@ int loadbios() if (!f) break; fread(rom+0xC000,8192,1,f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_MEGAPC: @@ -573,7 +620,10 @@ int loadbios() if (!f) break; fread(rom + 0xE000, 8192, 1, f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_LTXT: @@ -581,7 +631,10 @@ int loadbios() if (!f) break; fread(rom + 0xE000, 8192, 1, f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_LXT3: @@ -589,7 +642,10 @@ int loadbios() if (!f) break; fread(rom + 0xE000, 8192, 1, f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_SPC4200P: /*Samsung SPC-4200P*/ @@ -624,7 +680,10 @@ int loadbios() if (!f) break; fread(rom + 0xE000, 8192, 1, f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } return 1; case ROM_JUKOPC: @@ -632,7 +691,18 @@ int loadbios() if (!f) break; fread(rom + 0xE000, 8192, 1, f); fclose(f); - mem_load_xtide_bios(); + if (enable_xtide) + { + mem_load_xtide_bios(); + } + return 1; + + case ROM_IBMPS2_M30_286: + f = romfopen("roms/ibmps2_m30_286/33f5381a.bin", "rb"); + fread(rom, 0x20000, 1, f); + fclose(f); + biosmask = 0x1ffff; + mem_load_atide_bios(); return 1; case ROM_DTK486: diff --git a/src/model.c b/src/model.c index 0253cd97a..3e15c8018 100644 --- a/src/model.c +++ b/src/model.c @@ -55,6 +55,7 @@ #include "piix.h" #include "pit.h" #include "ps1.h" +#include "ps2.h" #include "scat.h" #include "serial.h" #include "sis496.h" @@ -84,6 +85,7 @@ void at_init(); void deskpro386_init(); void ps1_m2011_init(); void ps1_m2121_init(); +void ps2_m30_286_init(); void at_neat_init(); void at_scat_init(); void at_acer386sx_init(); @@ -152,6 +154,7 @@ MODEL models[] = {"IBM PS/1 model 2011", ROM_IBMPS1_2011, { "", cpus_ps1_m2011,"", NULL, "", NULL}, 1, MODEL_AT|MODEL_PS2, 1, 16, 1, ps1_m2011_init, NULL}, {"IBM PS/1 model 2121", ROM_IBMPS1_2121, { "Intel", cpus_i386SX, "AMD", cpus_Am386SX, "Cyrix", cpus_486SLC}, 1, MODEL_AT|MODEL_PS2, 1, 16, 1, ps1_m2121_init, NULL}, {"IBM PS/1 m.2121+ISA", ROM_IBMPS1_2121_ISA, { "Intel", cpus_i386DX, "AMD", cpus_Am386DX, "Cyrix", cpus_486DLC}, 1, MODEL_AT|MODEL_PS2, 1, 16, 1, ps1_m2121_init, NULL}, + {"IBM PS/2 Model 30-286", ROM_IBMPS2_M30_286, { "", cpus_ps2_m30_286, "", NULL, "", NULL}, 0, MODEL_AT|MODEL_PS2, 1, 16, 1, ps2_m30_286_init, NULL}, {"Compaq Deskpro 386", ROM_DESKPRO_386, { "Intel", cpus_i386DX, "AMD", cpus_Am386DX, "Cyrix", cpus_486DLC}, 0, MODEL_AT, 1, 15, 1, deskpro386_init, NULL}, {"Acer 386SX25/N", ROM_ACER386, { "Intel", cpus_acer, "", NULL, "", NULL}, 1, MODEL_AT|MODEL_PS2, 1, 16, 1, at_acer386sx_init, NULL}, {"DTK 386SX clone", ROM_DTK386, { "Intel", cpus_i386SX, "AMD", cpus_Am386SX, "Cyrix", cpus_486SLC}, 0, MODEL_AT, 1, 16, 1, at_neat_init, NULL}, @@ -379,6 +382,22 @@ void ps1_m2121_init() fdc_set_ps1(); } +void ps2_m30_286_init() +{ + AT = 1; + common_init(); + mem_add_bios(); + pit_set_out_func(1, pit_refresh_timer_at); + dma16_init(); + ide_init(); + keyboard_at_init(); + mouse_ps2_init(); + nvr_init(); + pic2_init(); + ps2board_init(); + fdc_set_dskchg_activelow(); +} + void at_neat_init() { at_init(); diff --git a/src/nvr.c b/src/nvr.c index 7e4e4223e..7c3844d5c 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -208,6 +208,8 @@ void loadnvr() case ROM_IBMAT: f = romfopen(nvr_concat("at.nvr"), "rb"); break; case ROM_IBMPS1_2011: f = romfopen(nvr_concat("ibmps1_2011.nvr"), "rb"); /*nvrmask = 127; */break; case ROM_IBMPS1_2121: f = romfopen(nvr_concat("ibmps1_2121.nvr"), "rb"); nvrmask = 127; break; + case ROM_IBMPS1_2121_ISA: f = romfopen(nvr_concat("ibmps1_2121_isa.nvr"), "rb"); nvrmask = 127; break; + case ROM_IBMPS2_M30_286: f = romfopen("nvr/ibmps2_m30_286.nvr", "rb"); /*nvrmask = 127; */break; case ROM_CMDPC30: f = romfopen(nvr_concat("cmdpc30.nvr"), "rb"); nvrmask = 127; break; case ROM_AMI286: f = romfopen(nvr_concat("ami286.nvr"), "rb"); nvrmask = 127; break; case ROM_AWARD286: f = romfopen(nvr_concat("award286.nvr"), "rb"); nvrmask = 127; break; @@ -289,6 +291,8 @@ void savenvr() case ROM_IBMAT: f = romfopen(nvr_concat("at.nvr"), "wb"); break; case ROM_IBMPS1_2011: f = romfopen(nvr_concat("ibmps1_2011.nvr"), "wb"); break; case ROM_IBMPS1_2121: f = romfopen(nvr_concat("ibmps1_2121.nvr"), "wb"); break; + case ROM_IBMPS1_2121_ISA: f = romfopen(nvr_concat("ibmps1_2121_isa.nvr"), "wb"); break; + case ROM_IBMPS2_M30_286: f = romfopen("nvr/ibmps2_m30_286.nvr", "wb"); break; case ROM_CMDPC30: f = romfopen(nvr_concat("cmdpc30.nvr"), "wb"); break; case ROM_AMI286: f = romfopen(nvr_concat("ami286.nvr"), "wb"); break; case ROM_AWARD286: f = romfopen(nvr_concat("award286.nvr"), "wb"); break; diff --git a/src/pc.c b/src/pc.c index e0ab1e0db..42a764320 100644 --- a/src/pc.c +++ b/src/pc.c @@ -868,6 +868,8 @@ void loadconfig(char *fn) joystick_type = config_get_int(NULL, "joystick_type", 0); mouse_type = config_get_int(NULL, "mouse_type", 0); + enable_xtide = config_get_int(NULL, "enable_xtide", 1); + for (c = 0; c < joystick_get_max_joysticks(joystick_type); c++) { sprintf(s, "joystick_%i_nr", c); @@ -1050,6 +1052,8 @@ void saveconfig() config_set_int(NULL, "joystick_type", joystick_type); config_set_int(NULL, "mouse_type", mouse_type); + config_set_int(NULL, "enable_xtide", enable_xtide); + for (c = 0; c < joystick_get_max_joysticks(joystick_type); c++) { char s[80]; diff --git a/src/pc.rc b/src/pc.rc index 634a696d2..f22e897ae 100644 --- a/src/pc.rc +++ b/src/pc.rc @@ -380,11 +380,12 @@ BEGIN PUSHBUTTON "Configure", IDC_CONFIGUREMOD, 224, 16, 40, 14, WS_TABSTOP COMBOBOX IDC_COMBOVID,62,36,157,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Configure", IDC_CONFIGUREVID, 224, 36, 40, 14, WS_TABSTOP - COMBOBOX IDC_COMBOCPUM,62,56,157,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBOCPUM,62,56,57,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_COMBO3,62,76,102,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "Dynamic Recompiler",IDC_CHECKDYNAREC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,169,76,99,10 + CONTROL "Enable XTIDE",IDC_CHECKXTIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,169,96,99,10 COMBOBOX IDC_COMBOWS, 62,96,57,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBOSPD,162,96,57,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBOSPD,162,56,57,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_COMBOSND,62,116,157,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Configure", IDC_CONFIGURESND, 224, 116, 40, 14, WS_TABSTOP EDITTEXT IDC_MEMTEXT, 62, 136, 36, 14, ES_AUTOHSCROLL | ES_NUMBER @@ -416,7 +417,7 @@ BEGIN LTEXT "CPU type :",IDC_STATIC,15,56,34,10 LTEXT "CPU :",IDC_STATIC,15,76,34,10 LTEXT "Waitstates :",IDC_STATIC,15,96,40,10 - LTEXT "Vid.speed:",IDC_STATIC,125,96,34,10 + LTEXT "Vid.speed:",IDC_STATIC,125,56,34,10 LTEXT "Sound card :",IDC_STATIC,15,116,40,10 LTEXT "Network :",IDC_STATIC,125,136,34,10 COMBOBOX IDC_COMBONET,162,136,57,120,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -604,5 +605,10 @@ END 1 24 "86Box.manifest" +#ifdef RELEASE_BUILD +/* Icon by Devcore - https://commons.wikimedia.org/wiki/File:Icon_PC_256x256.png */ +100 ICON "86Box-RB.ico" +#else /* Icon by Devcore - https://commons.wikimedia.org/wiki/File:Icon_PC2_256x256.png */ 100 ICON "86Box.ico" +#endif diff --git a/src/ps2.c b/src/ps2.c new file mode 100644 index 000000000..0b6b08424 --- /dev/null +++ b/src/ps2.c @@ -0,0 +1,136 @@ +#include "ibm.h" +#include "mem.h" +#include "ps2.h" +#include "rom.h" +#include "lpt.h" + +static uint8_t ps2_92, ps2_94, ps2_102, ps2_103, ps2_104, ps2_105, ps2_190; + +static struct +{ + uint8_t status, int_status; + uint8_t attention, ctrl; +} ps2_hd; + +uint8_t ps2_read(uint16_t port, void *p) +{ + uint8_t temp; + + switch (port) + { + case 0x91: + return 0; + case 0x92: + return ps2_92; + case 0x94: + return ps2_94; + case 0x102: + return ps2_102 | 8; + case 0x103: + return ps2_103; + case 0x104: + return ps2_104; + case 0x105: + return ps2_105; + case 0x190: + return ps2_190; + + case 0x322: + temp = ps2_hd.status; + break; + case 0x324: + temp = ps2_hd.int_status; + ps2_hd.int_status &= ~0x02; + break; + + default: + temp = 0xff; + break; + } + + return temp; +} + +void ps2_write(uint16_t port, uint8_t val, void *p) +{ + switch (port) + { + case 0x0092: + ps2_92 = val; + mem_a20_alt = val & 2; + mem_a20_recalc(); + break; + case 0x94: + ps2_94 = val; + break; + case 0x102: + lpt1_remove(); + if (val & 0x04) + serial1_init(0x3f8, 4); + else + serial1_remove(); + if (val & 0x10) + { + switch ((val >> 5) & 3) + { + case 0: + lpt1_init(0x3bc); + break; + case 1: + lpt1_init(0x378); + break; + case 2: + lpt1_init(0x278); + break; + } + } + ps2_102 = val; + break; + case 0x103: + ps2_103 = val; + break; + case 0x104: + ps2_104 = val; + break; + case 0x105: + ps2_105 = val; + break; + case 0x190: + ps2_190 = val; + break; + + case 0x322: + ps2_hd.ctrl = val; + if (val & 0x80) + ps2_hd.status |= 0x02; + break; + case 0x324: + ps2_hd.attention = val & 0xf0; + if (ps2_hd.attention) + ps2_hd.status = 0x14; + break; + } +} + +void ps2board_init() +{ + io_sethandler(0x0091, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL); + io_sethandler(0x0092, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL); + io_sethandler(0x0094, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL); + io_sethandler(0x0102, 0x0004, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL); + io_sethandler(0x0190, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL); + io_sethandler(0x0320, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL); + io_sethandler(0x0322, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL); + io_sethandler(0x0324, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL); + + ps2_190 = 0; + + lpt1_remove(); + lpt2_remove(); + lpt1_init(0x3bc); + + serial1_remove(); + serial2_remove(); + + memset(&ps2_hd, 0, sizeof(ps2_hd)); +} diff --git a/src/ps2.h b/src/ps2.h new file mode 100644 index 000000000..92fb6e077 --- /dev/null +++ b/src/ps2.h @@ -0,0 +1 @@ +void ps2board_init(); diff --git a/src/resources.h b/src/resources.h index bc1aa903b..6e9c6a041 100644 --- a/src/resources.h +++ b/src/resources.h @@ -254,6 +254,7 @@ #define IDC_CHECKBUSLOGIC 1017 #define IDC_STATIC 1020 #define IDC_CHECKSYNC 1024 +#define IDC_CHECKXTIDE 1025 #define IDC_EDIT1 1030 #define IDC_EDIT2 1031 #define IDC_EDIT3 1032 diff --git a/src/vid_cga.c b/src/vid_cga.c index ab909b3f3..e5a9de837 100644 --- a/src/vid_cga.c +++ b/src/vid_cga.c @@ -59,6 +59,14 @@ void cga_out(uint16_t addr, uint8_t val, void *p) update_cga16_color(cga->cgamode); } cga->cgamode = val; +#ifndef __unix + cga_palette = (cga->rgb_type << 1); + if (!(cga->cgamode & 1) && (cga_palette > 0) && (cga_palette < 8)) + { + cga_palette--; + cgapal_rebuild(); + } +#endif return; case 0x3D9: cga->cgacol = val; @@ -466,7 +474,8 @@ void *cga_standalone_init() overscan_x = overscan_y = 16; #ifndef __unix - cga_palette = device_get_config_int("rgb_type"); + cga->rgb_type = device_get_config_int("rgb_type"); + cga_palette = (cga->rgb_type << 1); cgapal_rebuild(); #endif @@ -538,33 +547,25 @@ static device_config_t cga_config[] = .selection = { { - .description = "Full 16-color", + .description = "Color", .value = 0 }, { - .description = "Green, 4-color", + .description = "Green Monochrome", .value = 1 }, { - .description = "Green, 16-color", + .description = "Amber Monochrome", .value = 2 }, { - .description = "Amber, 4-color", + .description = "Gray Monochrome", .value = 3 }, { - .description = "Amber, 16-color", + .description = "Color (no brown)", .value = 4 }, - { - .description = "Gray, 4-color", - .value = 5 - }, - { - .description = "Gray, 16-color", - .value = 6 - }, { .description = "" } diff --git a/src/vid_cga.h b/src/vid_cga.h index e3b187777..ca513785d 100644 --- a/src/vid_cga.h +++ b/src/vid_cga.h @@ -34,6 +34,9 @@ typedef struct cga_t int revision; int composite; int snow_enabled; +#ifndef __unix + int rgb_type; +#endif } cga_t; void cga_init(cga_t *cga); diff --git a/src/vid_hercules.c b/src/vid_hercules.c index d3cd051e3..2c96a5654 100644 --- a/src/vid_hercules.c +++ b/src/vid_hercules.c @@ -346,7 +346,11 @@ void *hercules_init() overscan_x = overscan_y = 0; #ifndef __unix - cga_palette = device_get_config_int("rgb_type"); + cga_palette = device_get_config_int("rgb_type") << 1; + if (cga_palette > 6) + { + cga_palette = 0; + } cgapal_rebuild(); #endif @@ -378,20 +382,20 @@ static device_config_t hercules_config[] = .selection = { { - .description = "Default 4-color", + .description = "Default", .value = 0 }, { - .description = "Green, 4-color", + .description = "Green", .value = 1 }, { - .description = "Amber, 4-color", - .value = 3 + .description = "Amber", + .value = 2 }, { - .description = "Gray, 4-color", - .value = 5 + .description = "Gray", + .value = 3 }, { .description = "" diff --git a/src/vid_mda.c b/src/vid_mda.c index be38890bd..bf3b9e459 100644 --- a/src/vid_mda.c +++ b/src/vid_mda.c @@ -302,7 +302,11 @@ void *mda_init() overscan_x = overscan_y = 0; #ifndef __unix - cga_palette = device_get_config_int("rgb_type"); + cga_palette = device_get_config_int("rgb_type") << 1; + if (cga_palette > 6) + { + cga_palette = 0; + } cgapal_rebuild(); #endif @@ -334,20 +338,20 @@ static device_config_t mda_config[] = .selection = { { - .description = "Default 4-color", + .description = "Default", .value = 0 }, { - .description = "Green, 4-color", + .description = "Green", .value = 1 }, { - .description = "Amber, 4-color", - .value = 3 + .description = "Amber", + .value = 2 }, { - .description = "Gray, 4-color", - .value = 5 + .description = "Gray", + .value = 3 }, { .description = "" diff --git a/src/vid_vga.c b/src/vid_vga.c index 501643cf2..fbed319d7 100644 --- a/src/vid_vga.c +++ b/src/vid_vga.c @@ -105,7 +105,7 @@ void *vga_init() return vga; } -void *vga_chips_init() +/* void *vga_chips_init() { vga_t *vga = malloc(sizeof(vga_t)); memset(vga, 0, sizeof(vga_t)); @@ -124,7 +124,7 @@ void *vga_chips_init() vga->svga.miscout = 1; return vga; -} +} */ void *trigem_unk_init() { @@ -222,7 +222,7 @@ device_t vga_device = vga_force_redraw, vga_add_status_info }; -device_t vga_chips_device = +/* device_t vga_chips_device = { "Chips VGA", 0, @@ -232,7 +232,7 @@ device_t vga_chips_device = vga_speed_changed, vga_force_redraw, vga_add_status_info -}; +}; */ device_t trigem_unk_device = { "VGA", diff --git a/src/vid_vga.h b/src/vid_vga.h index 77aff5056..1f8fbe700 100644 --- a/src/vid_vga.h +++ b/src/vid_vga.h @@ -2,6 +2,6 @@ see COPYING for more details */ extern device_t vga_device; -extern device_t vga_chips_device; +// extern device_t vga_chips_device; extern device_t trigem_unk_device; extern device_t ps1vga_device; diff --git a/src/video.c b/src/video.c index ee3bdf0d9..1764b8739 100644 --- a/src/video.c +++ b/src/video.c @@ -74,7 +74,7 @@ static VIDEO_CARD video_cards[] = {"Diamond Stealth 3D 2000 (S3 ViRGE)", &s3_virge_device, GFX_VIRGE}, {"EGA", &ega_device, GFX_EGA}, {"Chips & Technologies SuperEGA", &sega_device, GFX_SUPER_EGA}, - {"Chips & Technologies VGA 451", &vga_chips_device, GFX_CHIPS_VGA}, + /* {"Chips & Technologies VGA 451", &vga_chips_device, GFX_CHIPS_VGA}, */ {"Compaq ATI VGA Wonder XL (ATI-28800-5)", &compaq_ati28800_device, GFX_VGAWONDERXL}, {"Compaq EGA", &cpqega_device, GFX_COMPAQ_EGA}, {"Compaq/Paradise VGA", &cpqvga_device, GFX_COMPAQ_VGA}, diff --git a/src/win-config.c b/src/win-config.c index a72391e1b..0ffb74c7c 100644 --- a/src/win-config.c +++ b/src/win-config.c @@ -58,7 +58,8 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR int temp_joystick_type; int cpu_type; int temp_mouse_type; - + int temp_xtide; + UDACCEL accel; // pclog("Dialog msg %i %08X\n",message,message); switch (message) @@ -201,6 +202,9 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR EnableWindow(h, TRUE); SendMessage(h, BM_SETCHECK, ((cpu_flags & CPU_SUPPORTS_DYNAREC) && cpu_use_dynarec) || (cpu_flags & CPU_REQUIRES_DYNAREC), 0); + h=GetDlgItem(hdlg, IDC_CHECKXTIDE); + SendMessage(h, BM_SETCHECK, enable_xtide, 0); + h = GetDlgItem(hdlg, IDC_COMBOSPD); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"8-bit"); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Slow 16-bit"); @@ -414,6 +418,9 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR h = GetDlgItem(hdlg, IDC_CHECKDYNAREC); temp_dynarec = SendMessage(h, BM_GETCHECK, 0, 0); + h = GetDlgItem(hdlg, IDC_CHECKXTIDE); + temp_xtide = SendMessage(h, BM_GETCHECK, 0, 0); + h = GetDlgItem(hdlg, IDC_COMBONET); temp_network_card_current = settings_list_to_network[SendMessage(h, CB_GETCURSEL, 0, 0)]; @@ -433,7 +440,7 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR if (temp_model != model || gfx != gfxcard || mem != mem_size || temp_cpu != cpu || temp_cpu_m != cpu_manufacturer || fpu != hasfpu || temp_GAMEBLASTER != GAMEBLASTER || temp_GUS != GUS || - temp_SSI2001 != SSI2001 || temp_sound_card_current != sound_card_current || + temp_SSI2001 != SSI2001 || temp_sound_card_current != sound_card_current || temp_xtide != enable_xtide || temp_voodoo != voodoo_enabled || temp_buslogic != buslogic_enabled || temp_dynarec != cpu_use_dynarec || temp_mouse_type != mouse_type || temp_fd1_type != fdd_get_type(0) || temp_fd2_type != fdd_get_type(1) || temp_fd3_type != fdd_get_type(2) || temp_fd4_type != fdd_get_type(3) || temp_network_card_current != network_card_current) { @@ -454,6 +461,7 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR buslogic_enabled = temp_buslogic; cpu_use_dynarec = temp_dynarec; mouse_type = temp_mouse_type; + enable_xtide = temp_xtide; fdd_set_type(0, temp_fd1_type); fdd_set_type(1, temp_fd2_type); diff --git a/src/win-d3d-fs.cc b/src/win-d3d-fs.cc index d6fad07c5..9f8f91b0a 100644 --- a/src/win-d3d-fs.cc +++ b/src/win-d3d-fs.cc @@ -85,12 +85,12 @@ PALETTE cgapal_mono[6] = {0x2c,0x13,0x00},{0x32,0x17,0x00},{0x3a,0x1e,0x00},{0x3c,0x1f,0x00},{0x3f,0x27,0x01},{0x3f,0x2a,0x04},{0x3f,0x36,0x0c},{0x3f,0x38,0x0d}, }, { // 4 - grey, 4-color-optimized contrast - {0x00,0x00,0x00},{0x0d,0x0d,0x0d},{0x15,0x15,0x15},{0x18,0x18,0x18},{0x24,0x24,0x24},{0x27,0x27,0x27},{0x33,0x33,0x33},{0x37,0x37,0x37}, - {0x08,0x08,0x08},{0x10,0x10,0x10},{0x1c,0x1c,0x1c},{0x20,0x20,0x20},{0x2c,0x2c,0x2c},{0x2f,0x2f,0x2f},{0x3b,0x3b,0x3b},{0x3f,0x3f,0x3f}, + {0x00,0x00,0x00},{0x0b,0x0c,0x0a},{0x12,0x14,0x10},{0x15,0x17,0x13},{0x21,0x24,0x1e},{0x23,0x26,0x21},{0x30,0x31,0x2e},{0x34,0x35,0x33}, + {0x07,0x08,0x07},{0x0e,0x0f,0x0d},{0x19,0x1b,0x16},{0x1c,0x1f,0x1a},{0x28,0x2b,0x26},{0x2b,0x2d,0x2a},{0x37,0x38,0x37},{0x3d,0x3d,0x3c}, }, { // 5 - grey, 16-color-optimized contrast - {0x00,0x00,0x00},{0x0d,0x0d,0x0d},{0x12,0x12,0x12},{0x15,0x15,0x15},{0x1e,0x1e,0x1e},{0x20,0x20,0x20},{0x29,0x29,0x29},{0x2c,0x2c,0x2c}, - {0x1f,0x1f,0x1f},{0x23,0x23,0x23},{0x2b,0x2b,0x2b},{0x2d,0x2d,0x2d},{0x34,0x34,0x34},{0x36,0x36,0x36},{0x3d,0x3d,0x3d},{0x3f,0x3f,0x3f}, + {0x00,0x00,0x00},{0x0b,0x0c,0x0a},{0x0f,0x11,0x0e},{0x12,0x14,0x10},{0x1b,0x1d,0x18},{0x1c,0x1f,0x1a},{0x25,0x28,0x23},{0x28,0x2b,0x26}, + {0x1c,0x1e,0x19},{0x20,0x23,0x1d},{0x27,0x2a,0x25},{0x29,0x2c,0x27},{0x31,0x32,0x30},{0x33,0x34,0x32},{0x3a,0x3b,0x3a},{0x3d,0x3d,0x3c}, }, }; @@ -112,11 +112,15 @@ void cgapal_rebuild() int c; for (c = 0; c < 256; c++) pal_lookup[c] = makecol(video_6to8[cgapal[c].r], video_6to8[cgapal[c].g], video_6to8[cgapal[c].b]); - if (cga_palette > 1) + if ((cga_palette > 1) && (cga_palette < 8)) { for (c = 0; c < 16; c++) pal_lookup[c + 16] = makecol(video_6to8[cgapal_mono[cga_palette - 1][c].r], video_6to8[cgapal_mono[cga_palette - 1][c].g], video_6to8[cgapal_mono[cga_palette - 1][c].b]); } + if (cga_palette == 8) + { + pal_lookup[0x16] = makecol(video_6to8[42], video_6to8[42], video_6to8[0]); + } } void d3d_fs_init(HWND h)