Fixed the HLT instruction on 286+ and Intel Flash aliasing.

This commit is contained in:
OBattler
2020-01-21 01:23:35 +01:00
parent 2f5ba40367
commit 7506b4667e
3 changed files with 9 additions and 4 deletions

View File

@@ -615,7 +615,8 @@ static int opHLT(uint32_t fetchdat)
if (!((cpu_state.flags & I_FLAG) && pic_intpending)) if (!((cpu_state.flags & I_FLAG) && pic_intpending))
{ {
CLOCK_CYCLES_ALWAYS(100); CLOCK_CYCLES_ALWAYS(100);
cpu_state.pc--; if (!((cpu_state.flags & I_FLAG) && pic_intpending))
cpu_state.pc--;
} }
else else
CLOCK_CYCLES(5); CLOCK_CYCLES(5);

View File

@@ -615,7 +615,8 @@ static int opHLT(uint32_t fetchdat)
if (!((cpu_state.flags & I_FLAG) && pic_intpending)) if (!((cpu_state.flags & I_FLAG) && pic_intpending))
{ {
CLOCK_CYCLES_ALWAYS(100); CLOCK_CYCLES_ALWAYS(100);
cpu_state.pc--; if (!((cpu_state.flags & I_FLAG) && pic_intpending))
cpu_state.pc--;
} }
else else
CLOCK_CYCLES(5); CLOCK_CYCLES(5);

View File

@@ -278,9 +278,12 @@ intel_flash_add_mappings(flash_t *dev)
{ {
int max = 2, i = 0; int max = 2, i = 0;
uint32_t base, fbase; uint32_t base, fbase;
uint32_t sub = 0x20000;
if (biosmask == 0x3ffff) if (biosmask == 0x3ffff) {
sub = 0x40000;
max = 4; max = 4;
}
for (i = 0; i < max; i++) { for (i = 0; i < max; i++) {
if (biosmask == 0x3ffff) if (biosmask == 0x3ffff)
@@ -299,7 +302,7 @@ intel_flash_add_mappings(flash_t *dev)
flash_write, flash_writew, flash_writel, flash_write, flash_writew, flash_writel,
dev->array + fbase, MEM_MAPPING_EXTERNAL|MEM_MAPPING_ROMCS, (void *) dev); dev->array + fbase, MEM_MAPPING_EXTERNAL|MEM_MAPPING_ROMCS, (void *) dev);
} }
mem_mapping_add(&(dev->mapping_h[i]), (base | 0xfff00000) - 0x40000, 0x10000, mem_mapping_add(&(dev->mapping_h[i]), (base | 0xfff00000) - sub, 0x10000,
flash_read, flash_readw, flash_readl, flash_read, flash_readw, flash_readl,
flash_write, flash_writew, flash_writel, flash_write, flash_writew, flash_writel,
dev->array + fbase, MEM_MAPPING_EXTERNAL|MEM_MAPPING_ROMCS, (void *) dev); dev->array + fbase, MEM_MAPPING_EXTERNAL|MEM_MAPPING_ROMCS, (void *) dev);