just a bit of RE, no real insights

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3512 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-06-20 12:44:17 +00:00
parent 0a648b59e4
commit a68abea970
1 changed files with 771 additions and 715 deletions

View File

@ -459,16 +459,19 @@ void 00da_CopyBuffer(_src($AR0), _dest($AR3), _LenInDWORDs(_AC1.M))
}
void 00fa_XorBuffer( .., _LenInDWORDs(_AC1.M)) {
00e1 191e lrri $AC0.M, @$AR0
00e2 191a lrri $AX0.H, @$AR0
00e3 007f 00e8 bloop $AC1.M, 0x00e8
for (int i = 0; i < AC1.M; i++) {
00e5 32b2 xorr'sl $AC0.M, $AX1.H : $AC0.M, $AX1.H
00e6 65a0 movr'ls $ACC1, $AX0.H : $AX0.H, $AC0.M
00e7 33ba xorr'slm $AC1.M, $AX1.H : $AC0.M, $AX1.H
00e8 64a1 movr'ls $ACC0, $AX0.H : $AX0.H, $AC1.M
}
00e9 0000 nop
00ea 02df ret
}
//
@ -484,13 +487,14 @@ void 00eb_Unk_BufferMultWithDest(_Src=($AR0), _Dest($AR3), _size($AC1.M), _facto
00f0 9051 mul'l $AX0.L, $AX0.H : $AX0.H, @$AR1
00f1 925b mulmvz'l $AX0.L, $AX0.H, $ACC0 : $AX1.H, @$AR3
00f2 007f 00f7 bloop $AC1.M, 0x00f7
for (int i = 0; i < AC1.M; i++) {
00f4 4651 addr'l $ACC0, $AX1.H : $AX0.H, @$AR1
00f5 92b2 mulmvz'sl $AX0.L, $AX0.H, $ACC0 : $AC0.M, $AX1.H
00f6 4651 addr'l $ACC0, $AX1.H : $AX0.H, @$AR1
00f7 92b2 mulmvz'sl $AX0.L, $AX0.H, $ACC0 : $AC0.M, $AX1.H
}
00f8 8b00 m0
//00f9 02df ret
00f9 02df ret
return
}
@ -504,6 +508,10 @@ void 00eb_Unk_BufferMultWithDest(_Src=($AR0), _Dest($AR3), _size($AC1.M), _facto
0100 8b00 m0
0101 02df ret
// Clears the 0d00 and 0d60 buffers, plus a lot of other intermediate buffers.
// Also does some other things.
void 0102_PrepareFrameBuffers()
{
// 0102 8100 clr $ACC0
@ -569,7 +577,7 @@ void 00eb_Unk_BufferMultWithDest(_Src=($AR0), _Dest($AR3), _size($AC1.M), _facto
}
void 0127_Unk() {
0127 00c0 03a0 lr $AR0, @0x03a0
0129 191a lrri $AX0.H, @$AR0
012a 00df 03a1 lr $AC1.M, @0x03a1
@ -581,21 +589,24 @@ void 00eb_Unk_BufferMultWithDest(_Src=($AR0), _Dest($AR3), _size($AC1.M), _facto
0133 0080 0050 lri $AR0, #0x0050
0135 0508 addis $ACC1, #0x08
0136 02bf 0525 call 0x0525 // 0525_CopyRAMtoDMEM
// 0525_CopyRAMtoDMEM(... ,.. , 0x50)
0138 00de 0390 lr $AC0.M, @0x0390
013a 02a0 0001 andf $AC0.M, #0x0001
013c 029d 0145 jlz 0x0145
013e 0080 0398 lri $AR0, #0x0398
0140 0e08 lris $AC0.M, #0x08
0141 00c1 03a1 lr $AR1, @0x03a1
0143 02bf 0b2e call 0x0b2e
0143 02bf 0b2e call 0x0b2e // 0b2e_Unk_Multiply
0145 0f50 lris $AC1.M, #0x50
0146 00c0 03a1 lr $AR0, @0x03a1
0148 00da 0394 lr $AX0.H, @0x0394
014a 8600 tstaxh $AX0.H
014b 0295 0152 jz 0x0152
if (*0x0394 != 0) {
014d 1c7a mrr $AR3, $AX0.H
014e 00d8 0395 lr $AX0.L, @0x0395
0150 02bf 00eb call 0x00eb
0150 02bf 00eb call 0x00eb // 00eb_Unk_BufferMultWithDest
}
0152 0f50 lris $AC1.M, #0x50
0153 00c0 03a1 lr $AR0, @0x03a1
0155 00da 0396 lr $AX0.H, @0x0396
@ -603,15 +614,16 @@ void 00eb_Unk_BufferMultWithDest(_Src=($AR0), _Dest($AR3), _size($AC1.M), _facto
0158 0295 015f jz 0x015f
015a 1c7a mrr $AR3, $AX0.H
015b 00d8 0397 lr $AX0.L, @0x0397
015d 02bf 00eb call 0x00eb
015d 02bf 00eb call 0x00eb // 00eb_Unk_BufferMultWithDest
015f 00de 0390 lr $AC0.M, @0x0390
0161 02a0 0002 andf $AC0.M, #0x0002
0163 02dd retlz
0164 0080 0398 lri $AR0, #0x0398
0166 0e08 lris $AC0.M, #0x08
0167 00c1 03a1 lr $AR1, @0x03a1
0169 02bf 0b2e call 0x0b2e
0169 02bf 0b2e call 0x0b2e // 0b2e_Unk_Multiply
016b 02df ret
}
void 016c_Unk_SetupMemAt_0c00()
{
@ -808,6 +820,9 @@ void 0239_WaitUntilLastFrameGotSynced()
//
// 0x0520: Some kind of sample buffer
// 0x0d00: Left mix buffer
// 0x0d60: Right mix buffer
void 0243_COMMAND_02() // sync frame
{
// 0243 0080 0388 lri $AR0, #0x0388
@ -837,6 +852,8 @@ void 0239_WaitUntilLastFrameGotSynced()
// 0258 00de 0341 lr $AC0.M, @0x0341
// 025a 007e 0418 bloop $AC0.M, 0x0418
// Frame size is 0xa0 * *0x0341
for (int j=0; j< *0x0341; j++) // 0x0341 = high part of the (command & 0xFF) ... perhaps number of frames to render??
{
// 025c 02bf 0102 call 0x0102
@ -992,7 +1009,7 @@ void 0239_WaitUntilLastFrameGotSynced()
// 02d2 0081 0520 lri $AR1, #0x0520
// 02d4 0099 0000 lri $AX1.L, #0x0000
// 02d6 02bf 0d7f call 0x0d7f
0d7f_Unk(0x0580, 0x0520, 0x0000);
0d7f_Unk_MaybeResample(0x0580, 0x0520, 0x0000);
ContinueWithBlock:
@ -1244,6 +1261,7 @@ void 0239_WaitUntilLastFrameGotSynced()
// 03df 02bf 00eb call 0x00eb
00eb_Unk_BufferMultWithDest(0x09a0, 0x0d00, 0x50, 0x5a82)
// 03e1 0080 09a0 lri $AR0, #0x09a0
// 03e3 0083 0d60 lri $AR3, #0x0d60
// 03e5 0f50 lris $AC1.M, #0x50
@ -1282,7 +1300,7 @@ void 0239_WaitUntilLastFrameGotSynced()
// 040b 0098 00a0 lri $AX0.L, #0x00a0
// 040d 0080 0388 lri $AR0, #0x0388
// 040f 02bf 0233 call 0x0233
0233_Increase_32BitAddress_InMem(0x0388, 0x0a)
0233_Increase_32BitAddress_InMem(0x0388, 0xa0)
// 0411 0080 038a lri $AR0, #0x038a
@ -1725,7 +1743,6 @@ void 0239_WaitUntilLastFrameGotSynced()
*0x034e = (AC0.M++) << 4
// 05dd 1fda mrr $AC0.M, $AX0.H
// 05de 1f40 mrr $AX0.H, $AR0
// 05df 0200 04fc addi $AC0.M, #0x04fc
@ -1745,7 +1762,6 @@ void 0239_WaitUntilLastFrameGotSynced()
AR0 = AX.H // restore AR0
EndOfMailException:
/*
@ -1777,14 +1793,14 @@ EndOfMailException:
05fe 0021 halt
}
// Sync Table
05ff 0617 cmpis $ACC0, #0x17
0600 0618 cmpis $ACC0, #0x18
0601 0658 cmpis $ACC0, #0x58
0602 065b cmpis $ACC0, #0x5b
// Sync Table
05ff 0617 cmpis $ACC0, #0x17
0600 0618 cmpis $ACC0, #0x18
0601 0658 cmpis $ACC0, #0x58
0602 065b cmpis $ACC0, #0x5b
void 0603_Unk(_returnAddr($AR0))
{
void 0603_Unk(_returnAddr($AR0))
{
// 0603 00e0 03f9 sr @0x03f9, $AR0
0x03f9 = _returnAddr
@ -1825,6 +1841,8 @@ EndOfMailException:
0616 0021 halt
0617 0021 halt
void 0618_Unk() {
0618 009a 0002 lri $AX0.H, #0x0002
061a 00fa 03a3 sr @0x03a3, $AX0.H
061c 8100 clr $ACC0
@ -1872,7 +1890,9 @@ EndOfMailException:
0653 1204 sbclr #0x04
0654 1205 sbclr #0x05
0655 029f 80b5 jmp 0x80b5
**** GOTO ROM!!
0657 0021 halt
}
void 0658_SoftReset()
{
@ -2253,7 +2273,6 @@ void 0688_InitCommandBlock()
075d 1f7e mrr $AX1.H, $AC0.M
075e 0c00 lris $AC0.L, #0x00
075f 1404 lsl $ACC0, #4
0760 1f1e mrr $AX0.L, $AC0.M
@ -2353,7 +2372,7 @@ void 0688_InitCommandBlock()
07bb 8100 clr $ACC0
07bc 2681 lrs $AC0.M, @0xff81
07bd b100 tst $ACC0
07be 0295 07e3 jz 0x07e3
07be 0295 07e3 jz 0x07e3 // stop rendering, see below 7e3
@ -2969,8 +2988,8 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
//////////////////////////////////////////// 0x10 DECODER
{
//////////////////////////////////////////// 0x10 DECODER
{
0a14 0092 0004 lri $CR, #0x0004
0a16 2002 lrs $AX0.L, @0x0002
0a17 8100 clr $ACC0
@ -2987,13 +3006,19 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0a23 2201 lrs $AX0.H, @0x0001
0a24 8600 tstaxh $AX0.H
0a25 0294 0a36 jnz 0x0a36
0a27 2204 lrs $AX0.H, @0x0004
0a28 8600 tstaxh $AX0.H
0a29 02b4 0a7f callne 0x0a7f
if (*0x0404) {
0a7f_Unk_JumpInto_0a73()
}
0a2b 8100 clr $ACC0
0a2c 2605 lrs $AC0.M, @0x0005
0a2d b100 tst $ACC0
0a2e 0295 0a43 jz 0x0a43
loop_0a30:
0a30 8100 clr $ACC0
0a31 2e05 srs @0x0005, $AC0.M
0a32 2281 lrs $AX0.H, @0xff81
@ -3010,6 +3035,8 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0a3f 2e34 srs @0x0034, $AC0.M
0a40 2c35 srs @0x0035, $AC0.L
0a41 02bf 0a7f call 0x0a7f
0a43 00ff 0360 sr @0x0360, $AC1.M
0a45 2638 lrs $AC0.M, @0x0038
0a46 2439 lrs $AC0.L, @0x0039
@ -3024,11 +3051,14 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0a52 5c00 sub $ACC0, $AC1.L
0a53 0290 0a5e jns 0x0a5e
0a55 223b lrs $AX0.H, @0x003b
0a56 02bf 0a91 call 0x0a91
0a56 02bf 0a91 call 0x0a91 // Read samples
0a58 5500 subr $ACC1, $AX0.H
0a59 0a01 lris $AX0.H, #0x01
0a5a 00fa 0405 sr @0x0405, $AX0.H
0a5c 029f 0a30 jmp 0x0a30
GOTO loop_0a30;
0a5e 1f5f mrr $AX0.H, $AC1.M
0a5f 02bf 0a91 call 0x0a91
0a61 00fa 0362 sr @0x0362, $AX0.H
@ -3054,11 +3084,13 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0a78 0092 00ff lri $CR, #0x00ff
// 0a7a 029f 02d0 jmp 0x02d0
GOTO MixFrom_0580_to_0520:
}
}
void 0a7c_Unk() {
0a7c 8100 clr $ACC0
0a7d 2e34 srs @0x0034, $AC0.M
0a7e 2e35 srs @0x0035, $AC0.M
void 0a7f_Unk_JumpInto_0a73() {
0a7f 2334 lrs $AX1.H, @0x0034
0a80 2135 lrs $AX1.L, @0x0035
0a81 268a lrs $AC0.M, @0xff8a
@ -3077,22 +3109,22 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0a8e 8100 clr $ACC0
0a8f 2e05 srs @0x0005, $AC0.M
0a90 02df ret
}
// Could this be the thing that pulls samples from the accelerator?
void 0a91_Unk() {
0a91 0080 ffd3 lri $AR0, #0xffd3
0a93 0084 0000 lri $IX0, #0x0000
0a95 007a 0a98 bloop $AX0.H, 0x0a98
0a97 199e lrrn $AC0.M, @$AR0
0a98 1b7e srri @$AR3, $AC0.M
0a99 02df ret
}
//////////////////////////////////////////// 0x20 DECODER
{
//////////////////////////////////////////// 0x20 DECODER
{
0a9a 8900 clr $ACC1
0a9b 0f50 lris $AC1.M, #0x50
0a9c 0083 0520 lri $AR3, #0x0520
@ -3102,8 +3134,8 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
}
//////////////////////////////////////////// 0x21 DECODER
{
//////////////////////////////////////////// 0x21 DECODER
{
0aa2 00d8 0402 lr $AX0.L, @0x0402
0aa4 8100 clr $ACC0
0aa5 8900 clr $ACC1
@ -3120,6 +3152,8 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
}
// This has something to do with the address/length of the sample...
void 0ab3_Unk() {
0ab3 0092 0004 lri $CR, #0x0004
0ab5 8100 clr $ACC0
0ab6 263a lrs $AC0.M, @0x003a
@ -3128,9 +3162,11 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0ab9 0a00 lris $AX0.H, #0x00
0aba 5800 subax $ACC0, $AX0.L
0abb 0292 0ad1 jg 0x0ad1
if (prev val of)ACC0 > AX0.L) {
0abd 8900 clr $ACC1
0abe 00c0 043b lr $AR0, @0x043b
0ac0 02bf 0af6 call 0x0af6
0ac2 8100 clr $ACC0
0ac3 1fd8 mrr $AC0.M, $AX0.L
0ac4 223b lrs $AX0.H, @0x003b
@ -3145,6 +3181,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0acd 2f3b srs @0x003b, $AC1.M
0ace 0092 00ff lri $CR, #0x00ff
0ad0 02df ret
}
0ad1 2e3a srs @0x003a, $AC0.M
0ad2 2c3b srs @0x003b, $AC0.L
0ad3 8100 clr $ACC0
@ -3175,17 +3212,19 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0af1 02bf 0af6 call 0x0af6
0af3 0092 00ff lri $CR, #0x00ff
0af5 02df ret
}
// CR = 0x4
// Does strange stuff with PB[0x34] and the address PB[0x8c,d]
void 0af6_Unk() {
0af6 8100 clr $ACC0
0af7 1fc0 mrr $AC0.M, $AR0
0af8 b100 tst $ACC0
0af9 02d5 retz
if (!*AR0)
return;
0afa 8900 clr $ACC1
0afb 2734 lrs $AC1.M, @0x0034
0afc 0340 0001 andi $AC1.M, #0x0001
@ -3199,6 +3238,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0b05 4c00 add $ACC0, $AC1.L
0b06 5a00 subax $ACC0, $AX1.L
0b07 5a00 subax $ACC0, $AX1.L
0b08 1c20 mrr $AR1, $AR0
0b09 1fe0 mrr $AC1.M, $AR0
0b0a 0502 addis $ACC1, #0x02
@ -3206,6 +3246,8 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0b0c 009f 0b00 lri $AC1.M, #0x0b00
0b0e 0092 00ff lri $CR, #0x00ff
0b10 02bf 0525 call 0x0525 // 0525_CopyRAMtoDMEM
0525_CopyRAMtoDMEM($AR1, 0x0b00, $AR0)
0b12 0092 0004 lri $CR, #0x0004
0b14 2734 lrs $AC1.M, @0x0034
0b15 1f61 mrr $AX1.H, $AR1
@ -3216,12 +3258,15 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0b1b 1ff9 mrr $AC1.M, $AX1.L
0b1c b900 tst $ACC1
0b1d 0274 ifnz
if (ACC1) {
0b1e 0008 iar $AR0
}
0b1f 8900 clr $ACC1
0b20 1fe1 mrr $AC1.M, $AR1
0b21 191e lrri $AC0.M, @$AR0
0b22 0701 cmpis $ACC1, #0x01
0b23 0293 0b2c jle 0x0b2c
if (ACC1 <= 1) {
0b25 191a lrri $AX0.H, @$AR0
0b26 05fe addis $ACC1, #0xfe
0b27 005f loop $AC1.M
@ -3229,25 +3274,14 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0b29 1b7e srri @$AR3, $AC0.M
0b2a 1b7a srri @$AR3, $AX0.H
0b2b 02df ret
} else {
0b2c 1b7e srri @$AR3, $AC0.M
0b2d 02df ret
}
}
void 0b2e_Unk_Multiply() {
0b2e 8a00 m2
0b2f 0083 03e8 lri $AR3, #0x03e8
0b31 191e lrri $AC0.M, @$AR0
@ -3259,6 +3293,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0b37 0080 03e8 lri $AR0, #0x03e8
0b39 0088 0007 lri $WR0, #0x0007
0b3b 1150 0b48 bloopi #0x50, 0x0b48
for (int i = 0; i < 0x50; i++) {
0b3d 1c61 mrr $AR3, $AR1
0b3e 84c3 clrp'ld : $AX0.L, $AX1.L, @$AR3
0b3f f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3
@ -3271,17 +3306,18 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0b46 f200 madd $AX0.L, $AX0.H
0b47 fe00 movpz $ACC0
0b48 1b3e srri @$AR1, $AC0.M
}
0b49 0088 ffff lri $WR0, #0xffff
0b4b 8b00 m0
0b4c 02df ret
}
void 0b4d_Unk() {
0b4d 8a00 m2
0b4e 05fe addis $ACC1, #0xfe
0b4f 0083 03e8 lri $AR3, #0x03e8
@ -3305,18 +3341,11 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0b64 0088 ffff lri $WR0, #0xffff
0b66 8b00 m0
0b67 02df ret
}
void 0b68_Unk() {
0b68 0083 03e8 lri $AR3, #0x03e8
0b6a 191e lrri $AC0.M, @$AR0
0b6b 191a lrri $AX0.H, @$AR0
@ -3345,6 +3374,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0b86 e8e8 maddc'ldm $AC0.M, $AX1.L : $AX0.H, $AX1.L, @$AR0
0b87 b650 mulxmv'l $AX0.H, $AX1.L, $ACC0 : $AX0.H, @$AR0
0b88 1127 0b93 bloopi #0x27, 0x0b93
for (int i = 0; i < 0x27; i++) {
0b8a e3a8 maddx'lsm $AX0.H, $AX1.H : $AX0.H, $AC0.M
0b8b 197e lrri $AC0.M, @$AR3
0b8c e850 maddc'l $AC0.M, $AX1.L : $AX0.H, @$AR0
@ -3355,6 +3385,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0b91 ea50 maddc'l $AC1.M, $AX1.L : $AX0.H, @$AR0
0b92 e8e8 maddc'ldm $AC0.M, $AX1.L : $AX0.H, $AX1.L, @$AR0
0b93 b650 mulxmv'l $AX0.H, $AX1.L, $ACC0 : $AX0.H, @$AR0
}
0b94 e3a8 maddx'lsm $AX0.H, $AX1.H : $AX0.H, $AC0.M
0b95 197e lrri $AC0.M, @$AR3
0b96 e850 maddc'l $AC0.M, $AX1.L : $AX0.H, @$AR0
@ -3370,6 +3401,10 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0ba1 1b5f srri @$AR2, $AC1.M
0ba2 1b5e srri @$AR2, $AC0.M
0ba3 02df ret
}
void 0ba4_Unk() {
0ba4 0083 03e8 lri $AR3, #0x03e8
0ba6 191e lrri $AC0.M, @$AR0
0ba7 191a lrri $AX0.H, @$AR0
@ -3401,6 +3436,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0bc5 ece8 msubc'ldm $AC0.M, $AX1.L : $AX0.H, $AX1.L, @$AR0
0bc6 b200 mulxmvz $AX0.H, $AX1.L, $ACC0
0bc7 1127 0bd8 bloopi #0x27, 0x0bd8
for (int i = 0; i < 0x27; i++) {
0bc9 e250 maddx'l $AX0.H, $AX1.L : $AX0.H, @$AR0
0bca e3a8 maddx'lsm $AX0.H, $AX1.H : $AX0.H, $AC0.M
0bcb 197e lrri $AC0.M, @$AR3
@ -3417,6 +3453,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0bd6 e877 maddc'ln $AC0.M, $AX1.L : $AC0.M, @$AR3
0bd7 ece8 msubc'ldm $AC0.M, $AX1.L : $AX0.H, $AX1.L, @$AR0
0bd8 b200 mulxmvz $AX0.H, $AX1.L, $ACC0
}
0bd9 e250 maddx'l $AX0.H, $AX1.L : $AX0.H, @$AR0
0bda e3a8 maddx'lsm $AX0.H, $AX1.H : $AX0.H, $AC0.M
0bdb 197e lrri $AC0.M, @$AR3
@ -3435,6 +3472,8 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0be9 1b5f srri @$AR2, $AC1.M
0bea 1b5e srri @$AR2, $AC0.M
0beb 02df ret
}
void 0bec_Unk()
{
@ -3606,28 +3645,44 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
}
void 0ca9_Unk() {
0ca9 b900 tst $ACC1
0caa 0294 0caf jnz 0x0caf
if (!ACC0) {
0cac 6800 movax $ACC0, $AX0.L
0cad b100 tst $ACC0
0cae 02d5 retz
ACC0 = AX0.L
if (!ACC0)
return
}
0caf 1c23 mrr $AR1, $AR3
0cb0 197e lrri $AC0.M, @$AR3
0cb1 191b lrri $AX1.H, @$AR0
0cb2 d858 mulc'l $AC1.M, $AX1.H : $AX1.H, @$AR0
0cb3 1120 0cb9 bloopi #0x20, 0x0cb9
for (int i = 0; i < 0x20; i++) {
0cb5 dcd3 mulcac'ld $AC1.M, $AX1.H, $ACC0 : $AX0.L, $AX1.H, @$AR3
0cb6 6231 movr's $ACC0, $AX1.L : @$AR1, $AC0.M
0cb7 dcd3 mulcac'ld $AC1.M, $AX1.H, $ACC0 : $AX0.L, $AX1.H, @$AR3
0cb8 6231 movr's $ACC0, $AX1.L : @$AR1, $AC0.M
0cb9 4900 addax $ACC1, $AX0.L
}
0cba 1108 0cbf bloopi #0x08, 0x0cbf
for (int i = 0; i < 0x8; i++) {
0cbc dcd3 mulcac'ld $AC1.M, $AX1.H, $ACC0 : $AX0.L, $AX1.H, @$AR3
0cbd 6231 movr's $ACC0, $AX1.L : @$AR1, $AC0.M
0cbe dcd3 mulcac'ld $AC1.M, $AX1.H, $ACC0 : $AX0.L, $AX1.H, @$AR3
0cbf 6231 movr's $ACC0, $AX1.L : @$AR1, $AC0.M
}
// NOTE - The above two loops are very similar and the sum of their lengths is
// 0x28 - which is half of 0x50.
0cc0 02df ret
}
void 0cc1_UnkFilter(_pBuffer(AR3))
{
@ -3656,6 +3711,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0cd3 00da 0485 lr $AX0.H, @0x0485
0cd5 8600 tstaxh $AX0.H
0cd6 0295 0ce5 jz 0x0ce5
if (*0x0485 != 0) {
0cd8 8100 clr $ACC0
0cd9 00de 042a lr $AC0.M, @0x042a
0cdb 147f lsr $ACC0, #-1
@ -3664,6 +3720,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0cdf 0294 0ce5 jnz 0x0ce5
0ce1 009a 0001 lri $AX0.H, #0x0001
0ce3 00fa 0401 sr @0x0401, $AX0.H
}
0ce5 8f00 set40
0ce6 8100 clr $ACC0
0ce7 00de 0428 lr $AC0.M, @0x0428
@ -3676,11 +3733,12 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0cf2 1f3e mrr $AX1.L, $AC0.M
0cf3 0320 007f xori $ACC1, #0x007f
0cf5 1f7f mrr $AX1.H, $AC1.M
0cf6 8100 clr $ACC0
0cf7 8900 clr $ACC1
0cf8 009f 0200 lri $AC1.M, #0x0200
0cfa 1fd8 mrr $AC0.M, $AX0.L
0cfb 4c00 add $ACC0, $AC1.L
0cfa 1fd8 mrr $AC0.M, $AX0.L # AC0.M?
0cfb 4c00 add $ACC0, $AC1.L # broken disasm? this doesn't make much sense.
0cfc 1c1e mrr $AR0, $AC0.M
0cfd 1818 lrr $AX0.L, @$AR0
0cfe 1fda mrr $AC0.M, $AX0.H
@ -3695,6 +3753,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0d07 4c00 add $ACC0, $AC1.L
0d08 1c1e mrr $AR0, $AC0.M
0d09 181b lrr $AX1.H, @$AR0
0d0a 0080 0b00 lri $AR0, #0x0b00
0d0c 9800 mul $AX1.L, $AX1.H
0d0d ae00 mulxmv $AX0.L, $AX1.H, $ACC0
@ -3730,7 +3789,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0d3c 00da 0429 lr $AX0.H, @0x0429
0d3e 02bf 0d62 call 0x0d62
0d40 0081 0b04 lri $AR1, #0x0b04
0d42 0082 0b0c lri $AR2, #0x0b0c
0d42 0082 0b0c lri $AR2, #0x0b0c // Load buffer index from 0b0c
0d44 0083 0d77 lri $AR3, #0x0d77
0d46 1108 0d5f bloopi #0x08, 0x0d5f
0d48 195f lrri $AC1.M, @$AR2
@ -3740,7 +3799,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0d4c 193f lrri $AC1.M, @$AR1
0d4d 00e1 0b24 sr @0x0b24, $AR1
0d4f 00e2 0b25 sr @0x0b25, $AR2
0d51 021b ilrri $AC0.M, @$AR3
0d51 021b ilrri $AC0.M, @$AR3 // Table lookup (see above)
0d52 00e3 0b26 sr @0x0b26, $AR3
0d54 1c7e mrr $AR3, $AC0.M
0d55 00c0 038f lr $AR0, @0x038f
@ -3751,6 +3810,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0d5f 0000 nop
0d60 8e00 set16
0d61 02df ret
0d62 191f lrri $AC1.M, @$AR0
0d63 d078 mulc'l $AC1.M, $AX0.H : $AC1.M, @$AR0
0d64 d678 mulcmv'l $AC1.M, $AX0.H, $ACC0 : $AC1.M, @$AR0
@ -3760,6 +3820,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0d68 6e31 movp's $ACC0 : @$AR1, $AC0.M
0d69 1b3e srri @$AR1, $AC0.M
0d6a 02df ret
0d6b 8d00 set15
0d6c 1f7e mrr $AX1.H, $AC0.M
0d6d 1918 lrri $AX0.L, @$AR0
@ -3774,19 +3835,20 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0d76 02df ret
}
// table for 0cd3_Unk
0d77 0d00 lris $AC1.L, #0x00
0d78 0d60 lris $AC1.L, #0x60
0d79 0f40 lris $AC1.M, #0x40
0d7a 0ca0 lris $AC0.L, #0xa0
0d7b 0e80 lris $AC0.M, #0x80
0d7c 0ee0 lris $AC0.M, #0xe0
0d7d 0c00 lris $AC0.L, #0x00
0d7e 0c50 lris $AC0.L, #0x50
// table for 0cd3_Unk
// This is a bunch of buffer addresses!
short table = {0x0d00, 0x0d60, 0x0f40, 0x0ca0, 0x0e80, 0x0ee0, 0x0c00, 0x0c50};
0d77 0d00 lris $AC1.L, #0x00
0d78 0d60 lris $AC1.L, #0x60
0d79 0f40 lris $AC1.M, #0x40
0d7a 0ca0 lris $AC0.L, #0xa0
0d7b 0e80 lris $AC0.M, #0x80
0d7c 0ee0 lris $AC0.M, #0xe0
0d7d 0c00 lris $AC0.L, #0x00
0d7e 0c50 lris $AC0.L, #0x50
void 0d7f_Unk(_src($AR0), _dest($AR1), _option??)
{
void 0d7f_Unk_MaybeResample(_src($AR0), _dest($AR1), _option??)
{
0d7f 00f9 0361 sr @0x0361, $AX1.L
0d81 1fc0 mrr $AC0.M, $AR0
0d82 0200 fffc addi $AC0.M, #0xfffc
@ -3881,18 +3943,8 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0df0 6533 movr's $ACC1, $AX0.H : @$AR3, $AC0.M
0df1 1b7f srri @$AR3, $AC1.M
0df2 02df ret
}
subroutine:
0df3 1fe0 mrr $AC1.M, $AR0
0df4 1c1f mrr $AR0, $AC1.M
0df5 1128 0dfc bloopi #0x28, 0x0dfc
@ -3903,16 +3955,20 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0dfb 1b3e srri @$AR1, $AC0.M
0dfc 1c1f mrr $AR0, $AC1.M
0dfd 029f 0de2 jmp 0x0de2
}
// Small utility called from SyncFrame.
// sets 50 shorts from 0x520 to zero.
0dff 0083 0520 lri $AR3, #0x0520
0e01 00de 0433 lr $AC0.M, @0x0433
0e03 1050 loopi #0x50
0e04 1b7e srri @$AR3, $AC0.M
// 0e05 029f 02d8 jmp 0x02d8
0e05 029f 02d8 jmp 0x02d8
GOTO ContinueWithBlock: // in SyncFrame
void 0e07_UnUsed() {
0e07 1c20 mrr $AR1, $AR0
0e08 185f lrr $AC1.M, @$AR2
0e09 1f7f mrr $AX1.H, $AC1.M
@ -3925,7 +3981,7 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
0e11 6438 movr's $ACC0, $AX0.H : @$AR0, $AC1.M
0e12 1a5b srr @$AR2, $AX1.H
0e13 02df ret
}
void 0e14_Unk()
{
@ -3956,14 +4012,14 @@ void 0e14_Unk()
}
void 0e3f_Unk()
{
void 0e3f_Unk()
{
0e3f 0080 0f40 lri $AR0, #0x0f40
0e41 0083 0b00 lri $AR3, #0x0b00
0e43 8900 clr $ACC1
0e44 0f50 lris $AC1.M, #0x50
0e45 0098 6784 lri $AX0.L, #0x6784
0e47 02bf 00fa call 0x00fa
0e47 02bf 00fa call 0x00fa // XorBuffer
0e49 0080 04e8 lri $AR0, #0x04e8
0e4b 0082 04ec lri $AR2, #0x04ec
0e4d 0081 0b00 lri $AR1, #0x0b00
@ -3987,7 +4043,7 @@ void 0e14_Unk()
0e69 8900 clr $ACC1
0e6a 0f50 lris $AC1.M, #0x50
0e6b 0098 6784 lri $AX0.L, #0x6784
0e6d 02bf 00fa call 0x00fa
0e6d 02bf 00fa call 0x00fa // XorBuffer
0e6f 0080 04e8 lri $AR0, #0x04e8
0e71 0082 04f4 lri $AR2, #0x04f4
0e73 0081 0b00 lri $AR1, #0x0b00