joeylib2/examples/spacetaxi/spacetaxi.h
2026-09-17 17:46:47 -05:00

45 lines
1.8 KiB
C

// Space Taxi (JoeyLib port) -- host-side declarations.
//
// The game itself lives in the host-independent simulation (stSim.h):
// physics, collision, the fare machine, the level hooks, the title
// intro and the level intro all run there in the C64's own units and
// are verified tick-for-tick against a VICE trace of the original.
// This header is the JoeyLib side: the renderer that paints the
// simulation's screen RAM and sprite frame, the audio sink, the
// level loader and the front-end flow in spacetaxi.c.
#ifndef SPACETAXI_H
#define SPACETAXI_H
#include <joey/joey.h>
#include "stSim.h"
// Level loading through the JoeyLib data path (DATA/levels/...).
bool stLevelLoad(StLevelT *out, const char *path);
// Renderer: paints dirty screen cells with the live charset and draws
// the eight sprites of the last marshaled frame with save-under.
void stRenderInit(jlSurfaceT *stage);
// A word on the stage before the slow part of startup: loading the cel
// bank and the first level takes long enough that the host's desktop
// would otherwise sit there with nothing to look at.
void stRenderLoading(jlSurfaceT *stage);
void stRenderShutdown(void);
void stRenderFrame(jlSurfaceT *stage, StSimT *sim);
// Drop the sprite cache and force a full repaint (new scene). Also
// leaves the title's logo mode (below).
void stRenderSceneChanged(StSimT *sim);
// Title screen only: draw the logo's four flip-book frames from one
// tile held in reserved palette slots, so the flip and the colour
// cycle are palette writes instead of repainting 103 (and 407) cells.
// Call after stRenderSceneChanged, which turns it back off.
void stRenderTitleLogo(StSimT *sim);
void stRenderPrewarm(jlSurfaceT *stage, StSimT *sim);
// Audio sink setup and the per-tick release timers ($4320).
void stAudioInit(void);
void stAudioShutdown(void);
void stAudioTick(void);
#endif