mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-04-21 01:16:50 +00:00
Get rid of wrappers for bus access: i.e. make it clearer where the bus is being read/written.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -13,23 +13,21 @@ void EightBit::IntelProcessor::reset() {
|
||||
}
|
||||
|
||||
void EightBit::IntelProcessor::push(uint8_t value) {
|
||||
setByte(--SP().word, value);
|
||||
BUS().write(--SP().word, value);
|
||||
}
|
||||
|
||||
uint8_t EightBit::IntelProcessor::pop() {
|
||||
return getByte(SP().word++);
|
||||
return BUS().read(SP().word++);
|
||||
}
|
||||
|
||||
EightBit::register16_t EightBit::IntelProcessor::getWord() {
|
||||
register16_t returned;
|
||||
returned.low = getByte(MEMPTR().word++);
|
||||
BUS().ADDRESS().word++;
|
||||
returned.high = getByte();
|
||||
returned.low = BUS().read(MEMPTR().word++);
|
||||
returned.high = BUS().read(++BUS().ADDRESS().word);
|
||||
return returned;
|
||||
}
|
||||
|
||||
void EightBit::IntelProcessor::setWord(register16_t value) {
|
||||
setByte(MEMPTR().word++, value.low);
|
||||
BUS().ADDRESS().word++;
|
||||
setByte(value.high);
|
||||
BUS().write(MEMPTR().word++, value.low);
|
||||
BUS().write(++BUS().ADDRESS().word, value.high);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user