mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-08 17:51:37 -04:00
72f2294d8d
CLOSES #2649, CLOSES #2650, CLOSES #2652, CLOSES #2653, CLOSES #2654, CLOSES #2657, CLOSES #2658, CLOSES #2659, CLOSES #2660, CLOSES #2662, CLOSES #2664, CLOSES #2665, CLOSES #2666, CLOSES #2669, CLOSES #2671, CLOSES #2672, CLOSES #2674, CLOSES #2676, CLOSES #2682, CLOSES #2683, CLOSES #2684, CLOSES #2685, CLOSES #2686, CLOSES #2687, CLOSES #2688, CLOSES #2689
49 lines
1.8 KiB
Lua
49 lines
1.8 KiB
Lua
return function(game)
|
|
local U = dofile("tests/drivers/util.lua")
|
|
local Probe = dofile("tests/drivers/shot_probe.lua")
|
|
local PaletteFX = require("src.render.PaletteFX")
|
|
local GameVersion = require("src.core.GameVersion")
|
|
local DIR = os.getenv("POKEPORT_SHOT_DIR") or os.getenv("SHOT_DIR") or "."
|
|
|
|
local fails = 0
|
|
local function check(cond, label)
|
|
if not cond then fails = fails + 1 end
|
|
print((cond and "PASS " or "FAIL ") .. label)
|
|
end
|
|
|
|
local savedVer = GameVersion.get()
|
|
game.save.options = game.save.options or {}
|
|
game.save.options.colors = "ogred"
|
|
PaletteFX.setMode("ogred")
|
|
|
|
local function visit(version, shotName)
|
|
GameVersion.set(version)
|
|
U.teleport(game, "OAKS_LAB", 5, 5, "up")
|
|
U.wait(60)
|
|
local base = PaletteFX.ogObjBase()
|
|
local shot = Probe.grab()
|
|
if not shot then
|
|
check(false, version .. " screen probe available")
|
|
else
|
|
local counts = Probe.count(shot, {
|
|
light = base[2], dark = base[3],
|
|
}, 1)
|
|
U.log(version, "OBJ light px", counts.light, "OBJ dark px", counts.dark)
|
|
check(counts.dark == 0, version .. " no dark OBJ shade on overworld sprites")
|
|
check(counts.light > 0, version .. " light OBJ shade drawn on overworld sprites")
|
|
end
|
|
local colors = PaletteFX.ogObjWorld()
|
|
check(colors[2] == base[1] and colors[3] == base[2] and colors[4] == base[4],
|
|
version .. " overworld bake is rOBP0 $D0")
|
|
check(U.shot(game, DIR .. "/" .. shotName), version .. " shot reached disk")
|
|
end
|
|
|
|
local ok, err = pcall(function()
|
|
visit("red", "2689_01_red_oaks_lab_white_faces.png")
|
|
visit("blue", "2689_02_blue_oaks_lab_white_faces.png")
|
|
end)
|
|
if not ok then check(false, "driver ran: " .. tostring(err)) end
|
|
GameVersion.set(savedVer)
|
|
love.event.quit(fails == 0 and 0 or 1)
|
|
end
|