#include <C64.h>
Collaboration diagram for C64:

Public Member Functions | |
| C64 (Frodo *aFrodoPtr) | |
| ~C64 () | |
| void | Run (void) |
| void | Quit (void) |
| bool | TogglePause (void) |
| bool | Paused (void) |
| void | Reset (void) |
| void | NMI (void) |
| void | VBlank (bool draw_frame) |
| void | NewPrefs (Prefs *prefs) |
| void | PatchKernal (bool fast_reset, bool emul_1541_proc) |
| void | SaveRAM (char *filename) |
| void | SaveSnapshot (char *filename) |
| bool | LoadSnapshot (char *filename) |
| int | SaveCPUState (FILE *f) |
| int | Save1541State (FILE *f) |
| bool | Save1541JobState (FILE *f) |
| bool | SaveVICState (FILE *f) |
| bool | SaveSIDState (FILE *f) |
| bool | SaveCIAState (FILE *f) |
| bool | LoadCPUState (FILE *f) |
| bool | Load1541State (FILE *f) |
| bool | Load1541JobState (FILE *f) |
| bool | LoadVICState (FILE *f) |
| bool | LoadSIDState (FILE *f) |
| bool | LoadCIAState (FILE *f) |
| void | thread_func () |
Public Attributes | |
| uint8 * | RAM |
| uint8 * | Basic |
| uint8 * | Kernal |
| uint8 * | Char |
| uint8 * | Color |
| uint8 * | RAM1541 |
| uint8 * | ROM1541 |
| C64Display * | TheDisplay |
| MOS6510 * | TheCPU |
| MOS6569 * | TheVIC |
| MOS6581 * | TheSID |
| MOS6526_1 * | TheCIA1 |
| MOS6526_2 * | TheCIA2 |
| IEC * | TheIEC |
| REU * | TheREU |
| MOS6502_1541 * | TheCPU1541 |
| Job1541 * | TheJob1541 |
| TBool | iIsAudioPending |
| TBool | iSoundHaveBeenPaused |
| bool | have_a_break |
| Emulation thread shall pause. | |
| Frodo * | iFrodoPtr |
| int | joyfd [2] |
| double | speed_index |
| timeval | tv_start |
| CJoyPadObserver * | iJoyPadObserver |
| Prefs & | ThePrefs |
| Prefs & | ThePrefsOnDisk |
Private Member Functions | |
| void | c64_ctor1 (void) |
| void | c64_ctor2 (void) |
| void | c64_dtor (void) |
| void | open_close_joysticks (bool oldjoy1, bool oldjoy2, bool newjoy1, bool newjoy2) |
| uint8 | poll_joystick (int port) |
Private Attributes | |
| bool | thread_running |
| bool | quit_thyself |
| int | joy_minx |
| int | joy_maxx |
| int | joy_miny |
| int | joy_maxy |
| uint8 | joykey |
| uint8 | orig_kernal_1d84 |
| uint8 | orig_kernal_1d85 |
Definition at line 88 of file C64.h.
|
|
Constructor: Allocate objects and memory Definition at line 63 of file C64.cpp. References __CHECK_NULL, Basic, c64_ctor1(), c64_ctor2(), Char, Color, CTOR, have_a_break, iIsAudioPending, iJoyPadObserver, joykey, Kernal, Prefs::LimitSpeed, Prefs::Load(), MakePath(), memset, open_close_joysticks(), quit_thyself, RAM, RAM1541, rand, ROM1541, MOS6510::TheCIA1, TheCIA1, MOS6502_1541::TheCIA2, MOS6510::TheCIA2, TheCIA2, TheCPU, TheCPU1541, TheDisplay, MOS6510::TheIEC, TheIEC, TheJob1541, ThePrefs, ThePrefs, ThePrefsOnDisk, MOS6510::TheREU, TheREU, MOS6510::TheSID, TheSID, MOS6510::TheVIC, TheVIC, thread_running, and uint8. |
|
|
Destructor: Delete all objects
Definition at line 171 of file C64.cpp. References Basic, c64_dtor(), Char, Color, DTOR, ELOG1, ELOG2, iJoyPadObserver, Prefs::Joystick1On, Prefs::Joystick2On, Kernal, MakePath(), open_close_joysticks(), RAM, RAM1541, ROM1541, Prefs::Save(), TheCIA1, TheCIA2, TheCPU, TheCPU1541, TheDisplay, TheIEC, TheJob1541, ThePrefs, ThePrefsOnDisk, TheREU, TheSID, and TheVIC. |
|
|
Constructor, system-dependent things Definition at line 119 of file C64_Acorn.i. References MaximumVolume, and Sound_Volume(). Referenced by C64(). |
|
|
Definition at line 134 of file C64_Acorn.i. References DEFAULT_SYSCONF, and ReadKeyboardStatus(). Referenced by C64(). |
|
|
Definition at line 143 of file C64_Acorn.i. Referenced by ~C64(). |
|
|
Load 1541 GCR state from snapshot Definition at line 571 of file C64.cpp. References fread, Job1541::SetState(), and TheJob1541. Referenced by LoadSnapshot(). |
|
|
Load 1541 state from snapshot Definition at line 454 of file C64.cpp. References fread, RAM1541, MOS6502_1541::SetState(), and TheCPU1541. Referenced by LoadSnapshot(). |
|
|
Load CIA states from snapshot Definition at line 541 of file C64.cpp. References fread, MOS6526::SetState(), TheCIA1, and TheCIA2. Referenced by LoadSnapshot(). |
|
|
Definition at line 413 of file C64.cpp. References Color, fread, RAM, MOS6510::SetState(), and TheCPU. Referenced by LoadSnapshot(). |
|
|
Load SID state from snapshot Definition at line 510 of file C64.cpp. References fread, MOS6581::SetState(), and TheSID. Referenced by LoadSnapshot(). |
|
|
Load snapshot (emulation must be paused and in VBlank) Definition at line 674 of file C64.cpp. References Prefs::DrivePath, Prefs::Emul1541Proc, fclose, fgetc, FILE, fopen, fread, fseek, ftell, Load1541JobState(), Load1541State(), LoadCIAState(), LoadCPUState(), LoadSIDState(), LoadVICState(), NewPrefs(), Reset(), ShowRequester(), SNAPSHOT_1541, SNAPSHOT_HEADER, TheCIA1, TheCIA2, TheCPU, ThePrefs, TheVIC, and uint8. |
|
|
Load VIC state from snapshot Definition at line 483 of file C64.cpp. References fread, MOS6569::SetState(), and TheVIC. Referenced by LoadSnapshot(). |
|
|
The preferences have changed. prefs is a pointer to the new preferences, ThePrefs still holds the previous ones. The emulation must be in the paused state! Definition at line 262 of file C64.cpp. References MOS6502_1541::AsyncReset(), ELOG1, Prefs::Emul1541Proc, Prefs::FastReset, Prefs::Joystick1On, Prefs::Joystick2On, MOS6581::NewPrefs(), REU::NewPrefs(), Job1541::NewPrefs(), IEC::NewPrefs(), C64Display::NewPrefs(), open_close_joysticks(), PatchKernal(), TheCPU1541, TheDisplay, TheIEC, TheJob1541, ThePrefs, TheREU, and TheSID. Referenced by LoadSnapshot(), and CPrefsDialog::OkToExitL(). |
|
|
NMI C64 Definition at line 253 of file C64.cpp. References MOS6510::AsyncNMI(), and TheCPU. |
|
||||||||||||||||||||
|
Definition at line 149 of file C64_Acorn.i. References Joystick_Read(). Referenced by C64(), NewPrefs(), and ~C64(). |
|
||||||||||||
|
Patch kernal IEC routines Definition at line 304 of file C64.cpp. References Kernal, orig_kernal_1d84, orig_kernal_1d85, and ROM1541. Referenced by NewPrefs(), and Run(). |
|
|
Return ETrue if the emulator is paused Definition at line 316 of file c64_epoc32.i. References have_a_break. Referenced by CPrefsDialog::OkToExitL(), and CE32FrodoAppUi::SetPauseState(). |
|
|
Definition at line 158 of file C64_Acorn.i. References JoyButton1, JoyButton2, JoyDir_Thresh, Joystick_Read(), and uint8. Referenced by VBlank(). |
|
|
Stop emulation Definition at line 319 of file C64_Acorn.i. References quit_thyself, and thread_running. Referenced by CE32FrodoAppUi::HandleCommandL(). |
|
|
Definition at line 232 of file C64.cpp. References MOS6502_1541::AsyncReset(), MOS6510::AsyncReset(), ELOG1, IEC::Reset(), MOS6526_2::Reset(), MOS6526_1::Reset(), MOS6581::Reset(), C64Display::ResetKeyboardState(), TheCIA1, TheCIA2, TheCPU, TheCPU1541, TheDisplay, TheIEC, and TheSID. Referenced by CE32FrodoAppUi::HandleCommandL(), MOS6510::illegal_jump(), MOS6502_1541::illegal_jump(), MOS6510::illegal_op(), MOS6502_1541::illegal_op(), and LoadSnapshot(). |
|
|
Start emulation
Definition at line 299 of file C64_Acorn.i. References Prefs::Emul1541Proc, Prefs::FastReset, have_a_break, Kernal, orig_kernal_1d84, orig_kernal_1d85, PatchKernal(), quit_thyself, MOS6502_1541::Reset(), MOS6526_2::Reset(), MOS6526_1::Reset(), MOS6581::Reset(), MOS6510::Reset(), TheCIA1, TheCIA2, TheCPU, TheCPU1541, ThePrefs, TheSID, thread_func(), and thread_running. Referenced by Frodo::ReadyToRun(). |
|
|
Save 1541 GCR state to snapshot Definition at line 560 of file C64.cpp. References fwrite, Job1541::GetState(), and TheJob1541. Referenced by SaveSnapshot(). |
|
|
Definition at line 432 of file C64.cpp. References fwrite, MOS6502_1541::GetState(), MOS6502State::idle, MOS6502State::instruction_complete, RAM1541, and TheCPU1541. Referenced by SaveSnapshot(). |
|
|
Save CIA states to snapshot Definition at line 525 of file C64.cpp. References fwrite, MOS6526::GetState(), TheCIA1, and TheCIA2. Referenced by SaveSnapshot(). |
|
|
Save CPU state to snapshot 0: Error 1: OK -1: Instruction not completed Definition at line 390 of file C64.cpp. References Color, fwrite, MOS6510::GetState(), MOS6510State::instruction_complete, RAM, and TheCPU. Referenced by SaveSnapshot(). |
|
|
Save RAM contents Definition at line 370 of file C64.cpp. References Color, Prefs::Emul1541Proc, fclose, FILE, fopen, fwrite, RAM, RAM1541, ShowRequester(), and ThePrefs. |
|
|
Save SID state to snapshot Definition at line 498 of file C64.cpp. References fwrite, MOS6581::GetState(), and TheSID. Referenced by SaveSnapshot(). |
|
|
Save snapshot (emulation must be paused and in VBlank) To be able to use SC snapshots with SL, SC snapshots are made thus that no partially dealt with instructions are saved. Instead all devices are advanced cycle by cycle until the current instruction has been finished. The number of cycles this takes is saved in the snapshot and will be reconstructed if the snapshot is loaded into FrodoSC again. Definition at line 601 of file C64.cpp. References ADVANCE_CYCLES, Prefs::DrivePath, Prefs::Emul1541Proc, fclose, FILE, fopen, fprintf, fputc, fwrite, Save1541JobState(), Save1541State(), SaveCIAState(), SaveCPUState(), SaveSIDState(), SaveVICState(), ShowRequester(), SNAPSHOT_1541, SNAPSHOT_HEADER, stat, ThePrefs, and uint8. Referenced by VBlank(). |
|
|
Save VIC state to snapshot Definition at line 472 of file C64.cpp. References fwrite, MOS6569::GetState(), and TheVIC. Referenced by SaveSnapshot(). |
|
|
Definition at line 340 of file C64_Acorn.i. References Prefs::CIACycles, MOS6502_1541::CountVIATimers(), Prefs::Emul1541Proc, MOS6502_1541::EmulateLine(), MOS6510::EmulateLine(), MOS6526::EmulateLine(), MOS6569::EmulateLine(), MOS6581::EmulateLine(), Prefs::FloppyCycles, have_a_break, MOS6502_1541::Idle, OS_FlushBuffer(), OS_ReadMonotonicTime(), quit_thyself, ReadKeyboardStatus(), SetMousePointer(), TheCIA1, TheCIA2, TheCPU, TheCPU1541, TheDisplay, ThePrefs, TheSID, and TheVIC. Referenced by Run(), and RunThreadFunc(). |
|
|
The emulation's main loop Definition at line 303 of file c64_epoc32.i. References have_a_break, iFrodoPtr, iSoundHaveBeenPaused, and Frodo::StartC64(). Referenced by CPrefsDialog::OkToExitL(), and CE32FrodoAppUi::SetPauseState(). |
|
|
Vertical blank: Poll keyboard and joysticks, update window
Definition at line 196 of file C64_Acorn.i. References Icon_Pane_Speed, joykey, MOS6526_1::Joystick1, Prefs::Joystick1On, MOS6526_1::Joystick2, Prefs::Joystick2On, MOS6526_1::KeyMatrix, Prefs::LimitSpeed, OS_FlushBuffer(), OS_ReadMonotonicTime(), poll_joystick(), C64Display::PollKeyboard(), ReadKeyboardStatus(), MOS6526_1::RevMatrix, SaveSnapshot(), SetMousePointer(), sprintf, TheCIA1, TheDisplay, ThePrefs, uint8, and C64Display::Update(). Referenced by MOS6569::vblank(). |
|
|
Definition at line 118 of file C64.h. Referenced by C64(), Frodo::load_rom_files(), and ~C64(). |
|
|
Definition at line 118 of file C64.h. Referenced by C64(), Frodo::load_rom_files(), and ~C64(). |
|
|
Definition at line 118 of file C64.h. Referenced by C64(), LoadCPUState(), SaveCPUState(), SaveRAM(), and ~C64(). |
|
|
Emulation thread shall pause.
Definition at line 138 of file C64.h. Referenced by C64(), Paused(), Run(), RunThreadFunc(), thread_func(), and TogglePause(). |
|
|
Definition at line 194 of file C64.h. Referenced by DigitalRenderer::reset_sync(), C64Display::ResetKeyboardState(), and TogglePause(). |
|
|
Definition at line 136 of file C64.h. Referenced by C64(), and RunThreadFunc(). |
|
|
|
|
|
Definition at line 137 of file C64.h. Referenced by TogglePause(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 118 of file C64.h. Referenced by C64(), Frodo::load_rom_files(), PatchKernal(), Run(), and ~C64(). |
|
|
Definition at line 157 of file C64.h. Referenced by PatchKernal(), and Run(). |
|
|
Definition at line 157 of file C64.h. Referenced by PatchKernal(), and Run(). |
|
|
Definition at line 152 of file C64.h. Referenced by C64(), Quit(), Run(), and thread_func(). |
|
|
Definition at line 118 of file C64.h. Referenced by C64(), LoadCPUState(), SaveCPUState(), SaveRAM(), and ~C64(). |
|
|
Definition at line 120 of file C64.h. Referenced by C64(), Load1541State(), Save1541State(), SaveRAM(), and ~C64(). |
|
|
Definition at line 120 of file C64.h. Referenced by C64(), Frodo::load_rom_files(), PatchKernal(), and ~C64(). |
|
|
|
|
|
Definition at line 127 of file C64.h. Referenced by C64(), LoadCIAState(), LoadSnapshot(), Reset(), Run(), SAM(), SaveCIAState(), thread_func(), VBlank(), and ~C64(). |
|
|
Definition at line 128 of file C64.h. Referenced by C64(), LoadCIAState(), LoadSnapshot(), Reset(), Run(), SAM(), SaveCIAState(), thread_func(), and ~C64(). |
|
|
Definition at line 124 of file C64.h. Referenced by C64(), LoadCPUState(), LoadSnapshot(), NMI(), Reset(), Run(), SAM(), SaveCPUState(), thread_func(), and ~C64(). |
|
|
Definition at line 132 of file C64.h. Referenced by C64(), Load1541State(), NewPrefs(), Reset(), Run(), SAM(), Save1541State(), thread_func(), and ~C64(). |
|
|
Definition at line 122 of file C64.h. Referenced by C64(), NewPrefs(), Reset(), thread_func(), VBlank(), and ~C64(). |
|
|
Definition at line 129 of file C64.h. Referenced by C64(), NewPrefs(), Reset(), and ~C64(). |
|
|
Definition at line 133 of file C64.h. Referenced by C64(), Load1541JobState(), NewPrefs(), Save1541JobState(), and ~C64(). |
|
|
Definition at line 217 of file C64.h. Referenced by C64Display::BuildColorTable(), C64(), CE32FrodoAppUi::ConstructL(), CE32FrodoAppUi::HandleCommandL(), LoadSnapshot(), NewPrefs(), Run(), SaveRAM(), SaveSnapshot(), CE32FrodoAppUi::SetFullScreenModeL(), thread_func(), VBlank(), and ~C64(). |
|
|
|
|
|
Definition at line 130 of file C64.h. Referenced by C64(), NewPrefs(), and ~C64(). |
|
|
Definition at line 126 of file C64.h. Referenced by C64(), LoadSIDState(), NewPrefs(), Reset(), Run(), SAM(), SaveSIDState(), thread_func(), and ~C64(). |
|
|
Definition at line 125 of file C64.h. Referenced by C64Display::BuildColorTable(), C64(), LoadSnapshot(), LoadVICState(), SAM(), SaveVICState(), thread_func(), and ~C64(). |
|
|
|
|
|
|
1.3.3