PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Discussion Board > Archive

Notices

Archive Old threads that serve no purpose are here.

 
 
Thread Tools Display Modes
Old 22nd September 2012, 11:45 AM   #1
Jambo51
Glory To Arstotzka
Ex-Staff
 
Jambo51's Avatar
 
Join Date: May 2012
Location: Scotland
Posts: 85
Jambo51
Default Having the Player Face Trainers in FireRed

WITH THE GIVEN CODE, THIS WILL ONLY WORK FOR BPRE 1.0 (AKA FIRE RED US 1.0)

This is something that many FR hackers will have come across during their time hacking the game. When encountering a trainer, after all the music and walking up, the player does not face the trainer s/he is about to battle. This can be a slightly annoying feature of FR, since it has been the standard since GSC for the player to face the trainer s/he is about to battle. If you base your hack on FR, this little annoyance makes your hack look outdated!

Required Tools:
Hex Editor
THUMB ASM Compiler
XSE

So, in order to fix it, we must first insert the following ASM Code:

Code:
.text 
.align 2 
.thumb 
.thumb_func 
.global trainerface 

main: 
push {r0-r3, lr} 
ldr r0, ramlocation 
ldrb r0, [r0, #0x0] 
mov r1, #0x24 
mul r0, r1 
ldr r1, spritebank 
add r0, r0, r1 
ldrh r2, [r0, #0x10] 
ldrh r3, [r1, #0x10] 
cmp r2, r3 
beq checkvertical 
sub r2, r2, r3 
cmp r2, #0x1 
beq right 
mov r0, #0x2 
b store 
right:	mov r0, #0x3 
b store 
checkvertical:	ldrh r2, [r0, #0x12] 
ldrh r3, [r1, #0x12] 
sub r2, r2, r3 
cmp r2, #0x1 
beq alt 
mov r0, #0x1 
b store 
alt:	mov r0, #0x0 
store:	ldr r1, lastresult 
strh r0, [r1, #0x0] 
pop {r0-r3, pc} 
.align 
ramlocation:	.word 0x03005074 
spritebank:	.word 0x02036E38 
lastresult:	.word 0x020370D0
Now, note down the location that you inserted the assembled ASM into, and add 1 to that. So if you inserted it at 0x800000, the location you need for the next step would be 0x800001. You must ensure that the location you insert it into is aligned by 4 bytes. That is, the starting location of the routine ends with a 0, 4, 8 or a C. For example, 0x80045C, 0x953428, 0x721684 and 0x215680 would be appropriate locations, assuming they were free space before you inserted the routine.

Now, you must compile the following script using XSE (Technically, this fix is a hybrid of ASM and scripting) - Remember to change the callasm to the location you noted down above. The extra 8 in front of it is necessary:

Code:
#dynamic 0x800000 

#org @main 
callasm 0x8XXXXXX 
compare LASTRESULT 0x0 
if 0x1 call @down 
compare LASTRESULT 0x1 
if 0x1 call @up 
compare LASTRESULT 0x2 
if 0x1 call @left 
compare LASTRESULT 0x3 
if 0x1 call @right 
goto 0x81A4FC7 

#org @down 
applymovement 0xFF @lookdown 
waitmovement 0xFF 
return 

#org @up 
applymovement 0xFF @lookup 
waitmovement 0xFF 
return 

#org @left 
applymovement 0xFF @lookleft 
waitmovement 0xFF 
return 

#org @right 
applymovement 0xFF @lookright 
waitmovement 0xFF 
return 

#org @lookdown 
#raw 0x0 
#raw 0xFE 

#org @lookup 
#raw 0x1 
#raw 0xFE 

#org @lookleft 
#raw 0x2 
#raw 0xFE 

#org @lookright 
#raw 0x3 
#raw 0xFE
Now, when you have done this, you finally navigate to 0x1A4EBD and 0x1A4F15 in your hex editor, and change the pointers located in both these locations to point to the script you inserted above.

If you have done everything right, the fix should immediately start working.
Jambo51 is offline  
Sponsored Links
Old 23rd September 2012, 04:42 AM   #2
tajaros
Beginner
Ex-Staff
 
tajaros's Avatar
 
Join Date: Sep 2012
Location: senippilihP
Posts: 59
tajaros
Default

This is awesome!

This freaking worked for me, thanks so much Jambo!
tajaros is offline  
Old 23rd September 2012, 11:31 AM   #3
Icey
Ahoy!
Ex-StaffPHO VIP
 
Icey's Avatar
 
Join Date: Aug 2010
Location: Germany
Age: 21
Posts: 65
Icey
Default

A great tutorial, with great results.
Thanks for sharing this
Icey is offline  
Old 11th November 2012, 11:18 PM   #4
Chaos Rush
Neophyte
 
Chaos Rush's Avatar
 
Join Date: Sep 2011
Posts: 21
Chaos Rush
Default

Tried it, and worked like a charm. Thanks Jambo!
Chaos Rush is offline  
 

Tags
face, firered, player, trainers, [Guide]

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:47 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).
Green Charizard Christos TreeckoLv100

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts