mirror of
https://github.com/JorjBauer/aiie.git
synced 2024-09-11 01:56:59 +00:00
fixed INTCXROM loading/handling. Added comments in updateMemoryPages() as the functionality was verified.
This commit is contained in:
parent
080b236ab2
commit
609e5456b2
@ -683,12 +683,13 @@ void AppleMMU::resetRAM()
|
|||||||
uint8_t v = romData[idx];
|
uint8_t v = romData[idx];
|
||||||
#endif
|
#endif
|
||||||
for (int j=0; j<5; j++) {
|
for (int j=0; j<5; j++) {
|
||||||
// FIXME: not sure why this has to update pages [0] and [1] to
|
// For the ROM section from 0xc100 .. 0xcfff, we load in to
|
||||||
// work; find out what the //e really did
|
// an alternate page space (INTCXROM).
|
||||||
for (uint8_t j=0; j<2; j++) {
|
if (i >= 0xc1 && i <= 0xcf) {
|
||||||
if (ramPages[i][j]) {
|
ramPages[i][1][k] = v;
|
||||||
ramPages[i][j][k] = v;
|
} else {
|
||||||
}
|
// Everything else goes in page 0.
|
||||||
|
ramPages[i][0][k] = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -759,12 +760,22 @@ void AppleMMU::updateMemoryPages()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (switches & S_80STORE) {
|
if (switches & S_80STORE) {
|
||||||
|
// When S_80STORE is on, we switch 400-800 and 2000-4000 based on S_PAGE2.
|
||||||
|
// The behavior is different based on whether HIRESON/OFF is set.
|
||||||
if (switches & S_PAGE2) {
|
if (switches & S_PAGE2) {
|
||||||
|
// Regardless of HIRESON/OFF, pages 0x400-0x7ff are switched on S_PAGE2
|
||||||
for (uint8_t idx = 0x04; idx < 0x08; idx++) {
|
for (uint8_t idx = 0x04; idx < 0x08; idx++) {
|
||||||
readPages[idx] = ramPages[idx][1];
|
readPages[idx] = ramPages[idx][1];
|
||||||
writePages[idx] = ramPages[idx][1];
|
writePages[idx] = ramPages[idx][1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// but 2000-3fff switches based on S_PAGE2 only if HIRES is on.
|
||||||
|
|
||||||
|
// HIRESOFF: 400-7ff doesn't switch based on read/write flags
|
||||||
|
// b/c it switches based on S_PAGE2 instead
|
||||||
|
// HIRESON: 400-800, 2000-3fff doesn't switch
|
||||||
|
// b/c they switch based on S_PAGE2 instead
|
||||||
|
|
||||||
// If HIRES is on, then we honor the PAGE2 setting; otherwise, we don't
|
// If HIRES is on, then we honor the PAGE2 setting; otherwise, we don't
|
||||||
for (uint8_t idx = 0x20; idx < 0x40; idx++) {
|
for (uint8_t idx = 0x20; idx < 0x40; idx++) {
|
||||||
readPages[idx] = ramPages[idx][(switches & S_HIRES) ? 1 : 0];
|
readPages[idx] = ramPages[idx][(switches & S_HIRES) ? 1 : 0];
|
||||||
@ -775,15 +786,12 @@ void AppleMMU::updateMemoryPages()
|
|||||||
readPages[idx] = ramPages[idx][0];
|
readPages[idx] = ramPages[idx][0];
|
||||||
writePages[idx] = ramPages[idx][0];
|
writePages[idx] = ramPages[idx][0];
|
||||||
}
|
}
|
||||||
if (switches & S_HIRES) {
|
|
||||||
// PAGE2 is off, so we set this back to 0 regardless
|
|
||||||
for (uint8_t idx = 0x20; idx < 0x40; idx++) {
|
for (uint8_t idx = 0x20; idx < 0x40; idx++) {
|
||||||
readPages[idx] = ramPages[idx][0];
|
readPages[idx] = ramPages[idx][0];
|
||||||
writePages[idx] = ramPages[idx][0];
|
writePages[idx] = ramPages[idx][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (intcxrom) {
|
if (intcxrom) {
|
||||||
for (uint8_t idx = 0xc1; idx < 0xd0; idx++) {
|
for (uint8_t idx = 0xc1; idx < 0xd0; idx++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user