-
Notifications
You must be signed in to change notification settings - Fork 0
/
etc_7f00.asm
153 lines (142 loc) · 4.09 KB
/
etc_7f00.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
org $7f00
L7f00 jmp L7fb9
.L7f03
; Write EVENTV with $7f6f
lda #$6f
sta $0220
lda #$7f
sta $0221
lda #$0e
ldx #$04
jsr $fff4
; Write IRQ2V (unless already written)
sei
lda $0207
bpl L7f2d ; i.e. if not handled by ROM
; Copy original IRQ2V
sta $7ffe
lda $0206
sta $7ffd
lda #$2f
sta $0206
lda #$7f
sta $0207
L7f2d cli
rts
.IRQ2V
L7f2f php
pha
txa
pha
tya
pha
lda $fe6d
and #$20
beq L7f49
ldx #$00
L7f3e lda $110c,x
sta $fe21
inx
cpx #$10
bne L7f3e
L7f49 lda #$20
sta $fe6e
pla
tay
pla
tax
pla
plp
jmp ($7ffd)
L7f57 lda $fe6b
and #$df
sta $fe6b
lda #$a0
sta $fe6e
lda #$00
sta $fe68
lda #$0f ;<-- this is written from 'game_intro' in main
sta $fe69
rts
L7f6f php
cmp #$04
bne L7faf
pha
txa
pha
tya
pha
; Palette
ldx #$00
L7f7b lda $10fc,x
sta $fe21 ; SHEILA &21
inx
cpx #$10
bne L7f7b
jsr L7f57
dec $23
lda $23
bne L7fa9
lda #$32
sta $23
sed
clc
lda $24
adc #$01
sta $24
cld
cmp #$60
bcc L7fa9
lda #$00
sta $24
sed
adc $25
sta $25
L7fa9 cld
pla
tay
pla
tax
pla
L7faf plp
rts
00 20 80 a0 00 10 40 50
L7fb9 lda #$07
sta $8c
lda #$10
sta $8d
L7fc1 ldy $8c
ldx $90,y
tya
lsr a
ldy $8d
stx $8e
sta $8f
tax
lda $7fb1,x
clc
adc $8e
eor #$07
sta $8e
tya
asl $8f
asl $8f
clc
adc $8f
tay
ldx #$00
L7fe3 clc
lda $8e
adc $7fb5,x
sta $10fc,y
inx
iny
cpx #$04
bne L7fe3
lda $8d
eor #$10
sta $8d
dec $8c
bpl L7fc1
rts
89 de 20