1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#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);
uint32_t z80_clock_get(void);
int z80_clock_set(unsigned long freq);
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);
|