The PokéCommunity Forums

Notices
For all updates, view the main page.

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!


Reply
 
Thread Tools
  #1    
Old September 19th, 2014 (3:13 PM). Edited September 13th, 2016 by colors.
colors's Avatar
colors colors is offline
PokéCommunity Daily Staff
 
Join Date: Mar 2010
Location: Ohio
Age: 19
Gender: Male
Nature: Relaxed
Posts: 3,682

ASM Resource Thread


This thread is for the development of new assembly routines and hacks based off of the requests of users. Feel free to make requests, fulfil others' requests, and expand upon the work of others to develop and improve the routines and hacks posted. Note that some of these routines are untested and, therefore, may have unexpected side-effects, bugs or oddities. Be sure to report them by quoting the post of the original routine (after checking if the bug has been fixed or reported already) and patiently wait. Always make a back up of your ROM before making any changes!

Thread rules


Do not demand for your requests to be fulfilled!
People do not have to fulfil your requests, they do it because they want to! Not only are those posts annoying, they also are completely pointless! If such a post is found, it will probably be deleted.

Wrap your hacks and routines in [SPOILER]spoiler tags[/SPOILER].
This is here to keep the thread as easy to browse as possible, as most routines tend to take up multiple lines and this can make scrolling through the thread a chore.

Be reasonable with your requests!
This thread is more mostly small routines: don't be greedy! No-one is going to make an entire hack for you.

Give credit when requested!
If and when you use any of the routines posted here, give credit to the original creator if they ask for it. If they don't explicitly ask for credit, assume they do. Theft won't be tolerated and if you're caught the moderators will request you add credits to your hack threads, and if not your thread may be deleted.

State the base game for which your requests / routines are for.
This is mostly to avoid confusion, and to allow for easier organisation of the thread.

Read the thread before making a request!
Again for organisational reasons, it is a waste of space and time to request routines which have already been created.

Routines


Ruby/Sapphire


Nothing to see here.

FireRed

Pokémon Routines

Party Routines

Battle Routines

Item Routines

Other Routines

Graphical Routines

LeafGreen


Item Routines

Item Routines

Emerald


Pokémon Routines

Party Routines

Battle Routines

Item Routines

Specials Routines

Graphical Routines

Other Routines

Helpful Links


Assembling and Inserting ASM Routines by FBI
This post explains how to insert ASM routines to your ROM.

HackMew's Knowledge by HackMew
This includes a compiler and explains how to compile routines, as well as the basic construction of a routine and an overview of what ASM is.

GBA ASM Programming by Shiny Quagsire
This is another ASM tutorial that explains how assembly works with step-by-step explanations and useful images.

Yet another ASM tutorial by knizz and Full Metal
This is a tutorial about ASM for the Gameboy Advanced. It features expanding the Town Map for FireRed.
__________________
mod github pair
Reply With Quote

Relevant Advertising!

  #2    
Old November 24th, 2014 (6:31 PM).
Ewery1's Avatar
Ewery1 Ewery1 is offline
Local Red Panda
 
Join Date: Feb 2013
Location: A place
Gender: Male
Nature: Jolly
Posts: 831
Would like, changing hms into key items so you don't need slaves be good?
__________________
Reply With Quote
  #3    
Old November 24th, 2014 (6:57 PM).
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680
Quote:
Originally Posted by Ewery1 View Post
Would like, changing hms into key items so you don't need slaves be good?
Hi, already removed the need for HMs from Pokemon, and still create the field effect. If you want to use items to achieve this effect: http://www.pokecommunity.com/showthread.php?t=258426
When you get to the "addscript" part you will have to just point it to an existing script.

Surf is actually very easy to port to an item. You simply have to run the surf script, lol. That's at 0x1A6AC8. You only need to change that to this:
Spoiler:

Code:
#dyn 0x740000
#org @start
'do the checks you want
storepartypokemon 0x0 0x800D
setanimation 0x0 0x800D
doanimation 0x9 'this line alone does the "surf"
release
end


Fly is the only one which will require some ASM, and even that is easy, because the research is already done for you. For the item script for fly, just do "callasm 0x80C4EF9 (this info is in my thread btw)

Flash is my last post in the HM thread.
RockSmash, Strength, waterfall are all done exactly the same as surf.
Strength however has a special flag, 0x805 which needs to be set. It allows the "strength effect" to persist.

It requires you have JPAN's hacker engine applied to put scripts on items btw, according to the tutorial I linked you.
__________________
...
Reply With Quote
  #4    
Old November 24th, 2014 (7:58 PM).
kearnseyboy6's Avatar
kearnseyboy6 kearnseyboy6 is offline
Aussie's Toughest Mudder
 
Join Date: Dec 2008
Posts: 300
I like this idea and I have being playing ORAS and here are some features that could be implemented:

Only open if you want some features spoiled
Spoiler:
- Wild pokemon with special moves
- An item that tells you what pokemon are available on your route
- The amount of times you have encountered a specific pokemon
__________________
HOLIDAYING CURRENTLY!!
Reply With Quote
  #5    
Old November 24th, 2014 (8:35 PM).
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680
Quote:
Originally Posted by kearnseyboy6 View Post
I like this idea and I have being playing ORAS and here are some features that could be implemented:

Only open if you want some features spoiled
Spoiler:
- Wild pokemon with special moves
- An item that tells you what pokemon are available on your route
- The amount of times you have encountered a specific pokemon
I'm particularly interested in the wild Pokemon with special moves. The "encountered a specific pokemon" one is a little easy and hard at the same time. By that I mean what you have to do is easy, but doing it is a lot of work :P
The item about Pokemon on the route I'll check out after completing wild Pokemon with special moves :)
__________________
...
Reply With Quote
  #6    
Old November 24th, 2014 (11:32 PM). Edited November 25th, 2014 by Turtl3Skulll.
Turtl3Skulll's Avatar
Turtl3Skulll Turtl3Skulll is offline
Blue Turtl3
 
Join Date: Jun 2013
Location: Utah, U.S.A.
Age: 21
Gender: Male
Nature: Bold
Posts: 75
Dood, this sounds awesome, I hope you get some cool ideas from this.

Here's what came to my mind (For Fire Red U):
Spoiler:
Removing the ability to name Gary at the start (So just naming the main character and then game starts; I mostly ask because I can't seem to find anything that works).

A way to change the warp points for the ship animation in Fire Red, so that you can use it to travel to other maps (If already possible then I apologize, I just haven't found a way to change them w/o ASM).

Special wild Pokemon battles where pokemon can use held items, such as an encounter with a "wild" Celebi being able to use an item to restore its health; maybe like using something such as a trainer, but without the animation of the pokemon coming out of the pokeball, so it can be edited using PET, or a similar program.

This may be crossing your boundaries, but a possible interpretation of Shadow Pokemon like in Pokemon XD & Colosseum, not necessarily an all out shadow implementation, but at least a symbol for a shadow like shiny pokemon have; & if you can make this, then if it could work as the shiny code where you run a setvar that activate a pokemon battle & the pokemon you encounter is a shadow pokemon.

& I'm not sure if this exists elsewhere, but a way to catch certain trainer pokemon, such as if they have a shadow pokemon as I mentioned above.


If you can achieve any of the ideas let me know thanks.
Reply With Quote
  #7    
Old November 25th, 2014 (2:43 AM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 793
Adding new abilities will be good
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #8    
Old November 25th, 2014 (8:20 AM).
Red John's Avatar
Red John Red John is offline
Progressing Assembly hacker
 
Join Date: May 2014
Location: Where ever there is peace and darkness
Gender: Male
Nature: Lonely
Posts: 137
I am a total newb. Something I want is hacking the text box loadingroutine so that it would use a variableto load a certain text box.
__________________
Reply With Quote
  #9    
Old November 25th, 2014 (8:27 AM).
tzujm33 tzujm33 is offline
 
Join Date: Jul 2014
Posts: 129
A nuzlocke feature, where fainted pokemon cant be healed would be great.
Reply With Quote
  #10    
Old November 25th, 2014 (2:38 PM).
AtecainCorp.'s Avatar
AtecainCorp. AtecainCorp. is offline
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 24
Gender: Male
Nature: Hardy
Posts: 1,132
Can you port for me and finish Double Wild Pokemon Battle code for Emerald.
__________________
This signature has been disabled.
Image is too tall :(
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #11    
Old November 25th, 2014 (3:59 PM). Edited February 21st, 2016 by FBI.
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680

Wild Pokemon With custom attacks



Well, this took me longer than it should have lol. I initially just edited the wild Pokemon in RAM to have the moves I wanted, and used masterballs to capture it (i.e I didn't battle it).
Then I got a PP problem where the PP didn't match, so I wrote a routine to try and fix the PP problem. Then I talked to a friend on IRC, and he pointed out that I should make sure the Pokemon has the same moves in battle. Yeah, needless to say it didn't lol. So I ended up hacking the wild pokemon generator.

How to insert:

First compile this ASM routine.
ASM Routine:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	ldr r5, .VAR
	mov r4, #0x0

loop:
	mov r1, r5 @check if attacks are set
	ldrb r1, [r1]
	cmp r1, #0x0
	beq defaultMoves
	mov r1, #0x2 @calculate location of next attack
	mul r1, r1, r4
	add r1, r1, r5
	ldrh r1, [r1]
	mov r0, r8
	ldr r3, =(0x803E8B0 +1)
	bl linkerTwo
	add r4, r4, #0x1
	cmp r4, #0x4
	bne loop
	

noCrash:
	lsl r0, r0, #0x10
	mov r1, r9
	lsr r5, r1, #0x10
	ldr r3, [sp]
	ldr r1, = (0x803EA60 +1)
	cmp r0, r9
	bne linkerOne
	ldr r1, = (0x803EA56 +1)
	bx r1

defaultMoves:
	mov r0, r8
	ldr r3, =(0x803E8B0 +1)
	bl linkerTwo
	b noCrash

linkerTwo:
	bx r3

linkerOne:
	bx r1
	

.align 2

.VAR:
	.word 0x020370B8


compiled version:
Code:
0F 4D 00 24 29 1C 09 78 00 29 13 D0 02 21 61 43 49 19 09 88 40 46 0B 4B 00 F0 10 F8 01 34 04 2C F0 D1 00 04 49 46 0D 0C 00 9B 07 49 48 45 06 D1 06 49 08 47 03 4B 00 F0 01 F8 F2 E7 18 47 08 47 B8 70 03 02 B1 E8 03 08 61 EA 03 08 57 EA 03 08
Now go to 0x3EA46 and insert:
Code:
01 48 00 47 00 00 XX XX XX 08
Where XX XX XX is the reverse hex pointer to where you inserted the previously compiled routine.

How to use:
Set var 0x8000 to 0x0 to disable.
Variables 0x8000 to 0x8003 are the 4 custom attacks you want inserted.
So to set the first attack of the wild Pokemon to firepunch, I would setvar 0x8000 0x7.

Here's a present :3


EDIT: Attacks must be between 0x0-0xFFFF
__________________
...
Reply With Quote
  #12    
Old November 25th, 2014 (4:08 PM). Edited December 3rd, 2014 by FBI.
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680
Quote:
Originally Posted by Lance32497 View Post
Adding new abilities will be good
Will be too hard for me because I don't have any experience with battle scripts. You're better off making a thread in R/D for it, sorry :(

Quote:
Originally Posted by Turtl3Skulll View Post
Dood, this sounds awesome, I hope you get some cool ideas from this.

Here's what came to my mind (For Fire Red U):
Spoiler:
Removing the ability to name Gary at the start (So just naming the main character and then game starts; I mostly ask because I can't seem to find anything that works).

A way to change the warp points for the ship animation in Fire Red, so that you can use it to travel to other maps (If already possible then I apologize, I just haven't found a way to change them w/o ASM).

Special wild Pokemon battles where pokemon can use held items, such as an encounter with a "wild" Celebi being able to use an item to restore its health; maybe like using something such as a trainer, but without the animation of the pokemon coming out of the pokeball, so it can be edited using PET, or a similar program.

This may be crossing your boundaries, but a possible interpretation of Shadow Pokemon like in Pokemon XD & Colosseum, not necessarily an all out shadow implementation, but at least a symbol for a shadow like shiny pokemon have; & if you can make this, then if it could work as the shiny code where you run a setvar that activate a pokemon battle & the pokemon you encounter is a shadow pokemon.

& I'm not sure if this exists elsewhere, but a way to catch certain trainer pokemon, such as if they have a shadow pokemon as I mentioned above.



If you can achieve any of the ideas let me know thanks.
Rival naming, capturing trainer pokemon and items in wild battles I'll look into. Btw, Pokemon already use their berries in wild battles.

Quote:
Originally Posted by Knight of Duty View Post
I am a total newb. Something I want is hacking the text box loadingroutine so that it would use a variableto load a certain text box.
Sign post vs normal text box? Kinda graphically, but I'll look into it.

Quote:
Originally Posted by tzujm33 View Post
A nuzlocke feature, where fainted pokemon cant be healed would be great.
Already been done by JPAN! It's also very simple, just set max HP to 0 when it's fainted.

Quote:
Originally Posted by Ksiazek Bartlomiej View Post
Can you port for me and finish Double Wild Pokemon Battle code for Emerald.
Sorry I forgot to mention I only hack Fire Red. Not interested in other ROMs

EDIT:

Wild Pokemon Seen Count:



Check how many pokemon of a particular species you've seen. Requires JPAN's save block hack (here: http://www.pokecommunity.com/showpost.php?p=6993092&postcount=206)

How to Insert:

First compile the below ASM Code and insert into free space:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	ldr r0, = (0x202402C)
	mov r1, #0xB
	ldr r2, = (0x803FBE8 +1)
	bl linker
	ldr r1, .SAVEBLOCK
	add r1, r1, r0
	ldrb r1, [r0]
	strb r1, [r0 + #0x1]

noCrash:
	ldr r0, = (0x2023BC8)
	ldr r0, [r0]
	cmp r0, #0x0
	bne end
	ldr r1, =(0x801351C +1)
	bx r1
end:
	pop {r0}
	bx r0

linker:
	bx r2

.align 2
.SAVEBLOCK:
	.word 0x0203C000


Here's a compiled version
Code:
09 48 0B 21 09 4A 00 F0 0C F8 06 49 09 18 01 78 41 70 07 48 00 68 00 28 01 D1 06 49 08 47 01 BC 00 47 10 47 00 C0 03 02 2C 40 02 02 E9 FB 03 08 C8 3B 02 02 1D 35 01 08
Then navigate to 0x13516 and insert:
Code:
01 48 00 47 00 00 XX XX XX 08
Where XX XX XX is the reverse hex pointer to the routine you compiled above (plus 1).

To get the amount you've seen simply compile and insert:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r1, lr}
	ldr r0, = (0x0203C000)
	ldr r1, .VAR
	ldrb r1, [r1]
	add r0, r0, r1
	ldr r1, .VAR
	ldr r0, [r0]
	strb r0, [r1]
	pop {r0-r1, pc}

.align 2
.VAR:
	.word 0x020270B4 + (0x8000 * 2)


Here's a compiled version
Code:
03 B5 05 48 03 49 09 78 40 18 02 49 00 68 08 70 03 BD C0 46 B4 70 03 02 00 C0 03 02
How to use:
There is no use for the storing part, it's done automagically. For the getting part, setvar 0x8000 0xSpeciesYouWant
and then callasm 0xWhereYouCompiledGetterCode +1.

That's it. The limitations are it only counts up to 255 natural encounters. It supports up to 3576 inserted Pokemon Species.
__________________
...
Reply With Quote
  #13    
Old November 25th, 2014 (6:27 PM).
MrDollSteak's Avatar
MrDollSteak MrDollSteak is offline
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 21
Gender: Male
Posts: 794
Quote:
Originally Posted by FBI agent View Post

Wild Pokemon With custom attacks



Well, this took me longer than it should have lol. I initially just edited the wild Pokemon in RAM to have the moves I wanted, and used masterballs to capture it (i.e I didn't battle it).
Then I got a PP problem where the PP didn't match, so I wrote a routine to try and fix the PP problem. Then I talked to a friend on IRC, and he pointed out that I should make sure the Pokemon has the same moves in battle. Yeah, needless to say it didn't lol. So I ended up hacking the wild pokemon generator.

How to insert:

First compile this ASM routine.
ASM Routine:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	ldr r5, .VAR
	mov r4, #0x0

loop:
	mov r1, r5 @check if attacks are set
	ldrb r1, [r1]
	cmp r1, #0xFF
	beq noCrash
	mov r1, #0x2 @calculate location of next attack
	mul r1, r1, r4
	add r1, r1, r5
	ldrb r1, [r1]
	mov r0, r8
	ldr r3, =(0x803E8B0 +1)
	bl linkerTwo
	add r4, r4, #0x1
	cmp r4, #0x4
	bne loop
	

noCrash:
	lsl r0, r0, #0x10
	mov r1, r9
	lsr r5, r1, #0x10
	ldr r4, [sp]
	ldr r1, = (0x803EA60 +1)
	cmp r0, r9
	bne linkerOne
	ldr r1, = (0x803EA54 +1)
	bx r1

linkerTwo:
	bx r3

linkerOne:
	bx r1
	

.align 2

.VAR:
	.word 0x020270B8 + (0x8000* 2)


compiled version:
Code:
0D 4D 00 24 29 1C 09 78 FF 29 0A D0 02 21 61 43 49 19 09 78 40 46 09 4B 00 F0 0C F8 01 34 04 2C F0 D1 00 04 49 46 0D 0C 00 9C 05 49 48 45 02 D1 04 49 08 47 18 47 08 47 B8 70 03 02 B1 E8 03 08 61 EA 03 08 55 EA 03 08
Now go to 0x3EA46 and insert:
Code:
01 48 00 47 00 00 XX XX XX 08
Where XX XX XX is the reverse hex pointer to where you inserted the previously compiled routine.

How to use:
Set var 0x8000 to 0xFF to disable.
Variables 0x8000 to 0x8003 are the 4 custom attacks you want inserted.
So to set the first attack of the wild Pokemon to firepunch, I would setvar 0x8000 0x7.

Here's a present :3


EDIT: Attacks must be between 0x0-0xFF. You can only have 255 attacks in Pokemon :/
This is great FBI!

But there's actually room for 1FF attacks in Vanilla Pokemon, and expanded roms can get to FFFF now. So ideally this should be accounted for. I was under the impression that variables could be set to FFFF, because they're 2 bytes long. If this is untrue I have some suggestions.

One thing that could fix this is if you alter the routine a little, rather than making the variables account for a move, they should account for the position of the move in the egg move table. The reason I suggest this, is because ORAS specifically allows pokemon to be generated with an egg move. Now what I'd suggest is that when you load the var, you also load the egg move table, at which point you check for the pokemon or its pre-evolved form, and at that point add the variable number to this offset to get the egg move.

If you want to keep the freedom of having any move however, what you could do is, rather than allowing all four moves to be custom, you could make it more like ORAS in that its only the first slot that is changed. And then the second variable could be the second part of the move index, ie. if the halfword index of the move is 108, you'd set 8000 to 08, and then 8001 to 01. Then you'd shift it two places to the left and add them together to get your move.

This is just a suggestion because your current implementation is impressive, but is sadly not at its full potential, because being limited to the first 255 moves is just a pity.
__________________
Reply With Quote
  #14    
Old November 25th, 2014 (6:38 PM). Edited November 25th, 2014 by FBI.
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680
Quote:
Originally Posted by MrDollSteak View Post
This is great FBI!

But there's actually room for 1FF attacks in Vanilla Pokemon, and expanded roms can get to FFFF now. So ideally this should be accounted for. I was under the impression that variables could be set to FFFF, because they're 2 bytes long. If this is untrue I have some suggestions.

One thing that could fix this is if you alter the routine a little, rather than making the variables account for a move, they should account for the position of the move in the egg move table. The reason I suggest this, is because ORAS specifically allows pokemon to be generated with an egg move. Now what I'd suggest is that when you load the var, you also load the egg move table, at which point you check for the pokemon or its pre-evolved form, and at that point add the variable number to this offset to get the egg move.

If you want to keep the freedom of having any move however, what you could do is, rather than allowing all four moves to be custom, you could make it more like ORAS in that its only the first slot that is changed. And then the second variable could be the second part of the move index, ie. if the halfword index of the move is 108, you'd set 8000 to 08, and then 8001 to 01. Then you'd shift it two places to the left and add them together to get your move.

This is just a suggestion because your current implementation is impressive, but is sadly not at its full potential, because being limited to the first 255 moves is just a pity.
Hello, does the Pokemon Egg moves get looked up for wild Pokemon?
Also, it's 255 limited by choice, if I loaded a half-word instead of a byte it would read 0xFFFF moves (simple fix for that is to replace all the ldrb with ldrh) You would also just subtract "1" from the .VAR offset.

Also if you don't want a full custom move set, and only the first move custom, then you can do:
setvar 0x8000 0xmove
setvar 0x8001 0xFF (or FFFF with halfword instead, though I'm not sure you can setvar that high, pls check for me :P)

And the routine will stop generating custom moves at that point and look into default moves.

Edit: Though if the Pokemon you are battling has only 1 move, it will not generate a second. Extra moves are only generated if the variable is set. For example level 1 bulbasaur has only tackle. If found in the wild, and given razor leaf, then even if 0x8001 is 0xFF it won't learn tackle.


Mini-progress which I quit halfway:
Skipping rival naming, go to 0x130690 and insert D1 0B. It will skip the rival naming and then do the turn small animation. But it won't unfade the screen and frankly freezes. Probably a very easy fix somewhere, but I'm lazy to look at all the code there.
__________________
...
Reply With Quote
  #15    
Old November 25th, 2014 (7:14 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 793
Quote:
Originally Posted by FBI agent View Post
Will be too hard for me because I don't have any experience with battle scripts. You're better off making a thread in R/D for it, sorry


Nah! Its okay...
Ahhmmm how about Expanded PC boxes? in FireRed?
Reply With Quote
  #16    
Old November 25th, 2014 (9:29 PM). Edited December 17th, 2014 by FBI.
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680
Quote:
Originally Posted by Lance32497 View Post
Nah! Its okay...
Ahhmmm how about Expanded PC boxes? in FireRed?
About that, I feel very bad shutting down all of your suggestions, but that seems like a lot of work for a feature that's not even that great. There's already a large amount of space in the PC, and I'm sure to expand it will take hours and hours of work :/

Capturing Opponent's Pokemon:


So I was working on making trainer's Pokemon capture-able, and it does this check to see if the Pokemon is capturable, and if it was it'd check to see if it's a trainer's Pokemon. Well, I disabled the check and was successful in capturing a Pokemon that didn't belong to me :P

Sadly, the Pokemon turned into a bad egg the moment I caught it. The only solution to this was to edit the checksum so it'd make sense again, however that would be a lot of work, and honestly the checksum is calculated relatively frequently. So upon investigation (mostly by Shinyquagsire, thanks for the deduction detective!) we were able to determine the egg was turning bad because the checksum was no longer valid with the player's trainer ID. So, after diving through the code a bit I found the part of the code that overwrote the trainer ID with the player ID. Then it was a matter of disabling it!

To insert:
insert the following bytes at the following offsets:
0x2D496: E0 E0
0x40B36: 00 00 00 00 00

To fix the Pokedex bug
Follow the instructions in this link: http://www.pokecommunity.com/showpost.php?p=8536920&postcount=333

Here's Brock's Onix :3

__________________
...
Reply With Quote
  #17    
Old November 25th, 2014 (9:46 PM).
Turtl3Skulll's Avatar
Turtl3Skulll Turtl3Skulll is offline
Blue Turtl3
 
Join Date: Jun 2013
Location: Utah, U.S.A.
Age: 21
Gender: Male
Nature: Bold
Posts: 75
Quote:
Originally Posted by FBI agent View Post
About that, I feel very bad shutting down all of your suggestions, but that seems like a lot of work for a feature that's not even that great. There's already a large amount of space in the PC, and I'm sure to expand it will take hours and hours of work :/

Capturing Opponent's Pokemon:


So I was working on making trainer's Pokemon capture-able, and it does this check to see if the Pokemon is capturable, and if it was it'd check to see if it's a trainer's Pokemon. Well, I disabled the check and was successful in capturing a Pokemon that didn't belong to me

Sadly, the Pokemon turned into a bad egg the moment I caught it. The only solution to this was to edit the checksum so it'd make sense again, however that would be a lot of work, and honestly the checksum is calculated relatively frequently. So upon investigation (mostly by Shinyquagsire, thanks for the deduction detective!) we were able to determine the egg was turning bad because the checksum was no longer valid with the player's trainer ID. So, after diving through the code a bit I found the part of the code that overwrote the trainer ID with the player ID. Then it was a matter of disabling it!

To insert:
insert the following bytes at the following offsets:
0x2D496: E0 E0
0x40B36: 00 00 00 00 00

Here's Brock's Onix :3

Thanks for researching so quickly, I'll try it later, hopefully it works along with JPAN's engine
Reply With Quote
  #18    
Old November 26th, 2014 (12:43 AM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 17
Gender: Male
Posts: 409
Please don't waste time on rival naming skip; there's a routine for it published in this post: www.pokemonhackersonline.com/showthread.php?t=14448-Jambo51-s-ASM-Resource-Center
__________________
Reply With Quote
  #19    
Old November 26th, 2014 (5:48 AM).
Percy's Avatar
Percy Percy is offline
President of Procrastination
 
Join Date: Sep 2014
Location: Philippines
Gender: Male
Nature: Gentle
Posts: 2,402
Quote:
Originally Posted by FBI agent View Post
About that, I feel very bad shutting down all of your suggestions, but that seems like a lot of work for a feature that's not even that great. There's already a large amount of space in the PC, and I'm sure to expand it will take hours and hours of work :/

Capturing Opponent's Pokemon:


So I was working on making trainer's Pokemon capture-able, and it does this check to see if the Pokemon is capturable, and if it was it'd check to see if it's a trainer's Pokemon. Well, I disabled the check and was successful in capturing a Pokemon that didn't belong to me

Sadly, the Pokemon turned into a bad egg the moment I caught it. The only solution to this was to edit the checksum so it'd make sense again, however that would be a lot of work, and honestly the checksum is calculated relatively frequently. So upon investigation (mostly by Shinyquagsire, thanks for the deduction detective!) we were able to determine the egg was turning bad because the checksum was no longer valid with the player's trainer ID. So, after diving through the code a bit I found the part of the code that overwrote the trainer ID with the player ID. Then it was a matter of disabling it!

To insert:
insert the following bytes at the following offsets:
0x2D496: E0 E0
0x40B36: 00 00 00 00 00

Here's Brock's Onix :3

This seems awesome enough and very easy to insert. I know that there's a Gameshark code about that xD

Good job!
__________________
[insert quote here]
Reply With Quote
  #20    
Old November 26th, 2014 (6:12 AM). Edited December 12th, 2014 by FBI.
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680
Quote:
Originally Posted by Turtl3Skulll View Post
Thanks for researching so quickly, I'll try it later, hopefully it works along with JPAN's engine
It should have no problems with any other hacks; this check is quite standalone. I should also mention the Pokemon you captured from another trainer will act like a Pokemon who has been traded. If you don't have the badges to train it, it will disobey you.

Quote:
Originally Posted by daniilS View Post
Please don't waste time on rival naming skip; there's a routine for it published in this post: www.pokemonhackersonline.com/showthread.php?t=14448-Jambo51-s-ASM-Resource-Center
Thanks for that.

Quote:
Originally Posted by BlazikenXY View Post
This seems awesome enough and very easy to insert. I know that there's a Gameshark code about that xD

Good job! ^^
Thanks. To my knowledge, the gameshark code still turns your Pokemon to a bad egg. This fixes the bad egg too!

Anyways, I've finished all the requests which I'm willing to do. Keep shooting them at me guys :P

EDIT:


Toggling Capturability of Pokemon



So it's quite likely that maybe you want a Pokemon to be uncapturable, and at the same time you don't want to diminish it's catch rate to 0 in your Pokemon editor. Or perhaps you used the "capture trainer Pokemon" hack and you don't want it to work for all trainers. No problem, this is the hack for you :P

Basically it checks if variable 0x8000 is 0x1 or not. If it's 0x1, then any Pokemon you encounter (trainer or wild, via script or natural encounter) will become uncapturable even with the master ball. Simply set 0x8000 back to normal for the original game mechanics.
Note: If you use this hack, to say make it so the player can only capture a certain trainer's Pokemon, you will need to set 0x8000 right before the encounter, and unset it after (which is quite simple)
Note2: This hack won't let you capture trainer Pokemon, you need to have the capture trainer Pokemon hack from last time to create that effect.

How to insert:

First compile the following ASM code and insert into free space:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	ldr r0, =(0x2022B4C)
	ldr r1, [r0]
	ldr r2, .VAR
	ldrb r2, [r2]
	cmp r2, #0x1
	beq uncatchable
	ldr r0, = (0x802D490 +1)
	bx r0

uncatchable:
	ldr r0, = (0x802D460 +1)
	bx r0
	
	

.align 2
.VAR:
	.word 0x020270B8 + (0x8000 * 2) @change to var of your choice if you want


Here is a compiled version:
Code:
05 48 01 68 03 4A 12 78 01 2A 01 D0 03 48 00 47 03 48 00 47 B8 70 03 02 4C 2B 02 02 91 D4 02 08 61 D4 02 08
Now navigate to 0x2D452 and insert the following:
Code:
01 48 00 47 00 00 XX XX XX 08
Where XX XX XX is the reverse hex pointer to where you inserted the above routine. That's it :)

Here's a pesky Rattata:

(Yes, the Pokeball animation is still there, this was taken after it.)
__________________
...
Reply With Quote
  #21    
Old November 26th, 2014 (4:29 PM). Edited December 3rd, 2014 by FBI.
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680

Pokemon Obedience via Level and Happiness!



How it works:
If your Pokemon outlevels the level your badges say you can control, it will disobey you if it's unhappy. The concept was pretty simple sounding, but there was a lot of work that went into it. This should keep some similarities to the anime.
I should note that if your Pokemon loves you, and you don't have the badge to train it, it will still listen to you :3

This one is called love.asm

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

Code:
.text
.align 2
.thumb
.thumb_func


main:
	mov r4, #0x82
	lsl r4, r4, #0x4
	mov r2, #0x0

badgeLoop:
	mov r0, r4
	ldr r6, =(0x806E6D0 +1)
	bl linkerOne
	cmp r0, #0x1
	bne trainLevel
	add r4, r4, #0x1
	add r2, r2, #0x1
	cmp r2, #0x8
	beq obey
	b badgeLoop

trainLevel:
	@no flags set = lvl 20. Increment by 10 per additional flag
	mov r0, #0xA
	mov r2, #0x82
	lsl r2, r2, #0x4
	sub r4, r4, r2
	mul r4, r4, r0
	add r4, #0x14

PokemonLevel:
	ldrh r0, [r5]
	mul r0, r7
	ldr r6, = (0x2024284)
	add r0, r0, r6
	mov r1, #0x38
	ldr r6, = (0x803FBE8 +1)
	bl linkerOne
	cmp r0, r4
	ble obey
	


isHappy:
	@if it loves you and you don't have badges, it will obey
	@if it doesn't love you and you don't have badges it will disobey
	ldrh r0, [r5]
	mul r0, r7
	ldr r6, = (0x2024284)
	add r0, r0, r6
	mov r1, #0x20
	ldr r6, =(0x803FBE8 +1)
	bl linkerOne
	cmp r0, #0x7F @this is half possible of max happiness tone to your liking
	bls disobey

obey:
	mov r0, #0x1
	b end
	

disobey:
	ldr r0, =(0x801D414 +1) @you can simply mov r0 to 0x0 too
	bx r0

end:
	mov r2, #0x0
	ldr r1, =(0x801D42A +1)
	bx r1


linkerOne:
	bx r6
	
	

.align 2


Here's a compiled version:
Code:
82 24 24 01 00 22 20 1C 15 4E 00 F0 28 F8 01 28 04 D1 01 34 01 32 08 2A 1A D0 F4 E7 0A 20 82 22 12 01 A4 1A 44 43 14 34 28 88 78 43 0D 4E 80 19 38 21 0D 4E 00 F0 13 F8 A0 42 09 DD 28 88 78 43 08 4E 80 19 20 21 08 4E 00 F0 09 F8 7F 28 01 D9 01 20 01 E0 05 48 00 47 00 22 05 49 08 47 30 47 D1 E6 06 08 84 42 02 02 E9 FB 03 08 15 D4 01 08 2B D4 01 08
Navigate to 0x1D3E0 and insert:
Code:
 00 48 00 47 XX XX XX 08
Where XX XX XX is the reverse hex pointer to location you compiled the routine.

I should mention there was a little bit of this routine which I'm skipping over. Basically it checks if the Pokemon is a Mew or Deoxys. It then checks if the Mew/Deoxys has it's obedience set. I find the need for this non-existent because the obedience is checked by happiness and badges my way. In the end, if you want to keep these two (rather pointless) checks, insert at 0x1D406.

Sorry for the double post. I want to keep my routines on separate posts to help in formatting the first post's index :x

Requested here: http://www.pokecommunity.com/showpost.php?p=8510180&postcount=1
I made a special exception and decided to do it for her here by that I mean no other requests were on the table:)
__________________
...
Reply With Quote
  #22    
Old November 26th, 2014 (4:54 PM).
Gust's Avatar
Gust Gust is offline
 
Join Date: Feb 2006
Gender: Male
Nature: Serious
Posts: 5,613
I'm going to suggest something as well since it's kind of similar to all these routines you're doing. It's something that's been done in OR/AS. Going to put this in a spoiler:
Spoiler:
copied from Serebii: Once you have the three Regis, Regirock, Regice and Registeel, you can unlock Regigigas. The method to get this is rather complicated. In Pacifidlog Town, in the north-eastern house, a girl will tell you stories her grandfather told her. At random, she will tell you a part of the story about how to get Regigigas. This involves location and the other features. Take all three of the Pokémon to the Island Cave during the day, and make Regice hold a frozen item such as CasteliaCone, Snowball or Never-Melt Ice, and have Regice have a nickname, and Regigigas will challenge you.

So basically, a routine that would check if any of your Pokémon (or a specific one) are holding a certain item, or any of your Pokémon are nicknamed, though I believe the first one would be more useful.
Reply With Quote
  #23    
Old November 26th, 2014 (6:31 PM).
tzujm33 tzujm33 is offline
 
Join Date: Jul 2014
Posts: 129
Is it possible to make exp dependend on how big the level gap between you and the opponent pokemon are? for example that you get 100% of the exp if you beat a Pokemon, that is on a higher level or the same level as your pokemon, but only get 50% if your Pokemon is 10 level higher than the opponent Pokemon or so.
Reply With Quote
  #24    
Old November 26th, 2014 (7:04 PM).
Shiny Quagsire's Avatar
Shiny Quagsire Shiny Quagsire is offline
I'm Still Alive, Elsewhere
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 19
Gender: Male
Nature: Jolly
Posts: 697
Quote:
Originally Posted by Turtl3Skulll View Post
Dood, this sounds awesome, I hope you get some cool ideas from this.

Here's what came to my mind (For Fire Red U):
[SPOILER]
A way to change the warp points for the ship animation in Fire Red, so that you can use it to travel to other maps (If already possible then I apologize, I just haven't found a way to change them w/o ASM).
Ooh, I think I know this one, It doesn't require ASM, but it's actually a table I found a loooong while back. Either way, I believe the table is located at 0846AEFC, and the cutscene is executed using special 0x17B and the number in variable 0x8006. If you want to, you can repoint the table and then increase the length, setting the byte at 08147148 to the new number of locations you have. As for the format, I believe it's <bank> <map> <xpos> <ypos> <something>.
__________________



Reply With Quote
  #25    
Old November 26th, 2014 (7:16 PM). Edited December 3rd, 2014 by FBI.
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680
Quote:
Originally Posted by Christos View Post
I'm going to suggest something as well since it's kind of similar to all these routines you're doing. It's something that's been done in OR/AS. Going to put this in a spoiler:
Spoiler:
copied from Serebii: Once you have the three Regis, Regirock, Regice and Registeel, you can unlock Regigigas. The method to get this is rather complicated. In Pacifidlog Town, in the north-eastern house, a girl will tell you stories her grandfather told her. At random, she will tell you a part of the story about how to get Regigigas. This involves location and the other features. Take all three of the Pokémon to the Island Cave during the day, and make Regice hold a frozen item such as CasteliaCone, Snowball or Never-Melt Ice, and have Regice have a nickname, and Regigigas will challenge you.

So basically, a routine that would check if any of your Pokémon (or a specific one) are holding a certain item, or any of your Pokémon are nicknamed, though I believe the first one would be more useful.
I accept your challenge!
Nickname checks are done in a script via special2 0x7B. It returns 1 in the variable if it wasn't nicknamed.

Quote:
Originally Posted by tzujm33 View Post
Is it possible to make exp dependend on how big the level gap between you and the opponent pokemon are? for example that you get 100% of the exp if you beat a Pokemon, that is on a higher level or the same level as your pokemon, but only get 50% if your Pokemon is 10 level higher than the opponent Pokemon or so.
I'll add it to my projects list. iirc, this is read off of a table isn't it?

Quote:
Originally Posted by Shiny Quagsire View Post
Ooh, I think I know this one, It doesn't require ASM, but it's actually a table I found a loooong while back. Either way, I believe the table is located at 0846AEFC, and the cutscene is executed using special 0x17B and the number in variable 0x8006. If you want to, you can repoint the table and then increase the length, setting the byte at 08147148 to the new number of locations you have. As for the format, I believe it's <bank> <map> <xpos> <ypos> <something>.
Thanks :D


Party Item Checker:



How it works:
So I use the variables 0x8000 and 0x8001 again.
0x8000 Should be set to Pokemon species (2 bytes)
0x8001 Needs to be set to Item ID (1 byte...can be changes to 2 if you inserted more than 255 items)

case 1:
If a Pokemon in your party has the item specified by 0x8001 and the species matches 0x8000, return that Pokemon's slot

case 2:
If 0x8000 is set to 0x0 (no species), the routine will search your whole party and return the slot of the Pokemon holding the item specified in 0x8001

case 3:
If no Pokemon in the party are holding the item, returns 0x6.

The result will be stored in variable 0x8000. The result will, obviously, be 0x0-0x5 (slot) for item found and 0x6 for not found.


How to insert:

Compile and insert into free space the following routine:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r6, lr}
	ldr r6, =(0x2024029)
	ldrb r6, [r6]
	mov r5, #0x0

PokeLoop:
	cmp r6, r5
	beq none
	mov r0, #0x64
	mul r0, r0, r5
	mov r1, r0
	ldr r0, =(0x2024284)
	add r0, r0, r1
	mov r1, #0xC
	ldr r2, =(0x803FBE8 +1)
	bl linker
	ldr r3, .ITEM
	ldrb r3, [r3]
	cmp r0, r3
	beq PokeMatch

next:
	add r5, r5, #0x1
	b PokeLoop
	

PokeMatch:
	ldr r4, .MON
	ldrh r4, [r4]
	cmp r4, #0x0
	beq found
	ldr r2, =(0x803FBE8 +1)
	mov r0, #0x64
	mul r0, r0, r5
	mov r1, r0
	ldr r0, =(0x2024284)
	add r0, r0, r1
	mov r1, #0xB
	bl linker
	ldr r4, .MON
	ldrh r4, [r4]
	cmp r0, r4
	bne next

found:
	ldr r2, .MON
	strb r5, [r2]
	pop {r0-r6, pc}
	

none:
	ldr r0, .MON
	mov r1, #0x6
	strb r1, [r0]
	pop {r0-r6, pc}	
	
linker:
	bx r2
	
	
.align 2

.ITEM:
	.word 0x020270B8 + (0x8001 * 2) @ITEM ID
.MON:
	.word 0x020270B8 + (0x8000 *2) @PKMN SPECIES


Here's a compiled version:
Code:
7F B5 18 4E 36 78 00 25 AE 42 22 D0 64 20 68 43 01 1C 15 48 40 18 0C 21 14 4A 00 F0 1E F8 0F 4B 1B 78 98 42 01 D0 01 35 EE E7 0D 4C 24 88 00 2C 0C D0 0E 4A 64 20 68 43 01 1C 0B 48 40 18 0B 21 00 F0 0B F8 06 4C 24 88 A0 42 EC D1 04 4A 15 70 7F BD 03 48 06 21 01 70 7F BD 10 47 BA 70 03 02 B8 70 03 02 29 40 02 02 84 42 02 02 E9 FB 03 08
Usage:
In a script,
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
callasm 0x[Where you inserted the above routine +1]

That's it!
__________________
...
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

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 -8. The time now is 2:55 AM.