• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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

mkarthick98

Tensai
44
Posts
9
Years
Could you write an ASM script to name the hero in the overworld? I want to use this, since I intend to skip the intro, while still allowing the user to name themselves.
 
51
Posts
9
Years
  • Age 33
  • Seen Nov 18, 2023
Could you write an ASM script to name the hero in the overworld? I want to use this, since I intend to skip the intro, while still allowing the user to name themselves.

No ASM needed, only a simple script with callasm 0x9FC91 [FireRed(U)]
 
959
Posts
11
Years
I'm not sure if this has been done before in a rom hack, but is there a routine that enables the mother Pokemon to pass down Egg Moves to a child (like in Gen VI breeding)? Or is there just a gender check somewhere in the game that has to be disabled? iirc only the father can pass down Egg Moves in Generation 3.
 
7
Posts
9
Years
  • Age 33
  • Seen Mar 25, 2023
Greetings fellow modders! My mod was coming along well until I hit this ASM roadblock. After watching and reading what tutorials I had spare time for, I'm not even sure my idea is possible, so here it goes...

Basically, I want players to be rewarded for sticking with the same party of pokemon throughout.

I'd like to be able to store my "current party pokemon data" in a table/variable during/after a battle (wild, trainer, etc.). It needs to remember the exact pokemon in the party (or at least the species), and store it for an "extended" amount of time. At the end of every battle (wild included) I need to be able to compare the current party pokemon with the data stored in the table, and if the pokemon in my party are the same as the pokemon stored in the table, I need a "counter" to get +1. If they are not the counter has to reset.

Once the counter reaches X amount I can call to another script filled with things I already know are possible.

I would also like to change the way EVs work. Is there a way to remove the EV cap? If so I would prefer there was a way to earn 252 EVs normally (in a single stat), and then every EV after 252 (in that stat), was only 1/100th as effective (IE, you need 400 attack EVs to get +1 attack) I read that division was tricky in an ASM tutorial....

So is something like this possible? Can you think of any substitues if not? As long as the end result is the same idc how I get there.

Thanks for taking the time to read and respond, I hope you're enjoying/enjoyed the holidays!
 
58
Posts
8
Years
  • Age 31
  • Seen Jan 7, 2017

Time Box triggered along with the Start Menu

Preview: (Click to see the GIF animation)
15.gif
The routines are only for FR. I haven't found any bugs in it. However, the CPU will run much more instructions so that it will be a bit (really?) slower when you open the 'pokemon', 'bag'..... menus.
1) Insert the RTC routine via the tool 'DNS'.
2) Insert these routines and do the byte changes:
Routine I:
Spoiler:
Routine II:
Spoiler:
Routine III:
Spoiler:
 
Last edited:

BLAx501!

Pokemon Flux
80
Posts
10
Years

Time Box triggered along with the Start Menu

Preview: (Click to see the GIF animation)
View attachment 77173
The routines are only for FR. I haven't found any bugs in it. However, the CPU will run much more instructions so that it will be a bit (really?) slower when you open the 'pokemon', 'bag'..... menus.
1) Insert the RTC routine via the tool 'DNS'.
2) Insert these routines and do the byte changes:
Routine I:
Spoiler:
Routine II:
Spoiler:
Routine III:
Spoiler:

Seems cool, but I suggest you to change something. Why don't you link this functionality to an unused button such as R (remember we can use these two buttons if properly configured)?

Also it would be very interesting to have the option to display this "clock-box" anytime we want via scripting. I'm not sure but by a quick look, it seems to me that the one that displays it is the second one, isn't it??

You should explain, almost briefly, how do this work, anyway, awesome system :D
 
58
Posts
8
Years
  • Age 31
  • Seen Jan 7, 2017
Seems cool, but I suggest you to change something. Why don't you link this functionality to an unused button such as R (remember we can use these two buttons if properly configured)?

Also it would be very interesting to have the option to display this "clock-box" anytime we want via scripting. I'm not sure but by a quick look, it seems to me that the one that displays it is the second one, isn't it??

You should explain, almost briefly, how do this work, anyway, awesome system :D

If you know some concepts in ASM hacking, I think it won't be hard.
For ques1: In my opinion, triggering automatically is better xD
For ques2: have you heard of JPAN's number input box? It's imitating the 'multichoice' box and you can find how to display a box with a specific string in scripts. Then you can just add a task to the IRAM function queue and updating the time in the box. When you want to hide it, simply delete the task via another 'callasm'.
However, I don't think it necessary to be used in scripts, as I can't imagine a scene using that box xD
For explanation, I just imitate the function to generate the safari box so you can deal with that function to see its inner mechanism.
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
So here I am, well I dunno if it's still in development but still I'm hoping that someone would do it.
Here is my request:

Wild Pokemon switch based on Gender
It's like Gen IV and onwards' feature of a certain Pokèmon having a seperated sprite for its opposite gender. Well, if anyone here knows how to check if the player caught a specific Pokèmon not just in party but also "inside the PC" and a way how to let the player check and store seen and/or caught data of Pokèmon in Pokedex then please tell me cuz' I know how to trick this one
 
Last edited:
218
Posts
10
Years
  • Seen Nov 12, 2021
First Side Routine Rewrite
A rewrite of the pokemon turn order comparison routine during battles. It does not add any new features but decomposes the routine into a routine with 3 sub-modules which makes it easier to add new speed altering abilities and items (hooking in the original one required to make dual checks).

The rewrite also avoids redundant calculations. For example, if move priorities do not match then no need to calculate and compare effective speeds of the banked mons.
One of the sub-module returns the effective speed of the banked mon so it can readily used for accurate base power calculation of Gyro Ball and Electro Ball.


Spoiler:

The routines between emerald and FR are almost the same for that part of the engine.
The few exceptions are :
-Emerald check the battleflags of the battle frontier, it one of them is activated, you don't get the boost
from the third badges.
-Fews register are shifted, but since the whole routine has been rewritten, it shouldn't matter.

Since KDS completly removed the boost-speed from the badge, FR-EM routine are totally the same.

So, here is the port, thanks KDS :

First Side Routine Rewrite (update : fix a little typo from KDS's routine)
Spoiler:
 
Last edited:

Joexv

ManMadeOfGouda joexv.github.io
1,037
Posts
11
Years

Battle Modes addon: Delete fainted Pokemon


For those hackers who like minigames, this routine will delete Pokemon who have fainted in battle. There's a few things that need to happen for this effect to occur.

1) Pokemon who die in battle must be deleted
2) Eggs are spared
3) Pokemon who die outside of battle must be deleted (Poison or another similar effect)

However, if you put this in turn basis, you will NEED to make another routine to delete the Player's party if he/she loses the match. This is because the turn counter isn't reached on the last turn the player loses :x

If you're lazy like me you can just put this routine in as a battle by move addon and cover the whiteout case. Which is actually fine. It's rather fast, because it deletes the Pokemon as they die, so the worse case scenario is unforeseeable. And if a Pokemon dies it will only need to loop 5 times only doing operations on one of the 5 loops. If you're curious looping a maximum of 21 times is the worst case scenario (all 6 of your Pokemon die in 1 turn i.e never, and even if that did happen it'd be done in less .25 seconds). So it's fine to put in the battle by move section without expecting the game to lag.


How to insert:
Insert as addon to battle modes battle by move.
You will notice that near the start of the routine there is some commented out code (denoted by a prefix "@" symbol). That's for a flag check. Change [flag/4] = your flag/4 in hex if you want to toggle by flag. Of course the normal battle mode toggle flag should be used as well.

Spoiler:



Usage:
If you opted to use a flag, set it to allow further battles to delete Pokemon as they faint. If you didn't just sit back and let the unicorns inside the game do the rest.
Found a bug, when the player is down to 2 Pokemon and one dies in battle, you cannot exit the "choose your next Pokemon" menu. As a sorta fix for anyone who wants it, right after
Code:
loop:
	ldr r0, =(0x2024029)
	ldrb r4, [r0]
	cmp r5, r4
	beq end
add
Code:
	cmp r4, #0x1
	beq end
So it'll look like this:
Code:
loop:
	ldr r0, =(0x2024029)
	ldrb r4, [r0]
	cmp r5, r4
	beq end
	cmp r4, #0x1
	beq end

What this does, is it simply checks to see if you only have 2 pokemon left, when it goes through to delete your Pokemon, if it's true it just leaves the Pokemon fainted in your Party.(This is untested, but there's no reason it shouldn't work)
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
Wild double battles

I had inserted all the routines in my hack and I'm kind of glad that it doesn't crash the game or make any unwanted errors, well my problem is even though I set the percentage value of double wild pokemon appearance to 64, which is 100%, nothing happens. The grass ID is the default, 0xD, and all are fine.

Do you have any idea why setting it to 64 doesn't create a 100% double wild pokemon appearance?
 

jiangzhengwenjzw

now working on katam
181
Posts
11
Years
  • Seen today
I had inserted all the routines in my hack and I'm kind of glad that it doesn't crash the game or make any unwanted errors, well my problem is even though I set the percentage value of double wild pokemon appearance to 64, which is 100%, nothing happens. The grass ID is the default, 0xD, and all are fine.

Do you have any idea why setting it to 64 doesn't create a 100% double wild pokemon appearance?

You should have at least 2 Pokemon in your team lol
If it still doesn't work, see VM.
 

jiangzhengwenjzw

now working on katam
181
Posts
11
Years
  • Seen today
*facepalm*
as you can see in the video, I only have 2 Pokemon in my party but when 1 of my pokemon faints, it asks to use another pokemon

oh-oh... That's really a glitch never occurred in my mind TAT However, I'm quite busy these days for exam so I can only promise that I will see the problem in the winter vacation in February.
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
oh-oh... That's really a glitch never occurred in my mind TAT However, I'm quite busy these days for exam so I can only promise that I will see the problem in the winter vacation in February.

That's okay, those are just minor bugs, speaking of those, I had encountered bugs again.

When you press no, instead of letting your one pokemon as your last, you'll run into the battle,

also, there are instances that your pokemon's name will be changed to an undescribable weird letters,

sometimes, the HP gets translated to number rather than HP bar image itself,

anyway, it's still a good feature and thanks for sharing it, I do really hope that it will be possible to throw a ball in a 2v2 battle
 
Last edited:

jiangzhengwenjzw

now working on katam
181
Posts
11
Years
  • Seen today
When you press no, instead of letting your one pokemon as your last, you'll run into the battle,
OK, I haven't taken a look at those "switch" points.
also, there are instances that your pokemon's name will be changed to an undescribable weird letters,
sometimes, the hb gets translated to number rather than HP bar image itself,
WADAFAK, I've never encountered with those bugs, sorry.
anyway, it's still a good feature and thanks for sharing it, I do really hope that it will be possible to throw a ball in a 2v2 battle
That's meant to imitate the Gen V feature, in which you can't throw a ball when there're 2 pokemon on the field. It also prevent many bugs from occurring.

I'm sorry for those terrible bugs. As I've said, the system is not yet complete and I've only fixed some of the existing bugs and I think its main purpose is to provide some information for other hackers. If the rest bugs can't be fixed recently, I will take a look at them in Feb approximately.
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
I'm sorry for those terrible bugs. As I've said, the system is not yet complete and I've only fixed some of the existing bugs and I think its main purpose is to provide some information for other hackers. If the rest bugs can't be fixed recently, I will take a look at them in Feb approximately.

No it's fine, regarding to the catch one of 2v2 pokemon, well you're right, well I will still use it since those are just minors
 
218
Posts
10
Years
  • Seen Nov 12, 2021
OK, I haven't taken a look at those "switch" points.

WADAFAK, I've never encountered with those bugs, sorry.

That's meant to imitate the Gen V feature, in which you can't throw a ball when there're 2 pokemon on the field. It also prevent many bugs from occurring.

I'm sorry for those terrible bugs. As I've said, the system is not yet complete and I've only fixed some of the existing bugs and I think its main purpose is to provide some information for other hackers. If the rest bugs can't be fixed recently, I will take a look at them in Feb approximately.

In vanilla game you can see the number of hp you have instead of the bar pressing start. So don't bother about this one
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
Here are the 2 routines that need to be checked becuse these are not working

Code:
[list][B]Toggling Runaway[/B][/list]
[list][B]Special Shiny Pokemon box![/B][/list]

Well, these routines should be edited I think to work properly

Code:
[list][B]Wild Pokemon Custom Moves[/B]
•The reason why it needs to be edited because there are times that var 8000 is used in an event plus the wild battle thing, it automatically sets pokemon move whatever value is stored in that var. It would be good if it can be toggleabe by flag or var.[/list]
[list][B]Get Pokèmon type[/B]
•There should be a var that determines if the type you want to check is the 1st type and the 2nd type.[/list]
 
Back
Top