-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdebug.h
131 lines (105 loc) · 2.92 KB
/
debug.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#ifndef DEBUG_H
#define DEBUG_H
#define regs_x 1
#define regs_y 1
#define stack_x 72
#define stack_y 12
#define stack_size 10
#define ay_x 31
#define ay_y 28
#define time_x 1
#define time_y 28
#define copy_x 1
#define copy_y 28
#define banks_x 72
#define banks_y 22
#define ports_x 72
#define ports_y 1
#define dos_x 72
#define dos_y 6
#define trace_size 21
#define trace_x 1
#define trace_y 6
#define wat_x 34
#define wat_y 1
#define wat_sz 13
#define mem_size 12
#define mem_x 34
#define mem_y 15
#define W_SEL 0x17
#define W_NORM 0x07
#define W_CURS 0x30
#define BACKGR 0x50
#define FRAME_CURS 0x02
#define W_TITLE 0x59
#define W_OTHER 0x40
#define W_OTHEROFF 0x47
#define BACKGR_CH 0xB1
#define W_AYNUM 0x4F
#define W_AYON 0x41
#define W_AYOFF 0x40
#define W_BANK 0x40
#define W_BANKRO 0x41
#define W_DIHALT1 0x1A
#define W_DIHALT2 0x0A
#define W_TRACEPOS 0x70
#define W_INPUTCUR 0x60
#define W_INPUTBG 0x40
#define W_48K 0x20
#define W_DOS 0x20
#define W_TRACE_JINFO_CURS_FG 0x0D
#define W_TRACE_JINFO_NOCURS_FG 0x02
#define W_TRACE_JARROW_FOREGR 0x0D
#define FRAME 0x01
#define FFRAME_FRAME 0x04
#define FFRAME_INSIDE 0x50
#define FFRAME_ERROR 0x52
#define FRM_HEADER 0xD0
#define MENU_INSIDE 0x70
#define MENU_HEADER 0xF0
#define MENU_CURSOR 0xE0
#define MENU_ITEM MENU_INSIDE
#define MENU_ITEM_DIS 0x7A
enum DBGWND
{
WNDNO, WNDMEM, WNDTRACE, WNDREGS
};
enum { ED_MEM, ED_PHYS, ED_LOG, ED_CMOS, ED_NVRAM, ED_MAX };
class TCpuMgr
{
static const unsigned Count;
static Z80* Cpus[];
static TZ80State PrevCpus[];
static unsigned CurrentCpu;
public:
static Z80 &Cpu() { return *Cpus[CurrentCpu]; }
static Z80 &Cpu(u32 Idx) { return *Cpus[Idx]; }
static TZ80State &PrevCpu(u32 Idx) { return PrevCpus[Idx]; }
static TZ80State &PrevCpu() { return PrevCpus[CurrentCpu]; }
static void SwitchCpu();
static unsigned GetCurrentCpu() { return CurrentCpu; }
static void SetCurrentCpu(u32 Idx) { CurrentCpu = Idx; }
static void CopyToPrev();
static unsigned GetCount() { return Count; }
};
extern TCpuMgr CpuMgr;
extern DBGWND activedbg;
extern unsigned dbg_extport;
extern unsigned char dgb_extval; // extended memory port like 1FFD or DFFD
extern unsigned mem_sz;
extern unsigned mem_disk;
extern unsigned mem_track;
extern unsigned mem_max;
extern unsigned char mem_dump;
extern unsigned show_scrshot;
extern unsigned char editor;
extern unsigned char mem_ascii;
extern unsigned char mem_dump;
extern unsigned ripper; // ripper mode (none/read/write)
extern unsigned user_watches[3];
extern unsigned regs_curs;
extern unsigned char trace_labels;
unsigned char isbrk(const Z80 &cpu); // is there breakpoints active or any other reason to use debug z80 loop?
void debugscr();
void debug_events(Z80 *cpu);
#endif