2017-02-19 23:55:54 +00:00
|
|
|
#ifndef __VM_H
|
|
|
|
#define __VM_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2018-01-10 09:13:04 +00:00
|
|
|
#include <stdlib.h> // for NULL
|
2017-02-19 23:55:54 +00:00
|
|
|
|
|
|
|
#include "mmu.h"
|
|
|
|
#include "vmdisplay.h"
|
|
|
|
#include "vmkeyboard.h"
|
|
|
|
|
2017-02-26 16:00:41 +00:00
|
|
|
#define DISPLAYWIDTH 320
|
|
|
|
#define DISPLAYHEIGHT 240
|
|
|
|
|
2017-02-19 23:55:54 +00:00
|
|
|
class VM {
|
|
|
|
public:
|
2018-01-10 09:13:04 +00:00
|
|
|
VM() { mmu=NULL; vmdisplay = NULL; hasIRQ = false;}
|
|
|
|
virtual ~VM() { if (mmu) delete mmu; if (vmdisplay) delete vmdisplay; }
|
2017-02-19 23:55:54 +00:00
|
|
|
|
2021-01-10 02:32:40 +00:00
|
|
|
virtual bool Suspend(const char *fn) = 0;
|
|
|
|
virtual bool Resume(const char *fn) = 0;
|
2017-12-30 20:20:34 +00:00
|
|
|
|
2017-02-19 23:55:54 +00:00
|
|
|
virtual void SetMMU(MMU *mmu) { this->mmu = mmu; }
|
|
|
|
virtual MMU *getMMU() { return mmu; }
|
|
|
|
virtual VMKeyboard *getKeyboard() = 0;
|
|
|
|
|
|
|
|
virtual void Reset() = 0;
|
|
|
|
|
|
|
|
virtual void triggerPaddleInCycles(uint8_t paddleNum, uint16_t cycleCount) = 0;
|
|
|
|
|
|
|
|
VMDisplay *vmdisplay;
|
|
|
|
MMU *mmu;
|
|
|
|
bool hasIRQ;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|