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

@@ -2184,6 +2184,7 @@ read_p1(atkbc_t *dev)
-----------------
IBM PS/1: xxxxxxxx
IBM PS/2 MCA: xxxxx1xx
IBM PS/2 Model 30-286: xxxxx1xx
Intel AMI Pentium BIOS'es with AMI MegaKey KB-5 keyboard controller: x1x1xxxx
Acer: xxxxx0xx
Packard Bell PB450: xxxxx1xx
@@ -2198,6 +2199,7 @@ read_p1(atkbc_t *dev)
Acer: Pull down bit 6 if primary display is MDA.
Pull down bit 2 always (must be so to enable CMOS Setup).
IBM PS/1: Pull down bit 6 if current floppy drive is 3.5".
IBM PS/2 Model 30-286: Pull down bits 5 and 4 based on planar memory size.
Epson Action Tower 2600: Pull down bit 3 always (for Epson logo).
NCR: Pull down bit 5 always (power-on default speed = high).
Pull down bit 3 if there is no FPU.
@@ -2216,11 +2218,18 @@ read_p1(atkbc_t *dev)
Compaq: 0 = Compaq dual-scan display, 1 = non-Compaq display.
Bit 5: Mostly, manufacturing jumper: 0 = installed (infinite loop at POST), 1 = not installed;
NCR: power-on default speed: 0 = high, 1 = low;
IBM PS/2 Model 30-286: memory presence detect pin 1;
Compaq: System board DIP switch 5: 0 = ON, 1 = OFF.
Bit 4: (Which board?): RAM on motherboard: 0 = 512 kB, 1 = 256 kB;
NCR: RAM on motherboard: 0 = unsupported, 1 = 512 kB;
Intel AMI MegaKey KB-5: Must be 1;
IBM PS/1: Ignored;
IBM PS/2 Model 30-286: memory presence detect pin 2;
Bit 5, 4:
1, 1: 256Kx2 SIMM memory installed;
1, 0: 256Kx4 SIMM memory installed;
0, 1: 1Mx2 SIMM memory installed;
0, 0: 1Mx4 SIMM memory installed.
Compaq: 0 = Auto speed selected, 1 = High speed selected.
Bit 3: TriGem AMIKey: most significant bit of 2-bit OEM ID;
NCR: Coprocessor detect (1 = yes, 0 = no);

View File

@@ -426,6 +426,7 @@ extern uint8_t machine_compaq_p1_handler(void);
extern uint8_t machine_generic_p1_handler(void);
extern uint8_t machine_ncr_p1_handler(void);
extern uint8_t machine_ps1_p1_handler(void);
extern uint8_t machine_ps2_isa_p1_handler(void);
extern uint8_t machine_t3100e_p1_handler(void);
extern uint8_t machine_get_p1_default(void);

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,