The following warnings occurred: | |||||||||||||||
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.18 (Linux)
|
Pretty Speedometer [stebler] - Printable Version +- Mario Kart Wii Gecko Codes, Cheats, & Hacks (https://mariokartwii.com) +-- Forum: Cheat Codes (https://mariokartwii.com/forumdisplay.php?fid=51) +--- Forum: Visual & Sound Effects (https://mariokartwii.com/forumdisplay.php?fid=56) +--- Thread: Pretty Speedometer [stebler] (/showthread.php?tid=1730) |
RE: Pretty Speedometer [stebler] - jawa - 11-21-2021 (11-21-2021, 05:26 PM)Vega Wrote: Which exact source is not compiling for you? this one Code: # inject at 807ed1d8 (PAL) RE: Pretty Speedometer [stebler] - Vega - 11-21-2021 Compiling that source as-is in CodeWrite should pop up a message about string16 being an unknown psuedo-op. I supplied a fix to that on my previous post. If you are getting an alignment issue, then somehow when you copy-pasted the source to CodeWrite, something got altered, or you modified something prior to compilation? I can't speak for PyiiASMH3 as I can't get it to run on my personal Debian machine. But as mentioned already, apply that 'fix/patch' I provided. Then the source will compile on Codewrite. RE: Pretty Speedometer [stebler] - stebler - 11-21-2021 One possible issue is that changing the string format would break instruction alignment because it was manually padded with a null character at the end. I just replaced it with a .balign pseudo-op. RE: Pretty Speedometer [stebler] - jawa - 11-22-2021 what font does this code use? in coin.brlyt, it says the font is mario_font_number_red.brfnt, but that font contains no letters, and numbers that are not used in the code RE: Pretty Speedometer [stebler] - stebler - 11-23-2021 (11-22-2021, 07:55 PM)jawa Wrote: what font does this code use? in coin.brlyt, it says the font is mario_font_number_red.brfnt, but that font contains no letters, and numbers that are not used in the code It uses kart_kanji_font.brfnt / kart_font_korea.brfnt (font id 1) which is set via BMG attributes in the second to last code. RE: Pretty Speedometer [stebler] - jawa - 11-28-2021 Does this cap the max string size at 8? cus if i try to change the text from "%.2f" to "VEHICLE SPEED: %.2f" the game only renders the first 8 characters RE: Pretty Speedometer [stebler] - Vega - 11-29-2021 (11-28-2021, 09:51 PM)jawa Wrote: Does this cap the max string size at 8? cus if i try to change the text from "%.2f" to "VEHICLE SPEED: %.2f" the game only renders the first 8 characters In the 5th source which you are editing. You can see Stebler calls the swprintf function. It's similar to sprintf but uses 16-bit ASCII and the args are slightly different. https://www.cplusplus.com/reference/cwchar/swprintf/ Code: lis r12, swprintf@h swprintf requires 3 'main' args r3 = Where to output the completed C wide string (format strings are replaced with appropriate data) r4 = Amount of wide characters (including the null halfword at end) of r3; simply put the length of r3 in halfwords r5 = Where non-completed C wide string is at (contains format strings: i.e. %.2f) Since r4 is the amount of wide characters of the output, you will need to do a tiny bit of work to figure out what the length of the completed C wide string will be. However, you don't need to do this, you can just set this to an amount that you know will exceed the length of completed string. So you can set r4 to something like 0x50, lol. But another issue is that if you look at r3 in the source that's for the arg of swprintf. It's sp + 0x8. You would need to allocate more stack space. However since Stebler hooked the Assembly at an epilogue of a function, it appears you have some wiggle room. 0x8 thru 0xD7 in reference to sp appears to be free to use from just looking at the address in Code View. So that would be 0xD0 bytes of free space. As long as your output string (including the null halfword at end) isn't over 0x68 halfwords, you should be fine. So you shouldn't need to do anything but edit r4 to cover the halfword size of r3. RE: Pretty Speedometer [stebler] - stebler - 11-29-2021 On top of what Vega said you will also need to change the maximum size in the brlyt (in bytes) in the 3rd source. RE: Pretty Speedometer [stebler] - pakrett - 03-10-2022 Can I change the x position but only for splitscreen 4 players (and 3 players) ? RE: Pretty Speedometer [stebler] - stebler - 03-14-2022 (03-10-2022, 06:28 PM)pakrett Wrote: Can I change the x position but only for splitscreen 4 players (and 3 players) ? Yes, by replacing c3a6 for P1 and P3 and 43ac for P2 and P4. All values are the 2 upper bytes of 32-bit floating point (you can convert with https://www.h-schmidt.net/FloatConverter/IEEE754.html) and are listed in the 4th asm source. |