Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Exp points holds your group address, coins hold your room address. You can edit the exp points by holding L, then pressing dpad up or down to add/subtract. Holding R, then pressing dpad up or down will subtract from your coin count. Hold L + R while walking through a loading zone for the code to warp you to group (exp points value) and room (last byte of coins value) that has been specified. A + B + dpad up with 0 out the star points and coins, so you can always reset it back to 0 easily. Probably lots of optimizations to be made, may get around to it some time later.
- For Group Values and Valid Room Values: https://pastebin.com/Fp4C3c1u
- 00: LUI t1, 0x8007
- 04: LHU t1, 0x4006 (t1) //Buttons Held
- 08: ori t2, r0, 0x0820 //load dpad up + L value into t2
- 0C: ori t3, r0, 0x0420 //load dpad down + L value into t3
- 10: ori t7, r0, 0x0810 //load dpad up + r value into t7
- 14: ori v1, r0, 0x0410 //load dpad down + r value into v1
- 18: BEQ t7, t1, 0x804000E4 //branch to setting up stuff for R button
- 1C: nop
- 20: BEQ v1, t1, 0x804000E4 //branch to setting up stuff for R button
- 24: LUI t4, 0x8010
- 28: ORI t4, t4, 0xF460 //load exp address into t4
- 2C: LB t5, 0x0000 (t4) //load exp value into t5
- 30: LUI t6, 0x8007
- 34: ORI t6, t6, 0x408B //load group value into t6
- 38: BEQ t2, t1, 0x804000B4 //(branch to if L + Dpad up is pressed)
- 3C: nop
- 40: BEQ t3, t1, 0x804000CC //(branch to L + dpad down is pressed)
- 44: ORI t2, r0, 0xC800
- 48: BEQ t1, t2, 0x80400120
- %4C: nop
- %if L + R is held, load exp value and coin value into group address and room address
- 50: LUI t1, 0x8007 //take execution here after exp code
- 54: LHU t1, 0x4006 (t1) //load button value
- 58: ORI t2, r0, 0x0030 //load R + L button value into t2
- 5C: BNE t2, t1, 0x80400118 //if t2 =/= t1, (branch to ra)
- 60: NOP
- 64: LUI t1, 0x8007
- 68: ORI t1, t1, 0x408B //group address
- 6C: LUI t2, 0x8007
- 70: ORI t2, t2, 0x4091 //room address
- 74: LUI t3, 0x8010
- 78: ORI t3, t3, 0xF460 //exp address
- 7C: LUI t4, 0x8010
- 80: ORI t4, t4, 0xF45D //coin address second byte
- 84: LB t5, 0x0000 (t3)
- 88: SB t5, 0x0000 (t1)
- 8C: LB t5, 0x0000 (t4)
- 90: SB t5, 0x0000 (t2)
- 94: J 0x80400118
- 98: nop
- %add 1 to exp/coin
- 9C: ADDI t7, t5, 0x0001 //add one to exp count
- A0: J 0x80400118
- A4: SB t7, 0x0000 (t4) //store new exp count into exp address
- %subtract 1 from exp/coin
- A8: ADDI t5, t5, 0xFFFF //subtract 1 from exp value
- AC: J 0x80400118
- B0: SB t5, 0x0000 (t4) //store subtracted value into exp address
- %if L then dpad up is pressed
- B4: LUI t1, 0x8007
- B8: LHU t1, 0x4016 (t1)
- BC: ori t2, r0, 0x0800 //load dpad up value into t2
- C0: BEQ t1, t2, 0x8040009C //go to add 1 if dpad up + L is pressed
- C4: nop
- C8: J 0x80400118
- %if L then dpad down is pressed
- CC: LUI t1, 0x8007
- D0: LHU t1, 0x4016 (t1)
- D4: ori t2, r0, 0x0400 //load dpad down value into t2
- D8: BEQ t1, t2, 0x804000A8 //go to subtract 1
- DC: nop
- E0: J 0x80400118
- %if R + dpad up is pressed or R + dpad down (setting up registers)
- E4: LUI t4, 0x8010 //both R instances come here, then split to add/subtract at BEQ
- E8: ORI t4, t4, 0xF45D //load coin address into t4
- EC: LB t5, 0x0000 (t4) //load coin value into t5
- F0: LUI t6, 0x8007
- F4: ORI t6, t6, 0x4091 //load room address into t6
- F8: LUI t1, 0x8007
- FC: LHU t1, 0x4016 (t1) //load button 1 frame into t1
- 100: ORI t2, r0, 0x0800 //dpad up value
- 104: ORI t3, r0, 0x0400 //dpad down value
- 108: BEQ t2, t1 0x8040009C
- 10C: nop
- 110: BEQ t3, t1 0x804000A8
- 114: nop
- 118: jr ra
- 11C: nop
- %0 out star points and coins (A + B + Dpad Up)
- 120: LUI t1, 0x8010
- 124: ORI t1, t1, 0xF460 //exp address
- 128: LUI t2, 0x8010
- 12C: ORI t2, t2, 0xF45C //coin address second byte
- 130: SB r0, 0x0000 (t1)
- 134: SH r0, 0x0000 (t2)
- 138: J 0x80400118
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement