A20 line fix by Greatpsycho.
This commit is contained in:
13
src/mem.c
13
src/mem.c
@@ -2316,16 +2316,19 @@ static uint8_t port_92_read(uint16_t port, void *priv)
|
|||||||
|
|
||||||
static void port_92_write(uint16_t port, uint8_t val, void *priv)
|
static void port_92_write(uint16_t port, uint8_t val, void *priv)
|
||||||
{
|
{
|
||||||
if (val & 1)
|
if ((mem_a20_alt ^ val) & 2)
|
||||||
|
{
|
||||||
|
mem_a20_alt = val & 2;
|
||||||
|
mem_a20_recalc();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((~port_92_reg & val) & 1)
|
||||||
{
|
{
|
||||||
softresetx86();
|
softresetx86();
|
||||||
cpu_set_edx();
|
cpu_set_edx();
|
||||||
}
|
}
|
||||||
|
|
||||||
port_92_reg = val & ~-1;
|
port_92_reg = val;
|
||||||
|
|
||||||
mem_a20_alt = val & 2;
|
|
||||||
mem_a20_recalc();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void port_92_clear_reset()
|
void port_92_clear_reset()
|
||||||
|
|||||||
@@ -415,6 +415,7 @@ void xt_laserxt_init(void)
|
|||||||
void at_init(void)
|
void at_init(void)
|
||||||
{
|
{
|
||||||
AT = 1;
|
AT = 1;
|
||||||
|
mem_a20_key = mem_a20_alt = 0;
|
||||||
common_init();
|
common_init();
|
||||||
if (lpt_enabled)
|
if (lpt_enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ void ps1mb_m2121_init(void)
|
|||||||
0x3ffff,
|
0x3ffff,
|
||||||
0,
|
0,
|
||||||
MEM_MAPPING_EXTERNAL);
|
MEM_MAPPING_EXTERNAL);
|
||||||
|
ps1_92 = 0;
|
||||||
ps1_190 = 0;
|
ps1_190 = 0;
|
||||||
|
|
||||||
lpt1_init(0x3bc);
|
lpt1_init(0x3bc);
|
||||||
@@ -315,6 +316,7 @@ void ps1mb_m2133_init(void)
|
|||||||
io_sethandler(0x0102, 0x0004, ps1_m2121_read, NULL, NULL, ps1_m2121_write, NULL, NULL, NULL);
|
io_sethandler(0x0102, 0x0004, ps1_m2121_read, NULL, NULL, ps1_m2121_write, NULL, NULL, NULL);
|
||||||
io_sethandler(0x0190, 0x0001, ps1_m2121_read, NULL, NULL, ps1_m2121_write, NULL, NULL, NULL);
|
io_sethandler(0x0190, 0x0001, ps1_m2121_read, NULL, NULL, ps1_m2121_write, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
ps1_92 = 0;
|
||||||
ps1_190 = 0;
|
ps1_190 = 0;
|
||||||
|
|
||||||
lpt1_init(0x3bc);
|
lpt1_init(0x3bc);
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ void ps2board_init(void)
|
|||||||
io_sethandler(0x0322, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
io_sethandler(0x0322, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
||||||
io_sethandler(0x0324, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
io_sethandler(0x0324, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
ps2_92 = 0;
|
||||||
ps2_190 = 0;
|
ps2_190 = 0;
|
||||||
|
|
||||||
lpt1_init(0x3bc);
|
lpt1_init(0x3bc);
|
||||||
|
|||||||
@@ -494,6 +494,7 @@ void scat_init()
|
|||||||
scat_regs[SCAT_DRAM_CONFIGURATION] = cpu_waitstates == 1 ? 2 : 0x12;
|
scat_regs[SCAT_DRAM_CONFIGURATION] = cpu_waitstates == 1 ? 2 : 0x12;
|
||||||
scat_regs[SCAT_EXTENDED_BOUNDARY] = 0;
|
scat_regs[SCAT_EXTENDED_BOUNDARY] = 0;
|
||||||
scat_regs[SCAT_EMS_CONTROL] = 0;
|
scat_regs[SCAT_EMS_CONTROL] = 0;
|
||||||
|
scat_port_92 = 0;
|
||||||
|
|
||||||
mem_mapping_set_addr(&ram_low_mapping, 0, 0x40000);
|
mem_mapping_set_addr(&ram_low_mapping, 0, 0x40000);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user