-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakelist.inc
More file actions
56 lines (55 loc) · 987 Bytes
/
makelist.inc
File metadata and controls
56 lines (55 loc) · 987 Bytes
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
;
; initialise the orders list and allow a new order to be appended to the list
;
initlist:
pha
phy
lda #<.actions ; address the action list
sta mkll
lda #>.actions
sta mklh
ldy #0
sty mkly ; store zero in mkly so list addition begins at the start
lda #255 ; store end of list FF in three bytes
sta (mkll),y
iny
sta (mkll),y
iny
sta (mkll),y
ply
pla
rts
storeaction:
pha
phy
phx
ldy mkly ; pick up list index
lda sc ; character to store
sta (mkll),y
iny ; rolled over?
beq storeinc1 ; yes! inc the high addr
storecharx:
lda sx ; x position to set char
sta (mkll),y
iny ; rolled over?
beq storeinc2 ; yes! inc the high addr
storechary:
lda sy
sta (mkll),y
iny ; rolled over?
beq storeinc3 ; yes! inc the high addr
storechardone:
sty mkly ; store away the index for the next addition
plx
ply
pla
rts
storeinc1:
inc mklh
jmp storecharx
storeinc2:
inc mklh
jmp storechary
storeinc3:
inc mklh
jmp storechardone