aboutsummaryrefslogtreecommitdiff
path: root/engines/gargoyle/frotz/mem.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gargoyle/frotz/mem.h')
-rw-r--r--engines/gargoyle/frotz/mem.h46
1 files changed, 26 insertions, 20 deletions
diff --git a/engines/gargoyle/frotz/mem.h b/engines/gargoyle/frotz/mem.h
index e12c062ff8..c128994df1 100644
--- a/engines/gargoyle/frotz/mem.h
+++ b/engines/gargoyle/frotz/mem.h
@@ -24,6 +24,7 @@
#define GARGOYLE_FROTZ_MEM
#include "gargoyle/frotz/frotz_types.h"
+#include "gargoyle/frotz/err.h"
namespace Gargoyle {
namespace Frotz {
@@ -202,46 +203,51 @@ private:
* Handles loading the game header
*/
void loadGameHeader();
-public:
+protected:
/**
- * Constructor
+ * Read a value from the header extension (former mouse table).
*/
- Mem();
+ zword get_header_extension(int entry);
/**
- * Initialize
+ * Set an entry in the header extension (former mouse table).
*/
- void initialize();
+ void set_header_extension(int entry, zword val);
/**
- * Read a word
+ * Set all header fields which hold information about the interpreter.
*/
- zword readWord() {
- pcp += 2;
- return READ_BE_UINT16(pcp - 2);
- }
+ void restart_header();
/**
- * Read a word at a given index relative to pcp
+ * Write a byte value to the dynamic Z-machine memory.
*/
- zword readWord(size_t ofs) {
- return READ_BE_UINT16(pcp + ofs);
- }
+ void storeb(zword addr, zbyte value);
/**
- * Get the PC
+ * Write a word value to the dynamic Z-machine memory.
*/
- uint getPC() const { return pcp - zmp; }
+ void storew(zword addr, zword value);
/**
- * Set the PC
+ * Generates a runtime error
*/
- void setPC(uint ofs) { pcp = zmp + ofs; }
+ virtual void runtimeError(ErrorCode errNum) = 0;
/**
- * Read a value from the header extension (former mouse table).
+ * Called when the flags are changed
*/
- zword get_header_extension(int entry);
+ virtual void flagsChanged(zbyte value) = 0;
+public:
+ /**
+ * Constructor
+ */
+ Mem();
+
+ /**
+ * Initialize
+ */
+ void initialize();
};
} // End of namespace Frotz