forked from p4plus2/DKC2-disassembly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
464 lines (391 loc) · 5.95 KB
/
notes.txt
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
24 gamemode pointer or nmi part 2?
known pointers for $24:
$8086F6
$8087D9
$8087C5
$8087E1
$808819
$80B3D7
$80FAC0
$80FA7C
20 = main NMI pointer
known pointers for $20:
$808608 ;reset stack then set NMI pointer to F3E6
$808CC9
$808CD9
$808CE9
$808CED
$808CF1
$808CF5
$808D02
$808D0E
$808D1F
$808D30
$808D3D
$808D4E
$808D5F
$808D7D
$8093B8
$8099C3
$80A2CF
$80A86C
$80B461
$80B681
$80F3E6 ; Set brightness, and thats all.
known pointers $067A:
$B49E48
known pointers $067D:
$B48DFA
$B48E6C
$B49126
$B4BEEF
$BA90D9
$BAB1B9
$BAB31E
$BAB633
$BAB6F6
known pointers $067F:
$B49043
$B49122
$B49188
$B491C5
$B4C139
$B4C14E
$BAB8F9
$BAB8FD
Known pointers for $17B2:
$B5BC00 (ROM pointer list)
$B5C3F4
$B5C60B
known pointers for $AA:
$B5CA58 (ROM pointer list)
known pointers for $50,x:
$B6D9DD
$B6DA16
$B6D9B0
$B6DA5F
$B6DA93
$B6E80D
$B6E3EA
$B6E46E
known pointers for $34:
$B5E3D1
$B5E3D2
$B5E3D3
$B5E3D4
$B5E3D5
$B5E3D6
known pointers for $36:
$B5F3AD (ROM pointer list for JMP)
Known pointers for $05A9:
$B38052
$B380D5
known pointers for $32 (JMP)
$8085EB
known pointers for 0A8A (stored in $32 for JML):
$B3992E
$B398D7
$B3992E
$B3E1E2
$B3E2F4
$B3EF84
$B3F069
known pointers for $09F9:
$BCFCB5
$BCFCA5
known pointer for $0005
$B4B82A
$B4B7CA
$B4B82B
(look into CODE_808C2E)
CODE_BB8089 ;<-- CGRAM DMA routine
CODE_80A873 ;<-- some animation code
CODE_8084E7 ;<-- primary register init
CODE_BEB82A ;<-- Some sort of execptr routine
CODE_B3A369 ;<-- Some sort of execptr routine
CODE_B6D923 ;<-- Change to bank BA
DATA_EE1086 ;More long pointers
DATA_EE117B ;Even more
DATA_BCB600 ;Collision detection pointers
CODE_BA9E84 ;Relative to bank B6
CODE_B49E48 ;DMA new message to the screen
CODE_BAC7C0 ;Set OAM offscreen
CODE_808591 ;Clear VRAM DMA
CODE_80895F ;DMA routine (usually seems to DMA from $7F0000
CODE_808CAC ;OAM DMA routine
CODE_B5A919 ;Sprite graphics DMA routine!
CODE_BB940C ;load level music number
CODE_80ABA0 ;SRAM copy
DATA_FE0000 ;sprite level data
CODE_B38007 ;main sprite handler
CODE_B9D0B8 ;Handle the "AI" of the kongs along with those nasty tables in F9 and early B9
CODE_B5BCA8 ;Map loading stuff
CODE_808B6F ;Weird code
CODE_BBB70C ;Looks like sprite level load code
DATA_FD819A ;has pointers in some interlaced format (possibly RLE tilemap decoding)
$38 -- Mirror of 211C, DMA size, and some index
$32 layer 2 X position mirror ?
$059B OAM DMA enable
$0699 Address of message
$08C8 Also level number
$08A8 Also parent level number
$066E Parent level number
$098F layer three X position?
$0991 layer three Y position?
$17B8 Layer 2 X position
$17C0 something with layers probably layer 1 X position
$17C2 layer 1 Y position mirror
$0a31 active player speed
$0a33 active player speed
DATA_B5A194 ;Maybe graphics replaced
CODE_B9D143: STA $26
list of pointers in dp:
$26
$32
$34
$36
$38
$39
$3A
$3E
$40
$42
$44
$46
$5E
$54
$7A
$8E
$90
$98
$9C
$C8
$CE
$D9
$0E (one instance)
list of JML pointers in RAM
$0032 (Mostly done, possibly a few missing)
$05A9 (Done?)
$09F9 (Done)
list of JMP pointers in RAM
$0020 (Done?)
$0024 (Done?)
$0032 (Done?)
$0034 (Done?)
$0036 (Done?)
$0052 (INDEXED, Done?)
$00AA (done?)
$067A (done?)
$067D (done?)
$067F (done?)
$17B2 (Done?)
list of JSR pointers in RAM
$0515
$0024
$0044
$0046
$0650
$0006
$0000
$000E (Done?)
CODE_B6A5B0
known DMA trigger locations:
$BB8087
$BB8CDC
$BB8D49
$BB8D63
$BB8E52
$BB9843
$BB9AB3
$BB9B01
$BB9B3C
$BB9C3F
$BB9C53
$BB9C67
$BB9C7B
$BB9C8F
$BB9CA3
$BB9DBC
$BB9DD0
$BB9DE4
$BB9DF8
$BB9E2C
$BB9F9C
$BB9FB0
$BB9FC4
$BB9FD8
$BB9FEC
$BBA018
$BBA065
$BBA231
$BBA2B3
$BBA2CB
$BBA31E
$BBA332
$BBA348
$BBA532
$BBA546
$BBA55A
$BBA56E
$BBA582
$BBA6A8
$BBA6BC
$BBA86A
$BBA87E
$BBA894
$BBA8A8
$BBA8BC
$BBA999
$BBA9AD
$BBA9C1
$BBAB57
$BBAB6B
$BBAB81
$BBAB95
$BBABA9
$BBABBD
$BBABD1
$B5A939
$B5AABB
$B5AC50
$B5AC7A
$B5AE16
$B5AE7C
$B5B039
$B5B063
$B5B0B0
$B5B0DA
$B5D35C
$B5D3B1
$B5D921
$B5D935
$B5D949
$B5D95D
$B5E0E3
$808594
$808963
$808CAC
$80936A
$80937E
$809392
$8093BC
$809896
$809B3C
$809B5F
$809B7A
$80A029
$80A03D
$80A051
$80A065
$80A079
$80A08D
$80A0A1
$80A710
$80A891
$80A8CB
$80B10C
$80B8A3
$80B8A9
$80B8B1
$80B8B7
$80BD5A
$80BD86
$80C037
$80C111
$80C337
$80C368
$80C600
$80C914
$80C91A
$80C927
$80C92D
$80C9F3
$80CBE4
$80CC4B
$80CD3A
$80CDE5
$80CE13
$80CE41
$80CE73
$80CF34
$80CF7B
$80CFB8
$80CFEE
$80D061
$80D094
$80F341
$B481B3
$B48233
$B48442
$B48473
$B484E3
$B48CB9
$B48D52
$B48ED4
$B49224
$B493C9
$B498B1
$B499AD
$B499C8
$B49B79
$B49E65
$B49E9E
$B49EF1
$B4A22D
$B4A4FC
$B4A7F9
$B4A920
$B4AB12
$B4ABFC
$B4BDB1
$B4BDC7
$B4BF5B
$BAB285
$BAB31E
$BAB71E
$BAB74C
$BAB791
Various compressed data:
$C2FAC9
$C6FC11
$D9F7C9
$E98B07
$EB2B84
$EC4749
$EC4AAD
$EC4C1C
$EC4D40
$EC7CF0
$EC83A0
$ED02A1
$ED0997
$ED5E3F
$F50004
$F52FC7
$F5325B
$F55D4A
$F56AC9
$F661C1
$F67D1B
$F8063E
$F80D10
$F99400
$F9C775
$FA4C3E
;these are not exactly right, they are in the wrong order....
command 0x80(CODE_BB84C0): SEC and return ;success
command 0x81(CODE_BB84C7): evil? ;evil
command 0x82(CODE_BB84D8): Goto next command ;skip
command 0x83(CODE_BB84DA): load sub config ;subconfig
command 0x84(CODE_BB84EE): Set palette? ;palette
command 0x85(CODE_BB850C): Set X/Y/priority? ;directedpriority
command 0x86(CODE_BB8521): reads +2 (?) ;too tired
command 0x87(CODE_BB8582): reads +2, relative x flip? ;maybe
command 0x88(CODE_BB85A2): relative x/y ;relative
command 0x89(CODE_BB86D5): allocate vram? ;vram
command 0x8A(CODE_BB85BC): read +$1A, bulk copy ;bulk
command 0x8B(CODE_BB860E): x/y stuff ;ehh
command 0x8C(CODE_BB8646): jump to cmd 0x84 ;removed probably
command 0x8D(CODE_BB8678): more palette voodoo ;voodoo
command 0x8E(CODE_BB879E): vram alloc 2? ;vram2
$05FD = index to control buffer