pico9918-core 1.3.0
TMS9918A / F18A video display processor emulation in C99
Loading...
Searching...
No Matches
splash.c File Reference

pico9918-core - Splash overlay More...

#include "splash.h"
#include <stdbool.h>
#include "overlay/bmp_splash.h"
#include "overlay/bmp_splash_pro.h"
#include "overlay/bmp_f18a_badge.h"
+ Include dependency graph for splash.c:

Go to the source code of this file.

Macros

#define SPLASH_ENTER_FRAMES   60
 
#define SPLASH_HOLD_FRAMES   180
 
#define SPLASH_START_POS   (SPLASH_ENTER_FRAMES + SPLASH_HEIGHT + 2)
 

Functions

 PICO9918_STATIC_ASSERT (SPLASHPRO_HEIGHT==SPLASH_HEIGHT, "the PRO splash is a different height - SPLASH_START_POS assumes one band")
 
void pico9918_splash_select_pro (bool pro)
 render the F18A's power-on badge into the scanline buffer
 
void pico9918_splash_reset (void)
 restart the splash animation (after... reset)
 
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_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.
 
bool pico9918_f18a_badge_render (uint16_t outputLine, uint32_t frameCount, PICO9918_PIXEL_T *pixels)
 

Variables

static bool splashIsPro = false
 
static int logoOffset = SPLASH_START_POS
 
static bool canHideSplash = false
 

Detailed Description

pico9918-core - Splash overlay

Copyright (c) 2024 Troy Schrapel

This code is licensed under the MIT license

https://github.com/visrealm/pico9918-core

Definition in file splash.c.

Macro Definition Documentation

◆ SPLASH_ENTER_FRAMES

#define SPLASH_ENTER_FRAMES   60

Definition at line 42 of file splash.c.

◆ SPLASH_HOLD_FRAMES

#define SPLASH_HOLD_FRAMES   180

Definition at line 43 of file splash.c.

◆ SPLASH_START_POS

#define SPLASH_START_POS   (SPLASH_ENTER_FRAMES + SPLASH_HEIGHT + 2)

Definition at line 47 of file splash.c.

Function Documentation

◆ pico9918_splash_select_pro()

void pico9918_splash_select_pro ( bool  pro)

render the F18A's power-on badge into the scanline buffer

What PICO9918_CHIP_F18A shows where PICO9918_CHIP_PICO9918 shows its own splash. Not gated behind PICO9918_NO_SPLASH: that option drops the PICO9918's splash, and an F18A still has a badge.

outputLine is the host's OUTPUT line, not a display line, so one row of the badge is one physical scanline. Only a host driving pico9918_frame_output_line gets it; an interlaced one, which drives pico9918_frame_scanline per field, does not.

Returns
whether it drew, i.e. whether pixels changed.

choose the PRO artwork over the PICO9918's

pico9918_set_chip calls this; a host has no reason to. Only a runtime-chip build carries both images - a board resolves its one at build time.

Definition at line 36 of file splash.c.

Referenced by pico9918_set_chip().

◆ pico9918_splash_reset()

void pico9918_splash_reset ( void  )

restart the splash animation (after... reset)

Definition at line 57 of file splash.c.

Referenced by pico9918_reset().

◆ pico9918_splash_allow_hide()

void pico9918_splash_allow_hide ( void  )

allow the splash to animate back out - the host calls this once the display has been enabled

Definition at line 64 of file splash.c.

Referenced by pico9918_frame_end().

◆ pico9918_splash_render()

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.

Also advances the animation, on y == 0.

Definition at line 74 of file splash.c.

Referenced by pico9918_frame_scanline().

◆ pico9918_f18a_badge_render()

bool pico9918_f18a_badge_render ( uint16_t  outputLine,
uint32_t  frameCount,
PICO9918_PIXEL_T *  pixels 
)

Definition at line 147 of file splash.c.

Variable Documentation

◆ splashIsPro

bool splashIsPro = false
static

Definition at line 30 of file splash.c.

◆ logoOffset

int logoOffset = SPLASH_START_POS
static

Definition at line 49 of file splash.c.

◆ canHideSplash

bool canHideSplash = false
static

Definition at line 50 of file splash.c.