Skip to content

Commit bf3fb4f

Browse files
authored
Merge pull request 86Box#7694 from WNT50/ps2mca
Miscellaneous fixes to IBM PS/2 machines (Part 1)
2 parents 5aa40e2 + ce82027 commit bf3fb4f

1 file changed

Lines changed: 25 additions & 23 deletions

File tree

‎src/machine/m_ps2_mca.c‎

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,18 @@ model_70_type3_write(uint16_t port, uint8_t val)
700700
break;
701701
case 0x103:
702702
if (ps2.planar_id == 0xfff9)
703-
ps2.option[1] = (ps2.option[1] & 0x0f) | (val & 0xf0);
703+
ps2.option[1] = (ps2.option[1] & 0x7f) | (val & 0x80);
704704
break;
705705
case 0x104:
706-
if (ps2.planar_id == 0xfff9)
707-
ps2.option[2] = val;
706+
if (ps2.planar_id == 0xfff9) {
707+
uint8_t old = ps2.option[2];
708+
/* Only bit 0 (E0000 hole) is writable; bits 1-7 are fixed
709+
value (memory refresh speed, CPU type) and must be preserved
710+
to avoid POST error 225 with IBM KDOS 3.31 on warm reboot. */
711+
ps2.option[2] = (ps2.option[2] & 0xfe) | (val & 0x01);
712+
if ((old ^ ps2.option[2]) & 0x01)
713+
mem_encoding_update();
714+
}
708715
break;
709716
case 0x105:
710717
ps2.option[3] = val;
@@ -1474,7 +1481,7 @@ ps2_mca_board_model_70_type34_init(int is_type4, int slots)
14741481
ps2.option[2] = 0x01;
14751482
break;
14761483
case 4:
1477-
ps2.option[1] = 0xaa;
1484+
ps2.option[1] = 0x86;
14781485
ps2.option[2] = 0x01;
14791486
break;
14801487
case 6:
@@ -1483,14 +1490,20 @@ ps2_mca_board_model_70_type34_init(int is_type4, int slots)
14831490
break;
14841491
case 8:
14851492
default:
1486-
ps2.option[1] = 0xca;
1493+
ps2.option[1] = 0x8a;
14871494
ps2.option[2] = 0x02;
14881495
break;
14891496
}
14901497

14911498
if (is_type4)
14921499
ps2.option[2] |= 0x04; /*486 CPU*/
14931500

1501+
if (ps2.planar_id == 0xfff9) {
1502+
/* Disable/Enable E0000 - E0FFF (Make 2 KB hole for Display Adapter) */
1503+
ps2.option[2] &= ~0x01;
1504+
ps2.has_e0000_hole = 1;
1505+
}
1506+
14941507
mem_mapping_add(&ps2.split_mapping,
14951508
(mem_size + 256) * 1024,
14961509
256 * 1024,
@@ -1519,23 +1532,12 @@ ps2_mca_board_model_70_type34_init(int is_type4, int slots)
15191532
NULL);
15201533
mem_mapping_disable(&ps2.cache_mapping);
15211534

1522-
if (ps2.planar_id == 0xfff9) {
1523-
if (mem_size > 4096) {
1524-
/* Only 4 MB supported on planar, create a memory expansion card for the rest */
1525-
if (mem_size > 12288) {
1526-
ps2_mca_mem_d071_init(4);
1527-
} else {
1528-
ps2_mca_mem_fffc_init(4);
1529-
}
1530-
}
1531-
} else {
1532-
if (mem_size > 8192) {
1533-
/* Only 8 MB supported on planar, create a memory expansion card for the rest */
1534-
if (mem_size > 16384)
1535-
ps2_mca_mem_d071_init(8);
1536-
else {
1537-
ps2_mca_mem_fffc_init(8);
1538-
}
1535+
if (mem_size > 8192) {
1536+
/* Only 8 MB supported on planar, create a memory expansion card for the rest */
1537+
if (mem_size > 16384)
1538+
ps2_mca_mem_d071_init(8);
1539+
else {
1540+
ps2_mca_mem_fffc_init(8);
15391541
}
15401542
}
15411543

@@ -1650,7 +1652,7 @@ static const device_config_t ps2_model_50_config[] = {
16501652
.name = "bios",
16511653
.description = "BIOS Version",
16521654
.type = CONFIG_BIOS,
1653-
.default_string = "ibmps2_m50",
1655+
.default_string = "ibmps2_m50z",
16541656
.default_int = 0,
16551657
.file_filter = NULL,
16561658
.spinner = { 0 },

0 commit comments

Comments
 (0)