diff --git a/Makefile b/Makefile index a52f357b..838cadb6 100644 --- a/Makefile +++ b/Makefile @@ -87,6 +87,8 @@ clean: $Q$(RM) $(CSRC:.c=.s) $(MSG) RM $(GBAFIX) $Q$(RM) $(GBAFIX) + $(MSG) RM data/ + $Q$(RM) -r data .PHONY: help help: diff --git a/database.txt b/database.txt index 33fba586..ec330168 100644 --- a/database.txt +++ b/database.txt @@ -1,2 +1,79 @@ -sprites/MorphBall.gfx;672;0x2b28a8 -sprites/MorphBall.pal;32;0x2b2b48 \ No newline at end of file +# Unused sprites + +sprites/UnusedSprites.gfx.lz;24;0x2b2870 +sprites/UnusedSprites.pal;32;0x2b2888 + +# Item banner + +sprites/ItemBanner.gfx.lz;556;0x2cb304 +sprites/ItemBanner.pal;64;0x2cb530 + +# Zoomer + +sprites/Zoomer.gfx.lz;1516;0x2c4194 +sprites/Zoomer.pal;64;0x2c4780 + +# Zeela + +sprites/Zeela.gfx.lz;2312;0x2c4bc0 +sprites/Zeela.pal;64;0x2c54c8 + +# Ripper + +sprites/Ripper.gfx.lz;564;0x2cbb6c +sprites/Ripper.pal;32;0x2cbda0 + +sprites/RipperPurple.gfx.lz;564;0x2cbdc0 +sprites/Ripper.pal;32;0x2cbff4 + +# Zeb + +sprites/Zeb.gfx.lz;648;0x2cc4b0 +sprites/Zeb.pal;32;0x2cc738 + +sprites/ZebBlue.gfx.lz;648;0x2cc758 +sprites/ZebBlue.pal;32;0x2cc9e0 + +# Skree + +sprites/Skree.gfx.lz;1056;0x2cca8c +sprites/Skree.pal;32;0x2cceac + +sprites/SkreeBlue.gfx.lz;1056;0x2cca8c +sprites/SkreeBlue.pal;32;0x2cd2ec + +# Morph ball + +sprites/MorphBall.gfx.lz;672;0x2b28a8 +sprites/MorphBall.pal;32;0x2b2b48 + +# Chozo statue + +sprites/ChozoStatueLongBeam.gfx.lz;5340;0x2b3bc8 +sprites/ChozoStatueLongBeam.pal;160;0x2b50a4 + +sprites/ChozoStatueIceBeam.gfx.lz;5340;0x2b5b68 +sprites/ChozoStatueIceBeam.pal;160;0x2b7044 + +sprites/ChozoStatueWaveBeam.gfx.lz;5340;0x2b70e4 +sprites/ChozoStatueWaveBeam.pal;160;0x2b85c0 + +sprites/ChozoStatueBomb.gfx.lz;5356;0x2b8660 +sprites/ChozoStatueBomb.pal;160;0x2b9b4c + +sprites/ChozoStatueSpeedbooster.gfx.lz;5368;0x2b9bec +sprites/ChozoStatueSpeedbooster.pal;160;0x2bb0e4 + +sprites/ChozoStatueHighJump.gfx.lz;5488;0x2bb184 +sprites/ChozoStatueHighJump.pal;160;0x2bc6f4 + +sprites/ChozoStatueScrewAttack.gfx.lz;5512;0x2bc794 +sprites/ChozoStatueScrewAttack.pal;160;0x2bdd1c + +sprites/ChozoStatueVariaSuit.gfx.lz;5392;0x2bddbc +sprites/ChozoStatueVariaSuit.pal;160;0x2bf2cc + +# Power grip + +sprites/PowerGrip.gfx.lz;1116;0x2b2c00 +sprites/PowerGrip.pal;64;0x2b305c \ No newline at end of file diff --git a/tools/extractor.py b/tools/extractor.py index 34b6a224..3d74096e 100644 --- a/tools/extractor.py +++ b/tools/extractor.py @@ -3,12 +3,12 @@ from io import BufferedReader import os import shutil -DATA_PATH = "../data/" +DATA_PATH = "data/" subDirs: array = [ "sprites/" ] -shutil.rmtree(DATA_PATH, ignore_errors=False, onerror=None) +# shutil.rmtree(DATA_PATH, ignore_errors=False, onerror=None) if not os.path.exists(DATA_PATH): # Create directories @@ -17,19 +17,21 @@ if not os.path.exists(DATA_PATH): os.mkdir(DATA_PATH.__add__(dir)) -rom: BufferedReader = open("../mzm_us_baserom.gba", "rb") -db: BufferedReader = open("../database.txt", "r") +rom: BufferedReader = open("mzm_us_baserom.gba", "rb") +db: BufferedReader = open("database.txt", "r") line: str = db.readline() while line != '': - # Formatted as follows : name;size;address - info: array = line.split(";") - rom.seek(int(info[2], 16)) - data = rom.read(int(info[1])) - - output: BufferedReader = open("../data/".__add__(info[0]), "wb") - output.write(bytearray(data)) - output.close() + # Formatted as follows : name;length;address + # The symbol # can be used as the first character of a line to make the extractor ignore it + if line[0] != '\n' and line[0] != '#': + info: array = line.split(";") + rom.seek(int(info[2], 16)) + data = rom.read(int(info[1])) + + output: BufferedReader = open(DATA_PATH.__add__(info[0]), "wb") + output.write(bytearray(data)) + output.close() line = db.readline() rom.close() \ No newline at end of file