diff --git a/src/amstrad.c b/src/amstrad.c index acd5070..b952151 100644 --- a/src/amstrad.c +++ b/src/amstrad.c @@ -11,6 +11,7 @@ static uint8_t amstrad_dead; int amstrad_latch = 0; +static uint8_t amstrad_language; uint8_t amstrad_read(uint16_t port, void *priv) { @@ -22,7 +23,7 @@ uint8_t amstrad_read(uint16_t port, void *priv) case 0x378: return lpt1_read(port, NULL); case 0x379: - return lpt1_read(port, NULL) | 7; + return lpt1_read(port, NULL) | (amstrad_language & 7); case 0x37a: temp = lpt1_read(port, NULL) & 0x1f; if (romset == ROM_PC1512) return temp | 0x20; @@ -164,4 +165,165 @@ void amstrad_init() io_sethandler(0xdead, 0x0001, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL); if ((romset == ROM_PC200 || romset == ROM_PPC512) && gfxcard != GFX_BUILTIN) io_sethandler(0x03de, 0x0001, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL); + + } + +static void *ams1512_init() +{ + amstrad_language = device_get_config_int("language"); + return &amstrad_language; +} + +device_config_t ams1512_config[] = +{ + { + .name = "language", + .description = "BIOS language", + .type = CONFIG_SELECTION, + .selection = + { + { + .description = "English", + .value = 7 + }, + { + .description = "German", + .value = 6 + }, + { + .description = "French", + .value = 5 + }, + { + .description = "Spanish", + .value = 4 + }, + { + .description = "Danish", + .value = 3 + }, + { + .description = "Swedish", + .value = 2 + }, + { + .description = "Italian", + .value = 1 + }, + { + .description = "Diagnostic mode", + .value = 0 + }, + { + .description = "" + } + }, + .default_int = 7 + }, + { + .type = -1 + } +}; + + +device_config_t ams2086_config[] = +{ + { + .name = "language", + .description = "BIOS language", + .type = CONFIG_SELECTION, + .selection = + { + { + .description = "English", + .value = 7 + }, + { + .description = "Diagnostic mode", + .value = 0 + }, + { + .description = "" + } + }, + .default_int = 7 + }, + { + .type = -1 + } +}; + + + +device_config_t ams3086_config[] = +{ + { + .name = "language", + .description = "BIOS language", + .type = CONFIG_SELECTION, + .selection = + { + { + .description = "English", + .value = 7 + }, + { + .description = "Diagnostic mode", + .value = 3 + }, + { + .description = "" + } + }, + .default_int = 7 + }, + { + .type = -1 + } +}; + + + + +device_t ams1512_device = +{ + "Amstrad PC1512 (BIOS)", + 0, + ams1512_init, + NULL, + NULL, + NULL, + NULL, + NULL, + ams1512_config +}; + + + +device_t ams2086_device = +{ + "Amstrad PC2086 (BIOS)", + 0, + ams1512_init, + NULL, + NULL, + NULL, + NULL, + NULL, + ams2086_config +}; + + +device_t ams3086_device = +{ + "Amstrad PC3086 (BIOS)", + 0, + ams1512_init, + NULL, + NULL, + NULL, + NULL, + NULL, + ams3086_config +}; diff --git a/src/amstrad.h b/src/amstrad.h index bc13c37..0c54fcb 100644 --- a/src/amstrad.h +++ b/src/amstrad.h @@ -1,10 +1,15 @@ #include "mouse.h" +#include "device.h" void amstrad_init(); extern mouse_t mouse_amstrad; extern int amstrad_latch; +extern device_t ams1512_device; +extern device_t ams2086_device; +extern device_t ams3086_device; + enum { AMSTRAD_NOLATCH, diff --git a/src/model.c b/src/model.c index c1ea6a4..2778be7 100644 --- a/src/model.c +++ b/src/model.c @@ -156,13 +156,13 @@ MODEL models[] = {"[8088] Zenith Data SupersPort", ROM_ZD_SUPERS, "zdsupers", { {"", cpus_8088}, {"", NULL}, {"", NULL}}, MODEL_GFX_NONE, 128, 640, 128, xt_zenith_init, NULL}, {"[8088] Xi8088", ROM_XI8088, "xi8088", { {"", cpus_8088}, {"", NULL}, {"", NULL}}, MODEL_GFX_NONE|MODEL_AT|MODEL_PS2, 64, 1024, 128, xt_xi8088_init, &xi8088_device}, - {"[8086] Amstrad PC1512", ROM_PC1512, "pc1512", { {"", cpus_pc1512}, {"", NULL}, {"", NULL}}, MODEL_GFX_FIXED|MODEL_AMSTRAD, 512, 640, 128, ams_init, NULL}, - {"[8086] Amstrad PC1640", ROM_PC1640, "pc1640", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, NULL}, - {"[8086] Amstrad PC2086", ROM_PC2086, "pc2086", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, NULL}, - {"[8086] Amstrad PC3086", ROM_PC3086, "pc3086", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, NULL}, - {"[8086] Amstrad PPC512/640", ROM_PPC512, "ppc512", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 512, 640, 128, ams_init, NULL}, + {"[8086] Amstrad PC1512", ROM_PC1512, "pc1512", { {"", cpus_pc1512}, {"", NULL}, {"", NULL}}, MODEL_GFX_FIXED|MODEL_AMSTRAD, 512, 640, 128, ams_init, &ams1512_device}, + {"[8086] Amstrad PC1640", ROM_PC1640, "pc1640", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, &ams1512_device}, + {"[8086] Amstrad PC2086", ROM_PC2086, "pc2086", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, &ams2086_device}, + {"[8086] Amstrad PC3086", ROM_PC3086, "pc3086", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, &ams3086_device}, + {"[8086] Amstrad PPC512/640", ROM_PPC512, "ppc512", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 512, 640, 128, ams_init, &ams1512_device}, {"[8086] Olivetti M24", ROM_OLIM24, "olivetti_m24", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_FIXED|MODEL_OLIM24, 128, 640, 128, olim24_init, NULL}, - {"[8086] Sinclair PC200", ROM_PC200, "pc200", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 512, 640, 128, ams_init, NULL}, + {"[8086] Sinclair PC200", ROM_PC200, "pc200", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 512, 640, 128, ams_init, &ams1512_device}, {"[8086] Tandy 1000 SL/2", ROM_TANDY1000SL2, "tandy1000sl2", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_FIXED, 512, 768, 128, tandy1ksl2_init, NULL}, {"[8088] Toshiba T1200", ROM_T1200, "t1200", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_FIXED, 1024, 2048,1024, xt_t1200_init, NULL}, {"[8086] VTech Laser XT3", ROM_LXT3, "lxt3", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_NONE, 512, 1152, 128, xt_laserxt_init, NULL},