Using Mem81 to Auto-Clear Data for ASM Codes (MKWii only)
#1
Using Mem81 to Auto-Clear Data for ASM Codes (MKWii only)

NOTE: This is an MKWii specific 'feature', this most likely won't work for other Wii games.
NOTE: For beginner ASM Coders that have already been utilizing the Exception Vector Area in previous codes.


Let's say you have an ASM code that originally stores data/values to the Exception Vector Area. You wanted these values to clear after every race. So you write another ASM code (that occurs only in between races) to zero/null out all the values.

Seems pretty silly to write another whole ASM code just to clear values. Instead of storing your data/values to the Exception Vector Area, you store them to Mem81. Mem81 auto-clears after every race/battle. The only time is doesn't auto clear is pressing restart in TT mode. I don't know the entire exact allowable region of Mem81 but here is a LARGE chunk used many various codes over time and I have seen no issues with any of those codes' functionality.

0x81400000 thru 0x81701000

As you can see this is a very large region of memory to have at your expense. And there you go, a great place to store values that need to be cleared per race. Happy coding!
Reply
#2
Hey! Not to bump an old thread for no reason but, just to provide some bit of knowledge.

If you are using an LE-CODE distro, LE-CODE does use a portion of Mem81 (the exact size I don't know but, it seems to be between 0x81400000 - 0x814D0000) which can cause information to get written over your existing codes.

It seems to be written around the start of a race (right when objs are loading). You might be able to write mid race for certain conditions but, I highly recommend finding a portion that isn't being used.
~MarioKartWii.com #1~
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)