mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-04-21 17:16:35 +00:00
Simplify memory event handlers and ROM recognition a little (bit of speed difference)
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -100,17 +100,15 @@ void Board::Cpu_ExecutingInstruction_Debug(const EightBit::MOS6502& cpu) {
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
void Board::Memory_ReadingByte_Input(const uint16_t address) {
|
||||
if (address == m_configuration.getInputAddress()) {
|
||||
if (DATA() != 0) {
|
||||
assert(address == ADDRESS().word);
|
||||
void Board::Memory_ReadingByte_Input(EightBit::EventArgs) {
|
||||
if (ADDRESS().word == m_configuration.getInputAddress()) {
|
||||
if (DATA() != 0)
|
||||
write(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Board::Memory_WrittenByte_Output(const uint16_t address) {
|
||||
if (address == m_configuration.getOutputAddress()) {
|
||||
void Board::Memory_WrittenByte_Output(EightBit::EventArgs) {
|
||||
if (ADDRESS().word == m_configuration.getOutputAddress()) {
|
||||
#ifdef _MSC_VER
|
||||
_putch(DATA());
|
||||
#endif
|
||||
|
||||
+4
-6
@@ -20,13 +20,11 @@ public:
|
||||
void initialise();
|
||||
|
||||
protected:
|
||||
virtual uint8_t& reference(uint16_t address, bool& rom) {
|
||||
rom = false;
|
||||
virtual uint8_t& reference(uint16_t address) {
|
||||
return m_ram.reference(address);
|
||||
}
|
||||
|
||||
virtual uint8_t reference(uint16_t address, bool& rom) const {
|
||||
rom = false;
|
||||
virtual uint8_t reference(uint16_t address) const {
|
||||
return m_ram.reference(address);
|
||||
}
|
||||
|
||||
@@ -50,8 +48,8 @@ private:
|
||||
|
||||
void Cpu_ExecutedInstruction_StopLoop(const EightBit::MOS6502& cpu);
|
||||
|
||||
void Memory_ReadingByte_Input(uint16_t address);
|
||||
void Memory_WrittenByte_Output(uint16_t address);
|
||||
void Memory_ReadingByte_Input(EightBit::EventArgs);
|
||||
void Memory_WrittenByte_Output(EightBit::EventArgs);
|
||||
|
||||
void Cpu_ExecutedInstruction_Poll(const EightBit::MOS6502& cpu);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user