// Software framebuffer for the FS2 port. Owns a 280x192 8-bit // palette-indexed image AND a parallel Apple II hires bitplane // (40x192 = 7680 bytes) that the scenery viewport renders into so // chunk5's bit-pattern color generation works as on real hardware. // At blit time, viewport rows decode from the bitplane; panel rows // (below VIEWPORT_BOTTOM) use the palette image as before. #ifndef FRAMEBUFFER_H #define FRAMEBUFFER_H #include #include "hires.h" #include "palette.h" #include "types.h" typedef struct FramebufferT { uint8_t pixels[NATIVE_WIDTH * NATIVE_HEIGHT]; uint8_t hires[HIRES_PAGE_BYTES]; } FramebufferT; void framebufferClear(FramebufferT *fb, ColorE color); void framebufferFillRect(FramebufferT *fb, int16_t x, int16_t y, int16_t w, int16_t h, ColorE color); void framebufferFillRow(FramebufferT *fb, int16_t y, ColorE color); void framebufferSetPixel(FramebufferT *fb, int16_t x, int16_t y, ColorE color); // Copy the framebuffer into a 32-bit RGB SDL pixel buffer (any // upscaling is applied here so SDL just blits a flat surface). void framebufferBlitTo32(const FramebufferT *fb, uint32_t *dst, int dstWidth, int dstHeight); #endif