News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

How to activate the meltdown alarm.

Started by interdpth, April 24, 2018, 09:05:20 PM

Previous topic - Next topic

interdpth

Forword, an ASM hack will be easier on you in the long run.

There are a ton of ways to do this,
For this alarm we will use the meltdown timer, which must be activated by the navigation pad sprite.
Hack example seen here: https://www.youtube.com/watch?v=KiBK6RlcJVo&feature=youtu.be

Quick Dissassembly on the trigger

Valuable addresses:
0x8060EEC     GetTimerType
0x802A310     FirstTimerrStuf
0x3000B87     EventCounter
0x030008D7   TimerType

         
PUSH    {LR}
//Check here to make sure alarm type 1 is triggered via event
BL      GetTimerType
LSLS    R0, R0, #0x18
LSRS    R0, R0, #0x18
CMP     R0, #1
BNE     EndRoutine
//Also make sure there's no active timer
LDR     R0, =TimerType
LDRB    R0, [R0]
CMP     R0, #0
BNE     EndRoutine
BL      TransferTimerDeets
MOVS    R0, #0x35
MOVS    R1, #0xA
BL      DoSomeMusicStuff
EndRoutine:       
LDR     R0, =CurrentEnemyData
ADDS    R0, #0x24
MOVS    R1, #0x1E
STRB    R1, [R0]
POP     {R0}
BX      R0

Now for this:

I'm not sure who coded GetTimerType but it's a bit weird. All events that can have an alarm are relative. There is a normal switch table to determine the events, however the condition is this  if ( EventCounter - 59 <= 0x31 ), this makes in the switch table 59==0

Then you do the normal switch arithmetic. So say you wanted to trigger the alarm after talking about the secret mission as in the video. We change the 59 to 86(0x56)
This exists at
08060EF4   SUBS    R0, #0x3B 

Overall if you're going to use this, I would suggest writing your own function to return the values. Otherwise you will have to know all events you will be using and replace the correct address in the jump table.