diff --git a/src/86box.c b/src/86box.c index f0edb09f4..393ce90af 100644 --- a/src/86box.c +++ b/src/86box.c @@ -1039,6 +1039,12 @@ pc_reset_hard_init(void) if (postcard_enabled) device_add(&postcard_device); + /* Reset the CPU module. */ + resetx86(); + dma_reset(); + pci_pic_reset(); + cpu_cache_int_enabled = cpu_cache_ext_enabled = 0; + atfullspeed = 0; pc_full_speed(); diff --git a/src/dma.c b/src/dma.c index 34cde5461..d59160d73 100644 --- a/src/dma.c +++ b/src/dma.c @@ -1043,7 +1043,7 @@ dma_reset(void) dma_mask = 0x00ffffff; - dma_at = 0; + dma_at = is286; } diff --git a/src/include/86box/pci.h b/src/include/86box/pci.h index 4dbadc32c..919f14ac2 100644 --- a/src/include/86box/pci.h +++ b/src/include/86box/pci.h @@ -125,6 +125,8 @@ extern void trc_write(uint16_t port, uint8_t val, void *priv); extern void pci_bridge_set_ctl(void *priv, uint8_t ctl); +extern void pci_pic_reset(void); + #ifdef EMU_DEVICE_H extern const device_t dec21150_device; diff --git a/src/machine/machine.c b/src/machine/machine.c index 0465bbdaa..59c4bee04 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -114,15 +114,6 @@ machine_init_ex(int m) by the machine's init function). */ video_reset(gfxcard); - /* Reset the CPU module. */ - resetx86(); - dma_reset(); - pic_reset(); - cpu_cache_int_enabled = cpu_cache_ext_enabled = 0; - - dma_set_at(IS_AT(machine)); - pic_set_pci_flag(IS_ARCH(machine, MACHINE_BUS_PCI)); - return ret; } diff --git a/src/mem/rom.c b/src/mem/rom.c index 2c88d75a7..8fbd7ff97 100644 --- a/src/mem/rom.c +++ b/src/mem/rom.c @@ -422,7 +422,7 @@ bios_add(void) if (/*AT && */cpu_s) { temp_cpu_type = cpu_s->cpu_type; temp_cpu_16bitbus = (temp_cpu_type == CPU_286 || temp_cpu_type == CPU_386SX || temp_cpu_type == CPU_486SLC || temp_cpu_type == CPU_IBM386SLC || temp_cpu_type == CPU_IBM486SLC ); - temp_is286 = (temp_cpu_type == CPU_286); + temp_is286 = (temp_cpu_type >= CPU_286); } if (biosmask > 0x1ffff) { diff --git a/src/pci.c b/src/pci.c index 2fb5866d0..b66882bde 100644 --- a/src/pci.c +++ b/src/pci.c @@ -754,6 +754,14 @@ pci_reset_regs(void) } +void +pci_pic_reset(void) +{ + pic_reset(); + pic_set_pci_flag(last_pci_card > 0); +} + + static void pci_reset_hard(void) { @@ -769,8 +777,7 @@ pci_reset_hard(void) } } - pic_reset(); - pic_set_pci_flag(1); + pci_pic_reset(); }