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
  #1426   Link to this post, but load the entire thread.  
Old February 13th, 2019 (9:09 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
Quote:
Originally Posted by Skeli- View Post
Expanding the Bag Entirely [FR]
]
This has been updated with fixes for the Old Man battle, Teachy TV, and expanded berries.
__________________
Pokemon Unbound

Reply With Quote
  #1427   Link to this post, but load the entire thread.  
Old February 17th, 2019 (4:38 AM). Edited February 18th, 2019 by Golddron.
Golddron Golddron is offline
 
Join Date: Feb 2019
Posts: 1
I've been working on a FR hack for a few months recreating Pokémon Colosseum/Gale of Darkness. About 95% done with the trainer editing (The shadow pokemon concept wasn't really working out as I was having trouble catching a specific pokemon from a trainer's party, so I've just been using the givepokemon command after the battle and using the flags from various overworld item sprites).

I'd really like to add a function where an opponents party level matches the highest in your party, like in the Mt Battle area in those games. Is there a way to set that up in a specific area of the game? Like to pull a certain trainer hex ID into the trainerbattle command and temporarily adjust the levels from their original setting to the highest in your party? Or would entirely new trainers have to be made? I'm leaning toward that because I've tried to find the trainers in the Trainer Tower in FR but they don't seem to be available to edit in trainer editing programs.

I've been scouring threads looking for info on this, but haven't had much luck. If anyone is able to help, wants to take a crack at it, or point me in the right direction I'd greatly appreciate it.

EDIT

I've come across how to get the highest level in my party, but I'm unsure how to have the game temporarily overwrite the trainer's pokemon level with a script, so I was thinking an ASM routine might be the way to go.
Reply With Quote
  #1428   Link to this post, but load the entire thread.  
Old February 17th, 2019 (2:17 PM).
eMMe97 eMMe97 is offline
 
Join Date: Jan 2015
Posts: 51
Quote:
Originally Posted by ghoulslash View Post
[FR] Selection from PC Box

This hack allows the player to directly select a pokemon from the pc boxes by modifying the tasks associated with the withdraw function. It doesn't actually do anything with the selection except store relevant data, but this data can then be used in subsequent functions to modify relevant data.

Fortunately, I added in some new/updated specials to allow the user to swap pokemon between box and party for things like trading, nicknaming, and checking/setting pokeball types. Adding new specials for other data manipulation is easy enough, and I would be happy to add more if more ideas come to me.

Current Special Fixes Include:
Spoiler:

special 0x7 - get EVs of party/boxed pokemon
special 0x8 - get IVs of party/boxed pokemon
special 0xB - get pokeball ID of party/boxed pokemon
special 0xD - get happiness of party/boxed pokemon
special 0x13 - set happiness of party/boxed pokemon
special 0x14 - ste pokeball ID of party/boxed pokemon
special 0x1A - save/restore party pokemon data to/from free ram (default is 6th opponent slot)
special 0x1B - save/restore pokemon data to/from pc
special 0x7b - check nicknamed pokemon from party/box
special 0x7c - buffer party/boxed pokemon nickname
special 0x7d - check traded pokemon from party/box
special 0x9e - nickname pokemon from party/box


Here is the repository. The readme should do an adequate job of detailing the usage.

Here is a GIF of using this function with a wonder trade. (credit to sagiri for the dtan system)
GREAT!!!!
Can u make a example script please? I don't understand how to make it (I just read the README text in the repository). Thank you :)
Reply With Quote
  #1429   Link to this post, but load the entire thread.  
Old February 18th, 2019 (1:59 AM). Edited February 18th, 2019 by rubenturen.
rubenturen's Avatar
rubenturen rubenturen is offline
Also Known as: Canned Brain
 
Join Date: Dec 2018
Location: —Denmark
Gender: Male
Nature: Jolly
Posts: 52
im using emerald
Hello I wanted to know if there
Is a way to make a asm routine that I can call in a script Wich shows a trainer battle sprite anywhere on screen
Like a modified showpokepic or something

(P.s. i’m Not good at making asm myself so pls design the routine for me)
__________________
I’m working on a ROM hack called pokemon penny.
It is a hack of emerald.





Sry, im not very good at typing the english Language.
This is the best Pokemon. FIGHT ME!!!
Reply With Quote
  #1430   Link to this post, but load the entire thread.  
Old February 18th, 2019 (11:19 AM).
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
Quote:
Originally Posted by eMMe97 View Post
GREAT!!!!
Can u make a example script please? I don't understand how to make it (I just read the README text in the repository). Thank you :)
There is an example nicknaming script at the bottom of the readme file.

The usage is essentially:
Code:
writebytetooffset 0x1 <state tracker ram>
special 0x3c
waitstate
writebytetooffset 0x0 <state_tracker ram>
This will let you select a pokemon from the box, and store the relevant location information to var8000 and var8001. Then, using the updated specials you can manipulate that pokemon's data.
Reply With Quote
  #1431   Link to this post, but load the entire thread.  
Old February 18th, 2019 (2:35 PM).
eMMe97 eMMe97 is offline
 
Join Date: Jan 2015
Posts: 51
Ok. But how can insert 2 Pokémon in the box? For example bulbasaur e squirtle?
Reply With Quote
  #1432   Link to this post, but load the entire thread.  
Old February 18th, 2019 (8:29 PM).
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
Quote:
Originally Posted by eMMe97 View Post
Ok. But how can insert 2 Pokémon in the box? For example bulbasaur e squirtle?
The routine doesn't let you deposit pokemon to the box, just select them. The hack itself does nothing except save useful information.
Reply With Quote
  #1433   Link to this post, but load the entire thread.  
Old February 19th, 2019 (9:20 AM).
uchiwaobito uchiwaobito is offline
 
Join Date: Jan 2019
Posts: 1
Quote:
Originally Posted by GoGoJJTech View Post
For Emerald (Changes in Red):
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r7}
	ldr r0, =(0x20244EC) @Party Pokémon
	mov r6, #0x0
	ldr r7, =(0x20244E9) @Party Quantity
	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, =(0x806A518 +1) @Pokemon Get Attribute
	bl linker
	mov r4, r0
	cmp r4, #0x0
	beq next
	mov r0, r5
	mov r1, #0x3A
	ldr r3, =(0x806A518 +1) @Pokemon Get Attribute
	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, =(0x20375F0) @Var 0x800D (Lastresult)
	strh r4, [r2]
	ldr r3, =(0x806ACAC) @Pokemon Set Attribute
	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, =(0x809C8F4 +1)
	bx r1

brancher:
	ldr r0, =(0x809C92E +1) @This may actually fail the routine, needs testing
	bx r0
	
linker:
	bx r3
	
.align 2

Insert at 0x9C8EA.
Nice idea, however it didn't work for Pokemon Emerald BPEE, it automatically reset when the char moves.
Reply With Quote
  #1434   Link to this post, but load the entire thread.  
Old March 4th, 2019 (11:38 PM).
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 opakedragon View Post
Quote:
Originally Posted by Lunos View Post
Quote:
Originally Posted by ghoulslash View Post
Here you go! (admittedly I have not tested it)

Code:
.text
.align 2
.thumb
.thumb_func
.global GetHappiness

Main:
	push {r0-r2, lr}
	ldr r0, .var8004
	ldrb r0, [r0]	@slot num
	mov r1, #0x64
	mul r0, r1
	ldr r1, .PartyData
	add r0, r1, r0
	mov r1, #0x20	@happiness
	bl GetAttribute
	ldr r1, .var8004
	strb r0, [r1, #0x2]	@store into var8005
	pop {r0-r2, pc}
	
GetAttribute:
	ldr r2, =(0x0803FBE8 +1)
	bx r2
	
.align 2
.PartyData:	.word 0x02024284
.var8004:	.word 0x020370C0
Welp, it didn't work.
I compiled the routine and dropped it in the offset 71A250, wrote this script and once I checked it In-Game, this was the result.

Note: Just for the record, the savefile is right after defeating my Rival for the very first time, so there's no way for my Pokémon to have 76 points.

Dunno if you'll be able to fix it, but in any case thank you very much.
Would you be willing to reshare the script (the link is no longer working) in code tags? I am relatively new and trying to figure this stuff out.
Surprisingly, I just stumbled upon a thread that I made in the Spanish community "Whack a Hack!" where I reposted Ghoulslash's routine (giving all the credits to him, naturally.)
I also posted a script to get the routine working there, but instead of carelessly pasting it in Hastebin like I did here, I've put it in Pastebin.

Soo... yeah, here it is.
https://pastebin.com/2tv2QX18
__________________
Reply With Quote
  #1435   Link to this post, but load the entire thread.  
Old March 10th, 2019 (2:06 PM). Edited September 8th, 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
So because I have a life, I spent way too long yesterday writing a routine to change the measurements for the height and weight in the PokeDex to be in metric (for those who eschew the imperial system).

EDIT: I neglected to have this change the units for SEEN entries as well as CAUGHT entries. I fixed that now.



Height (Feet to Metres - (Uncaught Pokemon)):
Spoiler:
/* Assemble this at 0x1059D0 */
.text
.align 2
.thumb
.thumb_func

Main:
add r0, r13, #0xC
mov r1, #0xAC /* ? */
strb r1, [r0]
add r0, r0, #0x1
mov r1, #0xAC /* ? */
strb r1, [r0]
add r0, r0, #0x1
mov r1, #0x0 /* */
strb r1, [r0]
add r0, r0, #0x1
mov r1, #0xE1 /* m */
strb r1, [r0]
add r0, r0, #0x1
mov r1, #0xFF /* FF */
strb r1, [r0]
mov r0, r0
ldr r0, .Return
bx r0

.align 2
.Return: .word 0x081059FF


Height (Feet to Metres):
Spoiler:
/*00 48 00 47 XX XX XX 08 at 0x105924*/
.text
.align 2
.thumb
.thumb_func

/*r4 has the height number*/



Main:
mov r1, #0xB

Clear:
mov r2, r13
add r2, r2, r1
mov r0, #0x0
strb r0, [r2]
cmp r1, #0x10
beq Next
add r1, r1, #0x1
b Clear

Next:
mov r0, r4
cmp r4, #0xA
blt OneDigit
cmp r4, #0x64
blt TwoDigit

ThreeDigit:
mov r1, #0x64
bl Divide
mov r6, r0
mov r2, r13
add r2, r2, #0xC
mov r0, r6
add r0, r0, #0xA1
strb r0, [r2]
mul r1, r6
sub r0, r4, r1
mov r4, r0

TwoDigit:
mov r1, #0xA
bl Divide
mov r5, r0
mov r2, r13
add r2, r2, #0xD
mov r0, r5
add r0, r0, #0xA1
strb r0, [r2]
mul r1, r5
sub r0, r4, r1
mov r4, r0

OneDigit:
mov r2, r13
add r2, r2, #0xF
mov r0, r4
add r0, r0, #0xA1
strb r0, [r2]

PutTextIn:
mov r2, r13
add r2, r2, #0xE
mov r0, #0xAD
strb r0, [r2]
add r2, r2, #0x2
mov r0, #0x00
strb r0, [r2]
add r2, r2, #0x1
mov r0, #0xE1
strb r0, [r2]
add r2, r2, #0x1
mov r0, #0xFF
strb r0, [r2]
ldr r1, .Return
bx r1

Divide:
ldr r2, .Divide
bx r2

.align 2
.Return: .word 0x081059FF
.Divide: .word 0x081E4019


Weight (Pounds to Kilograms):
Spoiler:
/* 00 48 00 47 XX XX XX 08 at 0x105A94 */
/* Put AC 00 DF DB at 0x415FA0 */
.text
.align 2
.thumb
.thumb_func

/* r4 has the weight number */

Main:
mov r1, #0xB

Clear:
mov r2, r13
add r2, r2, r1
mov r0, #0x0
strb r0, [r2]
cmp r1, #0x10
beq Next
add r1, r1, #0x1
b Clear

Next:
mov r0, r4
cmp r4, #0xA
blt OneDigit
cmp r4, #0x64
blt TwoDigit
ldr r1, .Thousand
cmp r4, r1
blt ThreeDigit

FourDigit:
ldr r1, .Thousand
bl Divide
mov r6, r0
mov r2, r13
add r2, r2, #0xB
mov r0, r6
add r0, r0, #0xA1
strb r0, [r2]
ldr r1, .Thousand
mul r1, r6
sub r0, r4, r1
mov r4, r0

ThreeDigit:
mov r1, #0x64
bl Divide
mov r6, r0
mov r2, r13
add r2, r2, #0xC
mov r0, r6
add r0, r0, #0xA1
strb r0, [r2]
mov r1, #0x64
mul r1, r6
sub r0, r4, r1
mov r4, r0

TwoDigit:
mov r1, #0xA
bl Divide
mov r5, r0
mov r2, r13
add r2, r2, #0xD
mov r0, r5
add r0, r0, #0xA1
strb r0, [r2]
mov r1, #0xA
mul r1, r5
sub r0, r4, r1
mov r4, r0

OneDigit:
mov r2, r13
add r2, r2, #0xF
mov r0, r4
add r0, r0, #0xA1
strb r0, [r2]

PutTextIn:
mov r2, r13
add r2, r2, #0xE
mov r0, #0xAD
strb r0, [r2]
add r2, r2, #0x2
mov r0, #0x00
strb r0, [r2]
add r2, r2, #0x1
mov r0, #0xDF
strb r0, [r2]
add r2, r2, #0x1
mov r0, #0xDB
strb r0, [r2]
add r2, r2, #0x1
mov r0, #0x00
strb r0, [r2]
add r2, r2, #0x1
mov r0, #0xFF
strb r0, [r2]
ldr r1, .Return
bx r1

Divide:
ldr r2, .Divide
bx r2

.align 2
.Return: .word 0x08105BE7
.Divide: .word 0x081E4019
.Thousand: .word 0x000003E8
__________________
"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
  #1436   Link to this post, but load the entire thread.  
Old March 28th, 2019 (10:22 PM).
Cam's Avatar
Cam Cam is offline
dum camel
 
Join Date: Nov 2015
Gender: Male
Posts: 39
>Ruby/Saphhire
>nothing to see here
Real disappointing considering I'm stuck with a ruby base for certain reasons.
Reply With Quote
  #1437   Link to this post, but load the entire thread.  
Old March 29th, 2019 (5:03 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 CloverDevteam View Post
>Ruby/Saphhire
>nothing to see here
Real disappointing considering I'm stuck with a ruby base for certain reasons.
You can port some Routines if the functions are similar.
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
  #1438   Link to this post, but load the entire thread.  
Old April 2nd, 2019 (8:28 AM).
AtecainCorp.'s Avatar
AtecainCorp. AtecainCorp. is offline
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 30
Gender: Male
Nature: Hardy
Posts: 1,354
Quote:
Originally Posted by Sagiri View Post
Unhidden Power [FR]

This routine makes the game calculate and display the actual type of Hidden Power in battle and in status screens. If, for example, a Pok�mon's Hidden Power type is Water, it will display as a Water-type move, just like Surf or any other Water-type move.



Note that this only calculates and displays the type, not the base power.
I try remade it for Ruby
__________________
- My new Project comming Soon
Reply With Quote
  #1439   Link to this post, but load the entire thread.  
Old April 6th, 2019 (2:48 PM). Edited April 6th, 2019 by PokemonXO.
PokemonXO PokemonXO is offline
 
Join Date: Oct 2014
Gender: Male
Posts: 44
Hello, I am looking to add battle items X Sp Def and X Evasion to the game (And perhaps, if it's workable, X HP)

I do not own IDA Pro, so it's going to be a real challenge trying to locate the correct offsets for the Battle Items. I don't know how it's done, but I guess I can request a tutorial here.

I will give credit when requested!

This is the location of the battle effect:

0FE4B9
__________________
If your interested in tutoring me on how to use the scripting and answering all my questions, send me a PM and we can discuss contacting each other in further details.

A little info about me and my goals:

I am burned out on Pokemon games, which, since emerald, have gradually grown worse to me. I am a fan of Generation 3 and earlier. I have some creature ideas I'd rather keep to myself and friends, due to personal reasons. Thus, I want to make my first game encompassing them. I do not know how to program, so I'll learn by using pokemon essentials. Once I complete the game, I'll enjoy it, and work on an entirely new project.
Reply With Quote
  #1440   Link to this post, but load the entire thread.  
Old April 11th, 2019 (8:24 AM).
ShinypikachuX's Avatar
ShinypikachuX ShinypikachuX is offline
 
Join Date: Sep 2017
Posts: 44
I have a great idea for fire red I was thinking of in game player name change like to set the player name to a predefined name.
For example if the player name is David by setflag or setvar it could be changed to Mike I.e.,name decided by the hacker.
Sorry if this is too complicated and thanks in advance.
Reply With Quote
  #1441   Link to this post, but load the entire thread.  
Old April 12th, 2019 (6:26 AM). Edited April 12th, 2019 by ghoulslash.
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
Quote:
Originally Posted by ShinypikachuX View Post
I have a great idea for fire red I was thinking of in game player name change like to set the player name to a predefined name.
For example if the player name is David by setflag or setvar it could be changed to Mike I.e.,name decided by the hacker.
Sorry if this is too complicated and thanks in advance.
The player's name can be changed from the overworld via callasm 0x809FC91

I have a pretty old routine I wrote to change the OT name of your pokemon to the new name based on matching OTIDs, so traded pokemon will retain their OT names. Note that I wrote it a while ago so there may be bugs

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func
.global ChangePokeNames
/*
Function to change all pokemon OT names to the players new name (unless IDs dont match aka traded pokemon)

Inputs: 
	-none
Outputs: 
	-none

Usage:
	callasm 0x809FC91  //rename player
	waitstate
	callasm [this_routine]+1
*/

Start:
	push {r0-r7, lr}

ChangePartyNames:
	ldr r7, .PartyPoke
	mov r6, #0x64
	mov r5, #0x5	
	bl NameChanges

ChangeBoxNames:
	ldr r7, .BoxDMA
	ldr r7, [r7]
	add r7, #0x4
	mov r6, #0x50
	mov r5, #0x69
	lsl r5, r5, #0x2		@420 box pokemon total
	bl NameChanges
	
Exit:
	pop {r0-r7, pc}
	
	
/*
Name Change Call Function
	r5 = num pokes to check
	r6 = data size per poke
	r7 = start address
*/	
NameChanges:
	push {lr}
	mov r4, #0x0	
	
OuterLoop:
	mov r0, r4
	mul r0, r6
	
GetPokeDataLoc:
	add r0, r0, r7	
	ldrh r1, [r0, #0x4]	
	
GetPlayerID:
	ldr r2, .Saveblock
	ldr r3, [r2]
	ldrh r2, [r3, #0xA]	
	
CompareIDs:
	cmp r1, r2
	bne OuterLoopRestart		@OTIDs do not match -> no name change
	
PrepInnerLoop:
	add r0, #0x14
	mov r2, #0x0	
	
charLoop:
	ldrb r1, [r3]
	strb r1, [r0]
	cmp r2, #0x6		@7 bytes for OT name
	beq OuterLoopRestart
	add r3, #0x1
	add r0, #0x1
	add r2, #0x1
	b charLoop

OuterLoopRestart:
	cmp r4, r5
	beq Return
	add r4, #0x1
	b OuterLoop

Return:
	pop {r0}
	bx r0

	
.align 2
.PartyPoke:	.word 0x02024284
.Saveblock:	.word 0x0300500C
.BoxDMA:	.word 0x03005010
__________________

Pokeemerald Works
Reply With Quote
  #1442   Link to this post, but load the entire thread.  
Old April 17th, 2019 (9:28 AM).
mattymannnn's Avatar
mattymannnn mattymannnn is offline
 
Join Date: May 2018
Gender: Male
Posts: 55
Does anyone know of a routine that blocks the user from releasing certain species of pokemon?
__________________
Reply With Quote
  #1443   Link to this post, but load the entire thread.  
Old April 17th, 2019 (2:41 PM).
Super Versekr Dark Super Versekr Dark is offline
 
Join Date: Jan 2017
Gender: Male
Posts: 79
Quote:
Originally Posted by Chacha Dinosaur View Post
EV-enhancing items (Power Items)


Spoiler:


The routine now does not require any new Held Effect Item Byte. The new power items are tied to Macho Brace's Held Item Effect Byte. (Thanks to MrDollSteak for giving the idea.)
The type of EV gain is now differentiated by the Second Held Effect Byte (the byte just after the Primary Held Effect Byte in the Item Table).
There is no need to code the Speed Drop explicitly for Power Items.

Usage is now like this by using the following parameters in the Item Table:
Primary Byte | Secondary Byte | Item Name
0x18 | 0x0 | Macho Brace
0x18 | 0x1 | Power Weight
0x18 | 0x2 | Power Bracer
0x18 | 0x3 | Power Belt
0x18 | 0x4 | Power Anklet
0x18 | 0x5 | Power Lens
0x18 | 0x6 | Power Band

Also, there are additional byte changes mentioned in the Spoiler to limit the EVs for each stat from 255 to 252 to avoid wastage of EVs by normal battling.

Fire Red:-
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

Main:
    push {r2}
    mov r0, r8  /*Load pokemon slot no*/
    mov r1, #0xC
    mov r2, #0x0
    bl Decrypter /* Load pokemon's item */
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    pop {r2} /* Restore Pokerus Factor*/
    cmp r0, #0xAF
    beq EnigmaBerry
    add r3, r0, #0x0
    bl GetItemEffect /* Get Held Item's Effect Byte*/
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    cmp r0, #0x18
    bne NoPowerItem
    add r0, r3, #0x0
    bl GetSecondEffectByte
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    cmp r0, #0x0
    beq MachoBrace
    add r1, r6, #0x1 /*Load a Power Item's Secondary Effect Byte*/
    cmp r1, r0 /*Match items*/ 
    bne NoPowerItem /*No Power Item or No Match for that particular stat*/
    lsl r2, r2, #0x2
    add r4, r4, r2 /* Add 4 EVs or 8 (due to Pokerus) */
NoPowerItem:    
    ldr r3, =0x080439D9
    bx r3

EnigmaBerry:
    ldr r3, =0x0804398F
    bx r3

MachoBrace:
    ldr r3, =0x080439D5
    bx r3

Decrypter:
    ldr r3, =0x0803FBE9
    bx r3

GetItemEffect:
    ldr r1, =0x0809A925
    bx r1

GetSecondEffectByte:
    ldr r1, =0x0809A949
    bx r1

/*At 43978: 04 1C 54 43 00 49 08 47 XX+1 XX XX 08 00 00 00 00 00 00 00 00 00 00*/
/*At 439FC && 43A02: FC to limit EV growth for each stat to 252 */


Emerald:-
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

Main:
    push {r2}
    mov r0, r8  /*Load pokemon slot no*/
    mov r1, #0xC
    mov r2, #0x0
    bl Decrypter /* Load pokemon's item */
    lsl r0, r0, #0x10
    lsr r0, r0, #0x10
    pop {r2} /* Restore Pokerus Factor*/
    cmp r0, #0xAF
    beq EnigmaBerry
    add r3, r0, #0x0
    bl GetItemEffect /* Get Held Item's Effect Byte*/
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    cmp r0, #0x18
    bne NoPowerItem
    add r0, r3, #0x0
    bl GetSecondEffectByte
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    cmp r0, #0x0
    beq MachoBrace
    add r1, r6, #0x1 /*Load a Power Item's Secondary Effect Byte*/
    cmp r1, r0 /*Match items*/ 
    bne NoPowerItem /*No Power Item or No Match for that particular stat*/
    lsl r2, r2, #0x2
    add r4, r4, r2 /* Add 4 EVs or 8 (due to Pokerus) */
NoPowerItem:    
    ldr r3, =0x0806DC25
    bx r3

EnigmaBerry:
    ldr r3, =0x0806DBDB
    bx r3

MachoBrace:
    ldr r3, =0x0806DC21
    bx r3

Decrypter:
    ldr r3, =0x0806A519
    bx r3

GetItemEffect:
    ldr r1, =0x080D74DD
    bx r1

GetSecondEffectByte:
    ldr r1, =0x080D7501
    bx r1

/*At 6DBC4: 04 1C 54 43 00 49 08 47 XX+1 XX XX 08 00 00 00 00 00 00 00 00 00 00*/
/*At 6DC48 && 6DC4E: FC to limit EV growth for each stat to 252 */


For Ruby:

Spoiler:
.text
.align 2
.thumb
.thumb_func

Main:
push {r2}
mov r0, r8 /*Load pokemon slot no*/
mov r1, #0xC
mov r2, #0x0
bl Decrypter /* Load pokemon's item */
lsl r0, r0, #0x10
lsr r0, r0, #0x10
pop {r2} /* Restore Pokerus Factor*/
cmp r0, #0xAF
beq EnigmaBerry
add r3, r0, #0x0
bl GetItemEffect /* Get Held Item's Effect Byte*/
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, #0x18
bne NoPowerItem
add r0, r3, #0x0
bl GetSecondEffectByte
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, #0x0
beq MachoBrace
add r1, r6, #0x1 /*Load a Power Item's Secondary Effect Byte*/
cmp r1, r0 /*Match items*/
bne NoPowerItem /*No Power Item or No Match for that particular stat*/
lsl r2, r2, #0x2
add r4, r4, r2 /* Add 4 EVs or 8 (due to Pokerus) */
NoPowerItem:
ldr r3, =0x0803FFB9
bx r3

EnigmaBerry:
ldr r3, =0x0803FF6F
bx r3

MachoBrace:
ldr r3, =0x0803FFB5
bx r3

Decrypter:
ldr r3, =0x0803CB61
bx r3

GetItemEffect:
ldr r1, =0x080A993D
bx r1

GetSecondEffectByte:
ldr r1, =0x080A9961
bx r1

/*At 3FF58: 04 1C 54 43 00 49 08 47 XX+1 XX XX 08 00 00 00 00 00 00 00 00 00 00*/
/*At 3FFDC && 3FFE2: FC to limit EV growth for each stat to 252 */
Reply With Quote
  #1444   Link to this post, but load the entire thread.  
Old April 18th, 2019 (9:52 AM). Edited April 18th, 2019 by ShinypikachuX.
ShinypikachuX's Avatar
ShinypikachuX ShinypikachuX is offline
 
Join Date: Sep 2017
Posts: 44
Quote:
Originally Posted by ghoulslash View Post
The player's name can be changed from the overworld via callasm 0x809FC91

I have a pretty old routine I wrote to change the OT name of your pokemon to the new name based on matching OTIDs, so traded pokemon will retain their OT names. Note that I wrote it a while ago so there may be bugs

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func
.global ChangePokeNames
/*
Function to change all pokemon OT names to the players new name (unless IDs dont match aka traded pokemon)

Inputs: 
	-none
Outputs: 
	-none

Usage:
	callasm 0x809FC91  //rename player
	waitstate
	callasm [this_routine]+1
*/

Start:
	push {r0-r7, lr}

ChangePartyNames:
	ldr r7, .PartyPoke
	mov r6, #0x64
	mov r5, #0x5	
	bl NameChanges

ChangeBoxNames:
	ldr r7, .BoxDMA
	ldr r7, [r7]
	add r7, #0x4
	mov r6, #0x50
	mov r5, #0x69
	lsl r5, r5, #0x2		@420 box pokemon total
	bl NameChanges
	
Exit:
	pop {r0-r7, pc}
	
	
/*
Name Change Call Function
	r5 = num pokes to check
	r6 = data size per poke
	r7 = start address
*/	
NameChanges:
	push {lr}
	mov r4, #0x0	
	
OuterLoop:
	mov r0, r4
	mul r0, r6
	
GetPokeDataLoc:
	add r0, r0, r7	
	ldrh r1, [r0, #0x4]	
	
GetPlayerID:
	ldr r2, .Saveblock
	ldr r3, [r2]
	ldrh r2, [r3, #0xA]	
	
CompareIDs:
	cmp r1, r2
	bne OuterLoopRestart		@OTIDs do not match -> no name change
	
PrepInnerLoop:
	add r0, #0x14
	mov r2, #0x0	
	
charLoop:
	ldrb r1, [r3]
	strb r1, [r0]
	cmp r2, #0x6		@7 bytes for OT name
	beq OuterLoopRestart
	add r3, #0x1
	add r0, #0x1
	add r2, #0x1
	b charLoop

OuterLoopRestart:
	cmp r4, r5
	beq Return
	add r4, #0x1
	b OuterLoop

Return:
	pop {r0}
	bx r0

	
.align 2
.PartyPoke:	.word 0x02024284
.Saveblock:	.word 0x0300500C
.BoxDMA:	.word 0x03005010
No no I want to set player name to another one without any freedom to player, so I decide the name not the player.
But thanks anyways.
By the way can you help me I'm stuck with the random trainer id and secret id generator routine it won't compile for me please help.
Reply With Quote
  #1445   Link to this post, but load the entire thread.  
Old April 24th, 2019 (1:52 AM).
kevvic kevvic is offline
 
Join Date: Aug 2013
Gender: Male
Posts: 2
Quote:
Originally Posted by Lunos View Post
I
EDIT:

I was testing this routine out just now, and I'm not entirely sure if it's working correctly.
It looks to me like the Eggs are inheriting 3 stats alone, when they should always inherit 5 stats :/
I've been doing tests using this routine and XXXX.

In my last attempt for example, the results of the Egg were:
-03 HP IVs. Charmander has 30 and Ditto 26.
-03 Atk IVs inherited from Charmander.
-22 Def IVs inherited from Charmander or Ditto (both have 22 Def IVs.)
-23 Spd IVs. Charmander has 31 and Ditto 25.
-19 SpAtk IVs. Charmander has 31 and Ditto 10.
-31 SpDef IVs inherited from Ditto.

If we assume that HP is the random stat in this spread, Spd and SpAtk are the issue here.
The Egg should have inherited Charmander's or Ditto's values in those stats after all, right?
Has anyone tested this yet?
I did, I checked IV with the IV display summary screen routines. I edited the save so both parents have 31 IV in all stats, yet the child only have 3 stats with 31 IV.

Also for some reasons, sometimes if I give the destiny knot to the other parent or to both it crash when I talk to get the eggs. Did you figure it out?
Reply With Quote
  #1446   Link to this post, but load the entire thread.  
Old April 25th, 2019 (11:33 AM). Edited May 1st, 2019 by ghoulslash.
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
Quote:
Originally Posted by ShinypikachuX View Post
No no I want to set player name to another one without any freedom to player, so I decide the name not the player.
But thanks anyways.
By the way can you help me I'm stuck with the random trainer id and secret id generator routine it won't compile for me please help.
Actually, that's much easier. This will let you load a new player name into loadpointer 0x0 and then force the change. Make sure the player's name is 7 characters or less or else it will fail.
Spoiler:

Code:
.text
.align 2
.thumb
.global NewPlayerName
/*
usage:
	loadpointer 0x0 @name
	callasm [this_routine+1]
*/

Main:
	push {r0-r4, lr}
	ldr r0, .loadPointer
        ldr r0, [r0]     @string pointer
	mov r4, r0
	bl StringLength
	cmp r0, #0x7
	bgt Exit
	ldr r0, .TrainerDMA
	ldr r0, [r0]	@dest
	mov r1, r4		@src
	bl StringCopy
Exit:
	pop {r0-r4, pc}
	
StringLength:
	ldr r1, =(0x8008E08|1)
	bx r1
	
StringCopy:
	ldr r2, =(0x8008D84|1)
	bx r2

.align 2
.loadPointer: .word 0x03000f14
.TrainerDMA: .word 0x0300500c


eg. if I insert the above at 0x990000, then in XSE I could do the following to force the player's name to be Fred.
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
loadpointer 0x0 @name
callasm 0x8990001
msgbox @newName 0x6
release
end
#org @name
= Fred
#org @newName
= Your new name is [player]!
Quote:
By the way can you help me I'm stuck with the random trainer id and secret id generator routine it won't compile for me please help.
I'm not sure what routine you're talking about, sorry :/
__________________

Pokeemerald Works
Reply With Quote
  #1447   Link to this post, but load the entire thread.  
Old April 26th, 2019 (10:57 AM).
ShinypikachuX's Avatar
ShinypikachuX ShinypikachuX is offline
 
Join Date: Sep 2017
Posts: 44
Quote:
Originally Posted by ghoulslash View Post
Actually, that's much easier. This will let you load a new player name into loadpointer 0x0 and then force the change. Make sure the player's name is 7 characters or less or else it will fail.
Spoiler:

Code:
.text
.align 2
.thumb
.global NewPlayerName
/*
usage:
	loadpointer 0x0 @name
	callasm [this_routine+1]
*/

Main:
	push {r0-r4, lr}
	ldr r0, .loadPointer
	mov r4, r0
	bl StringLength
	cmp r0, #0x7
	bgt Exit
	ldr r0, .TrainerDMA
	ldr r0, [r0]	@dest
	mov r1, r4		@src
	bl StringCopy
Exit:
	pop {r0-r4, pc}
	
StringLength:
	ldr r1, =(0x8008E08|1)
	bx r1
	
StringCopy:
	ldr r2, =(0x8008D84|1)
	bx r2

.align 2
.loadPointer: .word 0x03000f14
.TrainerDMA: .word 0x0300500c


eg. if I insert the above at 0x990000, then in XSE I could do the following to force the player's name to be Fred.
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
loadpointer 0x0 @name
callasm 0x8990001
msgbox @newName 0x6
release
end
#org @name
= Fred
#org @newName
= Your new name is [player]!

I'm not sure what routine you're talking about, sorry :/
Thanks for this quick response and for the routine not tried it yet though.
The routine I was talking about is this http://www.pokecommunity.com/showpost.php?p=8536952&postcount=333
Reply With Quote
  #1448   Link to this post, but load the entire thread.  
Old April 26th, 2019 (12:30 PM).
TheWolfProd TheWolfProd is offline
 
Join Date: Nov 2017
Posts: 3
Quote:
Originally Posted by ghoulslash View Post
Actually, that's much easier. This will let you load a new player name into loadpointer 0x0 and then force the change. Make sure the player's name is 7 characters or less or else it will fail.
Spoiler:

Code:
.text
.align 2
.thumb
.global NewPlayerName
/*
usage:
	loadpointer 0x0 @name
	callasm [this_routine+1]
*/

Main:
	push {r0-r4, lr}
	ldr r0, .loadPointer
	mov r4, r0
	bl StringLength
	cmp r0, #0x7
	bgt Exit
	ldr r0, .TrainerDMA
	ldr r0, [r0]	@dest
	mov r1, r4		@src
	bl StringCopy
Exit:
	pop {r0-r4, pc}
	
StringLength:
	ldr r1, =(0x8008E08|1)
	bx r1
	
StringCopy:
	ldr r2, =(0x8008D84|1)
	bx r2

.align 2
.loadPointer: .word 0x03000f14
.TrainerDMA: .word 0x0300500c


eg. if I insert the above at 0x990000, then in XSE I could do the following to force the player's name to be Fred.
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
loadpointer 0x0 @name
callasm 0x8990001
msgbox @newName 0x6
release
end
#org @name
= Fred
#org @newName
= Your new name is [player]!

I'm not sure what routine you're talking about, sorry :/
I tried running this script with the same offsets in FireRed but when I go to speak to the NPC i assigned the script to the game freezes. Is there something I could've missed? I compiled the ASM, assigned the correct offsets in the hex editior. Thankyou:)
Reply With Quote
  #1449   Link to this post, but load the entire thread.  
Old April 28th, 2019 (5:10 AM).
ShinypikachuX's Avatar
ShinypikachuX ShinypikachuX is offline
 
Join Date: Sep 2017
Posts: 44
Someone help like all the asm routine I compile won't work for some god damn reason someone reply if you know how to fix this and if you post a compiler which works for you it would be more helpful.
Reply With Quote
  #1450   Link to this post, but load the entire thread.  
Old May 13th, 2019 (11:23 AM). Edited May 13th, 2019 by Diego98.
Diego98 Diego98 is offline
 
Join Date: Jan 2015
Gender: Male
Posts: 22
Quote:
Originally Posted by Koople View Post
Side Quest Menu [FR]

This hack converts the PC item storage menu into a side quest menu, or task list, etc.

Here is the repository, the compilation instructions are included in the readme. You will need to define your own parameters/ram in src/headers/defs.asm and create your own tables of string pointers for all of the quest names, descriptions, item images, and quest details. I kept the item image part to allow hackers to include items that might be symbolic of their quest, eg. a scroll or key or pokeball.

To use in a script (XSE)
Code:
writebytetooffset 0x1 <your questflag ram in src/headers/defs.asm>
fadescreen 0x1
callasm 0x80EBCD9
waitstate
Enjoy! And please let me know of any bugs.
I'm trying to build that but I'm getting an error code:
Code:
arm-none-eabi-as -mthumb -c src/quest_select_msg.asm -o build/src/quest_select_msg.o
make: arm-none-eabi-as: Command not found
make: *** [makefile:17: build/src/quest_select_msg.o] Error 127
I built lots of other things but never got this error. What should I do?

EDIT: Ok, forgot it. It was a typing mistake on my system path to the DevkitARM bin folder.
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.