-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New features. Bug fixes.
- Loading branch information
Showing
29 changed files
with
19,035 additions
and
19,022 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,85 @@ | ||
#ifndef VMACHINE_H | ||
#define VMACHINE_H | ||
|
||
#include <string> | ||
#include <queue> | ||
#include "system.h" | ||
#include "MKCpu.h" | ||
#include "Memory.h" | ||
#include "Display.h" | ||
|
||
//#define WINDOWS 1 | ||
#if defined (WINDOWS) | ||
#include <windows.h> | ||
#endif | ||
|
||
#define IOREFRESH 32 | ||
#define OPINTERRUPT 25 // operator interrupt code (CTRL-Y) | ||
|
||
using namespace std; | ||
|
||
namespace MKBasic { | ||
|
||
class VMachine | ||
{ | ||
public: | ||
VMachine(); | ||
VMachine(string romfname, string ramfname); | ||
~VMachine(); | ||
|
||
void InitVM(); | ||
Regs *Run(); | ||
Regs *Run(unsigned short addr); | ||
Regs *Exec(); | ||
Regs *Exec(unsigned short addr); | ||
Regs *Step(); | ||
Regs *Step(unsigned short addr); | ||
void LoadROM(string romfname); | ||
void LoadRAM(string ramfname); | ||
void LoadRAMBin(string ramfname); | ||
unsigned short MemPeek8bit(unsigned short addr); | ||
void MemPoke8bit(unsigned short addr, unsigned char v); | ||
Regs *GetRegs(); | ||
void SetCharIO(unsigned short addr, bool echo); | ||
void DisableCharIO(); | ||
unsigned short GetCharIOAddr(); | ||
bool GetCharIOActive(); | ||
void ShowIO(); | ||
void ClearScreen(); | ||
void ScrHome(); | ||
bool IsAutoExec(); | ||
void EnableROM(); | ||
void DisableROM(); | ||
void SetROM(unsigned short start, unsigned short end); | ||
void EnableROM(unsigned short start, unsigned short end); | ||
unsigned short GetROMBegin(); | ||
unsigned short GetROMEnd(); | ||
bool IsROMEnabled(); | ||
unsigned short GetRunAddr(); | ||
void SetOpInterrupt(); | ||
queue<string> GetExecHistory(); | ||
unsigned short Disassemble(unsigned short addr, char *buf); | ||
|
||
protected: | ||
|
||
private: | ||
|
||
MKCpu *mpCPU; | ||
Memory *mpROM; | ||
Memory *mpRAM; | ||
Display *mpDisp; | ||
unsigned short mRunAddr; | ||
unsigned short mCharIOAddr; | ||
bool mCharIOActive; | ||
bool mCharIO; | ||
bool mOpInterrupt; // operator interrupt from console | ||
bool mAutoExec; | ||
|
||
void LoadMEM(string memfname, Memory *pmem); | ||
void ShowDisp(); | ||
}; | ||
|
||
} // namespace MKBasic | ||
|
||
#endif | ||
#ifndef VMACHINE_H | ||
#define VMACHINE_H | ||
|
||
#include <string> | ||
#include <queue> | ||
#include "system.h" | ||
#include "MKCpu.h" | ||
#include "Memory.h" | ||
#include "Display.h" | ||
|
||
//#define WINDOWS 1 | ||
#if defined (WINDOWS) | ||
#include <windows.h> | ||
#endif | ||
|
||
#define IOREFRESH 32 | ||
#define OPINTERRUPT 25 // operator interrupt code (CTRL-Y) | ||
|
||
using namespace std; | ||
|
||
namespace MKBasic { | ||
|
||
class VMachine | ||
{ | ||
public: | ||
VMachine(); | ||
VMachine(string romfname, string ramfname); | ||
~VMachine(); | ||
|
||
void InitVM(); | ||
Regs *Run(); | ||
Regs *Run(unsigned short addr); | ||
Regs *Exec(); | ||
Regs *Exec(unsigned short addr); | ||
Regs *Step(); | ||
Regs *Step(unsigned short addr); | ||
void LoadROM(string romfname); | ||
void LoadRAM(string ramfname); | ||
void LoadRAMBin(string ramfname); | ||
unsigned short MemPeek8bit(unsigned short addr); | ||
void MemPoke8bit(unsigned short addr, unsigned char v); | ||
Regs *GetRegs(); | ||
void SetCharIO(unsigned short addr, bool echo); | ||
void DisableCharIO(); | ||
unsigned short GetCharIOAddr(); | ||
bool GetCharIOActive(); | ||
void ShowIO(); | ||
void ClearScreen(); | ||
void ScrHome(); | ||
bool IsAutoExec(); | ||
void EnableROM(); | ||
void DisableROM(); | ||
void SetROM(unsigned short start, unsigned short end); | ||
void EnableROM(unsigned short start, unsigned short end); | ||
unsigned short GetROMBegin(); | ||
unsigned short GetROMEnd(); | ||
bool IsROMEnabled(); | ||
unsigned short GetRunAddr(); | ||
void SetOpInterrupt(bool opint); | ||
bool IsOpInterrupt(); | ||
queue<string> GetExecHistory(); | ||
unsigned short Disassemble(unsigned short addr, char *buf); | ||
|
||
protected: | ||
|
||
private: | ||
|
||
MKCpu *mpCPU; | ||
Memory *mpROM; | ||
Memory *mpRAM; | ||
Display *mpDisp; | ||
unsigned short mRunAddr; | ||
unsigned short mCharIOAddr; | ||
bool mCharIOActive; | ||
bool mCharIO; | ||
bool mOpInterrupt; // operator interrupt from console | ||
bool mAutoExec; | ||
|
||
void LoadMEM(string memfname, Memory *pmem); | ||
void ShowDisp(); | ||
}; | ||
|
||
} // namespace MKBasic | ||
|
||
#endif |
Oops, something went wrong.