local Screen = require("screen") local mode = 15 local fps, _fps, second = 0, 0, 0 function _init() sys.stepinterval(0) scrn = Screen:new("Static", 15, 4) scrn:colors(15, 0) zoom(0) for i = 0, 15 do scrn:palette(i, i, i, i) end end function _step(t) local btn = input.gamepad() if _lastbtn == 0 and btn & 16 > 0 then -- A zoom(-32) end if _lastbtn == 0 and btn & 32 > 0 then -- B zoom(5) end if _lastbtn == 0 and btn & 64 > 0 then -- X zoom(1) end if _lastbtn == 0 and btn & 128 > 0 then -- Y zoom(4) end _lastbtn = btn view.active(scrn.mainvp) for y = 0, scrnh do for x = 0, scrnw do gfx.pixel(x, y, math.random(0, 15)) end end if input.hotkey() == "q" then sys.exit(0) end _fps = _fps + 1 if second ~= math.floor(t / 1000) then second = math.floor(t / 1000) fps = _fps _fps = 0 scrn:title("Mode:" .. mode .. " FPS:" .. fps) end scrn:step() end function zoom(amount) mode = mode + amount if mode < 0 then mode = 0 end while mode >= 16 do mode = mode - 16 end scrn:mode(mode, 4) scrnw, scrnh = scrn:size() end