Difference between revisions of "LE-CODE"

From Custom Mario Kart
Jump to navigation Jump to search
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{LE-CODE Content}}
 
{{LE-CODE Content}}
[[File:lecode-circ-160x160.png|right|thumb|LE-CODE logo, circle]]
+
[[File:LE-CODE Logo (Circle).png|right|thumb|LE-CODE logo, circle]]
[[File:lecode-hor-160x36.png|right|thumb|LE-CODE logo, horizontal]]
+
[[File:LE-CODE Logo (Horizontal).png|right|thumb|LE-CODE logo, horizontal]]
[[File:lecode-ver-36x160.png|right|thumb|LE-CODE logo, vertical]]
+
[[File:LE-CODE Logo (Vertical).png|right|thumb|LE-CODE logo, vertical]]
  
 
== What is the LE-CODE? ==
 
== What is the LE-CODE? ==
  
The LE-CODE (short for Leseratte-Code) is a code extension for Mario Kart Wii which has been written by [[User:Leseratte|Leseratte]]. [[Wiimm]] also provided code. 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 MrBean and Chadderz.  
+
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/Update|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 [[Filesystem/rel/StaticR.rel|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.
 
Leseratte has started the development of the LE-CODE in January 2019. The build system is taken from the [[Wiimmfi/Update|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 [[Filesystem/rel/StaticR.rel|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.
Line 37: Line 37:
 
* Room stability indicator
 
* Room stability indicator
 
* Blue shell can be dragged behind a vehicle like other shells
 
* Blue shell can be dragged behind a vehicle like other shells
* Speedometer
 
  
 
=== Changes / Bugfixes / New features with the LE-CODE ===
 
=== Changes / Bugfixes / New features with the LE-CODE ===
Line 54: Line 53:
 
*** The Korean version of Mario Kart Wii is now supported
 
*** The Korean version of Mario Kart Wii is now supported
 
*** [[Slot_Usage#LE-CODE|256 track limit removed]] ⇒ [[Slot Usage#LE-CODE|LE-CODE Slot Usage]]. New limit: 4028 CTs.
 
*** [[Slot_Usage#LE-CODE|256 track limit removed]] ⇒ [[Slot Usage#LE-CODE|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
+
*** 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. ⇒ [[LE-CODE/Exception Handler|Details]]
 
*** Special multiplayer variants (_d.szs) no longer mandatory, if they are missing, the non-multiplayer version is loaded instead
 
*** Special multiplayer variants (_d.szs) no longer mandatory, if they are missing, the non-multiplayer version is loaded instead
 
*** Tracks are now loaded from <tt>/Race/Course/<slot-id>.szs</tt>, removing the need for a file name table
 
*** Tracks are now loaded from <tt>/Race/Course/<slot-id>.szs</tt>, removing the need for a file name table
Line 70: Line 69:
 
*** [[Conditional Out of Bounds (Riidefi)]] implemented (for AREA type 10 where route=0xff)
 
*** [[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)
 
*** [[Conditional Out of Bounds (kHacker35000vr)]] implemented (for AREA types 10 where route=1)
 +
*** New speedometer.
 +
*** [[LPAR#debug|Debug screens]].
 +
*** [[LE-CODE/Item Cheat|Item Cheat]].
 
** Bugfixes
 
** Bugfixes
 
*** 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.  
 
*** 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.  
Line 78: Line 80:
 
*** Playing GPs on custom cups no longer breaks the savegame
 
*** 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
 
*** Fixed a bug that would cause the wrong trophy to be awarded in MKW-Fun due to cup reordering
*** <s>Fixed the recently discovered [[User:Leseratte#480p_graphics_fix|480p graphics glitch]] caused by a bug in the Nintendo SDK</s> ''due to the way this fix works it can't be embedded in the LE-CODE and has to be applied directly to the game''
 
 
* Menu
 
* Menu
 
** Fixed a bug that could have caused freezes and/or graphical glitches in the menu under some circumstances
 
** Fixed a bug that could have caused freezes and/or graphical glitches in the menu under some circumstances
Line 94: Line 95:
 
== History ==
 
== History ==
  
; 2019-01-07 — Idea for LE-CODE
+
→ See [[LE-CODE/History]] for a full history.
* [[Leseratte]] had the idea to consolidate all existing MKW-Fun and ct-code mods into one new structured system.
 
* He started looking for ways to extend the game code, possibly by placing it at the end of the heap (like MKW-Fun and CTGP 1.03 do).
 
* However, that would either require position-independant code (complicated), usage of the game's internal linker (even more complicated) or a fixed-length FST (would break if ISO is modified).
 
  
; 2019-01-11 — StaticR buffer
+
; 2022-10-02:
* The idea to use the heap has been discarded. Leseratte found a roughly 900 KB buffer within the StaticR.rel that is only used at game load.
+
* Support of [[LE-CODE/Distribution_Tutorial/LE-DEF#texture-hacks|texture hacks]].
* After the game is loaded, the buffer is still kept in memory and can be used for custom mods with the LE-CODE.
 
 
 
; 2019-01-30 — ct-code ported
 
* As of January 30, all ct-code mods have been ported or rewritten to work with the LE-CODE.
 
* Most MKW-Fun mods have been ported as well.
 
 
 
; 2019-02-10 — test script
 
* Leseratte made a small script to patch LE-CODE support into an image so Wiimm and Leseratte were able to do a few online tests.
 
 
 
; ~2019-02-14 — WLECT development
 
* Leseratte made a few changes to the LE-CODE to make it compatible with Wiimms tools.
 
* [[Wiimm]] started developing WLECT (Wiimms LE-CODE tool) so that we no longer have to create distributions manually.
 
* At the same time, Wiimm implemented LE-CODE support in its distribution-generator.
 
 
 
; 2019-02-15
 
* Leseratte developed a hacky way for LE-CODE to add additional ~20 slots to the game without breaking online support.
 
 
 
; 2019-02-25 — even more track IDs
 
* The hack from above has been removed. Leseratte started development for actually supporting up to ~32000 tracks in online mode.
 
* Korean games should now work properly and not freeze on track load.
 
 
 
; 2019-03-06 — track ID support finished
 
* Both online gameplay and online live view now support up to ~32000 tracks.
 
* Track icons changed from RGB5A3 to CMPR to reduce size.
 
* LE-CODE artificially limits the number of tracks to 4096 (you'd run out of memory for cup icons at some point anyways).
 
 
 
; 2019-04-01 — first public test distribution
 
* [[Wiimm]] and [[Leseratte]] released a [[LE-CODE_Test_Distribution|public test version]] of Wiimms [[Intermezzo]] built with the LE-CODE to do some online tests with more people.
 
* From now on, all new builds of Wiimms [[Intermezzo]] (released every Tuesday) will be built using the LE-CODE.
 
 
 
; 2019-05-18 — various preparations for MKW Fun
 
* During the last months Wiimm and Leseratte did some cleanup of the LE-CODE and the MKW Fun build system to prepare the first MKW-Fun distribution with the LE-CODE
 
* A "mushroom car" feature (for tracks like [[GCN Mushroom City (Tock)|GCN Mushroom City]]) has been added to the LE-CODE (thanks to [[User:KHacker35000vr|Kevin (KHacker35000vr)]] for the code for that)
 
 
 
; 2019-06-21 — release of [[Wiimms Mario Kart Fun 2019-06]]
 
* [[Wiimms Mario Kart Fun 2019-06]], the first real CT distribution based on the LE-CODE has been released.
 
 
 
; 2019-07-12 — official release of the binary files of [[#b13|LE-CODE build 13]].
 
* [[#b13|First official release]] of LE-CODE to the public. So other distributions can use it.
 
 
 
; 2020-01-25 — [[Extended presence flags]], Goombas and more
 
* Partial implementation of new [[Extended presence flags]] including the [[LEX#TEST|simulation of scenarios]].
 
* Goombas restored to scaled size after hit.
 
* Finish cut scene for team races fixed.
 
* Loading [[minigame.kmg]] from track's szs works now.
 
 
 
; 2020-02-07 — [[Extended presence flags]], Position Tracker
 
* Full implementation of new [[Extended presence flags]] including the [[LEX#TEST|simulation of scenarios]].
 
* For online races, the range for items can be increased to larger values than ±131071 (see [[LEX]]:[[LEX#SET1|SET1]]).
 
* The position tracker can be hidden dependent on offline/online, current lap and current check point (see [[LEX]]:[[LEX#HIPT|HIPT]]).
 
 
 
; 2020-02-14 — official release of the binary files of [[#b15|LE-CODE build 15]].
 
 
 
; 2020-02-29 — fixed ''hide-position-tracker'' functionality
 
* Fixed the ''hide-position-tracker'' functionality for 4:3 screens.
 
* Fixed a freeze bug that occasionally occurs when a player leaves a room and the current track uses the ''hide-position-tracker'' feature.
 
 
 
; 2020-03-04 — official release of the binary files of [[#b16|LE-CODE build 16]].
 
 
 
; 2020-04-08 — official release of the binary files of [[#b18|LE-CODE build 18]].
 
* Free distribution of [[LPAR (File Format)#chatmsg|special functions to all chat messages]] in private rooms.
 
 
 
; 2020-04-17 — block tracks
 
* Block previously used tracks for the next 0–50 races. (see [[LPAR#block-track|LPAR parameter BLOCK-TRACK]])
 
* More chat messages and up to 2 modes for each chat message. ([[LPAR#chatmsg|details]])
 
 
 
; 2020-04-21 — [[Epropeller Speed]]
 
* [[Cheat code]] »[[Epropeller Speed]]« implemented.
 
 
 
; 2020-06-16 — official release of the binary files of [[#b20|LE-CODE build 20]].
 
 
 
; 2020-07-26 — official release of the binary files of [[#b22|LE-CODE build 22]].
 
* The game doesn't crash anymore if a player goes online with many locked drivers.
 
 
 
; 2020-09-05 — bug fixed
 
* The game does not longer freeze if all players select ''random'' while selecting a battle arena.
 
 
 
; 2020-09-17 — official release of the binary files of [[#b24|LE-CODE build 24]].
 
 
 
; 2020-10-09 — Speedometer & Conditional Out of Bounds.
 
* Speedometer activated. Enable it by [[LPAR]].
 
* [[Conditional Out of Bounds]]:
 
** [[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)
 
** For more information about these conditional out-of-bounds patches, see [[Conditional Out of Bounds]].
 
* ''hide-position-tracker'' updated. Sound on position change is disabled if tracker is hidden.
 
 
 
; 2020-10-11 — Bug fix
 
* Bug fix: "Host always wins track selection" didn't work when the "block repeated track vote" feature was disabled.
 
 
 
; 2020-12-09 — official release of the binary files of [[#b26|LE-CODE build 26]].
 
 
 
; 2021-02-23 — currently in development:
 
* New speedometer with debug support. This is based on stebler's [https://mkwii.com/showthread.php?tid=1730 Pretty Speedometer] code
 
  
 
== <span id=download>Public releases and downloads</span> ==
 
== <span id=download>Public releases and downloads</span> ==
Line 235: Line 139:
 
* Different updates and bug fixes.
 
* Different updates and bug fixes.
  
 +
; <span id=b28>[https://download.wiimm.de/lecode/distribution-support/lecode-bin/2021-04-08.build-28.zip 2021-04-08, build 28]</span> (zip,90K)
 +
* New speedometer, that is based on stebler's [https://mkwii.com/showthread.php?tid=1730 Pretty Speedometer] code.
 +
* [[LPAR#debug|Debug screens]].
 +
* [[LE-CODE/Item Cheat|Item Cheat]].
 +
 +
; <span id=b30>[https://download.wiimm.de/lecode/distribution-support/lecode-bin/2021-09-03.build-30.zip 2021-09-03, build 30]</span> (zip,95K)
 +
* Update of [[LPAR#debug|debug screens]].
 +
* Implementation of [[Controller#le-cheats|Cheat Code System]]. Cheat Codes are activated by a sequence of {{LE-CODE ALT1}}+{{LE-CODE ALT2}}+{{button|D-Pad key}}.
 +
 +
; <span id=b32>[https://download.wiimm.de/lecode/distribution-support/lecode-bin/2022-05-13.build-32.zip 2022-05-13, build 32]</span> (zip,95K)
 +
* Patch for [[main.dol]] so that longer texts are allowed than defined in [[BRLYT]] ([https://mariokartwii.com/showthread.php?tid=1860 by Diamond]). Longer track names can be displayed in this way.
  
 
== Information for CT creators ==
 
== Information for CT creators ==

Revision as of 08:44, 3 October 2022

LE-CODE logo, circle
LE-CODE logo, horizontal
LE-CODE logo, vertical

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.

Wiimm has adapted his SZS tools and wrote a new tool called »wlect« (Wiimms LE-CODE tool).

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
    • 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
  • General
    • New generic features
      • The Korean version of Mario Kart Wii is now supported
      • 256 track limit removedLE-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
    • Bugfixes
      • 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
  • Menu
    • 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)

History

→ See LE-CODE/History for a full history.

2022-10-02

Public releases and downloads

You will find all official releases at download.wiimm.de.

2019-07-12, build 13 (zip,77K)
  • First official release of LE-CODE.
2020-02-14, build 15 (zip,90K)
  • Full implementation of new Extended presence flags including the simulation of scenarios.
  • Goombas restored to scaled size after hit.
  • Finish cut scene for team races fixed.
  • Loading minigame.kmg from track's szs.
  • 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).
2020-03-04, build 16 (zip,90K)
  • Fixed the hide-position-tracker functionality for 4:3 screens.
  • Fixed a freeze bug that occasionally occurs when a player leaves a room and the current track uses the hide-position-tracker feature.
2020-04-08, build 18 (zip,91K)
2020-06-16, build 20 (zip,99K)
  • Online, a track that has been played wont be re-picked for the next 0–50 races.
  • More chat messages and up to 2 modes for each chat message.
  • New chat messages modes to limit drivers by size and/or vehicle types.
  • Cheat code »Epropeller Speed« implemented.
  • Fix a bug that sometimes causes the game to freeze when loading a track.
2020-07-26, build 22 (zip,99K)
  • The game doesn't crash anymore if a player goes online with many locked drivers.
2020-09-17, build 24 (zip,99K)
  • The game does not longer freeze if all players select random while selecting a battle arena.
2020-12-09, build 26 (zip,99K)
2021-04-08, build 28 (zip,90K)
2021-09-03, build 30 (zip,95K)
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.

Information for CT creators

See »LE-CODE FAQ for track creators«.

Information for distribution creators

See »LE-CODE Distribution Tutorial« and »LE-CODE FAQ for distribution creators«.

Wiimms SZS Tools

Wiimms SZS Tools support the LE-CODE extension like the CT-CODE extension before. The new 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. So you can use the same definition file for CT-CODE and for LE-CODE.

Wiki Links