From fbdf721e0ec00a0b4775c6d70e2724e4ca96a9fd Mon Sep 17 00:00:00 2001 From: Marko Pusljar Date: Sun, 24 Jan 2010 00:31:20 +0000 Subject: [PATCH] ROM dissasm "refresh" + RE + small fixes git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4938 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DSPCore/Src/DSPInterpreter.h | 1 + Source/Core/DSPCore/Src/DSPTables.cpp | 1 + Source/Core/DSPCore/Src/DspIntMisc.cpp | 10 + .../Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp | 6 +- .../Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp | 6 +- .../Src/UCodes/UCode_InitAudioSystem.h | 2 +- .../Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp | 10 +- .../Plugin_DSP_HLE/Src/UCodes/UCode_ROM.h | 2 +- docs/DSP/DSP_UC_AXWii.txt | 43 +- docs/DSP/DSP_UC_IPL_CB22D5C7.txt | 1985 +++++++++++++++++ docs/DSP/DSP_UC_ROM.txt | 693 +++--- 11 files changed, 2434 insertions(+), 325 deletions(-) create mode 100644 docs/DSP/DSP_UC_IPL_CB22D5C7.txt diff --git a/Source/Core/DSPCore/Src/DSPInterpreter.h b/Source/Core/DSPCore/Src/DSPInterpreter.h index 37d464ea4d..434f46bdde 100644 --- a/Source/Core/DSPCore/Src/DSPInterpreter.h +++ b/Source/Core/DSPCore/Src/DSPInterpreter.h @@ -126,6 +126,7 @@ void lsrn(const UDSPInstruction& opc); void asrn(const UDSPInstruction& opc); void dar(const UDSPInstruction& opc); void iar(const UDSPInstruction& opc); +void xar(const UDSPInstruction& opc); void sbclr(const UDSPInstruction& opc); void sbset(const UDSPInstruction& opc); void mov(const UDSPInstruction& opc); diff --git a/Source/Core/DSPCore/Src/DSPTables.cpp b/Source/Core/DSPCore/Src/DSPTables.cpp index 9eb13527c1..fdb5d9cb27 100644 --- a/Source/Core/DSPCore/Src/DSPTables.cpp +++ b/Source/Core/DSPCore/Src/DSPTables.cpp @@ -41,6 +41,7 @@ const DSPOPCTemplate opcodes[] = {"DAR", 0x0004, 0xfffc, DSPInterpreter::dar, nop, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false}, {"IAR", 0x0008, 0xfffc, DSPInterpreter::iar, nop, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false}, + {"XAR", 0x000c, 0xfffc, DSPInterpreter::xar, nop, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false}, {"ADDARN", 0x0010, 0xfff0, DSPInterpreter::addarn, nop, 1, 2, {{P_REG, 1, 0, 0, 0x0003}, {P_REG04, 1, 0, 2, 0x000c}}, false}, diff --git a/Source/Core/DSPCore/Src/DspIntMisc.cpp b/Source/Core/DSPCore/Src/DspIntMisc.cpp index 8e674f54c4..ce27fd085b 100644 --- a/Source/Core/DSPCore/Src/DspIntMisc.cpp +++ b/Source/Core/DSPCore/Src/DspIntMisc.cpp @@ -129,6 +129,16 @@ void iar(const UDSPInstruction& opc) g_dsp.r[opc.hex & 0x3] = dsp_increment_addr_reg(opc.hex & 0x3); } +// XAR $arD ? +// 0000 0000 0000 11dd +// $arD result somehow depends on $wrD +// unknown atm +// used in IPL ucode +void xar(const UDSPInstruction& opc) +{ +// u8 dreg = opc.hex & 0x3; +} + // SBCLR #I // 0001 0011 0000 0iii // bit of status register $sr. Bit number is calculated by adding 6 to diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp index e98fd2a41b..649655aea5 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AX.cpp @@ -404,7 +404,11 @@ void CUCode_AX::HandleMail(u32 _uMail) { m_rMailHandler.PushMail(0xDCD10001); } - else if ((_uMail & 0xFFFF0000) == 0xCDD10000) // Action 1/2/3 + else if (_uMail == 0xCDD10001) // Action 1 - new ucode upload + { + NOTICE_LOG(DSPHLE,"Game wanted to upload new ucode!"); + } + else if ((_uMail & 0xFFFF0000) == 0xCDD10000) // Action 2/3 { } else diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp index 1621f32dfe..5b1218b9d5 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp @@ -73,7 +73,11 @@ void CUCode_AXWii::HandleMail(u32 _uMail) { m_rMailHandler.PushMail(0xDCD10001); } - else if ((_uMail & 0xFFFF0000) == 0xCDD10000) // Action 1/2/3 + else if (_uMail == 0xCDD10001) // Action 1 - new ucode upload + { + NOTICE_LOG(DSPHLE,"Game wanted to upload new ucode!"); + } + else if ((_uMail & 0xFFFF0000) == 0xCDD10000) // Action 2/3 { } else diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_InitAudioSystem.h b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_InitAudioSystem.h index fc9a7ce0ba..e73f3d399b 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_InitAudioSystem.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_InitAudioSystem.h @@ -36,7 +36,7 @@ private: u32 m_RAMAddress; u32 m_Length; u32 m_IMEMAddress; - u32 m_Unk; + u32 m_DMEMLength; u32 m_StartPC; }; diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp index 1ea008b61a..100c805e4e 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.cpp @@ -68,7 +68,10 @@ void CUCode_Rom::HandleMail(u32 _uMail) break; case 0x80F3B002: - m_CurrentUCode.m_Unk = _uMail; + m_CurrentUCode.m_DMEMLength = _uMail; + if (_uMail) { + NOTICE_LOG(DSPHLE,"Game wanted to DMA sth to DSP DRAM."); + } break; case 0x80F3D001: @@ -78,6 +81,9 @@ void CUCode_Rom::HandleMail(u32 _uMail) return; // Important! BootUCode indirectly does "delete this;". Must exit immediately. } break; + + default: + break; } // THE GODDAMN OVERWRITE WAS HERE. Without the return above, since BootUCode may delete "this", well ... @@ -100,7 +106,7 @@ void CUCode_Rom::BootUCode() DEBUG_LOG(DSPHLE, "CurrentUCode SOURCE Addr: 0x%08x", m_CurrentUCode.m_RAMAddress); DEBUG_LOG(DSPHLE, "CurrentUCode Length: 0x%08x", m_CurrentUCode.m_Length); DEBUG_LOG(DSPHLE, "CurrentUCode DEST Addr: 0x%08x", m_CurrentUCode.m_IMEMAddress); - DEBUG_LOG(DSPHLE, "CurrentUCode ???: 0x%08x", m_CurrentUCode.m_Unk); + DEBUG_LOG(DSPHLE, "CurrentUCode DMEM Length: 0x%08x", m_CurrentUCode.m_DMEMLength); DEBUG_LOG(DSPHLE, "CurrentUCode init_vector: 0x%08x", m_CurrentUCode.m_StartPC); DEBUG_LOG(DSPHLE, "CurrentUCode CRC: 0x%08x", crc); DEBUG_LOG(DSPHLE, "BootTask - done"); diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.h b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.h index b3730c96db..aa0c592a5d 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_ROM.h @@ -35,7 +35,7 @@ private: u32 m_RAMAddress; u32 m_Length; u32 m_IMEMAddress; - u32 m_Unk; + u32 m_DMEMLength; u32 m_StartPC; }; diff --git a/docs/DSP/DSP_UC_AXWii.txt b/docs/DSP/DSP_UC_AXWii.txt index fd75ef3b9f..d87967e4c2 100644 --- a/docs/DSP/DSP_UC_AXWii.txt +++ b/docs/DSP/DSP_UC_AXWii.txt @@ -3224,15 +3224,15 @@ void 0f92_Int7_Handler() { } // action jump table - 0f97 0fa9 lris $AC1.M, #0xa9 // Action 0 - restart - 0f98 0fac lris $AC1.M, #0xac // Action 1 - wait for 10 mails and dump memory? - 0f99 0fe4 lris $AC1.M, #0xe4 // Action 2 - soft reset - 0f9a 0fe7 lris $AC1.M, #0xe7 // Action 3 - jump back to main loop + 0f97 0fa9 // Action 0 - restart + 0f98 0fac // Action 1 - dump DRAM and jump into iROM where new IRAM and DRAM can be uploaded + 0f99 0fe4 // Action 2 - soft reset + 0f9a 0fe7 // Action 3 - jump back to main loop // called at AXList end; wait for a last mail and take an action // Note: the same thing can be found in Zelda ucode. It's called after DsyncFrame. // Probably debugging stuff. - +{ 0f9b 8e00 set16 0f9c 8100 clr $ACC0 0f9d 8900 clr $ACC1 @@ -3245,10 +3245,16 @@ void 0f92_Int7_Handler() { 0fa6 1c7f mrr $AR3, $AC1.M 0fa7 176f jmpr $AR3 // take the action! 0fa8 0021 halt - +} + +//ACTION 0 (0xCDD10000) +{ 0fa9 029f 0037 jmp 0037_Unk_Restart() - 0fab 0021 halt - + 0fab 0021 halt +} + +//ACTION 1 (0xCDD10001) +{ 0fac 8100 clr $ACC0 0fad 8900 clr $ACC1 0fae 02bf 0fea call 0x0fea @@ -3259,12 +3265,13 @@ void 0f92_Int7_Handler() { 0fb6 27ff lrs $AC1.M, @CMBL 0fb7 2ece srs @DSMAH, $AC0.M 0fb8 2ccf srs @DSMAL, $AC0.L - 0fb9 16c9 0001 si @DSCR, #0x0001 + 0fb9 16c9 0001 si @DSCR, #0x0001 // DMEM->CPU 0fbb 2fcd srs @DSPA, $AC1.M 0fbc 2dcb srs @DSBL, $AC1.L 0fbd 8100 clr $ACC0 0fbe 8900 clr $ACC1 0fbf 02bf 0fea call 0x0fea +//prepare addr-s/length/dsp-PC for new IRAM/DRAM 0fc1 24ff lrs $AC0.L, @CMBL 0fc2 1c9e mrr $IX0, $AC0.M 0fc3 1cbc mrr $IX1, $AC0.L @@ -3286,25 +3293,39 @@ void 0f92_Int7_Handler() { 0fd8 21ff lrs $AX1.L, @CMBL 0fd9 02bf 0fea call 0x0fea 0fdb 23ff lrs $AX1.H, @CMBL +// 0fdc 26c9 lrs $AC0.M, @DSCR 0fdd 02a0 0004 andf $AC0.M, #0x0004 0fdf 029c 0fdc jlnz 0x0fdc - 0fe1 029f 80b5 jmp 0x80b5 - 0fe3 0021 halt + 0fe1 029f 80b5 jmp 0x80b5 // 80b5_BootUcode() + 0fe3 0021 halt +} + +//ACTION 2 (0xCDD10002) +{ 0fe4 029f 8000 jmp 0x8000 0fe6 0021 halt +} + +//ACTION 3 (0xCDD10003) +{ 0fe7 029f 004c jmp 0x004c 0fe9 0021 halt +} +{ 0fea 26fe lrs $AC0.M, @CMBH 0feb 02c0 8000 andcf $AC0.M, #0x8000 0fed 029c 0fea jlnz 0x0fea 0fef 02df ret +} +{ 0ff0 27fe lrs $AC1.M, @CMBH 0ff1 03c0 8000 andcf $AC1.M, #0x8000 0ff3 029c 0ff0 jlnz 0x0ff0 0ff5 02df ret +} 0ff6 0000 nop 0ff7 0000 nop diff --git a/docs/DSP/DSP_UC_IPL_CB22D5C7.txt b/docs/DSP/DSP_UC_IPL_CB22D5C7.txt new file mode 100644 index 0000000000..394763bc7d --- /dev/null +++ b/docs/DSP/DSP_UC_IPL_CB22D5C7.txt @@ -0,0 +1,1985 @@ +0000 029f 0010 jmp 0x0010 +0002 0000 nop +0003 0000 nop +0004 02ff rti +0005 0000 nop +0006 02ff rti +0007 0000 nop +0008 02ff rti +0009 0000 nop +000a 02ff rti +000b 0000 nop +000c 02ff rti +000d 0000 nop +000e 02ff rti +000f 0000 nop + +// Entry +void 0010_Entry() +{ +0010 1302 sbset #0x02 +0011 1303 sbset #0x03 +0012 1204 sbclr #0x04 +0013 1305 sbset #0x05 +0014 1306 sbset #0x06 +0015 8e00 set16 +0016 8c00 clr15 +0017 8b00 m0 +0018 009e ffff lri $AC0.M, #0xffff +001a 1d1e mrr $WR0, $AC0.M +001b 1d3e mrr $WR1, $AC0.M +001c 1d5e mrr $WR2, $AC0.M +001d 1d7e mrr $WR3, $AC0.M +001e 0092 00ff lri $CR, #0x00ff +0020 8100 clr $ACC0 +0021 009f 1000 lri $AC1.M, #0x1000 +0023 0080 0000 lri $AR0, #0x0000 +0025 005f loop $AC1.M + 0026 1b1e srri @$AR0, $AC0.M // clear dram +0027 26ff lrs $AC0.M, @CMBL +0028 16fc 8888 si @DMBH, #0x8888 +002a 16fd 1111 si @DMBL, #0x1111 // SENDMAIL 0x88881111 +002c 26fc lrs $AC0.M, @DMBH +002d 02a0 8000 andf $AC0.M, #0x8000 +002f 029c 002c jlnz 0x002c +} + +void 0031_MainLoop() +{ +0031 8100 clr $ACC0 +0032 8900 clr $ACC1 +0033 26fe lrs $AC0.M, @CMBH +0034 02c0 8000 andcf $AC0.M, #0x8000 +0036 029c 0031 jlnz 0x0031 // wait for mail +0038 27ff lrs $AC1.M, @CMBL +0039 00ff 0345 sr @0x0345, $AC1.M +003b 1ffe mrr $AC1.M, $AC0.M +003c 0340 00ff andi $AC1.M, #0x00ff +003e 00ff 0344 sr @0x0344, $AC1.M +0040 1479 lsr $ACC0, #-7 +0041 0240 007e andi $AC0.M, #0x007e +0043 0200 0062 addi $AC0.M, #0x0062 +0045 00fe 0343 sr @0x0343, $AC0.M +0047 1c1e mrr $AR0, $AC0.M +0048 170f jmpr $AR0 // jump on CMD? +0049 009e 8000 lri $AC0.M, #0x8000 +004b 00dc 0343 lr $AC0.L, @0x0343 +004d 02bf 005a call 005a_SendMail(AC0.M,AC0.L) // sendmail 0x8000???? +004f 029f 0031 jmp 0x0031 +} + +void 0051_WaitForMailAndStoreIt(DEST $AR0) +{ +0051 26fe lrs $AC0.M, @CMBH +0052 02c0 8000 andcf $AC0.M, #0x8000 +0054 029c 0051 jlnz 0x0051 +0056 24ff lrs $AC0.L, @CMBL +0057 1b1e srri @$AR0, $AC0.M +0058 1b1c srri @$AR0, $AC0.L +0059 02df ret +} + +void 005a_SendMail(AC0.M,AC0.L) +{ +005a 2efc srs @DMBH, $AC0.M +005b 2cfd srs @DMBL, $AC0.L +005c 26fc lrs $AC0.M, @DMBH +005d 02a0 8000 andf $AC0.M, #0x8000 +005f 029c 005c jlnz 0x005c +0061 02df ret +} + +//CMDs +0062 029f 0049 jmp 0x0049 // CMD_0 +0064 029f 02bd jmp 0x02bd // CMD_1 +0066 029f 0470 jmp 0x0470 // CMD_2 +0068 029f 0031 jmp 0x0031 // CMD_3 +006a 029f 00df jmp 0x00df // CMD_4 +006c 029f 00f1 jmp 0x00f1 // CMD_5 +006e 029f 05bb jmp 0x05bb // CMD_6 +0070 029f 056f jmp 0x056f // CMD_7 +0072 029f 05d7 jmp 0x05d7 // CMD_8 +0074 029f 059f jmp 0x059f // CMD_9 +0076 029f 0741 jmp 0x0741 // CMD_A +0078 029f 0618 jmp 0x0618 // CMD_B - jump to IROM area (0x8644) +007a 029f 0203 jmp 0x0203 // CMD_C + +{ +007c 193e lrri $AC0.M, @$AR1 +007d 193c lrri $AC0.L, @$AR1 +007e 2fcd srs @DSPA, $AC1.M +007f 0f00 lris $AC1.M, #0x00 +0080 2fc9 srs @DSCR, $AC1.M // DMEM->CPU +0081 2ece srs @DSMAH, $AC0.M +0082 2ccf srs @DSMAL, $AC0.L +0083 1fe0 mrr $AC1.M, $AR0 +0084 1501 lsl $ACC1, #1 +0085 2fcb srs @DSBL, $AC1.M +0086 02bf 008f call 0x008f +0088 02df ret +} + +{ +0089 193e lrri $AC0.M, @$AR1 +008a 193c lrri $AC0.L, @$AR1 +008b 2fcd srs @DSPA, $AC1.M +008c 0f01 lris $AC1.M, #0x01 +008d 029f 0080 jmp 0x0080 +} + +{ +008f 26c9 lrs $AC0.M, @DSCR +0090 02a0 0004 andf $AC0.M, #0x0004 +0092 029c 008f jlnz 0x008f +0094 02df ret +} + +{ +0095 193e lrri $AC0.M, @$AR1 +0096 193c lrri $AC0.L, @$AR1 +0097 00ff ffcd sr @DSPA, $AC1.M +0099 0f00 lris $AC1.M, #0x00 +009a 00ff ffc9 sr @DSCR, $AC1.M +009c 00fe ffce sr @DSMAH, $AC0.M +009e 00fc ffcf sr @DSMAL, $AC0.L +00a0 1fe0 mrr $AC1.M, $AR0 +00a1 1501 lsl $ACC1, #1 +00a2 00ff ffcb sr @DSBL, $AC1.M +00a4 02df ret +} + +void 00a5_WaitForDMAend() +{ +00a5 00de ffc9 lr $AC0.M, @DSCR +00a7 02a0 0004 andf $AC0.M, #0x0004 +00a9 029c 00a5 jlnz 0x00a5 +00ab 02df ret +} + +void 00ac_AccZeldaTypeRead() +{ +00ac 193e lrri $AC0.M, @$AR1 +00ad 193c lrri $AC0.L, @$AR1 +00ae 0240 7fff andi $AC0.M, #0x7fff +00b0 02bf 00ba call 00ba_AccSetup() +00b2 007a 00b8 bloop $AX0.H, 0x00b8 +00b4 26d3 lrs $AC0.M, @UnkZelda +00b5 1b3e srri @$AR1, $AC0.M +00b6 0000 nop +00b7 0000 nop +00b8 0000 nop +00b9 02df ret +} + +void 00ba_AccSetup() +{ +00ba 1c3f mrr $AR1, $AC1.M +00bb 009f 0005 lri $AC1.M, #0x0005 +00bd 2fd1 srs @SampleFormat, $AC1.M // reads will be u8 +00be 1f5e mrr $AX0.H, $AC0.M +00bf 1f1c mrr $AX0.L, $AC0.L +00c0 2ed4 srs @ACSAH, $AC0.M +00c1 2cd5 srs @ACSAL, $AC0.L +00c2 8900 clr $ACC1 +00c3 1fa0 mrr $AC1.L, $AR0 +00c4 4c00 add $ACC0, $ACC1 +00c5 0200 0030 addi $AC0.M, #0x0030 +00c7 2ed6 srs @ACEAH, $AC0.M +00c8 2cd7 srs @ACEAL, $AC0.L +00c9 1fda mrr $AC0.M, $AX0.H +00ca 1f98 mrr $AC0.L, $AX0.L +00cb 147f lsr $ACC0, #-1 +00cc 2ed8 srs @ACCAH, $AC0.M +00cd 2cd9 srs @ACCAL, $AC0.L +00ce 1f40 mrr $AX0.H, $AR0 +00cf 02df ret +} + +void 00d0_AccZeldaTypeWrite() +{ +00d0 193e lrri $AC0.M, @$AR1 +00d1 193c lrri $AC0.L, @$AR1 +00d2 0260 8000 ori $AC0.M, #0x8000 +00d4 02bf 00ba call 00ba_AccSetup() +00d6 007a 00dd bloop $AX0.H, 0x00dd +{ + 00d8 193e lrri $AC0.M, @$AR1 + 00d9 2ed3 srs @UnkZelda, $AC0.M + 00da 0000 nop + 00db 0000 nop + 00dc 0000 nop + 00dd 0000 nop +} +00de 02df ret +} + +{ +00df 0080 0346 lri $AR0, #0x0346 +00e1 02bf 0051 call 0x0051 +00e3 02bf 0051 call 0x0051 +00e5 0081 0346 lri $AR1, #0x0346 +00e7 00df 0349 lr $AC1.M, @0x0349 +00e9 0340 ffff andi $AC1.M, #0xffff +00eb 00c0 0345 lr $AR0, @0x0345 +00ed 02bf 007c call 0x007c +00ef 029f 0049 jmp 0x0049 +} + +{ +00f1 0080 0346 lri $AR0, #0x0346 +00f3 02bf 0051 call 0x0051 +00f5 02bf 0051 call 0x0051 +00f7 0081 0346 lri $AR1, #0x0346 +00f9 00df 0349 lr $AC1.M, @0x0349 +00fb 0340 ffff andi $AC1.M, #0xffff +00fd 00c0 0345 lr $AR0, @0x0345 +00ff 02bf 0089 call 0x0089 +0101 029f 0049 jmp 0x0049 +} + +{ +0103 0092 00ff lri $CR, #0x00ff +0105 2fd1 srs @SampleFormat, $AC1.M +0106 0340 0003 andi $AC1.M, #0x0003 +0108 1f7f mrr $AX1.H, $AC1.M +0109 1f5e mrr $AX0.H, $AC0.M +010a 1f1c mrr $AX0.L, $AC0.L +010b 0200 0010 addi $AC0.M, #0x0010 +010d 2ed4 srs @ACSAH, $AC0.M +010e 2cd5 srs @ACSAL, $AC0.L +010f 8900 clr $ACC1 +0110 1fa0 mrr $AC1.L, $AR0 +0111 4c00 add $ACC0, $ACC1 +0112 0200 0030 addi $AC0.M, #0x0030 +0114 2ed6 srs @ACEAH, $AC0.M +0115 2cd7 srs @ACEAL, $AC0.L +0116 1fda mrr $AC0.M, $AX0.H +0117 1f98 mrr $AC0.L, $AX0.L +0118 1ffb mrr $AC1.M, $AX1.H +0119 7900 decm $AC1.M +011a 02ca lsrn +011b 2ed8 srs @ACCAH, $AC0.M +011c 2cd9 srs @ACCAL, $AC0.L +011d 02df ret +} + +//DSPLLE errors here!!! readw/writes from 0x3??? +{ +011e 1c23 mrr $AR1, $AR3 +011f 197e lrri $AC0.M, @$AR3 +0120 191b lrri $AX1.H, @$AR0 +0121 d858 mulc'l $AC1.M, $AX1.H : $AX1.H, @$AR0 +0122 1128 0128 bloopi #0x28, 0x0128 +0124 dcd3 mulcac'ld $AC1.M, $AX1.H, $ACC0 : $AX0.L, $AX1.H, @$AR3 +0125 6231 movr's $ACC0, $AX1.L : @$AR1, $AC0.M +0126 dcd3 mulcac'ld $AC1.M, $AX1.H, $ACC0 : $AX0.L, $AX1.H, @$AR3 +0127 6231 movr's $ACC0, $AX1.L : @$AR1, $AC0.M +0128 4900 addax $ACC1, $AX0 +0129 02df ret +} + +{ +012a 8f00 set40 +012b 1c03 mrr $AR0, $AR3 +012c 00db 038e lr $AX1.H, @0x038e +012e 009a 0004 lri $AX0.H, #0x0004 +0130 1978 lrri $AX0.L, @$AR3 +0131 a843 mulx'l $AX0.L, $AX1.H : $AX0.L, @$AR3 +0132 ae00 mulxmv $AX0.L, $AX1.H, $ACC0 +0133 1128 0138 bloopi #0x28, 0x0138 +0135 38c3 asrnrx'l $ACC0, $AX0.H : $AX0.L, @$AR3 +0136 ae30 mulxmv's $AX0.L, $AX1.H, $ACC0 : @$AR0, $AC0.M +0137 38c3 asrnrx'l $ACC0, $AX0.H : $AX0.L, @$AR3 +0138 ae30 mulxmv's $AX0.L, $AX1.H, $ACC0 : @$AR0, $AC0.M +0139 8e00 set16 +013a 02df ret +} + +{ +013b 00f9 0361 sr @0x0361, $AX1.L +013d 1fc0 mrr $AC0.M, $AR0 +013e 0200 fffc addi $AC0.M, #0xfffc +0140 1c1e mrr $AR0, $AC0.M +0141 1c5e mrr $AR2, $AC0.M +0142 0083 0424 lri $AR3, #0x0424 +0144 197e lrri $AC0.M, @$AR3 +0145 197f lrri $AC1.M, @$AR3 +0146 80a2 nx'sl : $AC0.M, $AX0.H +0147 64a3 movr'sl $ACC0, $AX0.H : $AC1.M, $AX0.H +0148 6530 movr's $ACC1, $AX0.H : @$AR0, $AC0.M +0149 1b1f srri @$AR0, $AC1.M +014a 1c02 mrr $AR0, $AR2 +014b 8100 clr $ACC0 +014c 00de 0402 lr $AC0.M, @0x0402 +014e 00fe 0362 sr @0x0362, $AC0.M +0150 1474 lsr $ACC0, #-12 +0151 1f7e mrr $AX1.H, $AC0.M +0152 1f3c mrr $AX1.L, $AC0.L +0153 8900 clr $ACC1 +0154 00dd 0418 lr $AC1.L, @0x0418 +0156 1504 lsl $ACC1, #4 +0157 0604 cmpis $AC0.M, #0x04 +0158 0290 01b0 jge 0x01b0 +015a 1fdd mrr $AC0.M, $AC1.L +015b 0082 0c00 lri $AR2, #0x0c00 +015d 1050 loopi #0x50 +015e 4b2a addax's $ACC1, $AX1 : @$AR2, $AC1.L +015f 1fbe mrr $AC1.L, $AC0.M +0160 00fe 0360 sr @0x0360, $AC0.M +0162 8900 clr $ACC1 +0163 1fbe mrr $AC1.L, $AC0.M +0164 009a fff8 lri $AX0.H, #0xfff8 +0166 009b 00fc lri $AX1.H, #0x00fc +0168 00d8 0361 lr $AX0.L, @0x0361 +016a 0082 0c00 lri $AR2, #0x0c00 +016c 0083 0c00 lri $AR3, #0x0c00 +016e 195e lrri $AC0.M, @$AR2 +016f 3480 lsrnrx $ACC0, $AX0.H +0170 1128 0175 bloopi #0x28, 0x0175 +0172 367a andr'l $AC0.M, $AX1.H : $AC1.M, @$AR2 +0173 35b3 lsrnrx's $ACC1, $AX0.H : @$AR3, $AC0.M +0174 3772 andr'l $AC1.M, $AX1.H : $AC0.M, @$AR2 +0175 34bb lsrnrx's $ACC0, $AX0.H : @$AR3, $AC1.M +0176 8a00 m2 +0177 0082 0c00 lri $AR2, #0x0c00 +0179 00dd 0418 lr $AC1.L, @0x0418 +017b 1504 lsl $ACC1, #4 +017c 1fe0 mrr $AC1.M, $AR0 +017d 8100 clr $ACC0 +017e 00de 0362 lr $AC0.M, @0x0362 +0180 1474 lsr $ACC0, #-12 +0181 1f7e mrr $AX1.H, $AC0.M +0182 1f3c mrr $AX1.L, $AC0.L +0183 8f00 set40 +0184 1943 lrri $AR3, @$AR2 +0185 4bc3 addax'ld $ACC1, $AX1 : $AX0.L, $AX1.L, @$AR3 +0186 90c3 mul'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 +0187 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 +0188 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 +0189 f200 madd $AX0.L, $AX0.H +018a fe00 movpz $ACC0 +018b 1c1f mrr $AR0, $AC1.M +018c 1943 lrri $AR3, @$AR2 +018d 4bc3 addax'ld $ACC1, $AX1 : $AX0.L, $AX1.L, @$AR3 +018e 90c3 mul'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 +018f 114e 0197 bloopi #0x4e, 0x0197 +0191 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 +0192 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 +0193 f231 madd's $AX0.L, $AX0.H : @$AR1, $AC0.M +0194 1c1f mrr $AR0, $AC1.M +0195 1943 lrri $AR3, @$AR2 +0196 4bc3 addax'ld $ACC1, $AX1 : $AX0.L, $AX1.L, @$AR3 +0197 92c3 mulmvz'ld $AX0.L, $AX0.H, $ACC0 : $AX0.L, $AX1.L, @$AR3 +0198 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 +0199 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 +019a f231 madd's $AX0.L, $AX0.H : @$AR1, $AC0.M +019b fe00 movpz $ACC0 +019c 1b3e srri @$AR1, $AC0.M +019d 8b00 m0 +019e 8e00 set16 +019f 00fe 041b sr @0x041b, $AC0.M +01a1 1c1f mrr $AR0, $AC1.M +01a2 150c lsl $ACC1, #12 +01a3 0340 0fff andi $AC1.M, #0x0fff +01a5 00ff 0418 sr @0x0418, $AC1.M +01a7 0083 0424 lri $AR3, #0x0424 +01a9 191e lrri $AC0.M, @$AR0 +01aa 191f lrri $AC1.M, @$AR0 +01ab 80a0 nx'ls : $AX0.H, $AC0.M +01ac 64a1 movr'ls $ACC0, $AX0.H : $AX0.H, $AC1.M +01ad 6533 movr's $ACC1, $AX0.H : @$AR3, $AC0.M +01ae 1b7f srri @$AR3, $AC1.M +01af 02df ret +} + +{ +01b0 1fe0 mrr $AC1.M, $AR0 +01b1 1c1f mrr $AR0, $AC1.M +01b2 1128 01b9 bloopi #0x28, 0x01b9 +01b4 4b70 addax'l $ACC1, $AX1 : $AC0.M, @$AR0 +01b5 1b3e srri @$AR1, $AC0.M +01b6 1c1f mrr $AR0, $AC1.M +01b7 4b70 addax'l $ACC1, $AX1 : $AC0.M, @$AR0 +01b8 1b3e srri @$AR1, $AC0.M +01b9 1c1f mrr $AR0, $AC1.M +01ba 029f 019f jmp 0x019f +} + +{ +01bc 8a00 m2 +01bd 0088 0007 lri $WR0, #0x0007 +01bf 1150 01cc bloopi #0x50, 0x01cc +{ + 01c1 1c61 mrr $AR3, $AR1 + 01c2 84c3 clrp'ld : $AX0.L, $AX1.L, @$AR3 + 01c3 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 + 01c4 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 + 01c5 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 + 01c6 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 + 01c7 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 + 01c8 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 + 01c9 f2c3 madd'ld $AX0.L, $AX0.H : $AX0.L, $AX1.L, @$AR3 + 01ca f200 madd $AX0.L, $AX0.H + 01cb fe00 movpz $ACC0 + 01cc 1b3e srri @$AR1, $AC0.M +} +01cd 0088 ffff lri $WR0, #0xffff +01cf 8b00 m0 +01d0 02df ret +} + +{ +01d1 0088 0003 lri $WR0, #0x0003 +01d3 0085 0000 lri $IX1, #0x0000 +01d5 0087 0000 lri $IX3, #0x0000 +01d7 1fc2 mrr $AC0.M, $AR2 +01d8 195b lrri $AX1.H, @$AR2 +01d9 1959 lrri $AX1.L, @$AR2 +01da 195f lrri $AC1.M, @$AR2 +01db 195a lrri $AX0.H, @$AR2 +01dc 1c5e mrr $AR2, $AC0.M +01dd 1fda mrr $AC0.M, $AX0.H +01de 1c61 mrr $AR3, $AR1 +01df 8a00 m2 +01e0 8f00 set40 +01e1 191a lrri $AX0.H, @$AR0 +01e2 b850 mulx'l $AX0.H, $AX1.H : $AX0.H, @$AR0 +01e3 e250 maddx'l $AX0.H, $AX1.L : $AX0.H, @$AR0 +01e4 ea50 maddc'l $AC1.M, $AX1.L : $AX0.H, @$AR0 +01e5 e8e8 maddc'ldm $AC0.M, $AX1.L : $AX0.H, $AX1.L, @$AR0 +01e6 b650 mulxmv'l $AX0.H, $AX1.L, $ACC0 : $AX0.H, @$AR0 +01e7 1127 01f2 bloopi #0x27, 0x01f2 +{ + 01e9 e3a8 maddx'lsm $AX0.H, $AX1.H : $AX0.H, $AC0.M + 01ea 197e lrri $AC0.M, @$AR3 + 01eb e850 maddc'l $AC0.M, $AX1.L : $AX0.H, @$AR0 + 01ec eaf8 maddc'ldm $AC1.M, $AX1.L : $AX0.H, $AX1.H, @$AR0 + 01ed bf50 mulxmv'l $AX0.H, $AX1.H, $ACC1 : $AX0.H, @$AR0 + 01ee e2a9 maddx'lsm $AX0.H, $AX1.L : $AX0.H, $AC1.M + 01ef 197f lrri $AC1.M, @$AR3 + 01f0 ea50 maddc'l $AC1.M, $AX1.L : $AX0.H, @$AR0 + 01f1 e8e8 maddc'ldm $AC0.M, $AX1.L : $AX0.H, $AX1.L, @$AR0 + 01f2 b650 mulxmv'l $AX0.H, $AX1.L, $ACC0 : $AX0.H, @$AR0 +} +01f3 e3a8 maddx'lsm $AX0.H, $AX1.H : $AX0.H, $AC0.M +01f4 197e lrri $AC0.M, @$AR3 +01f5 e850 maddc'l $AC0.M, $AX1.L : $AX0.H, @$AR0 +01f6 eaf8 maddc'ldm $AC1.M, $AX1.L : $AX0.H, $AX1.H, @$AR0 +01f7 bf00 mulxmv $AX0.H, $AX1.H, $ACC1 +01f8 1bff srrn @$AR3, $AC1.M +01f9 197f lrri $AC1.M, @$AR3 +01fa 8e00 set16 +01fb 8b00 m0 +01fc 0088 ffff lri $WR0, #0xffff +01fe 1b5b srri @$AR2, $AX1.H +01ff 1b59 srri @$AR2, $AX1.L +0200 1b5f srri @$AR2, $AC1.M +0201 1b5e srri @$AR2, $AC0.M +0202 02df ret +} + +{ +0203 0080 0346 lri $AR0, #0x0346 +0205 02bf 0051 call 0x0051 +0207 02bf 0051 call 0x0051 +0209 0081 0346 lri $AR1, #0x0346 +020b 009f 0580 lri $AC1.M, #0x0580 +020d 0080 0080 lri $AR0, #0x0080 +020f 02bf 007c call 0x007c +0211 0081 0348 lri $AR1, #0x0348 +0213 009f 0c00 lri $AC1.M, #0x0c00 +0215 0080 0080 lri $AR0, #0x0080 +0217 02bf 007c call 0x007c +0219 0080 0c00 lri $AR0, #0x0c00 +021b 0081 0580 lri $AR1, #0x0580 +021d 02bf 01d1 call 0x01d1 +021f 0081 0346 lri $AR1, #0x0346 +0221 009f 0580 lri $AC1.M, #0x0580 +0223 0080 0080 lri $AR0, #0x0080 +0225 02bf 0089 call 0x0089 +0227 0081 0348 lri $AR1, #0x0348 +0229 009f 0c00 lri $AC1.M, #0x0c00 +022b 0080 0080 lri $AR0, #0x0080 +022d 02bf 0089 call 0x0089 +022f 029f 0049 jmp 0x0049 +} + +void 0231_FormatAudioSynths(format AC0.M) +{ +0231 8100 clr $ACC0 +0232 1f5e mrr $AX0.H, $AC0.M +0233 00d8 0402 lr $AX0.L, @0x0402 +0235 00dc 0418 lr $AC0.L, @0x0418 +0237 0080 0520 lri $AR0, #0x0520 +0239 00df 0440 lr $AC1.M, @0x0440 +023b 1501 lsl $ACC1, #1 +023c 0340 007e andi $AC1.M, #0x007e +023e 0300 0246 addi $AC1.M, #0x0246 +0240 1c5f mrr $AR2, $AC1.M +0241 175f callr $AR2 // call 0x0246 +0242 00fc 0418 sr @0x0418, $AC0.L +0244 029f 04e7 jmp 0x04e7 // dummy +0246 029f 0257 jmp 0x0257 // 0x0 - Synth0 +0248 029f 028f jmp 0x028f // 0x1 - Synth1 +024a 029f 0277 jmp 0x0277 // 0x2 - Synth2 +024c 029f 0267 jmp 0x0267 // 0x3 - Synth3 +024e 029f 0292 jmp 0x0292 // 0x4 - Synth4 +0250 029f 0256 jmp 0x0256 // 0x5 - dummy +0252 029f 02b1 jmp 0x02b1 // 0x6 - Synth6 +0254 029f 02ae jmp 0x02ae // 0x7 - Synth7 +0256 02df ret +} + +void 0257_Synth0() +{ +0257 1401 lsl $ACC0, #1 +0258 009b c000 lri $AX1.H, #0xc000 +025a 0099 4000 lri $AX1.L, #0x4000 +025c 1150 0264 bloopi #0x50, 0x0264 +{ + 025e 02c0 0001 andcf $AC0.M, #0x0001 + 0260 027c iflnz + 0261 1b1b srri @$AR0, $AX1.H + 0262 027d iflz + 0263 1b19 srri @$AR0, $AX1.L + 0264 4800 addax $ACC0, $AX0 +} +0265 147f lsr $ACC0, #-1 +0266 02df ret +} + +void 0267_Synth3() +{ +0267 1401 lsl $ACC0, #1 +0268 009b c000 lri $AX1.H, #0xc000 +026a 0099 4000 lri $AX1.L, #0x4000 +026c 1150 0274 bloopi #0x50, 0x0274 +{ + 026e 02c0 0003 andcf $AC0.M, #0x0003 + 0270 027c iflnz + 0271 1b1b srri @$AR0, $AX1.H + 0272 027d iflz + 0273 1b19 srri @$AR0, $AX1.L + 0274 4800 addax $ACC0, $AX0 +} +0275 147f lsr $ACC0, #-1 +0276 02df ret +} + +void 0277_Synth2() +{ +0277 1401 lsl $ACC0, #1 +0278 0081 0ca0 lri $AR1, #0x0ca0 +027a 009b c000 lri $AX1.H, #0xc000 +027c 0099 4000 lri $AX1.L, #0x4000 +027e 8900 clr $ACC1 +027f 0082 0000 lri $AR2, #0x0000 +0281 1150 028c bloopi #0x50, 0x028c +{ + 0283 02c0 0001 andcf $AC0.M, #0x0001 + 0285 027c iflnz + 0286 1b1b srri @$AR0, $AX1.H + 0287 027d iflz + 0288 1b19 srri @$AR0, $AX1.L + 0289 183d lrr $AC1.L, @$AR1 + 028a 4900 addax $ACC1, $AX0 + 028b 1fe2 mrr $AC1.M, $AR2 + 028c 4c39 add's $ACC0, $ACC1 : @$AR1, $AC1.M +} +028d 147f lsr $ACC0, #-1 +028e 02df ret +} + +void 028f_Synth1() +{ +028f 1050 loopi #0x50 + 0290 4820 addax's $ACC0, $AX0 : @$AR0, $AC0.L +0291 02df ret +} + +void 0292_Synth4() +{ +0292 0082 0140 lri $AR2, #0x0140 +0294 008a 003f lri $WR2, #0x003f +0296 0086 0000 lri $IX2, #0x0000 +0298 1406 lsl $ACC0, #6 +0299 8900 clr $ACC1 +029a 1fb8 mrr $AC1.L, $AX0.L +029b 1506 lsl $ACC1, #6 +029c 009b 003f lri $AX1.H, #0x003f +029e 009a 0000 lri $AX0.H, #0x0000 +02a0 3600 andr $AC0.M, $AX1.H +02a1 1cde mrr $IX2, $AC0.M +02a2 001a addarn $AR2, $IX2 +02a3 3400 andr $AC0.M, $AX0.H +02a4 1150 02aa bloopi #0x50, 0x02aa +{ + 02a6 4c00 add $ACC0, $ACC1 + 02a7 364a andr'l $AC0.M, $AX1.H : $AX1.L, @$AR2 + 02a8 1cde mrr $IX2, $AC0.M + 02a9 340e andr'nr $AC0.M, $AX0.H : $AR2 + 02aa 1b19 srri @$AR0, $AX1.L +} +02ab 1fc2 mrr $AC0.M, $AR2 +02ac 147a lsr $ACC0, #-6 +02ad 02df ret +} + +void 02b1_Synth7() +{ +02ae 1050 loopi #0x50 + 02af 1b18 srri @$AR0, $AX0.L +02b0 02df ret +} + +void 02b1_Synth6() +{ +02b1 0083 0000 lri $AR3, #0x0000 +02b3 140f lsl $ACC0, #15 +02b4 4853 addax'l $ACC0, $AX0 : $AX0.H, @$AR3 +02b5 1114 02ba bloopi #0x14, 0x02ba +{ + 02b7 48a2 addax'sl $ACC0, $AX0 : $AC0.M, $AX0.H + 02b8 48a2 addax'sl $ACC0, $AX0 : $AC0.M, $AX0.H + 02b9 48a2 addax'sl $ACC0, $AX0 : $AC0.M, $AX0.H + 02ba 48a2 addax'sl $ACC0, $AX0 : $AC0.M, $AX0.H +} +02bb 146f lsr $ACC0, #-17 +02bc 02df ret +} + +{ +02bd 0080 0380 lri $AR0, #0x0380 +02bf 02bf 0051 call 0x0051 +02c1 02bf 0051 call 0x0051 +02c3 02bf 0051 call 0x0051 +02c5 02bf 0051 call 0x0051 +02c7 0081 0382 lri $AR1, #0x0382 +02c9 009f 0000 lri $AC1.M, #0x0000 +02cb 0080 0200 lri $AR0, #0x0200 +02cd 02bf 007c call 0x007c +02cf 0081 0384 lri $AR1, #0x0384 +02d1 009f 0300 lri $AC1.M, #0x0300 +02d3 0080 0020 lri $AR0, #0x0020 +02d5 02bf 007c call 0x007c +02d7 02bf 0351 call 0x0351 +02d9 00de 0345 lr $AC0.M, @0x0345 +02db 00fe 0342 sr @0x0342, $AC0.M +02dd 029f 0049 jmp 0x0049 +} + +{ +02df 00de 0344 lr $AC0.M, @0x0344 +02e1 1404 lsl $ACC0, #4 +02e2 0200 03a8 addi $AC0.M, #0x03a8 +02e4 1c1e mrr $AR0, $AC0.M +02e5 02bf 0051 call 0x0051 +02e7 02bf 0051 call 0x0051 +02e9 02bf 0051 call 0x0051 +02eb 00de 0345 lr $AC0.M, @0x0345 +02ed 1b1e srri @$AR0, $AC0.M +02ee 00de 0344 lr $AC0.M, @0x0344 +02f0 0200 03a4 addi $AC0.M, #0x03a4 +02f2 1c1e mrr $AR0, $AC0.M +02f3 8100 clr $ACC0 +02f4 1b1e srri @$AR0, $AC0.M +02f5 02df ret +} + +{ +02f6 00de 0344 lr $AC0.M, @0x0344 +02f8 1404 lsl $ACC0, #4 +02f9 0200 03b0 addi $AC0.M, #0x03b0 +02fb 1c1e mrr $AR0, $AC0.M +02fc 02bf 0051 call 0x0051 +02fe 02bf 0051 call 0x0051 +0300 02bf 0051 call 0x0051 +0302 02bf 0051 call 0x0051 +0304 02df ret +} + +{ +0305 0081 034c lri $AR1, #0x034c +0307 009f 0400 lri $AC1.M, #0x0400 +0309 0080 0080 lri $AR0, #0x0080 +030b 02bf 007c call 0x007c +030d 02df ret +} + +{ +030e 0081 034c lri $AR1, #0x034c +0310 009f 0a00 lri $AC1.M, #0x0a00 +0312 0080 0004 lri $AR0, #0x0004 +0314 02bf 00a5 call 00a5_WaitForDMAend() +0316 02bf 007c call 0x007c +0318 0081 034c lri $AR1, #0x034c +031a 009f 0400 lri $AC1.M, #0x0400 +031c 0080 0080 lri $AR0, #0x0080 +031e 02bf 0095 call 0x0095 +0320 02df ret +} + +{ +0321 0081 034c lri $AR1, #0x034c +0323 009f 0400 lri $AC1.M, #0x0400 +0325 0080 0040 lri $AR0, #0x0040 +0327 0081 034c lri $AR1, #0x034c +0329 193e lrri $AC0.M, @$AR1 +032a 193c lrri $AC0.L, @$AR1 +032b 0098 0000 lri $AX0.L, #0x0000 +032d 7000 addaxl $ACC0, $AX0.L +032e 02bf 008b call 0x008b +0330 02df ret +} + +{ +0331 191e lrri $AC0.M, @$AR0 +0332 191a lrri $AX0.H, @$AR0 +0333 005f loop $AC1.M +0334 64a0 movr'ls $ACC0, $AX0.H : $AX0.H, $AC0.M +0335 1b7e srri @$AR3, $AC0.M +0336 1b7a srri @$AR3, $AX0.H +0337 02df ret +} + +{ +0338 191e lrri $AC0.M, @$AR0 +0339 191a lrri $AX0.H, @$AR0 +033a 007f 033f bloop $AC1.M, 0x033f +{ + 033c 32b2 not's $AC0.M : @$AR2, $AC0.M + 033d 65a0 movr'ls $ACC1, $AX0.H : $AX0.H, $AC0.M + 033e 33ba not's $AC1.M : @$AR2, $AC1.M + 033f 64a1 movr'ls $ACC0, $AX0.H : $AX0.H, $AC1.M +} +0340 0000 nop +0341 02df ret +} + +{ +0342 8a00 m2 +0343 157f lsr $ACC1, #-1 +0344 1c20 mrr $AR1, $AR0 +0345 1c03 mrr $AR0, $AR3 +0346 193a lrri $AX0.H, @$AR1 +0347 9051 mul'l $AX0.L, $AX0.H : $AX0.H, @$AR1 +0348 925b mulmvz'l $AX0.L, $AX0.H, $ACC0 : $AX1.H, @$AR3 +0349 007f 034e bloop $AC1.M, 0x034e +{ + 034b 4651 addr'l $ACC0, $AX1.H : $AX0.H, @$AR1 + 034c 92b2 mulmvz'sl $AX0.L, $AX0.H, $ACC0 : $AC0.M, $AX1.H + 034d 4651 addr'l $ACC0, $AX1.H : $AX0.H, @$AR1 + 034e 92b2 mulmvz'sl $AX0.L, $AX0.H, $ACC0 : $AC0.M, $AX1.H +} +034f 8b00 m0 +0350 02df ret +} + +{ +0351 0083 ffa0 lri $AR3, #0xffa0 +0353 0080 0300 lri $AR0, #0x0300 +0355 009f 000e lri $AC1.M, #0x000e +0357 1108 035c bloopi #0x08, 0x035c +{ + 0359 191e lrri $AC0.M, @$AR0 + 035a 1b7e srri @$AR3, $AC0.M + 035b 191e lrri $AC0.M, @$AR0 + 035c 1b7e srri @$AR3, $AC0.M +} +035d 02df ret +} + +{ +035e 0080 0f40 lri $AR0, #0x0f40 +0360 0082 0d00 lri $AR2, #0x0d00 +0362 0083 0d60 lri $AR3, #0x0d60 +0364 009f 0028 lri $AC1.M, #0x0028 +0366 02bf 0338 call 0x0338 +0368 8900 clr $ACC1 +0369 009e 0050 lri $AC0.M, #0x0050 +036b 0080 0ca0 lri $AR0, #0x0ca0 +036d 005e loop $AC0.M + 036e 1b1f srri @$AR0, $AC1.M +036f 0080 0f40 lri $AR0, #0x0f40 +0371 005e loop $AC0.M + 0372 1b1f srri @$AR0, $AC1.M +0373 0080 0fa0 lri $AR0, #0x0fa0 +0375 005e loop $AC0.M + 0376 1b1f srri @$AR0, $AC1.M +0377 02df ret +} + +{ +0378 0080 0dc0 lri $AR0, #0x0dc0 +037a 009e 0180 lri $AC0.M, #0x0180 +037c 8900 clr $ACC1 +037d 005e loop $AC0.M + 037e 1b1f srri @$AR0, $AC1.M +037f 02df ret +} + +{ +0380 00c0 03a0 lr $AR0, @0x03a0 +0382 191a lrri $AX0.H, @$AR0 +0383 00df 03a1 lr $AC1.M, @0x03a1 +0385 009b 00a0 lri $AX1.H, #0x00a0 +0387 0081 0393 lri $AR1, #0x0393 +0389 18bc lrrd $AC0.L, @$AR1 +038a b871 mulx'l $AX0.H, $AX1.H : $AC0.M, @$AR1 +038b bc00 mulxac $AX0.H, $AX1.H, $ACC0 +038c 0080 0050 lri $AR0, #0x0050 +038e 0508 addis $AC1.M, #0x08 +038f 02bf 007e call 0x007e +0391 00de 0390 lr $AC0.M, @0x0390 +0393 02a0 0001 andf $AC0.M, #0x0001 +0395 029d 039f jlz 0x039f +0397 0080 0398 lri $AR0, #0x0398 +0399 009e 0008 lri $AC0.M, #0x0008 +039b 00c1 03a1 lr $AR1, @0x03a1 +039d 02bf 01bc call 0x01bc +039f 009f 0050 lri $AC1.M, #0x0050 +03a1 00c0 03a1 lr $AR0, @0x03a1 +03a3 8100 clr $ACC0 +03a4 00de 0394 lr $AC0.M, @0x0394 +03a6 b100 tst $ACC0 +03a7 0295 03ae jz 0x03ae +03a9 1c7e mrr $AR3, $AC0.M +03aa 00d8 0395 lr $AX0.L, @0x0395 +03ac 02bf 0342 call 0x0342 +03ae 009f 0050 lri $AC1.M, #0x0050 +03b0 00c0 03a1 lr $AR0, @0x03a1 +03b2 8100 clr $ACC0 +03b3 00de 0396 lr $AC0.M, @0x0396 +03b5 b100 tst $ACC0 +03b6 0295 03bd jz 0x03bd +03b8 1c7e mrr $AR3, $AC0.M +03b9 00d8 0397 lr $AX0.L, @0x0397 +03bb 02bf 0342 call 0x0342 +03bd 00de 0390 lr $AC0.M, @0x0390 +03bf 02a0 0002 andf $AC0.M, #0x0002 +03c1 02dd retlz +03c2 0080 0398 lri $AR0, #0x0398 +03c4 009e 0008 lri $AC0.M, #0x0008 +03c6 00c1 03a1 lr $AR1, @0x03a1 +03c8 02bf 01bc call 0x01bc +03ca 02df ret +} + +{ +03cb 009f 0dc0 lri $AC1.M, #0x0dc0 +03cd 00ff 03a1 sr @0x03a1, $AC1.M +03cf 009f 03a8 lri $AC1.M, #0x03a8 +03d1 00ff 03a2 sr @0x03a2, $AC1.M +03d3 009f 03a4 lri $AC1.M, #0x03a4 +03d5 00ff 03a0 sr @0x03a0, $AC1.M +03d7 1104 0400 bloopi #0x04, 0x0400 +{ + 03d9 00c0 03a2 lr $AR0, @0x03a2 + 03db 0083 0390 lri $AR3, #0x0390 + 03dd 009f 000e lri $AC1.M, #0x000e + 03df 02bf 0331 call 0x0331 + 03e1 00da 0390 lr $AX0.H, @0x0390 + 03e3 8600 tstaxh $AX0.H + 03e4 0295 03f1 jz 0x03f1 + 03e6 00df 03a1 lr $AC1.M, @0x03a1 + 03e8 1c7f mrr $AR3, $AC1.M + 03e9 0550 addis $AC1.M, #0x50 + 03ea 1c1f mrr $AR0, $AC1.M + 03eb 009f 0006 lri $AC1.M, #0x0006 + 03ed 02bf 0331 call 0x0331 + 03ef 02bf 0380 call 0x0380 + 03f1 00de 03a2 lr $AC0.M, @0x03a2 + 03f3 0410 addis $AC0.M, #0x10 + 03f4 00fe 03a2 sr @0x03a2, $AC0.M + 03f6 00de 03a1 lr $AC0.M, @0x03a1 + 03f8 0460 addis $AC0.M, #0x60 + 03f9 00fe 03a1 sr @0x03a1, $AC0.M + 03fb 00de 03a0 lr $AC0.M, @0x03a0 + 03fd 7400 incm $AC0.M + 03fe 00fe 03a0 sr @0x03a0, $AC0.M + 0400 0000 nop +} +0401 02df ret +} + +{ +0402 00c0 03a0 lr $AR0, @0x03a0 +0404 181a lrr $AX0.H, @$AR0 +0405 8100 clr $ACC0 +0406 181e lrr $AC0.M, @$AR0 +0407 00db 0391 lr $AX1.H, @0x0391 +0409 7400 incm $AC0.M +040a d100 cmpar $ACC1, $AX0.H +040b 0270 ifge +040c 8100 clr $ACC0 +040d 1b1e srri @$AR0, $AC0.M +040e 00df 03a1 lr $AC1.M, @0x03a1 +0410 009b 00a0 lri $AX1.H, #0x00a0 +0412 0081 0393 lri $AR1, #0x0393 +0414 18bc lrrd $AC0.L, @$AR1 +0415 b871 mulx'l $AX0.H, $AX1.H : $AC0.M, @$AR1 +0416 bc00 mulxac $AX0.H, $AX1.H, $ACC0 +0417 0080 0050 lri $AR0, #0x0050 +0419 02bf 008b call 0x008b +041b 02df ret +} + +{ +041c 009f 0dc0 lri $AC1.M, #0x0dc0 +041e 00ff 03a1 sr @0x03a1, $AC1.M +0420 009f 03a8 lri $AC1.M, #0x03a8 +0422 00ff 03a2 sr @0x03a2, $AC1.M +0424 009f 03a4 lri $AC1.M, #0x03a4 +0426 00ff 03a0 sr @0x03a0, $AC1.M +0428 1104 0448 bloopi #0x04, 0x0448 +{ + 042a 00c0 03a2 lr $AR0, @0x03a2 + 042c 0083 0390 lri $AR3, #0x0390 + 042e 009f 000e lri $AC1.M, #0x000e + 0430 02bf 0331 call 0x0331 + 0432 00da 0390 lr $AX0.H, @0x0390 + 0434 8600 tstaxh $AX0.H + 0435 0295 0439 jz 0x0439 + 0437 02bf 0402 call 0x0402 + 0439 00de 03a2 lr $AC0.M, @0x03a2 + 043b 0410 addis $AC0.M, #0x10 + 043c 00fe 03a2 sr @0x03a2, $AC0.M + 043e 00de 03a1 lr $AC0.M, @0x03a1 + 0440 0460 addis $AC0.M, #0x60 + 0441 00fe 03a1 sr @0x03a1, $AC0.M + 0443 00de 03a0 lr $AC0.M, @0x03a0 + 0445 7400 incm $AC0.M + 0446 00fe 03a0 sr @0x03a0, $AC0.M + 0448 0000 nop +} +0449 02df ret +} + +{ +044a 0081 0386 lri $AR1, #0x0386 +044c 009f 03a8 lri $AC1.M, #0x03a8 +044e 0080 0040 lri $AR0, #0x0040 +0450 02bf 007c call 0x007c +0452 02df ret +} + +{ +0453 191e lrri $AC0.M, @$AR0 +0454 189c lrrd $AC0.L, @$AR0 +0455 4800 addax $ACC0, $AX0 +0456 1b1e srri @$AR0, $AC0.M +0457 1b1c srri @$AR0, $AC0.L +0458 02df ret +0459 8100 clr $ACC0 +045a 26fe lrs $AC0.M, @CMBH +045b 02c0 8000 andcf $AC0.M, #0x8000 +045d 029c 045a jlnz 0x045a +045f 26ff lrs $AC0.M, @CMBL +0460 02df ret +} + +{ +0461 0080 0388 lri $AR0, #0x0388 +0463 0081 0051 lri $AR1, #0x0051 +0465 173f callr $AR1 // call 0x0051 +0466 00de 0344 lr $AC0.M, @0x0344 +0468 00fe 0341 sr @0x0341, $AC0.M +046a 00de 0345 lr $AC0.M, @0x0345 +046c 00fe 038e sr @0x038e, $AC0.M +046e 173f callr $AR1 // call 0x0051 +046f 02df ret +} + +{ +0470 02bf 0461 call 0x0461 +0472 009e 8000 lri $AC0.M, #0x8000 +0474 00dc 0341 lr $AC0.L, @0x0341 +0476 02bf 005a call 005a_SendMail(AC0.M,AC0.L) // 0x8000???? +0478 8100 clr $ACC0 +0479 00fe 0355 sr @0x0355, $AC0.M +047b 02bf 044a call 0x044a +047d 00de 0341 lr $AC0.M, @0x0341 +047f 007e 056c bloop $AC0.M, 0x056c +{ + 0481 02bf 035e call 0x035e + 0483 02bf 03cb call 0x03cb + 0485 02bf 0459 call 0x0459 + 0487 8100 clr $ACC0 + 0488 00fe 0354 sr @0x0354, $AC0.M + 048a 00de 0342 lr $AC0.M, @0x0342 + 048c 007e 0538 bloop $AC0.M, 0x0538 + { + 048e 00d8 0354 lr $AX0.L, @0x0354 + 0490 009a 0100 lri $AX0.H, #0x0100 + 0492 8100 clr $ACC0 + 0493 00de 0380 lr $AC0.M, @0x0380 + 0495 00dc 0381 lr $AC0.L, @0x0381 + 0497 9000 mul $AX0.L, $AX0.H + 0498 9400 mulac $AX0.L, $AX0.H, $ACC0 + 0499 00fe 034c sr @0x034c, $AC0.M + 049b 00fc 034d sr @0x034d, $AC0.L + 049d 02bf 0305 call 0x0305 + 049f 00da 0400 lr $AX0.H, @0x0400 + 04a1 8600 tstaxh $AX0.H + 04a2 0295 0533 jz 0x0533 + 04a4 00da 0401 lr $AX0.H, @0x0401 + 04a6 8600 tstaxh $AX0.H + 04a7 0294 0533 jnz 0x0533 + 04a9 00da 0406 lr $AX0.H, @0x0406 + 04ab 8600 tstaxh $AX0.H + 04ac 0294 0930 jnz 0x0930 + 04ae 8100 clr $ACC0 + 04af 00de 0440 lr $AC0.M, @0x0440 + 04b1 0607 cmpis $AC0.M, #0x07 // format 0x7 or less (Synths) + 04b2 0293 0231 jle 0x0231 + 04b4 0620 cmpis $AC0.M, #0x20 // format 0x20 + 04b5 0295 079e jz 0x079e + 04b7 0621 cmpis $AC0.M, #0x21 // format 0x21 + 04b8 0295 07a7 jz 0x07a7 + 04ba 00d8 0402 lr $AX0.L, @0x0402 + 04bc 8100 clr $ACC0 + 04bd 8900 clr $ACC1 + 04be 00dc 0418 lr $AC0.L, @0x0418 + 04c0 8d00 set15 + 04c1 0099 0050 lri $AX1.L, #0x0050 + 04c3 a000 mulx $AX0.L, $AX1.L + 04c4 a400 mulxac $AX0.L, $AX1.L, $ACC0 + 04c5 1404 lsl $ACC0, #4 + 04c6 8c00 clr15 + 04c7 1ffe mrr $AC1.M, $AC0.M + 04c8 0083 0580 lri $AR3, #0x0580 + 04ca 00da 0441 lr $AX0.H, @0x0441 + 04cc 8600 tstaxh $AX0.H + 04cd 0295 04dd jz 0x04dd + 04cf 00da 0449 lr $AX0.H, @0x0449 + 04d1 8100 clr $ACC0 + 04d2 00de 044b lr $AC0.M, @0x044b + 04d4 3800 orr $AC0.M, $AX0.H + 04d5 0240 000f andi $AC0.M, #0x000f + 04d7 0295 04dd jz 0x04dd + 04d9 02bf 06a6 call 0x06a6 + 04db 029f 04df jmp 0x04df + 04dd 02bf 0837 call 0x0837 + //RAW21-jmp + 04df 0080 0580 lri $AR0, #0x0580 + 04e1 0081 0520 lri $AR1, #0x0520 + 04e3 0099 0000 lri $AX1.L, #0x0000 + 04e5 02bf 013b call 0x013b + //RAW20-jmp + 04e7 0080 0450 lri $AR0, #0x0450 + 04e9 0081 0520 lri $AR1, #0x0520 + 04eb 0082 0428 lri $AR2, #0x0428 + 04ed 0083 0453 lri $AR3, #0x0453 + 04ef 18fa lrrd $AX0.H, @$AR3 + 04f0 8600 tstaxh $AX0.H + 04f1 0294 0501 jnz 0x0501 + 04f3 18fa lrrd $AX0.H, @$AR3 + 04f4 8600 tstaxh $AX0.H + 04f5 0294 0501 jnz 0x0501 + 04f7 18fa lrrd $AX0.H, @$AR3 + 04f8 8600 tstaxh $AX0.H + 04f9 0294 0501 jnz 0x0501 + 04fb 8100 clr $ACC0 + 04fc 18fe lrrd $AC0.M, @$AR3 + 04fd 0280 7fff cmpi $AC0.M, #0x7fff + 04ff 0295 0505 jz 0x0505 + 0501 02bf 01d1 call 0x01d1 + 0503 029f 0505 jmp 0x0505 + 0505 8100 clr $ACC0 + 0506 1c9e mrr $IX0, $AC0.M + 0507 1cde mrr $IX2, $AC0.M + 0508 7400 incm $AC0.M + 0509 1cfe mrr $IX3, $AC0.M + 050a 8f00 set40 + 050b 0086 0002 lri $IX2, #0x0002 + 050d 0082 0408 lri $AR2, #0x0408 + 050f 1104 052f bloopi #0x04, 0x052f + { + 0511 8100 clr $ACC0 + 0512 195e lrri $AC0.M, @$AR2 + 0513 1200 sbclr #0x00 + 0514 b100 tst $ACC0 + 0515 0275 ifz + 0516 1300 sbset #0x00 + 0517 1c7e mrr $AR3, $AC0.M + 0518 195e lrri $AC0.M, @$AR2 + 0519 14fa asr $ACC0, #-6 + 051a 1f5e mrr $AX0.H, $AC0.M + 051b 1f1c mrr $AX0.L, $AC0.L + 051c 185f lrr $AC1.M, @$AR2 + 051d 0080 0520 lri $AR0, #0x0520 + 051f 029d 0523 jlz 0x0523 + 0521 02bf 011e call 0x011e + 0523 1b5f srri @$AR2, $AC1.M + 0524 8100 clr $ACC0 + 0525 185e lrr $AC0.M, @$AR2 + 0526 000e xar $AR2 + //; *** UNKNOWN OPCODE *** + // 0xc/0xd/0xe/0xf is one opcode where last 2 bits define target $AR? reg + // (new value is based on orig $AR? and %WR? reg value = unknown) + 0527 b100 tst $ACC0 + 0528 0274 ifnz + 0529 7800 decm $AC0.M + 052a b100 tst $ACC0 + 052b 8900 clr $ACC1 + 052c 0275 ifz + 052d 1a5f srr @$AR2, $AC1.M + 052e 001a addarn $AR2, $IX2 + 052f 1b5e srri @$AR2, $AC0.M + } + 0530 8e00 set16 + 0531 02bf 0321 call 0x0321 + 0533 00de 0354 lr $AC0.M, @0x0354 + 0535 7400 incm $AC0.M + 0536 00fe 0354 sr @0x0354, $AC0.M + 0538 0000 nop + } + 0539 16fb 0001 si @DIRQ, #0x0001 + 053b 0083 0d00 lri $AR3, #0x0d00 + 053d 02bf 012a call 0x012a + 053f 0081 0388 lri $AR1, #0x0388 + 0541 009f 0d00 lri $AC1.M, #0x0d00 + 0543 0080 0050 lri $AR0, #0x0050 + 0545 02bf 0089 call 0x0089 + 0547 0080 0fa0 lri $AR0, #0x0fa0 + 0549 0083 0d60 lri $AR3, #0x0d60 + 054b 009f 0050 lri $AC1.M, #0x0050 + 054d 0098 8000 lri $AX0.L, #0x8000 + 054f 02bf 0342 call 0x0342 + 0551 0083 0d60 lri $AR3, #0x0d60 + 0553 02bf 012a call 0x012a + 0555 0081 038a lri $AR1, #0x038a + 0557 009f 0d60 lri $AC1.M, #0x0d60 + 0559 0080 0050 lri $AR0, #0x0050 + 055b 02bf 0089 call 0x0089 + 055d 009a 0000 lri $AX0.H, #0x0000 + 055f 0098 00a0 lri $AX0.L, #0x00a0 + 0561 0080 0388 lri $AR0, #0x0388 + 0563 02bf 0453 call 0x0453 + 0565 0080 038a lri $AR0, #0x038a + 0567 02bf 0453 call 0x0453 + 0569 02bf 041c call 0x041c + 056b 0000 nop + 056c 0000 nop +} +056d 029f 0031 jmp 0x0031 +} + +{ +056f 0080 0346 lri $AR0, #0x0346 +0571 02bf 0051 call 0x0051 +0573 02bf 0051 call 0x0051 +0575 0081 0346 lri $AR1, #0x0346 +0577 193e lrri $AC0.M, @$AR1 +0578 193c lrri $AC0.L, @$AR1 +0579 009f 0400 lri $AC1.M, #0x0400 +057b 00c0 0345 lr $AR0, @0x0345 +057d 02bf 007e call 0x007e +057f 0081 0348 lri $AR1, #0x0348 +0581 193e lrri $AC0.M, @$AR1 +0582 193c lrri $AC0.L, @$AR1 +0583 009f 0800 lri $AC1.M, #0x0800 +0585 00c0 0345 lr $AR0, @0x0345 +0587 02bf 007e call 0x007e +0589 0081 0346 lri $AR1, #0x0346 +058b 193e lrri $AC0.M, @$AR1 +058c 193c lrri $AC0.L, @$AR1 +058d 009f 0800 lri $AC1.M, #0x0800 +058f 00c0 0345 lr $AR0, @0x0345 +0591 02bf 008b call 0x008b +0593 0081 0348 lri $AR1, #0x0348 +0595 193e lrri $AC0.M, @$AR1 +0596 193c lrri $AC0.L, @$AR1 +0597 009f 0400 lri $AC1.M, #0x0400 +0599 00c0 0345 lr $AR0, @0x0345 +059b 02bf 008b call 0x008b +059d 029f 0049 jmp 0x0049 +} + +{ +059f 0080 0346 lri $AR0, #0x0346 +05a1 02bf 0051 call 0x0051 +05a3 02bf 0051 call 0x0051 +05a5 0081 0346 lri $AR1, #0x0346 +05a7 193e lrri $AC0.M, @$AR1 +05a8 193c lrri $AC0.L, @$AR1 +05a9 009f 0400 lri $AC1.M, #0x0400 +05ab 00c0 0345 lr $AR0, @0x0345 +05ad 02bf 007e call 0x007e +05af 0081 0348 lri $AR1, #0x0348 +05b1 193e lrri $AC0.M, @$AR1 +05b2 193c lrri $AC0.L, @$AR1 +05b3 009f 0400 lri $AC1.M, #0x0400 +05b5 00c0 0345 lr $AR0, @0x0345 +05b7 02bf 008b call 0x008b +05b9 029f 0049 jmp 0x0049 +} + +{ +05bb 0080 0346 lri $AR0, #0x0346 +05bd 02bf 0051 call 0x0051 +05bf 02bf 0051 call 0x0051 +05c1 0081 0346 lri $AR1, #0x0346 +05c3 193e lrri $AC0.M, @$AR1 +05c4 193c lrri $AC0.L, @$AR1 +05c5 009f 0400 lri $AC1.M, #0x0400 +05c7 00c0 0345 lr $AR0, @0x0345 +05c9 02bf 00ae call 0x00ae +05cb 0081 0348 lri $AR1, #0x0348 +05cd 193e lrri $AC0.M, @$AR1 +05ce 193c lrri $AC0.L, @$AR1 +05cf 009f 0400 lri $AC1.M, #0x0400 +05d1 00c0 0345 lr $AR0, @0x0345 +05d3 02bf 008b call 0x008b +05d5 029f 0049 jmp 0x0049 +} + +{ +05d7 0080 0346 lri $AR0, #0x0346 +05d9 02bf 0051 call 0x0051 +05db 02bf 0051 call 0x0051 +05dd 0081 0346 lri $AR1, #0x0346 +05df 193e lrri $AC0.M, @$AR1 +05e0 193c lrri $AC0.L, @$AR1 +05e1 009f 0400 lri $AC1.M, #0x0400 +05e3 00c0 0344 lr $AR0, @0x0344 +05e5 02bf 007e call 0x007e +05e7 0081 0348 lri $AR1, #0x0348 +05e9 193e lrri $AC0.M, @$AR1 +05ea 193c lrri $AC0.L, @$AR1 +05eb 009f 0800 lri $AC1.M, #0x0800 +05ed 00c0 0344 lr $AR0, @0x0344 +05ef 02bf 007e call 0x007e +05f1 0080 0400 lri $AR0, #0x0400 +05f3 0083 0800 lri $AR3, #0x0800 +05f5 0084 0000 lri $IX0, #0x0000 +05f7 00da 0345 lr $AX0.H, @0x0345 +05f9 00df 0344 lr $AC1.M, @0x0344 +05fb 8f00 set40 +05fc 197b lrri $AX1.H, @$AR3 +05fd b800 mulx $AX0.H, $AX1.H +05fe 197b lrri $AX1.H, @$AR3 +05ff 007f 0604 bloop $AC1.M, 0x0604 +0601 199e lrrn $AC0.M, @$AR0 +0602 bc00 mulxac $AX0.H, $AX1.H, $ACC0 +0603 80b2 nx'sl : $AC0.M, $AX1.H +0604 0000 nop +0605 8e00 set16 +0606 0081 0346 lri $AR1, #0x0346 +0608 193e lrri $AC0.M, @$AR1 +0609 193c lrri $AC0.L, @$AR1 +060a 009f 0400 lri $AC1.M, #0x0400 +060c 00c0 0344 lr $AR0, @0x0344 +060e 02bf 008b call 0x008b +0610 009e 8200 lri $AC0.M, #0x8200 +0612 00dc 0344 lr $AC0.L, @0x0344 +0614 02bf 005a call 005a_SendMail(AC0.M,AC0.L) // 0x8200???? +0616 029f 0031 jmp 0x0031 +} + +{ +0618 0080 0346 lri $AR0, #0x0346 +061a 02bf 0051 call 0x0051 +061c 0081 0346 lri $AR1, #0x0346 +061e 009f 0400 lri $AC1.M, #0x0400 +0620 00c0 0345 lr $AR0, @0x0345 +0622 02bf 007c call 0x007c +0624 02bf 8644 call 0x8644 // iROM!!!! +0626 029f 0049 jmp 0x0049 +} + +{ +0628 009e 0430 lri $AC0.M, #0x0430 +062a 2219 lrs $AX0.H, @0x0019 +062b 4400 addr $ACC0, $AX0.H +062c 1c1e mrr $AR0, $AC0.M +062d 1fda mrr $AC0.M, $AX0.H +062e 3280 not $AC0.M +062f 7400 incm $AC0.M +0630 221a lrs $AX0.H, @0x001a +0631 4400 addr $ACC0, $AX0.H +0632 0090 0000 lri $AC0.H, #0x0000 +0634 029f 0645 jmp 0x0645 +} + +{ +0636 009e 0430 lri $AC0.M, #0x0430 +0638 2219 lrs $AX0.H, @0x0019 +0639 4400 addr $ACC0, $AX0.H +063a 1c1e mrr $AR0, $AC0.M +063b 1fda mrr $AC0.M, $AX0.H +063c 3280 not $AC0.M +063d 7400 incm $AC0.M +063e 221a lrs $AX0.H, @0x001a +063f 4400 addr $ACC0, $AX0.H +0640 0090 0000 lri $AC0.H, #0x0000 +0642 8200 cmp +0643 0270 ifge +0644 1fdf mrr $AC0.M, $AC1.M +0645 1f3e mrr $AX1.L, $AC0.M +0646 02bf 0699 call 0x0699 +0648 261c lrs $AC0.M, @0x001c +0649 241d lrs $AC0.L, @0x001d +064a 7200 addaxl $ACC0, $AX1.L +064b 5300 subr $ACC1, $AX1.L +064c 2e1c srs @0x001c, $AC0.M +064d 2c1d srs @0x001d, $AC0.L +064e 02df ret +} + +{ +064f 8100 clr $ACC0 +0650 221c lrs $AX0.H, @0x001c +0651 201d lrs $AX0.L, @0x001d +0652 4800 addax $ACC0, $AX0 +0653 147c lsr $ACC0, #-4 +0654 2e1e srs @0x001e, $AC0.M +0655 2c1f srs @0x001f, $AC0.L +0656 2340 lrs $AX1.H, @0x0040 +0657 c814 mulc'mv $AC0.M, $AX1.H : $AX1.L, $AC0.L +0658 9e00 mulmv $AX1.L, $AX1.H, $ACC0 +0659 f000 lsl16 $ACC0 +065a 4e00 addp $ACC0 +065b 234c lrs $AX1.H, @0x004c +065c 214d lrs $AX1.L, @0x004d +065d 4a00 addax $ACC0, $AX1 +065e 2e20 srs @0x0020, $AC0.M +065f 2c21 srs @0x0021, $AC0.L +0660 1fd8 mrr $AC0.M, $AX0.L +0661 0240 000f andi $AC0.M, #0x000f +0663 2e19 srs @0x0019, $AC0.M +0664 264a lrs $AC0.M, @0x004a +0665 244b lrs $AC0.L, @0x004b +0666 5800 subax $ACC0, $AX0 +0667 2e22 srs @0x0022, $AC0.M +0668 2c23 srs @0x0023, $AC0.L +0669 02df ret +} + +{ +066a 221e lrs $AX0.H, @0x001e +066b 201f lrs $AX0.L, @0x001f +066c 8100 clr $ACC0 +066d 264a lrs $AC0.M, @0x004a +066e 244b lrs $AC0.L, @0x004b +066f 147c lsr $ACC0, #-4 +0670 5800 subax $ACC0, $AX0 +0671 0295 067a jz 0x067a +0673 02bf 06ec call 0x06ec +0675 0e10 lris $AC0.M, #0x10 +0676 2e1a srs @0x001a, $AC0.M +0677 8100 clr $ACC0 +0678 2e19 srs @0x0019, $AC0.M +0679 02df ret +} + +{ +067a 224a lrs $AX0.H, @0x004a +067b 204b lrs $AX0.L, @0x004b +067c 8100 clr $ACC0 +067d 261c lrs $AC0.M, @0x001c +067e 241d lrs $AC0.L, @0x001d +067f 5800 subax $ACC0, $AX0 +0680 0290 0687 jge 0x0687 +0682 02bf 06ec call 0x06ec +0684 2623 lrs $AC0.M, @0x0023 +0685 029f 0676 jmp 0x0676 +} + +{ +0687 2648 lrs $AC0.M, @0x0048 +0688 2449 lrs $AC0.L, @0x0049 +0689 2e1c srs @0x001c, $AC0.M +068a 2c1d srs @0x001d, $AC0.L +068b 0e10 lris $AC0.M, #0x10 +068c 2e1a srs @0x001a, $AC0.M +068d 02bf 064f call 0x064f +068f 2642 lrs $AC0.M, @0x0042 +0690 2e3f srs @0x003f, $AC0.M +0691 2643 lrs $AC0.M, @0x0043 +0692 2e3e srs @0x003e, $AC0.M +0693 8100 clr $ACC0 +0694 00fe 0362 sr @0x0362, $AC0.M +0696 02bf 06ec call 0x06ec +0698 02df ret +} + +{ +0699 b100 tst $ACC0 +069a 02d5 retz +069b 04fe addis $AC0.M, #0xfe +069c 1f1e mrr $AX0.L, $AC0.M +069d 191e lrri $AC0.M, @$AR0 +069e 0291 06a4 jl 0x06a4 +06a0 191a lrri $AX0.H, @$AR0 +06a1 0058 loop $AX0.L +06a2 64a0 movr'ls $ACC0, $AX0.H : $AX0.H, $AC0.M +06a3 6433 movr's $ACC0, $AX0.H : @$AR3, $AC0.M +06a4 1b7e srri @$AR3, $AC0.M +06a5 02df ret +} + +{ +06a6 0092 0004 lri $CR, #0x0004 +06a8 02bf 064f call 0x064f +06aa 8100 clr $ACC0 +06ab 00fe 0362 sr @0x0362, $AC0.M +06ad 8100 clr $ACC0 +06ae 2622 lrs $AC0.M, @0x0022 +06af 2423 lrs $AC0.L, @0x0023 +06b0 b100 tst $ACC0 +06b1 0294 06c3 jnz 0x06c3 +06b3 02bf 066a call 0x066a +06b5 2219 lrs $AX0.H, @0x0019 +06b6 8600 tstaxh $AX0.H +06b7 0294 06c0 jnz 0x06c0 +06b9 02bf 0636 call 0x0636 +06bb b900 tst $ACC1 +06bc 0295 06e9 jz 0x06e9 +06be 02bf 064f call 0x064f +06c0 8100 clr $ACC0 +06c1 2622 lrs $AC0.M, @0x0022 +06c2 2423 lrs $AC0.L, @0x0023 +06c3 1f1f mrr $AX0.L, $AC1.M +06c4 009a 0000 lri $AX0.H, #0x0000 +06c6 5800 subax $ACC0, $AX0 +06c7 0290 06d6 jge 0x06d6 +06c9 8100 clr $ACC0 +06ca 2619 lrs $AC0.M, @0x0019 +06cb b100 tst $ACC0 +06cc 0294 06d0 jnz 0x06d0 +06ce 02bf 066a call 0x066a +06d0 02bf 0628 call 0x0628 +06d2 02bf 064f call 0x064f +06d4 029f 06ad jmp 0x06ad +} + +{ +06d6 8100 clr $ACC0 +06d7 2619 lrs $AC0.M, @0x0019 +06d8 b100 tst $ACC0 +06d9 0294 06dd jnz 0x06dd +06db 02bf 066a call 0x066a +06dd 02bf 0636 call 0x0636 +06df b900 tst $ACC1 +06e0 0295 06e9 jz 0x06e9 +06e2 02bf 064f call 0x064f +06e4 029f 06d6 jmp 0x06d6 +} + +{ +06e6 8100 clr $ACC0 +06e7 005f loop $AC1.M +06e8 1b7e srri @$AR3, $AC0.M +06e9 0092 00ff lri $CR, #0x00ff +06eb 02df ret +} + +{ +06ec 00ff 0360 sr @0x0360, $AC1.M +06ee 00da 0362 lr $AX0.H, @0x0362 +06f0 8600 tstaxh $AX0.H +06f1 0294 06fe jnz 0x06fe +06f3 0a01 lris $AX0.H, #0x01 +06f4 00fa 0362 sr @0x0362, $AX0.H +06f6 2620 lrs $AC0.M, @0x0020 +06f7 2421 lrs $AC0.L, @0x0021 +06f8 009f 0005 lri $AC1.M, #0x0005 +06fa 02bf 0103 call 0x0103 +06fc 0092 0004 lri $CR, #0x0004 +06fe 0080 ffd3 lri $AR0, #0xffd3 +0700 0084 0000 lri $IX0, #0x0000 +0702 199e lrrn $AC0.M, @$AR0 +0703 1ffe mrr $AC1.M, $AC0.M +0704 1401 lsl $ACC0, #1 +0705 0240 001e andi $AC0.M, #0x001e +0707 0200 0300 addi $AC0.M, #0x0300 +0709 1c3e mrr $AR1, $AC0.M +070a 157c lsr $ACC1, #-4 +070b 0340 000f andi $AC1.M, #0x000f +070d 0a11 lris $AX0.H, #0x11 +070e 5500 subr $ACC1, $AX0.H +070f 009a 00f0 lri $AX0.H, #0x00f0 +0711 009b 000f lri $AX1.H, #0x000f +0713 0082 0370 lri $AR2, #0x0370 +0715 1998 lrrn $AX0.L, @$AR0 +0716 6000 movr $ACC0, $AX0.L +0717 1107 071e bloopi #0x07, 0x071e +{ + 0719 3400 andr $AC0.M, $AX0.H + 071a 1408 lsl $ACC0, #8 + 071b 6032 movr's $ACC0, $AX0.L : @$AR2, $AC0.M + 071c 3644 andr'ln $AC0.M, $AX1.H : $AX0.L, @$AR0 + 071d 140c lsl $ACC0, #12 + 071e 6032 movr's $ACC0, $AX0.L : @$AR2, $AC0.M +} +071f 3400 andr $AC0.M, $AX0.H +0720 1408 lsl $ACC0, #8 +0721 6032 movr's $ACC0, $AX0.L : @$AR2, $AC0.M +0722 3600 andr $AC0.M, $AX1.H +0723 140c lsl $ACC0, #12 +0724 1b5e srri @$AR2, $AC0.M +0725 8f00 set40 +0726 1f7f mrr $AX1.H, $AC1.M +0727 203e lrs $AX0.L, @0x003e +0728 273f lrs $AC1.M, @0x003f +0729 193a lrri $AX0.H, @$AR1 +072a 1939 lrri $AX1.L, @$AR1 +072b 0080 0370 lri $AR0, #0x0370 +072d 0081 0430 lri $AR1, #0x0430 +072f 1c80 mrr $IX0, $AR0 +0730 a000 mulx $AX0.L, $AX1.L +0731 ea70 maddc'l $AC1.M, $AX1.L : $AC0.M, @$AR0 +0732 1108 073b bloopi #0x08, 0x073b +0734 3a93 asrnrx'mv $ACC0, $AX1.H : $AX0.L, $AC1.M +0735 a478 mulxac'l $AX0.L, $AX1.L, $ACC0 : $AC1.M, @$AR0 +0736 1485 asl $ACC0, #5 +0737 e831 maddc's $AC0.M, $AX1.L : @$AR1, $AC0.M +0738 3b92 asrnrx'mv $ACC1, $AX1.H : $AX0.L, $AC0.M +0739 a570 mulxac'l $AX0.L, $AX1.L, $ACC1 : $AC0.M, @$AR0 +073a 1585 asl $ACC1, #5 +073b ea39 maddc's $AC1.M, $AX1.L : @$AR1, $AC1.M +073c 8e00 set16 +073d 8900 clr $ACC1 +073e 00df 0360 lr $AC1.M, @0x0360 +0740 02df ret +} + +{ +0741 0080 0346 lri $AR0, #0x0346 +0743 02bf 0051 call 0x0051 +0745 8100 clr $ACC0 +0746 0080 0430 lri $AR0, #0x0430 +0748 1010 loopi #0x10 + 0749 1b1e srri @$AR0, $AC0.M +074a 00fe 0442 sr @0x0442, $AC0.M +074c 00fe 0443 sr @0x0443, $AC0.M +074e 009c 0000 lri $AC0.L, #0x0000 +0750 00fe 041c sr @0x041c, $AC0.M +0752 00fc 041d sr @0x041d, $AC0.L +0754 009e 0100 lri $AC0.M, #0x0100 +0756 009c f100 lri $AC0.L, #0xf100 +0758 00fe 044e sr @0x044e, $AC0.M +075a 00fc 044f sr @0x044f, $AC0.L +075c 009e 0040 lri $AC0.M, #0x0040 +075e 009c 0000 lri $AC0.L, #0x0000 +0760 00fe 044c sr @0x044c, $AC0.M +0762 00fc 044d sr @0x044d, $AC0.L +0764 009e 0009 lri $AC0.M, #0x0009 +0766 00fe 0440 sr @0x0440, $AC0.M +0768 009e 0010 lri $AC0.M, #0x0010 +076a 00fe 041a sr @0x041a, $AC0.M +076c 009e 0100 lri $AC0.M, #0x0100 +076e 009c f250 lri $AC0.L, #0xf250 +0770 00fe 044a sr @0x044a, $AC0.M +0772 00fc 044b sr @0x044b, $AC0.L +0774 009c 0000 lri $AC0.L, #0x0000 +0776 00fe 0448 sr @0x0448, $AC0.M +0778 00fc 0449 sr @0x0449, $AC0.L +077a 009e 0001 lri $AC0.M, #0x0001 +077c 00fe 0441 sr @0x0441, $AC0.M +077e 8900 clr $ACC1 +077f 00ff 0401 sr @0x0401, $AC1.M +0781 1180 079b bloopi #0x80, 0x079b +{ + 0783 0083 0580 lri $AR3, #0x0580 + 0785 009f 0100 lri $AC1.M, #0x0100 + 0787 02bf 06a6 call 0x06a6 + 0789 0081 0346 lri $AR1, #0x0346 + 078b 193e lrri $AC0.M, @$AR1 + 078c 18bc lrrd $AC0.L, @$AR1 + 078d 009f 0580 lri $AC1.M, #0x0580 + 078f 0080 0100 lri $AR0, #0x0100 + 0791 02bf 008b call 0x008b + 0793 0081 0346 lri $AR1, #0x0346 + 0795 193e lrri $AC0.M, @$AR1 + 0796 18bc lrrd $AC0.L, @$AR1 + 0797 0098 0200 lri $AX0.L, #0x0200 + 0799 7000 addaxl $ACC0, $AX0.L + 079a 1b3e srri @$AR1, $AC0.M + 079b 1abc srrd @$AR1, $AC0.L +} +079c 029f 0049 jmp 0x0049 +} + +void 079e_AudioFormatRAW20() +{ +079e 8900 clr $ACC1 +079f 009f 0050 lri $AC1.M, #0x0050 +07a1 0083 0520 lri $AR3, #0x0520 +07a3 02bf 07b9 call 0x07b9 +07a5 029f 04e7 jmp 0x04e7 +} + +void 07a7_AudioFormatRAW21() +{ +07a7 00d8 0402 lr $AX0.L, @0x0402 +07a9 8100 clr $ACC0 +07aa 8900 clr $ACC1 +07ab 00dc 0418 lr $AC0.L, @0x0418 +07ad 009a 0050 lri $AX0.H, #0x0050 +07af 9000 mul $AX0.L, $AX0.H +07b0 9400 mulac $AX0.L, $AX0.H, $ACC0 +07b1 1404 lsl $ACC0, #4 +07b2 1ffe mrr $AC1.M, $AC0.M +07b3 0083 0580 lri $AR3, #0x0580 +07b5 02bf 07b9 call 0x07b9 +07b7 029f 04df jmp 0x04df +} + +{ +07b9 0092 0004 lri $CR, #0x0004 +07bb 8100 clr $ACC0 +07bc 2622 lrs $AC0.M, @0x0022 +07bd 2423 lrs $AC0.L, @0x0023 +07be 1f1f mrr $AX0.L, $AC1.M +07bf 009a 0000 lri $AX0.H, #0x0000 +07c1 5800 subax $ACC0, $AX0 +07c2 0290 07d9 jge 0x07d9 +07c4 8900 clr $ACC1 +07c5 00c0 0423 lr $AR0, @0x0423 +07c7 02bf 07fe call 0x07fe +07c9 8100 clr $ACC0 +07ca 1fd8 mrr $AC0.M, $AX0.L +07cb 2223 lrs $AX0.H, @0x0023 +07cc 5400 subr $ACC0, $AX0.H +07cd 0007 dar $AR3 +07ce 1979 lrri $AX1.L, @$AR3 +07cf 005e loop $AC0.M +07d0 1b79 srri @$AR3, $AX1.L +07d1 009f 0001 lri $AC1.M, #0x0001 +07d3 2f01 srs @0x0001, $AC1.M +07d4 8900 clr $ACC1 +07d5 2f23 srs @0x0023, $AC1.M +07d6 0092 00ff lri $CR, #0x00ff +07d8 02df ret +} + +{ +07d9 2e22 srs @0x0022, $AC0.M +07da 2c23 srs @0x0023, $AC0.L +07db 8100 clr $ACC0 +07dc 8900 clr $ACC1 +07dd 264a lrs $AC0.M, @0x004a +07de 271c lrs $AC1.M, @0x001c +07df 5c00 sub $ACC0, $ACC1 +07e0 2e1e srs @0x001e, $AC0.M +07e1 5000 subr $ACC0, $AX0.L +07e2 0290 07f8 jge 0x07f8 +07e4 00c0 041e lr $AR0, @0x041e +07e6 02bf 07fe call 0x07fe +07e8 8100 clr $ACC0 +07e9 1fd8 mrr $AC0.M, $AX0.L +07ea 221e lrs $AX0.H, @0x001e +07eb 5400 subr $ACC0, $AX0.H +07ec 1c1e mrr $AR0, $AC0.M +07ed 8100 clr $ACC0 +07ee 2e1c srs @0x001c, $AC0.M +07ef 2648 lrs $AC0.M, @0x0048 +07f0 2449 lrs $AC0.L, @0x0049 +07f1 2e4c srs @0x004c, $AC0.M +07f2 2c4d srs @0x004d, $AC0.L +07f3 02bf 07fe call 0x07fe +07f5 0092 00ff lri $CR, #0x00ff +07f7 02df ret +} + +{ +07f8 1c18 mrr $AR0, $AX0.L +07f9 02bf 07fe call 0x07fe +07fb 0092 00ff lri $CR, #0x00ff +07fd 02df ret +} + +{ +07fe 8100 clr $ACC0 +07ff 1fc0 mrr $AC0.M, $AR0 +0800 b100 tst $ACC0 +0801 02d5 retz +0802 8900 clr $ACC1 +0803 271c lrs $AC1.M, @0x001c +0804 0340 0001 andi $AC1.M, #0x0001 +0806 009b 0000 lri $AX1.H, #0x0000 +0808 1f3f mrr $AX1.L, $AC1.M +0809 264c lrs $AC0.M, @0x004c +080a 244d lrs $AC0.L, @0x004d +080b 8900 clr $ACC1 +080c 251c lrs $AC1.L, @0x001c +080d 1501 lsl $ACC1, #1 +080e 4c00 add $ACC0, $ACC1 +080f 5a00 subax $ACC0, $AX1 +0810 5a00 subax $ACC0, $AX1 +0811 1c20 mrr $AR1, $AR0 +0812 1fe0 mrr $AC1.M, $AR0 +0813 0502 addis $AC1.M, #0x02 +0814 1c1f mrr $AR0, $AC1.M +0815 009f 0a00 lri $AC1.M, #0x0a00 +0817 0092 00ff lri $CR, #0x00ff +0819 02bf 007e call 0x007e +081b 0092 0004 lri $CR, #0x0004 +081d 271c lrs $AC1.M, @0x001c +081e 1f61 mrr $AX1.H, $AR1 +081f 4700 addr $ACC1, $AX1.H +0820 2f1c srs @0x001c, $AC1.M +0821 0080 0a00 lri $AR0, #0x0a00 +0823 8900 clr $ACC1 +0824 1ff9 mrr $AC1.M, $AX1.L +0825 b900 tst $ACC1 +0826 0274 ifnz +0827 0008 iar $AR0 +0828 8900 clr $ACC1 +0829 1fe1 mrr $AC1.M, $AR1 +082a 191e lrri $AC0.M, @$AR0 +082b 0701 cmpis $AC1.M, #0x01 +082c 0293 0835 jle 0x0835 +082e 191a lrri $AX0.H, @$AR0 +082f 05fe addis $AC1.M, #0xfe +0830 005f loop $AC1.M +0831 64a0 movr'ls $ACC0, $AX0.H : $AX0.H, $AC0.M +0832 1b7e srri @$AR3, $AC0.M +0833 1b7a srri @$AR3, $AX0.H +0834 02df ret +} + +{ +0835 1b7e srri @$AR3, $AC0.M +0836 02df ret +} + +{ +0837 0092 0004 lri $CR, #0x0004 +0839 2201 lrs $AX0.H, @0x0001 +083a 8600 tstaxh $AX0.H +083b 0294 0868 jnz 0x0868 +083d 2204 lrs $AX0.H, @0x0004 +083e 8600 tstaxh $AX0.H +083f 02b4 08bc callnz 0x08bc +0841 2219 lrs $AX0.H, @0x0019 +0842 8600 tstaxh $AX0.H +0843 0295 085d jz 0x085d +0845 009e 0430 lri $AC0.M, #0x0430 +0847 4400 addr $ACC0, $AX0.H +0848 1c1e mrr $AR0, $AC0.M +0849 0e10 lris $AC0.M, #0x10 +084a 5400 subr $ACC0, $AX0.H +084b 1f7e mrr $AX1.H, $AC0.M +084c 02bf 0699 call 0x0699 +084e d900 cmpar $ACC1, $AX1.H +084f 0292 085c jg 0x085c +0851 0295 0858 jz 0x0858 +0853 2619 lrs $AC0.M, @0x0019 +0854 4c00 add $ACC0, $ACC1 +0855 2e19 srs @0x0019, $AC0.M +0856 029f 08b9 jmp 0x08b9 + +0858 8100 clr $ACC0 +0859 2e19 srs @0x0019, $AC0.M +085a 029f 08b9 jmp 0x08b9 + +085c 5700 subr $ACC1, $AX1.H +085d 8100 clr $ACC0 +085e 2605 lrs $AC0.M, @0x0005 +085f b100 tst $ACC0 +0860 0295 0879 jz 0x0879 +0862 8100 clr $ACC0 +0863 2e05 srs @0x0005, $AC0.M +0864 2241 lrs $AX0.H, @0x0041 +0865 8600 tstaxh $AX0.H +0866 0294 086f jnz 0x086f +0868 8100 clr $ACC0 +0869 005f loop $AC1.M +086a 1b7e srri @$AR3, $AC0.M +086b 7400 incm $AC0.M +086c 2e01 srs @0x0001, $AC0.M +086d 029f 08b9 jmp 0x08b9 + +086f 2648 lrs $AC0.M, @0x0048 +0870 2449 lrs $AC0.L, @0x0049 +0871 2e1c srs @0x001c, $AC0.M +0872 2c1d srs @0x001d, $AC0.L +0873 02bf 08c1 call 0x08c1 +0875 2642 lrs $AC0.M, @0x0042 +0876 2443 lrs $AC0.L, @0x0043 +0877 2e3f srs @0x003f, $AC0.M +0878 2c3e srs @0x003e, $AC0.L +0879 00ff 0360 sr @0x0360, $AC1.M +087b 2620 lrs $AC0.M, @0x0020 +087c 2421 lrs $AC0.L, @0x0021 +087d 009f 0005 lri $AC1.M, #0x0005 +087f 02bf 0103 call 0x0103 +0881 0092 0004 lri $CR, #0x0004 +0883 8900 clr $ACC1 +0884 00ff 0362 sr @0x0362, $AC1.M +0886 00df 0360 lr $AC1.M, @0x0360 +0888 02bf 08db call 0x08db +088a 8100 clr $ACC0 +088b 00de 0362 lr $AC0.M, @0x0362 +088d 2240 lrs $AX0.H, @0x0040 +088e 4400 addr $ACC0, $AX0.H +088f 00fe 0362 sr @0x0362, $AC0.M +0891 8100 clr $ACC0 +0892 2622 lrs $AC0.M, @0x0022 +0893 2423 lrs $AC0.L, @0x0023 +0894 0a01 lris $AX0.H, #0x01 +0895 0081 0405 lri $AR1, #0x0405 +0897 7a00 dec $ACC0 +0898 b100 tst $ACC0 +0899 0275 ifz +089a 1a3a srr @$AR1, $AX0.H +089b 2e22 srs @0x0022, $AC0.M +089c 2c23 srs @0x0023, $AC0.L +089d 0710 cmpis $AC1.M, #0x10 +089e 0293 08a7 jle 0x08a7 +08a0 05f0 addis $AC1.M, #0xf0 +08a1 2205 lrs $AX0.H, @0x0005 +08a2 8600 tstaxh $AX0.H +08a3 0294 0862 jnz 0x0862 +08a5 029f 0888 jmp 0x0888 +08a7 0275 ifz +08a8 8900 clr $ACC1 +08a9 2f19 srs @0x0019, $AC1.M +08aa 1fc3 mrr $AC0.M, $AR3 +08ab 04f0 addis $AC0.M, #0xf0 +08ac 1c1e mrr $AR0, $AC0.M +08ad 0083 0430 lri $AR3, #0x0430 +08af 0e10 lris $AC0.M, #0x10 +08b0 02bf 0699 call 0x0699 +08b2 2620 lrs $AC0.M, @0x0020 +08b3 2421 lrs $AC0.L, @0x0021 +08b4 00d8 0362 lr $AX0.L, @0x0362 +08b6 7000 addaxl $ACC0, $AX0.L +08b7 2c21 srs @0x0021, $AC0.L +08b8 2e20 srs @0x0020, $AC0.M +08b9 0092 00ff lri $CR, #0x00ff +08bb 02df ret +} + +{ +08bc 8100 clr $ACC0 +08bd 2e1c srs @0x001c, $AC0.M +08be 2e1d srs @0x001d, $AC0.M +08bf 2e3e srs @0x003e, $AC0.M +08c0 2e3f srs @0x003f, $AC0.M +08c1 231c lrs $AX1.H, @0x001c +08c2 211d lrs $AX1.L, @0x001d +08c3 264a lrs $AC0.M, @0x004a +08c4 244b lrs $AC0.L, @0x004b +08c5 5a00 subax $ACC0, $AX1 +08c6 147c lsr $ACC0, #-4 +08c7 2e22 srs @0x0022, $AC0.M +08c8 2c23 srs @0x0023, $AC0.L +08c9 261c lrs $AC0.M, @0x001c +08ca 241d lrs $AC0.L, @0x001d +08cb 147c lsr $ACC0, #-4 +08cc 2240 lrs $AX0.H, @0x0040 +08cd c010 mulc'mv $AC0.M, $AX0.H : $AX0.L, $AC0.L +08ce 9600 mulmv $AX0.L, $AX0.H, $ACC0 +08cf f000 lsl16 $ACC0 +08d0 4e00 addp $ACC0 +08d1 234c lrs $AX1.H, @0x004c +08d2 214d lrs $AX1.L, @0x004d +08d3 4a00 addax $ACC0, $AX1 +08d4 2e20 srs @0x0020, $AC0.M +08d5 2c21 srs @0x0021, $AC0.L +08d6 8100 clr $ACC0 +08d7 2e05 srs @0x0005, $AC0.M +08d8 2e19 srs @0x0019, $AC0.M +08d9 2e04 srs @0x0004, $AC0.M +08da 02df ret +} + +{ +08db 00ff 0360 sr @0x0360, $AC1.M +08dd 0080 ffd3 lri $AR0, #0xffd3 +08df 0084 0000 lri $IX0, #0x0000 +08e1 199e lrrn $AC0.M, @$AR0 +08e2 1ffe mrr $AC1.M, $AC0.M +08e3 1401 lsl $ACC0, #1 +08e4 0240 001e andi $AC0.M, #0x001e +08e6 0200 0300 addi $AC0.M, #0x0300 +08e8 1c3e mrr $AR1, $AC0.M +08e9 157c lsr $ACC1, #-4 +08ea 0340 000f andi $AC1.M, #0x000f +08ec 0a11 lris $AX0.H, #0x11 +08ed 5500 subr $ACC1, $AX0.H +08ee 009a 00f0 lri $AX0.H, #0x00f0 +08f0 009b 000f lri $AX1.H, #0x000f +08f2 0082 0370 lri $AR2, #0x0370 +08f4 1998 lrrn $AX0.L, @$AR0 +08f5 6000 movr $ACC0, $AX0.L +08f6 1107 08fd bloopi #0x07, 0x08fd +{ + 08f8 3400 andr $AC0.M, $AX0.H + 08f9 1408 lsl $ACC0, #8 + 08fa 6032 movr's $ACC0, $AX0.L : @$AR2, $AC0.M + 08fb 3644 andr'ln $AC0.M, $AX1.H : $AX0.L, @$AR0 + 08fc 140c lsl $ACC0, #12 + 08fd 6032 movr's $ACC0, $AX0.L : @$AR2, $AC0.M +} +08fe 3400 andr $AC0.M, $AX0.H +08ff 1408 lsl $ACC0, #8 +0900 6032 movr's $ACC0, $AX0.L : @$AR2, $AC0.M +0901 3600 andr $AC0.M, $AX1.H +0902 140c lsl $ACC0, #12 +0903 1b5e srri @$AR2, $AC0.M +0904 8f00 set40 +0905 1f7f mrr $AX1.H, $AC1.M +0906 203e lrs $AX0.L, @0x003e +0907 273f lrs $AC1.M, @0x003f +0908 193a lrri $AX0.H, @$AR1 +0909 1939 lrri $AX1.L, @$AR1 +090a 0080 0370 lri $AR0, #0x0370 +090c 1c80 mrr $IX0, $AR0 +090d a000 mulx $AX0.L, $AX1.L +090e ea70 maddc'l $AC1.M, $AX1.L : $AC0.M, @$AR0 +090f 3a93 asrnrx'mv $ACC0, $AX1.H : $AX0.L, $AC1.M +0910 a478 mulxac'l $AX0.L, $AX1.L, $ACC0 : $AC1.M, @$AR0 +0911 1485 asl $ACC0, #5 +0912 e833 maddc's $AC0.M, $AX1.L : @$AR3, $AC0.M +0913 3b92 asrnrx'mv $ACC1, $AX1.H : $AX0.L, $AC0.M +0914 a570 mulxac'l $AX0.L, $AX1.L, $ACC1 : $AC0.M, @$AR0 +0915 1585 asl $ACC1, #5 +0916 ea3b maddc's $AC1.M, $AX1.L : @$AR3, $AC1.M +0917 1106 0920 bloopi #0x06, 0x0920 +{ + 0919 3a93 asrnrx'mv $ACC0, $AX1.H : $AX0.L, $AC1.M + 091a a478 mulxac'l $AX0.L, $AX1.L, $ACC0 : $AC1.M, @$AR0 + 091b 1485 asl $ACC0, #5 + 091c e833 maddc's $AC0.M, $AX1.L : @$AR3, $AC0.M + 091d 3b92 asrnrx'mv $ACC1, $AX1.H : $AX0.L, $AC0.M + 091e a570 mulxac'l $AX0.L, $AX1.L, $ACC1 : $AC0.M, @$AR0 + 091f 1585 asl $ACC1, #5 + 0920 ea3b maddc's $AC1.M, $AX1.L : @$AR3, $AC1.M +} +0921 3a93 asrnrx'mv $ACC0, $AX1.H : $AX0.L, $AC1.M +0922 a478 mulxac'l $AX0.L, $AX1.L, $ACC0 : $AC1.M, @$AR0 +0923 1485 asl $ACC0, #5 +0924 e833 maddc's $AC0.M, $AX1.L : @$AR3, $AC0.M +0925 3b92 asrnrx'mv $ACC1, $AX1.H : $AX0.L, $AC0.M +0926 a500 mulxac $AX0.L, $AX1.L, $ACC1 +0927 1585 asl $ACC1, #5 +0928 1b7f srri @$AR3, $AC1.M +0929 2e3e srs @0x003e, $AC0.M +092a 2f3f srs @0x003f, $AC1.M +092b 8e00 set16 +092c 8900 clr $ACC1 +092d 00df 0360 lr $AC1.M, @0x0360 +092f 02df ret +} + +{ +0930 0083 0520 lri $AR3, #0x0520 +0932 00de 041b lr $AC0.M, @0x041b +0934 1050 loopi #0x50 + 0935 1b7e srri @$AR3, $AC0.M +0936 029f 04e7 jmp 0x04e7 +} + +0938 0000 nop +0939 0000 nop +093a 0000 nop +093b 0000 nop +093c 0000 nop +093d 0000 nop +093e 0000 nop +093f 0000 nop diff --git a/docs/DSP/DSP_UC_ROM.txt b/docs/DSP/DSP_UC_ROM.txt index 801140b7cb..1f9a19ced4 100644 --- a/docs/DSP/DSP_UC_ROM.txt +++ b/docs/DSP/DSP_UC_ROM.txt @@ -1,4 +1,4 @@ -// The DSP ROM +// The DSP ROM 8000 0092 00ff lri $CR, #0x00ff 8002 1206 sbclr #0x06 8003 1202 sbclr #0x02 @@ -9,180 +9,223 @@ 8008 8c00 clr15 8009 8b00 m0 800a 16fc 8071 si @DMBH, #0x8071 -800c 16fd feed si @DMBL, #0xfeed +800c 16fd feed si @DMBL, #0xfeed // sendmail 0x8071feed (INIT) -// hm. Lots of JMPs to here. +void 800e_MainLoop() +{ 800e 8100 clr $ACC0 800f 8900 clr $ACC1 -8010 02bf 8078 call 0x8078 // wait for CPU mailbox & 0x8000 +8010 02bf 8078 call 0x8078 // wait till there is mail for DSP from CPU 8012 009f 80f3 lri $AC1.M, #0x80f3 -8014 8200 cmp -8015 0295 801f jz 0x801f // skip below dsp mailbox write... +8014 8200 cmp // $AC0.M = @CMBH +8015 0295 801f jz 0x801f 8017 27ff lrs $AC1.M, @CMBL -8018 16fc feee si @DMBH, #0xfeee // Write to dsp mailbox -801a 2efd srs @DMBL, $AC0.M -801b 02bf 807e call 0x807e +8018 16fc feee si @DMBH, #0xfeee +801a 2efd srs @DMBL, $AC0.M // sendmail 0xfeee???? (????=@CMBH - !0x80f3) +801b 02bf 807e call 0x807e // wait for mail-to-be-received-by-CPU 801d 029f 800e jmp 0x800e +} -801f 26ff lrs $AC0.M, @CMBL // ...and end up here (skip above) - -// if equal to a001 ... +// if mail was equal to 0x80f3a001 ... +// m_CurrentUCode.m_RAMAddress +// $IX0-$IX1 +{ +801f 26ff lrs $AC0.M, @CMBL 8020 009f a001 lri $AC1.M, #0xa001 8022 8200 cmp 8023 0294 802c jnz 0x802c -8025 02bf 8078 call 0x8078 // wait for CPU mailbox & 0x8000 +8025 02bf 8078 call 0x8078 8027 27ff lrs $AC1.M, @CMBL 8028 1c9e mrr $IX0, $AC0.M 8029 1cbf mrr $IX1, $AC1.M 802a 029f 800e jmp 0x800e +} -// elseif a002 ... +// else if mail was equal to 0x80f3a002 ... +// m_CurrentUCode.m_Length +// $IX3 +{ 802c 009f a002 lri $AC1.M, #0xa002 802e 8200 cmp 802f 0294 8037 jnz 0x8037 -8031 02bf 8078 call 0x8078 // wait for CPU mailbox & 0x8000 +8031 02bf 8078 call 0x8078 8033 27ff lrs $AC1.M, @CMBL 8034 1cff mrr $IX3, $AC1.M 8035 029f 800e jmp 0x800e +} -// elseif c002 ... +// else if mail was equal to 0x80f3c002 ... +// m_CurrentUCode.m_IMEMAddress +// $IX2 +{ 8037 009f c002 lri $AC1.M, #0xc002 8039 8200 cmp 803a 0294 8042 jnz 0x8042 -803c 02bf 8078 call 0x8078 // wait for CPU mailbox & 0x8000 +803c 02bf 8078 call 0x8078 803e 27ff lrs $AC1.M, @CMBL 803f 1cdf mrr $IX2, $AC1.M 8040 029f 800e jmp 0x800e +} -// elseif b001 ... +// else if mail was equal to 0x80f3b001 ... +// DMEM.m_RAMAddress +// $AX0.H-$AX0.L +{ 8042 009f b001 lri $AC1.M, #0xb001 8044 8200 cmp 8045 0294 804e jnz 0x804e -8047 02bf 8078 call 0x8078 // wait for CPU mailbox & 0x8000 +8047 02bf 8078 call 0x8078 8049 27ff lrs $AC1.M, @CMBL 804a 1f5e mrr $AX0.H, $AC0.M 804b 1f1f mrr $AX0.L, $AC1.M 804c 029f 800e jmp 0x800e +} -// elseif b002 ... +// else if mail was equal to 0x80f3b002 ... +// DMEM.m_Length +// $AX1.L +{ 804e 009f b002 lri $AC1.M, #0xb002 8050 8200 cmp 8051 0294 8059 jnz 0x8059 -8053 02bf 8078 call 0x8078 // wait for CPU mailbox & 0x8000 +8053 02bf 8078 call 0x8078 8055 27ff lrs $AC1.M, @CMBL 8056 1f3f mrr $AX1.L, $AC1.M 8057 029f 800e jmp 0x800e +} -// elseif c001 ... +// else if mail was equal to 0x80f3c001 ... +// DMEM.m_DMEMAddress +// $AX1.H +{ 8059 009f c001 lri $AC1.M, #0xc001 805b 8200 cmp 805c 0294 8064 jnz 0x8064 -805e 02bf 8078 call 0x8078 // wait for CPU mailbox & 0x8000 +805e 02bf 8078 call 0x8078 8060 27ff lrs $AC1.M, @CMBL 8061 1f7f mrr $AX1.H, $AC1.M 8062 029f 800e jmp 0x800e +} -// elseif d001 ... +// else if mail was equal to 0x80f3d001 ... +// m_CurrentUCode.m_StartPC +// $AR0 +{ 8064 009f d001 lri $AC1.M, #0xd001 8066 8200 cmp 8067 0294 8071 jnz 0x8071 -8069 02bf 8078 call 0x8078 // wait for CPU mailbox & 0x8000 +8069 02bf 8078 call 0x8078 806b 8100 clr $ACC0 806c 26ff lrs $AC0.M, @CMBL 806d 1c1e mrr $AR0, $AC0.M -806e 029f 80b5 jmp 0x80b5 // Do DMA, probably - -// endif - never reaches here. +806e 029f 80b5 jmp 80b5_BootUcode() 8070 0021 halt +} -// default: +// else ... +{ 8071 16fc faaa si @DMBH, #0xfaaa -8073 2efd srs @DMBL, $AC0.M +8073 2efd srs @DMBL, $AC0.M // sendmail 0xfaaa???? (????=@CMBL) 8074 02bf 807e call 0x807e 8076 029f 800e jmp 0x800e -8078 26fe lrs $AC0.M, @CMBH +} // wait for CMBH & 0x8000 +{ +8078 26fe lrs $AC0.M, @CMBH 8079 02c0 8000 andcf $AC0.M, #0x8000 807b 029c 8078 jlnz 0x8078 -807d 02df ret +807d 02df ret +} -// wait for DMBH & 0x8000 +// wait for DMBH & 0x8000 +void 807e_WaitForDSPMail +{ 807e 26fc lrs $AC0.M, @DMBH 807f 02a0 8000 andf $AC0.M, #0x8000 8081 029c 807e jlnz 0x807e -8083 02df ret -8084 0021 halt - +8083 02df ret +8084 0021 halt +} +//dump DRAM/IRAM to mainmem +{ 8085 8e00 set16 8086 8100 clr $ACC0 8087 1fd9 mrr $AC0.M, $AX1.L 8088 b100 tst $ACC0 8089 0295 809d jz 0x809d -808b 00fa ffce sr @DSMAH, $AX0.H -808d 00f8 ffcf sr @DSMAL, $AX0.L -808f 009e 0001 lri $AC0.M, #0x0001 -8091 00fe ffc9 sr @DSCR, $AC0.M -8093 00fb ffcd sr @DSPA, $AX1.H -8095 00f9 ffcb sr @DSBL, $AX1.L -8097 00de ffc9 lr $AC0.M, @DSCR -8099 02a0 0004 andf $AC0.M, #0x0004 -809b 029c 8097 jlnz 0x8097 +{ // DRAM + 808b 00fa ffce sr @DSMAH, $AX0.H + 808d 00f8 ffcf sr @DSMAL, $AX0.L + 808f 009e 0001 lri $AC0.M, #0x0001 + 8091 00fe ffc9 sr @DSCR, $AC0.M // DMEM->CPU + 8093 00fb ffcd sr @DSPA, $AX1.H + 8095 00f9 ffcb sr @DSBL, $AX1.L + 8097 00de ffc9 lr $AC0.M, @DSCR + 8099 02a0 0004 andf $AC0.M, #0x0004 + 809b 029c 8097 jlnz 0x8097 +} 809d 8100 clr $ACC0 809e 1fc7 mrr $AC0.M, $IX3 809f b100 tst $ACC0 80a0 0295 80b4 jz 0x80b4 -80a2 00e4 ffce sr @DSMAH, $IX0 -80a4 00e5 ffcf sr @DSMAL, $IX1 -80a6 009e 0003 lri $AC0.M, #0x0003 -80a8 00fe ffc9 sr @DSCR, $AC0.M -80aa 00e6 ffcd sr @DSPA, $IX2 -80ac 00e7 ffcb sr @DSBL, $IX3 -80ae 00de ffc9 lr $AC0.M, @DSCR -80b0 02a0 0004 andf $AC0.M, #0x0004 -80b2 029c 80ae jlnz 0x80ae +{ // IRAM + 80a2 00e4 ffce sr @DSMAH, $IX0 + 80a4 00e5 ffcf sr @DSMAL, $IX1 + 80a6 009e 0003 lri $AC0.M, #0x0003 + 80a8 00fe ffc9 sr @DSCR, $AC0.M // IMEM->CPU + 80aa 00e6 ffcd sr @DSPA, $IX2 + 80ac 00e7 ffcb sr @DSBL, $IX3 + 80ae 00de ffc9 lr $AC0.M, @DSCR + 80b0 02a0 0004 andf $AC0.M, #0x0004 + 80b2 029c 80ae jlnz 0x80ae +} 80b4 02df ret +} - -// DMA utility function - maybe 2 modes, read, write? +//direct jump here from /ZeldaUcode (normal,sms,dma(wii) type)/AX/AXWII/ -> all except Zelda Light (Luigi/IPL) +void 80b5_BootUcode()() +{ 80b5 8e00 set16 80b6 8100 clr $ACC0 80b7 8900 clr $ACC1 80b8 1ff9 mrr $AC1.M, $AX1.L 80b9 b900 tst $ACC1 80ba 0295 80ce jz 0x80ce -80bc 00fa ffce sr @DSMAH, $AX0.H -80be 00f8 ffcf sr @DSMAL, $AX0.L -80c0 009e 0000 lri $AC0.M, #0x0000 -80c2 00fe ffc9 sr @DSCR, $AC0.M -80c4 00fb ffcd sr @DSPA, $AX1.H -80c6 00f9 ffcb sr @DSBL, $AX1.L -80c8 00de ffc9 lr $AC0.M, @DSCR -80ca 02a0 0004 andf $AC0.M, #0x0004 -80cc 029c 80c8 jlnz 0x80c8 +{ // DRAM upload + 80bc 00fa ffce sr @DSMAH, $AX0.H + 80be 00f8 ffcf sr @DSMAL, $AX0.L + 80c0 009e 0000 lri $AC0.M, #0x0000 + 80c2 00fe ffc9 sr @DSCR, $AC0.M // CPU->DMEM + 80c4 00fb ffcd sr @DSPA, $AX1.H + 80c6 00f9 ffcb sr @DSBL, $AX1.L + 80c8 00de ffc9 lr $AC0.M, @DSCR // wait for DMA completion + 80ca 02a0 0004 andf $AC0.M, #0x0004 + 80cc 029c 80c8 jlnz 0x80c8 +} 80ce 8900 clr $ACC1 -// jump destionation from 00ba 80cf 1fe7 mrr $AC1.M, $IX3 80d0 b900 tst $ACC1 80d1 0295 80e5 jz 0x80e5 -80d3 00e4 ffce sr @DSMAH, $IX0 -80d5 00e5 ffcf sr @DSMAL, $IX1 -80d7 009e 0002 lri $AC0.M, #0x0002 -80d9 00fe ffc9 sr @DSCR, $AC0.M -80db 00e6 ffcd sr @DSPA, $IX2 -80dd 00e7 ffcb sr @DSBL, $IX3 -80df 00de ffc9 lr $AC0.M, @DSCR // tiny loop here, wait for DMA completion -80e1 02a0 0004 andf $AC0.M, #0x0004 -80e3 029c 80df jlnz 0x80df -80e5 170f jmpr $AR0 // Jump through register? jump table? - - -80e6 0021 halt - +{ // IRAM upload + 80d3 00e4 ffce sr @DSMAH, $IX0 + 80d5 00e5 ffcf sr @DSMAL, $IX1 + 80d7 009e 0002 lri $AC0.M, #0x0002 + 80d9 00fe ffc9 sr @DSCR, $AC0.M // CPU->IMEM (ucode upload) + 80db 00e6 ffcd sr @DSPA, $IX2 + 80dd 00e7 ffcb sr @DSBL, $IX3 + 80df 00de ffc9 lr $AC0.M, @DSCR // wait for DMA completion + 80e1 02a0 0004 andf $AC0.M, #0x0004 + 80e3 029c 80df jlnz 0x80df +} +80e5 170f jmpr $AR0 // m_CurrentUCode.m_StartPC +80e6 0021 halt +} // Large mixer function - called a lot by AX -// Prolly simple Stereo Mixer +// Prolly simple Stereo Mixer +{ 80e7 8150 clr'l $ACC0 : $AX0.H, @$AR0 80e8 8949 clr'l $ACC1 : $AX1.L, @$AR1 80e9 b072 mulx'l $AX0.H, $AX1.L : $AC0.M, @$AR2 @@ -456,11 +499,11 @@ 81f5 9909 asr16'ir $ACC1 : $AR1 81f6 1b7f srri @$AR3, $AC1.M 81f7 812b clr's $ACC0 : @$AR3, $AC1.L -81f8 02df ret -// End of 1st big mixer function +81f8 02df ret +} - -// Second big mixer function? +// Second big mixer function? +{ 81f9 8150 clr'l $ACC0 : $AX0.H, @$AR0 81fa 8949 clr'l $ACC1 : $AX1.L, @$AR1 81fb b072 mulx'l $AX0.H, $AX1.L : $AC0.M, @$AR2 @@ -597,147 +640,147 @@ 827e 1b7f srri @$AR3, $AC1.M 827f 812b clr's $ACC0 : @$AR3, $AC1.L 8280 1f63 mrr $AX1.H, $AR3 -8281 02df ret -// End of 2nd big mixer function +8281 02df ret +} - -// 3rd big mixer function +// 3rd big mixer function +{ 8282 1ce3 mrr $IX3, $AR3 8283 8100 clr $ACC0 8284 8971 clr'l $ACC1 : $AC0.M, @$AR1 8285 18bf lrrd $AC1.M, @$AR1 8286 1b7e srri @$AR3, $AC0.M -8287 4c00 add $ACC0, $AC1.L +8287 4c00 add $ACC0, $ACC1 8288 1b7e srri @$AR3, $AC0.M -8289 4c00 add $ACC0, $AC1.L +8289 4c00 add $ACC0, $ACC1 828a 1b7e srri @$AR3, $AC0.M -828b 4c00 add $ACC0, $AC1.L +828b 4c00 add $ACC0, $ACC1 828c 1b7e srri @$AR3, $AC0.M -828d 4c00 add $ACC0, $AC1.L +828d 4c00 add $ACC0, $ACC1 828e 1b7e srri @$AR3, $AC0.M -828f 4c00 add $ACC0, $AC1.L +828f 4c00 add $ACC0, $ACC1 8290 1b7e srri @$AR3, $AC0.M -8291 4c00 add $ACC0, $AC1.L +8291 4c00 add $ACC0, $ACC1 8292 1b7e srri @$AR3, $AC0.M -8293 4c00 add $ACC0, $AC1.L +8293 4c00 add $ACC0, $ACC1 8294 1b7e srri @$AR3, $AC0.M -8295 4c00 add $ACC0, $AC1.L +8295 4c00 add $ACC0, $ACC1 8296 1b7e srri @$AR3, $AC0.M -8297 4c00 add $ACC0, $AC1.L +8297 4c00 add $ACC0, $ACC1 8298 1b7e srri @$AR3, $AC0.M -8299 4c00 add $ACC0, $AC1.L +8299 4c00 add $ACC0, $ACC1 829a 1b7e srri @$AR3, $AC0.M -829b 4c00 add $ACC0, $AC1.L +829b 4c00 add $ACC0, $ACC1 829c 1b7e srri @$AR3, $AC0.M -829d 4c00 add $ACC0, $AC1.L +829d 4c00 add $ACC0, $ACC1 829e 1b7e srri @$AR3, $AC0.M -829f 4c00 add $ACC0, $AC1.L +829f 4c00 add $ACC0, $ACC1 82a0 1b7e srri @$AR3, $AC0.M -82a1 4c00 add $ACC0, $AC1.L +82a1 4c00 add $ACC0, $ACC1 82a2 1b7e srri @$AR3, $AC0.M -82a3 4c00 add $ACC0, $AC1.L +82a3 4c00 add $ACC0, $ACC1 82a4 1b7e srri @$AR3, $AC0.M -82a5 4c00 add $ACC0, $AC1.L +82a5 4c00 add $ACC0, $ACC1 82a6 1b7e srri @$AR3, $AC0.M -82a7 4c00 add $ACC0, $AC1.L +82a7 4c00 add $ACC0, $ACC1 82a8 1b7e srri @$AR3, $AC0.M -82a9 4c00 add $ACC0, $AC1.L +82a9 4c00 add $ACC0, $ACC1 82aa 1b7e srri @$AR3, $AC0.M -82ab 4c00 add $ACC0, $AC1.L +82ab 4c00 add $ACC0, $ACC1 82ac 1b7e srri @$AR3, $AC0.M -82ad 4c00 add $ACC0, $AC1.L +82ad 4c00 add $ACC0, $ACC1 82ae 1b7e srri @$AR3, $AC0.M -82af 4c00 add $ACC0, $AC1.L +82af 4c00 add $ACC0, $ACC1 82b0 1b7e srri @$AR3, $AC0.M -82b1 4c00 add $ACC0, $AC1.L +82b1 4c00 add $ACC0, $ACC1 82b2 1b7e srri @$AR3, $AC0.M -82b3 4c00 add $ACC0, $AC1.L +82b3 4c00 add $ACC0, $ACC1 82b4 1b7e srri @$AR3, $AC0.M -82b5 4c00 add $ACC0, $AC1.L +82b5 4c00 add $ACC0, $ACC1 82b6 1b7e srri @$AR3, $AC0.M -82b7 4c00 add $ACC0, $AC1.L +82b7 4c00 add $ACC0, $ACC1 82b8 1b7e srri @$AR3, $AC0.M -82b9 4c00 add $ACC0, $AC1.L +82b9 4c00 add $ACC0, $ACC1 82ba 1b7e srri @$AR3, $AC0.M -82bb 4c00 add $ACC0, $AC1.L +82bb 4c00 add $ACC0, $ACC1 82bc 1b7e srri @$AR3, $AC0.M -82bd 4c00 add $ACC0, $AC1.L +82bd 4c00 add $ACC0, $ACC1 82be 1b7e srri @$AR3, $AC0.M -82bf 4c00 add $ACC0, $AC1.L +82bf 4c00 add $ACC0, $ACC1 82c0 1b7e srri @$AR3, $AC0.M -82c1 4c00 add $ACC0, $AC1.L +82c1 4c00 add $ACC0, $ACC1 82c2 1b7e srri @$AR3, $AC0.M -82c3 4c00 add $ACC0, $AC1.L +82c3 4c00 add $ACC0, $ACC1 82c4 1b7e srri @$AR3, $AC0.M -82c5 4c00 add $ACC0, $AC1.L +82c5 4c00 add $ACC0, $ACC1 82c6 8931 clr's $ACC1 : @$AR1, $AC0.M 82c7 8109 clr'ir $ACC0 : $AR1 82c8 193e lrri $AC0.M, @$AR1 82c9 18bf lrrd $AC1.M, @$AR1 82ca 1b7e srri @$AR3, $AC0.M -82cb 4c00 add $ACC0, $AC1.L +82cb 4c00 add $ACC0, $ACC1 82cc 1b7e srri @$AR3, $AC0.M -82cd 4c00 add $ACC0, $AC1.L +82cd 4c00 add $ACC0, $ACC1 82ce 1b7e srri @$AR3, $AC0.M -82cf 4c00 add $ACC0, $AC1.L +82cf 4c00 add $ACC0, $ACC1 82d0 1b7e srri @$AR3, $AC0.M -82d1 4c00 add $ACC0, $AC1.L +82d1 4c00 add $ACC0, $ACC1 82d2 1b7e srri @$AR3, $AC0.M -82d3 4c00 add $ACC0, $AC1.L +82d3 4c00 add $ACC0, $ACC1 82d4 1b7e srri @$AR3, $AC0.M -82d5 4c00 add $ACC0, $AC1.L +82d5 4c00 add $ACC0, $ACC1 82d6 1b7e srri @$AR3, $AC0.M -82d7 4c00 add $ACC0, $AC1.L +82d7 4c00 add $ACC0, $ACC1 82d8 1b7e srri @$AR3, $AC0.M -82d9 4c00 add $ACC0, $AC1.L +82d9 4c00 add $ACC0, $ACC1 82da 1b7e srri @$AR3, $AC0.M -82db 4c00 add $ACC0, $AC1.L +82db 4c00 add $ACC0, $ACC1 82dc 1b7e srri @$AR3, $AC0.M -82dd 4c00 add $ACC0, $AC1.L +82dd 4c00 add $ACC0, $ACC1 82de 1b7e srri @$AR3, $AC0.M -82df 4c00 add $ACC0, $AC1.L +82df 4c00 add $ACC0, $ACC1 82e0 1b7e srri @$AR3, $AC0.M -82e1 4c00 add $ACC0, $AC1.L +82e1 4c00 add $ACC0, $ACC1 82e2 1b7e srri @$AR3, $AC0.M -82e3 4c00 add $ACC0, $AC1.L +82e3 4c00 add $ACC0, $ACC1 82e4 1b7e srri @$AR3, $AC0.M -82e5 4c00 add $ACC0, $AC1.L +82e5 4c00 add $ACC0, $ACC1 82e6 1b7e srri @$AR3, $AC0.M -82e7 4c00 add $ACC0, $AC1.L +82e7 4c00 add $ACC0, $ACC1 82e8 1b7e srri @$AR3, $AC0.M -82e9 4c00 add $ACC0, $AC1.L +82e9 4c00 add $ACC0, $ACC1 82ea 1b7e srri @$AR3, $AC0.M -82eb 4c00 add $ACC0, $AC1.L +82eb 4c00 add $ACC0, $ACC1 82ec 1b7e srri @$AR3, $AC0.M -82ed 4c00 add $ACC0, $AC1.L +82ed 4c00 add $ACC0, $ACC1 82ee 1b7e srri @$AR3, $AC0.M -82ef 4c00 add $ACC0, $AC1.L +82ef 4c00 add $ACC0, $ACC1 82f0 1b7e srri @$AR3, $AC0.M -82f1 4c00 add $ACC0, $AC1.L +82f1 4c00 add $ACC0, $ACC1 82f2 1b7e srri @$AR3, $AC0.M -82f3 4c00 add $ACC0, $AC1.L +82f3 4c00 add $ACC0, $ACC1 82f4 1b7e srri @$AR3, $AC0.M -82f5 4c00 add $ACC0, $AC1.L +82f5 4c00 add $ACC0, $ACC1 82f6 1b7e srri @$AR3, $AC0.M -82f7 4c00 add $ACC0, $AC1.L +82f7 4c00 add $ACC0, $ACC1 82f8 1b7e srri @$AR3, $AC0.M -82f9 4c00 add $ACC0, $AC1.L +82f9 4c00 add $ACC0, $ACC1 82fa 1b7e srri @$AR3, $AC0.M -82fb 4c00 add $ACC0, $AC1.L +82fb 4c00 add $ACC0, $ACC1 82fc 1b7e srri @$AR3, $AC0.M -82fd 4c00 add $ACC0, $AC1.L +82fd 4c00 add $ACC0, $ACC1 82fe 1b7e srri @$AR3, $AC0.M -82ff 4c00 add $ACC0, $AC1.L +82ff 4c00 add $ACC0, $ACC1 8300 1b7e srri @$AR3, $AC0.M -8301 4c00 add $ACC0, $AC1.L +8301 4c00 add $ACC0, $ACC1 8302 1b7e srri @$AR3, $AC0.M -8303 4c00 add $ACC0, $AC1.L +8303 4c00 add $ACC0, $ACC1 8304 1b7e srri @$AR3, $AC0.M -8305 4c00 add $ACC0, $AC1.L +8305 4c00 add $ACC0, $ACC1 8306 1b7e srri @$AR3, $AC0.M -8307 4c00 add $ACC0, $AC1.L +8307 4c00 add $ACC0, $ACC1 8308 1b7e srri @$AR3, $AC0.M -8309 4c00 add $ACC0, $AC1.L +8309 4c00 add $ACC0, $ACC1 830a 1b3e srri @$AR1, $AC0.M 830b 1c27 mrr $AR1, $IX3 830c 1c62 mrr $AR3, $AR2 @@ -1076,78 +1119,79 @@ 8459 9900 asr16 $ACC1 845a 1b7f srri @$AR3, $AC1.M 845b 812b clr's $ACC0 : @$AR3, $AC1.L -845c 02df ret +845c 02df ret +} - -// Don't know what this is, looks like more mixing +// Don't know what this is, looks like more mixing +{ 845d 1ce3 mrr $IX3, $AR3 845e 8100 clr $ACC0 845f 8971 clr'l $ACC1 : $AC0.M, @$AR1 8460 18bf lrrd $AC1.M, @$AR1 8461 1b7e srri @$AR3, $AC0.M -8462 4c00 add $ACC0, $AC1.L +8462 4c00 add $ACC0, $ACC1 8463 1b7e srri @$AR3, $AC0.M -8464 4c00 add $ACC0, $AC1.L +8464 4c00 add $ACC0, $ACC1 8465 1b7e srri @$AR3, $AC0.M -8466 4c00 add $ACC0, $AC1.L +8466 4c00 add $ACC0, $ACC1 8467 1b7e srri @$AR3, $AC0.M -8468 4c00 add $ACC0, $AC1.L +8468 4c00 add $ACC0, $ACC1 8469 1b7e srri @$AR3, $AC0.M -846a 4c00 add $ACC0, $AC1.L +846a 4c00 add $ACC0, $ACC1 846b 1b7e srri @$AR3, $AC0.M -846c 4c00 add $ACC0, $AC1.L +846c 4c00 add $ACC0, $ACC1 846d 1b7e srri @$AR3, $AC0.M -846e 4c00 add $ACC0, $AC1.L +846e 4c00 add $ACC0, $ACC1 846f 1b7e srri @$AR3, $AC0.M -8470 4c00 add $ACC0, $AC1.L +8470 4c00 add $ACC0, $ACC1 8471 1b7e srri @$AR3, $AC0.M -8472 4c00 add $ACC0, $AC1.L +8472 4c00 add $ACC0, $ACC1 8473 1b7e srri @$AR3, $AC0.M -8474 4c00 add $ACC0, $AC1.L +8474 4c00 add $ACC0, $ACC1 8475 1b7e srri @$AR3, $AC0.M -8476 4c00 add $ACC0, $AC1.L +8476 4c00 add $ACC0, $ACC1 8477 1b7e srri @$AR3, $AC0.M -8478 4c00 add $ACC0, $AC1.L +8478 4c00 add $ACC0, $ACC1 8479 1b7e srri @$AR3, $AC0.M -847a 4c00 add $ACC0, $AC1.L +847a 4c00 add $ACC0, $ACC1 847b 1b7e srri @$AR3, $AC0.M -847c 4c00 add $ACC0, $AC1.L +847c 4c00 add $ACC0, $ACC1 847d 1b7e srri @$AR3, $AC0.M -847e 4c00 add $ACC0, $AC1.L +847e 4c00 add $ACC0, $ACC1 847f 1b7e srri @$AR3, $AC0.M -8480 4c00 add $ACC0, $AC1.L +8480 4c00 add $ACC0, $ACC1 8481 1b7e srri @$AR3, $AC0.M -8482 4c00 add $ACC0, $AC1.L +8482 4c00 add $ACC0, $ACC1 8483 1b7e srri @$AR3, $AC0.M -8484 4c00 add $ACC0, $AC1.L +8484 4c00 add $ACC0, $ACC1 8485 1b7e srri @$AR3, $AC0.M -8486 4c00 add $ACC0, $AC1.L +8486 4c00 add $ACC0, $ACC1 8487 1b7e srri @$AR3, $AC0.M -8488 4c00 add $ACC0, $AC1.L +8488 4c00 add $ACC0, $ACC1 8489 1b7e srri @$AR3, $AC0.M -848a 4c00 add $ACC0, $AC1.L +848a 4c00 add $ACC0, $ACC1 848b 1b7e srri @$AR3, $AC0.M -848c 4c00 add $ACC0, $AC1.L +848c 4c00 add $ACC0, $ACC1 848d 1b7e srri @$AR3, $AC0.M -848e 4c00 add $ACC0, $AC1.L +848e 4c00 add $ACC0, $ACC1 848f 1b7e srri @$AR3, $AC0.M -8490 4c00 add $ACC0, $AC1.L +8490 4c00 add $ACC0, $ACC1 8491 1b7e srri @$AR3, $AC0.M -8492 4c00 add $ACC0, $AC1.L +8492 4c00 add $ACC0, $ACC1 8493 1b7e srri @$AR3, $AC0.M -8494 4c00 add $ACC0, $AC1.L +8494 4c00 add $ACC0, $ACC1 8495 1b7e srri @$AR3, $AC0.M -8496 4c00 add $ACC0, $AC1.L +8496 4c00 add $ACC0, $ACC1 8497 1b7e srri @$AR3, $AC0.M -8498 4c00 add $ACC0, $AC1.L +8498 4c00 add $ACC0, $ACC1 8499 1b7e srri @$AR3, $AC0.M -849a 4c00 add $ACC0, $AC1.L +849a 4c00 add $ACC0, $ACC1 849b 1b7e srri @$AR3, $AC0.M -849c 4c00 add $ACC0, $AC1.L +849c 4c00 add $ACC0, $ACC1 849d 1b7e srri @$AR3, $AC0.M -849e 4c00 add $ACC0, $AC1.L +849e 4c00 add $ACC0, $ACC1 849f 1b7e srri @$AR3, $AC0.M -84a0 4c00 add $ACC0, $AC1.L +84a0 4c00 add $ACC0, $ACC1 84a1 8931 clr's $ACC1 : @$AR1, $AC0.M 84a2 1c27 mrr $AR1, $IX3 84a3 1c62 mrr $AR3, $AR2 @@ -1317,16 +1361,17 @@ 8547 9900 asr16 $ACC1 8548 1b7f srri @$AR3, $AC1.M 8549 812b clr's $ACC0 : @$AR3, $AC1.L -854a 02df ret +854a 02df ret +} - -// Don't know what this is. There's deadbeef and 1234 in it. Suspicious. +// Don't know what this is. There's deadbeef and 1234 in it. Suspicious. +{ 854b 8e00 set16 854c 0080 0800 lri $AR0, #0x0800 854e 0092 00ff lri $CR, #0x00ff 8550 00c4 0403 lr $IX0, @0x0403 8552 1fe4 mrr $AC1.M, $IX0 -8553 0503 addis $ACC1, #0x03 +8553 0503 addis $AC1.M, #0x03 8554 156e lsr $ACC1, #-18 8555 1502 lsl $ACC1, #2 8556 29c9 srs @DSCR, $AX1.L @@ -1358,20 +1403,20 @@ 857d 009b 0018 lri $AX1.H, #0x0018 857f 8178 clr'l $ACC0 : $AC1.M, @$AR0 8580 0065 8586 bloop $IX1, 0x8586 -8582 35be andr'slnm $AC1.M, $AX0.H : $AC0.M, $AX1.H -8583 3793 andr'sl $AC1.M, $AX1.H : $AC1.M, $AX1.L +8582 35be lsrnrx'sn $ACC1, $AX0.H : @$AR2, $AC1.M +8583 3793 lsrnrx'mv $ACC1, $AX1.H : $AX0.L, $AC1.M 8584 f500 lsr16 $ACC1 8585 7017 addaxl'mv $ACC0, $AX0.L : $AX1.L, $AC1.M 8586 7278 addaxl'l $ACC0, $AX1.L : $AC1.M, @$AR0 8587 029c 858c jlnz 0x858c -8589 35be andr'slnm $AC1.M, $AX0.H : $AC0.M, $AX1.H +8589 35be lsrnrx'sn $ACC1, $AX0.H : @$AR2, $AC1.M 858a 1f1f mrr $AX0.L, $AC1.M 858b 7000 addaxl $ACC0, $AX0.L -858c 6d00 mov $ACC1, $AC0.L +858c 6d00 mov $ACC1, $ACC0 858d 0080 0408 lri $AR0, #0x0408 858f 009a 12df lri $AX0.H, #0x12df 8591 0098 acbd lri $AX0.L, #0xacbd -8593 4800 addax $ACC0, $AX0.L +8593 4800 addax $ACC0, $AX0 8594 1b1e srri @$AR0, $AC0.M 8595 1b1c srri @$AR0, $AC0.L 8596 009e fbca lri $AC0.M, #0xfbca @@ -1446,7 +1491,7 @@ 85fd 1b3e srri @$AR1, $AC0.M 85fe 029d 8602 jlz 0x8602 8600 02bf 8611 call 0x8611 -8602 16c9 0001 si @DSCR, #0x0001 +8602 16c9 0001 si @DSCR, #0x0001 // DMEM->CPU 8604 00de 0406 lr $AC0.M, @0x0406 8606 2ece srs @DSMAH, $AC0.M 8607 00de 0407 lr $AC0.M, @0x0407 @@ -1454,15 +1499,16 @@ 860a 16cd 040a si @DSPA, #0x040a 860c 16cb 0004 si @DSBL, #0x0004 860e 02bf 863d call 0x863d -8610 02df ret +8610 02df ret +} - -// No idea what this is either. +// No idea what this is either. +{ 8611 18da lrrd $AX0.H, @$AR2 8612 18db lrrd $AX1.H, @$AR2 8613 18dd lrrd $AC1.L, @$AR2 8614 18df lrrd $AC1.M, @$AR2 -8615 4c04 add'dr $ACC0, $AC1.L : $AR0 +8615 4c04 add'dr $ACC0, $ACC1 : $AR0 8616 1ffc mrr $AC1.M, $AC0.L 8617 3143 xorr'l $AC1.M, $AX0.H : $AX0.L, @$AR3 8618 f563 lsr16'l $ACC1 : $AC0.L, @$AR3 @@ -1473,18 +1519,18 @@ 861d 1423 lsl $ACC0, #-29 861e 146d lsr $ACC0, #-19 861f 1f5e mrr $AX0.H, $AC0.M -8620 04e0 addis $ACC0, #0xe0 -8621 6c1e mov'mv $ACC0, $AC1.L : $AX1.H, $AC0.M +8620 04e0 addis $AC0.M, #0xe0 +8621 6c1e mov'mv $ACC0, $ACC1 : $AX1.H, $AC0.M 8622 1c66 mrr $AR3, $IX2 -8623 3486 andr'sln $AC0.M, $AX0.H : $AC0.M, $AX0.L -8624 3786 andr'sln $AC1.M, $AX1.H : $AC0.M, $AX0.L -8625 4c52 add'l $ACC0, $AC1.L : $AX0.H, @$AR2 -8626 486b addax'l $ACC0, $AX0.L : $AC1.L, @$AR3 +8623 3486 lsrnrx'dr $ACC0, $AX0.H : $AR2 +8624 3786 lsrnrx'dr $ACC1, $AX1.H : $AR2 +8625 4c52 add'l $ACC0, $ACC1 : $AX0.H, @$AR2 +8626 486b addax'l $ACC0, $AX0 : $AC1.L, @$AR3 8627 1adc srrd @$AR2, $AC0.L 8628 1a5e srr @$AR2, $AC0.M 8629 183e lrr $AC0.M, @$AR1 862a 18bf lrrd $AC1.M, @$AR1 -862b 33d2 xorr'ld $AC1.M, $AX1.H : $AX0.L, $AX1.H, @$AR2 +862b 33d2 not'l $AC1.M : $AX0.H, @$AR2 862c 195b lrri $AX1.H, @$AR2 862d 365f andr'ln $AC0.M, $AX1.H : $AX1.H, @$AR3 862e 371e andr'mv $AC1.M, $AX1.H : $AX1.H, $AC0.M @@ -1492,7 +1538,7 @@ 8630 1aff srrd @$AR3, $AC1.M 8631 183e lrr $AC0.M, @$AR1 8632 3479 andr'l $AC0.M, $AX0.H : $AC1.M, @$AR1 -8633 339a xorr'slm $AC1.M, $AX1.H : $AC0.M, $AX1.L +8633 339a not'mv $AC1.M : $AX0.H, $AC0.M 8634 3705 andr'dr $AC1.M, $AX1.H : $AR1 8635 390a orr'ir $AC1.M, $AX0.H : $AR2 8636 1bff srrn @$AR3, $AC1.M @@ -1502,21 +1548,26 @@ 863a f557 lsr16'ln $ACC1 : $AX0.H, @$AR3 863b 197f lrri $AC1.M, @$AR3 863c 02df ret +} - -// waits for DMA control reg - probably completion. +// waits for DMA completion. +void 863d_WaitForDMAend() +{ 863d 00df ffc9 lr $AC1.M, @DSCR 863f 03c0 0004 andcf $AC1.M, #0x0004 8641 029d 863d jlz 0x863d -8643 02df ret +8643 02df ret +} - -// This one does some DMA-ing. +// This one does some DMA-ing. +// jump here from ZeldaLightTypeUcode (light type... Luigi Mansion, Pikmin 1 (U), IPL ucode) +void 8644_Irom() +{ 8644 8e00 set16 8645 0081 0800 lri $AR1, #0x0800 8647 0092 00ff lri $CR, #0x00ff 8649 00df 0403 lr $AC1.M, @0x0403 -864b 0503 addis $ACC1, #0x03 +864b 0503 addis $AC1.M, #0x03 864c 156e lsr $ACC1, #-18 864d 1502 lsl $ACC1, #2 864e 29c9 srs @DSCR, $AX1.L @@ -1526,6 +1577,7 @@ 8654 2ecf srs @DSMAL, $AC0.M 8655 00e1 ffcd sr @DSPA, $AR1 8657 2dcb srs @DSBL, $AC1.L + 8658 02bf 863d call 0x863d 865a 29d1 srs @SampleFormat, $AX1.L 865b 29d4 srs @ACSAH, $AX1.L @@ -1548,20 +1600,22 @@ 8676 009b 0018 lri $AX1.H, #0x0018 8678 8179 clr'l $ACC0 : $AC1.M, @$AR1 8679 0066 867f bloop $IX2, 0x867f -867b 35bc andr'lsnm $AC1.M, $AX0.H : $AX1.H, $AC0.M -867c 3793 andr'sl $AC1.M, $AX1.H : $AC1.M, $AX1.L -867d f500 lsr16 $ACC1 -867e 7017 addaxl'mv $ACC0, $AX0.L : $AX1.L, $AC1.M -867f 7279 addaxl'l $ACC0, $AX1.L : $AC1.M, @$AR1 +{ + 867b 35bc lsrnrx'sn $ACC1, $AX0.H : @$AR0, $AC1.M + 867c 3793 lsrnrx'mv $ACC1, $AX1.H : $AX0.L, $AC1.M + 867d f500 lsr16 $ACC1 + 867e 7017 addaxl'mv $ACC0, $AX0.L : $AX1.L, $AC1.M + 867f 7279 addaxl'l $ACC0, $AX1.L : $AC1.M, @$AR1 +} 8680 029c 8685 jlnz 0x8685 -8682 35bc andr'lsnm $AC1.M, $AX0.H : $AX1.H, $AC0.M +8682 35bc lsrnrx'sn $ACC1, $AX0.H : @$AR0, $AC1.M 8683 1f1f mrr $AX0.L, $AC1.M 8684 7000 addaxl $ACC0, $AX0.L -8685 6d00 mov $ACC1, $AC0.L +8685 6d00 mov $ACC1, $ACC0 8686 0081 0408 lri $AR1, #0x0408 8688 009a 170a lri $AX0.H, #0x170a 868a 0098 7489 lri $AX0.L, #0x7489 -868c 4800 addax $ACC0, $AX0.L +868c 4800 addax $ACC0, $AX0 868d 1b3e srri @$AR1, $AC0.M 868e 1b3c srri @$AR1, $AC0.L 868f 009e 05ef lri $AC0.M, #0x05ef @@ -1602,18 +1656,20 @@ 86c2 199a lrrn $AX0.H, @$AR0 86c3 1c65 mrr $AR3, $IX1 86c4 0079 86cf bloop $AX1.L, 0x86cf -86c6 02bf 86e5 call 0x86e5 -86c8 1fb9 mrr $AC1.L, $AX1.L -86c9 1f46 mrr $AX0.H, $IX2 -86ca 1c65 mrr $AR3, $IX1 -86cb 02bf 86e5 call 0x86e5 -86cd 1fb9 mrr $AC1.L, $AX1.L -86ce 1f46 mrr $AX0.H, $IX2 -86cf 1c65 mrr $AR3, $IX1 +{ + 86c6 02bf 86e5 call 0x86e5 + 86c8 1fb9 mrr $AC1.L, $AX1.L + 86c9 1f46 mrr $AX0.H, $IX2 + 86ca 1c65 mrr $AR3, $IX1 + 86cb 02bf 86e5 call 0x86e5 + 86cd 1fb9 mrr $AC1.L, $AX1.L + 86ce 1f46 mrr $AX0.H, $IX2 + 86cf 1c65 mrr $AR3, $IX1 +} 86d0 029d 86d4 jlz 0x86d4 86d2 02bf 86e5 call 0x86e5 86d4 0088 ffff lri $WR0, #0xffff -86d6 16c9 0001 si @DSCR, #0x0001 +86d6 16c9 0001 si @DSCR, #0x0001 // DMEM->CPU 86d8 00de 0406 lr $AC0.M, @0x0406 86da 2ece srs @DSMAH, $AC0.M 86db 00de 0407 lr $AC0.M, @0x0407 @@ -1622,6 +1678,10 @@ 86e0 16cb 0004 si @DSBL, #0x0004 86e2 02bf 863d call 0x863d 86e4 02df ret +} + +//used by 8644_Irom() (Zelda Light) +{ 86e5 1999 lrrn $AX1.L, @$AR0 86e6 199c lrrn $AC0.L, @$AR0 86e7 1cdc mrr $IX2, $AC0.L @@ -1630,10 +1690,10 @@ 86ea f052 lsl16'l $ACC0 : $AX0.H, @$AR2 86eb 9106 asr16'dr $ACC0 : $AR2 86ec 1518 lsl $ACC1, #24 -86ed 3086 xorr'sln $AC0.M, $AX0.H : $AC0.M, $AX0.L +86ed 3086 xorc'dr $AC0.M, $AC1.M : $AR2 86ee 1ff9 mrr $AC1.M, $AX1.L 86ef 150c lsl $ACC1, #12 -86f0 3086 xorr'sln $AC0.M, $AX0.H : $AC0.M, $AX0.L +86f0 3086 xorc'dr $AC0.M, $AC1.M : $AR2 86f1 1f1e mrr $AX0.L, $AC0.M 86f2 18bc lrrd $AC0.L, @$AR1 86f3 193e lrri $AC0.M, @$AR1 @@ -1644,7 +1704,7 @@ 86f8 f543 lsr16'l $ACC1 : $AX0.L, @$AR3 86f9 18df lrrd $AC1.M, @$AR2 86fa 3300 xorr $AC1.M, $AX1.H -86fb 4d63 add'l $ACC1, $AC0.L : $AC0.L, @$AR3 +86fb 4d63 add'l $ACC1, $ACC0 : $AC0.L, @$AR3 86fc 7607 inc'dr $ACC0 : $AR3 86fd 1b7c srri @$AR3, $AC0.L 86fe 7042 addaxl'l $ACC0, $AX0.L : $AX0.L, @$AR2 @@ -1652,21 +1712,21 @@ 8700 145d lsr $ACC0, #29 8701 7c00 neg $ACC0 8702 f000 lsl16 $ACC0 -8703 04f8 addis $ACC0, #0xf8 +8703 04f8 addis $AC0.M, #0xf8 8704 1f5e mrr $AX0.H, $AC0.M -8705 0428 addis $ACC0, #0x28 -8706 6c1e mov'mv $ACC0, $AC1.L : $AX1.H, $AC0.M +8705 0428 addis $AC0.M, #0x28 +8706 6c1e mov'mv $ACC0, $ACC1 : $AX1.H, $AC0.M 8707 1408 lsl $ACC0, #8 8708 1c68 mrr $AR3, $WR0 -8709 3486 andr'sln $AC0.M, $AX0.H : $AC0.M, $AX0.L -870a 3786 andr'sln $AC1.M, $AX1.H : $AC0.M, $AX0.L -870b 4c52 add'l $ACC0, $AC1.L : $AX0.H, @$AR2 -870c 486b addax'l $ACC0, $AX0.L : $AC1.L, @$AR3 +8709 3486 lsrnrx'dr $ACC0, $AX0.H : $AR2 +870a 3786 lsrnrx'dr $ACC1, $AX1.H : $AR2 +870b 4c52 add'l $ACC0, $ACC1 : $AX0.H, @$AR2 +870c 486b addax'l $ACC0, $AX0 : $AC1.L, @$AR3 870d 1adc srrd @$AR2, $AC0.L 870e 1a5e srr @$AR2, $AC0.M 870f 183e lrr $AC0.M, @$AR1 8710 18bf lrrd $AC1.M, @$AR1 -8711 33d2 xorr'ld $AC1.M, $AX1.H : $AX0.L, $AX1.H, @$AR2 +8711 33d2 not'l $AC1.M : $AX0.H, @$AR2 8712 19fb lrrn $AX1.H, @$AR3 8713 365a andr'l $AC0.M, $AX1.H : $AX1.H, @$AR2 8714 371e andr'mv $AC1.M, $AX1.H : $AX1.H, $AC0.M @@ -1674,7 +1734,7 @@ 8716 1aff srrd @$AR3, $AC1.M 8717 183e lrr $AC0.M, @$AR1 8718 3679 andr'l $AC0.M, $AX1.H : $AC1.M, @$AR1 -8719 339e xorr'slnm $AC1.M, $AX1.H : $AC0.M, $AX1.L +8719 339e not'mv $AC1.M : $AX1.H, $AC0.M 871a 3505 andr'dr $AC1.M, $AX0.H : $AR1 871b 3b0a orr'ir $AC1.M, $AX1.H : $AR2 871c 1bff srrn @$AR3, $AC1.M @@ -1686,7 +1746,10 @@ 8722 312a xorr's $AC1.M, $AX0.H : @$AR2, $AC1.L 8723 3300 xorr $AC1.M, $AX1.H 8724 1adf srrd @$AR2, $AC1.M -8725 02df ret +8725 02df ret +} + +{ 8726 8e00 set16 8727 0081 0800 lri $AR1, #0x0800 8729 0092 00ff lri $CR, #0x00ff @@ -1720,16 +1783,18 @@ 8754 009b 0018 lri $AX1.H, #0x0018 8756 8179 clr'l $ACC0 : $AC1.M, @$AR1 8757 0066 875d bloop $IX2, 0x875d -8759 35bc andr'lsnm $AC1.M, $AX0.H : $AX1.H, $AC0.M -875a 3793 andr'sl $AC1.M, $AX1.H : $AC1.M, $AX1.L -875b f500 lsr16 $ACC1 -875c 7017 addaxl'mv $ACC0, $AX0.L : $AX1.L, $AC1.M -875d 7279 addaxl'l $ACC0, $AX1.L : $AC1.M, @$AR1 -875e 6d00 mov $ACC1, $AC0.L +{ + 8759 35bc lsrnrx'sn $ACC1, $AX0.H : @$AR0, $AC1.M + 875a 3793 lsrnrx'mv $ACC1, $AX1.H : $AX0.L, $AC1.M + 875b f500 lsr16 $ACC1 + 875c 7017 addaxl'mv $ACC0, $AX0.L : $AX1.L, $AC1.M + 875d 7279 addaxl'l $ACC0, $AX1.L : $AC1.M, @$AR1 +} +875e 6d00 mov $ACC1, $ACC0 875f 0081 0408 lri $AR1, #0x0408 8761 009a 298f lri $AX0.H, #0x298f 8763 0098 0b7f lri $AX0.L, #0x0b7f -8765 4800 addax $ACC0, $AX0.L +8765 4800 addax $ACC0, $AX0 8766 1b3e srri @$AR1, $AC0.M 8767 1b3c srri @$AR1, $AC0.L 8768 009e 4bf9 lri $AC0.M, #0x4bf9 @@ -1792,22 +1857,24 @@ 87bb 19da lrrn $AX0.H, @$AR2 87bc 1c65 mrr $AR3, $IX1 87bd 199f lrrn $AC1.M, @$AR0 -87be 4c5e add'ln $ACC0, $AC1.L : $AX1.H, @$AR2 +87be 4c5e add'ln $ACC0, $ACC1 : $AX1.H, @$AR2 87bf 1abc srrd @$AR1, $AC0.L 87c0 1b3e srri @$AR1, $AC0.M 87c1 0079 87cd bloop $AX1.L, 0x87cd -87c3 02bf 87df call 0x87df -87c5 199d lrrn $AC1.L, @$AR0 -87c6 18bc lrrd $AC0.L, @$AR1 -87c7 193e lrri $AC0.M, @$AR1 -87c8 19da lrrn $AX0.H, @$AR2 -87c9 1c65 mrr $AR3, $IX1 -87ca 199f lrrn $AC1.M, @$AR0 -87cb 4c5e add'ln $ACC0, $AC1.L : $AX1.H, @$AR2 -87cc 1abc srrd @$AR1, $AC0.L -87cd 1b3e srri @$AR1, $AC0.M +{ + 87c3 02bf 87df call 0x87df + 87c5 199d lrrn $AC1.L, @$AR0 + 87c6 18bc lrrd $AC0.L, @$AR1 + 87c7 193e lrri $AC0.M, @$AR1 + 87c8 19da lrrn $AX0.H, @$AR2 + 87c9 1c65 mrr $AR3, $IX1 + 87ca 199f lrrn $AC1.M, @$AR0 + 87cb 4c5e add'ln $ACC0, $ACC1 : $AX1.H, @$AR2 + 87cc 1abc srrd @$AR1, $AC0.L + 87cd 1b3e srri @$AR1, $AC0.M +} 87ce 02bf 87df call 0x87df -87d0 16c9 0001 si @DSCR, #0x0001 +87d0 16c9 0001 si @DSCR, #0x0001 // DMEM->CPU 87d2 00de 0406 lr $AC0.M, @0x0406 87d4 2ece srs @DSMAH, $AC0.M 87d5 00de 0407 lr $AC0.M, @0x0407 @@ -1816,12 +1883,15 @@ 87da 16cb 0004 si @DSBL, #0x0004 87dc 02bf 863d call 0x863d 87de 02df ret +} + +{ 87df 1ffc mrr $AC1.M, $AC0.L 87e0 3166 xorr'ln $AC1.M, $AX0.H : $AC0.L, @$AR2 87e1 f543 lsr16'l $ACC1 : $AX0.L, @$AR3 87e2 1ffe mrr $AC1.M, $AC0.M 87e3 3376 xorr'ln $AC1.M, $AX1.H : $AC0.M, @$AR2 -87e4 4d63 add'l $ACC1, $AC0.L : $AC0.L, @$AR3 +87e4 4d63 add'l $ACC1, $ACC0 : $AC0.L, @$AR3 87e5 7607 inc'dr $ACC0 : $AR3 87e6 1b7c srri @$AR3, $AC0.L 87e7 7046 addaxl'ln $ACC0, $AX0.L : $AX0.L, @$AR2 @@ -1829,15 +1899,15 @@ 87e9 145d lsr $ACC0, #29 87ea 7c0f neg'nr $ACC0 : $AR3 87eb f00f lsl16'nr $ACC0 : $AR3 -87ec 04f8 addis $ACC0, #0xf8 +87ec 04f8 addis $AC0.M, #0xf8 87ed 1f5e mrr $AX0.H, $AC0.M -87ee 0428 addis $ACC0, #0x28 -87ef 6c1e mov'mv $ACC0, $AC1.L : $AX1.H, $AC0.M +87ee 0428 addis $AC0.M, #0x28 +87ef 6c1e mov'mv $ACC0, $ACC1 : $AX1.H, $AC0.M 87f0 1408 lsl $ACC0, #8 -87f1 3485 andr'lsn $AC0.M, $AX0.H : $AX0.L, $AC1.M -87f2 37d9 andr'ldm $AC1.M, $AX1.H : $AX0.L, $AX1.H, @$AR1 -87f3 4c52 add'l $ACC0, $AC1.L : $AX0.H, @$AR2 -87f4 4853 addax'l $ACC0, $AX0.L : $AX0.H, @$AR3 +87f1 3485 lsrnrx'dr $ACC0, $AX0.H : $AR1 +87f2 37d9 lsrnrx'l $ACC1, $AX1.H : $AX1.H, @$AR1 +87f3 4c52 add'l $ACC0, $ACC1 : $AX0.H, @$AR2 +87f4 4853 addax'l $ACC0, $AX0 : $AX0.H, @$AR3 87f5 1bdc srrn @$AR2, $AC0.L 87f6 1b5e srri @$AR2, $AC0.M 87f7 325f xorr'ln $AC0.M, $AX1.H : $AX1.H, @$AR3 @@ -1850,22 +1920,25 @@ 87fe 183b lrr $AX1.H, @$AR1 87ff 3653 andr'l $AC0.M, $AX1.H : $AX0.H, @$AR3 8800 18bf lrrd $AC1.M, @$AR1 -8801 339e xorr'slnm $AC1.M, $AX1.H : $AC0.M, $AX1.L +8801 339e not'mv $AC1.M : $AX1.H, $AC0.M 8802 3571 andr'l $AC1.M, $AX0.H : $AC0.M, @$AR1 8803 3b05 orr'dr $AC1.M, $AX1.H : $AR1 8804 f557 lsr16'ln $ACC1 : $AX0.H, @$AR3 8805 193f lrri $AC1.M, @$AR1 8806 345f andr'ln $AC0.M, $AX0.H : $AX1.H, @$AR3 -8807 339a xorr'slm $AC1.M, $AX1.H : $AC0.M, $AX1.L +8807 339a not'mv $AC1.M : $AX0.H, $AC0.M 8808 370a andr'ir $AC1.M, $AX1.H : $AR2 8809 392e orr'sn $AC1.M, $AX0.H : @$AR2, $AC1.L 880a 1b5f srri @$AR2, $AC1.M 880b 02df ret +} + +{ 880c 8e00 set16 880d 0081 0800 lri $AR1, #0x0800 880f 0092 00ff lri $CR, #0x00ff 8811 00df 0403 lr $AC1.M, @0x0403 -8813 0503 addis $ACC1, #0x03 +8813 0503 addis $AC1.M, #0x03 8814 156e lsr $ACC1, #-18 8815 1502 lsl $ACC1, #2 8816 29c9 srs @DSCR, $AX1.L @@ -1897,20 +1970,20 @@ 883e 009b 0018 lri $AX1.H, #0x0018 8840 8179 clr'l $ACC0 : $AC1.M, @$AR1 8841 0066 8847 bloop $IX2, 0x8847 -8843 35bc andr'lsnm $AC1.M, $AX0.H : $AX1.H, $AC0.M -8844 3793 andr'sl $AC1.M, $AX1.H : $AC1.M, $AX1.L +8843 35bc lsrnrx'sn $ACC1, $AX0.H : @$AR0, $AC1.M +8844 3793 lsrnrx'mv $ACC1, $AX1.H : $AX0.L, $AC1.M 8845 f500 lsr16 $ACC1 8846 7017 addaxl'mv $ACC0, $AX0.L : $AX1.L, $AC1.M 8847 7279 addaxl'l $ACC0, $AX1.L : $AC1.M, @$AR1 8848 029c 884d jlnz 0x884d -884a 35bc andr'lsnm $AC1.M, $AX0.H : $AX1.H, $AC0.M +884a 35bc lsrnrx'sn $ACC1, $AX0.H : @$AR0, $AC1.M 884b 1f1f mrr $AX0.L, $AC1.M 884c 7000 addaxl $ACC0, $AX0.L -884d 6d00 mov $ACC1, $AC0.L +884d 6d00 mov $ACC1, $ACC0 884e 0081 0408 lri $AR1, #0x0408 8850 009a 4ea2 lri $AX0.H, #0x4ea2 8852 0098 1e71 lri $AX0.L, #0x1e71 -8854 4800 addax $ACC0, $AX0.L +8854 4800 addax $ACC0, $AX0 8855 1b3e srri @$AR1, $AC0.M 8856 1b3c srri @$AR1, $AC0.L 8857 009e cc0a lri $AC0.M, #0xcc0a @@ -1959,22 +2032,24 @@ 8897 19da lrrn $AX0.H, @$AR2 8898 1c65 mrr $AR3, $IX1 8899 199d lrrn $AC1.L, @$AR0 -889a 4c5a add'l $ACC0, $AC1.L : $AX1.H, @$AR2 +889a 4c5a add'l $ACC0, $ACC1 : $AX1.H, @$AR2 889b 1abc srrd @$AR1, $AC0.L 889c 1b3e srri @$AR1, $AC0.M 889d 0079 88a9 bloop $AX1.L, 0x88a9 -889f 02bf 88bb call 0x88bb -88a1 199f lrrn $AC1.M, @$AR0 -88a2 18bc lrrd $AC0.L, @$AR1 -88a3 193e lrri $AC0.M, @$AR1 -88a4 19da lrrn $AX0.H, @$AR2 -88a5 1c65 mrr $AR3, $IX1 -88a6 199d lrrn $AC1.L, @$AR0 -88a7 4c5a add'l $ACC0, $AC1.L : $AX1.H, @$AR2 -88a8 1abc srrd @$AR1, $AC0.L -88a9 1b3e srri @$AR1, $AC0.M +{ + 889f 02bf 88bb call 0x88bb + 88a1 199f lrrn $AC1.M, @$AR0 + 88a2 18bc lrrd $AC0.L, @$AR1 + 88a3 193e lrri $AC0.M, @$AR1 + 88a4 19da lrrn $AX0.H, @$AR2 + 88a5 1c65 mrr $AR3, $IX1 + 88a6 199d lrrn $AC1.L, @$AR0 + 88a7 4c5a add'l $ACC0, $ACC1 : $AX1.H, @$AR2 + 88a8 1abc srrd @$AR1, $AC0.L + 88a9 1b3e srri @$AR1, $AC0.M +} 88aa 02bf 88bb call 0x88bb -88ac 16c9 0001 si @DSCR, #0x0001 +88ac 16c9 0001 si @DSCR, #0x0001 // DMEM->CPU 88ae 00de 0406 lr $AC0.M, @0x0406 88b0 2ece srs @DSMAH, $AC0.M 88b1 00de 0407 lr $AC0.M, @0x0407 @@ -1982,10 +2057,13 @@ 88b4 16cd 040a si @DSPA, #0x040a 88b6 16cb 0004 si @DSBL, #0x0004 88b8 02bf 863d call 0x863d -88ba 02df ret +88ba 02df ret +} + +{ 88bb 19d8 lrrn $AX0.L, @$AR2 88bc 19da lrrn $AX0.H, @$AR2 -88bd 4856 addax'ln $ACC0, $AX0.L : $AX0.H, @$AR2 +88bd 4856 addax'ln $ACC0, $AX0 : $AX0.H, @$AR2 88be 1ffc mrr $AC1.M, $AC0.L 88bf 3156 xorr'ln $AC1.M, $AX0.H : $AX0.H, @$AR2 88c0 f543 lsr16'l $ACC1 : $AX0.L, @$AR3 @@ -1997,13 +2075,13 @@ 88c6 1423 lsl $ACC0, #-29 88c7 146d lsr $ACC0, #-19 88c8 1f5e mrr $AX0.H, $AC0.M -88c9 04e0 addis $ACC0, #0xe0 +88c9 04e0 addis $AC0.M, #0xe0 88ca 001f addarn $AR3, $IX3 -88cb 6c1e mov'mv $ACC0, $AC1.L : $AX1.H, $AC0.M -88cc 3485 andr'lsn $AC0.M, $AX0.H : $AX0.L, $AC1.M -88cd 37d9 andr'ldm $AC1.M, $AX1.H : $AX0.L, $AX1.H, @$AR1 -88ce 4c52 add'l $ACC0, $AC1.L : $AX0.H, @$AR2 -88cf 4853 addax'l $ACC0, $AX0.L : $AX0.H, @$AR3 +88cb 6c1e mov'mv $ACC0, $ACC1 : $AX1.H, $AC0.M +88cc 3485 lsrnrx'dr $ACC0, $AX0.H : $AR1 +88cd 37d9 lsrnrx'l $ACC1, $AX1.H : $AX1.H, @$AR1 +88ce 4c52 add'l $ACC0, $ACC1 : $AX0.H, @$AR2 +88cf 4853 addax'l $ACC0, $AX0 : $AX0.H, @$AR3 88d0 1bdc srrn @$AR2, $AC0.L 88d1 1b5e srri @$AR2, $AC0.M 88d2 325f xorr'ln $AC0.M, $AX1.H : $AX1.H, @$AR3 @@ -2014,33 +2092,32 @@ 88d7 3200 xorr $AC0.M, $AX1.H 88d8 1b5e srri @$AR2, $AC0.M 88d9 183f lrr $AC1.M, @$AR1 -88da 339e xorr'slnm $AC1.M, $AX1.H : $AC0.M, $AX1.L +88da 339e not'mv $AC1.M : $AX1.H, $AC0.M 88db 18be lrrd $AC0.M, @$AR1 88dc 3753 andr'l $AC1.M, $AX1.H : $AX0.H, @$AR3 88dd 341f andr'mv $AC0.M, $AX0.H : $AX1.H, $AC1.M 88de 3a79 orr'l $AC0.M, $AX1.H : $AC1.M, @$AR1 88df f405 lsr16'dr $ACC0 : $AR1 -88e0 33d3 xorr'ld $AC1.M, $AX1.H : $AX0.L, $AX1.H, @$AR3 +88e0 33d3 not'l $AC1.M : $AX0.H, @$AR3 88e1 3571 andr'l $AC1.M, $AX0.H : $AC0.M, @$AR1 88e2 0009 iar $AR1 88e3 183b lrr $AX1.H, @$AR1 88e4 361b andr'mv $AC0.M, $AX1.H : $AX0.H, $AC1.M 88e5 387a orr'l $AC0.M, $AX0.H : $AC1.M, @$AR2 88e6 18dd lrrd $AC1.L, @$AR2 -88e7 4c05 add'dr $ACC0, $AC1.L : $AR1 +88e7 4c05 add'dr $ACC0, $ACC1 : $AR1 88e8 1b5e srri @$AR2, $AC0.M 88e9 1a5c srr @$AR2, $AC0.L 88ea 02df ret - +} 88eb 0000 nop 88ec 0000 nop 88ed 0000 nop 88ee 0000 nop -88ef 0000 nop - - // 08f0 to 0ffd = invalid data +88ef 0000 nop +// 08f0 to 0ffd = invalid data 8ffe 06e2 cmpis $ACC0, #0xe2 8fff 8845 nx'ln : $AX0.L, @$AR1