Merge remote-tracking branch 'origin/master' into feature/recompiler_improvements

This commit is contained in:
OBattler
2026-02-11 09:07:10 +01:00
4 changed files with 101 additions and 7 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);
@@ -1382,6 +1383,9 @@ extern const device_t ps1_hdc_device;
#endif
/* m_ps2_isa.c */
#ifdef EMU_DEVICE_H
extern const device_t ps2_m30_286_device;
#endif
extern int machine_ps2_m30_286_init(const machine_t *);
/* m_ps2_mca.c */

View File

@@ -146,6 +146,58 @@ ps2_read(uint16_t port, void *priv)
return temp;
}
static const device_config_t ps2_m30_286_config[] = {
// clang-format off
{
.name = "bios",
.description = "BIOS Version",
.type = CONFIG_BIOS,
.default_string = "ibmps2_m30_286",
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = {
{
.name = "Model 30-286 rev. 0 BIOS",
.internal_name = "ibmps2_m30_286_rev0",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 131072,
.files = { "roms/machines/ibmps2_m30_286/27F4092.BIN", "" }
},
{
.name = "Model 30-286 rev. 2 BIOS",
.internal_name = "ibmps2_m30_286",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 131072,
.files = { "roms/machines/ibmps2_m30_286/33f5381a.bin", "" }
},
{ .files_no = 0 }
}
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};
const device_t ps2_m30_286_device = {
.name = "IBM PS/2 model 30-286",
.internal_name = "ps2_m30_286_device",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = ps2_m30_286_config
};
static void
ps2_isa_setup(int model, int cpu_type)
{
@@ -205,17 +257,46 @@ 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)
{
int ret;
int ret = 0;
const char *fn;
ret = bios_load_linear("roms/machines/ibmps2_m30_286/33f5381a.bin",
0x000e0000, 131072, 0);
if (bios_only || !ret)
/* No ROMs available */
if (!device_available(model->device))
return ret;
device_context(model->device);
fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), 0);
ret = bios_load_linear(fn, 0x000e0000, 131072, 0);
device_context_restore();
ps2_isa_common_init(model);
ps2_isa_setup(30, 286);

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,
@@ -3202,7 +3202,7 @@ const machine_t machines[] = {
.kbc_p1 = 0x00000cf0,
.gpio = 0xffffffff,
.gpio_acpi = 0xffffffff,
.device = NULL,
.device = &ps2_m30_286_device,
.kbd_device = NULL,
.fdc_device = NULL,
.sio_device = NULL,