// 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 #include "stSim.h" // Diagnostics. The logger drags in vsnprintf (with newlib that pulls the // whole formatted-output and float-conversion family, ~45 KB) plus a // multi-KB ring buffer, and the game has no need of either. That is // unaffordable on the IIgs, whose bank-0 BSS budget cannot spare the // ring, and on the X68000, which ships on a Human68k floppy with about // 330 KB of usable space for the binary AND its levels. Both compile it // out; the ports with room keep it. #if defined(__W65816__) || defined(JOEYLIB_PLATFORM_X68000) #define ST_LOG_RESET() ((void)0) #define ST_LOG(...) ((void)0) #define ST_LOG_FLUSH() ((void)0) #else #define ST_LOG_RESET() jlLogReset() #define ST_LOG(...) jlLogF(__VA_ARGS__) #define ST_LOG_FLUSH() jlLogFlush() #endif // 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); // Level intro only: cycle the starfield's ring palette slots so the warp // animates without a single pixel moving. Call after // stRenderSceneChanged, which turns it back off. void stRenderIntroStars(void); // Fill the stage with a two-line message and present it. Used when an // asset the game ships with will not load, so a player sees why the // game stopped instead of a silently degraded ride. void stRenderFatal(jlSurfaceT *stage, const char *line1, const char *line2); // Compile every always-on cel. False when a shipped asset is present but // unusable, so main can stop with a message instead of running the game // on interpreted cels. bool stRenderPrewarm(jlSurfaceT *stage, StSimT *sim); // Ready a level's hook cels before its ride (evicts the previous level's). // False only when this level's baked bank exists and will not load; a // port that ships no per-level banks compiles them and returns true. bool stRenderLevelCels(jlSurfaceT *stage, const StLevelT *level); // Audio sink setup and the per-tick release timers ($4320). // False when the shipped speech blob will not load. bool stAudioInit(void); void stAudioShutdown(void); void stAudioTick(void); #endif