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)
File Line Function
/inc/class_error.php 153 errorHandler->error
/printthread.php(287) : eval()'d code 2 errorHandler->error_callback
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



Mario Kart Wii Gecko Codes, Cheats, & Hacks
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)

Pages: 1 2 3 4 5 6 7 8 9


RE: Pretty Speedometer [stebler] - stebler - 02-08-2021

(02-08-2021, 03:24 PM)NOKKY Wrote: How do I add km/h text in the customized version?

Replace

c2QQQQQQ 0000002e
48000019 001a0800
000100RR 0025002e
003S0066 00000000

with

c2QQQQQQ 0000002f
48000021 001a0800
000100RR 0025002e
003S0066 0020006b
006d002f 00680000

where QQQQQQ is region dependent.


RE: Pretty Speedometer [stebler] - NOKKY - 02-09-2021

Thanks! Personally, this is the best way to go.
S:1
TTTT:c3fa(-500)
VVVV:c36e(-238)
[Image: Yg3i4jN.png]


RE: Pretty Speedometer [stebler] - Zeraora - 02-09-2021

Hello, This may be an off question but would there be a way to have it display a different value besides Speed? I have a value within the EV that I think having display would be useful!


RE: Pretty Speedometer [stebler] - Melg - 02-09-2021

Yes you can change it to display anything really. For example this is a debug panel code I made for CT authors and testers:
[Image: debug.png]

This code essentially patches setTextsrc to display any arbitrary string if you call it with r4=0.
The easy way (but not the shortest) to do it is just to change the ASM contents of the last code. You need to call swprintf with the string of your choice. It uses the standard C printf formatting. 

The arguments for swprintf are:
r6 through r10 are your integer/pointer to char arguments (%d %c in the string)
f1 through f8 are your float arguments (%f in the string)

So you'd replace the original string by the one of your choice, eg:
Code:
.string16 "Integer1 %3d  Integer2 %1d \a Float1 %3.0f"

And there before swprintf gets called, you load your arguments:
Code:
lwz r6, 0x21 (r3)
lbz r7, 0x30 (r3)
lfs f1, 0x90 (r3)

This specific example would draw on the screen
Code:
Integer1 r6  Integer2 r7
Float1 f1

You can also hook at a different instruction, format your string (by calling swprintf and then making any modification to the string you'd want) there and then call setTxtsrc there, if your arguments loading is easier at that instruction.


RE: Pretty Speedometer [stebler] - Zeraora - 02-09-2021

So, I should load my value into the registers provided?


RE: Pretty Speedometer [stebler] - Melg - 02-09-2021

Change the UTF-16 string to the text you want to display and then load the relevant register/floating-point register.
If your value is an integer:
.string16 "InterestingInteger %d" 
+ load the integer into r6

If it's a float
.string16 "InterestingFloat %f" 
+ load the float into f1

It functions very similarly to how the old graphical codes did (see Vega's graphical speedometer for example).


RE: Pretty Speedometer [stebler] - Zeraora - 02-09-2021

Got it, so if I wanted lets say a value from address 0x800001b0, I would load its contents to r6


RE: Pretty Speedometer [stebler] - Melg - 02-09-2021

(02-09-2021, 05:45 PM)TheNinjaKingOW Wrote: Got it, so if I wanted lets say a value from address 0x800001b0, I would load its contents to r6

Yes, and you'd have an integer parameter (%d) in your string


RE: Pretty Speedometer [stebler] - Zeraora - 02-09-2021

(02-09-2021, 06:30 PM)Melg Wrote: Yes, and you'd have an integer parameter (%d) in your string

So, I should remove how its loading the speed in and replace it with my value?


RE: Pretty Speedometer [stebler] - Leseratte10 - 02-10-2021

Is it possible to make this fade-out along with the other HUD elements? Currently when you press Plus to pause the game, this display stays on-screen and doesn't disappear like the "legit" HUD elements.