Change combo after track vote
#10
(11-29-2020, 10:02 AM)Melg Wrote:
(11-29-2020, 03:05 AM)Vega Wrote: If you really want a customizeable version, I can make one. Something like the user fills in which combo they want for each track.

Hmm your message got my thinking that I could maybe check the button pressed at the address of your code; since there are 4 combos viable, I could assign each one to a d-pad input.

So instead of automatically assigning the combo, it would check which dpad is pressed (wouldn't change the combo or would default to funky flame if no press).
That seems like a possible solution, I'll look some more into it, thanks to you both.

EDIT: problem would be that lottery needs to be finished before the player can know which dpad input to press; so the perfect combo selection address would need to be called even after the lottery animation is done; well just have to test that I guess

EDIT 2: Came up with this:

C2661890 00000014
2C1F0002 40A20090
88B8003C 28050020
40800084 3C60809C
8063D70C A0A30032
88631917 2C030007
41820028 2C050008
41A20044 2C050001
41820044 2C050002
41820044 2C050004
41820044 48000048
2C050001 41A20020
2C050002 41820020
28058000 41820020
28054000 41820020
48000024 38A01617
48000018 38A00F16
48000010 38A01620
48000008 38A00D1E
B0B8001C 807D20D8
807DD918 00000000

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Vega's address = 80661890  #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Lottery Byte (r31) Check #
#      1 = Waiting        #
#      2 = Occuring      #
#~~~~~~~~~~~~~~~~~~~~~~~~~~#

cmpwi r31, 0x2 #Address gets called a lot, we only want to do checks when lottery is occurring
bne+ default_instruction

#~~~~~~~~~~~~~~~~~~~~~#
# Load Selected Track #
#~~~~~~~~~~~~~~~~~~~~~#

lbz r5, 0x003C (r24)

#~~~~~~~~~~~~~~~~~~~~~~~#
# Check If Battle Track #
#~~~~~~~~~~~~~~~~~~~~~~~#

cmplwi r5, 0x20 #Battle Track Values range from 0x20 thru 0x29
bge- default_instruction #If 0xFF, sequence has not begun; if 20 or more, skip

#~~~~~~~~~~~~~~~~~~~~~~~#
# Load INPUTDATA        #
#~~~~~~~~~~~~~~~~~~~~~~~#
lis r3, 0x809C
lwz r3, 0xffffd70c(r3)
lhz r5, 0x32(r3) #Get the button currently pressed
lbz r3, 0x1917 (r3) #Get the current controller

cmpwi r3, 0x7
beq- classic

#~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# D-Pad buttons attribution #
# Order: up left right down #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~#
cmpwi r5, 0x8
beq+ flame
cmpwi r5, 0x1
beq- mach
cmpwi r5, 0x2
beq- spear
cmpwi r5, 0x4
beq- magik
b default_instruction #If none of the dpad buttons are pressed, skip

classic:
cmpwi r5, 0x1
beq+ flame
cmpwi r5, 0x2
beq- mach
cmplwi r5, 0x8000
beq- spear
cmplwi r5, 0x4000
beq- magik
b default_instruction #If none of the dpad buttons are pressed, skip

#~~~~~~~~~~~~~~~#
# Combos labels #
#~~~~~~~~~~~~~~~#
flame:
li r5, 0x1617
b end

mach:
li r5, 0x0f16
b end

spear:
li r5, 0x1620
b end

magik:
li r5, 0x0d1e

#~~~~~#
# end #
#~~~~~#
end:
sth r5, 0x001C (r24) #Store the character/vehicle halfword value to spot in memory

#~~~~~~~~~~~~~~~~~~~~~#
# default instruction #
#~~~~~~~~~~~~~~~~~~~~~#
default_instruction:
lwz r3, 0x20D8 (r29)


Just tested it and it works just fine. This is obviously heavily based on Vega's code (full credit to him) and on Seeky's work on inputdata.h (not my 1st code that uses it, very useful findinds). Might want to add a "default" button for rooms, to come back to the combo selected at the start of the GP, most notably for karters, since this current solution only allows 4combos for now. Not sure how I would cleanly store said combo.

The code literally doesn't work though...

Steps to reproduce: Enable this gecko code and the wiimmfi patcher gecko code. Join a wiimmfi room. Choose flame runner. Hold down on the d-pad when a track is selected. Observe that you still have flame runner instead of magikruiser.

Am I doing something wrong?
Reply


Messages In This Thread
Change combo after track vote - by Melg - 11-26-2020, 11:46 PM
RE: Change combo after track vote - by Zeraora - 11-28-2020, 11:51 PM
RE: Change combo after track vote - by Vega - 11-29-2020, 03:05 AM
RE: Change combo after track vote - by Melg - 11-29-2020, 10:02 AM
RE: Change combo after track vote - by Melg - 11-30-2020, 11:52 PM
RE: Change combo after track vote - by lschlick - 06-15-2023, 07:55 AM
RE: Change combo after track vote - by lschlick - 06-15-2023, 06:50 AM
RE: Change combo after track vote - by Vega - 12-01-2020, 01:34 AM
RE: Change combo after track vote - by Melg - 12-02-2020, 07:13 PM
RE: Change combo after track vote - by Jerma - 11-27-2021, 01:10 AM
RE: Change combo after track vote - by Fifty - 06-18-2023, 05:22 AM
RE: Change combo after track vote - by Vega - 06-18-2023, 07:26 PM
RE: Change combo after track vote - by Fifty - 06-18-2023, 07:36 PM

Forum Jump:


Users browsing this thread: 7 Guest(s)