-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcredits.asm
78 lines (74 loc) · 1.55 KB
/
credits.asm
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
creditsmain
ldx creditsaddr
ldy #$7F0
clr xcnt
creditslp1
lda ,x+
sta ,y+
inc xcnt
lda xcnt
cmpa #16
bne creditslp1
clr xcnt
rts
patchcredits
ldd #$0000
ldx #$7F0
patchcreditslp
std ,x++
cmpx #$800
bne patchcreditslp
rts
copycredits
ldx #$400
ldy #$3F0
clr xcnt
clr ycnt
copycreditslp1
ldd ,x++
std ,y++
inc xcnt
lda xcnt
cmpa #8
bne copycreditslp1
clr xcnt
inc ycnt
;leax 16,x ;it took me 4 hours to realise
;leay 16,y ;why i didn't need to do this
lda ycnt
cmpa #64
bne copycreditslp1
rts
credits
inc vscnt2
lda vscnt2
cmpa #6
bne creditsend
clr vscnt2
lda creditsflag
cmpa #0
beq docredits
jsr creditsinit
clr creditsflag
docredits
jsr creditsmain
ldx creditsaddr
cmpx #creditsgfxend-16
beq skipscreditsreset
jsr copycredits
jsr patchcredits
ldx creditsaddr
leax 16,x
stx creditsaddr
ldx creditsaddr
cmpx #creditsgfxend-16
beq skipscreditsreset
bra creditsend
skipscreditsreset
ldx #creditsgfxend-16
stx creditsaddr
creditsend
rts
creditsgfx
includebin "gfx/creditsgreets.bin"
creditsgfxend