Genoa Unknown 486: Reset BIOS memory state on soft reset, fixes hangs on soft reset after saving CMOS Setup.

This commit is contained in:
OBattler
2024-07-22 18:26:10 +02:00
parent 46db537b74
commit 95894198bf
3 changed files with 12 additions and 5 deletions

View File

@@ -752,7 +752,7 @@ compaq_genoa_outw(uint16_t port, uint16_t val, void *priv)
{ {
if (port == 0x0c02) { if (port == 0x0c02) {
if (val) if (val)
mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL); mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
else else
mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL); mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
@@ -760,6 +760,12 @@ compaq_genoa_outw(uint16_t port, uint16_t val, void *priv)
} }
} }
static void
compaq_genoa_reset(void *priv)
{
mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
}
static void * static void *
compaq_genoa_init(UNUSED(const device_t *info)) compaq_genoa_init(UNUSED(const device_t *info))
{ {
@@ -787,11 +793,11 @@ const device_t compaq_386_device = {
const device_t compaq_genoa_device = { const device_t compaq_genoa_device = {
.name = "Compaq Genoa Memory Control", .name = "Compaq Genoa Memory Control",
.internal_name = "compaq_genoa", .internal_name = "compaq_genoa",
.flags = 0, .flags = DEVICE_SOFTRESET,
.local = 0, .local = 0,
.init = compaq_genoa_init, .init = compaq_genoa_init,
.close = NULL, .close = NULL,
.reset = NULL, .reset = compaq_genoa_reset,
{ .available = NULL }, { .available = NULL },
.speed_changed = NULL, .speed_changed = NULL,
.force_redraw = NULL, .force_redraw = NULL,

View File

@@ -240,7 +240,6 @@ reset_common(int hard)
if (!hard && reset_on_hlt) { if (!hard && reset_on_hlt) {
hlt_reset_pending++; hlt_reset_pending++;
pclog("hlt_reset_pending = %i\n", hlt_reset_pending);
if (hlt_reset_pending == 2) if (hlt_reset_pending == 2)
hlt_reset_pending = 0; hlt_reset_pending = 0;
else else
@@ -352,7 +351,8 @@ reset_common(int hard)
/* If we have an AT or PS/2 keyboard controller, make sure the A20 state /* If we have an AT or PS/2 keyboard controller, make sure the A20 state
is correct. */ is correct. */
device_reset_all(DEVICE_KBC); device_reset_all(DEVICE_KBC);
} } else
device_reset_all(DEVICE_SOFTRESET);
if (!is286) if (!is286)
reset_808x(hard); reset_808x(hard);

View File

@@ -101,6 +101,7 @@ enum {
DEVICE_COM = 0x100000, /* requires a serial port */ DEVICE_COM = 0x100000, /* requires a serial port */
DEVICE_LPT = 0x200000, /* requires a parallel port */ DEVICE_LPT = 0x200000, /* requires a parallel port */
DEVICE_KBC = 0x400000, /* is a keyboard controller */ DEVICE_KBC = 0x400000, /* is a keyboard controller */
DEVICE_SOFTRESET = 0x800000, /* requires to be reset on soft reset */
DEVICE_ONBOARD = 0x40000000, /* is on-board */ DEVICE_ONBOARD = 0x40000000, /* is on-board */
DEVICE_PIT = 0x80000000, /* device is a PIT */ DEVICE_PIT = 0x80000000, /* device is a PIT */