-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathloader-original.asm
166 lines (166 loc) · 2.1 KB
/
loader-original.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
154
155
156
157
158
159
160
161
162
163
164
165
166
org #fe40
ld sp, 26000 ; #6590
ld hl, 16384 ; #4000
ld d, h
ld e, 1
ld (hl), l
ld bc, 6911 ; #1aff
ldir
call Lfee5
jp 16530 ; #4092
Lfe55:
ld a, 0
scf
inc d
ex af, af'
dec d
di
ld a, 15
out (#00fe), a
ld hl, 65332 ; #ff34
push hl
in a, (#00fe)
rra
and 32
or 2
ld c, a
cp a
Lfe6d:
ret nz
Lfe6e:
call Lff16
jr nc, Lfe6d
ld hl, 1045 ; #0415
Lfe76:
djnz Lfe76
dec hl
ld a, h
or l
jr nz, Lfe76
call Lff12
jr nc, Lfe6d
Lfe82:
ld b, 156
call Lff12
jr nc, Lfe6d
ld a, 198
cp b
jr nc, Lfe6e
inc h
jr nz, Lfe82
Lfe91:
ld b, 201
call Lff16
jr nc, Lfe6d
ld a, b
cp 212
jr nc, Lfe91
call Lff16
ret nc
ld a, c
xor 3
ld c, a
ld h, 0
ld b, 123
jr Lfeca
Lfeab:
ex af, af'
jr nz, Lfeb5
jr nc, Lfebf
ld (ix + 0), l
jr Lfec4
Lfeb5:
rl c
xor l
ret nz
ld a, c
rra
ld c, a
inc de
jr Lfec6
Lfebf:
ld a, (ix + 0)
xor l
ret nz
Lfec4:
inc ix
Lfec6:
dec de
ex af, af'
ld b, 125
Lfeca:
ld l, 1
Lfecc:
call Lff12
ret nc
ld a, 142
cp b
rl l
ld b, 123
jp nc, Lfecc
ld a, h
xor l
ld h, a
ld a, d
or e
jr nz, Lfeab
ld a, h
cp 1
ret
Lfee5:
ld ix, 16384 ; #4000
ld de, 6912 ; #1b00
call Lfe55
ld ix, 27136 ; #6a00
ld de, 35328 ; #8a00
push ix
call Lfe55
ld hl, 16384 ; #4000
ld d, h
ld e, 1
ld (hl), l
ld bc, 6911 ; #1aff
ldir
ld ix, 16384 ; #4000
ld de, 6912 ; #1b00
call Lfe55
ret
Lff12:
call Lff16
ret nc
Lff16:
ld a, 22
Lff18:
dec a
jr nz, Lff18
and a
Lff1c:
inc b
ret z
ld a, 127
in a, (#00fe)
rra
xor c
and 32
jr z, Lff1c
ld a, c
xor 255
ld c, a
and 6
or 8
out (#00fe), a
scf
ret
jr c, Lff3e
xor a
Lff37:
out (#00fe), a
inc a
and 7
jr Lff37
Lff3e:
xor a
out (#00fe), a
ret
nop
nop