-
Notifications
You must be signed in to change notification settings - Fork 10
/
macros.s
51 lines (39 loc) · 1.17 KB
/
macros.s
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
processor 6502
mac varbase
NEXT_VAR set {1}
endm
mac var
{1} = NEXT_VAR
NEXT_VAR set NEXT_VAR + 1
endm
mac varrange
{1} = NEXT_VAR
NEXT_VAR set NEXT_VAR + {2}
endm
mac checkvarbase
if NEXT_VAR > {1}
err
endif
endm
; BIT instruction for skipping the next 1- or 2-byte instruction
mac skip1
dc.b $24
endm
mac skip2
dc.b $2c
endm
mac checkscriptend
if * > scriptCodeEnd
err
endif
endm
; Text jump. Game texts need to be located between $0000-$7fff to use
mac textjump
dc.b >{1} | $80
dc.b <{1}
endm
; Get address of text
mac gettext
lda #<{1}
ldx #>{1}
endm