ref: 87685c8b06551a1b7d173877cccd0b6eb7cc251b
parent: da4aac425f22887a697863fbf9175537c69fce0d
author: xander-haj <[email protected]>
date: Thu Oct 20 15:52:15 EDT 2022
override armor palette (#163)
--- a/tables/compile_resources.py
+++ b/tables/compile_resources.py
@@ -148,7 +148,7 @@
add_asset_uint16('kPalette_DungBgMain', ROM.get_words(0x9BD734, 1800))
add_asset_uint16('kPalette_MainSpr', ROM.get_words(0x9BD218, 120))
- add_asset_uint16('kPalette_ArmorAndGloves', ROM.get_words(0x9BD308, 75))
+ add_asset_uint16('kPalette_ArmorAndGloves', sprite_sheets.override_armor_palette or ROM.get_words(0x9BD308, 75))
add_asset_uint16('kPalette_Sword', ROM.get_words(0x9BD630, 12))
add_asset_uint16('kPalette_Shield', ROM.get_words(0x9BD648, 12))
--- a/tables/sprite_sheets.py
+++ b/tables/sprite_sheets.py
@@ -4,6 +4,13 @@
from util import get_bytes, get_words, get_byte, cache
import array
import tables
+override_armor_palette = None
+#override_armor_palette = [0x7fff, 0x237e, 0x11b7, 0x369e, 0x14a5, 0x1ff, 0x1078, 0x599d, 0x3647, 0x3b68, 0xa4a, 0x12ef, 0x2a5c, 0x1571, 0x7a18,
+# 0x7fff, 0x237e, 0x11b7, 0x369e, 0x14a5, 0x1ff, 0x1078, 0x599d, 0x6980, 0x7691, 0x26b8, 0x437f, 0x2a5c, 0x1199, 0x7a18,
+# 0x7fff, 0x237e, 0x11b7, 0x369e, 0x14a5, 0x1ff, 0x1078, 0x599d, 0x1057, 0x457e, 0x6df3, 0xfeb9, 0x2a5c, 0x2227, 0x7a18,
+# 0x7fff, 0x237e, 0x11b7, 0x369e, 0x14a5, 0x1ff, 0x1078, 0x3d97, 0x3647, 0x3b68, 0xa4a, 0x12ef, 0x567e, 0x1571, 0x7a18,
+# 0, 0x0EFA, 0x7DD1, 0, 0x7F1A, 0x7F1A,0, 0x716E, 0x7DD1, 0x40A7, 0x7DD1, 0x40A7, 0x48E9, 0x50CF, 0x7FFF]
+
def save_as_png(dimensions, data, fname, palette = None):
img = Image.new('L' if palette == None else 'P', dimensions)