Quote:
Originally Posted by Magic
After my problem I was trying to think of a way around it.
I stumbled across this ASM routine for naming the rival - and thought it might be useful to make a similar routine to name the player, whilst avoiding the pop-up start menu.
Would it be hard to alter this to change the [player] name rather than [rival]?
|
I haven't tried the existing routine, or even tested this one actually. It looks like the rival naming and player naming routines both use the same routine as the Pokemon naming routine. It's actually quite useful because this naming routine can be adjusted to name pretty much EVERYTHING.
Just taking a quick look at this routine, to name the player you'd change it a light bit like this:
Code:
.text
.align 2
.thumb
.thumb_func
main:
push {r0-r4, lr}
ldr r0, =(0x80568E0 +1) @callback routine; script continuer
str r0, [SP, #0x4]
ldr r1, =(0x300500C)
ldr r1, [r1]
mov r0, #0x0
mov r2, #0x0
mov r3, #0x0
@setting lastresult to 0x0, you'll see soon why
ldr r4, =(0x20370D0)
strb r0, [r4]
ldr r4, =(0x809D954 +1)
bl linker
checkValidName:
ldr r0, =(0x300500C)
ldr r0, [r0]
ldrb r0, [r0]
cmp r0, #0xFF
beq invalid
cmp r0, #0x0
beq invalid
done:
pop {r0-r4, pc}
invalid:
@Here, whoever owns the original routine assigns a default name.
@you can either loop back, assign a default name...or even better
@set a variable to flag that the name was invalid, and in the script prompt again
ldr r0, =(0x20370D0) @lastresult will be set to 0x1
mov r1, #0x1
strb r1, [r1]
pop {r0-r4, pc}
linker:
bx r4
.align 2
Try it and report back with your findings. You don't need to control overflow because r0 being 0x0 not only makes the OW that appear to be the hero, but also limits the name size to 7 characters!
EDIT: If the original routine creator wanted credits, please give them to him. I just simply modified his routine after a little bit of research.
EDIT2: Magic says it works~