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
|
Function3e32:: ; 3e32
; Mobile
cp $2
ld [$c988], a
ld a, l
ld [$c986], a
ld a, h
ld [$c987], a
jr nz, .asm_3e4f
ld [$c982], a
ld a, l
ld [$c981], a
ld hl, $c983
ld a, c
ld [hli], a
ld a, b
ld [hl], a
.asm_3e4f
ld hl, $c822
set 6, [hl]
ld a, [hROMBank]
push af
ld a, BANK(Function110030)
ld [$c981], a
rst Bankswitch
jp Function110030
; 3e60
Function3e60:: ; 3e60
ld [$c986], a
ld a, l
ld [$c987], a
ld a, h
ld [$c988], a
pop bc
ld a, b
ld [$c981], a
rst Bankswitch
ld hl, $c822
res 6, [hl]
ld hl, $c987
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [$c986]
ret
; 3e80
Function3e80:: ; 3e80
ld a, [hROMBank]
push af
ld a, BANK(Function1116c5)
ld [$c981], a
rst Bankswitch
call Function1116c5
pop bc
ld a, b
ld [$c981], a
rst Bankswitch
ret
; 3e93
Timer:: ; 3e93
push af
push bc
push de
push hl
ld a, [hMobile]
and a
jr z, .pop_ret
xor a
ld [rTAC], a
; Turn off timer interrupt
ld a, [rIF]
and 1 << VBLANK | 1 << LCD_STAT | 1 << SERIAL | 1 << JOYPAD
ld [rIF], a
ld a, [$c86a]
or a
jr z, .pop_ret
ld a, [$c822]
bit 1, a
jr nz, .skip_Function1118de
ld a, [rSC]
and 1 << rSC_ON
jr nz, .skip_Function1118de
ld a, [hROMBank]
push af
ld a, BANK(Function1118de)
ld [$c981], a
rst Bankswitch
call Function1118de
pop bc
ld a, b
ld [$c981], a
rst Bankswitch
.skip_Function1118de
ld a, [rTMA]
ld [rTIMA], a
ld a, 1 << rTAC_ON | rTAC_65536_HZ
ld [rTAC], a
.pop_ret
pop hl
pop de
pop bc
pop af
reti
; 3ed7
Function3ed7:: ; 3ed7
ld [$dc02], a
ld a, [hROMBank]
push af
ld a, BANK(Function114243)
rst Bankswitch
call Function114243
pop bc
ld a, b
rst Bankswitch
ld a, [$dc02]
ret
; 3eea
|