Mario Kart Wii Gecko Codes, Cheats, & Hacks

Full Version: What is the maximum length of a gecko code?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I read somewhere that its 350 lines, other sources say its 600 lines, others 256.
So, whats the maximum length of a gecko code using Dolphin's codehandler (codehandler.bin)?
It depends on the version of the Gecko Code Handler that is being used.

The "standard" Code Handler refers to version 1.9.3.1. This is the version found in most HBC Applications (i.e. USB Loader GX). With this version, the totality of all codes can't exceed 256 "lines" (double-words). I can't remember if this includes the GCT Header and Footer/Code-Terminator. Those take up 2 lines total.

I've heard Dolphin's tweaked Gecko Code Handler supports slightly more than 256. I don't know the number off the top of my head.

You can bypass this limit and go into the 1,000's using Wiimm's SZS Tools.
wstrt patch main.dol --add-section nameofgct.gct

If you are unfamiliar with Wiimm's SZS (and WIT) Tools, here's a subforum
https://mariokartwii.com/forumdisplay.php?fid=17
With standard setting, memory from 80001800 to 80003000 is available for gecko codes. Addresses >=80003000 are sometimes overwritten by MKWii. The usual gecko loader needs 2728 bytes, GCT header and footer 16 Bytes. So we have space for 3400 bytes (425 code lines).

A memory map of my Intermezzo:
Code:
Memory map of code handler and GCT files:
           unused :  off(beg) ..  off(end) :      size : part or source file
     ---------------------------------------------------------------------------
                  :  80001800 ..  800022a8 :       aa8 : Code Handler
                  :  800022a8 ..  800022b0 :         8 : GCT magic
                  :  800022b0 ..  80002460 :       1b0 : intermezzo-P.gct
                  :  80002460 ..  80002468 :         8 : GCT terminator
                  :  80002468 ..  80003000 :       b98 : Unused available memory

wstrt --add-section=... takes care of the 80003000 border. If this address is reached, then the cheat codes are moved by a special loader to the end of the heap before the FST table. So more than 90,000 code lines are possible.