mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-11-12 17:04:46 +00:00
Correct a 6502 bug in absolute indirect addressing mode (unchanging page on address resolution).
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
1946b7ef39
commit
7432e602f8
@ -75,6 +75,7 @@ namespace EightBit {
|
||||
adjustNegative(datum);
|
||||
}
|
||||
|
||||
void getWord(uint8_t page, uint8_t offset, register16_t& output);
|
||||
void getWord(uint8_t offset, register16_t& output);
|
||||
|
||||
void getWord(register16_t& output);
|
||||
@ -104,7 +105,7 @@ namespace EightBit {
|
||||
|
||||
void Address_Indirect() {
|
||||
Address_Absolute();
|
||||
getWord(MEMPTR(), MEMPTR());
|
||||
getWord(MEMPTR().high, MEMPTR().low, MEMPTR());
|
||||
}
|
||||
|
||||
void Address_ZeroPageX() {
|
||||
|
@ -63,14 +63,18 @@ void EightBit::MOS6502::reset() {
|
||||
getWord(RSTvector, PC());
|
||||
}
|
||||
|
||||
void EightBit::MOS6502::getWord(uint8_t offset, register16_t& output) {
|
||||
void EightBit::MOS6502::getWord(uint8_t page, uint8_t offset, register16_t& output) {
|
||||
BUS().ADDRESS().low = offset;
|
||||
BUS().ADDRESS().high = 0;
|
||||
BUS().ADDRESS().high = page;
|
||||
output.low = getByte();
|
||||
BUS().ADDRESS().low++;
|
||||
output.high = getByte();
|
||||
}
|
||||
|
||||
void EightBit::MOS6502::getWord(uint8_t offset, register16_t& output) {
|
||||
getWord(0, offset, output);
|
||||
}
|
||||
|
||||
void EightBit::MOS6502::getWord(register16_t& output) {
|
||||
output.low = getByte();
|
||||
BUS().ADDRESS().word++;
|
||||
|
Loading…
Reference in New Issue
Block a user