- [FIX] No calculava be l'adreça de la ROM actual en 128K

- [FIX] La ROM accedeix al pot 0x7ffd "the torerous menner", he tingut que ficar un apanyo
This commit is contained in:
2025-07-21 14:00:31 +02:00
parent ab476a19b1
commit 300f95803e
2 changed files with 13 additions and 9 deletions

View File

@@ -22,8 +22,8 @@ zx_128mem::zx_128mem()
void zx_128mem::port_out(int port, int val)
{
const bool shadow = config & ZX_128MEM_SCREEN;
if (config & ZX_128MEM_DISPAG) return;
const bool shadow = config & ZX_128MEM_SCREEN;
config = val;
if (config & ZX_128MEM_SCREEN) {
if (!shadow) zxscreen::setBaseAddresses(0x4000*7, 0x1800+0x4000*7);
@@ -40,7 +40,7 @@ uint8_t zx_128mem::readMem(uint16_t address)
switch (bank)
{
case 0:
return rom[disp | ((config & ZX_128MEM_ROM)<<4)];
return rom[disp | ((config & ZX_128MEM_ROM)<<10)];
break;
case 1:
return memory[disp | 0x14000];
@@ -52,6 +52,7 @@ uint8_t zx_128mem::readMem(uint16_t address)
return memory[disp | (0x4000 * (config&ZX_128MEM_PAGE))];
break;
}
return 0;
}
void zx_128mem::writeMem(uint16_t address, uint8_t value)
@@ -88,7 +89,7 @@ uint8_t zx_128mem::getTag(uint16_t address)
switch (bank)
{
case 0:
return romtags[disp | ((config & ZX_128MEM_ROM)<<4)];
return romtags[disp | ((config & ZX_128MEM_ROM)<<10)];
break;
case 1:
return tags[disp | 0x14000];
@@ -111,7 +112,7 @@ void zx_128mem::setTag(uint16_t address, uint8_t value)
switch (bank)
{
case 0:
romtags[disp | ((config & ZX_128MEM_ROM)<<4)] = value;
romtags[disp | ((config & ZX_128MEM_ROM)<<10)] = value;
break;
case 1:
tags[disp | 0x14000] = value;
@@ -135,6 +136,7 @@ void zx_128mem::reset()
for (int i=0; i<131072; ++i) tags[i] = MEMTAG_NONE;
z80::connect_port(0x7ffd, nullptr, zx_128_port_out);
z80::connect_port(0xfd, nullptr, zx_128_port_out);
}
void zx_128mem::saveState(FILE *f)