diff --git a/src/import/gba/ow_extract.lua b/src/import/gba/ow_extract.lua index 9e6ae52f..705f05d1 100644 --- a/src/import/gba/ow_extract.lua +++ b/src/import/gba/ow_extract.lua @@ -130,6 +130,10 @@ local function decode_frame_4bpp(raw, width, height) for ty = 0, tilesY - 1 do for tx = 0, tilesX - 1 do local tileIndex = ty * tilesX + tx + if width == 128 and height == 64 then + tileIndex = math.floor(ty / 4) * 64 + math.floor(tx / 8) * 32 + + (ty % 4) * 8 + tx % 8 + end local tileOff = tileIndex * 32 for y = 0, 7 do for x = 0, 7 do @@ -403,7 +407,9 @@ end function OwExtract.ready(cache, root) root = root or "data/generated/gba" - return cache and cache:exists(root .. "/ow/manifest.lua") + local manifest = cache and cache:read(root .. "/ow/manifest.lua") + return type(manifest) == "string" + and tonumber(manifest:match("ow_version%s*=%s*(%d+)")) == Versions.OW_VERSION end return OwExtract diff --git a/src/import/gba/versions.lua b/src/import/gba/versions.lua index a9a4e681..491d589b 100644 --- a/src/import/gba/versions.lua +++ b/src/import/gba/versions.lua @@ -41,9 +41,9 @@ Versions.ROM_SIZE = 16777216 -- v114: pokemon/icons/412.rgba, the SPECIES_EGG menu icon — eggs were drawn -- with the icon of the species they hatch into. -- v115: LeafGreen profiles, edition-specific title assets and Deoxys stats. -Versions.CACHE_VERSION = 115 +Versions.CACHE_VERSION = 116 Versions.NATIVE_VERSION = 6 -Versions.OW_VERSION = 1 +Versions.OW_VERSION = 2 Versions.ANIM_VERSION = 1 -- Audio pack (M4A banks / DirectSound samples / cries). Versions.AUDIO_VERSION = 6