-
Notifications
You must be signed in to change notification settings - Fork 2
/
hwdebug.src
56 lines (48 loc) · 838 Bytes
/
hwdebug.src
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
; support macros for debbuging using an external display
; (c) 2005 Matthias Reichl
HWDISP = $D5F0
.MACRO DBGTXT ; write 8 ascii bytes to display
.IF .DEF HWDEBUG
LDX #0
BEQ DBGTXT1
DBGTXTT .BYTE %$1
DBGTXT1 LDA DBGTXTT,X
STA HWDISP,X
INX
CPX #8
BNE DBGTXT1
.ENDIF
.ENDM
.MACRO DBGT4 ; pos, text - write 4 ascii bytes to display
.IF .DEF HWDEBUG
LDX #%1
LDY #0
BEQ DBGTXT1
DBGTXTT .BYTE %$2
DBGTXT1 LDA DBGTXTT,Y
STA HWDISP,X
INX
INY
CPY #4
BNE DBGTXT1
.ENDIF
.ENDM
.MACRO DBGADR ; offset, adr - write 2 byte hex address
.IF .DEF HWDEBUG
LDX #%1
LDA %2+1
JSR SDBGHEX
LDA %2
JSR SDBGHEX
.ENDIF
.ENDM
.MACRO DBGA ; write A (in hex) to position X,X+1
.IF .DEF HWDEBUG
JSR SDBGHEX
.ENDIF
.ENDM
.MACRO DBGASC ; write A to specified position
.IF .DEF HWDEBUG
STA HWDISP+%1
.ENDIF
.ENDM