• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Name Tag Shadow Box Automatically Scales to Tag Length

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Name Tag Shadow Box Automatically Scales to Tag Length (1.02) [Achilles]
Code:
C22FCCE8 00000013
3C608003 6063556C
7C6803A6 887F0000
4E800021 5460063E
28000078 41820070
3C608045 6063D84F
1C0001A4 7C630214
38800000 8C030001
2C000000 41820018
38840001 2C000080
41A0FFEC 8C030001
4BFFFFE4 2C040005
41800034 3C604080
9061FFF0 C221FFF0
3E404330 CA028C58
9241FFEC 9081FFF0
C9E1FFEC EDEF8028
EDEF8824 807E0010
D1E3002C 807E0010
60000000 00000000
Capture.PNG


Code:
************************************************
* Automatically Scale Name Tag Shadow Box Size *
************************************************

802fcc44   NameTag_DisplayInGame

802fcce8 - lwz r3,0x10(r30)

at this point, r3+0x2c = float, x scale of backgound shadow box (and colored arrow pointing to player)

- proper scale would be (number of characters)/4, if (number of characters) is greater than 4.

Logic:
1) Pull player number, which I think I can do with
lbz r3,0(r31)

2) Branch to PlayerBlock_NameTagSlotLoad
3) Multiply that number by (space between each nametag)
4) Add to first name tag location

5) Now..count nametag length. I think I can make it work with Dan's name tag code and regular non-standard ASCII ones.

load 0x1 byte & update.
  - if zero, then end.
  - if less than 0x80, then add 1
  - else (it's normal..), so add 1 & update

6) compare size to 5
blt END

7) [float] tag length divided by [float] 4
8) store at x scale.

-----
Code...

8045D850  First Name Tag
- name tags are 0x1a4 apart

inject @ 802fcce8 - lwz r3,0x10(r30)

#load function PlayerBlock_LoadNameTagNumber
lis r3,0x8003
ori r3,r3,0x556c
mtlr r3
#load slot number
lbz r3,0(r31)
#get name tag number this slot is using
blrl


rlwinm r0,r3,0,24,31
cmplwi r0,120
#ignore if no tag
beq- END

#-0x1 from first name tag
lis r3,0x8045
ori r3,r3,0xd84f
mulli r0,r0,0x1a4
#get to this name tag
add r3,r3,r0
#initialize length counter
li r4,0

COUNT_CHARACTER_LOOP:
lbzu r0,1(r3)
cmpwi r0,0
beq- CHARACTER_LOOP_END
addi r4,r4,1
#check if normal tag type or reg ASCII
cmpwi r0,0x80
blt- COUNT_CHARACTER_LOOP
#normal name tag type
lbzu r0,1(r3)
b COUNT_CHARACTER_LOOP

CHARACTER_LOOP_END:
cmpwi r4,5
blt- END

SCALE_SHADOW_BOX:

lis r3,0x4080
stw r3,-0x10(sp)
#f17 holds 4
lfs f17,-0x10(sp)

CONVERT_INT_TO_FLOAT:

#r4 = input, f15 = output
lis r18,0x4330
lfd f16,-0x73a8(rtoc)
stw r18,-0x14(sp)
stw r4,-0x10(sp)
lfd f15,-0x14(sp)
fsubs f15,f15,f16

fdivs f15,f15,f17
#load pointer to object data
lwz r3,0x10(r30)
#store new x scale
stfs f15,0x2c(r3)

END:
#default code line
lwz r3,0x10(r30)
 
Last edited:

Ohsm

Smash Apprentice
Joined
Jul 26, 2011
Messages
175
Location
Germany
Wow this is groundbreaking.
Finally we can use the extended tags with fitting shadows.

Based achilles at work, thank you so much <3

 
Last edited:

sihalanick

Smash Rookie
Joined
Apr 16, 2015
Messages
5
Location
604
There are new developments in SSBM everyday it seems, even as a 14 year old game. Here's to many more! Can't wait to use this feature in 20XX... Using extended name tags was an eye sore before lol.
 

CeLL

Smash Lord
Joined
Jan 26, 2014
Messages
1,026
Location
Washington
How do I convert this into a DOL mod?
Here's the one I made:
Code:
@2F98C8: 807E0010 -> 4BD071E8

@ED0:
3C608003 6063556C
7C6803A6 887F0000
4E800021 5460063E
28000078 41820070
3C608045 6063D84F
1C0001A4 7C630214
38800000 8C030001
2C000000 41820018
38840001 2C000080
41A0FFEC 8C030001
4BFFFFE4 2C040005
41800034 3C604080
9061FFF0 C221FFF0
3E404330 CA028C58
9241FFEC 9081FFF0
C9E1FFEC EDEF8028
EDEF8824 807E0010
D1E3002C 807E0010
482F8D8C
 

Sham Rock

Smash Apprentice
Joined
Feb 10, 2014
Messages
95
Location
Outside of your grab range
Name Tag Shadow Box Automatically Scales to Tag Length (pal) [Achilles,rice]
C22FD630 00000011
3C608003 60635B60
7C6803A6 887F0000
4E800021 5460063E
28000078 41820060
3C608044 6063E658
1C0001A4 7C630214
38800000 38840001
8C030001 2C000000
40A2FFF4 2C040005
41800034 3C604080
9061FFF0 C221FFF0
3E404330 CA028C50
9241FFEC 9081FFF0
C9E1FFEC EDEF8028
EDEF8824 807E0010
D1E3002C 807E0010
60000000 00000000
 
Top Bottom