/* * (C) Copyright 2014 Leo C. * * SPDX-License-Identifier: GPL-2.0 */ #include "common.h" #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_P(const FLASH uint8_t *src, uint32_t dest, uint32_t length); void z80_write_block(const uint8_t *src, uint32_t dest, uint32_t length); void z80_read_block (uint8_t *dest, uint32_t src, size_t length); typedef enum fifo_t { fifo_msgin, fifo_msgout, fifo_conin, fifo_conout, 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); int z80_memfifo_getc(const fifo_t f); uint8_t z80_memfifo_getc_wait(const fifo_t f); void z80_memfifo_putc(fifo_t f, uint8_t val);