map_block_dumper - create these .blk files

TODO: spit out new INCBIN lines to take advantage of these files.

hg-commit-id: f06654f42d78
This commit is contained in:
Bryan Bishop 2012-01-03 22:26:35 -06:00
parent 67d3093008
commit 39f6ddfa92
218 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,46 @@
#!/usr/bin/python
#author: Bryan Bishop <kanzure@gmail.com>
#date: 2012-01-03
#purpose: extract .blk files from baserom.gbc
import extract_maps #rom, assert_rom, load_rom, calculate_pointer, load_map_pointers, read_all_map_headers, map_headers
from pretty_map_headers import map_name_cleaner
from analyze_incbins import offset_to_pointer
import sys
def extract_map_block_data(map_id, savefile=True):
map = extract_maps.map_headers[map_id]
if map["name"] == "FREEZE": return #skip this one
blocksdata_pointer = int(map["map_pointer"], 16)
y = int(map["y"], 16)
x = int(map["x"], 16)
size = x*y
#fetch the data from the rom
blocksdata = extract_maps.rom[blocksdata_pointer:blocksdata_pointer+size]
#clean up the filename and label (for pokered.asm)
cleaned_name = map_name_cleaner(map["name"], None)
label_text = cleaned_name.replace("_h", "Blocks")
filename = cleaned_name.replace("_h", "").lower()
if savefile:
print "Saving ../maps/" + filename + ".blk for map id=" + str(map_id)
fh = open("../maps/" + filename + ".blk", "w")
fh.write(blocksdata)
fh.close()
def get_all_map_blockdata():
for map in extract_maps.map_headers.keys():
extract_map_block_data(map)
if __name__ == "__main__":
#load map headers
extract_maps.load_rom()
extract_maps.load_map_pointers()
extract_maps.read_all_map_headers()
#extract_map_block_data(0)
get_all_map_blockdata()

BIN
maps/agatha.blk Normal file

Binary file not shown.

BIN
maps/battlecenterm.blk Normal file

Binary file not shown.

BIN
maps/bikeshop.blk Normal file

Binary file not shown.

BIN
maps/billshouse.blk Normal file

Binary file not shown.

BIN
maps/bruno.blk Normal file

Binary file not shown.

BIN
maps/celadoncity.blk Normal file

Binary file not shown.

BIN
maps/celadondiner.blk Normal file

Binary file not shown.

BIN
maps/celadongamecorner.blk Normal file

Binary file not shown.

BIN
maps/celadongym.blk Normal file

Binary file not shown.

BIN
maps/celadonhotel.blk Normal file

Binary file not shown.

BIN
maps/celadonhouse.blk Normal file

Binary file not shown.

BIN
maps/celadonhouse2.blk Normal file

Binary file not shown.

BIN
maps/celadonmansion1.blk Normal file

Binary file not shown.

BIN
maps/celadonmansion2.blk Normal file

Binary file not shown.

BIN
maps/celadonmansion3.blk Normal file

Binary file not shown.

BIN
maps/celadonmansion4.blk Normal file

Binary file not shown.

BIN
maps/celadonmansion5.blk Normal file

Binary file not shown.

BIN
maps/celadonmart1.blk Normal file

Binary file not shown.

BIN
maps/celadonmart2.blk Normal file

Binary file not shown.

BIN
maps/celadonmart3.blk Normal file

Binary file not shown.

BIN
maps/celadonmart4.blk Normal file

Binary file not shown.

BIN
maps/celadonmart5.blk Normal file

Binary file not shown.

BIN
maps/celadonmart6.blk Normal file

Binary file not shown.

BIN
maps/celadonpokecenter.blk Normal file

Binary file not shown.

BIN
maps/celadonprizeroom.blk Normal file

Binary file not shown.

BIN
maps/ceruleancity.blk Normal file

Binary file not shown.

BIN
maps/ceruleangym.blk Normal file

Binary file not shown.

BIN
maps/ceruleanhouse2.blk Normal file

Binary file not shown.

BIN
maps/ceruleanhouse3.blk Normal file

Binary file not shown.

Binary file not shown.

BIN
maps/ceruleanmart.blk Normal file

Binary file not shown.

BIN
maps/ceruleanpokecenter.blk Normal file

Binary file not shown.

BIN
maps/cinnabarisland.blk Normal file

Binary file not shown.

BIN
maps/cinnibargym.blk Normal file

Binary file not shown.

BIN
maps/cinnibarmart.blk Normal file

Binary file not shown.

BIN
maps/cinnibarpokecenter.blk Normal file

Binary file not shown.

BIN
maps/copycatshousef1.blk Normal file

Binary file not shown.

BIN
maps/copycatshousef2.blk Normal file

Binary file not shown.

BIN
maps/daycarem.blk Normal file

Binary file not shown.

BIN
maps/diglettscave.blk Normal file

Binary file not shown.

Binary file not shown.

BIN
maps/diglettscaveroute2.blk Normal file

Binary file not shown.

BIN
maps/fanclub.blk Normal file

Binary file not shown.

BIN
maps/fightingdojo.blk Normal file

Binary file not shown.

BIN
maps/fuchsiacity.blk Normal file

Binary file not shown.

BIN
maps/fuchsiagym.blk Normal file

Binary file not shown.

BIN
maps/fuchsiahouse1.blk Normal file

Binary file not shown.

BIN
maps/fuchsiahouse2.blk Normal file

Binary file not shown.

BIN
maps/fuchsiahouse3.blk Normal file

Binary file not shown.

BIN
maps/fuchsiamart.blk Normal file

Binary file not shown.

BIN
maps/fuchsiameetingroom.blk Normal file

Binary file not shown.

BIN
maps/fuchsiapokecenter.blk Normal file

Binary file not shown.

BIN
maps/gary.blk Normal file

Binary file not shown.

BIN
maps/halloffameroom.blk Normal file

Binary file not shown.

BIN
maps/indigoplateau.blk Normal file

Binary file not shown.

BIN
maps/indigoplateaulobby.blk Normal file

Binary file not shown.

BIN
maps/lab1.blk Normal file

Binary file not shown.

BIN
maps/lab2.blk Normal file

Binary file not shown.

BIN
maps/lab3.blk Normal file

Binary file not shown.

BIN
maps/lab4.blk Normal file

Binary file not shown.

BIN
maps/lance.blk Normal file

Binary file not shown.

BIN
maps/lavendartown.blk Normal file

Binary file not shown.

BIN
maps/lavenderhouse1.blk Normal file

Binary file not shown.

BIN
maps/lavenderhouse2.blk Normal file

Binary file not shown.

BIN
maps/lavendermart.blk Normal file

Binary file not shown.

BIN
maps/lavenderpokecenter.blk Normal file

Binary file not shown.

BIN
maps/loreli.blk Normal file

Binary file not shown.

BIN
maps/mansion1.blk Normal file

Binary file not shown.

BIN
maps/mansion2.blk Normal file

Binary file not shown.

BIN
maps/mansion3.blk Normal file

Binary file not shown.

BIN
maps/mansion4.blk Normal file

Binary file not shown.

BIN
maps/mtmoon1.blk Normal file

Binary file not shown.

BIN
maps/mtmoon2.blk Normal file

Binary file not shown.

BIN
maps/mtmoon3.blk Normal file

Binary file not shown.

BIN
maps/mtmoonpokecenter.blk Normal file

Binary file not shown.

BIN
maps/museumf1.blk Normal file

Binary file not shown.

BIN
maps/museumf2.blk Normal file

Binary file not shown.

BIN
maps/namerater.blk Normal file

Binary file not shown.

BIN
maps/oakslab.blk Normal file

Binary file not shown.

BIN
maps/pewtercity.blk Normal file

Binary file not shown.

BIN
maps/pewtergym.blk Normal file

Binary file not shown.

BIN
maps/pewterhouse1.blk Normal file

Binary file not shown.

BIN
maps/pewterhouse2.blk Normal file

Binary file not shown.

BIN
maps/pewtermart.blk Normal file

Binary file not shown.

BIN
maps/pewterpokecenter.blk Normal file

Binary file not shown.

BIN
maps/pokemontower1.blk Normal file

Binary file not shown.

BIN
maps/pokemontower2.blk Normal file

Binary file not shown.

BIN
maps/pokemontower3.blk Normal file

Binary file not shown.

BIN
maps/pokemontower4.blk Normal file

Binary file not shown.

BIN
maps/pokemontower5.blk Normal file

Binary file not shown.

BIN
maps/pokemontower6.blk Normal file

Binary file not shown.

BIN
maps/pokemontower7.blk Normal file

Binary file not shown.

BIN
maps/powerplant.blk Normal file

Binary file not shown.

BIN
maps/rockethideout1.blk Normal file

Binary file not shown.

BIN
maps/rockethideout2.blk Normal file

Binary file not shown.

BIN
maps/rockethideout3.blk Normal file

Binary file not shown.

BIN
maps/rockethideout4.blk Normal file

Binary file not shown.

Binary file not shown.

BIN
maps/rocktunnel1.blk Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more