mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-02-03 15:30:34 +00:00
Zero page indirection should completely ignore the high byte of the address line.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
bfa1c07ea4
commit
dcf99bf65d
@ -75,6 +75,8 @@ namespace EightBit {
|
|||||||
adjustNegative(datum);
|
adjustNegative(datum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void getWord(uint8_t offset, register16_t& output);
|
||||||
|
|
||||||
void getWord(register16_t& output);
|
void getWord(register16_t& output);
|
||||||
void getWord(uint16_t offset, register16_t& output);
|
void getWord(uint16_t offset, register16_t& output);
|
||||||
void getWord(const register16_t& offset, register16_t& output);
|
void getWord(const register16_t& offset, register16_t& output);
|
||||||
@ -97,7 +99,7 @@ namespace EightBit {
|
|||||||
|
|
||||||
void Address_ZeroPageIndirect() {
|
void Address_ZeroPageIndirect() {
|
||||||
Address_ZeroPage();
|
Address_ZeroPage();
|
||||||
getWord(MEMPTR(), MEMPTR());
|
getWord(MEMPTR().low, MEMPTR());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Address_Indirect() {
|
void Address_Indirect() {
|
||||||
@ -127,7 +129,7 @@ namespace EightBit {
|
|||||||
|
|
||||||
void Address_IndexedIndirectX() {
|
void Address_IndexedIndirectX() {
|
||||||
Address_ZeroPageX();
|
Address_ZeroPageX();
|
||||||
getWord(MEMPTR(), MEMPTR());
|
getWord(MEMPTR().low, MEMPTR());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Address_IndirectIndexedY() {
|
void Address_IndirectIndexedY() {
|
||||||
|
@ -63,6 +63,14 @@ void EightBit::MOS6502::reset() {
|
|||||||
getWord(RSTvector, PC());
|
getWord(RSTvector, PC());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EightBit::MOS6502::getWord(uint8_t offset, register16_t& output) {
|
||||||
|
BUS().ADDRESS().low = offset;
|
||||||
|
BUS().ADDRESS().high = 0;
|
||||||
|
output.low = getByte();
|
||||||
|
BUS().ADDRESS().low++;
|
||||||
|
output.high = getByte();
|
||||||
|
}
|
||||||
|
|
||||||
void EightBit::MOS6502::getWord(register16_t& output) {
|
void EightBit::MOS6502::getWord(register16_t& output) {
|
||||||
output.low = getByte();
|
output.low = getByte();
|
||||||
BUS().ADDRESS().word++;
|
BUS().ADDRESS().word++;
|
||||||
@ -502,12 +510,12 @@ void EightBit::MOS6502::Branch(bool flag) {
|
|||||||
//
|
//
|
||||||
|
|
||||||
void EightBit::MOS6502::PHP() {
|
void EightBit::MOS6502::PHP() {
|
||||||
setFlag(P(), BF);
|
//setFlag(P(), BF);
|
||||||
push(P());
|
push(P() | BF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EightBit::MOS6502::PLP() {
|
void EightBit::MOS6502::PLP() {
|
||||||
P() = pop() | RF;
|
P() = pop() | RF & (~BF);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user