Advertiser Content

Development ASM Resource Thread Page 28

Started by esperance September 19th, 2014 3:13 PM
  • 281778 views
  • 1489 replies

Joexv

ManMadeOfGouda
joexv.github.io

Age 22
Male
Oregon
Seen 1 Week Ago
Posted August 7th, 2018
1,031 posts
7.2 Years
Update to Egg Check routine:
Now uses var 0x8004 for party slot instead of the user manually using the species.
Good idea to use with a special 0x9F(FR)

FR
Spoiler:
.text
.align 2
.thumb
.thumb_func

main:
push {r0-r5, lr}
ldr r1, =(0x20370C0) @var 0x8004
ldrb r1, [r1]
mov r2, #0x64
mul r1, r1, r2
ldr r0, =(0x2024284)
add r0, r0, r1 @slot
mov r4, r0 @save slot
mov r1, #0xB
bl Dec
ldr r2, =(0x8254784)
mov r3, #0x1c
mul r0, r0, r3
add r2, r0, r2
add r2, r2, #0x14
ldrb r0, [r2]
add r2, r2, #0x1
ldrb r1, [r2]
ldr r2, =(0x20370B8)
ldr r3, =(0x20370BA)
strb r1, [r3] 
strb r0, [r2]
pop {r0-r5, pc}
Dec:
ldr r2, =(0x803FBE8 +1)
bx r2

.align 2


EM (untested but idk why it wouldnt work)
Spoiler:
.text
.align 2
.thumb
.thumb_func

main:
push {r0-r5, lr}
ldr r1, =(0x20270C0)
ldrb r1, [r1]
mov r2, #0x64
mul r1, r1, r2
ldr r0, =(0x20244EC)
add r0, r0, r1
mov r4, r0
mov r1, #0xB
bl Dec
ldr r2, =(0x83203cc)
mov r3, #0x1c
mul r0, r0, r3
add r2, r0, r2
add r2, r2, #0x14
ldrb r0, [r2]
add r2, r2, #0x1
ldrb r1, [r2]
ldr r2, =(0x20270B8)
ldr r3, =(0x20270BA)
strb r1, [r3] 
strb r0, [r2]
pop {r0-r5, pc}
Dec:
ldr r2, =(0x806A519 +1)
bx r2

.align 2


I would recommend using this version of the routine over the old one as its more efficient and works better.
Thanks to Touched Senpai for telling me something I shouldve known!, but was too stupid to remember.
I died and am dead

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.3 Years

HP Regeneration per step



Intro:
Basically a routine to regenerate a Pokemon's HP every step. In this routine it's set to 3 per step. You may want to modify the exact amount to a percentage or something (see the commented line).

How to insert:

First compile and insert the following routine into free space.

Spoiler:

.text
.align 2
.thumb
.thumb_func

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

	
loop:
	cmp r6, r7
	beq end
	mov r1, #0x64
	mul r1, r1, r6
	add r0, r0, r1
	mov r5, r0
	mov r1, #0x39
	ldr r3, =(0x803FBE8 +1)
	bl linker
	mov r4, r0
	cmp r4, #0x0
	beq next
	mov r0, r5
	mov r1, #0x3A
	ldr r3, =(0x803FBE8 +1)
	bl linker
	add r6, r6, #0x1
	cmp r4, r0
	beq loop

addOn:
	add r4, r4, #0x3 @amount to add per step. Here it's 3
	cmp r4, r0
	ble cont
	mov r4, r0
	
cont:
	mov r0, r5
	mov r1, #0x39
	ldr r2, =(0x20370D0)
	strh r4, [r2]
	ldr r3, =(0x804037C)
	bl linker
	b loop
	
next:
	add r6, r6, #0x1
	b loop

end:
	pop {r0-r7}
	lsl r0, r0, #0x18
	lsr r0, r0, #0x18
	cmp r0, #0x1
	beq brancher
	mov r0, r5
	ldr r1, =(0x806D600 +1)
	bx r1

brancher:
	ldr r0, =(0x806D650 +1)
	bx r0
	
linker:
	bx r3
	
.align 2


Now in a hex editor navigate to 0x6D5F6. There you will need to insert the following byte changes:
 01 4A 10 47 00 00 XX XX XX 08
Where XX XX XX is the pointer to where you inserted the above routine +1.

Usage:

There isn't any usage. It's automatically done. You can change the amount generated by reading the line in the code which I've commented.
This is nice, but, it will be better if it is toggleable by flag
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.

C me

Creator of Pokemon League Of Legends

Age 22
Male
Seen February 2nd, 2019
Posted September 9th, 2018
683 posts
5.9 Years
Does anyone have a routine to open the flightmap in Emerald, I don't think it's a special like the normal map.

Thanks
Check out my hack: Pokemon League of Legends.
Join the subreddit: https://www.reddit.com/r/PokemonLoL/
If you would like to give me money for no reason you can do so here

Exodrake

The Manliest Chick that Ever Manlied

Age 26
Female
Seen November 30th, 2016
Posted July 24th, 2016
164 posts
6.6 Years
While clowning around in my game, I stumbled upon a bug with Protean. The Gale Wings ability (which Otachi has) trips Protean and changes the monster into a Flying type for some weird reason.



Video is silly but it does demonstrate the bug.

I'M A WITCH THAT'S HOW

FBI

Free supporter

Male
Unknown Island
Seen 1 Day Ago
Posted 2 Weeks Ago
1,909 posts
6.9 Years
It would be great, if i could warp via ASM in a script to a warp of my choice / to a location of my choice. I do not understand really function of this ASM snippet, because you don't say, which warp will be changed.
I don't understand what you are saying here. The routine currently changes the destination of all warps until untoggled.

This is nice, but, it will be better if it is toggleable by flag
Pretty simple change. I think it's like the second ASM tutorial I made which covers this. The thing with flag toggling is that everyone wants to use a different flag, and some people prefer variables. Better to do it yourself if you want toggling imo.
...

FBI

Free supporter

Male
Unknown Island
Seen 1 Day Ago
Posted 2 Weeks Ago
1,909 posts
6.9 Years

Scrolling Multi-choice boxes



Multiple choice boxes have been a really cool, yet in my opinion, a very unmastered feature in ROM hacks. Most people use JPAN's patch to make multichoice boxes, others edit the existing ones in the ROM. However, it seems like there is no solution for when the multiple choice box needs to hold more than just 8 or so options. Most competent hackers seem to have the last option be something which opens another box. It seems clunky and quite troublesome, so I decided to hack it and make it support scrolling and customization :)

Here are some things which are in some popular hacks which use a work around that can be avoided altogether with this hack:


The hack in action:



How to insert:

Before getting started with the hack there is a little bit of setting up which is required.

You need to set up a table of pointers somewhere in your ROM. This table will be a table of pointers to possible mulitchoice boxes in your ROM. Each pointer in that table will point to a location of another table. The second table will have pointers to 0xFF terminated strings which will appear in your multichoice box. Visually this is what it should look like:
Spoiler:


I suggest first setting up atleast the first table before inserting the actual routine itself.


Once you've configured the above tables, take a look at the routine in the spoilers.
table:
	.word 0x8[Location of your table, do not +1]
Change this line according to wherever you put your first table.

Once that's done compile and insert the routine into free word-aligned space!

Spoiler:

.text
.align 2
.thumb
.thumb_func

@hook via r1

main:
	ldr r4, =(0x20370BA) @var 0x8001
	ldrh r4, [r4]
	mov r1, #0xA
	strh r4, [r5, r1]
	ldrsh r0, [r5, r1]
	lsl r0, r0, #0x3
	ldr r2, malloc
	bl linker
	ldr r4, =(0x2039A14) @RAM to hold pointer to malloc data
	str r0, [r4]
	ldr r2, boxProperties
	bl linker
	mov r6, #0x0
	mov r4, #0x0
	mov r2, #0xA
	ldrsh r0, [r5, r2]
	lsl r3, r7, #0x2
	mov r10, r3
	add r1, SP, #0x18
	mov r9, r1
	cmp r6, r0
	bge loop
	ldr r2, table
	ldr r1, =(0x20370B8) @var 0x8000
	ldrh r1, [r1]
	lsl r1, r1, #0x2
	add r2, r2, r1
	ldr r2, [r2]
	mov r8, r2
	ldr r0, =(0x80CB974 +1)
	bx r0
	
	
loop:
	ldr r0, =(0x80CB9AE +1)
	bx r0

	
	
linker:
	bx r2
	
.align 2

table:
	.word 0x8[Location of your table, do not +1]
	
malloc:
	.word 0x8002BB0 +1
	
boxProperties:
	.word 0x80CBA7C +1


Now navigate to 080CB94C and insert the following byte changes:
00 49 08 47 XX XX XX 08
Where XX XX XX is wherever you inserted this routine +1. Note that the trailing 08 may change depending on your ROM situation!


Usage:

So this is a hack of special 0x158. I've essentially fixed the hard coded table read, and removed limitters as well as recoded the size readings to read of a variable instead. So the script usage of this implementation is quite simple, yet there are some complications which arise along the way. I'll talk about those complications later and first describe usage!

Paramaters:
var 0x8000 = which multichoice box should be shown from the table of multichoice boxes
var 0x8001 = How many options are supposed to be shown
var 0x8004 = leave as 0x0 for expected output. It does more, but don't play with it for now (I'll document it on a later day!).

Return value:
var 0x800D = Which option was selected, where 0x0 is the first option and 0x1 is the second options....ect.
Sample script snipplet.
#dyn 0x740000
#org @start
lock
faceplayer
msgbox 0x874001B
callstd MSG_NORMAL
setvar 0x8000 0x0 'Use first multichoice box
setvar 0x8001 0x12 ' First box has 18 options
setvar 0x8004 0x0 ' standard
special 0x158
waitspecial
release
end

#org 0x874001B
= Hello here's some tough choices
Note, after the waitspecial command finishes, variable 0x800D will have the selected option's index number inside it. From there you can do your own checks to verify which option the user had selected.

Some usage requirements:

- 0x8004 = 0. Keep it like this for now until I explain it more a later day. You can play with it too if you want, but it will likely cause a game crash.

- The menu does not close unless the "B" button is pressed inplace of an option, OR the last option is selected. FR counters this by having an "EXIT" option as the last option of the multichoice box, and any scripts which use the multichoice box are looped as well. I have a fix for this:
@ 080CBB84 insert the following byte changes:
@ 00 00 00 00
So use this if you don't want to use the last option EXIT :)
...
Male
Seen January 10th, 2019
Posted May 4th, 2017
216 posts
6.4 Years
While clowning around in my game, I stumbled upon a bug with Protean. The Gale Wings ability (which Otachi has) trips Protean and changes the monster into a Flying type for some weird reason.



Video is silly but it does demonstrate the bug.
I think MrDS plans to rewrite the priority system, it should work correctly after he done that

Xencleamas

Suddenly lurking in the shadows...

Male
Asgard
Seen January 21st, 2019
Posted August 7th, 2018
460 posts
5.8 Years

Scrolling Multi-choice boxes



Multiple choice boxes have been a really cool, yet in my opinion, a very unmastered feature in ROM hacks. Most people use JPAN's patch to make multichoice boxes, others edit the existing ones in the ROM. However, it seems like there is no solution for when the multiple choice box needs to hold more than just 8 or so options. Most competent hackers seem to have the last option be something which opens another box. It seems clunky and quite troublesome, so I decided to hack it and make it support scrolling and customization :)
Wow! This is kewl! Gonna test it out.

What about for setting its x and y alignment? For an example, I would like to have the scrolling multichoice box on the center (or right). Just like the nature of multichoice boxes that can be aligned.

Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)

BLAx501!

Pokemon Flux

Male
Madrid, Spain
Seen 1 Day Ago
Posted February 5th, 2019
80 posts
6.2 Years
I want to ask for something. Would it be possible to create a routine that doesn't changes the current music when changing maps?

For expample, I start at Pallet Town with its lovely music, I activate that routine and when I move to Route 1 or enter Oak's Research Centre, it keeps playing the music, although there is specific music for each map I've mentioned.

FBI

Free supporter

Male
Unknown Island
Seen 1 Day Ago
Posted 2 Weeks Ago
1,909 posts
6.9 Years
Wow! This is kewl! Gonna test it out.

What about for setting its x and y alignment? For an example, I would like to have the scrolling multichoice box on the center (or right). Just like the nature of multichoice boxes that can be aligned.
I don't think there are any multichoice boxes which can be aligned. Anyways, if you want information about the box X-Y please see the parameters passed to the function at
ROM:08003CE4
...

FBI

Free supporter

Male
Unknown Island
Seen 1 Day Ago
Posted 2 Weeks Ago
1,909 posts
6.9 Years

Music Overriding upon warp



I want to ask for something. Would it be possible to create a routine that doesn't changes the current music when changing maps?

For expample, I start at Pallet Town with its lovely music, I activate that routine and when I move to Route 1 or enter Oak's Research Centre, it keeps playing the music, although there is specific music for each map I've mentioned.
Happy birthday, have an untested routine. If you experience problems, let me know.

How to insert:

Compile the following routine into free space:

Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	mov r0, #0x2
	strb r0, [r2]
	
flagCheck:
	mov r0, #0xFF
	lsl r0, r0, #0x1
	add r0, r0, #0x8
	ldr r4, =(0x806E6D0 +1) @check flag 0x404
	bl linker
	ldr r1, =(0x3000FC0) @current map music
	cmp r0, #0x0
	beq norm
	ldr r0, =(0x20370B8) @var 0x8000
	ldrh r0, [r0]
	strh r0, [r1]
	
norm:
	ldrh r0, [r1]
	ldr r1, =(0x8071994 +1) @return
	bx r1
	

linker:
	bx r4

.align 2


Then insert the following byte changes to 0x807198C:
 00 48 00 47 XX XX XX 08
Note that the trailing 08 may change. XX XX XX is as usual wherever you've inserted the routine +1 in reverse hex.

Usage:
Have flag 0x404 set and variable 0x8000 to be the music ID you'd want to play. Only works upon warp.
...
Male
Seen January 10th, 2019
Posted May 4th, 2017
216 posts
6.4 Years
Better to post it here :

Here is a very simple routine that makes moves having 0 accuracy never miss. I found that more convenient than set the "always hit flag" in the battle scripts. It is for Emerald :

Spoiler:

CheckAccuracy:
add r7, r0, r1
ldrb r3, [r7, #3]
cmp r3, #0
bne Continue
mov r3, #0xFF

Continue:
mov r8, r3
mov r0, #0
ldr r1, Return
bx r1

.align 2
Return: .word 0x080467E0+1

/*00 4B 18 47 xx+1 xx xx 08 at 080467D8*/


Also, I saw few people asking for having new "-ate" abilities, which is understandable, so I post them here too if you want to make your custom ones :
Spoiler:

Emerald :
Spoiler:

.text
.align 2
.thumb
.thumb_func
.global ateabilities

Start:
push {r0-r4}
mov r0, r10
cmp r0, #0	/*Normal type*/
beq AteCheck

PopAndClassic:
pop {r0-r4}

Classic:
ldrh r0, [r6, #0x2E]
cmp r0, #0xAF
bne Back
ldr r1, SomeLoc
ldr r2, Return
mov pc, r2

Back:
ldr r0, Return1
mov pc, r0

AteCheck:
ldr r0, BankUser
ldrb r1, [r0]
ldr r2, BattleData
mov r3, #0x58
mul r1, r3
add r1, r2
add r1, #0x20
ldrb r4, [r1]
cmp r4, #0xB7	/*Index number Pixilate*/
beq Pixi
cmp r4, #0xB9	/*Index number Aerilate*/
beq Aeri
cmp r4, #0xAF	/*Index number Refrigerate*/
beq Refri
b PopAndClassic

Pixi:
mov r0, #0x17	/*Index number of your Fairy type*/
b StoreAndBoost

Aeri:
mov r0, #2	/*Index number of your Flying type*/
b StoreAndBoost

Refri:
mov r0, #0xF	/*Index number of your Ice type*/

StoreAndBoost:
mov r10, r0
Store:
ldr r0, ChangeTypeLoc
ldr r1, [r0]
add r1, #0x13
ldrb r2, [r1]
cmp r2, #0
bne PopAndClassic
mov r2, r10
strb r2, [r1]

Boost:
mov r0, r8
mov r3, #0xA7
mul r0, r3
lsr r0, #7
mov r8, r0
mul r7, r3
lsr r7, #7
b PopAndClassic



.align 2
Return: .word 0x0806961C+1
Return1: .word 0x08069634+1
BankUser: .word 0x0202420B
BattleData: .word 0x02024084
ChangeTypeLoc: .word 0x0202449C
SomeLoc: .word 0x02024404

/*00 48 00 47 xx+1 xx xx 08 at 08069614*/

So here is the official ones, what if I want to create a new one ? It is simple :
Spoiler:

That part check the ability of the user :

cmp r4, #0xB7 /*Index number Pixilate*/
beq Pixi
cmp r4, #0xB9 /*Index number Aerilate*/
beq Aeri
cmp r4, #0xAF /*Index number Refrigerate*/
beq Refri
b PopAndClassic

All we have to do is make one (or several) more check before that.

Exemple, my ability "Firething -ate" is the ability number 193 or 0xC1, all I have to do is :

cmp r4, #0xC1
beq Fire-ate

and create a new section right after the original one, say :

Fire-ate:
mov r0, #0xA /*Here is your fire type*/
b StoreAndBoost

And it is done. Note that we cannot handle Normalize the same way because of the way the engine handle some things. (actually we could but I'd have to find and alter many routines)

BLAx501!

Pokemon Flux

Male
Madrid, Spain
Seen 1 Day Ago
Posted February 5th, 2019
80 posts
6.2 Years

Music Overriding upon warp





Happy birthday, have an untested routine. If you experience problems, let me know.

How to insert:

Compile the following routine into free space:

Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	mov r0, #0x2
	strb r0, [r2]
	
flagCheck:
	mov r0, #0xFF
	lsl r0, r0, #0x1
	add r0, r0, #0x8
	ldr r4, =(0x806E6D0 +1) @check flag 0x404
	bl linker
	ldr r1, =(0x3000FC0) @current map music
	cmp r0, #0x0
	beq norm
	ldr r0, =(0x20370B8) @var 0x8000
	ldrh r0, [r0]
	strh r0, [r1]
	
norm:
	ldrh r0, [r1]
	ldr r1, =(0x8071994 +1) @return
	bx r1
	

linker:
	bx r4

.align 2


Then insert the following byte changes to 0x807198C:
 00 48 00 47 XX XX XX 08
Note that the trailing 08 may change. XX XX XX is as usual wherever you've inserted the routine +1 in reverse hex.

Usage:
Have flag 0x404 set and variable 0x8000 to be the music ID you'd want to play. Only works upon warp.
I love you man!! I'm going to try it now to check if it works well and I'll edit this post with the results.

Anyway, thanks a lot for the effort you are putting on this thread ;)

Exodrake

The Manliest Chick that Ever Manlied

Age 26
Female
Seen November 30th, 2016
Posted July 24th, 2016
164 posts
6.6 Years
I'm unsure of the correct place to bring this up, but is there anybody researching expanding the move tutor yet (move reminder in later gens)? The problem is, if your Pokemon has a moveset with more than 20 moves, they won't all show up in the move tutor because that list can only show up to 20 moves. And expanded movesets with more than 20 moves are common with hacks that try to mimic later generations.

I'M A WITCH THAT'S HOW
Seen November 20th, 2016
Posted November 20th, 2016
420 posts
4.8 Years
I'm unsure of the correct place to bring this up, but is there anybody researching expanding the move tutor yet (move reminder in later gens)? The problem is, if your Pokemon has a moveset with more than 20 moves, they won't all show up in the move tutor because that list can only show up to 20 moves. And expanded movesets with more than 20 moves are common with hacks that try to mimic later generations.
Had a (quick) look after reading your post. So this is how you can change the limit when the subroutine is reading the learnset entry:

main: @at 0x08043DA0:
	cmp r5, #0x13 @CHANGE TO NEW LIMIT
	bgt main + 0x14
Actually you might be able to just change the first byte from 0x13 to the limit, but I’m not all that confident with compares and alignment with opcodes so I wrote it out.

Sadly it isn’t this simple. This subroutine (at 0x08043C84) is apparently writing the moves to an address contained at the offset 0x0203AAB4 + 0xE8. If anyone is familiar with with what’s going on there and if there is space to add moves (a halfword at a time) that would be great. If it isn’t possible to add more moves there without corruption, it may be necessary to use malloc and change all references to that address.

As a side note, I had also wanted to rewrite the relearner to reteach egg moves. I didn’t even know there was a limit of twenty until you brought it up.

Edit:

I went a level up, and word 0x0203AAB4 is just a temporary pointer to a malloc of size 0xA6C called at 0x080E47A6. It is necessary to understand each area used in that block, or at the very least how their size and offset relates to the maximum number of moves that can be listed. Following from the malloc call to the bl to 0x080E50CC, here’s what I have so far on the block:

Spoiler:
0x1A: number of moves on relearner list
0x20: pointer to a string later in this block, the name of move #0
0x24: word 0x00000000
0x28: pointer to string of name of move #1
0x24: word 0x00000001
. . . . .
0xB8: pointer to a string of name of move #19
0xBC: word 0x00000013
0xC0: pointer to ascii “CANCEL”
0xC4: word 0x000000FE
*0xC0 and 0xC4 are “pushed” up the list if there are less than 20 moves, right after the last one

0xE8: move #0 index
0xEA: move #1 index
. . . . .
0x10E: move #19 index

0x11A: move name #0 (0xD string)
0x127: move name #1, (0xD string)
. . . . .
0x201: move name, #19
0x20E: CANCEL
*like the pointers, 0x201 and 0x20E are pushed up if there are less than 20 moves

0x260: content var8004
0x261: content var8005
The annoying thing is that the routines use actual numbers for the “bases”, such as 0xE8 being used for move indices and 0x11A in a literal pool being used for names. I attempted changing the routines before all of the graphics comes into play and, as expected, it didn’t work. This will be fun.

JPAN

pokemon rom researcher

Seen July 2nd, 2016
Posted August 31st, 2015
104 posts
11 Years
I have something for you all. A number input box for Fire Red. Image in spoiler
Spoiler:



This box allows the player to insert numbers in a hack, allowing for many new features such as a banking system, password protected doors and the like.
Included in the zip is the compiled code and the source. The source, however must be modified to be compiled in a normal compiler. It's included more as a study material to see how it was implemented.
The "number box.out" file contains the compiled code, ready to use. All you need to do is insert the code at a free location, edit the pointer at code + 0x164 to (pointer to code + 0x0179) and then call it with the callASM command followed by a waitstate. You also need to be in a locked state, so use lockall or lock before callASM, and release/releaseall at the end of the script.
To change the location of where the box is located change X at code+2 and Y at code+4 and to change the width of the box change the byte at code+6.
Here are the links for my work


Currently working on:
Battle Script Documentation
Another large project
Male
Seen June 26th, 2019
Posted January 2nd, 2017
83 posts
10.3 Years
I have something for you all. A number input box for Fire Red. Image in spoiler
Spoiler:



This box allows the player to insert numbers in a hack, allowing for many new features such as a banking system, password protected doors and the like.
Included in the zip is the compiled code and the source. The source, however must be modified to be compiled in a normal compiler. It's included more as a study material to see how it was implemented.
The "number box.out" file contains the compiled code, ready to use. All you need to do is insert the code at a free location, edit the pointer at code + 0x164 to (pointer to code + 0x0179) and then call it with the callASM command followed by a waitstate.
To change the location of where the box is located change X at code+2 and Y at code+4 and to change the width of the box change the byte at code+6.
Hey, this is great! Yet I would be glad if you would provide us the actual source code. Somebody might want to edit your code and for my part I would like to add it to my build scripts. (I don't think your code is compiled with -c)

Looking forward to combination lock like riddles :D

~SBird

Edit: Okay screw me, I just found the "number_box.tmb" and did not consider it being a code file... thanks again for the project :)
Seen January 7th, 2017
Posted August 6th, 2016
58 posts
4.3 Years
I have something for you all. A number input box for Fire Red. Image in spoiler

This box allows the player to insert numbers in a hack, allowing for many new features such as a banking system, password protected doors and the like.
Included in the zip is the compiled code and the source. The source, however must be modified to be compiled in a normal compiler. It's included more as a study material to see how it was implemented.
The "number box.out" file contains the compiled code, ready to use. All you need to do is insert the code at a free location, edit the pointer at code + 0x164 to (pointer to code + 0x0179) and then call it with the callASM command followed by a waitstate.
To change the location of where the box is located change X at code+2 and Y at code+4 and to change the width of the box change the byte at code+6.
Your work amaze me! However I haven't passed the test in script.
1. I changed the pointer you've mentioned.
2. write a script like
#org @start
setvar 0x8008 0xffff
setvar 0x8009 0x2 //random number in my brain
callasm 0x8[address+1]
waitstate
end
But when I go to talk with the man who has the script, nothing happened.
Please point out my mistake, thanks.

JPAN

pokemon rom researcher

Seen July 2nd, 2016
Posted August 31st, 2015
104 posts
11 Years
Your work amaze me! However I haven't passed the test in script.
1. I changed the pointer you've mentioned.
2. write a script like
#org @start
setvar 0x8008 0xffff
setvar 0x8009 0x2 //random number in my brain
callasm 0x8[address+1]
waitstate
end
But when I go to talk with the man who has the script, nothing happened.
Please point out my mistake, thanks.
I hadn't tested it without a lock/lockall command. Apparently, it is required, as the box does not appear without it. Instructions were edited to cover this fact.
Here are the links for my work


Currently working on:
Battle Script Documentation
Another large project
Male
Seen June 26th, 2019
Posted January 2nd, 2017
83 posts
10.3 Years
Another request (A real one this time I promise) : It is quite a neusance for (most) cases that you have to switch the number lets say from 0 to 456786 - For combination locks, codes, and generally stuff that requires LARGE numbers it would be way easier if you could edit digit by digit. Probably you could consider this. :)

~SBird
Seen January 7th, 2017
Posted August 6th, 2016
58 posts
4.3 Years
I hadn't tested it without a lock/lockall command. Apparently, it is required, as the box does not appear without it. Instructions were edited to cover this fact.
Sorry for bothering you again. I've looked at the routine and I found that maybe "func_10f7d8" is not needed to be called and after deleting it i've found nothing wrong though it's included in the original "multichoice" command for showing the triangle before the text. (number)

Another thing is that could you make a detailed note about your functions? I know that it's a bit not realistic, but i really don't know many things in the source code.

Thank you very much in advance!

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.3 Years
Hello, since the EXP. Gain canceller had been effin'ly implemented, it's good to have MONEY gain and reduce canceller so that we can make a Battle frontier-like event.
Request
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.

partys over

Male
california
Seen September 12th, 2019
Posted March 17th, 2019
268 posts
4.8 Years
I don't know where it is either. Perhaps you can ask daniilS via VM or something.




1) For forced evolution, I don't know what you're really talking about. You mean just make a Pokemon evolve without giving the player time to hit the "b" button? I'll look into Pokemon evolution sure.

2) I haven't seen it so VMing me it would be nice. Anyways this is rather easy, I've done it before. I'll post the results at the bottom of this post.

3) Skipping the introduction was already done by Knizz. There's a post in the research and development section's quick research thread.


Preventing TMs from being consumed on use



Quick research:
TMs are deleted in two places. The first place is in their own function. When called from the bag, after use the TM has it's own deletion mechanism. The second way is from the bag, after you use a TM the bag attempts to delete it as well. Well, the solution is quite simple. There's two ways to do this, either go to 0809A1D8 call your own function there which checks if the item is a TM, and if it is, just jump to the end. Or much more simply you just remove the parts from the bag and tm function that deletes the TM (Which is what I did). The former way is a way you can make another item you have unconsumable.

To insert:
Do the byte changes below
0x124F78: 00 00 00 00
0x125C80: 00 00 00 00

Make it Ungivable:
insert that at 0x1326B8: 00 00 17 E0

Make it consumable after animation:
Insert: 00 00 00 00 at 0x124F78

To remove the quantities showing up in the bag:

Compile and insert into free space:
Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	cmp r5, #0x0
	bne end
	ldr r3, =(0x8131EFE +1)
	bx r3

end:
	mov r0, r7
	mov r1, #0x8
	mov r2, r4
	ldr r6, =(0x81335B0 +1)
	bl link
	ldr r3, =(0x8131EFE +1)
	bx r3

link:
	bx r6

.align 2


Here's a compiled version:
00 2D 01 D1 05 4B 18 47 38 1C 08 21 22 1C 04 4E 00 F0 02 F8 01 4B 18 47 30 47 C0 46 FF 1E 13 08 B1 35 13 08
Now navigate to 0x131EF4 and insert:
00 48 00 47 XX XX XX 08
Where XX XX XX is the pointer to where you assembled the routine +1

Now navigate to 0x131EA5 and change the byte to E0

Unsellable:
Basically for the TMs, you can still sell them to vendors. To change this, you need to modify each TM individually. It's unfortunate, but the game checks if an item can be sold my comparing it's market price to zero. If it's strictly greater than zero, then you can sell it to a vendor, seems to be the rule. So to make TMs unsellable you need to set their market prices individually to zero.
I can't use my own checks to disguise the TMs as unique because the sell routine in shops are used for ALL items including potions, berries, TMs, and other items like nuggets.


Present :3
I've done this twice, and checked my hex editing, but it doesn't work. It still says there's 1 tm, and after I teach the tm to a pokemon the screen goes black, but the music still plays. Any idea why this happens?

DizzyEgg

Age 22
Male
Poland
Seen 7 Hours Ago
Posted 5 Days Ago
790 posts
5.9 Years
I've done this twice, and checked my hex editing, but it doesn't work. It still says there's 1 tm, and after I teach the tm to a pokemon the screen goes black, but the music still plays. Any idea why this happens?
You probably messed up pointers. Try doing it again and make sure all your pointers are correct.

Preventing TMs from being consumed on use



Quick research:
TMs are deleted in two places. The first place is in their own function. When called from the bag, after use the TM has it's own deletion mechanism. The second way is from the bag, after you use a TM the bag attempts to delete it as well. Well, the solution is quite simple. There's two ways to do this, either go to 0809A1D8 call your own function there which checks if the item is a TM, and if it is, just jump to the end. Or much more simply you just remove the parts from the bag and tm function that deletes the TM (Which is what I did). The former way is a way you can make another item you have unconsumable.

To insert:
Do the byte changes below
0x124F78: 00 00 00 00
0x125C80: 00 00 00 00

Make it Ungivable:
insert that at 0x1326B8: 00 00 17 E0

Make it consumable after animation:
Insert: 00 00 00 00 at 0x124F78

To remove the quantities showing up in the bag:

Compile and insert into free space:
Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
    cmp r5, #0x0
    bne end
    ldr r3, =(0x8131EFE +1)
    bx r3

end:
    mov r0, r7
    mov r1, #0x8
    mov r2, r4
    ldr r6, =(0x81335B0 +1)
    bl link
    ldr r3, =(0x8131EFE +1)
    bx r3

link:
    bx r6

.align 2


Here's a compiled version:
00 2D 01 D1 05 4B 18 47 38 1C 08 21 22 1C 04 4E 00 F0 02 F8 01 4B 18 47 30 47 C0 46 FF 1E 13 08 B1 35 13 08
Now navigate to 0x131EF4 and insert:
00 48 00 47 XX XX XX 08
Where XX XX XX is the pointer to where you assembled the routine +1

Now navigate to 0x131EA5 and change the byte to E0

Unsellable:
Basically for the TMs, you can still sell them to vendors. To change this, you need to modify each TM individually. It's unfortunate, but the game checks if an item can be sold my comparing it's market price to zero. If it's strictly greater than zero, then you can sell it to a vendor, seems to be the rule. So to make TMs unsellable you need to set their market prices individually to zero.
I can't use my own checks to disguise the TMs as unique because the sell routine in shops are used for ALL items including potions, berries, TMs, and other items like nuggets.


Present :3
It seems that TMs are still consumable if taught to a pokemon without animation, i.e. if it only knows 2 moves.
Advertiser Content