shithub: zelda3

Download patch

ref: b584fd08c6c5f67cb759b62acff90cf2fb52b518
parent: 8c4e6c62b52becba39def847358eafd469d24374
author: Snesrev <snesrev@protonmail.com>
date: Wed Oct 12 13:04:41 EDT 2022

Display tile indexes and palette names differently in sprites

--- a/tables/sprite_sheet_info.py
+++ b/tables/sprite_sheet_info.py
@@ -1,6 +1,6 @@
 class Entry:
   def __init__(self, name, dungeon_or_ow, tileset_and_pal, ss_idx, matrix, pal_base):
-    self.name = name
+    self.name = name.replace(' - ', ': ')
     self.dungeon_or_ow = dungeon_or_ow
     self.tileset, self.palset_idx = tileset_and_pal
     self.ss_idx = ss_idx
--- a/tables/sprite_sheets.py
+++ b/tables/sprite_sheets.py
@@ -267,10 +267,12 @@
     if e.high_palette:
       pal_name = '%sR' % e.pal_base
     else:
-      pal_name = ' %s' % e.pal_base
+      pal_name = '%s' % e.pal_base
       if e.pal_base in (1, 2, 3):
         assert e.pal_subidx in (0, 1)
         pal_subidx = 'LW' if pal_subidx == 0 else 'DW'
+    if pal_subidx != None:
+      pal_name = '%s-%s' % (pal_name, pal_subidx)
 
     header = bytearray([255] * BIGW * 9)
     draw_string3x5(header, BIGW, 1, 3, e.name[:22], 254)
@@ -279,10 +281,12 @@
       xx = BIGW - 37 + i * 5 - 9
       fillrect(header, xx, xx + 4, 3, 7, i + (9 if e.high_palette else 1))
 
-    if pal_subidx != None:
-      draw_string3x5(header, BIGW, BIGW - 9, 3, '%2s' % pal_subidx, 252)
+    #if pal_subidx != None:
+    #  draw_string3x5(header, BIGW, BIGW - 9, 3, '%2s' % pal_subidx, 252)
 
-    draw_string3x5(header, BIGW, BIGW - 45 - 9, 3, pal_name, 252)
+    draw_string3x5(header, BIGW, BIGW - 9, 3, '%2s' % e.tileset, 252)
+
+    draw_string3x5(header, BIGW, BIGW - 45 - 1 - len(pal_name) * 4, 3, pal_name, 252)
     finaldst.extend(convert_to_24bpp(header, palette))
 
   bigdst = bytearray([255] * BIGW * 36)
@@ -307,6 +311,10 @@
       if master_tilesheets:
         master_tilesheets.insert(e.tileset, src, x, y, palette, 0)
 
+  # display vram addresses
+  draw_string3x5(bigdst, BIGW, BIGW - 9, 4, '%Xx' % (e.ss_idx * 0x4), 252)
+  draw_string3x5(bigdst, BIGW, BIGW - 9, 4 + 17, '%Xx' % (e.ss_idx * 0x4 + 2), 252)
+
   # collapse unused matrix sections
   if all(m=='.' for m in e.matrix[0]) and all(m=='.' for m in e.matrix[1]):
     del bigdst[1*BIGW:17*BIGW]
@@ -313,8 +321,8 @@
   elif all(m=='.' for m in e.matrix[2]) and all(m=='.' for m in e.matrix[3]):
     del bigdst[18*BIGW:34*BIGW]
 
-  draw_string3x5(bigdst, BIGW, BIGW - 9, 2, ' %d' % e.ss_idx, 252)
-  draw_string3x5(bigdst, BIGW, BIGW - 9, 2 + 9, '%.2d' % e.tileset, 252)
+  if e.skip_header:
+    draw_string3x5(bigdst, BIGW, BIGW - 9, len(bigdst)//BIGW - 8, '%.2d' % e.tileset, 252)
   
   finaldst.extend(convert_to_24bpp(bigdst, palette))