No Boundary Check V2.0
#8
(03-23-2023, 03:54 PM)Zeraora Wrote:
(03-21-2023, 06:37 PM)Luigi Hack Fan Wrote: NTSC-U
0056F033 00000000
C259728C 00000001
B27D0334 A01D0334

PAL
00573E83 00000000
C25A22C4 00000001
B27D0334 A01D0334

NTSC-J
00573803 00000000
C25A1C44 00000001
B27D0334 A01D0334

Like this

Your code is using technically 2 whole instructions to create the C2 code. While yes, dolphin and most code reader/writers can read this, it isn't correct by the whole "instruction amount" declared in the C2.

Since you are using 2 instructions, it should be declared as "C2XXXXXX 00000002".

Also, since you also are using an even amount of instructions in the C2 code, you should also have an extra line at the end of the code that looks something like "60000000 00000000". This is simply a terminator and it tells the code handler when the C2 code ends. Any code writer should add this in automatically so, make sure you are actually attempting to write the codes, instead on just Frankenstein-ing it together.

(Anyone smarter correct me if I am wrong)

@Zeraora Dolphin can actually execute that improper C2 code as "intended"? Never knew that.

@Luigi_Hack_Fan Regarding the proper format of a C2 Gecko ASM Code, all C2 codes end in "00000000". This isn't an actual PPC instruction. It's present to "tell" the Gecko Code Handler to place in a "return back to game" branch in your code's source. To understand this better, go to this thread and read Chapter 3 - https://mariokartwii.com/showthread.php?tid=1383

Due to compiled code alignment/size rules, a nop may be inserted into a C2 code's source during code compilation time. This is the "60000000" part you see in some C2 codes. In nooby terms, a Nop = Do Nothing.

Regardless, this conversation shouldn't even need to take place. All Gecko C2 Code compilers do everything for you in regards to adjusting the finished/compiled code.

--

On another note, the source for this C2 code is strange...

sth r19, 0x334 (r29)
lhz r0, 0x334 (r29)

This may be written incorrectly. Some codes may require a custom value to be placed in memory (and replaced into the register) using a method like this...
li rX, ZZZZ
stb/h/w rX, XXXX (rY)
lbz/h/w rX, XXXX (rY)

Which can be shorten to this if the value doesn't actually need to stay in memory..
li rX, ZZZZ

Assuming if the source is correct and r19 needs to be in r0, if r19 doesn't need to be placed into memory, you can shorten the source to this...
mr r0, r19
Reply


Messages In This Thread
No Boundary Check V2.0 - by Deez Nutz - 11-13-2022, 11:30 PM
RE: No Boundary Check V2.0 - by Vega - 11-14-2022, 01:01 AM
RE: No Boundary Check V2.0 - by Deez Nutz - 11-14-2022, 01:34 AM
RE: No Boundary Check V2.0 - by Seeky - 11-14-2022, 03:30 PM
RE: No Boundary Check V2.0 - by Luigi Hack Fan - 03-21-2023, 06:37 PM
RE: No Boundary Check V2.0 - by Zeraora - 03-23-2023, 03:54 PM
RE: No Boundary Check V2.0 - by Vega - 03-22-2023, 01:35 PM
RE: No Boundary Check V2.0 - by Vega - 03-23-2023, 11:28 PM
RE: No Boundary Check V2.0 - by Zeraora - 03-24-2023, 01:23 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)