KBC P1 readout fixes.

This commit is contained in:
OBattler
2025-08-23 16:45:06 +02:00
parent d333ea8b4f
commit fbe69ab218
3 changed files with 10 additions and 18 deletions

View File

@@ -140,6 +140,7 @@ machine_init(void)
{
bios_only = 0;
machine_set_p1_default(machines[machine].kbc_p1);
machine_set_ps2();
(void) machine_init_ex(machine);

View File

@@ -19831,7 +19831,8 @@ machine_generic_p1_handler(void)
uint8_t
machine_get_p1(uint8_t kbc_p1)
{
uint8_t ret = 0xff;
uint8_t low_bits = ((machine_p1 >> 8) + 1) & 0x03;
uint8_t ret = 0xff;
if (machines[machine].p1_handler)
ret = machines[machine].p1_handler();
@@ -19844,6 +19845,8 @@ machine_get_p1(uint8_t kbc_p1)
ret &= kbc_p1;
machine_p1 = (machine_p1 & 0xfffffcff) | (low_bits << 8);
return ret;
}