diff --git a/src/device.h b/src/device.h index 3127362..67bdda1 100644 --- a/src/device.h +++ b/src/device.h @@ -52,7 +52,8 @@ enum DEVICE_NOT_WORKING = 1, /*Device does not currently work correctly and will be disabled in a release build*/ DEVICE_AT = 2, /*Device requires an AT-compatible system*/ DEVICE_MCA = 0x20, /*Device requires an MCA system*/ - DEVICE_PCI = 0x40 /*Device requires a PCI system*/ + DEVICE_PCI = 0x40, /*Device requires a PCI system*/ + DEVICE_PS1 = 0x80 /*Device is only for IBM PS/1 Model 2011*/ }; int model_get_config_int(char *s); diff --git a/src/hdd.c b/src/hdd.c index 0f166f5..b4f2dff 100644 --- a/src/hdd.c +++ b/src/hdd.c @@ -35,6 +35,7 @@ static struct {"[IDE] Standard IDE", "ide", &ide_device, 0, 1}, {"[IDE] XTIDE", "xtide", &xtide_device, 0, 1}, {"[IDE] XTIDE (AT)", "xtide_at", &xtide_at_device, 0, 1}, + {"[IDE] XTIDE (PS/1)", "xtide_ps1", &xtide_ps1_device, 0, 1}, {"[SCSI] Adaptec AHA-1542C", "aha1542c", &scsi_aha1542c_device, 0, 0}, {"[SCSI] BusLogic BT-545S", "bt545s", &scsi_bt545s_device, 0, 0}, {"[SCSI] Longshine LCS-6821N", "lcs6821n", &scsi_lcs6821n_device, 0, 0}, diff --git a/src/mem.c b/src/mem.c index 8b80783..841f018 100644 --- a/src/mem.c +++ b/src/mem.c @@ -57,19 +57,6 @@ int cachesize=256; uint8_t *ram, *rom = NULL; uint8_t romext[32768]; -static void mem_load_atide115_bios() -{ - FILE *f; - f=romfopen("ide_at_1_1_5.bin","rb"); - -// is486=0; - if (f) - { - fread(romext,16384,1,f); - fclose(f); - } -} - static int mem_load_basic(char *path) { char s[256]; @@ -564,7 +551,6 @@ int loadbios() fclose(f); //#endif biosmask = 0x1ffff; - mem_load_atide115_bios(); return 1; case ROM_IBMPS1_2121: diff --git a/src/wx-config.c b/src/wx-config.c index 368b9fd..942c02c 100644 --- a/src/wx-config.c +++ b/src/wx-config.c @@ -188,6 +188,12 @@ static void recalc_hdd_list(void* hdlg, int model, int use_selected_hdd, int for c++; continue; } + if ((((hdd_controller_get_flags(c) & DEVICE_PS1) && models[model].id != ROM_IBMPS1_2011) || + (!(hdd_controller_get_flags(c) & DEVICE_PS1) && models[model].id == ROM_IBMPS1_2011)) && c) + { + c++; + continue; + } if (!hdd_controller_available(c)) { c++; diff --git a/src/xtide.c b/src/xtide.c index 5c16b8f..22058f5 100644 --- a/src/xtide.c +++ b/src/xtide.c @@ -90,6 +90,17 @@ static void *xtide_at_init() return xtide; } +static void *xtide_ps1_init() +{ + xtide_t *xtide = malloc(sizeof(xtide_t)); + memset(xtide, 0, sizeof(xtide_t)); + + rom_init(&xtide->bios_rom, "ide_at_1_1_5.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL); + device_add(&ide_device); + + return xtide; +} + static void xtide_close(void *p) { xtide_t *xtide = (xtide_t *)p; @@ -107,6 +118,11 @@ static int xtide_at_available() return rom_present("ide_at.bin"); } +static int xtide_ps1_available() +{ + return rom_present("ide_at_1_1_5.bin"); +} + device_t xtide_device = { "XTIDE", @@ -131,3 +147,15 @@ device_t xtide_at_device = NULL, NULL }; +device_t xtide_ps1_device = +{ + "XTIDE (PS/1)", + DEVICE_PS1, + xtide_ps1_init, + xtide_close, + xtide_ps1_available, + NULL, + NULL, + NULL, + NULL +}; diff --git a/src/xtide.h b/src/xtide.h index 739c987..798c03c 100644 --- a/src/xtide.h +++ b/src/xtide.h @@ -1,2 +1,3 @@ extern device_t xtide_device; extern device_t xtide_at_device; +extern device_t xtide_ps1_device;