Added port 0xE9 hack switch to runtime options.

This commit is contained in:
Volker Ruppert 2021-05-11 14:42:31 +00:00
parent 4f906524de
commit 4db9f76819
3 changed files with 19 additions and 0 deletions

View File

@ -1727,6 +1727,7 @@ void bx_init_options()
misc->add(SIM->get_param(BXPN_MOUSE_ENABLED));
misc->add(SIM->get_param(BXPN_KBD_PASTE_DELAY));
misc->add(SIM->get_param(BXPN_USER_SHORTCUT));
misc->add(SIM->get_param(BXPN_PORT_E9_HACK));
misc->set_options(misc->SHOW_PARENT | misc->SHOW_GROUP_NAME);
}

View File

@ -63,6 +63,7 @@ void bx_unmapped_c::init(void)
s.port8e = 0x00;
s.shutdown = 0;
s.port_e9_hack = SIM->get_param_bool(BXPN_PORT_E9_HACK)->get();
SIM->get_param_num(BXPN_PORT_E9_HACK)->set_handler(param_handler);
}
// static IO port read callback handler
@ -283,3 +284,19 @@ return_from_write:
break;
}
}
Bit64s bx_unmapped_c::param_handler(bx_param_c *param, bool set, Bit64s val)
{
if (set) {
char pname[BX_PATHNAME_LEN];
param->get_param_path(pname, BX_PATHNAME_LEN);
if (set) {
if (!strcmp(pname, BXPN_PORT_E9_HACK)) {
BX_UM_THIS s.port_e9_hack = (val != 0);
} else {
BX_PANIC(("param_handler called with unexpected parameter '%s'", pname));
}
}
}
return val;
}

View File

@ -44,6 +44,7 @@ private:
Bit32u read(Bit32u address, unsigned io_len);
void write(Bit32u address, Bit32u value, unsigned io_len);
#endif
static Bit64s param_handler(bx_param_c *param, bool set, Bit64s val);
struct {
Bit8u port80;