mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-09-29 00:54:54 +00:00
Small performance change to 8080 reserved flags.
Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
dc1f7ad1d5
commit
c52f0a36aa
@ -38,12 +38,7 @@ namespace EightBit {
|
|||||||
|
|
||||||
const std::array<Instruction, 0x100>& getInstructions() const { return instructions; }
|
const std::array<Instruction, 0x100>& getInstructions() const { return instructions; }
|
||||||
|
|
||||||
register16_t& AF() {
|
register16_t& AF() { return af; }
|
||||||
af.low &= ~(Bit5 | Bit3);
|
|
||||||
af.low |= Bit1;
|
|
||||||
return af;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t& A() { return AF().high; }
|
uint8_t& A() { return AF().high; }
|
||||||
uint8_t& F() { return AF().low; }
|
uint8_t& F() { return AF().low; }
|
||||||
|
|
||||||
@ -105,6 +100,11 @@ namespace EightBit {
|
|||||||
return cycles + instruction.count;
|
return cycles + instruction.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void adjustReservedFlags() {
|
||||||
|
AF().low &= ~(Bit5 | Bit3);
|
||||||
|
AF().low |= Bit1;
|
||||||
|
}
|
||||||
|
|
||||||
void adjustSign(uint8_t value) { setFlag(SF, value & SF); }
|
void adjustSign(uint8_t value) { setFlag(SF, value & SF); }
|
||||||
void adjustZero(uint8_t value) { clearFlag(ZF, value);}
|
void adjustZero(uint8_t value) { clearFlag(ZF, value);}
|
||||||
|
|
||||||
@ -343,7 +343,11 @@ namespace EightBit {
|
|||||||
void pop_b() { popWord(BC()); }
|
void pop_b() { popWord(BC()); }
|
||||||
void pop_d() { popWord(DE()); }
|
void pop_d() { popWord(DE()); }
|
||||||
void pop_h() { popWord(HL()); }
|
void pop_h() { popWord(HL()); }
|
||||||
void pop_psw() { popWord(AF()); }
|
|
||||||
|
void pop_psw() {
|
||||||
|
popWord(AF());
|
||||||
|
adjustReservedFlags();
|
||||||
|
}
|
||||||
|
|
||||||
void xhtl() {
|
void xhtl() {
|
||||||
auto tos = m_memory.getWord(sp.word);
|
auto tos = m_memory.getWord(sp.word);
|
||||||
|
Loading…
Reference in New Issue
Block a user