Pretty Speedometer [stebler]
#34
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.
Reply


Messages In This Thread
Pretty Speedometer [stebler] - by stebler - 01-16-2021, 09:47 PM
RE: Pretty Speedometer [stebler] - by Melg - 01-16-2021, 09:58 PM
RE: Pretty Speedometer [stebler] - by Vega - 01-16-2021, 10:59 PM
RE: Pretty Speedometer [stebler] - by Jeffy/Wrath - 01-17-2021, 04:22 AM
RE: Pretty Speedometer [stebler] - by stebler - 01-17-2021, 05:12 PM
RE: Pretty Speedometer [stebler] - by Optllizer - 01-17-2021, 06:04 PM
RE: Pretty Speedometer [stebler] - by stebler - 01-17-2021, 07:25 PM
RE: Pretty Speedometer [stebler] - by Vega - 01-18-2021, 12:12 AM
RE: Pretty Speedometer [stebler] - by Again - 01-18-2021, 10:27 PM
RE: Pretty Speedometer [stebler] - by stebler - 01-18-2021, 11:27 PM
RE: Pretty Speedometer [stebler] - by Again - 01-18-2021, 11:31 PM
RE: Pretty Speedometer [stebler] - by Vega - 01-18-2021, 11:38 PM
RE: Pretty Speedometer [stebler] - by Joeblase - 01-20-2021, 01:20 AM
RE: Pretty Speedometer [stebler] - by stebler - 01-20-2021, 09:34 AM
RE: Pretty Speedometer [stebler] - by Mewmaster99 - 01-21-2021, 05:38 AM
RE: Pretty Speedometer [stebler] - by Zeraora - 01-21-2021, 12:04 PM
RE: Pretty Speedometer [stebler] - by stebler - 01-22-2021, 12:38 PM
RE: Pretty Speedometer [stebler] - by Hibyehello - 02-04-2021, 08:33 PM
RE: Pretty Speedometer [stebler] - by Mango Man - 01-25-2021, 06:35 PM
RE: Pretty Speedometer [stebler] - by WhatisLoaf - 01-26-2021, 09:34 PM
RE: Pretty Speedometer [stebler] - by JMM - 01-26-2021, 12:40 AM
RE: Pretty Speedometer [stebler] - by stebler - 01-27-2021, 10:21 PM
RE: Pretty Speedometer [stebler] - by NOKKY - 01-30-2021, 06:34 AM
RE: Pretty Speedometer [stebler] - by stebler - 02-04-2021, 03:19 PM
RE: Pretty Speedometer [stebler] - by Mango Man - 02-06-2021, 01:41 PM
RE: Pretty Speedometer [stebler] - by Renverse - 02-05-2021, 10:10 AM
RE: Pretty Speedometer [stebler] - by Again - 02-05-2021, 06:49 PM
RE: Pretty Speedometer [stebler] - by stebler - 02-06-2021, 11:37 AM
RE: Pretty Speedometer [stebler] - by NOKKY - 02-08-2021, 03:24 PM
RE: Pretty Speedometer [stebler] - by stebler - 02-08-2021, 09:07 PM
RE: Pretty Speedometer [stebler] - by NOKKY - 02-09-2021, 12:42 PM
RE: Pretty Speedometer [stebler] - by Zeraora - 02-09-2021, 04:07 PM
RE: Pretty Speedometer [stebler] - by Melg - 02-09-2021, 04:39 PM
RE: Pretty Speedometer [stebler] - by jawa - 10-12-2023, 06:34 PM
RE: Pretty Speedometer [stebler] - by Zeraora - 02-09-2021, 05:10 PM
RE: Pretty Speedometer [stebler] - by Melg - 02-09-2021, 05:43 PM
RE: Pretty Speedometer [stebler] - by Zeraora - 02-09-2021, 05:45 PM
RE: Pretty Speedometer [stebler] - by Melg - 02-09-2021, 06:30 PM
RE: Pretty Speedometer [stebler] - by Zeraora - 02-09-2021, 07:09 PM
RE: Pretty Speedometer [stebler] - by Leseratte10 - 02-10-2021, 02:25 PM
RE: Pretty Speedometer [stebler] - by stebler - 02-11-2021, 06:13 PM
RE: Pretty Speedometer [stebler] - by Lydeum - 03-13-2021, 12:51 PM
RE: Pretty Speedometer [stebler] - by 9Paran - 03-14-2021, 01:53 AM
RE: Pretty Speedometer [stebler] - by Lydeum - 03-14-2021, 03:46 AM
RE: Pretty Speedometer [stebler] - by Wiimm - 03-14-2021, 09:58 PM
RE: Pretty Speedometer [stebler] - by Hannna - 04-30-2021, 08:34 AM
RE: Pretty Speedometer [stebler] - by xMeap826 - 06-14-2021, 12:15 AM
RE: Pretty Speedometer [stebler] - by Vega - 06-20-2021, 11:53 PM
RE: Pretty Speedometer [stebler] - by xMeap826 - 06-22-2021, 08:43 AM
RE: Pretty Speedometer [stebler] - by Mewmaster99 - 06-22-2021, 10:00 AM
RE: Pretty Speedometer [stebler] - by xMeap826 - 06-22-2021, 08:38 PM
RE: Pretty Speedometer [stebler] - by Vega - 07-23-2021, 11:19 PM
RE: Pretty Speedometer [stebler] - by JMM - 08-04-2021, 06:08 PM
RE: Pretty Speedometer [stebler] - by Vega - 10-03-2021, 12:59 AM
RE: Pretty Speedometer [stebler] - by jawa - 11-10-2021, 03:18 PM
RE: Pretty Speedometer [stebler] - by Vega - 11-10-2021, 05:53 PM
RE: Pretty Speedometer [stebler] - by stebler - 11-20-2021, 04:33 PM
RE: Pretty Speedometer [stebler] - by Vega - 11-21-2021, 03:17 AM
RE: Pretty Speedometer [stebler] - by jawa - 11-21-2021, 03:46 PM
RE: Pretty Speedometer [stebler] - by Vega - 11-21-2021, 05:26 PM
RE: Pretty Speedometer [stebler] - by jawa - 11-21-2021, 05:39 PM
RE: Pretty Speedometer [stebler] - by Vega - 11-21-2021, 05:47 PM
RE: Pretty Speedometer [stebler] - by stebler - 11-21-2021, 06:05 PM
RE: Pretty Speedometer [stebler] - by jawa - 11-22-2021, 07:55 PM
RE: Pretty Speedometer [stebler] - by stebler - 11-23-2021, 07:03 AM
RE: Pretty Speedometer [stebler] - by jawa - 11-28-2021, 09:51 PM
RE: Pretty Speedometer [stebler] - by Vega - 11-29-2021, 01:06 AM
RE: Pretty Speedometer [stebler] - by stebler - 11-29-2021, 11:12 AM
RE: Pretty Speedometer [stebler] - by pakrett - 03-10-2022, 06:28 PM
RE: Pretty Speedometer [stebler] - by stebler - 03-14-2022, 10:29 PM
RE: Pretty Speedometer [stebler] - by pakrett - 03-16-2022, 01:54 PM
RE: Pretty Speedometer [stebler] - by fibes - 10-29-2022, 10:19 AM
RE: Pretty Speedometer [stebler] - by Vega - 11-01-2022, 01:07 AM
RE: Pretty Speedometer [stebler] - by fibes - 11-02-2022, 10:31 PM
RE: Pretty Speedometer [stebler] - by xMeap826 - 01-29-2023, 04:31 AM
RE: Pretty Speedometer [stebler] - by Vega - 07-14-2023, 08:52 PM
RE: Pretty Speedometer [stebler] - by xMeap826 - 07-15-2023, 07:11 AM
RE: Pretty Speedometer [stebler] - by Vega - 07-15-2023, 11:02 PM
extra colors for speedometer - by Fifty - 07-16-2023, 03:05 AM
RE: Pretty Speedometer [stebler] - by milky - 08-07-2023, 05:47 PM
RE: Pretty Speedometer [stebler] - by Cealgair - 10-13-2023, 08:57 AM
RE: Pretty Speedometer [stebler] - by Vega - 08-10-2024, 08:13 PM

Forum Jump:


Users browsing this thread: 13 Guest(s)