1 // dgen debugger
2 // (C) 2012, Edd Barrett <vext01@gmail.com>
3 
4 #ifndef DEBUG_H_
5 #define DEBUG_H_
6 
7 #include <stdint.h>
8 
9 /** Maximum number of beakpoints supported. */
10 #define MAX_BREAKPOINTS			64
11 /** Maximum number of watchpoints supported. */
12 #define MAX_WATCHPOINTS			64
13 /** Maximum number of tokens on the debugger command line. */
14 #define MAX_DEBUG_TOKS			8
15 /** Default number of instructions to disassemble. */
16 #define DEBUG_DFLT_DASM_LEN		16
17 /** Default number of bytes to display while dumping memory. */
18 #define DEBUG_DFLT_MEMDUMP_LEN		128
19 
20 #define DBG_CONTEXT_M68K		0
21 #define DBG_CONTEXT_Z80			1
22 #define DBG_CONTEXT_YM2612		2
23 #define DBG_CONTEXT_SN76489		3
24 
25 /** Breakpoint structure. */
26 struct dgen_bp {
27 	uint32_t	addr; /**< Address to break on. */
28 #define BP_FLAG_USED		(1<<0) /**< Breakpoint enabled. */
29 #define BP_FLAG_FIRED		(1<<1) /**< Set when breakpoint fires. */
30 	uint32_t	flags; /**< Flags for breakpoint, see BP_FLAG*. */
31 };
32 
33 /** Watchpoint structure. */
34 struct dgen_wp {
35 	uint32_t	 start_addr; /**< Address to start watching from. */
36 	uint32_t	 end_addr;   /**< Address to stop watching to. */
37 #define WP_FLAG_USED		(1<<0) /**< Watchpoint enabled. */
38 #define WP_FLAG_FIRED		(1<<1) /**< Set when watchpoint fires. */
39 	uint32_t	 flags;     /**< Flags for watchpoint, see WP_FLAG*. */
40 	unsigned char	*bytes;
41 };
42 
43 extern "C" void		debug_show_ym2612_regs(void); // fm.c
44 
45 #endif
46