The PokéCommunity Forums Tutorial Manipulating Map Banks

 Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.New threads in this forum are to be approved by a moderator before they are displayed.

#1
December 10th, 2012 (1:20 PM). Edited January 9th, 2014 by Spherical Ice.
 Spherical Ice Moderator Join Date: Nov 2007 Location: Leicester, UK Age: 18 Posts: 4,709

# Manipulating Map Banks

Backup your ROM before making changes!

### You need:

• HxD or another Hex Editor (this tutorial will reference HxD keystrokes and shortcuts)
• Windows Calculator: Programmer Mode (Programmer Mode can be accessed doing the keystroke Alt + 3)
• FSF (or the ability to find free space in a Hex Editor - it really isn't that hard)
• A FireRed BPRE ROM

### Repointing Map Banks

The offset that control map banks is located at 0x05524C.
In HxD, do the shortcut Ctrl+ G and enter 5524C.

At that offset, you can see the data:
Code:
`A8 26 35 08`
This is a pointer. To find out where this pointer...points to, we need to do the following:
Code:
```A8 26 35 08

Reverse order of bytes:
08 35 26 A8

Remove 08:
35 26 A8```
This points to 0x3526A8.
In HxD, do the shortcut Ctrl + G and enter 3526A8.

The data here lists pointers that point to each map bank.
In HxD, do the shortcut Ctrl + E. In the Length: field, select hex and enter AC.

Do the shortcut Ctrl + C to copy the selected block of data to your clipboard.

Open Notepad and do the shortcut Ctrl + V to paste the block of data.

Using FSF (or just manually in HxD), find an offset that has room for 0xAC (or dec 127). I'm going to use the offset 0x800000. Take note of the offset in Notepad, and turn it into a pointer (the opposite of what we did before):
Code:
```80 00 00

Reverse the bytes:
00 00 80

00 00 80 08```
In HxD, go back to the offset 0x05524C (Ctrl + G and enter 5524C).
Replace the data
Code:
`A8 26 35 08`
with your pointer to the new, repointed table of the map banks:
Code:
`00 00 80 08`

Now go to your new pointer, so in my case 0x800000, using Ctrl + G, and then go back into Notepad.
Select the data you pasted earlier (04 20 35 08 18 20 35 08...) and in HxD do the shortcut Ctrl + B to overwrite the FF free space.

Congratulations, you've now repointed your Map Bank table. When you load your ROM in Advance Map, you will get an error message, but it won't affect anything. I think editing the INI files will fix this error message but I can't find the data you need to change.

### Adding, removing and changing maps in Banks

Each pointer (XX XX XX 08) in this table points to another table which has pointers for each map.

The first pointer, which corresponds to the first map bank, Bank 0, 04 20 35 08, when rearranged, points to 0x352004. At 0x352004, the five pointers point to the five maps in Bank 0.

With this knowledge, we can add, remove, or change the maps in each bank by changing the offsets that each Bank points to. To make this easier, we should repoint each bank. For this tutorial, I'm just going to repoint Bank 0.

First, we're going to need to copy the data at 0x352004. Since there are five maps in Bank 0, there are also five pointers, and each pointer is four bytes long, we're going to need to select 0x14 (dec 20) bytes of data - that's five multiplied by four (if you don't know that 5 * 4 = 20 already, smh).

To select the data, do the shortcut Ctrl + E at 0x352004, and in the Length: field, enter 14, making sure that hex is selected. Copy and paste the selected data in Notepad.

Using FSF, or manually, find an offset with at least 20 bytes of space free (more if you want to add more maps to a bank). I'm going to use the offset 0x8000B0. Copy the data you just pasted into Notepad, and then do the shortcut Ctrl + B at your new offset to replace the FF free space with the data for the maps in Bank 0.

Convert the offset where the maps at Bank 0 are located by doing the process we did before:

Code:
```80 00 B0

Reverse the bytes:
B0 00 80

B0 00 80 08```
Go back to your new bank table, which is 0x800000 for me, and replace the pointer to the maps in Bank 0, or whatever bank you're editing, with your new pointer.

You've now repointed Bank 0, meaning you can now just add, remove, or change the pointers to whichever map you'd like.

It's pretty straightforward, but in case you're not sure, here's an example.
(The following could probably apply to Banks instead of Maps, but I'm not sure)

Say I want to remove the map 0.1 from Bank 0 (this won't remove it from the game, the data is still there, it's just inaccessible). That's this map:

Well, that map is the second map along, so it will be the second offset.
Code:
`A4 F1 34 08`
In order to remove this map, I need to shift the offsets after it over and replace this offset, like so:

Of course, by doing this, we're going to have a duplicate of the last map, but we can just overwrite that offset with free space (FF FF FF FF).

Similarly, you can add maps to Banks by adding their offset to the end of the table. For example, this time I'm going to add Pallet Town (3.0) to Bank 0. Pallet Town's offset is 18 06 35 08, so by adding that to the end of the table, the last map in Bank 0 will now be Pallet Town.

Note that Pallet Town will still be in Bank 3, so you'll have to remove it from there to save space.

I hope this tutorial will be helpful, it's a good way to keep things organised for we OCD folk (for example, if your starting town has more than four interior maps, you can expand Bank 4 and not overflow into Bank 5 and making things all confusing).

I haven't found any adverse side effects except for the error message upon loading, but that isn't too much of a problem. Sometimes, however, Advance Map won't let you collapse the From header folder, so to fix that, load a working ROM, open the folder, and then load your ROM. This isn't ideal, so if anyone has a solution for that, I'm all ears :3 (I'm almost 100% sure it involves editing the INI files)
__________________

#2
December 11th, 2012 (6:47 AM).
 Spherical Ice Moderator Join Date: Nov 2007 Location: Leicester, UK Age: 18 Posts: 4,709
Oh, it appears that Advance Map 1.9.2 doesn't give the error message and loads the ROM first time, so it's only 1.9.5 that will give you the glitch. The more you know~
__________________
#3
June 11th, 2013 (11:00 AM).
 A Sunny Moo Join Date: Jun 2013 Gender: Male Posts: 33
After they took the map removal out of Advance Map, it became very difficult for me to be able to use the default maps and resize them without ending up with pointers that led to nowhere. This tutorial is very helpful. Thank you very much.
#4
June 17th, 2013 (2:33 PM).
 Awkward. #britanna Join Date: May 2012 Age: 19 Gender: Male Nature: Sassy Posts: 845
Okay, so, hypothetically, if I wanted to, if I repointed both bank 0 and bank 3, I could replace the data in bank 0 with the data in bank 3?
__________________
at some point I must have liked that you look like a taco addict who's had one too many back alley liposuctions

#5
July 9th, 2013 (11:08 PM).
 reeveelution Join Date: Jul 2013 Gender: Male Posts: 2
ok, so how would one go about completely removeing all of the maps and banks from a rom, so i could start fresh and insert the maps into banks as i get them made?
__________________

#6
January 9th, 2014 (11:14 PM).
 Spherical Ice Moderator Join Date: Nov 2007 Location: Leicester, UK Age: 18 Posts: 4,709
Quote:
 Originally Posted by PJBottomz Okay, so, hypothetically, if I wanted to, if I repointed both bank 0 and bank 3, I could replace the data in bank 0 with the data in bank 3?
Yes, though it would involve a lot of shuffling data.
Quote:
 Originally Posted by reeveelution ok, so how would one go about completely removeing all of the maps and banks from a rom, so i could start fresh and insert the maps into banks as i get them made?
I believe there are many patches made that do so.

Anyway, I'm just posting to say that A-Map 1.9.5 doesn't glitch up if you keep the pointers to the map banks at 0x3526A8.
__________________

 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 [icon] codes HTML code is Off Forum Rules
 Forum Jump Dashboard Private Messages Subscriptions Who's Online Search Forums Forums Home Community Square     Main Street: Meet & Greet!     Celebrations!     City Hall: Feedback & Support     PokéCommunity Daily         Published Piece Archive     The Bulletin Board Main Series Pokémon Gaming     Pokémon Sun & Pokémon Moon     Omega Ruby & Alpha Sapphire     Pokémon X & Pokémon Y     Fifth Generation     Fourth Generation     Third Generation     Second Generation     First Generation Pokémon Gaming     Pokémon Gaming Central     Pokémon GO         Pokémon Field Journals     Pokkén Tournament     Challenges     Trade Corner         Trade Shops         Quick Trades         Trader Reviews     Battling & Team Building         The PokéCommunity League         Events & Groups Approval The Wide World of Pokémon     Pokémon General     Pokémon World Championships     Pokémon Anime         Episode Discussion     Pokémon Trivia     Pokémon Trading Card Game         TCG Deck Reviewing         Custom Cards ROM Hacking     ROM Hacking Hub         Beginner’s Lounge     Hacks Studio         Progressing Hacks         Sideshow Showcase     Research & Development     Tools, Tutorials & Resources Create & Discover     Art & Design         A&D School of the Arts     Creative Media     Roleplay Theatre         Roleplay Casting         Roleplay Stage     Fan Fiction and Writing         Writer's Lounge         Fanfiction Archive     Game Development         Games Showcase         Progressing Games         Resources         Scripts & Tutorials         Pokémon Essentials Entertainment & Hobbies     General Entertainment     Anime & Manga     Video Games     Tabletop Gaming Off-Topic Discussions     The Mall     The Treehouse     The Lab     The Round Table     The Playground     The Underground

All times are GMT -8. The time now is 2:08 PM.

 -- Forever Standing -- Route 167+ -- Chromatic ---- Chromatic 2.0 -- Style'd! -- Dawn of Champions -- Plusle's Play Date -- Poké Link 3 ---- Poké Link 3 Grape Juice Blend ---- Poké Link 3 Red Cocktail -- Midnight Misty Revived -- Green's Ivy 2008 ---- Red's Flame 2008 -- PokéLink 2.0 -- Ledian's Knockout! -- PokéLink -- Team Magma's Passion -- PokéSpecial Adventures -- Trick or Treat -- Ash's Big Test -- Quilava's Glaciation -- PokéRevolution ---- PokéRevolution 2.0 -- Autumn Always -- Winter Friends -- 10th Anniversary Pocket Monsters -- Azure Fantasy -- Blossom Shower -- Squareline -- Unseen Forces -- Darkness Prevails Once More -- Caramel Sentret -- PokeGeneric2 -- Let's Get This Party Startered -- Seeds of Platinum -- Bewitched -- Ampharos' Starry Night -- PCWii -- Poké Link 4 Pink ---- Poké Link 4 Blue -- Delibird's Delivery -- Pawlicious -- Infernal Smash ---- Infernal Smash (fixed width) -- Conway -- Final Resistance -- The Golden Girl -- Sinnoh Springs ---- Sinnoh Springs Reduced -- Pichu² -- The Plaza -- The Pokéthletes ---- Inverted -- Route 167 -- Sweet Kisses -- Generation² -- Begin, Again -- Dimensional Rift -- The Johto Elite -- slooooowpooooke -- Unova's Violet Masquerade -- Generation InVerse -- Flames of Simplicity -- PokeCommunity Black Version ---- PokeCommunity White Version -- The Stand Nexus -- The Top Dog -- Stunfisk'd -- Nimbasa's Shining Beauty -- Atop Mount Coronet -- Kanto Dream Party -- PokéBok -- Forest Savage -- Hypno's Lullaby -- Let's Fly Together [Legacy] -- Volcarona Pour Toujours -- The Y-Axis -- Color Flattered X ---- Color Flattered Y ---- Color Flattered ORAS ------ Color Flattered ORAS Standard -- Let's Fly Together -- Fundamental -- Garchompin' ---- Yggdrasil -- Inflicted One ---- Inflicted One+ -- Sky High -- vBulletin Default -- PC Pro - Blue Edition -- PC Pro - Green Edition -- PC Pro - Special Purple Edition Contact Us - Archive - Privacy Statement - Terms of Service - Top

Style by Nymphadora, artwork by Sa-Dui.
© 2002 - 2016 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 - 2016 The PokéCommunity / PokéCommunity.com.