02-08-2021, 09:07 PM
Pretty Speedometer [stebler]
|
Thanks! Personally, this is the best way to go.
S:1 TTTT:c3fa(-500) VVVV:c36e(-238)
02-09-2021, 04:07 PM
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!
~MarioKartWii.com #1~
Yes you can change it to display anything really. For example this is a debug panel code I made for CT authors and testers:
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) This specific example would draw on the screen Code: Integer1 r6 Integer2 r7 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.
02-09-2021, 05:10 PM
So, I should load my value into the registers provided?
~MarioKartWii.com #1~
02-09-2021, 05:43 PM
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).
02-09-2021, 05:45 PM
Got it, so if I wanted lets say a value from address 0x800001b0, I would load its contents to r6
~MarioKartWii.com #1~
02-09-2021, 06:30 PM
02-09-2021, 07:09 PM
(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?
~MarioKartWii.com #1~
02-10-2021, 02:25 PM
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.
|
« Next Oldest | Next Newest »
|
Users browsing this thread: 2 Guest(s)