implement emergency exit hook

awakener itself is not implemented but the code to get there is there.
the awakener itself needs the entire text zonk engine first
This commit is contained in:
Kistaro Windrider 2024-02-09 23:06:28 -08:00
parent db7ce90182
commit 873722b1ac
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -244,15 +244,43 @@ function _init()
-- complex fill API mode
poke(0x5f34, 1)
awakener_hold_frames = 0
mainview = ao_splash.new()
end
function _update60()
if awakener_armed then
if btn() & 0x30 > 0 then
awakener_hold_frames += 1
else
awakener_hold_frames = 0
end
if awakener_hold_frames == 90 then
exit_dither = ditherer.new{di=1}
awakener_armed = false
end
end
if exit_dither and exit_dither:update() then
exit_dither = nil
awakener_hold_frames=0
mainview = fast_awakener.new()
end
mainview:update()
end
function _draw()
mainview:draw()
if awakener_hold_frames >= 30 then
local gpx=(awakener_hold_frames-30) * 2 + 7
rectfill(0,0,gpx,9,4)
rectfill(gpx+1,0,128,9,5)
font_default()
print("keep holding for awakener", 1, 1, 7)
font_special()
end
if exit_dither then
exit_dither:draw()
end
end
function font_dogica()
@ -560,6 +588,20 @@ end
-->8
-- awakener
fast_awakener = {}
mknew(fast_awakener)
function fast_awakener:update()
--todo: implement
end
function fast_awakener:draw()
cls()
pal()
clear_alt_pal_bits()
font_default()
print("placeholder", 45, 61, 8)
end
-->8
-- consent screens
@ -612,6 +654,8 @@ mknew(consent_splash, function(self)
self.d = ditherer.new{
di=-1
}
awakener_armed = true
awakener_hold_frames = 0
end)
function consent_splash:update()
@ -624,6 +668,7 @@ function consent_splash:update()
end
function consent_splash:draw()
cls()
font_special()
print("\^w\^twarning", 20, 2, 10)
font_default()