• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Code: ASM Resource Thread

Hmm, I've been asked to do this before and it's quite the common request. However, it's so easy and straight forward, I'm always left wondering why people don't do it themselves. Then I remember, even if it's easy for me, I guess it's not as easy if you don't know what to do :P

Trainer Capture toggle by Pokeball


What this does right now, if check if the thrown Pokeball is a masterball. If it is, allow capture. If it's not a masterball then the normal "trainer has blocked the ball" will occur. To change which ball toggles the capture look at my comments in the code and change 0x1 - masterball to something else of your choice.
Spoiler:


How to insert:
Compile and insert the following routine into freespace:
Spoiler:


Now navigate to 0x2D498 and insert the following:
Code:
 00 48 00 47 XX XX XX 08
Where XX XX XX is the reverse hex pointer +1 of where you inserted the routine.

Usage:
No usage! It's all done with the power of ASMAGIX!

Works great. I've set my script up to also check flag 0x203, if it's set stealing is disabled. I found that I need this ability because capturing a trainer's Pokemon ends the trainer battle immediately. This is my first ASM attempt, apologizes if I made any mistakes. The code works properly in my testing.

Spoiler:


Compiled version below. Swap out the XX with the Pokeball item number, 01 for a Masterball.

Spoiler:
 
Last edited:
Yes, I also don't know how to use a party slot as a parameter by a scripter as we always don't know what's the player's pokemon. Special 0x9F is a pokemon selection screen, but who knows what the player will do? If I use it, i must decrypt its species as well.

The reason, for me, why Party slot number and not species index number, is to work well with Special 0x9F. What if the hacker wants to evolve a charmander on the third slot, and not the first slot? It would be very useful, and about specie decryption, JPAN has a routine (don't get it wrong) that decrypts pokemon, identifying specie index number is not a hard way to do via scripting, cuz JPAN has that routine.
 
The reason, for me, why Party slot number and not species index number, is to work well with Special 0x9F. What if the hacker wants to evolve a charmander on the third slot, and not the first slot? It would be very useful, and about specie decryption, JPAN has a routine (don't get it wrong) that decrypts pokemon, identifying specie index number is not a hard way to do via scripting, cuz JPAN has that routine.

I don't use JPAN's engine so I don't know what his engine includes though.
My routine will evolve the first pokemon of a specified species in your team. For example, I search for ho-oh in the player's team and get that it's in the second slot, then the routine will evolve it. Therefore it can achieve the goal.
If you insist that choosing a pokemon and then checking if the selected pokemon is of specified species, you can ask someone else to enhance it as it's very very simple. For me, I think it's not bad so I don't want to touch the routines again.
 
Are you guys really unaware of the Pokémon decryption routines already in the games?
 
Last edited:
yup, is there any? Tell us please

Go look through basically any routine on this website that deals with Pokemon. Besides if this is so easy to do why don't you do it yourself? What you're asking for is indeed easy to accomplish, but I'm fairly certain that just using the Selector Special then running another routine(that's already made mind you) to check the species.
 

Instant NPC sprite switch

This is related to the last hack, but can be more useful for a less permanent change. It can also work on other NPCs. Callasm as usual with the NPC person number in 0x8000 (same ID you use with applymovement - and 0xFF for the player) and the target sprite (the sprite index you'd use in advance map) in 0x8001.

Code untested.

Spoiler:
It would be cool if someone could test these and write example scripts. I am too lazy.

Hmm, I've tried it, but it gives me this error on VBA-M

[PokeCommunity.com] ASM Resource Thread


And freezes the game. Any ideas??

EDIT: Simple test script to change Players OW

Code:
#dynamic 0x800000
#org @start
setvar 0x8000 0xFF
setvar 0x8001 0x18
callasm 0x8800001
end

EDIT2: The error above happens when trying to change the player OW as I said. When trying to change a NPC it just does nothing but doesn't freezes.
 
Last edited:
Hmm, I've tried it, but it gives me this error on VBA-M

[PokeCommunity.com] ASM Resource Thread


And freezes the game. Any ideas??

EDIT: Simple test script to change Players OW

Code:
#dynamic 0x800000
#org @start
setvar 0x8000 0xFF
setvar 0x8001 0x18
callasm 0x8800001
end

EDIT2: The error above happens when trying to change the player OW as I said. When trying to change a NPC it just does nothing but doesn't freezes.
Don't know what specifically the problem is, but I do immediately notice at least one:

ldr r5, npc_turn
bl npc_turn

instead of

ldr r5, npc_turn
bl call_via_r5
 
Don't know what specifically the problem is, but I do immediately notice at least one:

ldr r5, npc_turn
bl npc_turn

instead of

ldr r5, npc_turn
bl call_via_r5

Yup, you were right :D

I can now change player's OW, but NPC doesn't seem to work :/

Should Touched or Spherical Ice edit that post to add this little change??
 
Yup, you were right :D

I can now change player's OW, but NPC doesn't seem to work :/

Should Touched or Spherical Ice edit that post to add this little change??
https://imgur.com/a/nKQXA
Sad times.

To be honest tho - although it would be nice to have that fixed, if mods had to fix every error in every post on this site, their workload would never end :D
 
I found that how frustration when playing some Emerald hack with bad egg/event corruption caused by usage of unsafe flag/var.
IDK if anyone had already port Jambo's routine to Emerald because I can't find any relevant post ATM.

Emerald safe variables hack
Spoiler:



Emerald safe flag hack
Spoiler:


Pls tell me if any bug found.
 
Last edited:
BigPensausage said:
<deleted post>

Someone offered to pay for it (and then I'd release it) but they never paid and I never learned how to use Github. Tough world :(
Hey, I have an idea!
You can do it!
 
Last edited by a moderator:
BigPensausage said:
<deleted post>

Woah when did I become a veteran???

Edit: Also if we're so unhelpful then how did I get a helping hand emblem?
 
Last edited by a moderator:
BigPensausage said:
<deleted post>

Nah, Spherical Ice isn't that kind of person. I had received the emblem from him long before interacting with him.

It seems like this daily dose of drama stems from the response to where/how to use the encryption functions in the game. Like Joexv and GoGo had pointed out, there is a built-in Pokemon decrypter/encrypter function which you can use to retrieve and set certain aspects of a Pokemon. Since they failed to site any sources or further readings, you can check the documentation here out: https://www.romhack.me/database/23/fire-red-commonly-used-asm-rom-offsets/

The first two are the ones that Lance and friends are interested in. If you're looking for applications of these functions, there are many inside this very thread. Just take a look at the first post and choose a routine dealing with Pokemon, which you'd like to inspect. Finally, if further problems arise, the ASM help thread is in the beginner's lounge.

Please guys, lets not be so hateful to eachother. Also gogo's not a veteran, she's a nab :^)
 
Last edited by a moderator:
Thanks GOGOJJTECH for crediting me ;) but you didn't have to put it that way but it's fine we are all cool here at the end of the day :)
 
I know the ability thread is for existing abilities so I'm posting this here. I want to make new abilities that are similar to Torrent, Blaze, Overgrow, and Swarm, that use other types, mainly ones I've made. Now, I don't know ASM, and don't have a clue where to start.

But could someone please... (for Fire Red)
1. Provide an offset to change to hook a new routine off of to make a new ability.
2. Provide something similar to the original "power up" ability that has notes to what can be changed.
3. And provide a bit of code to allow the routine to return to the original routine.

So, for instance.
Spoiler:

Hopefully someone with the knowledge can understand what I typed. This is ability stuff but the ability resource thread is for gen 4-6 abilities, not custom ones. But this is ASM so here it is.
 
Spoiler:

@FBI: 1) any way to pull up the naming routine for the player after the intro has been skipped so that players can name themselves later in the game? 2) can this be done for emerald? I have the research here that allows you to skip the birch intro if that helps with a starting point: https://www.pokecommunity.com/posts/8444249/

Spoiler:


@FBI: this has been done by shinyquagsire for me before for emerald however I can not for the life of me figure out the magic he did. I do have previous commands associated to what he did if it helps, but if this could be done for emerald and also like how it was done, set a flag to give the player the battle frontier bag and allow me to clear flags and make the menu have certain things only (i.e. disabling the use of the bag) that'd be great. Here is the previous research: https://www.pokecommunity.com/posts/8450458


Spoiler:


@Spice: this is a great feature and I am wondering why it isn't a built-in command already. Anyways, I was wondering if you could translate this into emerald? There are always work arounds for this such as a flags for each item (which is a horrible way to go about it) but it'd be easier to just count them and that's be great.

~~~~

As usual, I'd be willing to donate to the cause and if either of you need motivation, I'm here to support you helping myself and others and that is why I'm willing to donate. Thanks for any help.
 
@Spice: this is a great feature and I am wondering why it isn't a built-in command already. Anyways, I was wondering if you could translate this into emerald? There are always work arounds for this such as a flags for each item (which is a horrible way to go about it) but it'd be easier to just count them and that's be great.

[EM] checkitem hack to store quantity in 0x8008

This is untested, but it should work based on the offsets I've changed. Let me know if something's up with it.

As usual, the dummy script should look something like this:

Code:
checkitem ITEM_BLUESHARD 0x1
if B_< goto @none
buffernumber 0x0 0x8008
msgbox @string1 0x6
...

#org @string1
= You have [buffer1] Blue Shards.

It will always buffer to 0x8008, but you can change the RAM loc in the routine if you want it to be some other variable.

Code:
.thumb

@ 00 4A 10 47 XX+1 XX XX XX at 080D6794

lsl r0,r0,#0x10
lsr r0,r0,#0x10
ldr r2, =(0x020375E8) @ RAM location of 0x8008 (I think)
strh r0, [r2]
ldr r2, =(0x080D6764+1)
cmp r0, r5
bcs branch
ldr r2, =(0x080D6778+1)

branch:
bx r2
 
Back
Top