Subversion Repositories pentevo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1088 alone 1
#pragma once
2
//#ifndef DEBUG_H
3
//#define DEBUG_H
4
 
5
 
6
//-----------------------------------------------------------------------------
7
// Regs                         // WNDREGS
8
#define regs_x 1
9
#define regs_y 1
10
 
11
#define regs_cx 32              // size
12
#define regs_cy 4
13
//-----------------------------------------------------------------------------
14
// Stack                        // WND_STACK
15
#define stack_x 72
16
#define stack_y 12
17
#define stack_size 10
18
 
19
#define stack_cx 7              // size
20
#define stack_cy 10
21
//-----------------------------------------------------------------------------
22
// AY                           // WND_AY
23
#define ay_x  31
24
#define ay_y  28
25
 
26
#define ay_cx  48               // size
27
#define ay_cy  1
28
//-----------------------------------------------------------------------------
29
// Time Delta                   // WND_TIME_DELTA
30
#define time_x 1
31
#define time_y 28
32
 
33
#define time_cx 26              // size
34
#define time_cy 1
35
//-----------------------------------------------------------------------------
36
// deprecated copyrights (был на месте time delta)
37
//#define copy_x 1
38
//#define copy_y 28
39
//-----------------------------------------------------------------------------
40
// Pages                        // WND_PAGES - маленькое окошко с страницами
41
#define banks_x 72
42
#define banks_y 23
43
 
44
#define banks_cx 7              // size
45
#define banks_cy 4
46
//-----------------------------------------------------------------------------
47
// Ports                        // WND_PORTS - маленькое окошко с портами
48
#define ports_x 72              // FE 7FFD cmos EFF7
49
#define ports_y 1
50
 
51
#define ports_cx 7              // Size
52
#define ports_cy 4
53
//-----------------------------------------------------------------------------
54
// Beta 128                     // WND_BETA128 - маленькое окошко
55
#define dos_x 72
56
#define dos_y 6
57
 
58
#define dos_cx 7                // size
59
#define dos_cy 5
60
//-----------------------------------------------------------------------------
61
// Trace window                 // WNDTRACE
62
#define trace_size 21           
63
#define trace_x 1
64
#define trace_y 6
65
 
66
#define trace_cx 32             // size
67
#define trace_cy 21
68
//-----------------------------------------------------------------------------
69
// Watches                      // WND_WATCHES - большое окно с превиевом памяти
70
#define wat_x 34                // по адресам в регистрах
71
#define wat_y 1
72
#define wat_sz 13
73
 
74
#define wat_cx 37               // size
75
#define wat_cy 13
76
//-----------------------------------------------------------------------------
77
// Memory window                // WNDMEM
78
#define mem_size 12
79
#define mem_x 34
80
#define mem_y 15
81
 
82
#define mem_cx 37               // size
83
#define mem_cy 12
84
//-----------------------------------------------------------------------------
85
 
86
 
87
 
88
 
89
 
90
//NS
91
//#define DBG_REGS              0x38    //0011 1000 bright white?
92
//#define DBG_REGS_HGLGHT       0x17    //0001 0111
93
 
94
#define W_SEL      0x17
95
#define W_NORM     0x07
96
#define W_CURS     0x30         //      00110000
97
#define BACKGR     0x50
98
#define FRAME_CURS 0x02
99
#define W_TITLE    0x59
100
#define W_OTHER    0x40
101
#define W_OTHEROFF 0x47
102
#define BACKGR_CH  0xB1
103
#define W_AYNUM    0x4F
104
#define W_AYON     0x41
105
#define W_AYOFF    0x40
106
#define W_BANK     0x40
107
#define W_BANKRO   0x41
108
#define W_DIHALT1  0x1A
109
#define W_DIHALT2  0x0A
110
#define W_TRACEPOS 0x70
111
#define W_INPUTCUR 0x60
112
#define W_INPUTBG  0x40
113
#define W_48K 0x20
114
#define W_DOS 0x20
115
 
116
#define W_TRACE_JINFO_CURS_FG   0x0D
117
#define W_TRACE_JINFO_NOCURS_FG 0x02
118
#define W_TRACE_JARROW_FOREGR   0x0D
119
 
120
#define FRAME         0x01
121
#define FFRAME_FRAME  0x04
122
 
123
#define FFRAME_INSIDE 0x50
124
#define FFRAME_ERROR  0x52
125
#define FRM_HEADER    0xD0
126
 
127
#define MENU_INSIDE   0x70
128
#define MENU_HEADER   0xF0
129
 
130
#define MENU_CURSOR   0xE0
131
#define MENU_ITEM     MENU_INSIDE
132
#define MENU_ITEM_DIS 0x7A
133
 
134
 
135
 
136
//=============================================================================
137
// Типы текущего "активного" окна дебагера
138
enum DBGWND
139
{
140
    WNDNO,
141
    WNDMEM,
142
    WNDTRACE,
143
    WNDREGS,
144
    WND_PORTS,          // [NS]
145
    WND_BETA128,        // [NS]
146
    WND_STACK,          // [NS]
147
    WND_PAGES,          // [NS]
148
    WND_WATCHES,        // [NS]
149
    WND_AY,             // [NS]
150
    WND_TIME_DELTA      // [NS]
151
};
152
//=============================================================================
153
enum
154
{
155
    ED_MEM,
156
    ED_PHYS,
157
    ED_LOG,
158
    ED_CMOS,
159
    ED_NVRAM,
160
    ED_COMP_PAL,
161
    ED_MAX
162
};
163
//=============================================================================
164
 
165
 
166
 
167
//=============================================================================
168
class TCpuMgr
169
{
170
    static const unsigned Count;
171
    static Z80* Cpus[];
172
    static TZ80State PrevCpus[];
173
    static unsigned CurrentCpu;
174
public:
175
    //-------------------------------------------------------------------------
176
    static Z80 &Cpu()
177
    {
178
        return *Cpus[ CurrentCpu];
179
    }
180
    //-------------------------------------------------------------------------
181
    static Z80 &Cpu( u32 Idx)
182
    {
183
        return *Cpus[ Idx];
184
    }
185
    //-------------------------------------------------------------------------
186
    static TZ80State &PrevCpu( u32 Idx)
187
    {
188
        return PrevCpus[ Idx];
189
    }
190
    //-------------------------------------------------------------------------
191
    static TZ80State &PrevCpu()
192
    {
193
        return PrevCpus[ CurrentCpu];
194
    }
195
    //-------------------------------------------------------------------------
196
    static void SwitchCpu();
197
    //-------------------------------------------------------------------------
198
    static unsigned GetCurrentCpu()
199
    {
200
        return CurrentCpu;
201
    }
202
    //-------------------------------------------------------------------------
203
    static void SetCurrentCpu( u32 Idx)
204
    {
205
        CurrentCpu = Idx;
206
    }
207
    //-------------------------------------------------------------------------
208
    static void CopyToPrev();
209
    //-------------------------------------------------------------------------
210
    static unsigned GetCount()
211
    {
212
        return Count;
213
    }
214
    //-------------------------------------------------------------------------
215
};
216
//=============================================================================
217
 
218
extern TCpuMgr CpuMgr;
219
extern DBGWND activedbg;
220
extern unsigned dbg_extport;
221
extern unsigned char dbg_extval; // extended memory port like 1FFD or DFFD
222
 
223
extern unsigned mem_sz;
224
extern unsigned mem_disk;
225
extern unsigned mem_track;
226
extern unsigned mem_max;
227
 
228
extern unsigned char mem_dump;
229
extern unsigned show_scrshot;
230
extern unsigned char editor;
231
extern unsigned char mem_ascii;
232
 
233
extern unsigned char mem_dump;
234
 
235
extern unsigned ripper; // ripper mode (none/read/write)
236
 
237
extern int dbg_force_exit;      // для костыльного выхода из дебагера     [NS]
238
                                // без дополнительного аникея
239
 
240
extern unsigned user_watches[ 3];
241
extern unsigned regs_curs;
242
 
243
extern unsigned char trace_labels;
244
//-----------------------------------------------------------------------------
245
// is there breakpoints active or any other reason to use debug z80 loop?
246
unsigned char isbrk( const Z80 &cpu);
247
//-----------------------------------------------------------------------------
248
void debugscr();
249
//-----------------------------------------------------------------------------
250
void debug_events( Z80 *cpu);
251
//-----------------------------------------------------------------------------
252
//#endif