Rapid Fire/Hop [Vega]
#1
Rapid Fire/Hop [Vega]

This code will allow you to configure a button to use to implement Rapid Fire or Rapid Hop. It works for all controllers.

Also the code is gives you the ability of when to initiate the Rapid Fire/Hop and when to not. Thus, to fire items / hop normally, just use w/e button on your controller that is normally required for Item Usage/Hopping.

View the button map below on how to fill out values for the code. If configuring a button for Rapid Fire, it cannot be the same button that is used for Item Usage. If configuring a button for Rapid Hop, it cannot be the same button that is used for Hopping (i.e. R button for GCN).

W values (needed for PAL code only):
4 = Non-GCN controller (Wheel, chuck, classic)
5 = GCN

XXXX values = Controller Address
ZZZZ values = Button for RF

Thread containing XXXX and ZZZZ values -> https://mkwii.com/showthread.php?tid=44

Important: If filling a ZZZZ value for GCN, used the Wavebird ZZZZ values!

R Value is rate of rapid fire/hop (in frames)
2 = Lowest amount possible (fastest it can be)

T Values:
4 = Rapid Fire
8 = Rapid Hop

NOTE: This code makes use of memory addresses 0x80000FCC thru 0x80000FCF. Make sure no other codes you have equipped are using those addresses.

Video - https://www.youtube.com/watch?v=CMU1NX4m804

NTSC-U
C251CE8C 00000007
3D808000 816C0FCC
280B000R 41800020
3D608034 A16BXXXX
716BZZZZ 41A20010
6000000T 39600000
916C0FCC B01E002C
60000000 00000000
C0000000 00000003
3D808000 816C0FCC
396B0001 916C0FCC
4E800020 00000000

PAL
C2521300 00000007
3D808000 816C0FCC
280B000R 41800020
3D60803W A16BXXXX
716BZZZZ 41A20010
6000000T 39600000
916C0FCC B01E002C
60000000 00000000
C0000000 00000003
3D808000 816C0FCC
396B0001 916C0FCC
4E800020 00000000

NTSC-J
C2520C80 00000007
3D808000 816C0FCC
280B000R 41800020
3D608034 A16BXXXX
716BZZZZ 41A20010
6000000T 39600000
916C0FCC B01E002C
60000000 00000000
C0000000 00000003
3D808000 816C0FCC
396B0001 916C0FCC
4E800020 00000000

NTSC-K
C250F324 00000007
3D808000 816C0FCC
280B000R 41800020
3D608033 A16BXXXX
716BZZZZ 41A20010
6000000T 39600000
916C0FCC B01E002C
60000000 00000000
C0000000 00000003
3D808000 816C0FCC
396B0001 916C0FCC
4E800020 00000000



Code creator: Vega
Code credits: Seeky (Timed Auto Usage & Input State structure)



Source:
1st ASM (C2)

#NTSC-U = 8051CE8C
#PAL = 80521300
#NTSC-J = 80520C80
#NTSC-K = 8050F324

#Check Frame Count
lis r12, 0x8000
lwz r11, 0x0FCC (r12)
cmplwi r11, 2 #2 used for compilation purposes, adjust this to your needs
blt- default_instruction

#Get Controller Button Halfword
lis r11, 0x8033 #NTSC-K GCN used for compilation purposes, adjust this to your needs
lhz r11, 0x6200 (r11)

#Check if desired button for RF/RH has at least been pressed
andi. r11, r11, 0x0800 #GCN Y button used for compilation purposes, adjust this to your needs
beq+ default_instruction

#RF/RH Button pressed+held, initiate Rapid Fire/Hop. Flip Item Usage/Hop bit high.
ori r0, r0, 0x0004 #RF used for compilation, adjust this to 0x0008 if doing RH

#Start cooldown period
li r11, 0
stw r11, 0x0FCC (r12)

#Default Instruction
default_instruction:
sth r0, 0x002C (r30) #Default instruction; Store the word containing Item Usage/Hop bits to memory

===

2nd ASM (C0)

lis r12, 0x8000 #Set EVA Upper
lwz r11, 0x0FCC (r12) #Get Frame Count
addi r11, r11, 1 #Increment Frame Count
stw r11, 0x0FCC (r12) #Update Frame Count
Reply
#2
Bump. Had some people on Discord wanting a Rapid Hop code. All that is needed on this code is to modify what bit gets flipped high in the Input State Structure. Thus simply adding in another value for the user to fill in now allows them to choose Rapid Fire or Rapid Hop. There are other bits that can be implemented but they are useless, but if anyone cares, here is the Input State structure, credits to Seeky.

Code:
uint16_t buttonActions; // bit flags:
    /*
      0x1 = accelerate
      0x2 = brake + reverse (used for SSMT)
      0x4 = use item
      0x8 = hop + drift
      0x20 = rear-view camera
    */
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)