From 873722b1ac5672c7b5261b33130662fff91f417a Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Fri, 9 Feb 2024 23:06:28 -0800 Subject: [PATCH] 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 --- vacation.p8 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/vacation.p8 b/vacation.p8 index a849c5e..7020f1d 100644 --- a/vacation.p8 +++ b/vacation.p8 @@ -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()