mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-04-26 21:18:36 +00:00
Start refactoring the processor classes to allow big/little endian processors to be specified.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
+1
-16
@@ -2,7 +2,7 @@
|
||||
#include "mos6502.h"
|
||||
|
||||
EightBit::MOS6502::MOS6502(Bus& bus)
|
||||
: Processor(bus) {}
|
||||
: LittleEndianProcessor(bus) {}
|
||||
|
||||
void EightBit::MOS6502::powerOn() {
|
||||
|
||||
@@ -50,21 +50,6 @@ void EightBit::MOS6502::reset() {
|
||||
jump(getWordPaged(0xff, RSTvector));
|
||||
}
|
||||
|
||||
EightBit::register16_t EightBit::MOS6502::getWordPaged(uint8_t page, uint8_t offset) {
|
||||
const auto low = getBytePaged(page, offset);
|
||||
++BUS().ADDRESS().low;
|
||||
const auto high = BUS().read();
|
||||
return register16_t(low, high);
|
||||
}
|
||||
|
||||
uint8_t EightBit::MOS6502::getBytePaged(uint8_t page, uint8_t offset) {
|
||||
return BUS().read(register16_t(offset, page));
|
||||
}
|
||||
|
||||
void EightBit::MOS6502::setBytePaged(uint8_t page, uint8_t offset, uint8_t value) {
|
||||
BUS().write(register16_t(offset, page), value);
|
||||
}
|
||||
|
||||
void EightBit::MOS6502::interrupt(uint8_t vector) {
|
||||
raise(HALT());
|
||||
pushWord(PC());
|
||||
|
||||
Reference in New Issue
Block a user