from coilsnake.modules.eb.EbModule import EbModule from coilsnake.util.common.yml import replace_field_in_yml, yml_load from coilsnake.util.eb.pointer import from_snes_address MAP_POINTERS_OFFSET = 0xa1db LOCAL_TILESETS_OFFSET = 0x175000 MAP_HEIGHT = 320 MAP_WIDTH = 256 SECTOR_TILESETS_PALETTES_TABLE_OFFSET = 0xD7A800 SECTOR_MUSIC_TABLE_OFFSET = 0xDCD637 SECTOR_MISC_TABLE_OFFSET = 0xD7B200 SECTOR_TOWN_MAP_TABLE_OFFSET = 0xEFA70F TELEPORT_ENTRY = EnumeratedLittleEndianIntegerTableEntry.create( "Teleport", 1, ["Enabled", "Disabled"] ) TOWNMAP_ENTRY = EnumeratedLittleEndianIntegerTableEntry.create( "Town Map", 1, ["None", "Onett", "Twoson", "Threed", "Fourside", "Scaraba", "Summers", "None 2"] ) SETTING_ENTRY = EnumeratedLittleEndianIntegerTableEntry.create( "Setting", 1, ["None", "Indoors", "Exit Mouse usable", "Lost Underworld sprites", "Magicant sprites", "Robot sprites", "Butterflies", "Indoors and Butterflies"] ) TOWNMAP_IMAGE_ENTRY = EnumeratedLittleEndianIntegerTableEntry.create( "Town Map Image", 1, ["None", "Onett", "Twoson", "Threed", "Fourside", "Scaraba", "Summers"] ) TOWNMAP_ARROW_ENTRY = EnumeratedLittleEndianIntegerTableEntry.create(
def hash(self): return hash_tile(self.data) def flipped_hash(self): self.flip_horizontally() h = self.hash() self.flip_horizontally() return h SPRITE_SIZES = [ "16x16", "16x16 2", "24x16", "32x16", "48x16", "16x24", "24x24", "16x32", "32x32", "48x32", "24x40", "16x48", "32x48", "48x48", "64x48", "64x64", "64x80" ] SpriteGroupSizeTableEntry = EnumeratedLittleEndianIntegerTableEntry.create( "Size", 1, SPRITE_SIZES) SpriteGroupCollisionNSWidthEntry = LittleEndianIntegerTableEntry.create( "North/South Collision Width", 1) SpriteGroupCollisionNSHeightEntry = LittleEndianIntegerTableEntry.create( "North/South Collision Height", 1) SpriteGroupCollisionEWWidthEntry = LittleEndianIntegerTableEntry.create( "East/West Collision Width", 1) SpriteGroupCollisionEWHeightEntry = LittleEndianIntegerTableEntry.create( "East/West Collision Height", 1) SpriteGroupHeaderTableEntry = RowTableEntry.from_schema( name="Sprite Group Header Table Entry", schema=[ LittleEndianIntegerTableEntry.create("Height", 1), LittleEndianIntegerTableEntry.create("Width", 1), SpriteGroupSizeTableEntry,
def block_size(self): return (self.width / 8) * (self.height / 8) * 32 def hash(self): return hash_tile(self.data) def flipped_hash(self): self.flip_horizontally() h = self.hash() self.flip_horizontally() return h SPRITE_SIZES = ["16x16", "16x16 2", "24x16", "32x16", "48x16", "16x24", "24x24", "16x32", "32x32", "48x32", "24x40", "16x48", "32x48", "48x48", "64x48", "64x64", "64x80"] SpriteGroupSizeTableEntry = EnumeratedLittleEndianIntegerTableEntry.create("Size", 1, SPRITE_SIZES) SpriteGroupCollisionNSWidthEntry = LittleEndianIntegerTableEntry.create("North/South Collision Width", 1) SpriteGroupCollisionNSHeightEntry = LittleEndianIntegerTableEntry.create("North/South Collision Height", 1) SpriteGroupCollisionEWWidthEntry = LittleEndianIntegerTableEntry.create("East/West Collision Width", 1) SpriteGroupCollisionEWHeightEntry = LittleEndianIntegerTableEntry.create("East/West Collision Height", 1) SpriteGroupHeaderTableEntry = RowTableEntry.from_schema( name="Sprite Group Header Table Entry", schema=[LittleEndianIntegerTableEntry.create("Height", 1), LittleEndianIntegerTableEntry.create("Width", 1), SpriteGroupSizeTableEntry, LittleEndianIntegerTableEntry.create("Palette", 1), SpriteGroupCollisionNSWidthEntry, SpriteGroupCollisionNSHeightEntry, SpriteGroupCollisionEWWidthEntry, SpriteGroupCollisionEWHeightEntry,