diff options
| author | hrydgard <hrydgard@gmail.com> | 2009-06-17 21:08:49 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2009-06-17 21:08:49 +0000 |
| commit | 28122e0a9ba0253c86228e2be9698f85f0ae529a (patch) | |
| tree | cb8ca17bd8a7eab2f8030d368a5b39e3ab904dcb /Source/Core/DSPCore/Src/DspIntLoadStore.cpp | |
| parent | 51cbdea782705f22053f6b15b2bcc4e99be305fb (diff) | |
Implement the findings about CR and lrs/srs in LLE plugin. Don't hear any difference in the few games i tried.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3480 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DSPCore/Src/DspIntLoadStore.cpp')
| -rw-r--r-- | Source/Core/DSPCore/Src/DspIntLoadStore.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/DSPCore/Src/DspIntLoadStore.cpp b/Source/Core/DSPCore/Src/DspIntLoadStore.cpp index 93396b43f8..9916245a7a 100644 --- a/Source/Core/DSPCore/Src/DspIntLoadStore.cpp +++ b/Source/Core/DSPCore/Src/DspIntLoadStore.cpp @@ -28,12 +28,15 @@ namespace DSPInterpreter { // 0010 1sss mmmm mmmm
// Store value from register $(0x18+S) to a memory pointed by address M.
// (8-bit sign extended).
+// ALTERNATIVELY: It now seems that the upper 8 bits are controlled
+// by CR, not sign extension.
// FIXME: Perform additional operation depending on destination register.
// Note: pc+=2 in duddie's doc seems wrong
void srs(const UDSPInstruction& opc)
{
u8 reg = ((opc.hex >> 8) & 0x7) + 0x18;
- u16 addr = (u16)(s16)(s8)opc.hex;
+// u16 addr = (u16)(s16)(s8)opc.hex;
+ u16 addr = (g_dsp.r[DSP_REG_CR] << 8) | (opc.hex & 0xFF);
dsp_dmem_write(addr, g_dsp.r[reg]);
}
@@ -41,12 +44,15 @@ void srs(const UDSPInstruction& opc) // 0010 0ddd mmmm mmmm
// Move value from data memory pointed by address M (8-bit sign
// extended) to register $(0x18+D).
+// ALTERNATIVELY: It now seems that the upper 8 bits are controlled
+// by CR, not sign extension.
// FIXME: Perform additional operation depending on destination register.
// Note: pc+=2 in duddie's doc seems wrong
void lrs(const UDSPInstruction& opc)
{
u8 reg = ((opc.hex >> 8) & 0x7) + 0x18;
- u16 addr = (u16)(s16)(s8)opc.hex;
+ //u16 addr = (u16)(s16)(s8)opc.hex;
+ u16 addr = (g_dsp.r[DSP_REG_CR] << 8) | (opc.hex & 0xFF);
g_dsp.r[reg] = dsp_dmem_read(addr);
}
|
