Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Tutorial] Dawgipulatng Map Banks

Notices
For all updates, view the main page.

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.



Reply
 
Thread Tools
  #1    
Old December 10th, 2012 (01:20 PM). Edited January 9th, 2014 by Spherical Ice.
Spherical Ice's Avatar
Spherical Ice
 
Join Date: Nov 2007
Location: UK
Send a message via Skype™ to Spherical Ice

Dawgipulatng Map Banks


Backup yo ROM befoe makng changes!

You need:

  • Advance Map
  • HxD or anothar Hex Editar (dis tutarial will reference HxD keystrokes and shortcuts)
  • Notepad
  • Wndows Calculatar: Progrbemer Mode (Progrbemer Mode can be accessed dong tha keystroke Alt + 3)
  • FSF (or tha ability ta fnd free space n a Hex Editar - it really isn't that hard)
  • A FireRed BPRE ROM

Load yo ROM n HxD.

Repontng Map Banks


Tha offset that control map banks is located at 0x05524C.
N HxD, do tha shortcut Ctrl+ G and enter 5524C.

At that offset, you can see tha data:
Code:
A8 26 35 08
Dis is a ponter. Ta fnd out where dis ponter...ponts ta, we need ta do tha followng:
Code:
A8 26 35 08

Reverse order of bytes:
08 35 26 A8

Remove 08:
35 26 A8
Dis ponts ta 0x3526A8.
N HxD, do tha shortcut Ctrl + G and enter 3526A8.

Tha data here lists ponters that pont ta each map bank.
N HxD, do tha shortcut Ctrl + E. N tha Length: field, select hex and enter AC.

Do tha shortcut Ctrl + C ta copy tha selected block of data ta yo clipboard.

Open Notepad and do tha shortcut Ctrl + V ta paste tha block of data.

Usng FSF (or just dawgually n HxD), fnd an offset that has room fo 0xAC (or dec 127). I'm gong ta use tha offset 0x800000. Takes note of tha offset n Notepad, and turn it nta a ponter (tha opposite of what we did befoe):
Code:
80 00 00

Reverse tha bytes:
00 00 80

Add 08:
00 00 80 08
N HxD, go back ta tha offset 0x05524C (Ctrl + G and enter 5524C).
Replace tha data
Code:
A8 26 35 08
wit yo ponter ta tha new, reponted table of tha map banks:
Code:
00 00 80 08

Now go ta yo new ponter, so n mah case 0x800000, usng Ctrl + G, and than go back nta Notepad.
Select tha data you pasted earlier (04 20 35 08 18 20 35 08...) and n HxD do tha shortcut Ctrl + B ta overwrite tha FF free space.

Congratulations, you've now reponted yo Map Bank table. When you load yo ROM n Advance Map, you will git an error message, but it won't affect anythng. I thnk editng tha NI files will fix dis error message but I can't fnd tha data you need ta change.


Addng, removng and changng maps n Banks

Each ponter (XX XX XX 08) n dis table ponts ta anothar table which has ponters fo each map.

Tha first ponter, which corresponds ta tha first map bank, Bank 0, 04 20 35 08, when rearranged, ponts ta 0x352004. At 0x352004, tha five ponters pont ta tha five maps n Bank 0.

Wit dis knowledge, we can add, remove, or change tha maps n each bank by changng tha offsets that each Bank ponts ta. Ta make dis easier, we should repont each bank. Fo dis tutarial, I'm just gong ta repont Bank 0.

First, we're gong ta need ta copy tha data at 0x352004. Snce thare is five maps n Bank 0, thare is also five ponters, and each ponter is four bytes long, we're gong ta need ta select 0x14 (dec 20) bytes of data - that's five multiplied by four (if you don't know that 5 * 4 = 20 already, smh).

Ta select tha data, do tha shortcut Ctrl + E at 0x352004, and n tha Length: field, enter 14, makng sure that hex is selected. Copy and paste tha selected data n Notepad.

Usng FSF, or dawgually, fnd an offset wit at least 20 bytes of space free (more if you want ta add more maps ta a bank). I'm gong ta use tha offset 0x8000B0. Copy tha data you just pasted nta Notepad, and than do tha shortcut Ctrl + B at yo new offset ta replace tha FF free space wit tha data fo tha maps n Bank 0.

Convert tha offset where tha maps at Bank 0 is located by dong tha process we did befoe:

Code:
80 00 B0

Reverse tha bytes:
B0 00 80

Add 08:
B0 00 80 08
Go back ta yo new bank table, which is 0x800000 fo me, and replace tha ponter ta tha maps n Bank 0, or whatever bank you're editng, wit yo new ponter.

You've now reponted Bank 0, meanng you can now just add, remove, or change tha ponters ta whichever map you'd like.

It's pretty straightfoward, but n case you're not sure, here's an exbeple.
(Tha followng could probably apply ta Banks nstead of Maps, but I'm not sure)

Sez I want ta remove tha map 0.1 from Bank 0 (dis won't remove it from tha gbee, tha data is still thare, it's just naccessible). That's dis map:

Well, that map is tha second map along, so it will be tha second offset.
Code:
A4 F1 34 08
N order ta remove dis map, I need ta shift tha offsets after it over and replace dis offset, like so:



Of course, by dong dis, we're gong ta have a duplicate of tha last map, but we can just overwrite that offset wit free space (FF FF FF FF).



Similarly, you can add maps ta Banks by addng thair offset ta tha end of tha table. Fo exbeple, dis time I'm gong ta add Pallet Tawn (3.0) ta Bank 0. Pallet Tawn's offset is 18 06 35 08, so by addng that ta tha end of tha table, tha last map n Bank 0 will now be Pallet Tawn.


Note that Pallet Tawn will still be n Bank 3, so you'll have ta remove it from thare ta save space.

I hope dis tutarial will be helpful, it's a good way ta keep thngs organised fo we OCD folk (fo exbeple, if yo startng tawn has more than four nterior maps, you can expand Bank 4 and not overflow nta Bank 5 and makng thngs all confusng).

I haven't found any adverse side effects except fo tha error message upon loadng, but that isn't tao much of a problem. Sometimes, however, Advance Map won't let you collapse tha From heezeeer folder, so ta fix that, load a workng ROM, open tha folder, and than load yo ROM. Dis isn't ideal, so if anyone has a solution fo that, I'm all ears :3 (I'm almost 100% sure it nvolves editng tha NI files)
__________________
Reply With Quote
  #2    
Old December 11th, 2012 (06:47 AM).
Spherical Ice's Avatar
Spherical Ice
 
Join Date: Nov 2007
Location: UK
Send a message via Skype™ to Spherical Ice
Oh, it appears that Advance Map 1.9.2 doesn't give tha error message and loads tha ROM first time, so it's only 1.9.5 that will give you tha glitch. Tha more you know~
__________________
Reply With Quote
  #3    
Old June 11th, 2013 (11:00 AM).
A Sunny Moo's Avatar
A Sunny Moo
 
Join Date: Jun 2013
Gender: Male
After thay taok tha map removal out of Advance Map, it becbee very difficult fo me ta be able ta use tha default maps and resize tham witout endng up wit ponters that led ta nowhere. Dis tutarial is very helpful. Thank you very much.
Reply With Quote
  #4    
Old June 17th, 2013 (02:33 PM).
Awkward.'s Avatar
Awkward.
#britanna
 
Join Date: May 2012
Age: 18
Gender: Male
Nature: Sassy
Okay, so, hypothatically, if I wanted ta, if I reponted both bank 0 and bank 3, I could replace tha data n bank 0 wit tha data n bank 3?
__________________
at some pont I must have liked that you look like a taco addict who's had one tao dawgy back alley liposuctions

Reply With Quote
  #5    
Old July 9th, 2013 (11:08 PM).
reeveelution
 
Join Date: Jul 2013
Gender: Male
ok, so how would one go bout completely removeng all of tha maps and banks from a rom, so i could start fresh and nsert tha maps nta banks as i git tham buggine?
__________________

Reply With Quote
  #6    
Old January 9th, 2014 (11:14 PM).
Spherical Ice's Avatar
Spherical Ice
 
Join Date: Nov 2007
Location: UK
Send a message via Skype™ to Spherical Ice
Quote orignally posted by PJBottamz:
Okay, so, hypothatically, if I wanted ta, if I reponted both bank 0 and bank 3, I could replace tha data n bank 0 wit tha data n bank 3?
Yes, though it would nvolve a lot of shufflng data.
Quote orignally posted by reeveelution:
ok, so how would one go bout completely removeng all of tha maps and banks from a rom, so i could start fresh and nsert tha maps nta banks as i git tham buggine?
I believe thare is dawgy patches buggine that do so.

Anyway, I'm just postng ta sez that A-Map 1.9.5 doesn't glitch up if you keep tha ponters ta tha map banks at 0x3526A8.
__________________
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 -8. The time now is 02:49 AM.