Skip to content

Commit

Permalink
Version 2.0
Browse files Browse the repository at this point in the history
New features. Bug fixes.
  • Loading branch information
makarcz committed Mar 14, 2016
1 parent 67f1a62 commit 32f2b2d
Show file tree
Hide file tree
Showing 29 changed files with 19,035 additions and 19,022 deletions.
1,899 changes: 956 additions & 943 deletions VMachine.cpp

Large diffs are not rendered by default.

169 changes: 85 additions & 84 deletions VMachine.h
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
Loading

0 comments on commit 32f2b2d

Please sign in to comment.