Fix memory size report for IBM PS/2 model 30-286

This commit is contained in:
WNT50
2026-02-11 15:30:27 +08:00
parent b636ed3b92
commit e064caac73
4 changed files with 36 additions and 1 deletions

View File

@@ -257,6 +257,31 @@ ps2_isa_common_init(const machine_t *model)
device_add(&port_6x_ps2_device);
}
uint8_t
machine_ps2_isa_p1_handler(void)
{
uint8_t mem_p1;
switch (mem_size / 1024) {
case 0: /*256Kx2*/
mem_p1 = 0xf0;
break;
case 1: /*256Kx4*/
mem_p1 = 0xe0;
break;
case 2: /*1Mx2*/
case 3:
mem_p1 = 0xd0;
break;
case 4: /*1Mx4*/
default:
mem_p1 = 0xc0;
break;
}
return mem_p1;
}
int
machine_ps2_m30_286_init(const machine_t *model)
{

View File

@@ -3173,7 +3173,7 @@ const machine_t machines[] = {
.type = MACHINE_TYPE_286,
.chipset = MACHINE_CHIPSET_PROPRIETARY,
.init = machine_ps2_m30_286_init,
.p1_handler = machine_generic_p1_handler,
.p1_handler = machine_ps2_isa_p1_handler,
.gpio_handler = NULL,
.available_flag = MACHINE_AVAILABLE,
.gpio_acpi_handler = NULL,