Go to the documentation of this file.
7 #ifndef __PZ80emu__z80__
8 #define __PZ80emu__z80__
15 #define INIT_PC 0x0000
18 #define INTERRUPT_PERIOD 10240
29 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
74 #define PARITY_OVERFLOW 2
84 int run(
struct z80 *, uint8_t *,
long,
bool);
struct bus * bus
Definition: z80.h:66
word sp
Definition: z80.h:65
#define INTERRUPT_PERIOD
number of cycles to run before triggering interrupt
Definition: z80.h:18
z80 memory class
Definition: memory.h:19
int run(struct z80 *cpu, uint8_t *memory, long runcycles, bool s_flag)
Definition: z80.c:66
interrupt_mode
enum to contain all possible interrupt modes
Definition: z80.h:44
word pc
Definition: z80.h:53
@ IM0
Definition: z80.h:45
word ix
Definition: z80.h:58
int counter
Definition: z80.h:52
word _bc
Definition: z80.h:62
bool nmi
Definition: bus.h:18
interrupt_mode im
Definition: z80.h:67
__BEGIN_DECLS struct z80 * new_cpu(void)
Definition: z80.c:26
word ir
Definition: z80.h:60
bool busreq
Definition: bus.h:16
z80 CPU data structure and functions
bool iff1
Definition: z80.h:68
bool interrupt
Definition: bus.h:17
void display_mem(uint8_t *memory)
display the current memory contents to STDOUT
Definition: display.c:144
word _af
Definition: z80.h:61
word bc
Definition: z80.h:55
uint8_t l
low order byte
Definition: z80.h:31
uint8_t h
high order byte
Definition: z80.h:32
z80 bus class
Definition: bus.h:15
int run(struct z80 *, uint8_t *, long, bool)
Definition: z80.c:66
@ IM2
Definition: z80.h:47
word af
Definition: z80.h:54
word _hl
Definition: z80.h:64
void display_registers(struct z80 *cpu)
display the current register state to STDOUT
Definition: display.c:177
uint16_t W
16-bit pair
Definition: z80.h:22
void reset_cpu(struct z80 *cpu)
Definition: z80.c:48
word iy
Definition: z80.h:59
word de
Definition: z80.h:56
type to deal with endianness and access of high/low bits
Definition: z80.h:21
struct z80 * new_cpu(void)
Definition: z80.c:26
void reset_cpu(struct z80 *)
Definition: z80.c:48
word hl
Definition: z80.h:57
void _instruction(struct z80 *cpu, uint8_t *memory)
parses an opcode from the main instruction set
Definition: interpreter.c:158
@ IM1
Definition: z80.h:46
bool iff2
Definition: z80.h:69
word _de
Definition: z80.h:63