mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
zelda disasm: minor commenting/formatting
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3518 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
aecaf271f1
commit
eef35f9537
@ -1,7 +1,7 @@
|
||||
/* ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
All code is now wrapped in void Function() {} - the upcoming new DSP LLE debugger
|
||||
All code is now wrapped in void Function() {} - the new DSP LLE debugger
|
||||
can parse this file and auto read symbols using those.
|
||||
|
||||
BIG Questions:
|
||||
@ -10,6 +10,9 @@ BIG Questions:
|
||||
- What does 00eb_Unk_BufferMultWithDest??
|
||||
- Why is a PB-Transfer from RAM to DMEM 0xC0 shorts long but DMEM to RAM just 0x80
|
||||
|
||||
DSP functionality to test:
|
||||
- CR
|
||||
- Interrupts (7)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
|
||||
//
|
||||
@ -1465,7 +1468,9 @@ void 041d_Unk() {
|
||||
0472 193c lrri $AC0.L, @$AR1
|
||||
0473 009f 0400 lri $AC1.M, #0x0400
|
||||
0475 00c0 0345 lr $AR0, @0x0345
|
||||
0477 02bf 0555 call 0x0555
|
||||
// 0477 02bf 0555 call 0x0555 // ReadFromMysteryReg
|
||||
0555_UnknownReadFromMysteryReg(ARAMAddress(ACC0), DestBuffer(AC1.M), Length(AC0.M)) {
|
||||
|
||||
0479 0081 0348 lri $AR1, #0x0348
|
||||
047b 193e lrri $AC0.M, @$AR1
|
||||
047c 193c lrri $AC0.L, @$AR1
|
||||
@ -1532,7 +1537,9 @@ void 04c0_UnknownInit()
|
||||
|
||||
|
||||
void 04d0_Unk() {
|
||||
04d0 02bf 04e1 call 0x04e1
|
||||
// 04d0 02bf 04e1 call 0x04e1
|
||||
04e1_Read0x40WordsFromZeroTo0b00()
|
||||
|
||||
// 04fb is incremented when you reset a voice
|
||||
04d2 00df 04fb lr $AC1.M, @0x04fb
|
||||
04d4 009e 0b00 lri $AC0.M, #0x0b00
|
||||
@ -1550,16 +1557,15 @@ void 04d0_Unk() {
|
||||
04e0 02df ret
|
||||
}
|
||||
|
||||
void 04e1_Strange() {
|
||||
void 04e1_Read0x40WordsFromZeroTo0b00() {
|
||||
04e1 0092 00ff lri $CR, #0x00ff
|
||||
04e3 8100 clr $ACC0
|
||||
04e4 009f 0b00 lri $AC1.M, #0x0b00
|
||||
04e6 0080 0040 lri $AR0, #0x0040
|
||||
04e8 029f 0555 jmp 0x0555
|
||||
GOTO 0555_UnknownReadFromMysteryReg
|
||||
// 04e8 029f 0555 jmp 0x0555
|
||||
GOTO 0555_UnknownReadFromMysteryReg(ARAMAddress(ACC0), DestBuffer(AC1.M), Length(AR0)) {
|
||||
}
|
||||
|
||||
|
||||
void 04ea_Call0573With0b00And0050() {
|
||||
04ea 8100 clr $ACC0
|
||||
04eb 009f 0b00 lri $AC1.M, #0x0b00
|
||||
@ -1570,9 +1576,9 @@ void 04ea_Call0573With0b00And0050() {
|
||||
}
|
||||
|
||||
|
||||
void 04f1_strange() {
|
||||
04f1 02bf 04e1 call 0x04e1
|
||||
04e1_Strange();
|
||||
void 04f1_Read0x40WordsFromZeroTo0b00() {
|
||||
// 04f1 02bf 04e1 call 0x04e1
|
||||
04e1_Read0x40WordsFromZeroTo0b00();
|
||||
}
|
||||
|
||||
void 04f3_strange() {
|
||||
@ -1679,7 +1685,7 @@ void 0536_WaitForDMATransfer()
|
||||
}
|
||||
|
||||
// Can't find any calls to this one.
|
||||
void 053c_Unk() {
|
||||
void 053c_Unk_Unused() {
|
||||
053c 193e lrri $AC0.M, @$AR1
|
||||
053d 193c lrri $AC0.L, @$AR1
|
||||
053e 00ff ffcd sr @DSPA, $AC1.M
|
||||
@ -1706,9 +1712,9 @@ void 0553_UnknownReadFromMysteryReg_Unused() {
|
||||
// continues...
|
||||
|
||||
void 0555_UnknownReadFromMysteryReg(ARAMAddress(ACC0), DestBuffer(AC1.M), Length(AC0.M)) {
|
||||
// 0555 0240 7fff andi $AC0.M, #0x7fff // Don't know the purpose of this and
|
||||
// 0555 0240 7fff andi $AC0.M, #0x7fff
|
||||
// 0557 02bf 0561 call 0x0561
|
||||
0561_SetupAcceleratorForMysteryRead(ACC0, AR0, AC1.M);
|
||||
0561_SetupAcceleratorForMysteryAccess(ACC0 & 0x7FFFFFFF, AR0, AC1.M);
|
||||
// After that, length is now in AX0.H
|
||||
|
||||
// 0559 007a 055f bloop $AX0.H, 0x055f
|
||||
@ -1723,7 +1729,7 @@ void 0555_UnknownReadFromMysteryReg(ARAMAddress(ACC0), DestBuffer(AC1.M), Length
|
||||
// 0560 02df ret
|
||||
}
|
||||
|
||||
void 0561_SetupAcceleratorForMysteryRead(ARAMAddress(ACC0), DestBuffer(AC1.M), Length(AR0)) {
|
||||
void 0561_SetupAcceleratorForMysteryAccess(ARAMAddress(ACC0), DestBuffer(AC1.M), Length(AR0)) {
|
||||
0561 1c3f mrr $AR1, $AC1.M
|
||||
0562 0f0a lris $AC1.M, #0x0a
|
||||
0563 2fd1 srs @SampleFormat, $AC1.M
|
||||
@ -1748,9 +1754,10 @@ void 0571_Mystery_Write_FirstLoadTwoRegs_Unused() {
|
||||
0571 193e lrri $AC0.M, @$AR1
|
||||
0572 193c lrri $AC0.L, @$AR1
|
||||
|
||||
void 0573_Mystery_Write(InBuffer($AR1), _COUNT(AX0.H)) {
|
||||
void 0573_Mystery_Write(InBuffer($AR1), SourceBuffer(AC1.M), _COUNT(AX0.H)) {
|
||||
0573 0090 0001 lri $AC0.H, #0x0001
|
||||
0575 02bf 0561 call 0x0561
|
||||
// 0575 02bf 0561 call 0x0561
|
||||
0561_SetupAcceleratorForMysteryAccess(ACC0, AR0, AC1.M);
|
||||
0577 007a 057e bloop $AX0.H, 0x057e
|
||||
0579 193e lrri $AC0.M, @$AR1
|
||||
057a 2ed3 srs @Unk Zelda, $AC0.M
|
||||
@ -2528,8 +2535,6 @@ void 073d_DECODE_0x05_0x09(_dest($AR3), _numberOfSamples($AC1.M), _len(AX1)) /
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
07c0 2380 lrs $AX1.H, @0xff80
|
||||
07c1 2688 lrs $AC0.M, @0xff88
|
||||
07c2 2489 lrs $AC0.L, @0xff89
|
||||
@ -2583,21 +2588,6 @@ void 073d_DECODE_0x05_0x09(_dest($AR3), _numberOfSamples($AC1.M), _len(AX1)) /
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void 07eb_AFCDecoder(_numberOfSample(AC0.M))
|
||||
{
|
||||
// 07eb 00ff 0360 sr @0x0360, $AC1.M
|
||||
@ -2608,7 +2598,6 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
|
||||
// 07f2 02bf 05ad call 0x05ad
|
||||
05ad_SetupAccelerator(AC0.M, AC0.L, AC1.M)
|
||||
|
||||
|
||||
// 07f4 2638 lrs $AC0.M, @0x0038
|
||||
// 07f5 2439 lrs $AC0.L, @0x0039
|
||||
// 07f6 8900 clr $ACC1
|
||||
@ -2631,6 +2620,14 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
|
||||
//0802 007e 086b bloop $AC0.M, 0x086b
|
||||
for (int i = 0; i < _numberOfSample; i++)
|
||||
{
|
||||
// Look for the lrrn below to find the ARAM reads.
|
||||
|
||||
// FFD3 seems to be some interface to do plain single byte reads
|
||||
// from ARAM with no ADPCM fanciness or similar.
|
||||
|
||||
// It loads through AR0 loaded with immediate #ffd3, not through
|
||||
// lrs, so CR doesn't affect the effective address.
|
||||
|
||||
0804 0080 ffd3 lri $AR0, #0xffd3
|
||||
0806 0084 0000 lri $IX0, #0x0000
|
||||
0808 199e lrrn $AC0.M, @$AR0
|
||||
@ -2645,12 +2642,11 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
|
||||
0814 0a11 lris $AX0.H, #0x11
|
||||
0815 5500 subr $ACC1, $AX0.H
|
||||
|
||||
|
||||
// 0816 8100 clr $ACC0
|
||||
// 0817 2680 lrs $AC0.M, @0xff80
|
||||
// 0818 0605 cmpis $ACC0, #0x05
|
||||
// 0819 0295 0832 jz 0x0832
|
||||
if (*0x480 == 0x09)
|
||||
if (*0x480 != 0x5) // ( == 0x09)
|
||||
{
|
||||
081b 009a 00f0 lri $AX0.H, #0x00f0
|
||||
081d 0b0f lris $AX1.H, #0x0f
|
||||
@ -2658,26 +2654,29 @@ void 07eb_AFCDecoder(_numberOfSample(AC0.M))
|
||||
0820 1998 lrrn $AX0.L, @$AR0
|
||||
0821 6000 movr $ACC0, $AX0.L
|
||||
|
||||
// Unpack the nibbles
|
||||
// Unpack 14 of the nibbles..
|
||||
0822 1107 0829 bloopi #0x07, 0x0829
|
||||
for (int j=0; j<7; j++)
|
||||
{
|
||||
0824 3400 andr $AC0.M, $AX0.H
|
||||
0825 1408 lsl $ACC0, #8
|
||||
0826 6032 movr's $ACC0, $AX0.L : @$AR2, $AC0.M
|
||||
|
||||
0827 3644 andr'ln $AC0.M, $AX1.H : $AX0.L, @$AR0
|
||||
0828 140c lsl $ACC0, #12
|
||||
0829 6032 movr's $ACC0, $AX0.L : @$AR2, $AC0.M
|
||||
}
|
||||
// Then do the last two ..
|
||||
082a 3400 andr $AC0.M, $AX0.H
|
||||
082b 1408 lsl $ACC0, #8
|
||||
082c 6032 movr's $ACC0, $AX0.L : @$AR2, $AC0.M
|
||||
082d 3600 andr $AC0.M, $AX1.H
|
||||
082e 140c lsl $ACC0, #12
|
||||
082f 1b5e srri @$AR2, $AC0.M
|
||||
|
||||
0830 029f 0852 jmp 0x0852
|
||||
}
|
||||
else // (*0x480 == 5?)
|
||||
else // (*0x480 == 5)
|
||||
{
|
||||
0832 009a c000 lri $AX0.H, #0xc000
|
||||
0834 0082 0364 lri $AR2, #0x0364
|
||||
@ -3154,6 +3153,7 @@ void 09f9_UsedBy08Decoder() {
|
||||
}
|
||||
|
||||
void 0a0a_UsedBy08Decoder() {
|
||||
// Read from ARAM.
|
||||
0a0a 0080 ffd3 lri $AR0, #0xffd3
|
||||
0a0c 0084 0000 lri $IX0, #0x0000
|
||||
0a0e 007a 0a12 bloop $AX0.H, 0x0a12
|
||||
@ -3784,6 +3784,9 @@ void 0c1c_Unk()
|
||||
0c5b 0080 0a00 lri $AR0, #0x0a00
|
||||
0c5d 0900 lris $AX1.L, #0x00
|
||||
|
||||
// This is the loop that used to go crazy in the LLE emulation
|
||||
// before we fixed addarn to obey the wrapping register.
|
||||
|
||||
// 0c5e 1150 0c65 bloopi #0x50, 0x0c65
|
||||
for (int i = 0; i < 0x50; i++) {
|
||||
0c60 1878 lrr $AX0.L, @$AR3
|
||||
|
Loading…
x
Reference in New Issue
Block a user