diff --git a/src/machine/m_at_headland.c b/src/machine/m_at_headland.c
index aa28d4d16..2e00e16ba 100644
--- a/src/machine/m_at_headland.c
+++ b/src/machine/m_at_headland.c
@@ -471,7 +471,7 @@ mem_write_headlandl(uint32_t addr, uint32_t val, void *priv)
static void
-headland_init(void)
+headland_init(int ht386)
{
int i;
@@ -479,16 +479,11 @@ headland_init(void)
headland_regs_cr[i] = 0;
headland_regs_cr[0] = 4;
- switch(romset) {
- case ROM_AMI386SX:
- case ROM_AMA932J:
- headland_regs_cr[4] = 0x20;
- io_sethandler(0x0092, 0x0001, headland_read, NULL, NULL, headland_write, NULL, NULL, NULL);
- break;
- default:
- headland_regs_cr[4] = 0;
- break;
- }
+ if (ht386) {
+ headland_regs_cr[4] = 0x20;
+ io_sethandler(0x0092, 0x0001, headland_read, NULL, NULL, headland_write, NULL, NULL, NULL);
+ } else
+ headland_regs_cr[4] = 0;
io_sethandler(0x01EC, 0x0001, headland_read, headland_readw, NULL, headland_write, headland_writew, NULL, NULL);
io_sethandler(0x01ED, 0x0003, headland_read, NULL, NULL, headland_write, NULL, NULL, NULL);
@@ -527,38 +522,57 @@ headland_init(void)
}
-void
-machine_at_headland_init(const machine_t *model)
+static void
+machine_at_headland_common_init(int ht386)
{
- if (romset == ROM_TG286M)
- machine_at_common_init(model);
- else
- machine_at_common_ide_init(model);
-
device_add(&keyboard_at_ami_device);
device_add(&fdc_at_device);
- headland_init();
+ headland_init(ht386);
+}
- if (romset == ROM_TG286M) {
- if (gfxcard == GFX_INTERNAL)
- device_add(&et4000k_tg286_isa_device);
- } else if (romset == ROM_AMA932J) {
- if (gfxcard == GFX_INTERNAL)
- device_add(&oti067_ama932j_device);
- }
+void
+machine_at_heandland_init(const machine_t *model)
+{
+ machine_at_common_ide_init(model);
+
+ machine_at_headland_common_init(1);
}
const device_t *
-at_tg286_get_device(void)
+at_tg286m_get_device(void)
{
return &et4000k_tg286_isa_device;
}
+void
+machine_at_tg286m_init(const machine_t *model)
+{
+ machine_at_common_init(model);
+
+ machine_at_headland_common_init(0);
+
+ if (gfxcard == GFX_INTERNAL)
+ device_add(&et4000k_tg286_isa_device);
+}
+
+
const device_t *
at_ama932j_get_device(void)
{
return &oti067_ama932j_device;
}
+
+
+void
+machine_at_ama932j_init(const machine_t *model)
+{
+ machine_at_common_ide_init(model);
+
+ machine_at_headland_common_init(1);
+
+ if (gfxcard == GFX_INTERNAL)
+ device_add(&oti067_ama932j_device);
+}
diff --git a/src/machine/machine.h b/src/machine/machine.h
index 68b114a00..2124e2f08 100644
--- a/src/machine/machine.h
+++ b/src/machine/machine.h
@@ -8,7 +8,7 @@
*
* Handling of the emulated machines.
*
- * Version: @(#)machine.h 1.0.29 2018/09/15
+ * Version: @(#)machine.h 1.0.30 2018/09/15
*
* Authors: Sarah Walker,
* Miran Grca,
@@ -135,6 +135,8 @@ extern void machine_at_ali1429_init(const machine_t *);
extern void machine_at_cmdpc_init(const machine_t *);
extern void machine_at_headland_init(const machine_t *);
+extern void machine_at_tg286m_init(const machine_t *);
+extern void machine_at_ama932j_init(const machine_t *);
extern void machine_at_neat_init(const machine_t *);
extern void machine_at_neat_ami_init(const machine_t *);
extern void machine_at_opti495_init(const machine_t *);
@@ -208,7 +210,7 @@ extern const device_t *t1200_get_device(void);
extern const device_t *at_endeavor_get_device(void);
-extern const device_t *at_tg286_get_device(void);
+extern const device_t *at_tg286m_get_device(void);
extern const device_t *at_ama932j_get_device(void);
#endif
diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c
index a98132026..0b47c525b 100644
--- a/src/machine/machine_table.c
+++ b/src/machine/machine_table.c
@@ -11,7 +11,7 @@
* NOTES: OpenAT wip for 286-class machine with open BIOS.
* PS2_M80-486 wip, pending receipt of TRM's for machine.
*
- * Version: @(#)machine_table.c 1.0.38 2018/09/15
+ * Version: @(#)machine_table.c 1.0.39 2018/09/15
*
* Authors: Sarah Walker,
* Miran Grca,
@@ -80,11 +80,11 @@ const machine_t machines[] = {
{ "[286 ISA] Samsung SPC-4200P", ROM_SPC4200P, "spc4200p", {{"", cpus_286}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_AT | MACHINE_PS2, 512, 2048, 128, 127, machine_at_scat_init, NULL },
{ "[286 ISA] Samsung SPC-4216P", ROM_SPC4216P, "spc4216p", {{"", cpus_286}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_AT | MACHINE_PS2, 1, 5, 1, 127, machine_at_scat_init, NULL },
{ "[286 ISA] Toshiba T3100e", ROM_T3100E, "t3100e", {{"", cpus_286}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA | MACHINE_AT | MACHINE_HDC, 1024, 5120, 256, 63, machine_at_t3100e_init, NULL },
- { "[286 ISA] Trigem 286M", ROM_TG286M, "tg286m", {{"", cpus_286}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_AT | MACHINE_VIDEO, 512, 8192, 128, 127, machine_at_headland_init, at_tg286_get_device },
+ { "[286 ISA] Trigem 286M", ROM_TG286M, "tg286m", {{"", cpus_286}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_AT | MACHINE_VIDEO, 512, 8192, 128, 127, machine_at_tg286m_init, at_tg286m_get_device },
{ "[286 MCA] IBM PS/2 model 50", ROM_IBMPS2_M50, "ibmps2_m50", {{"", cpus_ps2_m30_286}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_MCA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC_PS2 | MACHINE_VIDEO, 1, 10, 1, 63, machine_ps2_model_50_init, NULL },
- { "[386SX ISA] AMA-932J", ROM_AMA932J, "ama932j", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_AT | MACHINE_HDC | MACHINE_VIDEO, 512, 8192, 128, 127, machine_at_headland_init, at_ama932j_get_device },
+ { "[386SX ISA] AMA-932J", ROM_AMA932J, "ama932j", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_AT | MACHINE_HDC | MACHINE_VIDEO, 512, 8192, 128, 127, machine_at_ama932j_init, at_ama932j_get_device },
{ "[386SX ISA] AMI 386SX clone", ROM_AMI386SX, "ami386", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_AT | MACHINE_HDC, 512,16384, 128, 127, machine_at_headland_init, NULL },
{ "[386SX ISA] Amstrad MegaPC", ROM_MEGAPC, "megapc", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_VIDEO | MACHINE_HDC, 1, 16, 1, 127, machine_at_wd76c10_init, NULL },
{ "[386SX ISA] Award 386SX clone", ROM_AWARD386SX_OPTI495, "award386sx", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_HDC, 1, 64, 1, 127, machine_at_opti495_init, NULL },