The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle 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!
Research & Development programs in this forum are subject to moderator approval before they are displayed.


Advertise here

Reply
 
Thread Tools
  #1    
Old December 15th, 2009, 12:46 AM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat

Advertise here
Ruby Version
Spoiler:
@ RS Major Tileset Hack
@ By ZodiacDaGreat
@ ------------------------------------------------------------------

@ Hack 1 - Making the game use a enlarged tileset
@ ------------------------------------------------------------------
To enlarge the major tileset like in Fire Red, we must edit this routine.

08056d38 b500 push {lr}
08056d3a 4903 ldr r1, [$08056d48] (=$06004000)
08056d3c 6940 ldr r0, [r0, #0x14]
08056d3e f7ff bl $08056c98
08056d42 bc01 pop {r0}
08056d44 4700 bx r0
08056d46 0000 lsl r0, r0, #0x00

0x06004000 is the location where Tileset 2 data begins in the VRAM

for Ruby, on Fire Red it starts at 0x06005000. So, to change it -

just edit it to 0x06005000.

This pointer is at 0x56d48 in reversed format. So, to make Ruby use a

Fire Red sized major tileset just insert:
0050 0006 at 0x56d48

@ Hack 2 - Making the game use more tileset blocks
@ -------------------------------------------------------------------
~ Coming Soon~

@ Step 3 - Changing Advance Map's ini setting
@ -------------------------------------------------------------------
Finally we need Advance Map to display the correct tileset size, so

we need to hack it's ini. Find 'AdvanceMap.ini' in the ini folder and

find this:

[Version:AXV]
mainfile=ini/Main.ini
mapsfile=ini/Maps.ini
TilesetIni=ini/Tilesets.ini
Tilesethoehe=32 @ This value must be 40
Teil1Bloecke=$200
SpritePalettenAnz=27
AnzMapNamen=87
AnzTilesets=57
SuchByte=$FF
SuchBeginn=$6B0000
AnzItems=348


Emerald Version
Spoiler:
@ Emerald Major Tileset Hack
@ By ZodiacDaGreat
@ ------------------------------------------------------------------

@ Hack 1 - Making the game use a enlarged tileset
@ ------------------------------------------------------------------
To enlarge the major tileset like in Fire Red, we must edit this routine. It looks way too different from Ruby's uh? Well, this is because later games were

more protected. Below I've commented the parts to hack to make it load the major tileset like Fire Red.

08088d78 b500 push {lr}
08088d7a 6940 ldr r0, [r0, #0x14]
08088d7c 2280 mov r2, #0x80 @ mov r2, #0xA
08088d7e 0092 lsl r2, r2, #0x02 @ lsl r2, r2, #0x6
08088d80 1c11 add r1, r2, #0x0
08088d82 f7ff bl $08088c78
08088d86 bc01 pop {r0}
08088d88 4700 bx r0
08088d8a 0000 lsl r0, r0, #0x00

Why change it to what I've commented?
Because on Emerald the 0x06004000 (Where the major tileset is loaded in the VRAM) is calculated. How?

The above routine left shifts the r2 value by 2. So, 80 left shifted by 2 is 0x200; the value is again left shifted by 0x5 in another routine making it

0x4000. That 0x4000 is added to 0x06000000 (VRAM base address) in another routine just before it is taken as the value to load the tileset. So, to change

that we simply need to re-calculate the value added to the base address of the VRAM. That's all you have to change.

My changes were 0xA left shifted by 0x6, which gives 0x280 and 0x280 left shifted by 0x5 is 0x5000. So, to hack it insert 0A 22 92 01 at 0x88d7c.

@ Hack 2 - Making the game use more tileset blocks
@ -------------------------------------------------------------------
~ Coming Soon~

@ Step 3 - Changing Advance Map's ini setting
@ -------------------------------------------------------------------
Finally we need Advance Map to display the correct tileset size, so

we need to hack it's ini. Find 'AdvanceMap.ini' in the ini folder and

find this:

[Version:BPE]
mainfile=ini/Main.ini
mapsfile=ini/Maps.ini
TilesetIni=ini/EmTilesets.ini
Tilesethoehe=32 @ This value must be 40
Teil1Bloecke=$200
SpritePalettenAnz=27
AnzMapNamen=213
AnzTilesets=74
SuchByte=$00
SuchBeginn=$6B0000
AnzItems=376


Fire Red Version
Spoiler:
@ FRLG Major Tileset Hack
@ By ZodiacDaGreat
@ ------------------------------------------------------------------
This is exactly like Emerald's hack, but in different format. The

routine we're interested in is this:

08059a7c b500 push {lr}
08059a7e 6940 ldr r0, [r0, #0x14]
08059a80 21c0 mov r1, #0xc0
08059a82 0049 lsl r1, r1, #0x01
08059a84 22a0 mov r2, #0xa0 @ Value 1
08059a86 0092 lsl r2, r2, #0x02 @ Value 2
08059a88 f7ff bl $08059888
08059a8c bc01 pop {r0}
08059a8e 4700 bx r0

0xA0 left shifted by 0x2 = 0x280. 0x280 left shifted by 0x5 is

0x5000. 0x5000 is added to the base VRAM address to give you the

location from where tileset is to be loaded. I don't recommend

changing Fire Red's though Cause there's already enough space.


Unfixed Issues
- When you enter Mauville or some other city with loads of animations in Tileset 2 the map becomes screwed up. To fix this you need to edit your animations, Juan's tutorial mentions how to do that, you just need to change the VRAM address for the animation as well of Tileset 2.
Edit: Did more research and found out that cities which was screwed up was due to the large second tileset. So, once you apply this hack - your Tileset 2 cannot be large like Slateports' or Mauvilles' as in Fire Red no tileset 2 is that large.

The reason why, is because when it because large it overwrites the empty data used for the screen and the Town/City/Route label hence causing a weird display. If you don't understand what I'm saying just go study Fire Red in the Tile Viewer for char bases 0x06000000, 0x06004000, 0x06008000. You'll see that no tileset reaches 0x06008000 but when you apply this hack on Ruby and you check char base 0x06008000 - there's tileset data there.

- Tileset 2 tiles are all in a mess, this is because when we changed the location for where Tileset 2 begins in the VRAM to it's new place, the block data still used the original unchanged location. I'll fixed this soon.
Edit: That's wrong XD, everything is fine but you need to redo your tiles in Advance Map's Block Editor

Finally, the animation routines for your previous tileset 2 must be edited to reflect the changes in this hack

This is what I did just now, from what you can see it's from my private home made documentation of all the stuff I hack, I decided to release this to the public... Have fun as always give credit and don't claim this as your tutorial
__________________

Last edited by ZodiacDaGreat; December 30th, 2009 at 09:21 PM.
Reply With Quote
  #2    
Old December 15th, 2009, 04:24 PM
diegoisawesome's Avatar
diegoisawesome
Not the Script Help Thread
Community Supporter
 
Join Date: Dec 2007
Location: Goldenrod City, Johto
Age: 17
Gender: Male
Nature: Quirky
Do you think you could maybe adapt it for use in Fire Red? I'm hacking Fire Red, and this would be extremely useful.

[offtopic]1st post! W00T!
__________________


My other resources:
My Website
diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
diegoisawesome's Miscellaneous Finds
The Ruins of Alph Puzzles
Reply With Quote
  #3    
Old December 15th, 2009, 04:42 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Quote:
Originally Posted by diegoisawesome
Do you think you could maybe adapt it for use in Fire Red? I'm hacking Fire Red, and this would be extremely useful.

[offtopic]1st post! W00T!
Yeah, adapting it for Fire Red isn't hard, but why? Increasing more space on the major tileset in Fire Red will mean lesser space for the secondary tileset is it? Anyway, I'll post the Fire Red adaption later, you just need to change the VRAM offset as well
__________________
Reply With Quote
  #4    
Old December 15th, 2009, 04:44 PM
Sleepwalker's Avatar
Sleepwalker
Some Kind Of Monster
 
Join Date: May 2009
Location: In the forest of denial
Age: 20
Gender: Male
Nature: Adamant
Can you do the same thing to Emerald following those steps?

Last edited by Sleepwalker; December 15th, 2009 at 04:44 PM. Reason: reasoning
Reply With Quote
  #5    
Old December 15th, 2009, 05:28 PM
Liquid Shadow's Avatar
Liquid Shadow
xD
 
Join Date: Mar 2008
Gender:
....WOW... You don't understand how much this has helped me and how many restrictions it removed.

I'm simply amazed, once again.
__________________

4 truths of life
1. You cannot touch all your teeth with your tongue.
2. All idiots, after reading the first truth, will try it.
3. And discover that the first truth is a lie.
4. You're smiling now because you're an idiot.
Reply With Quote
  #6    
Old December 15th, 2009, 05:30 PM
~Teh Panda~'s Avatar
~Teh Panda~
Sea of Dreams - Redux
 
Join Date: Aug 2007
EDIT: Alright so now it all looks good in amap, but now when I load up the rom everything is screwed up
__________________




Mystic still in work to let you know...

Last edited by ~Teh Panda~; December 15th, 2009 at 06:26 PM.
Reply With Quote
  #7    
Old December 15th, 2009, 08:34 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Quote:
Originally Posted by ~Teh Panda~
EDIT: Alright so now it all looks good in amap, but now when I load up the rom everything is screwed up
Yeah XD I re-checked and found the same, so I edited the thread. Read the Unsolved Issues - you must've faced those eh?
__________________

Last edited by ZodiacDaGreat; December 15th, 2009 at 08:42 PM. Reason: Your double post has been automatically merged.
Reply With Quote
  #8    
Old December 15th, 2009, 08:54 PM
~Teh Panda~'s Avatar
~Teh Panda~
Sea of Dreams - Redux
 
Join Date: Aug 2007
Quote:
Originally Posted by ZodiacDaGreat View Post
Yeah XD I re-checked and found the same, so I edited the thread. Read the Unsolved Issues - you must've faced those eh?
Actually I did not xD, I witnessed the errors then had to go do homework, will talk to you more about it on MSN I presume.
__________________




Mystic still in work to let you know...
Reply With Quote
  #9    
Old December 16th, 2009, 04:58 AM
Pokepal17's Avatar
Pokepal17
More cowbell~
 
Join Date: Oct 2008
Location: Steeltown
Age: 19
Gender: Male
Nature: Modest
Wow, this is awesome. :D

However vould you add some screenies for the people who don't like reading need visual aid, please?

And it's a shame that when one tileset gets bigger, the other one must get shorter. Hope yuo find a fix for this
__________________
Pokémon Stardrop
Reply With Quote
  #10    
Old December 16th, 2009, 10:40 AM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Okay, I'll add it when I have sometime but the thing with ASM is with visual aids it becomes too long - me I keep them all in .txts in one folder Anyway, this hack is copying Fire Red's tileset system so tileset 2 isn't geting shorter. It's just some maps in R/S which previously had big tilesets must be reduced or you'll enter a glitchy map - I'm sure you liked Fire Red's tileset system
__________________
Reply With Quote
  #11    
Old December 16th, 2009, 12:42 PM
Pokepal17's Avatar
Pokepal17
More cowbell~
 
Join Date: Oct 2008
Location: Steeltown
Age: 19
Gender: Male
Nature: Modest
Quote:
Originally Posted by ZodiacDaGreat View Post
Okay, I'll add it when I have sometime but the thing with ASM is with visual aids it becomes too long - me I keep them all in .txts in one folder Anyway, this hack is copying Fire Red's tileset system so tileset 2 isn't geting shorter. It's just some maps in R/S which previously had big tilesets must be reduced or you'll enter a glitchy map - I'm sure you liked Fire Red's tileset system

Yes I did, very much.

However, I find it useful for R/S/E but I don't see why a lot of people would want to do the inverse with Fire Red since if you're careful and don't insert multiple tiles, there should be no problem.
__________________
Pokémon Stardrop
Reply With Quote
  #12    
Old December 30th, 2009, 08:46 PM
interdpth
I've seen things, man.
 
Join Date: Jul 2004
Thanks for all the help, Zodiac
__________________
yes, this is doge.

potato is not here.

bye
Reply With Quote
  #13    
Old December 30th, 2009, 08:51 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Yeah, the thing's updated with how to do it on Emerald, I'll research the Fire Red way now.

Edit: Added the Fire Red version one But not with the patching bytes, to patch or hack the routine you need an assembler.
__________________

Last edited by ZodiacDaGreat; December 30th, 2009 at 09:31 PM.
Reply With Quote
  #14    
Old April 25th, 2010, 04:32 AM
altariaking's Avatar
altariaking
Needs NO VMs...
 
Join Date: Dec 2009
Location: Scotland, Lesmahagow
Age: 39
Gender: Male
Nature: Naive
Send a message via Windows Live Messenger to altariaking
ok, i did everything you said for emeeald.
when i open it in advance map, it's fine.
when i open it in vba, not fine.
a lot of tiles like grass are all glitchy.
__________________
http://www.pokecommunity.com/member.php?u=253113
Reply With Quote
  #15    
Old May 6th, 2010, 04:10 PM
diegoisawesome's Avatar
diegoisawesome
Not the Script Help Thread
Community Supporter
 
Join Date: Dec 2007
Location: Goldenrod City, Johto
Age: 17
Gender: Male
Nature: Quirky
What we need now is that Step 2.
EDIT: Applying the patch for Emerald, strangely enough, didn't work.
EDIT2: Not only did it not work as expected, here's exactly what it did:
1. At first, when walking out a door, it loaded Tileset 2 into 0x06004000. I thought, this is strange...
2. Then, when walking to another map, the entire screen crapped up. Looking at the tile viewer, I saw that it had ended up loading Tileset 2 into 0x06005000, but keeping the version in 0x06004000 as well, and loading everything that the 0x06004000 version had overwritten, but after the 0x06005000 version!
My guess is that you found only one of the routines.
EDIT3: I was right! There are three more routines that you need to patch: 0x88DB6, 0x88D68, and 0x88D54, although only the first and fourth bytes, otherwise the other calculations would go awry. But you already know that, I'm talking to the people who look through this thread for a fix.
The end result is still screwed up when walking from one map to the next, but it's working for the most part.
__________________


My other resources:
My Website
diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
diegoisawesome's Miscellaneous Finds
The Ruins of Alph Puzzles

Last edited by diegoisawesome; May 8th, 2010 at 03:51 PM.
Reply With Quote
  #16    
Old May 9th, 2010, 09:14 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Quote:
Originally Posted by diegoisawesome
What we need now is that Step 2.
EDIT: Applying the patch for Emerald, strangely enough, didn't work.
EDIT2: Not only did it not work as expected, here's exactly what it did:
1. At first, when walking out a door, it loaded Tileset 2 into 0x06004000. I thought, this is strange...
2. Then, when walking to another map, the entire screen crapped up. Looking at the tile viewer, I saw that it had ended up loading Tileset 2 into 0x06005000, but keeping the version in 0x06004000 as well, and loading everything that the 0x06004000 version had overwritten, but after the 0x06005000 version!
My guess is that you found only one of the routines.
EDIT3: I was right! There are three more routines that you need to patch: 0x88DB6, 0x88D68, and 0x88D54, although only the first and fourth bytes, otherwise the other calculations would go awry. But you already know that, I'm talking to the people who look through this thread for a fix.
The end result is still screwed up when walking from one map to the next, but it's working for the most part.
Okay, part of your discovery is right, the screen gets messed up when your tileset 2 is bigger than it is on Fire Red. Cause on Fire Red tileset 2 is small, while R/S/E tileset 2's are bigger.

Edit: Yeah, I remember now why I didn't proceed further to edit the other 3 parts. Because, as you said coming out indoors the tileset 2 gets loaded into 0x06004000. Well, this didn't matter since the map refreshes when you goto another map (outdoors). And there wasn't any bugs, AFAIK. Anyway, if you're interested in patching the full thing feel free
__________________
Reply With Quote
  #17    
Old May 10th, 2010, 01:45 PM
diegoisawesome's Avatar
diegoisawesome
Not the Script Help Thread
Community Supporter
 
Join Date: Dec 2007
Location: Goldenrod City, Johto
Age: 17
Gender: Male
Nature: Quirky
Can I get your MSN? It would be much faster if we could talk on there.
__________________


My other resources:
My Website
diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
diegoisawesome's Miscellaneous Finds
The Ruins of Alph Puzzles
Reply With Quote
  #18    
Old July 26th, 2010, 08:08 AM
diegoisawesome's Avatar
diegoisawesome
Not the Script Help Thread
Community Supporter
 
Join Date: Dec 2007
Location: Goldenrod City, Johto
Age: 17
Gender: Male
Nature: Quirky
Sorry for double posting, but I finally fixed the routine for Emerald! (almost perfect)
0x88DB6, 0x88D68, and 0x88D54 need to be overwritten with 0A XX XX 01, where XX stands for bytes that you DO NOT change.

Then, paste 00 B5 40 69 C0 21 49 00 A0 22 92 00 FF F7 78 FF 01 BC 00 47 in 0x88D78, and test it out. Ta-da!

I found the solution when I copied over some bytes from FR, and kept messing with them until everything was coming out correctly. This included fixing the bl $08088c78 which was shifted over two bytes (and therefore I wrote my own bl).
__________________


My other resources:
My Website
diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
diegoisawesome's Miscellaneous Finds
The Ruins of Alph Puzzles
Reply With Quote
  #19    
Old January 2nd, 2011, 03:09 AM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Here is another function that needs to be edited when changing the tileset sizes on Firered: 08059080
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)
Reply With Quote
  #20    
Old May 24th, 2011, 02:22 PM
Quickster's Avatar
Quickster
Dream or Drop?
 
Join Date: Oct 2007
Gender: Male
Nature: Quiet
Im pretty sure that theres no thread revival limit in this sub section, but if there is, I apologize mods. I want to do the routine for emeralds tileset, and possibly fire red, but I do not know the first place to start. I tried to learn basic ASM from the multiple tutorials here, but I still cant understand this. Can someone tell me where to begin and the basics of doing this?
__________________
I laugh looking at this.

But sometimes I want to come back to it...

Reply With Quote
  #21    
Old September 18th, 2012, 04:03 PM
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
Quote:
Originally Posted by diegoisawesome View Post
Sorry for double posting, but I finally fixed the routine for Emerald! (almost perfect)
0x88DB6, 0x88D68, and 0x88D54 need to be overwritten with 0A XX XX 01, where XX stands for bytes that you DO NOT change.

Then, paste 00 B5 40 69 C0 21 49 00 A0 22 92 00 FF F7 78 FF 01 BC 00 47 in 0x88D78, and test it out. Ta-da!

I found the solution when I copied over some bytes from FR, and kept messing with them until everything was coming out correctly. This included fixing the bl $08088c78 which was shifted over two bytes (and therefore I wrote my own bl).
Thank goodness there isn't a thread revival limit here!

I did what diegoisawesome said to do here, but my tileset 0 in Emerald still only holds 1FF blocks instead of Firered's 27F. Please tell me I grossly misunderstood what I was doing and that I'm missing a simple step somewhere. AdvanceMap's .ini has already been edited to what the original post suggested.
Reply With Quote
  #22    
Old September 18th, 2012, 04:31 PM
diegoisawesome's Avatar
diegoisawesome
Not the Script Help Thread
Community Supporter
 
Join Date: Dec 2007
Location: Goldenrod City, Johto
Age: 17
Gender: Male
Nature: Quirky
Quote:
Originally Posted by Deokishisu View Post
Thank goodness there isn't a thread revival limit here!

I did what diegoisawesome said to do here, but my tileset 0 in Emerald still only holds 1FF blocks instead of Firered's 27F. Please tell me I grossly misunderstood what I was doing and that I'm missing a simple step somewhere. AdvanceMap's .ini has already been edited to what the original post suggested.
By blocks, do you mean blocks made out of tiles? If so, this isn't what you need. This hack changes the amount of TILES, not the number of BLOCKS.
__________________


My other resources:
My Website
diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
diegoisawesome's Miscellaneous Finds
The Ruins of Alph Puzzles
Reply With Quote
  #23    
Old September 18th, 2012, 05:11 PM
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
Quote:
Originally Posted by diegoisawesome View Post
By blocks, do you mean blocks made out of tiles? If so, this isn't what you need. This hack changes the amount of TILES, not the number of BLOCKS.
OH! Okay, so this is really only half of what it takes to make Emerald's tilesets work exactly as Firered's does.

I suppose I'll start searching around for how to change the block amount as well. (Can you tell I haven't done any hacking in a while?)
Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 03:12 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 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 generated content remains the property of its creator.