The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Emulation & ROM Hacking > Research & Development
Register New Account FAQ/Rules Chat Blogs Mark Forums Read

Notices

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
New threads in this forum are to be approved by a moderator before they are displayed. The thread revival limit does not apply here.



Reply
Thread Tools
  #1  
Unread June 3rd, 2012, 12:03 PM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
Here are some hacks that I have made for people. I hope you enjoy them. I have attempted to explain how they work as well, for those who want to learn.

Remove the "Previously on your quest..." scene from game load.
Spoiler:
Hack:
Code:
Change bytes at 110F44 to 00 20
Change bytes at 110F50 to C0 46
Explained:
Spoiler:
Original:
Code:
08110F32 loc_08110F32:                           @ CODE XREF: sub_08110F14+3Cj
08110F32                 MOVS    R0, R2
08110F34                 MULS    R0, R7
08110F36                 ADDS    R0, R5, R0
08110F38                 ADDS    R0, R0, R6
08110F3A                 LDRB    R0, [R0]
08110F3C                 LDR     R3, =unk_0203ADF9
08110F3E                 CMP     R0, #0
08110F40                 BEQ     loc_08110F48
08110F42                 LDRB    R0, [R1]
08110F44                 ADDS    R0, #1
08110F46                 STRB    R0, [R1]
08110F48
08110F48 loc_08110F48:                           @ CODE XREF: sub_08110F14+2Cj
08110F48                 ADDS    R0, R2, #1
08110F4A                 LSLS    R0, R0, #0x18
08110F4C                 LSRS    R2, R0, #0x18
08110F4E                 CMP     R2, #3
08110F50                 BLS     loc_08110F32
Basically, this code counts the amount of important events that have occured. Once it reaches 3 (CMP R2, #3), it stops counting and continues the game as normal. What we want to do is make it so it always returns zero. We do this by setting R0 to 0 instead of incrementing as normal, and then removing the loop with the NOP (which literally does nothing) command.

New:
Code:
08110F32 loc_08110F32:                           @ CODE XREF: sub_08110F14+3Cj
08110F32                 MOVS    R0, R2
08110F34                 MULS    R0, R7
08110F36                 ADDS    R0, R5, R0
08110F38                 ADDS    R0, R0, R6
08110F3A                 LDRB    R0, [R0]
08110F3C                 LDR     R3, =unk_0203ADF9
08110F3E                 CMP     R0, #0
08110F40                 BEQ     loc_08110F48
08110F42                 LDRB    R0, [R1]
08110F44                 MOV     R0, #0
08110F46                 STRB    R0, [R1]
08110F48
08110F48 loc_08110F48:                           @ CODE XREF: sub_08110F14+2Cj
08110F48                 ADDS    R0, R2, #1
08110F4A                 LSLS    R0, R0, #0x18
08110F4C                 LSRS    R2, R0, #0x18
08110F4E                 CMP     R2, #3
08110F50                 NOP
Run a script from an items "Use" command or from registering it from select...
Spoiler:
First of all, follow DavidJCobb's Item Creation Tutorial, until the part where it attempts to add scripts, to actually create a new item. But change the "Type" combobox to #2 in the Item Manager. JPANs engine is not required!

Next step is to put this (assmelbed) code somewhere:
Code:
10 B5 04 1C 78 46 13 30 0C 49 08 60 20 1C 0C 49 00 F0 10 F8 10 BC 01 BC 00 47 10 B5 04 1C 0A 48 05 49 00 F0 07 F8 20 1C 06 49 00 F0 03 F8 10 BC 01 BC 00 47 08 47 C0 46 E5 9A 06 08 98 99 03 02 3D 10 0A 08 09 75 07 08 XX XX XX 08
Where XXXXXX is the location of your script reversed. 800300 would be 00 03 80, for example.

By entering this hex somewhere in the ROM and putting it's offset+1 in the "Field Usage" box in the Item Manager, you can call any script by using the item from the bag or by select. Say I put the routine at 800000 in the ROM, the Field Usage box would be 08800001.
Here's the unassembled code:
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global Hax
	
setup:
	push {r4, lr}
	mov r4, r0
	mov r0, pc
	add r0, #0x13
	ldr r1, .unk_02039998
	str r0, [r1]
	mov r0, r4
	ldr r1, .sub_080A103C
	bl bx_r1
	pop {r4}
	pop {r0}
	bx r0

main:
	push {r4, lr}
	mov r4, r0
	ldr r0, .ScriptToCall
	ldr r1, .CallScript
	bl bx_r1
	mov r0, r4
	ldr r1, .del_c3_from_linked_list
	bl bx_r1
	pop {r4}
	pop {r0}
	bx r0

.align 2
bx_r1:
	bx r1

.align 2
.CallScript:
	.word 0x08069AE4+1
.unk_02039998:
	.word 0x02039998
.sub_080A103C:
	.word 0x080A103C+1
.del_c3_from_linked_list:
	.word 0x08077508+1
.ScriptToCall:
	.word 0x08800300
More to come as I can be bothered.

EDIT: Also feel free to ask about/request stuff here. I may not do all requests, but I'll try my best.
__________________
あなた は しきしゃ です
わたし は ばか です

Last edited by Darthatron; June 12th, 2012 at 05:18 AM. Reason: New hax.
Reply With Quote
  #2  
Unread June 3rd, 2012, 05:02 PM
Team Fail's Avatar
Team Fail
Walk the walk // Talk the talk
 
Join Date: May 2009
Age: 18
Gender: Male
Nature: Brave
So, if I read this correctly, you can also make it record more than 3 important events as well depending on those 2 values?
__________________
Reply With Quote
  #3  
Unread June 4th, 2012, 12:24 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 21
Gender: Male
Nature: Modest
Quote:
Originally Posted by Team Fail View Post
So, if I read this correctly, you can also make it record more than 3 important events as well depending on those 2 values?
Not sure. Even so, not with just this code. There's more code somewhere that reads it somewhere else. But I imagine increasing it without repointing something would be bad.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #4  
Unread June 14th, 2012, 06:34 PM
Link_971's Avatar
Link_971
French Rom-Hacker
 
Join Date: Jul 2006
Location: France
Age: 20
Gender: Male
Nature: Relaxed
Send a message via Windows Live Messenger to Link_971
Quote:
Originally Posted by Darthatron View Post
Spoiler:
Code:
Change bytes at 110F44 to 00 20
Change bytes at 110F50 to C0 46
EDIT: Also feel free to ask about/request stuff here. I may not do all requests, but I'll try my best.


I have found a little bug, if you save in a Pokemon Center.
When you restart, the game doesn't show the name of the Map.
__________________

Reply With Quote
  #5  
Unread June 14th, 2012, 06:38 PM
Fireworks's Avatar
Fireworks
Please call me Crimson
 
Join Date: Feb 2011
Location: Scotland
Age: 17
Gender: Male
Nature: Quiet
Just wondering if you'd know anything about the hidebox command? In Ruby. when you use it in conjunction with showpokepic, it hides the box, showing only the sprite. This is useful for things like mugshots.
In FireRed though...it doesn't work :\
__________________

Because it should've won HotY.
Pear
Frodo Baggins
Twitter
Youtube
CBC
Reply With Quote
  #6  
Unread July 10th, 2012, 09:46 AM
jhay21's Avatar
jhay21
Beginning Trainer
 
Join Date: Jan 2010
Location: Philippines
Gender: Male
Nature: Timid
Quote:
Originally Posted by Darthatron View Post
EDIT: Also feel free to ask about/request stuff here. I may not do all requests, but I'll try my best.
how about a pokemon type reader/checker i haven't seen one so maybe nobody's done it yet? you set a query to a variable like 01=fire 02=grass etc.
then it checks whether the type of the pokemon selected by special 0x9F has the same type returns 1 if yes, 0 for no
Reply With Quote
  #7  
Unread September 28th, 2012, 10:07 AM
ChaosBringer41
Unhatched Egg
 
Join Date: Nov 2010
Gender: Male
I don't know if I'm asking in the right section (I got a headache trying to read the rules/FAQ). Anyway:

1) Can you - or anyone else - tell me how to upgrade the Pokedex in Pokemon Ruby, so that any non-Hoenn Pokemon are properly registered in the Pokedex pre-Elite Four?

2) On one of my 'this is how I'd like Pokemon Ruby to be like' hacks, I used a patch to put an old man in the intro instead of Professor Birch. The patch's name was Mr Fuji. According to my scribbled notes, I got it from PokeCommunity, but nothing on who made it. Any ideas? (I tried searching, but couldn't find it)
__________________
I don't always know what I'm doing. Life is more interesting that way.
Reply With Quote
  #8  
Unread September 28th, 2012, 03:22 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
Gender: Male
Nature: Quiet
Quote:
Originally Posted by ChaosBringer41 View Post
I don't know if I'm asking in the right section (I got a headache trying to read the rules/FAQ). Anyway:
This belongs in the general ROM hacking discussion thread, as opposed to here.

Quote:
Originally Posted by ChaosBringer41 View Post
1) Can you - or anyone else - tell me how to upgrade the Pokedex in Pokemon Ruby, so that any non-Hoenn Pokemon are properly registered in the Pokedex pre-Elite Four?
They are correctly registered, you just can't see them because they're not part of the Hoenn Dex. The easiest thing to do is to extend Ruby's Hoenn dex to include all the other Pokémon. I don't know precisely how to do that off the top of my head.

Quote:
Originally Posted by ChaosBringer41 View Post
2) On one of my 'this is how I'd like Pokemon Ruby to be like' hacks, I used a patch to put an old man in the intro instead of Professor Birch. The patch's name was Mr Fuji. According to my scribbled notes, I got it from PokeCommunity, but nothing on who made it. Any ideas? (I tried searching, but couldn't find it)
I highly doubt anyone will be able to help you.

And, so this post is actually on subject, these 2 hacks will probably have been of great use to many people. I hope you have more cool stuff up your sleeve, Darthatron!
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #9  
Unread September 29th, 2012, 04:19 PM
.parado✗'s Avatar
.parado✗
paranormal user
 
Join Date: Sep 2012
Location: Ha✗land
Age: 17
Gender: Male
Nature: Gentle
Send a message via Skype™ to .parado✗
Thank you!
The Item Stuff could be very useful for my Ruby hack.
I ever wonder how long you must research for those things..
Reply With Quote
  #10  
Unread February 12th, 2013, 09:25 PM
karatekid552's Avatar
karatekid552
Scyther
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552
Quote:
Originally Posted by .parado✗ View Post
Thank you!
The Item Stuff could be very useful for my Ruby hack.
I ever wonder how long you must research for those things..
With the help of Darthatron, I have successfully ported over the item script runner to Ruby. Everything is the same, except the offsets:

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

	setup:
		push {r4, lr}
		mov r4, r0
		mov r0, pc
		add r0, #0x13
		ldr r1, .unk_03005D00
		str r0, [r1]
		mov r0, r4
		ldr r1, .sub_080C9050
		bl bx_r1
		pop {r4}
		pop {r0}
		bx r0

	main:
		push {r4, lr}
		mov r4, r0
		ldr r0, .ScriptToCall
		ldr r1, .CallScript
		bl bx_r1
		mov r0, r4
		ldr r1, .del_c3_from_linked_list
		bl bx_r1
		pop {r4}
		pop {r0}
		bx r0
.align 2
bx_r1:
	bx r1

.align 2
.CallScript:
	.word 0x080655B8+1
.unk_03005D00:
	.word 0x03005D00
.sub_080C9050:
	.word 0x080C9050+1
.del_c3_from_linked_list:
	.word 0x0807AB74+1
.ScriptToCall:
	.word 0x08XXXXXX
Here is the compiled version:

Code:
10 B5 04 1C 78 46 13 30 0C 49 08 60 20 1C 0C 49 00 F0 10 F8 10 BC 01 BC 00 47 10 B5 04 1C 0A 48 05 49 00 F0 07 F8 20 1C 06 49 00 F0 03 F8 10 BC 01 BC 00 47 08 47 C0 46 B9 55 06 08 00 5D 00 03 51 90 0C 08 75 AB 07 08 XX XX XX 08
Hope this helps all of the Ruby hackers out there!
__________________
If you didn't do it like a BOSS, you didn't do it RIGHT!
Just some of the more BOSS Pokemon....
People and Hacks I support:

Hacks I own:
Reply With Quote
Reply
Quick Reply

Sponsored Links


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC. The time now is 10:44 AM.


Style by Perdition Haze, artwork by Sa-Dui.
Like our Facebook Page Follow us on TwitterMessage Board Statistics | © 2002 - 2013 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2013 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User posts belong to the user.