Fixed wrong tilesets being used for blocks

This commit is contained in:
Luke Hubmayer-Werner 2018-03-28 06:56:07 +10:30
parent 5d701a02fc
commit 2e2e8e5fe1
2 changed files with 11 additions and 3 deletions

View File

@ -256,7 +256,7 @@ class FF5Reader(QMainWindow):
field_blocks = [] field_blocks = []
zone_pxs = [] zone_pxs = []
for z in zones: for z in zones:
blocks = make_field_map_blocks_px(ROM_jp, z.blockset, field_tiles, field_minitiles, field_blocksets) blocks = make_field_map_blocks_px2(ROM_jp, z, field_tiles, field_minitiles, field_blocksets)
field_blocks.append(stitch_tileset_px(blocks)) field_blocks.append(stitch_tileset_px(blocks))
zone_pxs += make_zone_pxs(blocks, [blockmaps[b] for b in z.blockmaps if b!=-1]) zone_pxs += make_zone_pxs(blocks, [blockmaps[b] for b in z.blockmaps if b!=-1])
perfcount() perfcount()
@ -311,9 +311,9 @@ class FF5Reader(QMainWindow):
backgrounds_tab.addTab(make_px_table(world_blocks_pixmaps[1], cols=16, scale=4), 'World 2 Blocks') backgrounds_tab.addTab(make_px_table(world_blocks_pixmaps[1], cols=16, scale=4), 'World 2 Blocks')
backgrounds_tab.addTab(make_px_table(world_blocks_pixmaps[2], cols=16, scale=4), 'Underwater Blocks') backgrounds_tab.addTab(make_px_table(world_blocks_pixmaps[2], cols=16, scale=4), 'Underwater Blocks')
backgrounds_tab.addTab(make_px_table(worldpixmaps, cols=1, scale=1, large=True), 'Worldmaps') backgrounds_tab.addTab(make_px_table(worldpixmaps, cols=1, scale=1, large=True), 'Worldmaps')
backgrounds_tab.addTab(make_px_table(fieldmap_tiles, cols=8, scale=1), 'Fieldmap Tiles') backgrounds_tab.addTab(make_px_table(fieldmap_tiles, cols=16, scale=1), 'Fieldmap Tiles')
backgrounds_tab.addTab(make_px_table(field_blocks, cols=16, scale=1), 'Field Blocks') backgrounds_tab.addTab(make_px_table(field_blocks, cols=16, scale=1), 'Field Blocks')
backgrounds_tab.addTab(make_px_table(zone_pxs, cols=4, scale=1, large=1), 'Zone') backgrounds_tab.addTab(make_px_table(zone_pxs, cols=3, scale=1, large=1), 'Zone')
backgrounds_tab.addTab(make_px_table(battle_bgs, cols=8, scale=1), 'Battle BGs') backgrounds_tab.addTab(make_px_table(battle_bgs, cols=8, scale=1), 'Battle BGs')
self.ff4widget.addTab(make_px_table(self.battle_strips_ff4, cols=16, scale=2), 'Character Battle Sprites') self.ff4widget.addTab(make_px_table(self.battle_strips_ff4, cols=16, scale=2), 'Character Battle Sprites')

View File

@ -263,6 +263,14 @@ def make_field_map_blocks_px(rom, id, tilesets, minitilesets, blockmaps):
blocks = [make_tilemap_canvas(tm, tiles, cols=2, rows=2, pal_adjust=0, tile_modulo=0x1000) for tm in blockmap] blocks = [make_tilemap_canvas(tm, tiles, cols=2, rows=2, pal_adjust=0, tile_modulo=0x1000) for tm in blockmap]
return [b.pixmap(palettes) for b in blocks] return [b.pixmap(palettes) for b in blocks]
def make_field_map_blocks_px2(rom, _zone, tilesets, minitilesets, blocksets):
*i_tiles, i_minitiles = _zone.tilesets
tiles = tilesets[i_tiles[0]] + tilesets[i_tiles[1]] + tilesets[i_tiles[2]]
tiles += minitilesets[i_minitiles]
blockset = blocksets[_zone.blockset]
blocks = [make_tilemap_canvas(tm, tiles, cols=2, rows=2, pal_adjust=0, tile_modulo=0x1000) for tm in blockset]
return [b.pixmap(_zone.palette) for b in blocks]
def get_blockmaps(rom, start_address=0x0B0000, num=0x148): def get_blockmaps(rom, start_address=0x0B0000, num=0x148):
bank = 0x0B0000 bank = 0x0B0000
ptrs = [indirect(rom, start_address)+bank] ptrs = [indirect(rom, start_address)+bank]