- LE-CODE & LPAR & LEX
- LE-CODE: General description
- LE-CODE: History
- LE-CODE: FAQ for track creators
- LE-CODE: Distribution Tutorial
- LE-CODE: Definition file for distributions
- LE-CODE: FAQ for distribution creators
- LE-CODE: Item Cheat
- LE-CODE: Controllers & Buttons
- LE-CODE: Slot usage
- LE-CODE: Exception Handler
- LPAR: File format for parameters
- LEX: File format and definitions
- Wiimm's Test Tracks
- Extended presence flags
- Related Categories
What is the LE-CODE?
The LE-CODE (short for Leseratte-Code) is a code extension for Mario Kart Wii that was initially written by Leseratte. After the initial phase, the code was jointly developed by Leseratte and Wiimm. The name has been chosen by Wiimm in the style of the CT-CODE, the name of the old Mario Kart Wii code extension by MrBean35000vr and Chadderz.
Leseratte has started the development of the LE-CODE in January 2019. The build system is taken from the Wiimmfi updater, which means, it supports writing C source code instead of Assembly code for the game code modifications, and is designed to be loaded into the StaticR.rel relocation buffer as soon as the StaticR.rel has been loaded and linked into memory, which has about 900 KB of usable space for mods.
First test versions of the LE-CODE have been tested by Wiimm and Leseratte in February 2019, with the first version for a few more private testers being released on February 20th. The public can use the LE-CODE in Wiimms Mario Kart Fun 2019-06 which has been released in June 2019. A source code release currently isn't planned.
The LE-CODE can either be discussed on the talk page, or in this forum thread: click
What does the LE-CODE contain?
Leseratte developed the LE-CODE as a complete build system for all modifications Wiimm and Leseratte are doing to Wiimms MKW-Fun distributions. It includes nearly all features of the old ct-code (even though all of them have either been rewritten (C or ASM) or heavily modified to fix quite a few bugs), and it includes all of the features in the MKW-Fun distributions.
List of features from the old ct-code and MKW-Fun, now included in LE-CODE
- Extension to allow the game to load more than 32 race tracks
- Custom menu system from the ct-code to add arrows to the track selection
- Online track selection time limit is displayed all the time
- Removed CTGP randomizer so picking "Random" actually votes "???"
- Lap and speed modifier
- Mushroom bugfix
- Cloud time modifier
- New random variants (All tracks, Nintendo tracks, Custom tracks, new tracks)
- Track variants (like Animal Crossing in Mario Kart 8)
- VS point scheme changed (25 points instead of 15 points)
- Room settings (friend room host can set options like vehicle restrictions or number of races)
- No Lightning in team races
- Engine class probability modifier, engine class is no longer dependant on VR
- Room stability indicator
- Blue shell can be dragged behind a vehicle like other shells
Changes / Bugfixes / New features with the LE-CODE
- Battle mode actually works
- Battle mode has proper time limit online (3:00.000 instead of 0:30.000)
- Playing a battle no longer influences name tag view distance in VS races played afterwards
- Loading minigame.kmg from track's szs.
- Demo screen
- Demo shows battle tracks as well
- Demo correctly switches modes in the proper order
- Demo no longer randomly freezes sometimes
- New generic features
- The Korean version of Mario Kart Wii is now supported
- 256 track limit removed ⇒ LE-CODE Slot Usage. New limit: 4028 CTs.
- The game now has a proper crash handler (like the "DSI exception" screen in homebrew) that displays data for the developers when the game crashes. ⇒ Details
- Special multiplayer variants (_d.szs) no longer mandatory, if they are missing, the non-multiplayer version is loaded instead
- Tracks are now loaded from /Race/Course/<slot-id>.szs, removing the need for a file name table
- MrBeans performance monitor is included and can be enabled / disabled with Wiimms LE-CODE tool (either console only, or Console+Dolphin)
- New track-related features
- Support for track-dependant ObjFlow.bin and GeoHitTable*.bin files - see section below.
- Special feature for DS Airship Fortress (usable in all other tracks as well): The object uses setting 8 for the drop height so it doesn't land on the wrong floor
- Loading cannon parameters from a course.lex file inside a track so CT authors can define own cannon parameters.
- Special feature for tracks like GCN Mushroom Bridge and GCN Mushroom City: The object's settings can be used to make it behave like a mushroom car (spitting out a mushroom when hit) - thanks to Kevin for the code to do that
- The finish line on the map can be freely placed anywhere (using a second KTPT entry with player index -1) and will automatically be rotated properly in mirror mode, fixing the Start Line Bug. See Track FAQ for details.
- Full implementation of new Extended presence flags including the simulation of scenarios.
- Goombas restored to scaled size after hit.
- For online races, the range for items can be increased to larger values than ±131071 (see LEX:SET1).
- The position tracker can be hidden dependent on offline/online, current lap and current check point (see LEX:HIPT).
- Conditional Out of Bounds (Riidefi) implemented (for AREA type 10 where route=0xff)
- Conditional Out of Bounds (kHacker35000vr) implemented (for AREA types 10 where route=1)
- New speedometer.
- Debug screens.
- Item Cheat.
- The icache is properly handled, this means that LE-CODE will work on Dolphin >=5.0-9000. On older versions of Dolphin, it will most likely freeze at boot.
- 4-player offline mode with Miis no longer crashes (LE-CODE no longer wastes memory with useless copies of unnecessarily large data structures like CT-CODE did)
- After playing a Time Trial the minimap driver icons will be correctly resized instead of staying large
- Playing a team GP no longer removes the Lightning from subsequent non-team GPs
- The special random variants (new tracks, CTs, all tracks, Nintendo tracks) and the track variants now work offline as well
- Playing GPs on custom cups no longer breaks the savegame
- Fixed a bug that would cause the wrong trophy to be awarded in MKW-Fun due to cup reordering
- New generic features
- Fixed a bug that could have caused freezes and/or graphical glitches in the menu under some circumstances
- In Time Trial mode, custom tracks are now hidden from the menu
- The Worldwide button on the online menu has been removed (instead of just being labeled "don't use")
- Scrolling through the cup list auto-updates the track list (also, as in previous versions, one can scroll in the bottom row as well)
- The algorithm that selected a track to be loaded when "???" is selected was slightly off and not every track had the exact same probability of winning the random lottery
- Not yet done, but likely to be added:
- TT ranking selection menu in the Mario Kart Channel is no longer broken
List of features in old MKW-Fun that are no longer included in LE-CODE (yet?)
- Change vehicle between online races (cheat code can fix it)
→ See LE-CODE/History for a full history.
- Builds 35+36
- LE-CODE Version number increased from 4 to 5. Wiimms SZS Tools as of v2.29a are required for LE-CODE processing.
- The track flags have been extended from 8 to 16 bits.
- New random track selection: Any Texture Hack. Bit LE$F_TEXTURE is used to identify such tracks.
- The 5 random track selections can be used for racing tracks and now for battle arenas too.
Public releases and downloads
You will find all official releases since build 13 at download.wiimm.de.
- 2021-04-08, build 28 (zip,90K)
- 2021-09-03, build 30 (zip,95K)
- Update of debug screens.
- Implementation of Cheat Code System. Cheat Codes are activated by a sequence of ++ .
- 2022-05-13, build 32 (zip,95K)
- Patch for main.dol so that longer texts are allowed than defined in BRLYT (by Diamond). Longer track names can be displayed in this way.
- 2022-10-20, build 34 (zip,98K)
- Support of random texture hacks.
- Item Cheat Bullet Bill is deactivated in battles now.
Information for CT creators
Information for distribution creators
Wiimms SZS Tools
Wiimms SZS Tools support the LE-CODE extension like the CT-CODE extension before. Tool wlect was created for LE-CODE and LEX support. If using tool wctct with option --lecode, it switch internally to LE-CODE support and accepts track definition files in CT-CODE syntax (CT-DEF). So you can use the same definition file for CT-CODE and for LE-CODE. Since 2022, the new definition format LE-DEF is available and recommended.