cool-bun-demo/screen.h

44 lines
798 B
C

#ifndef __SCREEN_H__
#define __SCREEN_H__
#include "types.h"
#define SCREEN_WIDTH (320)
#define SCREEN_HEIGHT (256)
struct ScreenSetup {
// human entered
uint16_t width;
uint16_t height;
short int bitplanes;
// calculated
unsigned char *memoryStart;
uint16_t byteWidth;
uint16_t nextBitplaneAdvance;
uint16_t nextBufferAdvance;
};
struct CurrentScreen {
uint16_t currentBuffer;
uint16_t pixelWidth;
uint16_t byteWidth;
uint16_t pixelHeight;
unsigned char *planes[8];
};
void setupScreen(
struct ScreenSetup *screenSetup,
uint16_t width,
uint16_t height,
uint8_t bitplanes
);
void teardownScreen(struct ScreenSetup *screenSetup);
void setCurrentScreen(
struct ScreenSetup *screenSetup,
struct CurrentScreen *currentScreen,
short int buffer
);
#endif