The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking > Binary Hack Research & Development
Reload this Page Code ASM Resource Thread

Notices
For all updates, view the main page.

Binary Hack Research & Development Got a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, 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!

Ad Content
Reply
 
Thread Tools
  #1301   Link to this post, but load the entire thread.  
Old February 5th, 2018 (11:27 PM).
Delta231's Avatar
Delta231 Delta231 is offline
A noob
 
Join Date: May 2016
Location: India
Gender: Male
Nature: Bold
Posts: 682
I want to make a request. As Dizzy's Various features added Expansion for Hall of Frame fix. Is there any way to port to Fire Red?
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
  #1302   Link to this post, but load the entire thread.  
Old February 7th, 2018 (12:14 AM). Edited February 7th, 2018 by Delta231.
Delta231's Avatar
Delta231 Delta231 is offline
A noob
 
Join Date: May 2016
Location: India
Gender: Male
Nature: Bold
Posts: 682
Quote:
Originally Posted by Lunos View Post
Exp. All / Gen. 6 Exp. Share [Emerald]
This routine was created by Samu from Wahack and it was posted right here. All the credits belong to him.

I'm afraid that I'll have to leave the comments in Spanish because I don't know how to properly translate them to English due to my lack of knowledge on the ASM programming language. Sorry :(

ASM Routine:
Code:
.thumb
.align 2

/****** NEW GEN EXP SHARE + EGG EXP FIX *******
************************************************
************************************************
************************************************
Créditos a BluRose & Lunos *********************
************************************************
************************************************/

no_crash:
	ldr r0, [r5]
	mov r1, r0
	add r1, #0x53
	ldrb r0, [r1]
	
flag_check:				@Se encarga de comprobar si hemos activado el flag
	push {r0-r2}
	ldr r0, flag_number
	ldr r2, flag_routine
	push {r1-r3}
	bl linker
	pop {r1-r3}
	cmp r0, #0x1		@Compara el flag con 0x1 (activado)
	bne routine_off
	pop {r0-r2}	
	
main:
	@Comprobar el slot y guardarlo en una variable.
	push {r3-r6}
	ldr r6, slot_var		@Carga en r3 el slot del pokemon
	ldrb r3, [r6]
	ldr r4, is_egg_party	
	mov r5, #0x64			
	mul r5, r5, r3			@Calcula las posiciones a avanzar
	ldrb r4, [r4, r5]		@Carga en r4 el byte egg/not
	cmp r4, #0x6
	beq pokemonIsEgg
	mov r2, #0x1
	b update_slot
	
pokemonIsEgg:
	mov r2, #0x0			@Establece r2 en 0 (no ganará exp)
	
update_slot:				@Actualiza y resetea el valor del slot
	add r3, #0x1
	cmp r3, #0x6
	bne end
	mov r3, #0x0
	
end:
	strh r3, [r6]
	pop {r3-r6}
	
return:
	push {r2}
	ldr r2, return_dir
	bx r2
	
routine_off:				@Ejecuta las instrucciones "originales"
	pop {r0-r2}
	mov r2, #0x1
	and r2, r0
	b return

linker:
	bx r2
	
.align 2
flag_number:
	.word 0x00000XXX 					@Elige el numero del flag
flag_routine:
	.word 0x0809D790 +1				@Rutina que checkea el flag
slot_var: 								@Escoge una variable temporal (no uses la 0x8000,
	.word 0x020275D6 + (0x800Y * 2)	@el juego la utiliza al inicializar combates dobles
is_egg_party:
	.word 0x020244EC + 0x13				@Byte que comprueba si es un huevo
return_dir:
	.word 0x0804A592 + 1				@Dirección de retorno a la rutina
Note: In order to use this routine, you must set a flag and a temp var in the Lines 72 and 76 respectively.

After inserting the routine in your ROM, open your Pokémon Emerald ROM in a hex editor and make the following changes:
-04A4BE: 02 21
-04A634: 01 20
-04A58A: C0 46 00 4A 10 47 XX XX XX 08 04 BC
Note: XX XX XX = Pointer to the ASM Routine, +1.
Example: If I were to put it in E3CF80, I'd have to replace XX XX XX with 81 CF E3.


Relevant information:
The flag handles the effect itself. If the flag you gave to the routine is OFF (0x0) the Exp. Share will work just like in Gen. 3. If it's ON (0x1), it'll work like in Gen. 1/6/7.

Result:

I'm sure there's ways to make this better, so if anyone could give that a try, that'd be awesome :)

Fire Red Port done by Samu from Whack a hack Foro.
Original Link to the post


Code:
.align 2
.thumb

/****** NEW GEN EXP SHARE + EGG EXP FIX  *******
************** FIRE RED VERSION ********************
************************************************
It Is important to note that you HAVE Tto choose the flag you
wanna use to toggle on/off the routine.
In the same way, you also have to choose a temp variable
for this routine to store a control value. (it will actually count
the current pokemon slot from it's checking)
************************************************
************************************************
************************************************
Credits to BluRose & Lunos          *********************
& Samu (lmao almost forgot myself)  ******************
************************************************
************************************************/

no_crash:
	ldr r0, [r5]
	mov r1, r0
	add r1, #0x53
	ldrb r0, [r1]
	
flag_check:			   
@will
 check the flag value, return it to r0 and compare it
	push {r0-r2}
	ldr r0, flag_number
	ldr r2, flag_routine
	push {r1-r3}
	bl linker
	pop {r1-r3}
	cmp r0, #0x1		        @If flag is set (0x1) routine is "on", otherwise is "off"
	bne routine_off
	pop {r0-r2}	
	
main:
   
@Che
cks the team slot to check and stores it into a temp variable
	push {r3-r6}
	ldr r6, slot_var		        @Loads the slot in r3
	ldrb r3, [r6]
	ldr r4, is_egg_party	
	mov r5, #0x64			
	mul r5, r5, r3			  
	ldrb r4, [r4, r5]		        @Loads in r4 the pointer to the team_slot "egg_byte"
	cmp r4, #0x6                    @if byte value is 0x6 -> pokemon is an egg
	beq pokemonIsEgg
	mov r2, #0x1                    @otherwise set r0 to 0x1 (will gain exp)
	b update_slot
	
pokemonIsEgg:
	mov r2, #0x0			@sets r2 to 0x0 (will not gain exp)
	
update_slot:				@updates and reset slot value.
	add r3, #0x1
	cmp r3, #0x6
	bne end
	mov r3, #0x0
	
end:
	strh r3, [r6]
	pop {r3-r6}
	
return:
	push {r2}
	ldr r2, return_dir
	bx r2
	
routine_off:				@"original instructions"
	pop {r0-r2}
	mov r2, #0x1
	and r2, r0
	b return

linker:
	bx r2
	
.align 2
flag_number:
	.word 0x00000[XXX] 					@Choose the flag number
flag_routine:
	.word 0x0806E6D0 +1				@Routine that returns flag value to r0
slot_var: 								@choose a temp variable
	.word 0x020270B8 + (0x800[X] * 2)	
is_egg_party:
	.word 0x02024284 + 0x13				@"eggByte" of first pokemon slot
return_dir:
	.word 0x08021CD0 + 1	               @routine return direction

The following changes in the rom are needed:
- Go to 0x08021C3A and overwrite with "02 21".
- Go to 0x08021D70 and write "01 20".
- Go to 0x08021CC6 and write the following:
"C0 46 00 4A 10 47 [XX+1 XX XX 08] 04 BC"
where [XX+1 XX XX 08] is the reverse pointer +1 to the offset of this routine.


Example: If I were to put it in 130F40, I'd have to replace XX XX XX with 41 0F 13.
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
  #1303   Link to this post, but load the entire thread.  
Old February 7th, 2018 (4:39 AM).
eMMe97 eMMe97 is offline
 
Join Date: Jan 2015
Posts: 51
Quote:
Originally Posted by Delta231 View Post
Fire Red Port done by Samu from Whack a hack Foro.
Original Link to the post


Code:
.align 2
.thumb

/****** NEW GEN EXP SHARE + EGG EXP FIX  *******
************** FIRE RED VERSION ********************
************************************************
It Is important to note that you HAVE Tto choose the flag you
wanna use to toggle on/off the routine.
In the same way, you also have to choose a temp variable
for this routine to store a control value. (it will actually count
the current pokemon slot from it's checking)
************************************************
************************************************
************************************************
Credits to BluRose & Lunos          *********************
& Samu (lmao almost forgot myself)  ******************
************************************************
************************************************/

no_crash:
	ldr r0, [r5]
	mov r1, r0
	add r1, #0x53
	ldrb r0, [r1]
	
flag_check:			   
@will
 check the flag value, return it to r0 and compare it
	push {r0-r2}
	ldr r0, flag_number
	ldr r2, flag_routine
	push {r1-r3}
	bl linker
	pop {r1-r3}
	cmp r0, #0x1		        @If flag is set (0x1) routine is "on", otherwise is "off"
	bne routine_off
	pop {r0-r2}	
	
main:
   
@Che
cks the team slot to check and stores it into a temp variable
	push {r3-r6}
	ldr r6, slot_var		        @Loads the slot in r3
	ldrb r3, [r6]
	ldr r4, is_egg_party	
	mov r5, #0x64			
	mul r5, r5, r3			  
	ldrb r4, [r4, r5]		        @Loads in r4 the pointer to the team_slot "egg_byte"
	cmp r4, #0x6                    @if byte value is 0x6 -> pokemon is an egg
	beq pokemonIsEgg
	mov r2, #0x1                    @otherwise set r0 to 0x1 (will gain exp)
	b update_slot
	
pokemonIsEgg:
	mov r2, #0x0			@sets r2 to 0x0 (will not gain exp)
	
update_slot:				@updates and reset slot value.
	add r3, #0x1
	cmp r3, #0x6
	bne end
	mov r3, #0x0
	
end:
	strh r3, [r6]
	pop {r3-r6}
	
return:
	push {r2}
	ldr r2, return_dir
	bx r2
	
routine_off:				@"original instructions"
	pop {r0-r2}
	mov r2, #0x1
	and r2, r0
	b return

linker:
	bx r2
	
.align 2
flag_number:
	.word 0x00000[XXX] 					@Choose the flag number
flag_routine:
	.word 0x0806E6D0 +1				@Routine that returns flag value to r0
slot_var: 								@choose a temp variable
	.word 0x020270B8 + (0x800[X] * 2)	
is_egg_party:
	.word 0x02024284 + 0x13				@"eggByte" of first pokemon slot
return_dir:
	.word 0x08021CD0 + 1	               @routine return direction

The following changes in the rom are needed:
- Go to 0x08021C3A and overwrite with "02 21".
- Go to 0x08021D70 and write "01 20".
- Go to 0x08021CC6 and write the following:
"C0 46 00 4A 10 47 [XX+1 XX XX 08] 04 BC"
where [XX+1 XX XX 08] is the reverse pointer +1 to the offset of this routine.


Example: If I were to put it in 130F40, I'd have to replace XX XX XX with 41 0F 13.
It doesn't work correctly.

Without asm:
pidgey level 3 - 24 exp point
with exp share - 12 + 12 exp point

With this routine:
pidgey level 3 - 12 exp point
with exp share flag off - 12 + 24 exp point
with exp share flag on - 12 + 12 + 12 + ... exp point
Reply With Quote
  #1304   Link to this post, but load the entire thread.  
Old February 12th, 2018 (2:06 PM). Edited February 13th, 2018 by Skeli.
Skeli's Avatar
Skeli Skeli is offline
Lord of the Rings
 
Join Date: Apr 2014
Location: Canada
Age: 24
Gender: Male
Nature: Adamant
Posts: 300
Auto Run [FR]
Compile this ASM, copy everything past offset 0x5BA30 in the bin file, and paste in at 0x5BA30 in your rom. This checks if a flag is set to allow you to run automatically. The default is the original running shoes flag in Fire Red. This also removes the need for a flag to be set in order for the player to run. If you want a flag, you'll have to hook to a new routine altogether.
Code:
.thumb
.global AutoRun

.org 0x5BA30
CheckAutoRunFlag:
ldr r0, .Flag
bl 0x6E6D0 @Flag Check
lsl r0, #0x18
cmp r0, #0x0
bne CheckRunTile

CheckBButton:
mov r0, #0x2
and r5, r0
cmp r5, #0x0
beq 0x5BA8C @Walk

CheckRunTile:
ldr r2, .NPC_States
ldrb r1, [r6, #0x5]
lsl r0, r1, #0x3
add r0, r1
lsl r0, #0x2
add r0, r2
ldrb r0, [r0, #0x1E]
bl 0xBD488 @Runnable Tile
cmp r0, #0x0
bne 0x5BA8C @Walk

Run:
mov r0, r4
bl 0x5BAAC
cmp r0, #0x0
beq 0x5BA74
mov r0, r4
bl 0x5C194
b 0x5BA7A

.align 2
.Flag: .word 0x82F
.NPC_States: .word 0x2036E38
This next piece of code allows you to toggle auto run through the use of the L or R buttons. Just make sure you disable the help menu (put 1D E0 at 0x13B8C2), and flashbacks (somewhere on PC). The bottom area of the code is where the customizable stuff is. If you don't know much about Ram locations leave the helper byte location alone (it's probably fine for you). Also, this code only allows you to change the toggle every second of playtime (so no spamming).
Note:
-The toggling rarely works when the game is in Turbo Mode.
-This code will only work if you've inserted the above code.
-This code must have the same flag as above to work.


Code:
.thumb
.global AutoRunToggle

@Hook at 0x8056458 with r0
@00 48 00 47 XX+1 XX XX 0x8 at 0x8056458

Main:
lsr r1, #0x10
mov r4, r1

CheckButtonPress:
ldrb r2, .Key
ldr r0, .KeyInput
ldrb r0, [r0, #0x1]
mov r1, #0x3
and r0, r1
cmp r0, r2
bne Return

CheckSecondPass:
ldr r0, .HelperByte
ldrb r0, [r0]
ldr r1, .SaveBlock2
ldr r1, [r1]
ldrb r1, [r1, #0x11]
cmp r0, r1
beq Return

ChangeFlag:
ldrh r2, .Flag
mov r0, r2
ldr r1, .Flag_Decrypt
bl Linker
cmp r0, #0x0
bne ClearFlag

SetFlag:
mov r0, r2
ldr r1, .SetFlag
bl Linker
b UpdateHelper

ClearFlag:
mov r0, r2
ldr r1, .ClearFlag
bl Linker

UpdateHelper:
ldr r1, .SaveBlock2
ldr r1, [r1]
ldrb r1, [r1, #0x11]
ldr r0, .HelperByte
strb r1, [r0]

Return:
ldr r1, =0x8112B3D
bl Linker
ldr r1, =0x8056461

Linker:
bx r1

.align 2
.SaveBlock2: .word 0x300500C
.Flag_Decrypt: .word 0x806E6D1
.SetFlag: .word 0x806E681
.ClearFlag: .word 0x806E6A9
.KeyInput: .word 0x04000130
.HelperByte: .word 0x203D800 @Replace with custom loc
.Key: .word 0x1 @0x0 = L+R, 0x1 = L, 0x2 = R @Choose key
.Flag: .word 0x82F @Change to Custom Flag
__________________
Pokemon Unbound

Reply With Quote
  #1305   Link to this post, but load the entire thread.  
Old February 12th, 2018 (3:35 PM). Edited February 12th, 2018 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Quote:
Originally Posted by Skeli Unbound View Post
Auto Run [FR]
Compile this ASM, copy everything past offset 0x5BA30 in the bin file, and paste in at 0x5BA30 in your rom. This checks if a flag is set to allow you to run automatically. The default is the original running shoes flag in Fire Red. This also removes the need for a flag to be set in order for the player to run. If you want a flag, you'll have to hook to a new routine altogether.
Code:
.thumb
.global AutoRun

.org 0x5BA30
CheckAutoRunFlag:
ldr r0, .Flag
bl 0x6E6D0 @Flag Check
lsl r0, #0x18
cmp r0, #0x0
bne CheckRunTile

CheckBButton:
mov r0, #0x2
and r5, r0
cmp r5, #0x0
beq 0x5BA8C @Walk

CheckRunTile:
ldr r2, .NPC_States
ldrb r1, [r6, #0x5]
lsl r0, r1, #0x3
add r0, r1
lsl r0, #0x2
add r0, r2
ldrb r0, [r0, #0x1E]
bl 0xBD488 @Runnable Tile
cmp r0, #0x0
bne 0x5BA8C @Walk

Run:
mov r0, r4
bl 0x5BAAC
cmp r0, #0x0
beq 0x5BA74
mov r0, r4
bl 0x5C194
b 0x5BA7A

.align 2
.Flag: .word 0x82F
.NPC_States: .word 0x2036E38
Would it be possible to modify it a little bit so when pressing a button like say.. the GBA's R Button, the flag is enabled or disabled? Then it would work just like in Pokémon Procyon/Deneb, a pair of Japanese ROM Hacks in which by pressing the R Button you can toggle ON or OFF the Running Shoes.
__________________
Reply With Quote
  #1306   Link to this post, but load the entire thread.  
Old February 12th, 2018 (5:53 PM). Edited February 12th, 2018 by Skeli.
Skeli's Avatar
Skeli Skeli is offline
Lord of the Rings
 
Join Date: Apr 2014
Location: Canada
Age: 24
Gender: Male
Nature: Adamant
Posts: 300
Quote:
Originally Posted by Lunos View Post
Would it be possible to modify it a little bit so when pressing a button like say.. the GBA's R Button, the flag is enabled or disabled? Then it would work just like in Pokémon Procyon/Deneb, a pair of Japanese ROM Hacks in which by pressing the R Button you can toggle ON or OFF the Running Shoes.
They should really learn to share more often.

(Scroll up)
__________________
Pokemon Unbound

Reply With Quote
  #1307   Link to this post, but load the entire thread.  
Old February 13th, 2018 (12:41 AM). Edited February 15th, 2018 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
Quote:
Originally Posted by Skeli Unbound View Post
This next piece of code allows you to toggle auto run through the use of the L or R buttons. Just make sure you disable the help menu first (put 1D E0 at 0x13B8C2). The bottom of the code is where the customizable stuff is. If you don't know much about Ram locations leave the helper byte location alone (it's probably fine for you). Also, this code only allows you to change the toggle every second of playtime (so no spamming). Note that the the toggling rarely works when the game is in Turbo Mode.

Code:
.thumb
.global AutoRunToggle

@Hook at 0x8056458 with r0
@00 48 00 47 XX+1 XX XX 0x8 at 0x8056458

Main:
lsr r1, #0x10
mov r4, r1

CheckButtonPress:
ldrb r2, .Key
ldr r0, .KeyInput
ldrb r0, [r0, #0x1]
mov r1, #0x3
and r0, r1
cmp r0, r2
bne Return

CheckSecondPass:
ldr r0, .HelperByte
ldrb r0, [r0]
ldr r1, .SaveBlock2
ldr r1, [r1]
ldrb r1, [r1, #0x11]
cmp r0, r1
beq Return

ChangeFlag:
ldrh r2, .Flag
mov r0, r2
ldr r1, .Flag_Decrypt
bl Linker
cmp r0, #0x0
bne ClearFlag

SetFlag:
mov r0, r2
ldr r1, .SetFlag
bl Linker
b UpdateHelper

ClearFlag:
mov r0, r2
ldr r1, .ClearFlag
bl Linker

UpdateHelper:
ldr r1, .SaveBlock2
ldr r1, [r1]
ldrb r1, [r1, #0x11]
ldr r0, .HelperByte
strb r1, [r0]

Return:
ldr r1, =0x8112B3D
bl Linker
ldr r1, =0x8056461

Linker:
bx r1

.align 2
.SaveBlock2: .word 0x300500C
.Flag_Decrypt: .word 0x806E6D1
.SetFlag: .word 0x806E681
.ClearFlag: .word 0x806E6A9
.KeyInput: .word 0x04000130
.HelperByte: .word 0x203D800 @Replace with custom loc
.Key: .word 0x1 @0x0 = L+R, 0x1 = L, 0x2 = R @Choose key
.Flag: .word 0x82F @Change to Custom Flag
The first routine is working perfectly fine on my end, but this one's not.
1) I went to the offset 13B8C2 and wrote "1D E0".
2) I compiled the ASM Routine, the only changes I did to it were:
-Line 70: .Key: .word 0x2
-Line 71: .Flag: .word 0x200
3) I inserted the compiled routine in the offset 71A250.
4) I went to the offset 056458 and wrote: 00 48 00 47 51 A2 71 08
And then when I start the game, enable the Flag 0x200 and press the R Button, my character still walks and I still have to run by holding the B Button :/

EDIT: Fixed. I didn't get at first that I had to use both ASM Routines at the same time.
__________________
Reply With Quote
  #1308   Link to this post, but load the entire thread.  
Old February 20th, 2018 (5:16 PM).
DarkPsychic's Avatar
DarkPsychic DarkPsychic is offline
 
Join Date: Jul 2012
Location: CO
Gender: Male
Nature: Timid
Posts: 146
Pokemon LoathingFriendship Evolution:
Code:
.text
.align 2
.thumb
.thumb_func
.global loathFriendship

main:
push {r0-r7}
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r3, r0, r3
ldrb r2, [r3, #0x2]
mov r0, r8
bl decrypt
mov r11, r0
pop {r0-r7}
mov r1, r11
cmp r1, #0x10
blo max_lowhappy
b exit

max_lowhappy:
mov r10, r3
pop {r0-r7}
mov r1, r10
ldr r0, evolution_loc
bx r0

exit:
pop {r0-r7}
ldr r0, no_evo
bx r0

decrypt: 
push {r0-r7}
mov r1, #0x20
ldr r2, decryptpoke
bx r2

.align 2
no_evo: .word 0x08043111
evolution_loc: .word 0x0804310D
decryptpoke: .word 0x0803FBE9
The Pokemons happiness must be between 0-10 to trigger the evolution.
To insert follow instructions in this thread.

I hope some find this useful.
I thought about trade evolution basically being just this.
A Pokemon so depressed it evolves...
Reply With Quote
  #1309   Link to this post, but load the entire thread.  
Old February 24th, 2018 (5:04 AM).
Miko-chan's Avatar
Miko-chan Miko-chan is offline
Haruka Fanboy
 
Join Date: Feb 2018
Location: Hoenn <3
Age: 27
Gender: Male
Nature: Timid
Posts: 3
Is there a port of the Disable Bag to Emerald?

Trying on my own, I was trying to convert this "Prevent Items" routine by JPAN here:
Spoiler:
Can't post links yet :(
pokecommunity.com/showpost.php?p=6746353&postcount=35

The only problem I have now is finding the address of the routine that shows the "Items can't be used now." message.

Here's the original FR Version:
Spoiler:
Code:
.thumb
.align 2
/*Simple routine to remove item usage from pokemon battles. Same strategy as
the Not catching bypass, we will be using the script already in place for 
the item prevention on link/tower battles, and jump to it if it's what we want.

in 080143D6 place 0x00 47, and at 08014410 place the pointer to this function*/
/*begin*/
No_items: 		ldr r0, num_to_check	/*flags, variables or addresses*/
				/*uncomment if flag*/
				/*
				bl	CheckFlag	//returns r0 as 1 if flag set
				cmp r0, #0x1
				bne return_to_normal
				*/
				/*uncomment if variable*/
				/*
				bl	LoadVariable		//returns r0 as variable content
				cmp r0, VALUE_OF_VARIABLE
				bne return_to_normal
				*/
				/*The address version, compiled*/
				ldrb r0, [r0]
				cmp r0, #0x1
				bne return_to_normal
				ldr r0, denyItemsAddr
				bx r0
				
return_to_normal:	ldr r1, battleFlags
				ldr r0, [r1]
				ldr r1, itemForbiddenTestAddr
				bx r1
/*.hword 0x0000	*/
num_to_check:		.word 0x020370c0	/*var 8004 address*/
battleFlags:			.word 0x02022b4c
denyItemsAddr: 		.word 0x080143e1
itemForbiddenTestAddr:	.word 0x080143d9

/*end*/
/*if needed, the called routines*/
/*begin*/
/*
LoadVariable:	ldr r1, ld_Var_addr
				bx r1
ld_Var_addr:	.word 0x0806e569
*/
/*		
CheckFlag:		ldr r1, flagCheck_addr
				bx r1
flagCheck_addr:	.word 0x0806e6d1
*/

/*end*/

Here's mine (omitted stuff for clarity):
Spoiler:
Code:
/* Routine starts somewhere at 0x0806F116? */
.thumb
.align 2

No_items:    ldr r0, num_to_check
                    ldrb r0, [r0]
                    cmp r0, #0x1
                    bne return_to_normal
                    ldr r0, denyItemsAddr
                    bx r0
				
return_to_normal:	ldr r1, battleFlags
				ldr r0, [r1]
				ldr r1, itemForbiddenTestAddr
				bx r1

num_to_check:          	 .word 0x02022FFC		/* Just to test */
battleFlags:			 .word 0x02022FEC
denyItemsAddr:         	 .word 0x08?????? 		/* I can't find this one */
itemForbiddenTestAddr:	 .word 0x0806F11B		/* Not totally sure here tbh */
Reply With Quote
  #1310   Link to this post, but load the entire thread.  
Old February 24th, 2018 (8:39 AM).
Hotice03 Hotice03 is offline
 
Join Date: Apr 2017
Posts: 10
I want to make an ghost eeveelution and to evolve it you must level it up with a rare candy in the party while it is fainted then once it is leveled up it evolves
Reply With Quote
  #1311   Link to this post, but load the entire thread.  
Old February 24th, 2018 (5:25 PM). Edited February 25th, 2018 by Miko-chan.
Miko-chan's Avatar
Miko-chan Miko-chan is offline
Haruka Fanboy
 
Join Date: Feb 2018
Location: Hoenn <3
Age: 27
Gender: Male
Nature: Timid
Posts: 3
Old post :/
Spoiler:
Is there a port of the Disable Bag in Emerald?

I've been trying it myself by trying to port JPAN's Prevent Items routine from Fire Red.
It checks for a certain value in memory and calls the "Items can't be used now." used in link battles if it meets the condition.

The original routine from FR:
Code:
.thumb
.align 2
@At 080143D6 place 00 47, and at 08014410 place the pointer to this function + 1
No_items: 		ldr r0, num_to_check
				ldrb r0, [r0]
				cmp r0, #0x1
				bne return_to_normal
				ldr r0, denyItemsAddr
				bx r0
				
return_to_normal:	ldr r1, battleFlags
				ldr r0, [r1]
				ldr r1, itemForbiddenTestAddr
				bx r1

num_to_check:		 .word 0x020370c0
battleFlags:			 .word 0x02022B4C
denyItemsAddr:		 .word 0x080143E1
itemForbiddenTestAddr:	 .word 0x080143D9
My attempt at porting it to Emerald:
Code:
@Routine is somewhere at 0x0806F116
.thumb
.align 2

No_items:    ldr r0, num_to_check
                    ldrb r0, [r0]
                    cmp r0, #0x1
                    bne return_to_normal
                    ldr r0, denyItemsAddr
                    bx r0
				
return_to_normal:	ldr r1, battleFlags
				ldr r0, [r1]
				ldr r1, itemForbiddenTestAddr
				bx r1

num_to_check:           	 .word 0x02022FFC		@Some random location for testing
battleFlags:	        	 .word 0x02022FEC
denyItemsAddr:         	 .word 0x08			@Unusure where this is one located
itemForbiddenTestAddr:	 .word 0x0806F11B		@Also not sure here but seems like it

Okay, having checked the Disable Bag routine for FR here in this thread (which I actually checked before using JPAN's, but apparently I was so in a rush that I didn't check properly).

Here is the routine for Emerald:
Code:
@Insert this compiled routine at 0x0803C230
.thumb
.equ qq_bag,        0x0803C230
.equ flag_check,    0x0809D790
.equ loc_803C23E,   0x0803C23E
.equ off_803C254,   0x0803C254
 
.equ loc,       qq_bag
.equ checkflag, flag_check
.equ blockitem, loc_803C23E
.equ flag,      off_803C254
 
main:
    ldr r0, [pc, #flag-(loc+4)]
    bl +checkflag-loc
    bne +blockitem-loc
    NOP
    NOP
All those hours wasted yesterday :catflip:
Reply With Quote
  #1312   Link to this post, but load the entire thread.  
Old March 2nd, 2018 (1:14 AM).
DarkPsychic's Avatar
DarkPsychic DarkPsychic is offline
 
Join Date: Jul 2012
Location: CO
Gender: Male
Nature: Timid
Posts: 146
Quote:
Originally Posted by Hotice03 View Post
I want to make an ghost eeveelution and to evolve it you must level it up with a rare candy in the party while it is fainted then once it is leveled up it evolves
Here ya go ^_^
Faint/Low Hp Evolution:
Code:
.text
.align 2
.thumb
.thumb_func
.global faintEvolution

main:
push {r0-r7}
add r0, r6, r7   @line to change if expanded evos
lsl r0, r0, #0x3
add r0, r2, r0
add r3, r0, r3
ldrb r2, [r3, #0x2]
mov r0, r8
bl decrypt
mov r11, r0
pop {r0-r7}
mov r1, r11
cmp r1, #0x2    @Compare Amount of Current Hp
blo low_hp
b exit

low_hp:
mov r10, r3
pop {r0-r7}
mov r1, r10
ldr r0, evolution_loc
bx r0

exit:
pop {r0-r7}
ldr r0, no_evo
bx r0

decrypt: 
push {r0-r7}
mov r1, #0x39
ldr r2, decryptpoke
bx r2

.align 2
no_evo: .word 0x08043111
evolution_loc: .word 0x0804310D
decryptpoke: .word 0x0803FBE9

Note for the first highlighted in green:
If you have expaned your evolutions for your pokemon you must change this line:
"add r0, r6, r7"
to:
8 evos or less = lsl r0, r6, #0x1
16 evos or less = lsl r0, r6, #0x2
32 evos or less = lsl r0, r6, #0x3

or
just change the bytes in the compiled file from F0 19 to:
8 evos or less = 70 00
16 evos or less = B0 00
32 evos or less = F0 00


Note for second highlighted in green:
As it is the Pokemon must be leveled up with a Rare Candy to get it to revive and have 1-Hp.
You can change the value of 0x2 to something higher but anything lower than 0x2 will not work with this routine.
After the compare it the vaule must be lower than the "0x2" or what ever value you decide to change it to.


Hope this helps!
Reply With Quote
  #1313   Link to this post, but load the entire thread.  
Old March 4th, 2018 (6:24 AM).
Hotice03 Hotice03 is offline
 
Join Date: Apr 2017
Posts: 10
omg thank you so much dude! youve just made me so happy now since im still new to asm i gotta figure out the little bits but im sure i can get it :) again thank you so much would you like credit since youve created the asm for it
Reply With Quote
  #1314   Link to this post, but load the entire thread.  
Old March 4th, 2018 (3:50 PM).
Hotice03 Hotice03 is offline
 
Join Date: Apr 2017
Posts: 10
so me and my friend got it into the rom and everything and turns out it didnt work, did you test it? cause we cant get it to work
Reply With Quote
  #1315   Link to this post, but load the entire thread.  
Old March 13th, 2018 (1:11 PM). Edited March 13th, 2018 by Dionen.
Dionen's Avatar
Dionen Dionen is offline
deprived of sleep
 
Join Date: Jun 2011
Location: Brazil
Gender: Male
Nature: Quirky
Posts: 295
Quote:
Originally Posted by FBI View Post

OAM routines


Generating OAMs



This routine is only to generate OAMs which are trainer or Pokemon sprites. I've modified it to be usable with a script, but honestly, setting the values yourself via ASM would've been faster (not that this is noticeably slow, just comparatively). I will have to do more research on making it portray an arbitrary image, but with the expansion work on the Pokedex and such, I don't see it as very necessary anymore.

How to insert:
Compile and insert the following routine into a free word aligned offset.

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func
 
main:
        push {r0-r4, lr}
        sub SP, SP, #0x14
       
        @load PID
        ldr r2, =(0x20370B8) @PokeSlot
        ldrb r2, [r2]
        cmp r2, #0x6
        beq shiny
        ldr r0, =(0x2024284)
        mov r4, #0x64
        mul r2, r2, r4
        add r2, r2, r0
        ldrh r2, [r2] @PID
       
        @load TID
        ldr r1, =(0x300500C)
        ldr r1, [r1]
        ldrh r1, [r1, #0xA] @TID
        b cont
               
shiny:
        mov r0, #0x0
        mov r1, r0
        mov r2, r0
 
cont:
        @X-pos
        ldr r0, =(0x20370BA)
        ldrh r0, [r0]
        str r0, [SP] @X-Pos
       
        @Y-pos
        ldr r0, =(0x20370BC)
        ldrh r0, [r0]
        str r0, [SP, #0x4] @Y-Pos
       
        @pal #
        ldr r0, =(0x20370BE)
        ldrh r0, [r0]
        str r0, [SP, #0x8] @pal #
       
        ldr r3, =(0x20370C0)
        ldrb r3, [r3]
        cmp r3, #0x1
        bne nonsil
        mov r3, #0x0
        str r3, [SP, #0xC] @occupacity
        b unkn
       
nonsil:
        ldr r3, =(0x0000FFFF)
        str r3, [SP, #0xC] @occupacity
       
unkn:  
        @??? - No idea, but leave as 0s
        @possibly priority?
	ldr r0, =(0x20370C6)
	ldrb r0, [r0]
        str r0, [SP, #0x10]
	mov r0, #0x0
        str r0, [SP, #0x14]
       
        @species/sprite ID
        ldr r0, =(0x20370C2)
        ldrh r0, [r0]
 
        @front VS back
        ldr r3, =(0x20370C4)
        ldrb r3, [r3]
 
        @display func
        ldr r4, =(0x810BDAC +1)
        bl linker
        add SP, SP, #0x14
        pop {r0-r4, pc}
       
 
 
linker:
        bx r4
 
.align 2
Compiled version:
Code:
1F B5 85 B0 18 4A 12 78 06 2A 08 D0 17 48 64 24 62 43 12 18 12 88 16 49 09 68 49 89 02 E0 00 20 01 1C 02 1C 13 48 00 88 00 90 13 48 00 88 01 90 12 48 00 88 02 90 12 4B 1B 78 01 2B 02 D1 00 23 03 93 01 E0 0F 4B 03 93 0F 48 00 78 04 90 00 20 05 90 0E 48 00 88 0E 4B 1B 78 0E 4C 00 F0 02 F8 05 B0 1F BD 20 47 C0 46 B8 70 03 02 84 42 02 02 0C 50 00 03 BA 70 03 02 BC 70 03 02 BE 70 03 02 C0 70 03 02 FF FF 00 00 C6 70 03 02 C2 70 03 02 C4 70 03 02 AD BD 10 08
so, little question, cause I'm still learning.
Is it possible to modify this routine in order to display Item images? Is this display function able to handle them?
If not, what is the best way to show them?
__________________
Reply With Quote
  #1316   Link to this post, but load the entire thread.  
Old March 14th, 2018 (9:33 PM).
Delta231's Avatar
Delta231 Delta231 is offline
A noob
 
Join Date: May 2016
Location: India
Gender: Male
Nature: Bold
Posts: 682
Quote:
Originally Posted by Petuuuhhh View Post
Is there a way to make the turbo slower?
Just don't use the routine simple.
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
  #1317   Link to this post, but load the entire thread.  
Old March 15th, 2018 (5:25 AM).
Skeli's Avatar
Skeli Skeli is offline
Lord of the Rings
 
Join Date: Apr 2014
Location: Canada
Age: 24
Gender: Male
Nature: Adamant
Posts: 300
Quote:
Originally Posted by Petuuuhhh View Post
Is there a way to make the turbo slower?
You could add a bunch of useless long loops to that routine, but I'm pretty sure that'd make the game lag as well.
__________________
Pokemon Unbound

Reply With Quote
  #1318   Link to this post, but load the entire thread.  
Old March 15th, 2018 (1:44 PM).
Skeli's Avatar
Skeli Skeli is offline
Lord of the Rings
 
Join Date: Apr 2014
Location: Canada
Age: 24
Gender: Male
Nature: Adamant
Posts: 300
Why do you want to prevent the player from using the turbo button? One of the main benefits to playing a rom is that you get a turbo button.

It would lag without turbo. Turbo would probably still speed the game up somewhat, but just not as much.
__________________
Pokemon Unbound

Reply With Quote
  #1319   Link to this post, but load the entire thread.  
Old March 16th, 2018 (2:25 PM).
DarkPsychic's Avatar
DarkPsychic DarkPsychic is offline
 
Join Date: Jul 2012
Location: CO
Gender: Male
Nature: Timid
Posts: 146
Quote:
Originally Posted by Petuuuhhh View Post
I want the player to get as authentic of an experience as possible when playing my hack, which means that if I can disable the Turbo button, I will. Is there an emulator that doesn't have a turbo button?

Thank you,
This should be asked in the Quick Questions thread.
I have told you before that even with asm this would be hard.
Because its on a emulator level.
Reply With Quote
  #1320   Link to this post, but load the entire thread.  
Old March 16th, 2018 (3:34 PM). Edited November 21st, 2020 by AkameTheBulbasaur.
AkameTheBulbasaur's Avatar
AkameTheBulbasaur AkameTheBulbasaur is offline
Akame Marukawa of Iyotono
 
Join Date: May 2013
Location: A place :D
Age: 25
Gender: Male
Nature: Docile
Posts: 408
Quote:
Originally Posted by Petuuuhhh View Post
I want the player to get as authentic of an experience as possible when playing my hack, which means that if I can disable the Turbo button, I will. Is there an emulator that doesn't have a turbo button?

Thank you,
I'm pretty sure No$GBA doesn't. You can speed up the emulation through the options menu, but as far as I know there isn't a button that you press to do that automatically.

I could be wrong about this so nobody sue me if there in fact is one xD

Sweet Scent Script
This is what I did with FBI's Field Moves ASM in this post.

I basically just made it so you could attract certain Pokemon in certain special areas with an increased shiny chance.

You will need FBI's Shiny Generator. Either use this one here or use the modified version if you want to have Synchronize's overworld effect here.

Then follow the steps for inserting a new field move, except you don't need to expand the table if you're replacing Sweet Scent's effect. Just replace the pointer C9 E0 0D 08 with the pointer to the first routine.

Also, you will need to go to 0x82E76 and change “20 78” to “06 E0”. Also go to 0x82E6C and change “0C 31” to “04 31”. This allows Special 0xAB to use the grass data when loading Wild Pokémon.

Anyway the script I made is here:
Spoiler:
#dyn 0x6B0000
#org @start
lockall
compare 0x4050 0x0
if true jump @Normal
compare 0x4050 0x1
if true jump @Celebi
compare 0x4050 0x2
if true jump @Hooh
compare 0x4050 0x3
if true jump @Lugia
compare 0x4050 0x4
if true jump @Moltres
compare 0x4050 0x5
if true jump @Articuno
compare 0x4050 0x6
if true jump @Zapdos
compare 0x4050 0x7
if true jump @Entei
compare 0x4050 0x8
if true jump @Raikou
compare 0x4050 0x9
if true jump @Suicune
compare 0x4050 0xA
if true jump @Mewtwo
release
end

#org @Normal
checkitem 0xEF 1
if true jump @SCharm
jump @NoCharm

#org @SCharm
random 0x10A
jump @SweetScent

#org @NoCharm
random 0x320
jump @SweetScent

#org @SweetScent
compare LASTRESULT 0x1
if true call @ShinySet
doanimation 0x33
release
end

#org @Celebi 'Forest
setvar 0x4054 CELEBI
setvar 0x4055 ROSELIA
setvar 0x4056 RALTS
setvar 0x4057 PARAS
jump @SetChance

#org @Hooh 'Volcano
setvar 0x4054 HO-OH
setvar 0x4055 SOLROCK
setvar 0x4056 NUMEL
setvar 0x4057 VULPIX
jump @SetChance

#org @Lugia 'Island
setvar 0x4054 LUGIA
setvar 0x4055 EEVEE
setvar 0x4056 MARILL
setvar 0x4057 CATERPIE
jump @SetChance

#org @Moltres 'Mountain
setvar 0x4054 MOLTRES
setvar 0x4055 RHYHORN
setvar 0x4056 MACHOP
setvar 0x4057 GEODUDE
jump @SetChance

#org @Articuno 'Tundra
setvar 0x4054 ARTICUNO
setvar 0x4055 DELIBIRD
setvar 0x4056 SPHEAL
setvar 0x4057 SWINUB
jump @SetChance

#org @Zapdos 'Savannah
setvar 0x4054 ZAPDOS
setvar 0x4055 TAUROS
setvar 0x4056 ELECTRIKE
setvar 0x4057 RATTATA
jump @SetChance

#org @Entei 'Ruins
setvar 0x4054 ENTEI
setvar 0x4055 EKANS
setvar 0x4056 ZUBAT
setvar 0x4057 BALTOY
jump @SetChance

#org @Suicune 'Ruins
setvar 0x4054 SUICUNE
setvar 0x4055 EKANS
setvar 0x4056 ZUBAT
setvar 0x4057 BALTOY
jump @SetChance

#org @Raikou 'Ruins
setvar 0x4054 RAIKOU
setvar 0x4055 EKANS
setvar 0x4056 ZUBAT
setvar 0x4057 BALTOY
jump @SetChance

#org @Mewtwo 'Settlement
setvar 0x4054 MEWTWO
setvar 0x4055 MAGNEMITE
setvar 0x4056 VOLTORB
setvar 0x4057 PICHU
jump @SetChance

#org @SetChance
random 0xFF
compare LASTRESULT 0x7F
if >= jump @Common
compare LASTRESULT 0x3F
if >= jump @Uncommon
compare LASTRESULT 0x1F
if >= jump @Rare
jump @SecretRare

#org @Common
copyvar 0x8000 0x4057
setvar 0x4041 0x1
checkitem 0xEF 1
if true jump @SCharmC
jump @NoCharmC

#org @SCharmC 'max: 40/400 = 10%
random 0x10A
comparevars LASTRESULT 0x4044
if <= call @ShinySet
jump @Battle

#org @NoCharmC 'max: 40/800 = 5%
random 0x320
comparevars LASTRESULT 0x4044
if <= call @ShinySet
jump @Battle

#org @Uncommon
copyvar 0x8000 0x4056
setvar 0x4041 0x2
checkitem 0xEF 1
if true jump @SCharmUC
jump @NoCharmUC

#org @SCharmUC 'max: 40/266 = 15%
random 0x10A
comparevars LASTRESULT 0x4045
if <= call @ShinySet
jump @Battle

#org @NoCharmUC 'max: 40/400 = 10%
random 0x190
comparevars LASTRESULT 0x4045
if <= call @ShinySet
jump @Battle

#org @Rare
copyvar 0x8000 0x4055
setvar 0x4041 0x3
checkitem 0xEF 1
if true jump @SCharmR
jump @NoCharmR

#org @SCharmR 'max: 40/200 = 20%
random 0xC8
comparevars LASTRESULT 0x4046
if <= call @ShinySet
jump @Battle

#org @NoCharmR 'max: 40/266 = 15%
random 0x10A
comparevars LASTRESULT 0x4046
if <= call @ShinySet
jump @Battle

#org @SecretRare
copyvar 0x8000 0x4054
setvar 0x4041 0x4
checkitem 0xEF 1
if true jump @SCharmR
jump @NoCharmR

#org @SCharmR 'max: 40/160 = 25%
random 0xA0
comparevars LASTRESULT 0x4047
if <= call @ShinySet
jump @Battle

#org @NoCharmR 'max: 40/200 = 20%
random 0xC8
comparevars LASTRESULT 0x4047
if <= call @ShinySet
jump @Battle

#org @Battle
doanimation 0x1
copyvar LASTRESULT 0x8000
showpokepic LASTRESULT 0xA 0x3
hidepokepic
battle LASTRESULT 0xA SITRUSBERRY
special BATTLE_INTERLACE
waitspecial
special2 LASTRESULT 0xB4
compare LASTRESULT 0x4
if true jump @Reset
compare 0x4041 0x1
if true jump @CommonPlus
compare 0x4041 0x2
if true jump @UncommonPlus
compare 0x4041 0x3
if true jump @RarePlus
compare 0x4041 0x4
if true jump @SRarePlus
release
end

#org @CommonPlus
compare 0x4044 0x28
if true jump @Return
addvar 0x4044 0x1
release
end

#org @UncommonPlus
compare 0x4045 0x28
if true jump @Return
addvar 0x4045 0x1
release
end

#org @RarePlus
compare 0x4046 0x28
if true jump @Return
addvar 0x4046 0x1
release
end

#org @SRarePlus
compare 0x4047 0x28
if true jump @Return
addvar 0x4047 0x1
release
end

#org @ShinySet
setvar 0x8003 0x1
return

#org @Reset
setvar 0x4044 0x0
setvar 0x4045 0x0
setvar 0x4046 0x0
setvar 0x4047 0x0
release
end

#org @Return
release
end


The CheckItem part was for the Shiny Charm, so if you have that then change the number to the index number for the Shiny Charm.

I also modified the Set Wild Battle command with this:
Spoiler:
/*Replace the pointer 69 C3 06 08 with the pointer to this +1*/
.text
.align 2
.thumb
.thumb_func

Main:
push {r4-r6, lr}
mov r4, r0
bl GetSpecies
ldr r5, =0x800D
cmp r0, r5
beq LastResult
b Return

GetSpecies:
ldr r2, .GetSpecies
bx r2

LastResult:
ldr r5, .Var800D
ldrh r0, [r5]

Return:
ldr r5, .Return
bx r5

.align 2
.GetSpecies: .word 0x080698F9
.Var800D: .word 0x020370D0
.Return: .word 0x0806C371


Basically all that does is let you use LASTRESULT for the Pokemon.
__________________
"The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo
Reply With Quote
  #1321   Link to this post, but load the entire thread.  
Old March 27th, 2018 (2:45 AM).
Diego98 Diego98 is offline
 
Join Date: Jan 2015
Gender: Male
Posts: 22
Anyone can make a routine that counts the amount of a certain item in the bag and stores it in a variable? I know this can be made with loops but I think a routine is a better way to do this. Thanks anyway.
Reply With Quote
  #1322   Link to this post, but load the entire thread.  
Old March 27th, 2018 (3:58 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Quote:
Originally Posted by Diego98 View Post
Anyone can make a routine that counts the amount of a certain item in the bag and stores it in a variable? I know this can be made with loops but I think a routine is a better way to do this. Thanks anyway.
Spherical Ice made a routine for that.
__________________
Reply With Quote
  #1323   Link to this post, but load the entire thread.  
Old March 27th, 2018 (11:44 AM).
Diego98 Diego98 is offline
 
Join Date: Jan 2015
Gender: Male
Posts: 22
Quote:
Originally Posted by DrFuji View Post
Thanks! Just what I was searching for.
Reply With Quote
  #1324   Link to this post, but load the entire thread.  
Old April 4th, 2018 (4:53 AM).
pikachux2's Avatar
pikachux2 pikachux2 is offline
Never Evolve
 
Join Date: Mar 2010
Location: USA
Gender: Male
Nature: Jolly
Posts: 115
Hey helpful people, you all might have seen my post about this in a thread under Rom Hacking. But anyway, I've never used ASM coding in my PKMN hacking career thus far. I'm making a game in which I only want double battles and have encountered a glitch in which if you start a double battle with 1 (not-fainted) Pokémon is your party, the game just clones that pokemon for your partner in battle... (not desired) I've come to the realization that the only way to keep this game double battles only Is to either fix this glitch by changing the battle engine (sounds too hard) or to find another solution.

Well, the solution I came up with was to possibly have an ASM call before each trainer that would change the bitfield's double battle bit of the trainer in question to 1 or 0 based on how many Pokémon the player has. Now again, I've never used ASM so I don't know if you have access to that certain part of the rom, but if you did this would be a great way of fixing my problem.

So any help would be awesome, thanks!
Reply With Quote
  #1325   Link to this post, but load the entire thread.  
Old April 4th, 2018 (5:35 AM).
Delta231's Avatar
Delta231 Delta231 is offline
A noob
 
Join Date: May 2016
Location: India
Gender: Male
Nature: Bold
Posts: 682
Quote:
Originally Posted by pikachux2 View Post
Hey helpful people, you all might have seen my post about this in a thread under Rom Hacking. But anyway, I've never used ASM coding in my PKMN hacking career thus far. I'm making a game in which I only want double battles and have encountered a glitch in which if you start a double battle with 1 (not-fainted) Pokémon is your party, the game just clones that pokemon for your partner in battle... (not desired) I've come to the realization that the only way to keep this game double battles only Is to either fix this glitch by changing the battle engine (sounds too hard) or to find another solution.

Well, the solution I came up with was to possibly have an ASM call before each trainer that would change the bitfield's double battle bit of the trainer in question to 1 or 0 based on how many Pokémon the player has. Now again, I've never used ASM so I don't know if you have access to that certain part of the rom, but if you did this would be a great way of fixing my problem.

So any help would be awesome, thanks!
https://github.com/jiangzhengwenjz/Double_wild_battle
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
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 8:46 AM.