Merge pull request #4511 from jriwanek-forks/emswork
Improvements to the RAMpage XT and EMS logging
This commit is contained in:
@@ -315,9 +315,7 @@ ems_read(uint16_t port, void *priv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ISAMEM_DEBUG
|
isamem_log("ISAMEM: read(%04x) = %02x) page=%d\n", port, ret, vpage);
|
||||||
isamem_log("ISAMEM: read(%04x) = %02x)\n", port, ret);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -333,12 +331,13 @@ consecutive_ems_read(uint16_t port, void *priv)
|
|||||||
/* Get the viewport page number. */
|
/* Get the viewport page number. */
|
||||||
vpage = (port - dev->base_addr);
|
vpage = (port - dev->base_addr);
|
||||||
|
|
||||||
isamem_log("ISAMEM: read(%04x) = %02x) page=%d\n", port, ret, vpage);
|
|
||||||
|
|
||||||
ret = dev->ems[vpage].page;
|
ret = dev->ems[vpage].page;
|
||||||
if (dev->ems[vpage].enabled)
|
if (dev->ems[vpage].enabled)
|
||||||
ret |= 0x80;
|
ret |= 0x80;
|
||||||
|
|
||||||
|
isamem_log("ISAMEM: read(%04x) = %02x) page=%d\n", port, ret, vpage);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,12 +352,10 @@ ems_write(uint16_t port, uint8_t val, void *priv)
|
|||||||
vpage = (port / EMS_PGSIZE);
|
vpage = (port / EMS_PGSIZE);
|
||||||
port &= (EMS_PGSIZE - 1);
|
port &= (EMS_PGSIZE - 1);
|
||||||
|
|
||||||
#if ISAMEM_DEBUG
|
|
||||||
isamem_log("ISAMEM: write(%04x, %02x) page=%d\n", port, val, vpage);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (port - dev->base_addr) {
|
switch (port - dev->base_addr) {
|
||||||
case 0x0000: /* page mapping registers */
|
case 0x0000: /* page mapping registers */
|
||||||
|
isamem_log("ISAMEM: write(%04x, %02x) to page mapping registers! page=%d\n", port, val, vpage);
|
||||||
|
|
||||||
/* Set the page number. */
|
/* Set the page number. */
|
||||||
dev->ems[vpage].enabled = (val & 0x80);
|
dev->ems[vpage].enabled = (val & 0x80);
|
||||||
dev->ems[vpage].page = (val & 0x7f);
|
dev->ems[vpage].page = (val & 0x7f);
|
||||||
@@ -385,6 +382,8 @@ ems_write(uint16_t port, uint8_t val, void *priv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x0001: /* page frame registers */
|
case 0x0001: /* page frame registers */
|
||||||
|
isamem_log("ISAMEM: write(%04x, %02x) to page frame registers! page=%d\n", port, val, vpage);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The EV-159 EMM driver configures the frame address
|
* The EV-159 EMM driver configures the frame address
|
||||||
* by setting bits in these registers. The information
|
* by setting bits in these registers. The information
|
||||||
@@ -403,7 +402,6 @@ ems_write(uint16_t port, uint8_t val, void *priv)
|
|||||||
* 80 c0 e0 DC000
|
* 80 c0 e0 DC000
|
||||||
* 80 c0 e0 E0000
|
* 80 c0 e0 E0000
|
||||||
*/
|
*/
|
||||||
isamem_log("EMS: write(%02x) to register 1 !\n");
|
|
||||||
dev->ems[vpage].frame = val;
|
dev->ems[vpage].frame = val;
|
||||||
dev->frame_addr = 0x000c4000 + ((((dev->ems[2].frame & 0x80) >> 5) ||
|
dev->frame_addr = 0x000c4000 + ((((dev->ems[2].frame & 0x80) >> 5) ||
|
||||||
((dev->ems[1].frame & 0x80) >> 6) ||
|
((dev->ems[1].frame & 0x80) >> 6) ||
|
||||||
@@ -429,9 +427,8 @@ consecutive_ems_write(uint16_t port, uint8_t val, void *priv)
|
|||||||
/* Get the viewport page number. */
|
/* Get the viewport page number. */
|
||||||
vpage = (port - dev->base_addr);
|
vpage = (port - dev->base_addr);
|
||||||
|
|
||||||
isamem_log("ISAMEM: write(%04x, %02x) page=%d\n", port, val, vpage);
|
isamem_log("ISAMEM: write(%04x, %02x) to page mapping registers! (page=%d)\n", port, val, vpage);
|
||||||
|
|
||||||
isamem_log("EMS: write(%02x) to register 0! (%02x)\n", val);
|
|
||||||
/* Set the page number. */
|
/* Set the page number. */
|
||||||
dev->ems[vpage].enabled = 1;
|
dev->ems[vpage].enabled = 1;
|
||||||
dev->ems[vpage].page = val;
|
dev->ems[vpage].page = val;
|
||||||
@@ -532,6 +529,14 @@ isamem_init(const device_t *info)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ISAMEM_RAMPAGEXT_CARD: /* AST RAMpage/XT */
|
case ISAMEM_RAMPAGEXT_CARD: /* AST RAMpage/XT */
|
||||||
|
dev->base_addr = device_get_config_hex16("base");
|
||||||
|
dev->total_size = device_get_config_int("size");
|
||||||
|
dev->start_addr = device_get_config_int("start");
|
||||||
|
tot = dev->total_size;
|
||||||
|
dev->flags |= FLAG_EMS;
|
||||||
|
dev->frame_addr = 0xE0000;
|
||||||
|
break;
|
||||||
|
|
||||||
case ISAMEM_ABOVEBOARD_CARD: /* Intel AboveBoard */
|
case ISAMEM_ABOVEBOARD_CARD: /* Intel AboveBoard */
|
||||||
case ISAMEM_BRAT_CARD: /* BocaRAM/AT */
|
case ISAMEM_BRAT_CARD: /* BocaRAM/AT */
|
||||||
dev->base_addr = device_get_config_hex16("base");
|
dev->base_addr = device_get_config_hex16("base");
|
||||||
@@ -1673,7 +1678,7 @@ static const device_config_t rampage_config[] = {
|
|||||||
.description = "Address",
|
.description = "Address",
|
||||||
.type = CONFIG_HEX16,
|
.type = CONFIG_HEX16,
|
||||||
.default_string = "",
|
.default_string = "",
|
||||||
.default_int = 0x0258,
|
.default_int = 0x0218,
|
||||||
.file_filter = "",
|
.file_filter = "",
|
||||||
.spinner = { 0 },
|
.spinner = { 0 },
|
||||||
.selection = {
|
.selection = {
|
||||||
@@ -1687,22 +1692,6 @@ static const device_config_t rampage_config[] = {
|
|||||||
{ .description = "" }
|
{ .description = "" }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
.name = "frame",
|
|
||||||
.description = "Frame Address",
|
|
||||||
.type = CONFIG_HEX20,
|
|
||||||
.default_string = "",
|
|
||||||
.default_int = 0,
|
|
||||||
.file_filter = "",
|
|
||||||
.spinner = { 0 },
|
|
||||||
.selection = {
|
|
||||||
{ .description = "Disabled", .value = 0x00000 },
|
|
||||||
{ .description = "C000H", .value = 0xC0000 },
|
|
||||||
{ .description = "D000H", .value = 0xD0000 },
|
|
||||||
{ .description = "E000H", .value = 0xE0000 },
|
|
||||||
{ .description = "" }
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
.name = "size",
|
.name = "size",
|
||||||
.description = "Memory Size",
|
.description = "Memory Size",
|
||||||
@@ -1717,6 +1706,19 @@ static const device_config_t rampage_config[] = {
|
|||||||
},
|
},
|
||||||
.selection = { { 0 } }
|
.selection = { { 0 } }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.name = "start",
|
||||||
|
.description = "Start Address",
|
||||||
|
.type = CONFIG_SPINNER,
|
||||||
|
.default_string = "",
|
||||||
|
.default_int = 640,
|
||||||
|
.file_filter = "",
|
||||||
|
.spinner = {
|
||||||
|
.min = 0,
|
||||||
|
.max = 640,
|
||||||
|
.step = 64
|
||||||
|
},
|
||||||
|
},
|
||||||
{ .name = "", .description = "", .type = CONFIG_END }
|
{ .name = "", .description = "", .type = CONFIG_END }
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user