mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
13 lines
389 B
Python
Vendored
13 lines
389 B
Python
Vendored
import os
|
|
import sys
|
|
|
|
address = int(sys.argv[1], 16)
|
|
length = int(sys.argv[2], 16)
|
|
|
|
with open('baserom.gba', 'rb') as rom:
|
|
rom.seek(address)
|
|
outpath = "graphics/sa2/" + str(hex(0x8000000 + address).upper())[2:] + ".gbapal"
|
|
with open(outpath, "wb") as bin:
|
|
bin.write(rom.read(length))
|
|
os.system(f"tools/gbagfx/gbagfx {outpath} {outpath.replace('.gbapal', '.pal')}")
|