summaryrefslogtreecommitdiff
path: root/z80.h
diff options
context:
space:
mode:
Diffstat (limited to 'z80.h')
-rw-r--r--z80.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/z80.h b/z80.h
index b6dd902..0b7424b 100644
--- a/z80.h
+++ b/z80.h
@@ -56,14 +56,10 @@ typedef signed char Z80Relative;
typedef unsigned short Z80Word;
-/* Memory
+/* Interfaces used to handle memory
*/
-typedef Z80Byte Z80Memory[0x10000];
-
-
-/* Memory control - a TRUE indicates that the 256-byte page is writeable.
-*/
-typedef int Z80MemoryControl[256];
+typedef Z80Byte (*Z80ReadMemory)(Z80 *cpu, Z80Word address);
+typedef void (*Z80WriteMemory)(Z80 *cpu, Z80Word address, Z80Byte value);
/* Interfaces needed to handle ports (IN/OUT commands)
@@ -161,10 +157,11 @@ typedef struct
/* Initialises the processor.
*/
-Z80 *Z80Init(Z80Memory memory,
- Z80MemoryControl memcontrol,
+Z80 *Z80Init(Z80ReadMemory read_memory,
+ Z80WriteMemory write_memory,
+ Z80ReadPort read_port,
Z80WritePort write_port,
- Z80ReadPort read_port);
+ Z80ReadMemory read_for_disassem);
/* Resets the processor.
@@ -238,7 +235,8 @@ void Z80SetState(Z80 *cpu, const Z80State *state);
void Z80SetLabels(Z80Label labels[]);
-/* Simple disassembly. addr is updated on exit.
+/* Simple disassembly of memory accessed through read_for_disassem.
+ addr is updated on exit.
*/
const char *Z80Disassemble(Z80 *cpu, Z80Word *addr);