Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8837 from Tilka/dsp
DSPSpy: fix register editing using GC pad on Wii
  • Loading branch information
Tilka committed May 31, 2020
2 parents b805c35 + b0258af commit 4fc8674
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion Source/Core/Core/DSP/Interpreter/DSPIntArithmetic.cpp
Expand Up @@ -770,7 +770,6 @@ void movr(const UDSPInstruction opc)
break;
}
ax <<= 16;
ax &= ~0xffff;

ZeroWriteBackLog();

Expand Down
18 changes: 9 additions & 9 deletions Source/Core/Core/DSP/Interpreter/DSPIntMisc.cpp
Expand Up @@ -110,7 +110,7 @@ void addarn(const UDSPInstruction opc)
//----

// SBCLR #I
// 0001 0011 aaaa aiii
// 0001 0010 aaaa aiii
// bit of status register $sr. Bit number is calculated by adding 6 to
// immediate value I.
void sbclr(const UDSPInstruction opc)
Expand All @@ -120,7 +120,7 @@ void sbclr(const UDSPInstruction opc)
}

// SBSET #I
// 0001 0010 aaaa aiii
// 0001 0011 aaaa aiii
// Set bit of status register $sr. Bit number is calculated by adding 6 to
// immediate value I.
void sbset(const UDSPInstruction opc)
Expand All @@ -133,24 +133,24 @@ void sbset(const UDSPInstruction opc)
void srbith(const UDSPInstruction opc)
{
ZeroWriteBackLog();
switch ((opc >> 8) & 0xf)
switch ((opc >> 8) & 0x7)
{
case 0xa: // M2
case 2: // M2
g_dsp.r.sr &= ~SR_MUL_MODIFY;
break;
case 0xb: // M0
case 3: // M0
g_dsp.r.sr |= SR_MUL_MODIFY;
break;
case 0xc: // CLR15
case 4: // CLR15
g_dsp.r.sr &= ~SR_MUL_UNSIGNED;
break;
case 0xd: // SET15
case 5: // SET15
g_dsp.r.sr |= SR_MUL_UNSIGNED;
break;
case 0xe: // SET16 (CLR40)
case 6: // SET16 (CLR40)
g_dsp.r.sr &= ~SR_40_MODE_BIT;
break;
case 0xf: // SET40
case 7: // SET40
g_dsp.r.sr |= SR_40_MODE_BIT;
break;
default:
Expand Down
6 changes: 2 additions & 4 deletions Source/DSPSpy/main_spy.cpp
Expand Up @@ -265,7 +265,7 @@ void ui_pad_sel(void)
ui_mode = UIM_EDIT_REG;
reg_value = &dspreg_in[cursor_reg];
}
#else
#endif
if (PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT)
cursor_reg += 8;
if (PAD_ButtonsDown(0) & PAD_BUTTON_LEFT)
Expand All @@ -280,7 +280,6 @@ void ui_pad_sel(void)
ui_mode = UIM_EDIT_REG;
reg_value = &dspreg_in[cursor_reg];
}
#endif
}

void ui_pad_edit_reg(void)
Expand All @@ -302,7 +301,7 @@ void ui_pad_edit_reg(void)
*reg_value = 0;
if (WPAD_ButtonsDown(0) & WPAD_BUTTON_2)
*reg_value = 0xffff;
#else
#endif
if (PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT)
small_cursor_x++;
if (PAD_ButtonsDown(0) & PAD_BUTTON_LEFT)
Expand All @@ -319,7 +318,6 @@ void ui_pad_edit_reg(void)
*reg_value = 0;
if (PAD_ButtonsDown(0) & PAD_BUTTON_Y)
*reg_value = 0xffff;
#endif
}

void handle_dsp_mail(void)
Expand Down

0 comments on commit 4fc8674

Please sign in to comment.