CC Tracker [JoshuaMK]
#3
(03-14-2020, 02:31 AM)TheNinjaKingOW Wrote: How would i specific make this track for 150cc? I'm very noobish with codes and want a faster bullet only for 150cc. I have gotten it to work with this code attached but, i dont know how to specify it.
c0000000 00000009
3d808000 896c5f27
3d40809b 2c0b00ec
6149d728 41820024
2c0b0010 6149c788
41820018 2c0b0054
3d20809a 6129bd68
41820008 61498f68
81690b6c 996c048b
4e800020 00000000
048b1138 43960000

This is right?

How you would do this in a non-ASM manner (with gecko codetypes) is you encapsulate the code you want to have be CC specific in an if-statement gecko codetype. More info on this can be found here: https://mkwii.com/showthread.php?tid=545&highlight=If+Codes

F
or now though, this is all you need to know for this use case, the 28 type means "if equal". With this in mind, we can set the if statement on the flag of the CC type, and have the faster bullet bill speeds be implemented if the cc is equal to the specified value, like so:



048B1138 43110000 <-Default value
2800048A 00000002 <-If CC is equal to 2 (150cc)
048B1138 43960000 <-"Poke" default value to be 43960000
E0000000 80008000 <-Final Terminator (Essentially ends the if block)



Lets deconstruct this shall we?

To start: 2800048A.

This is saying, if the halfword sized (<- VERY IMPORTANT) value at address 8000048A IS EQUAL: "poke" the value at address 808B1138 to be the new specified value of 43960000. It is extremely important to keep in mind that the value for the 28 type if-statement is ALWAYS halfword sized ("0123" for example), so to make a proper compare on the byte sized flag that the CC tracker code provides, you make the address for the compare be 1 less than the actual address of the byte to compare with (Also, make sure you have the byte storage be on an odd byte (which you do btw so don't worry about it this time, but for later times, odd bytes are: 1, 3, 5, 7, 9, B, D, F) because the codehandler will automatically "align" the if statement to be halfword aligned (so 28000005 would be translated to 28000004) which can cause the code to not ever access your value). So always keep this in mind.

Next is the 00000002.

This is the value to compare with, in this case, it is 2.
What is happening here is the value grabbed from above is compared to this value of 2. If they are equal, the code within the if statement executes.

Lastly, the E0000000 80008000.

Best thing to know what this is is to read up on Vega's well written post here: https://mkwii.com/showthread.php?tid=745




With these things in mind, this is the final code that only changes the bullet bill's speed when the flag is set to 2 (150cc):

C0000000 0000000A
3D808000 896C5F27
3D40809B 2C0B00EC
6149D728 41820024
2C0B0010 6149C788
41820018 2C0B0054
3D20809A 6129BD68
41820008 61498F68
81290000 2C090000
4D820020 81690B6C
996C0000 4E800020
048B1138 43110000
2800048A 00000002
048B1138 43960000
E0000000 80008000

I hope this has helped you understand how to create if-statements with gecko codes better Smile
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply


Messages In This Thread
CC Tracker [JoshuaMK] - by JoshuaMK - 03-08-2020, 04:19 AM
RE: CC Tracker [JoshuaMK] - by Zeraora - 03-14-2020, 02:31 AM
RE: CC Tracker [JoshuaMK] - by JoshuaMK - 03-14-2020, 03:28 AM
RE: CC Tracker [JoshuaMK] - by jawa - 04-20-2021, 06:35 PM
RE: CC Tracker [JoshuaMK] - by Skittey - 10-25-2020, 12:31 PM
RE: CC Tracker [JoshuaMK] - by Zeraora - 02-27-2021, 06:56 PM
RE: CC Tracker [JoshuaMK] - by jawa - 04-06-2021, 06:11 PM
RE: CC Tracker [JoshuaMK] - by Vega - 04-07-2021, 12:59 AM
RE: CC Tracker [JoshuaMK] - by jawa - 04-07-2021, 10:05 AM
RE: CC Tracker [JoshuaMK] - by Vega - 04-08-2021, 08:58 PM
RE: CC Tracker [JoshuaMK] - by Zeraora - 04-20-2021, 09:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)