17#if !PICO9918_NO_SPLASH
22#include "overlay/bmp_splash.h"
24#if PICO9918_BUILD_RUNTIME_CHIP
25#include "overlay/bmp_splash_pro.h"
30static bool splashIsPro =
false;
33PICO9918_STATIC_ASSERT(SPLASHPRO_HEIGHT == SPLASH_HEIGHT,
34 "the PRO splash is a different height - SPLASH_START_POS assumes one band");
42#define SPLASH_ENTER_FRAMES 60
43#define SPLASH_HOLD_FRAMES 180
47#define SPLASH_START_POS (SPLASH_ENTER_FRAMES + SPLASH_HEIGHT + 2)
49static int logoOffset = SPLASH_START_POS;
50static bool canHideSplash =
false;
59#if !PICO9918_NO_SPLASH
60 logoOffset = SPLASH_START_POS;
66#if !PICO9918_NO_SPLASH
75 uint32_t vVirtualPixels, PICO9918_PIXEL_T* pixels)
88 if (frameCount < SPLASH_ENTER_FRAMES)
90 else if (canHideSplash && frameCount > (SPLASH_ENTER_FRAMES + SPLASH_HOLD_FRAMES))
94 if (y <= vVirtualPixels)
99 y -= vBorder + vPixels + logoOffset;
100 if (y < splashHeight)
102 const int leftBorderPx = 4;
103 const int splashBpp = 2;
104 const int splashPixPerByte = 8 / splashBpp;
106#if PICO9918_BUILD_RUNTIME_CHIP
107 uint8_t*
const art = splashIsPro ? splashPro : splash;
108 const int artWidth = splashIsPro ? splashProWidth : splashWidth;
109 const PICO9918_PIXEL_T* pal = splashIsPro ? splashPro_pal : splash_pal;
111 uint8_t*
const art = splash;
112 const int artWidth = splashWidth;
113 const PICO9918_PIXEL_T* pal = splash_pal;
116 uint8_t* splashPtr = art + (y * artWidth / splashPixPerByte);
118 for (
int x = leftBorderPx; x < leftBorderPx + artWidth; x += splashPixPerByte)
120 uint8_t c = *(splashPtr++);
121 uint8_t pixMask = 0xc0;
124 for (
int px = 0; px < 4; ++px, offset -= 2, pixMask >>= 2)
126 uint8_t palIndex = (c & pixMask) >> offset;
127 if (palIndex) pixels[x + px] = pal[palIndex];
135#if PICO9918_BUILD_RUNTIME_CHIP
137#include "overlay/bmp_f18a_badge.h"
140 "the badge asset is not the height the renderer draws");
142 "the badge asset is not the width the renderer draws");
145_Static_assert(F18ABADGE_WIDTH % 8 == 0,
"the badge asset width must be a multiple of 8");
147bool pico9918_f18a_badge_render(uint16_t outputLine, uint32_t frameCount, PICO9918_PIXEL_T* pixels)
154 const uint8_t* row = f18aBadge + outputLine * (F18ABADGE_WIDTH / 8);
159 pixels[x] = f18aBadge_pal[(row[x >> 3] >> (7 - (x & 7))) & 1];
void pico9918_splash_allow_hide(void)
allow the splash to animate back out - the host calls this once the display has been enabled
void pico9918_splash_select_pro(bool pro)
render the F18A's power-on badge into the scanline buffer
void pico9918_splash_render(uint16_t y, uint32_t frameCount, uint32_t vBorder, uint32_t vPixels, uint32_t vVirtualPixels, PICO9918_PIXEL_T *pixels)
render the splash logo into the scanline buffer, if row y falls in the logo band.
void pico9918_splash_reset(void)
restart the splash animation (after... reset)
pico9918-core - Splash overlay
#define PICO9918_F18A_BADGE_WIDTH
badge columns - must stay a multiple of 8, see splash.c
#define PICO9918_F18A_BADGE_HEIGHT
badge rows, each one OUTPUT line rather than one display line
#define PICO9918_F18A_BADGE_FRAMES
frames the badge is shown for, counting from reset