mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-09-01 15:29:11 +00:00
Better method of enabling/disabling boot ROM.
Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
86a4e22ae1
commit
75b17e47a8
@ -158,13 +158,13 @@ namespace EightBit {
|
||||
writeRegister(LY, 0);
|
||||
}
|
||||
|
||||
void disableBootRom() { m_disableBootRom = true; }
|
||||
void enableBootRom() { m_disableBootRom = false; }
|
||||
bool bootRomDisabled() const { return m_disableBootRom; }
|
||||
bool bootRomEnabled() const { return !bootRomDisabled(); }
|
||||
|
||||
void loadBootRom(const std::string& path);
|
||||
|
||||
bool isBootRom(uint16_t address) const {
|
||||
return !m_disableBootRom && (address < m_boot.size()) && !peek(BASE + BOOT_DISABLE);
|
||||
return (address < m_boot.size()) && bootRomEnabled();
|
||||
}
|
||||
|
||||
virtual uint8_t peek(uint16_t address) const;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include "Bus.h"
|
||||
|
||||
EightBit::Bus::Bus()
|
||||
: Memory(0xffff),
|
||||
m_disableBootRom(false) {
|
||||
: Memory(0xffff) {
|
||||
WrittenByte.connect(std::bind(&Bus::Bus_WrittenByte, this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
void EightBit::Bus::reset() {
|
||||
@ -39,8 +39,11 @@ uint8_t EightBit::Bus::peek(uint16_t address) const {
|
||||
|
||||
void EightBit::Bus::Bus_WrittenByte(const AddressEventArgs& e) {
|
||||
switch (e.getAddress()) {
|
||||
case EightBit::Bus::BASE + TAC:
|
||||
case BASE + TAC:
|
||||
m_timerRate = timerClockTicks();
|
||||
break;
|
||||
case BASE + BOOT_DISABLE:
|
||||
m_disableBootRom = e.getCell() != 0;
|
||||
break;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user