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


Archive Old threads that serve no purpose are here.

Thread Tools Display Modes
Old 15th February 2014, 07:03 PM   #1
Join Date: Feb 2014
Posts: 2
Default Showing Mugshots via ASM

Showing Mugshots via ASM

Yo, PHO! I would like to present you a little ASM hack of mine:
Showing 1 or 2 mugshots and hiding them after.
The mugshots are stored in the OAM so its possible to display mugshots + textbox! Let's get started!

You need 3 things:

  • thumb compiler (hxxp://

  • loading.asm (hxxp://

  • removing.asm (xxp://
(this forum doesnt allow me to post them in links o.o)

And then, ofc, you need to insert an image and it's palette.
Okay.. I think in this forum everyone knows how to do that, so
I will just skip that one and go on to the next part: The table!

My ASM code uses a table and vars for dynamic displaying of sprites.
Go to a free location somewhere at your ROM and start building the table.


Well, I think image_pntr and palette_pntr are clear, but what is pal#?
OAM has access to 16 OBJ palettes, which can be found

from 0x5000200 - 0x5000400 in the Palette-RAM. If you, for example,
set 00-byte as pal#, the image-pal will be at 0x5000200 and so on..

Each entry is 0xC bytes long, directly after that you can set another entry.
Enough from that one.

Lets take a look at the code.
You need to change 2 things in general.

.equ TABLE, 0x08[TABLE]

Replace [TABLE] with the offset you have just written the entries to.

Near the end of the code there is some strange data.
[OFFSET_OF_CODE] needs to be replaced with the offset, where you
are going to insert this ASM code!

If you have done that, save the Loading.asm and close it.

Extract the to your desktop and put the loading.asm and removing.asm in this folder. DRAG AND DROP the loading.asm into thumb.bat and do the same with removing.asm.

You should get 2 files.. removing.bin and loading.bin

Open both of them in a hex-editor, as well as your ROM.
Go to the offset, which you have replaced [OFFSET_OF_CODE] with.

Now swap over to the loading.asm and do CTRL+A to copy all bytes.
At your ROM, mark now 0x11C bytes and make CTRL+V to insert

the bytes of loading.bin there.
Swap to removing.bin, copy all bytes and at your ROM, mark 0x40 bytes.
(I recommend you to insert the removing.bin right after loading.bin)

Then again, make CTRL+V to insert the bytes of removing.bin.
Write down the offsets you have written loading.bin and removing.bin to and add +1 to them, as they are THUMB codes.

Prepare a script:
We need to use 3 variables.

@/* VAR 0x4500 = SPRITE NUMBER IN TABLE     */@
@/* VAR 0x4501 = LEFT OR RIGHT SIDE?        */@
@/* VAR 0x4502 = SPRITE SLOT IN SCRIPT        */@

In var 0x4500, you need to define the index of the picture you
want to display.

If you want to display the mugshot at the left side of the textbox,
set var 0x4501 to 0. Otherwise, set it to 0x1 for the right side.

At var 0x4502 you need to write 0x0 if you display the first sprite.
If you call the ASM the 2nd time (to display another mugshot) set this var to 0x1.

Example script:

#dynamic 0x750000
#org @testscript
setvar 0x4500 0x0                              'first sprite
setvar 0x4501 0x0                              'left
setvar 0x4502 0x0                              'this sprite is the 1st one
callasm 0x(offset_of_your_loading.bin) +1
setvar 0x4500 0x1                              'second sprite
setvar 0x4501 0x1                              'right
setvar 0x4502 0x1                              'this sprite is the 2nd one
callasm 0x(offset_of_your_loading.bin) +1
msgbox @text 0x6
callasm  0x(offset_of_your_removing.bin) +1

#org @text

At that moment, I decided to limit the displayable mugshots to 2.
I dont think you need more, and it would cause bugs if you would
spam a 100%-dynamic code.

Ok, let's test the code out:


(again, this forum wont let me post links ~.~)


Ending words

Thanks for reading my tutorial and have fun!
Don't forget to give credits if you use it.
Kyoko is offline  
Sponsored Links

asm, mugshots, showing, [Ongoing]

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:13 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2019 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