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 2nd November 2013, 01:07 AM   #11
Diegoisawesome
Oh god the bees
Ex-Staff
 
Diegoisawesome's Avatar
 
Join Date: Jul 2013
Location: :noitacoL
Age: 21
Posts: 60
Diegoisawesome
Default

Quote:
Originally Posted by karatekid552 View Post
So, the routine calls the loader, which is what I hacked, and then calls a refresher? Damm.... I honestly tried looking for the refresher. I never thought to backtrack, lol. I always went forward. When I couldn't find it, I just wrote my own crappy one, haha.
No, the refresher calls the sprite loader, which is what you hacked.

EDIT: I don't think there's ever going to be a time where you set the variable but can't call an ASM routine, so there's really no need for the game loop to detect the sprite change itself when you can just call the updater from a script. Oh, and I wrote a new one:
Code:
.align 2
.thumb
refreshsprite:    push {lr}
                  ldr r1, val1
                  ldrb r0, [r1]
                  strb r0, [r1, #0x1]
                  ldr r3, addr1
                  bl bx_r3
end_now:          pop {r0}
                  bx r0

bx_r3:            bx r3

.align 2
val1:             .word 0x02037078
addr1:            .word 0x0805BE09
Assemble this into the ROM at a free address ending in 0, 4, 8, or C and use callasm right after setting the variable to call that address + 1 (I know you won't have any issues doing this but this is for everyone else).
This refreshes the sprite instantly and works with all sprite situations (biking, surfing, etc).

Last edited by Diegoisawesome; 2nd November 2013 at 04:32 AM.
Diegoisawesome is offline  
Sponsored Links
Old 2nd November 2013, 10:26 PM   #12
karatekid552
What does this button do?.....
Ex-Staff
 
karatekid552's Avatar
 
Join Date: Feb 2013
Location: Stalker.......
Posts: 229
karatekid552 karatekid552
Default

Quote:
Originally Posted by diegoisawesome View Post
No, the refresher calls the sprite loader, which is what you hacked.

EDIT: I don't think there's ever going to be a time where you set the variable but can't call an ASM routine, so there's really no need for the game loop to detect the sprite change itself when you can just call the updater from a script. Oh, and I wrote a new one:
Code:
.align 2
.thumb
refreshsprite:    push {lr}
                  ldr r1, val1
                  ldrb r0, [r1]
                  strb r0, [r1, #0x1]
                  ldr r3, addr1
                  bl bx_r3
end_now:          pop {r0}
                  bx r0

bx_r3:            bx r3

.align 2
val1:             .word 0x02037078
addr1:            .word 0x0805BE09
Assemble this into the ROM at a free address ending in 0, 4, 8, or C and use callasm right after setting the variable to call that address + 1 (I know you won't have any issues doing this but this is for everyone else).
This refreshes the sprite instantly and works with all sprite situations (biking, surfing, etc).
But.... The sprite loader is run every single frame and the refresher is not.... Why?

Thanks for the ASM though, should prove cool.
karatekid552 is offline  
Old 2nd November 2013, 10:37 PM   #13
Diegoisawesome
Oh god the bees
Ex-Staff
 
Diegoisawesome's Avatar
 
Join Date: Jul 2013
Location: :noitacoL
Age: 21
Posts: 60
Diegoisawesome
Default

Quote:
Originally Posted by karatekid552 View Post
But.... The sprite loader is run every single frame and the refresher is not.... Why?

Thanks for the ASM though, should prove cool.
I think it must be that Game Freak knew that the player sprite was always going to be changed in a controlled scenario: riding a bike, going fishing, surfing, etc., so they could just call the hero refresher when needed (that routine would be CPU-intensive if it ran every frame). But on the other hand, the sprite LOADER needed to be run every frame as it was less predictable when the player would have to load a sprite into memory.
Diegoisawesome is offline  
Likes karatekid552 liked this post
 

Tags
customization, gba, pkmn, player, real, runtime, trainer

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 09:43 AM.

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