This C2 code assumes the Gecko OS 1931 code handler. It patches the "frozen" test and when the game is frozen (pause or breakpoint) it shuts off the DSP DMA. When the game starts running again, the DSP DMA is re-enabled. In a few days, this will be integrated into Gecko.NET's debugger patches, and it will support 1931 and 1932 handlers.
You can check the hook to make sure you have 1931.
===============================
1931 CODE HANDLER
80001ED0: 2C040000 cmpwi r4,0
---
C2001ED0 00000004
2C040000 3D80CC00
A06C5036 60638000
41820008 70637FFF
B06C5036 00000000
===============================
1932 CODE HANDLER
80001F50: 2C040000 cmpwi r4,0
---
C2001F50 00000004
2C040000 3D80CC00
A06C5036 60638000
41820008 70637FFF
B06C5036 00000000
===============================
GECKO OS MOD 0.92 CODE HANDLER
80001F48: 2C040000 cmpwi r4,0
---
C2001F48 00000004
2C040000 3D80CC00
A06C5036 60638000
41820008 70637FFF
B06C5036 00000000
===============================
SOURCE
.set DSP_DMA_CTRL,0xCC005036
cmpwi r4,0
# load DMA value
lis r12,DSP_DMA_CTRL@ha
lhz r3,DSP_DMA_CTRL@l(r12)
# pre-enable DMA, and disable if frozen
ori r3,r3,0x8000
# the cmpwi r4 at the beginning is tested here
beq- 0f
# disable DMA
andi. r3,r3,0x7FFF # clear CTRL bit
0:
sth r3,DSP_DMA_CTRL@l(r12)
Awesome, nice work!
thought it´s not possible since nobody ever tried to mute it.
Awesome, like it! ;D
The beep was fun but it´s even better to remove it. :smileyface:
It´s time for some gecko.net upgrades I guess.
Hope you can do it soon :D
Alternative: turn the volume off.
Ocarina Codehandler Support (USB Loader)
C2001F28 00000007
887F1807 989F1807
7C032000 41820020
3D80CC00 A06C5036
60638000 2C040000
41820008 70637FFF
B06C5036 2C040000
60000000 00000000
Tested and works.
lol, nice port deathwolf ;D
dcx2´s code works for my USB Loader.
---
Nice try, dcx2.
Setting a breakpoint freezes the game completely (it can´t be resumed anymore)... ???
well, homebrew is so error prone... :(
hmm on gx it doesn't work. Only the ported code works.
dcx2's code works on neogamma too.
This would freez nothing. (No beep or freezing)
04001F28 2C080000
Quote from: Deathwolf on August 13, 2011, 11:14:18 PM
dcx2's code works on neogamma too.
and on config. usb loader.
All Codehandlers
F6000001 8000817F
80920000 2C040000
D2000004 00000007
887F1807 989F1807
7C032000 41820020
3D80CC00 A06C5036
60638000 2C040000
41820008 70637FFF
B06C5036 2C040000
60000000 00000000
lol, F6 fail. F6 code starts searching at 80003000. This hook is located at 80001ED0: 2C040000 cmpwi r4,0. F6 code will never find this hook. (also, F6 codes can use 80008180 safely, there's no need to put 817F)
In order for this code to work for you, you MUST be using the 1931 handler! If you go to 80001ED0 and do not see 2C040000 cmpwi r4,0 then it will not work for you.
cfg usb and neogamma use 1931 handler, AFAIK. Most USB loaders use pre-1931 handlers.
1932 handler will hook this address. 80001F50: 2C040000 cmpwi r4,0
So this C2 will work for 1932
C2001F50 00000007
887F1807 989F1807
7C032000 41820020
3D80CC00 A06C5036
60638000 2C040000
41820008 70637FFF
B06C5036 2C040000
60000000 00000000
oh fuck you are right. F6 can't search for this D: Actually it doesn't need to be a F6 code.
Don't worry, Gecko.NET will provide an option to automatically patch the debugger to get rid of the buzz, just like all the other debugger patches.
code works, but it seemed like the game crashes, when one sets a breakpoint on that hook, when the code is enabled.
Someone may want to check it out...
You set a breakpoint on the hook in the debugger? (i.e. on an address less than 80002800)
It's a bad idea to set breakpoints in the debugger. It can easily cause crashing.
Quote from: dcx2 on August 14, 2011, 12:06:42 AM
You set a breakpoint on the hook in the debugger? (i.e. on an address less than 80002800)
It's a bad idea to set breakpoints in the debugger. It can easily cause crashing.
Yes,
otherwise it doesn´t crash?
Got it! :eek:
Ok works perfect.
Backuploader (USB Loader) : Usb Loader GX, Neo Gamma , Ocarina
20001F28 2C040000
C2001F28 00000004
2C040000 3D80CC00
A06C5036 60638000
41820008 70637FFF
B06C5036 00000000
===============================
< 1931 CODE HANDLER
80001F28: 2C040000 cmpwi r4,0
---
C2001F28 00000004
2C040000 3D80CC00
A06C5036 60638000
41820008 70637FFF
B06C5036 00000000
---
===============================