forked from badman12345/osmose-rpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SmsDebugger.h
79 lines (69 loc) · 2.06 KB
/
SmsDebugger.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
/*****************************************************************************
*
* File: SmsDebugger.h
*
* Project: Osmose emulator.
*
* Description: This class will handle built-in debugger.
*
* Author: Vedder Bruno
* Date: 16/10/2004, 18h00
*
* URL: http://bcz.emu-france.com/
*****************************************************************************/
#ifndef SMS_DEBUGGER_H
#define SMS_DEBUGGER_H
#include "Definitions.h"
#include "MemoryMapper.h"
#include "IOMapper.h"
#include "SmsEnvironment.h"
#include "z80_disasm/Z80Dasm.h"
#include "VDP.h"
#include "DebugEventListener.h"
using namespace std;
#define MAX_BREAKPOINTS 16
class SmsDebugger : public DebugEventListener
{
public:
SmsDebugger();
void setCPU(Z80 *c) {cpu = c;}
void setMemoryMapper(MemoryMapper *mm) {mem = mm;}
void setEnvironment(SmsEnvironment *se){env = se;}
void setVDP(VDP *vd) {v = vd;}
void setIOMapper(IOMapper *im){iom = im;}
void setDasm(Z80Dasm *d){dasm = d;}
void enter();
/* DebugEventListener interface implementation. */
void sendDebugEvent(int event_type, char* src, char *message);
protected:
MemoryMapper *mem;
SmsEnvironment *env;
VDP *v;
IOMapper *iom;
Z80Dasm *dasm;
Z80 *cpu;
private:
int scanlineBreakpoint;
bool any_breakpoint; /* Flag to avoid bp search. */
bool end_session; /* Have we leaved the debugger ? */
bool breakpoint_on_irq;
bool breakpoint_on_enable_interrupt;
bool breakpoint_on_disable_interrupt;
bool cpu_steping;
int breakpoints[MAX_BREAKPOINTS]; /* INTeger chose to allow -1 value */
unsigned int bp_index; /* Index in circular buffer of bp. */
void help();
void dpr();
void dvdpr();
void vdpi();
void dvram();
void dumpRegisters();
void clearBreakpoints();
void addBreakpoint(int add);
void listBreakpoints();
void setScanlineBreakpoint(int scanline);
void exec_cmd(char *cmd, int param1);
void exec_cmd(char *cmd, int param1, int param2);
void unknownCommand();
};
#endif