summaryrefslogtreecommitdiff
path: root/include/z80-if.h
diff options
context:
space:
mode:
authorLeo C2014-08-21 11:36:14 +0200
committerLeo C2014-08-21 11:36:14 +0200
commit21a24f90c5aaaaf13f91716208b32cde163c5918 (patch)
treeefc6f9ebab5f84d3af20493821444f220b957962 /include/z80-if.h
parentdea9a31523216caa153c589426b175d52aa43634 (diff)
downloadz180-stamp-21a24f90c5aaaaf13f91716208b32cde163c5918.zip
Create include directory
Diffstat (limited to 'include/z80-if.h')
-rw-r--r--include/z80-if.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/z80-if.h b/include/z80-if.h
new file mode 100644
index 0000000..b02fe23
--- /dev/null
+++ b/include/z80-if.h
@@ -0,0 +1,46 @@
+
+#define ZST_ACQUIRED 0x01
+#define ZST_RUNNING 0x02
+
+typedef enum {
+ RESET = 0x00,
+ RESET_AQRD = ZST_ACQUIRED,
+ RUNNING = ZST_RUNNING,
+ RUNNING_AQRD = ZST_RUNNING | ZST_ACQUIRED,
+} zstate_t;
+
+typedef enum {
+ Reset,
+ Request,
+ Release,
+ Run,
+ Restart,
+ M_Cycle
+} bus_cmd_t;
+
+typedef enum {LOW, HIGH} level_t;
+
+zstate_t z80_bus_state(void);
+zstate_t z80_bus_cmd(bus_cmd_t cmd);
+void z80_setup_bus(void);
+int z80_stat_reset(void);
+//void z80_busreq(level_t level);
+int z80_stat_halt(void);
+
+void z80_write(uint32_t addr, uint8_t data);
+uint8_t z80_read(uint32_t addr);
+void z80_memset(uint32_t addr, uint8_t data, uint32_t length);
+void z80_write_block(const FLASH uint8_t *src, uint32_t dest, uint32_t length);
+
+
+typedef enum fifo_t {fifo_in, fifo_out, NUM_FIFOS} fifo_t;
+
+void z80_memfifo_init(const fifo_t f, uint32_t adr);
+int z80_memfifo_is_empty(const fifo_t f);
+int z80_memfifo_is_full(const fifo_t f);
+uint8_t z80_memfifo_getc(const fifo_t f);
+void z80_memfifo_putc(fifo_t f, uint8_t val);
+
+void z80_setup_msg_fifo(void);
+void z80_init_msg_fifo(uint32_t addr);
+int z80_msg_fifo_getc(void);