add compiler option (#define) for using 6502 emulator or simulator
This commit is contained in:
parent
eb2cc561d6
commit
90d9fbd9c5
|
@ -47,9 +47,12 @@ Apple2::Apple2(KeypressQueue& keypresses, PaddleButtonStates& paddleButtonStates
|
|||
addressBus(ram,rom,kbd,videoMode,paddles,paddleButtonStates,speaker,cassette,slts),
|
||||
picgen(tv,videoMode,this->revision),
|
||||
video(videoMode,addressBus,picgen,textRows),
|
||||
#ifdef USE_EMU
|
||||
transistors("transistors"),
|
||||
cpu(transistors,addressBus),
|
||||
// cpu(addressBus),
|
||||
#else
|
||||
cpu(addressBus),
|
||||
#endif
|
||||
powerUpReset(*this),
|
||||
revision(1)
|
||||
{
|
||||
|
|
|
@ -39,6 +39,9 @@
|
|||
class Emulator;
|
||||
class ScreenImage;
|
||||
|
||||
//#define USE_EMU 1
|
||||
#undef USE_EMU
|
||||
|
||||
class Apple2 : public Timable
|
||||
{
|
||||
Slots slts;
|
||||
|
@ -53,9 +56,12 @@ class Apple2 : public Timable
|
|||
PictureGenerator picgen;
|
||||
TextCharacters textRows;
|
||||
Video video;
|
||||
// CPU cpu;
|
||||
#ifdef USE_EMU
|
||||
std::ifstream transistors;
|
||||
Emu6502 cpu;
|
||||
#else
|
||||
CPU cpu;
|
||||
#endif
|
||||
PowerUpReset powerUpReset;
|
||||
int revision;
|
||||
|
||||
|
|
|
@ -44,5 +44,9 @@ void PowerUpReset::tick()
|
|||
|
||||
void PowerUpReset::powerOn()
|
||||
{
|
||||
#ifdef USE_EMU
|
||||
this->pendingTicks = 99; // TODO REMOVE THIS
|
||||
#else
|
||||
this->pendingTicks = (int)(E2Const::AVG_CPU_HZ*.3); // U.A.II, p. 7-15
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue