mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-10 10:29:43 +00:00
Power on conditions are chip specific and *not* directly related to construction/destruction.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
19aea5244b
commit
21bd8a06e6
@ -31,6 +31,7 @@ namespace EightBit {
|
|||||||
|
|
||||||
virtual int execute(uint8_t opcode) final;
|
virtual int execute(uint8_t opcode) final;
|
||||||
virtual int step() final;
|
virtual int step() final;
|
||||||
|
virtual void powerOn() override;
|
||||||
|
|
||||||
uint8_t& X() { return x; }
|
uint8_t& X() { return x; }
|
||||||
uint8_t& Y() { return y; }
|
uint8_t& Y() { return y; }
|
||||||
@ -316,11 +317,11 @@ namespace EightBit {
|
|||||||
const uint8_t RSTvector = 0xfc;
|
const uint8_t RSTvector = 0xfc;
|
||||||
const uint8_t NMIvector = 0xfa;
|
const uint8_t NMIvector = 0xfa;
|
||||||
|
|
||||||
uint8_t x; // index register X
|
uint8_t x = 0; // index register X
|
||||||
uint8_t y; // index register Y
|
uint8_t y = 0; // index register Y
|
||||||
uint8_t a; // accumulator
|
uint8_t a = 0; // accumulator
|
||||||
uint8_t s; // stack pointer
|
uint8_t s = 0; // stack pointer
|
||||||
uint8_t p; // processor status
|
uint8_t p = 0; // processor status
|
||||||
|
|
||||||
PinLevel m_soLine = Low;
|
PinLevel m_soLine = Low;
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
#include "mos6502.h"
|
#include "mos6502.h"
|
||||||
|
|
||||||
EightBit::MOS6502::MOS6502(Bus& bus)
|
EightBit::MOS6502::MOS6502(Bus& bus)
|
||||||
: Processor(bus) {
|
: Processor(bus) {}
|
||||||
|
|
||||||
|
void EightBit::MOS6502::powerOn() {
|
||||||
|
|
||||||
X() = Bit7;
|
X() = Bit7;
|
||||||
Y() = 0;
|
Y() = 0;
|
||||||
@ -11,6 +13,8 @@ EightBit::MOS6502::MOS6502(Bus& bus)
|
|||||||
S() = Mask8;
|
S() = Mask8;
|
||||||
|
|
||||||
raise(SO());
|
raise(SO());
|
||||||
|
|
||||||
|
Processor::powerOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
int EightBit::MOS6502::step() {
|
int EightBit::MOS6502::step() {
|
||||||
|
@ -76,7 +76,7 @@ namespace EightBit {
|
|||||||
PinLevel& POWER() { return m_powerLine; } // In
|
PinLevel& POWER() { return m_powerLine; } // In
|
||||||
|
|
||||||
bool powered() { return raised(POWER()); }
|
bool powered() { return raised(POWER()); }
|
||||||
void powerOn() { raise(POWER()); raise(HALT()); reset(); }
|
virtual void powerOn() { raise(POWER()); raise(HALT()); reset(); }
|
||||||
void powerOff() { lower(POWER()); }
|
void powerOff() { lower(POWER()); }
|
||||||
|
|
||||||
int run(int limit);
|
int run(int limit);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user