Kobo: More readable crash screen on sunxi (Sage, especially).

Switch to flashing GC16, because the screen is so fast that using GL16
simply leaves us with an unreadable mess of ghosting.

I'm halfway considering rewriting this in Lua so that I can do a proper
batched update...
pull/8403/head
NiLuJe 3 years ago
parent f94101178f
commit 98b53b0390

@ -245,6 +245,9 @@ fi
# will also enforce UR... (Only actually meaningful on sunxi). # will also enforce UR... (Only actually meaningful on sunxi).
if [ "${PLATFORM}" = "b300-ntx" ]; then if [ "${PLATFORM}" = "b300-ntx" ]; then
export FBINK_FORCE_ROTA=0 export FBINK_FORCE_ROTA=0
# Screen is too fast for GL16 not to look like utter crap.
FBINK_WFM="GC16"
FBINK_FLASH="-f"
# And we also cannot use batched updates for the crash screens, as buffers are private, # And we also cannot use batched updates for the crash screens, as buffers are private,
# so each invocation essentially draws in a different buffer... # so each invocation essentially draws in a different buffer...
FBINK_BATCH_FLAG="" FBINK_BATCH_FLAG=""
@ -256,6 +259,8 @@ if [ "${PLATFORM}" = "b300-ntx" ]; then
# Make sure we poke the right input device # Make sure we poke the right input device
KOBO_TS_INPUT="/dev/input/by-path/platform-0-0010-event" KOBO_TS_INPUT="/dev/input/by-path/platform-0-0010-event"
else else
FBINK_WFM="GL16"
FBINK_FLASH=""
FBINK_BATCH_FLAG="-b" FBINK_BATCH_FLAG="-b"
FBINK_BGLESS_FLAG="-O" FBINK_BGLESS_FLAG="-O"
FBINK_OT_PADDING="" FBINK_OT_PADDING=""
@ -398,19 +403,21 @@ while [ ${RETURN_VALUE} -ne 0 ]; do
bombMargin=$((FONTH + FONTH / 2)) bombMargin=$((FONTH + FONTH / 2))
# Start with a big gray screen of death, and our friendly old school crash icon ;) # Start with a big gray screen of death, and our friendly old school crash icon ;)
# U+1F4A3, the hard way, because we can't use \u or \U escape sequences... # U+1F4A3, the hard way, because we can't use \u or \U escape sequences...
# shellcheck disable=SC2039,SC3003 # shellcheck disable=SC2039,SC3003,SC2086
./fbink -q ${FBINK_BATCH_FLAG} -c -B GRAY9 -m -t regular=./fonts/freefont/FreeSerif.ttf,px=${bombHeight},top=${bombMargin} -W GL16 -- $'\xf0\x9f\x92\xa3' ./fbink -q ${FBINK_BATCH_FLAG} -c -B GRAY9 -m -t regular=./fonts/freefont/FreeSerif.ttf,px=${bombHeight},top=${bombMargin} -W ${FBINK_WFM} ${FBINK_FLASH} -- $'\xf0\x9f\x92\xa3'
# With a little notice at the top of the screen, on a big gray screen of death ;). # With a little notice at the top of the screen, on a big gray screen of death ;).
./fbink -q ${FBINK_BATCH_FLAG} ${FBINK_BGLESS_FLAG} -m -y 1 "Don't Panic! (Crash n°${CRASH_COUNT} -> ${RETURN_VALUE})" -W GL16 # shellcheck disable=SC2086
./fbink -q ${FBINK_BATCH_FLAG} ${FBINK_BGLESS_FLAG} -m -y 1 -W ${FBINK_WFM} ${FBINK_FLASH} -- "Don't Panic! (Crash n°${CRASH_COUNT} -> ${RETURN_VALUE})"
if [ ${CRASH_COUNT} -eq 1 ]; then if [ ${CRASH_COUNT} -eq 1 ]; then
# Warn that we're waiting on a tap to continue... # Warn that we're waiting on a tap to continue...
./fbink -q ${FBINK_BATCH_FLAG} ${FBINK_BGLESS_FLAG} -m -y 2 "Tap the screen to continue." -W GL16 # shellcheck disable=SC2086
./fbink -q ${FBINK_BATCH_FLAG} ${FBINK_BGLESS_FLAG} -m -y 2 -W ${FBINK_WFM} ${FBINK_FLASH} -- "Tap the screen to continue."
fi fi
# And then print the tail end of the log on the bottom of the screen... # And then print the tail end of the log on the bottom of the screen...
crashLog="$(tail -n 25 crash.log | sed -e 's/\t/ /g')" crashLog="$(tail -n 25 crash.log | sed -e 's/\t/ /g')"
# The idea for the margins being to leave enough room for an fbink -Z bar, small horizontal margins, and a font size based on what 6pt looked like @ 265dpi # The idea for the margins being to leave enough room for an fbink -Z bar, small horizontal margins, and a font size based on what 6pt looked like @ 265dpi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
./fbink -q ${FBINK_BATCH_FLAG} ${FBINK_BGLESS_FLAG} -t regular=./fonts/droid/DroidSansMono.ttf,top=$((viewHeight / 2 + FONTH * 2 + FONTH / 2)),left=$((viewWidth / 60)),right=$((viewWidth / 60)),px=$((viewHeight / 64))${FBINK_OT_PADDING} -W GL16 -- "${crashLog}" ./fbink -q ${FBINK_BATCH_FLAG} ${FBINK_BGLESS_FLAG} -t regular=./fonts/droid/DroidSansMono.ttf,top=$((viewHeight / 2 + FONTH * 2 + FONTH / 2)),left=$((viewWidth / 60)),right=$((viewWidth / 60)),px=$((viewHeight / 64))${FBINK_OT_PADDING} -W ${FBINK_WFM} ${FBINK_FLASH} -- "${crashLog}"
if [ "${PLATFORM}" != "b300-ntx" ]; then if [ "${PLATFORM}" != "b300-ntx" ]; then
# So far, we hadn't triggered an actual screen refresh, do that now, to make sure everything is bundled in a single flashing refresh. # So far, we hadn't triggered an actual screen refresh, do that now, to make sure everything is bundled in a single flashing refresh.
./fbink -q -f -s ./fbink -q -f -s

Loading…
Cancel
Save