+#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_request_bus(void);
-void z80_release_bus(void);
void z80_memset(uint32_t addr, uint8_t data, uint32_t length);
-void z80_reset(level_t level);
-void z80_reset_pulse(void);
-int z80_stat_reset(void);
-int z80_runstate(void);
-//void z80_busreq(level_t level);
void z80_write_block(const FLASH uint8_t *src, uint32_t dest, uint32_t length);
-int z80_stat_halt(void);
typedef enum fifo_t {fifo_in, fifo_out, NUM_FIFOS} fifo_t;