Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Code Description: Drops items as if you were getting squished by holding down a button. Please note that gecko code types are used to handle buttons. The source above is for the main code itself. Please note that you will need the code located here: https://pastebin.com/NsrpbwqB in order to make it work online.
- Instructions start at: 0x8079093C: add r3, r3, r0
- ;Using macros to make function calling cleaner
- .macro CALL symbol
- lis r18,\symbol@h
- ori r18,r18,\symbol@l
- mtctr r18
- bctrl
- .endm
- .set dropItemEquip, 0x8078FA24
- code:
- .include "push.s"
- mr r15, r0 ;Backup r0
- mr r16, r3 ;Backup r3
- mr r17, r4 ;Backup r4
- lis r18, 0x8000
- ori r18, r18, 0x1500 ;r18 now contains 0x80001500
- lwz r18, 4(r18) ;Get our player index from 0x80001504
- cmpw r27, r18 ;The code is being iterated, so we check the current counter which is in r27
- bne DoNotDrop ;Skip rest of code if it does not equal our player index
- lwz r3, 0x14(r30) ;Load the pointer needed for the dropItemEquip function
- add r3, r3, r0 ;r0 contains the calculated offset based on the counter, so we add it to the pointer obtained above
- lwz r18,0x10(r3) ;We will use a buffer so items will not drop every frame
- ;Thus we keep a counter and obtain it from a location in memory that is not in use
- addi r18, r18, 1 ;Increment the counter
- stw r18,0x10(r3) ;Store the counter back into the same location
- cmpwi r18, 15 ;Check counter if it has reached a certain value (change this to increase or decrease the drop speed)
- blt DoNotDrop ;Skip the function call if it is less than the value above
- li r18, 0 ;Reset counter
- stw r18,0x10(r3) ;Store counter back into memory
- li r4, 12 ;arg2 is always 12 it seems
- CALL dropItemEquip ;Call the dropItemEquip function
- DoNotDrop:
- mr r0, r15 ;Restore r0
- mr r3, r16 ;Restore r3
- mr r4, r17 ;Restore r4
- .include "pop.s"
- add r3, r3, r0 ;Original instruction
- Finished product:
- Drop Any Item -Fishguy6564- [NTSC-U]
- 0479093C 7C630214
- 28XXXXXX YYYYYYYY
- C279093C 00000010
- 9421FFB0 BDC10008
- 7C0F0378 7C701B78
- 7C912378 3E408000
- 62521500 82520004
- 7C1B9000 4082003C
- 807E0014 7C630214
- 82430010 3A520001
- 92430010 2C12000F
- 41800020 3A400000
- 92430010 3880000C
- 3E408078 6252FA24
- 7E4903A6 4E800421
- 7DE07B78 7E038378
- 7E248B78 B9C10008
- 38210050 7C630214
- 60000000 00000000
- E0000000 80008000
- XX = Button Address
- YY = Button State
- Drop Any Item -Fishguy6564- [PAL]
- 04799948 7C630214
- 28XXXXXX YYYYYYYY
- C2799948 00000010
- 9421FFB0 BDC10008
- 7C0F0378 7C701B78
- 7C912378 3E408000
- 62521500 82520004
- 7C1B9000 4082003C
- 807E0014 7C630214
- 82430010 3A520001
- 92430010 2C12000F
- 41800020 3A400000
- 92430010 3880000C
- 3E408079 62528A30
- 7E4903A6 4E800421
- 7DE07B78 7E038378
- 7E248B78 B9C10008
- 38210050 7C630214
- 60000000 00000000
- E0000000 80008000
- XX = Button Address
- YY = Button State
- To change the speed of items being dropped, edit 2C12000F.
- Replace the Z values as seen here:
- 2C12ZZZZ
- where 0 <= Z <= 0x7FFF
- The larger the value, the slower it drops.
- The smaller the value, the faster it drops.
- If anyone is interested to port and test, then I will be happy to include it on this paste. You will be credited if ported correctly.
- Anyways, Enjoy the code!
- Current available regions:
- NTSC-U: ✓
- NTSC-J: X
- NTSC-K: X
- PAL: ✓ ported by D3A01000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement