// SPDX-License-Identifier: GPL-3.0-or-later #ifndef VCC_GIME_H #define VCC_GIME_H #define GIME_WIDTH 320 #define GIME_HEIGHT 192 // Open from ordinary IRQ-enabled CoCo 3 BASIC text (WIDTH 32, 40 or 80). // Requires 512 KB or more, the standard BASIC MMU task 0 and video RAM group, // and a CMOC program, globals and stack below $8000. Reserve physical RAM // $40000..$4FFFF for both pages. Opening clears the images in that RAM. // Raw video/MMU register changes and interrupt-handler calls are unsupported. // Returns 1 on success, 0 for unsupported hardware/state or an existing session. unsigned char gime_open(void); // Draw into the hidden page. Its contents persist when it becomes hidden again. // Coordinates are unsigned, rectangles are clipped at the right and bottom. // Empty rectangles, colors above 15 and draws outside a session do nothing. void gime_plot(unsigned x, unsigned y, unsigned char color); void gime_fill_rect(unsigned x, unsigned y, unsigned w, unsigned h, unsigned char color); void gime_clear(unsigned char color); // Set one of the 16 shared palette entries immediately (GIME six-bit color). // Out-of-range slots/colors and calls outside a session do nothing. void gime_set_palette(unsigned char slot, unsigned char rgb); // Wait for the next BASIC vertical interrupt, then display the finished page. // Returns 0 if closed or the field timer fails to advance. A failed presentation // leaves the displayed and drawing pages alone. unsigned char gime_present(void); // Restore BASIC's text display and its original palette. Safe to repeat. void gime_close(void); #endif