From 1ca874365b3bfe6d0ab6d8cbfbc1d34fa37abdeb Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sun, 21 Jun 2009 11:46:27 +0000 Subject: [PATCH] Unknown DSP opcode 0x02ca tested and figured out. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3522 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/DSPSpy/tests/op_test.ds | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Source/DSPSpy/tests/op_test.ds diff --git a/Source/DSPSpy/tests/op_test.ds b/Source/DSPSpy/tests/op_test.ds new file mode 100644 index 0000000000..cb75ffd77f --- /dev/null +++ b/Source/DSPSpy/tests/op_test.ds @@ -0,0 +1,41 @@ +; This test tries to figure out a couple of unknown opcodes. +incdir "tests" +include "dsp_base.inc" + +// 0x02ca is an unknown opcode found in Zelda ucodes. + +// 0x02ca logically shifts (not rotates) the whole ACC0 right by signed 16-bit value AC1.M +// (So, if AC1.M is negative, it shifts left). +// We'll call it lsrn, no arguments. +// 0x02cb is the same opcode, but arithmetic. +// We'll call it asrn, no arguments. + +clr $ACC0 +clr $ACC1 +lri $AC0.H, #0 +lri $AC0.M, #256 +//neg $ACC0 +lri $AC0.L, #1 +lri $AC1.H, #0xFF +lri $AC1.M, #1 +lri $AC1.L, #0xFF + +call send_back + +cw 0x02ca + +call send_back + +cw 0x02ca + +call send_back + +cw 0x02ca + +call send_back + +cw 0x02ca + +call send_back + +jmp end_of_test