Ported the latest changes from PCem.

This commit is contained in:
TC1995
2021-07-05 01:21:02 +02:00
parent 87f8029378
commit 6acbf62f42
8 changed files with 5225 additions and 7 deletions

View File

@@ -16,6 +16,7 @@
#include <86box/nvr.h>
#include <86box/gameport.h>
#include <86box/keyboard.h>
#include <86box/flash.h>
#include <86box/lpt.h>
#include <86box/rom.h>
#include <86box/hdc.h>
@@ -73,11 +74,19 @@ xi8088_bios_128kb(void)
static void *
xi8088_init(const device_t *info)
{
/* even though the bios by default turns the turbo off when controlling by hotkeys, pcem always starts at full speed */
xi8088.turbo = 1;
xi8088.turbo_setting = device_get_config_int("turbo_setting");
xi8088.bios_128kb = device_get_config_int("bios_128kb");
mem_set_mem_state(0x0a0000, 0x20000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
mem_set_mem_state(0x0c0000, 0x08000, device_get_config_int("umb_c0000h_c7fff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
mem_set_mem_state(0x0c8000, 0x08000, device_get_config_int("umb_c8000h_cffff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
mem_set_mem_state(0x0d0000, 0x08000, device_get_config_int("umb_d0000h_d7fff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
mem_set_mem_state(0x0d8000, 0x08000, device_get_config_int("umb_d8000h_dffff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
mem_set_mem_state(0x0e0000, 0x08000, device_get_config_int("umb_e0000h_e7fff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
mem_set_mem_state(0x0e8000, 0x08000, device_get_config_int("umb_e8000h_effff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
mem_set_mem_state(0x0f0000, 0x10000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
return &xi8088;
}
@@ -95,7 +104,7 @@ static const device_config_t xi8088_config[] =
.value = 0
},
{
.description = "Hotkeys (starts off)",
.description = "BIOS setting + Hotkeys (off during POST)",
.value = 1
}
},
@@ -108,16 +117,52 @@ static const device_config_t xi8088_config[] =
.selection =
{
{
.description = "64KB",
.description = "64KB starting from 0xF0000",
.value = 0
},
{
.description = "128KB",
.description = "128KB starting from 0xE0000 (address MSB inverted, last 64KB first)",
.value = 1
}
},
.default_int = 1
},
{
.name = "umb_c0000h_c7fff",
.description = "Map 0xc0000-0xc7fff as UMB",
.type = CONFIG_BINARY,
.default_int = 0
},
{
.name = "umb_c8000h_cffff",
.description = "Map 0xc8000-0xcffff as UMB",
.type = CONFIG_BINARY,
.default_int = 0
},
{
.name = "umb_d0000h_d7fff",
.description = "Map 0xd0000-0xd7fff as UMB",
.type = CONFIG_BINARY,
.default_int = 0
},
{
.name = "umb_d8000h_dffff",
.description = "Map 0xd8000-0xdffff as UMB",
.type = CONFIG_BINARY,
.default_int = 0
},
{
.name = "umb_e0000h_e7fff",
.description = "Map 0xe0000-0xe7fff as UMB",
.type = CONFIG_BINARY,
.default_int = 0
},
{
.name = "umb_e8000h_effff",
.description = "Map 0xe8000-0xeffff as UMB",
.type = CONFIG_BINARY,
.default_int = 0
},
{
.type = -1
}
@@ -171,7 +216,6 @@ machine_xt_xi8088_init(const machine_t *model)
if (bios_only || !ret)
return ret;
/* TODO: set UMBs? See if PCem always sets when we have > 640KB ram and avoids conflicts when a peripheral uses the same memory space */
machine_common_init(model);
if (fdc_type == FDC_INTERNAL)
@@ -182,6 +226,7 @@ machine_xt_xi8088_init(const machine_t *model)
device_add(&ibmat_nvr_device);
pic2_init();
standalone_gameport_type = &gameport_device;
device_add(&sst_flash_39sf010_device);
return ret;
}