mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-22 09:30:32 +00:00
Wire the GameBoy board like a piece of powered hardware.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
e326490cd9
commit
68b352d1df
@ -36,6 +36,9 @@ namespace EightBit {
|
||||
|
||||
Bus() noexcept;
|
||||
|
||||
virtual void powerOn() override;
|
||||
virtual void powerOff() override;
|
||||
|
||||
auto& CPU() { return m_cpu; }
|
||||
auto& VRAM() { return m_videoRam; }
|
||||
auto& OAMRAM() { return m_oamRam; }
|
||||
|
@ -8,6 +8,17 @@ EightBit::GameBoy::Bus::Bus() noexcept
|
||||
WrittenByte.connect(std::bind(&GameBoy::Bus::Bus_WrittenByte, this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
void EightBit::GameBoy::Bus::powerOn() {
|
||||
EightBit::Bus::powerOn();
|
||||
CPU().powerOn();
|
||||
reset();
|
||||
}
|
||||
|
||||
void EightBit::GameBoy::Bus::powerOff() {
|
||||
CPU().powerOff();
|
||||
EightBit::Bus::powerOff();
|
||||
}
|
||||
|
||||
void EightBit::GameBoy::Bus::reset() {
|
||||
IO().reset();
|
||||
LR35902::lower(CPU().RESET());
|
||||
|
Loading…
Reference in New Issue
Block a user