Pages above the top of RAM now have mem[] pointing to a 4096-byte array of FF's, and fixed the naming and indentation of the P5MP3 in machine/machine_table.c.

This commit is contained in:
OBattler
2020-06-21 04:03:14 +02:00
parent d2dbf49e3c
commit 8bf15f535b
2 changed files with 31 additions and 7 deletions

View File

@@ -235,7 +235,7 @@ const machine_t machines[] = {
{ "[i430LX] IBM PS/ValuePoint P60", "valuepointp60", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 127, machine_at_valuepointp60_init, NULL }, { "[i430LX] IBM PS/ValuePoint P60", "valuepointp60", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 127, machine_at_valuepointp60_init, NULL },
#endif #endif
{ "[i430LX] Intel Premiere/PCI", "revenge", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 127, machine_at_batman_init, NULL }, { "[i430LX] Intel Premiere/PCI", "revenge", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 127, machine_at_batman_init, NULL },
{ "[i430LX] ASUS P5MP3", "p5mp3", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 192, 2, 127, machine_at_p5mp3_init, NULL }, { "[i430LX] ASUS P/I-P5MP3", "p5mp3", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 192, 2, 127, machine_at_p5mp3_init, NULL },
{ "[i430LX] Micro Star 586MC1", "586mc1", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 127, machine_at_586mc1_init, NULL }, { "[i430LX] Micro Star 586MC1", "586mc1", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 127, machine_at_586mc1_init, NULL },
/* Socket 5 machines */ /* Socket 5 machines */

View File

@@ -81,6 +81,7 @@ page_t *pages, /* RAM page table */
uint32_t pages_sz; /* #pages in table */ uint32_t pages_sz; /* #pages in table */
uint8_t *ram, *ram2; /* the virtual RAM */ uint8_t *ram, *ram2; /* the virtual RAM */
uint8_t page_ff[4096];
uint32_t rammask; uint32_t rammask;
uint8_t *rom; /* the virtual ROM */ uint8_t *rom; /* the virtual ROM */
@@ -1720,6 +1721,9 @@ page_remove_from_evict_list(page_t *p)
void void
mem_write_ramb_page(uint32_t addr, uint8_t val, page_t *p) mem_write_ramb_page(uint32_t addr, uint8_t val, page_t *p)
{ {
if ((p != NULL) && (p->mem == page_ff))
return;
#ifdef USE_DYNAREC #ifdef USE_DYNAREC
if (val != p->mem[addr & 0xfff] || codegen_in_recompile) { if (val != p->mem[addr & 0xfff] || codegen_in_recompile) {
#else #else
@@ -1743,6 +1747,9 @@ mem_write_ramb_page(uint32_t addr, uint8_t val, page_t *p)
void void
mem_write_ramw_page(uint32_t addr, uint16_t val, page_t *p) mem_write_ramw_page(uint32_t addr, uint16_t val, page_t *p)
{ {
if ((p != NULL) && (p->mem == page_ff))
return;
#ifdef USE_DYNAREC #ifdef USE_DYNAREC
if (val != *(uint16_t *)&p->mem[addr & 0xfff] || codegen_in_recompile) { if (val != *(uint16_t *)&p->mem[addr & 0xfff] || codegen_in_recompile) {
#else #else
@@ -1776,6 +1783,9 @@ mem_write_ramw_page(uint32_t addr, uint16_t val, page_t *p)
void void
mem_write_raml_page(uint32_t addr, uint32_t val, page_t *p) mem_write_raml_page(uint32_t addr, uint32_t val, page_t *p)
{ {
if ((p != NULL) && (p->mem == page_ff))
return;
#ifdef USE_DYNAREC #ifdef USE_DYNAREC
if (val != *(uint32_t *)&p->mem[addr & 0xfff] || codegen_in_recompile) { if (val != *(uint32_t *)&p->mem[addr & 0xfff] || codegen_in_recompile) {
#else #else
@@ -1805,6 +1815,9 @@ mem_write_raml_page(uint32_t addr, uint32_t val, page_t *p)
void void
mem_write_ramb_page(uint32_t addr, uint8_t val, page_t *p) mem_write_ramb_page(uint32_t addr, uint8_t val, page_t *p)
{ {
if ((p != NULL) && (p->mem == page_ff))
return;
#ifdef USE_DYNAREC #ifdef USE_DYNAREC
if ((p == NULL) || (p->mem == NULL) || (val != p->mem[addr & 0xfff]) || codegen_in_recompile) { if ((p == NULL) || (p->mem == NULL) || (val != p->mem[addr & 0xfff]) || codegen_in_recompile) {
#else #else
@@ -1820,6 +1833,9 @@ mem_write_ramb_page(uint32_t addr, uint8_t val, page_t *p)
void void
mem_write_ramw_page(uint32_t addr, uint16_t val, page_t *p) mem_write_ramw_page(uint32_t addr, uint16_t val, page_t *p)
{ {
if ((p != NULL) && (p->mem == page_ff))
return;
#ifdef USE_DYNAREC #ifdef USE_DYNAREC
if ((p == NULL) || (p->mem == NULL) || (val != *(uint16_t *)&p->mem[addr & 0xfff]) || codegen_in_recompile) { if ((p == NULL) || (p->mem == NULL) || (val != *(uint16_t *)&p->mem[addr & 0xfff]) || codegen_in_recompile) {
#else #else
@@ -1837,6 +1853,9 @@ mem_write_ramw_page(uint32_t addr, uint16_t val, page_t *p)
void void
mem_write_raml_page(uint32_t addr, uint32_t val, page_t *p) mem_write_raml_page(uint32_t addr, uint32_t val, page_t *p)
{ {
if ((p != NULL) && (p->mem == page_ff))
return;
#ifdef USE_DYNAREC #ifdef USE_DYNAREC
if ((p == NULL) || (p->mem == NULL) || (val != *(uint32_t *)&p->mem[addr & 0xfff]) || codegen_in_recompile) { if ((p == NULL) || (p->mem == NULL) || (val != *(uint32_t *)&p->mem[addr & 0xfff]) || codegen_in_recompile) {
#else #else
@@ -2606,6 +2625,9 @@ mem_log("MEM: reset: new pages=%08lx, pages_sz=%i\n", pages, pages_sz);
#endif #endif
for (c = 0; c < pages_sz; c++) { for (c = 0; c < pages_sz; c++) {
if ((c << 12) >= (mem_size << 10))
pages[c].mem = page_ff;
else {
if (mem_size > 1048576) { if (mem_size > 1048576) {
if ((c << 12) < (1 << 30)) if ((c << 12) < (1 << 30))
pages[c].mem = &ram[c << 12]; pages[c].mem = &ram[c << 12];
@@ -2613,6 +2635,7 @@ mem_log("MEM: reset: new pages=%08lx, pages_sz=%i\n", pages, pages_sz);
pages[c].mem = &ram2[(c << 12) - (1 << 30)]; pages[c].mem = &ram2[(c << 12) - (1 << 30)];
} else } else
pages[c].mem = &ram[c << 12]; pages[c].mem = &ram[c << 12];
}
if (c < m) { if (c < m) {
pages[c].write_b = mem_write_ramb_page; pages[c].write_b = mem_write_ramb_page;
pages[c].write_w = mem_write_ramw_page; pages[c].write_w = mem_write_ramw_page;
@@ -2745,6 +2768,7 @@ mem_init(void)
#if FIXME #if FIXME
memset(ff_array, 0xff, sizeof(ff_array)); memset(ff_array, 0xff, sizeof(ff_array));
#endif #endif
memset(page_ff, 0xff, sizeof(page_ff));
/* Reset the memory state. */ /* Reset the memory state. */
mem_reset(); mem_reset();