-
Notifications
You must be signed in to change notification settings - Fork 8
/
cpu6.h
54 lines (51 loc) · 1.52 KB
/
cpu6.h
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
50
51
52
53
54
#include <inttypes.h>
#define AH 0
#define AL 1
#define BH 2
#define BL 3
#define XH 4
#define XL 5
#define YH 6
#define YL 7
#define ZH 8
#define ZL 9
#define SH 10
#define SL 11
#define CH 12
#define CL 13
#define PH 14
#define PL 15
#define A 0
#define B 2
#define X 4
#define Y 6
#define Z 8
#define S 10 /* Just a convention it seems */
#define C 12 /* Flags ? */
#define P 14 /* PC */
extern uint8_t mem_read8(uint32_t addr);
extern uint8_t mem_read8_debug(uint32_t addr);
extern uint16_t mem_read16_debug(uint32_t addr);
extern void mem_write8_debug(uint32_t addr, uint8_t val);
extern void mem_write16_debug(uint32_t addr, uint16_t val);
extern uint8_t mmu_mem_read8(uint16_t addr);
extern uint8_t mmu_mem_read8_debug(uint16_t addr);
extern void mem_write8(uint32_t addr, uint8_t val);
extern void halt_system(void);
extern uint16_t cpu6_pc(void);
extern void set_pc_debug(uint16_t new_pc);
extern void reg_write_debug(uint8_t r, uint8_t v);
extern void regpair_write_debug(uint8_t r, uint16_t v);
extern unsigned cpu6_execute_one(unsigned trace);
extern int dma_read_cycle(uint8_t data);
extern uint8_t dma_write_cycle(void);
extern int dma_write_active(void);
extern void cpu6_set_switches(unsigned switches);
extern unsigned cpu6_halted(void);
extern void cpu6_init(void);
extern void cpu_assert_irq(unsigned ipl);
extern void cpu_deassert_irq(unsigned ipl);
extern void advance_time(uint64_t nanoseconds);
extern uint16_t cpu6_dma_count(void);
extern void cpu6_dma_write(uint8_t);
extern uint8_t cpu6_dma_read(void);