-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDebugger.Constants.asm
More file actions
93 lines (79 loc) · 4.17 KB
/
Debugger.Constants.asm
File metadata and controls
93 lines (79 loc) · 4.17 KB
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
; ===============================================================
; ---------------------------------------------------------------
; Constants
; ---------------------------------------------------------------
; ----------------------------
; Arguments formatting flags
; ----------------------------
; General arguments format flags
hex equ $80 ; flag to display as hexadecimal number
#ifdef BUNDLE-AXM68K
## For AXM68K compatibility, we replace "dec" with "deci"
deci equ $90 ; flag to display as decimal number
#else
dec equ $90 ; flag to display as decimal number
#endif
bin equ $A0 ; flag to display as binary number
sym equ $B0 ; flag to display as symbol (treat as offset, decode into symbol +displacement, if present)
symdisp equ $C0 ; flag to display as symbol's displacement alone (DO NOT USE, unless complex formatting is required, see notes below)
str equ $D0 ; flag to display as string (treat as offset, insert string from that offset)
; NOTES:
; * By default, the "sym" flag displays both symbol and displacement (e.g.: "Map_Sonic+$2E")
; In case, you need a different formatting for the displacement part (different text color and such),
; use "sym|split", so the displacement won't be displayed until symdisp is met
; * The "symdisp" can only be used after the "sym|split" instance, which decodes offset, otherwise, it'll
; display a garbage offset.
#ifdef BUNDLE-AXM68K
; * No other argument format flags (hex, deci, bin, str) are allowed between "sym|split" and "symdisp",
#else
; * No other argument format flags (hex, dec, bin, str) are allowed between "sym|split" and "symdisp",
#endif
; otherwise, the "symdisp" results are undefined.
; * When using "str" flag, the argument should point to string offset that will be inserted.
; Arguments format flags CAN NOT be used in the string (as no arguments are meant to be here),
; only console control flags (see below).
; Additional flags ...
#ifdef BUNDLE-AXM68K
; ... for number formatters (hex, deci, bin)
#else
; ... for number formatters (hex, dec, bin)
#endif
signed equ 8 ; treat number as signed (display + or - before the number depending on sign)
; ... for symbol formatter (sym)
split equ 8 ; DO NOT write displacement (if present), skip and wait for "symdisp" flag to write it later (optional)
forced equ 4 ; display "<unknown>" if symbol was not found, otherwise, plain offset is displayed by the displacement formatter
; ... for symbol displacement formatter (symdisp)
weak equ 8 ; DO NOT write plain offset if symbol is displayed as "<unknown>"
; Argument type flags:
; - DO NOT USE in formatted strings processed by macros, as these are included automatically
; - ONLY USE when writting down strings manually with DC.B
byte equ 0
word equ 1
long equ 3
; -----------------------
; Console control flags
; -----------------------
; Plain control flags: no arguments following
endl equ $E0 ; "End of line": flag for line break
cr equ $E6 ; "Carriage return": jump to the beginning of the line
pal0 equ $E8 ; use palette line #0
pal1 equ $EA ; use palette line #1
pal2 equ $EC ; use palette line #2
pal3 equ $EE ; use palette line #3
; Parametrized control flags: followed by 1-byte argument
setw equ $F0 ; set line width: number of characters before automatic line break
setoff equ $F4 ; set tile offset: lower byte of base pattern, which points to tile index of ASCII character 00
setpat equ $F8 ; set tile pattern: high byte of base pattern, which determines palette flags and $100-tile section id
setx equ $FA ; set x-position
; -----------------------------
; Error handler control flags
; -----------------------------
; Screen appearence flags
_eh_address_error equ $01 ; use for address and bus errors only (tells error handler to display additional "Address" field)
_eh_show_sr_usp equ $02 ; displays SR and USP registers content on error screen
_eh_hide_caller equ $04 ; don't guess and print caller in the header (in SGDK and C/C++ projects naive caller detection isn't reliable)
; Advanced execution flags
; WARNING! For experts only, DO NOT USE them unless you know what you're doing
_eh_return equ $20
_eh_enter_console equ $40
_eh_align_offset equ $80