-
Notifications
You must be signed in to change notification settings - Fork 0
/
taki-util.inc
52 lines (43 loc) · 848 Bytes
/
taki-util.inc
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
.ifndef _TAKI_UTIL_INC_
_TAKI_UTIL_INC_ = 1
.include "taki-effect.inc"
; write a byte literal to a memory loc
.macro writeByte dst, src
lda #src
sta dst
.endMacro
; write a word literal to a memory loc
.macro writeWord dst, src
writeByte dst, <src
writeByte {dst+1}, >src
.endMacro
; copy a word from one location to another
.macro copyWord dst, src
lda src
sta dst
lda src+1
sta dst+1
.endMacro
.macro subtractAndSave16_8 wloc, bloc
sec
lda wloc
sbc bloc
sta wloc
lda wloc+1
sbc #$0
sta wloc+1
.endmacro
; needs .macpack apple2 before use
.macro tstr str
scrcode str
.byte 0
.endmacro
.if 0
.macro tstr str
.repeat .strlen (str)-1, i
.byte .strat(str, i)&$7F
.endrepeat
.byte .strat(str, .strlen(str)-1)|$80
.endmacro
.endif
.endif ; _TAKI_UTIL_INC_