mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-23 03:32:38 +00:00
Correct some possible one definition rule issues.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
7a0ebb9198
commit
b3114ed520
@ -4,15 +4,13 @@
|
||||
#include <cassert>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <Bus.h>
|
||||
#include <InputOutput.h>
|
||||
#include <IntelProcessor.h>
|
||||
#include <Signal.h>
|
||||
#include <Register.h>
|
||||
|
||||
namespace EightBit {
|
||||
|
||||
class InputOutput;
|
||||
class Bus;
|
||||
|
||||
class Z80 : public IntelProcessor {
|
||||
public:
|
||||
struct refresh_t {
|
||||
@ -60,21 +58,10 @@ namespace EightBit {
|
||||
virtual int execute(uint8_t opcode);
|
||||
int step();
|
||||
|
||||
virtual register16_t& AF() override {
|
||||
return m_accumulatorFlags[m_accumulatorFlagsSet];
|
||||
}
|
||||
|
||||
virtual register16_t& BC() override {
|
||||
return m_registers[m_registerSet][BC_IDX];
|
||||
}
|
||||
|
||||
virtual register16_t& DE() override {
|
||||
return m_registers[m_registerSet][DE_IDX];
|
||||
}
|
||||
|
||||
virtual register16_t& HL() override {
|
||||
return m_registers[m_registerSet][HL_IDX];
|
||||
}
|
||||
virtual register16_t& AF() override;
|
||||
virtual register16_t& BC() override;
|
||||
virtual register16_t& DE() override;
|
||||
virtual register16_t& HL() override;
|
||||
|
||||
register16_t& IX() { return m_ix; }
|
||||
uint8_t& IXH() { return IX().high; }
|
||||
@ -103,10 +90,7 @@ namespace EightBit {
|
||||
virtual void reset() override;
|
||||
|
||||
protected:
|
||||
virtual int fetchExecute() override {
|
||||
M1() = true;
|
||||
return IntelProcessor::fetchExecute();
|
||||
}
|
||||
virtual int fetchExecute() override;
|
||||
|
||||
private:
|
||||
InputOutput& m_ports;
|
||||
|
@ -24,6 +24,27 @@ EightBit::Z80::Z80(Bus& bus, InputOutput& ports)
|
||||
IY().word = 0xffff;
|
||||
}
|
||||
|
||||
EightBit::register16_t& EightBit::Z80::AF() {
|
||||
return m_accumulatorFlags[m_accumulatorFlagsSet];
|
||||
}
|
||||
|
||||
EightBit::register16_t& EightBit::Z80::BC() {
|
||||
return m_registers[m_registerSet][BC_IDX];
|
||||
}
|
||||
|
||||
EightBit::register16_t& EightBit::Z80::DE() {
|
||||
return m_registers[m_registerSet][DE_IDX];
|
||||
}
|
||||
|
||||
EightBit::register16_t& EightBit::Z80::HL() {
|
||||
return m_registers[m_registerSet][HL_IDX];
|
||||
}
|
||||
|
||||
int EightBit::Z80::fetchExecute() {
|
||||
M1() = true;
|
||||
return IntelProcessor::fetchExecute();
|
||||
}
|
||||
|
||||
void EightBit::Z80::reset() {
|
||||
|
||||
IntelProcessor::reset();
|
||||
|
Loading…
x
Reference in New Issue
Block a user