Pretty Speedometer [stebler]
#51
(06-22-2021, 10:00 AM)Mewmaster99 Wrote: It uses fonts from font.szs

awesome, thanks again!
Reply
#52
For anyone interested and that is decent with ASM, you can use the 'patch/add' in the following template source in the last ASM of the pretty speedometer code to display the velocity instead of the normal engine speed. Adjustments to the current speedometer source and adjustments to the register values shown below will need to modified accordingly.

Code:
.set playerbase, 0x80XXXXXX #Adjust this the playerbase of your region, too lazy to find and post the 4 addresses
.set SLOT, X #0 thru 0xB #Adjust this to your liking, Player 1 offline slot is always 0

#r11, r12, and f13 are just example registers, change them accordingly
li r11, SLOT
lis r12, playerbase@ha
lwz r12, playerbase@l (r12)
lwz r12, 0x20 (r12)
rlwinm r11, r11, 2, 0, 29 #r11 = slot
lwzx r12, r12, r11
lwz r12, 0 (r12)
lwz r12, 0x8 (r12)
lwz r12, 0x90 (r12)
lwz r12, 0x4 (r12)
lfs r13, 0xE0 (r12) #Velocity now in f13
Reply
#53
Is it possible to make it disappear when falling off? Like how it happens with the time and the laps.
Reply
#54
For anyone who wants to know the 16-bit ASCII codes for using Japanese Language here you go....
https://web.archive.org/web/202210180108...s/9.2.html

Also for the Korean fans who use the Korean game, here's a nice list of 16-bit ASCII codes for Korean Language....
https://web.archive.org/web/202208122010...s/9.3.html
Reply
#55
can i make this code display any byte from memory?
like the byte at 0x8000 03d0?
Reply
#56
(11-10-2021, 03:18 PM)jawa Wrote: can i make this code display any byte from memory?
like the byte at 0x8000 03d0?

Yep. With a decent amount of ASM knowledge (and since the source is provided with notes), you can make it display anything you want, change the color of the font, place it anywhere on the screen, etc.
Reply
#57
Version 2.0 has been released with the following new features:
- The speedometer is animated just like most other HUD controls.
- Split-screen multiplayer is supported.
- The speedometer color is automatically adjusted depending on the player/team.
- The "GHOST DATA CANNOT BE SAVED" control is no longer replaced.

This has only been tested offline on Dolphin. In particular I'm afraid that the game may crash in live view mode.

Version 1.0 is still available at the bottom of the OP.
Reply
#58
Excellent work.
Reply
#59
what compiler should i use for compiling this code? i tried using codewrite and pyiiasmh 3, but i kept getting the same error

64: Error: instruction address is not a multiple of 4
Reply
#60
Which exact source is not compiling for you?

Every source for every region option compiles for me on old legacy PyiiASMH2. I only use the old version because I can't get the new version to run/compile on Debian 10. So I'm unable to test on PyiiASMH3.

Codewrite & ASMWiiRD won't compile the 5th source. It will reject it and say that 'string16' is an unknown pseudo-op. You can easily fix this though by just putting in the raw hex. Is that what you are attempting to do (hence why you get the alignment error)?

If so try this...

Replace .string16 "%.2f\0"

with...
.long 0x0025002e #16-bit ASCII for %.
.long 0x00320066 #16-bit ASCII for 2f
.long 0x00000000 #Alignment

This will compile the 16-bit ascii string and then have enough null bytes for the alignment
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)