Merge pull request #1778 from bryanthaboi/dev

some fixes
This commit is contained in:
bryanthaboi
2026-08-24 12:38:35 -04:00
committed by GitHub
7 changed files with 31 additions and 8 deletions
+2 -5
View File
@@ -56,9 +56,6 @@ local MAP_GROUP_COUNT = 26 -- constants/map_constants.asm NUM_MAP_GROUPS
-- "bank13" (../pokecrystal/main.asm:192-195). -- "bank13" (../pokecrystal/main.asm:192-195).
local PAL_MAP_BANK = 0x02 local PAL_MAP_BANK = 0x02
local PAL_MAP_BANK_CRYSTAL = 0x13 local PAL_MAP_BANK_CRYSTAL = 0x13
-- LoadBallIconGFX.gfx (engine/battle/trainer_huds.asm:225-232); bank $0b
-- carries no manifest symbol to resolve it through.
local BALL_ICON_GFX = { 0x0b, 0x41a4 }
-- A tileset sheet is 96 tiles (128x48 at 8x8), and its PalMap packs two -- A tileset sheet is 96 tiles (128x48 at 8x8), and its PalMap packs two
-- tiles per byte: low nibble first tile, high nibble second (`dn` in the -- tiles per byte: low nibble first tile, high nibble second (`dn` in the
-- tilepal macro). The high bit of each nibble is the VRAM bank, not colour. -- tilepal macro). The high bit of each nibble is the VRAM bank, not colour.
@@ -5716,8 +5713,8 @@ function RomExtractorGen2:extractMenuGfx()
-- Four OAM tiles at $31 -- normal, statused, fainted, empty -- and OBJ -- Four OAM tiles at $31 -- normal, statused, fainted, empty -- and OBJ
-- colour 0 is transparent (engine/battle/trainer_huds.asm:47-99, :225-232). -- colour 0 is transparent (engine/battle/trainer_huds.asm:47-99, :225-232).
local balls = self.symbols["LoadBallIconGFX.gfx"] or BALL_ICON_GFX local balls = self:symbol("LoadBallIconGFX.gfx")
self:write2bpp(self.rom:bytes(balls[1], balls[2], 4 * 16), 32, 8, self:write2bpp(self.rom:bytes(balls.bank, balls.address, 4 * 16), 32, 8,
"battle/hud/balls.png", true) "battle/hud/balls.png", true)
hud.balls = "assets/generated/battle/hud/balls.png" hud.balls = "assets/generated/battle/hud/balls.png"
hud.ballsFirstTile = 0x31 hud.ballsFirstTile = 0x31
+13 -3
View File
@@ -371,9 +371,13 @@ end
-- `es`: true for GLSL ES 1.00 (mobile), false for GLSL 1.20 (desktop). Only -- `es`: true for GLSL ES 1.00 (mobile), false for GLSL 1.20 (desktop). Only
-- ever called from ShaderFX.convert(). -- ever called from ShaderFX.convert().
function ShaderFX.translate(fullPath, es) function ShaderFX.translate(fullPath, es)
local ffi = require("ffi") local okFfi, ffi = pcall(require, "ffi")
local ok, l = pcall(ensureLib) if not okFfi or type(ffi) ~= "table" then
return nil, "this build has no ffi, so presets cannot be converted here"
end
local ok, l, lerr = pcall(ensureLib)
if not ok then return nil, "ffi.load failed: " .. tostring(l) end if not ok then return nil, "ffi.load failed: " .. tostring(l) end
if not l then return nil, tostring(lerr or libError or "librashader bridge not available") end
local ptr = l.librashader_translate_preset(fullPath, es and 1 or 0) local ptr = l.librashader_translate_preset(fullPath, es and 1 or 0)
if ptr == nil then return nil, "librashader_translate_preset returned NULL" end if ptr == nil then return nil, "librashader_translate_preset returned NULL" end
local json = ffi.string(ptr) local json = ffi.string(ptr)
@@ -780,7 +784,7 @@ end
-- Translates `entry` via the bridge and writes ShaderFX.artifactPath(entry). -- Translates `entry` via the bridge and writes ShaderFX.artifactPath(entry).
-- Sets entry.converted on success; an existing artifact survives a failure. -- Sets entry.converted on success; an existing artifact survives a failure.
function ShaderFX.convert(entry, es) local function doConvert(entry, es)
ShaderSourcePatches.apply(entry) ShaderSourcePatches.apply(entry)
local preset, err = ShaderFX.translate(entry.fullPath, es == nil and defaultEs() or es) local preset, err = ShaderFX.translate(entry.fullPath, es == nil and defaultEs() or es)
if not preset then return false, err end if not preset then return false, err end
@@ -797,6 +801,12 @@ function ShaderFX.convert(entry, es)
return true return true
end end
function ShaderFX.convert(entry, es)
local ok, res, err = pcall(doConvert, entry, es)
if not ok then return false, tostring(res) end
return res, err
end
-- Two independent slots. "shaderfx" stays main's option key, so existing -- Two independent slots. "shaderfx" stays main's option key, so existing
-- saves keep meaning what they already meant. -- saves keep meaning what they already meant.
ShaderFX.SLOTS = { "main", "secondary" } ShaderFX.SLOTS = { "main", "secondary" }
+1
View File
@@ -119,6 +119,7 @@ function ShaderFXScreen.new(game, slot)
item.entry.name, tostring(err)) item.entry.name, tostring(err))
end end
applyRowState(item) applyRowState(item)
if not ok then item.right = Strings("FAILED") end
return return
end end
+3
View File
@@ -778,6 +778,9 @@ REQUIRED_SYMBOLS = {
# nine fill cells. "HP:" and the ten HP-bar cells come from # nine fill cells. "HP:" and the ten HP-bar cells come from
# FontBattleExtra, which is already extracted. # FontBattleExtra, which is already extracted.
"EnemyHPBarBorderGFX", "HPExpBarBorderGFX", "ExpBarGFX", "EnemyHPBarBorderGFX", "HPExpBarBorderGFX", "ExpBarGFX",
# gfx/battle/balls.2bpp, the four party-ball OAM tiles
# (engine/battle/trainer_huds.asm LoadBallIconGFX).
"LoadBallIconGFX.gfx",
# gfx/stats/stats_tiles.png + gfx/stats/pages.pal, StatsScreen_LoadFont # gfx/stats/stats_tiles.png + gfx/stats/pages.pal, StatsScreen_LoadFont
# and _CGB_StatsScreenHPPals (#1558) # and _CGB_StatsScreenHPPals (#1558)
"StatsScreenPageTilesGFX", "StatsScreenPagePals", "StatsScreenPageTilesGFX", "StatsScreenPagePals",
+4
View File
@@ -17024,6 +17024,10 @@
32, 32,
21684 21684
], ],
"LoadBallIconGFX.gfx": [
11,
16754
],
"LoadOpponentTrainerAndPokemon.resample": [ "LoadOpponentTrainerAndPokemon.resample": [
126, 126,
16418 16418
+4
View File
@@ -15084,6 +15084,10 @@
64, 64,
24169 24169
], ],
"LoadBallIconGFX.gfx": [
11,
16804
],
"LoadOrientedFrontpic": [ "LoadOrientedFrontpic": [
20, 20,
22948 22948
+4
View File
@@ -15084,6 +15084,10 @@
64, 64,
24169 24169
], ],
"LoadBallIconGFX.gfx": [
11,
16804
],
"LoadOrientedFrontpic": [ "LoadOrientedFrontpic": [
20, 20,
22948 22948