GCTRealMate AKA GCTRM is a command line program that operates as a sort of macro assembler from formatted Gecko and PPC ASM formats living in a text file to Gecko Codes output into a standard GCT file.
| Option | Use |
|---|---|
| -g, -G | Output the converted codeset to a text file codeset.txt. |
| -* | Output the codeset with * before each code. |
| -l, -L | Output the code names into a log file. |
| -q, -Q | Keep console open after running. |
| -p, -P, -c, -C | Unimplemented switches |
The *.txt file you write should be formatted in a way that GCTRM can understand; this section will cover the syntax you should use, seperated into subsections based on need.
Gecko codes are the most simple way to code using GCTRM; simply append an asterisk before each line of Gecko.
Example:
* E0000000 80008000
* 225664EC 00000000
There are currently 4 ways to embed ASM into a codeset:
Hook calls are useful when you want to run some code at a location, then return back to that location and continue running intended code.
Example:
HOOK @ $80044A34
{
lwz r4, 0x8(r3)
cmpwi r8, 0x1
bne- %END%
lis r12, 0x8059
stw r15, -0x7D08(r12)
}
Code calls are useful when you want to run some code at a location, replacing the code that exists at that address and the number of lines that follow it.
Example:
CODE @ $80001198
{
addi r6, r7, 0x4C
mr r3, r7
addi r4, r7, 0x34
addi r5, r7, 0x38
}
Pulse calls are useful when you need to run some code every frame, without a distinction as to where you're injecting it.
Example:
PULSE
{
lis r3,0x8020
ori r3,r3,0x0984
icbi r0,r3
lis r3,0x801E
ori r3,r3,0x9A2C
icbi r0,r3
isync
blr
}
op calls are useful when you want to overwrite a single line of code with another line of code.
Example:
op bge- 0x14C @ $80055444
Macros work in a way that is similar to C-type functions. You provide the name of the macro, arguments, and within the macro body you provide a code that utilizes those arguments.
Example:
.macro ModuleCmd(<module>, <cmd>)
{
lwz r3, 0xD8(r31)
lwz r3, <module>(r3)
lwz r12, 0x0(r3)
lwz r12, <cmd>(r12)
mtctr r12
bctrl
}
An alias is essentially a C-type variable. You provide the name of the alias and the value to the right of the name after an equal sign symbol. You can utilize logic and arthimetic symbols within the alias to further give it meaning. Aliases are also definable within macros, code calls, and hook calls.
Example 1:
.alias Teeter_Loc = 0x80546120
Example 2:
.macro LoadAddress(<arg1>,<arg2>)
{
.alias temp_Hi = <arg2> / 0x10000
.alias temp_Lo = <arg2> & 0xFFFF
lis <arg1>, temp_Hi
ori <arg1>,<arg1>, temp_Lo
}
To include other ASM files akin to including headers in C, follow '.include' with the path to the ASM file.
Example:
.include ExampleFolder/Example.asm
Drag a *.txt file in the format specified by the file specification over the GCTRM executable. This will output a *.GCT file with the same name as the *.txt file.
NOTE: GCTRM only works on Windows 10/11 at the moment. More platforms to follow.