use 1 bit map for screen

This commit is contained in:
Nicholas Orlowsky 2024-04-06 16:38:23 -05:00
parent f949c2515b
commit 9804af7796
Signed by: nickorlow
GPG key ID: 838827D8C4611687
9 changed files with 51 additions and 43 deletions

View file

@ -41,10 +41,10 @@ void set_beep(const svBit beep) {
SDL_SetTextureColorMod(texture, 255, 255, 255);
}
void draw_screen(const svLogicVecVal *vram) {
void draw_screen(const svLogic *vram) {
uint32_t *screen = (uint32_t *)malloc(SCREEN_WIDTH * SCREEN_HEIGHT * 32);
for (int i = 0; i < SCREEN_WIDTH * SCREEN_HEIGHT; i++) {
screen[i] = vram[i].aval;
screen[i] = vram[i] == 1 ? 0xFFFFFFFF : 0x00000000;
}
SDL_UpdateTexture(texture, NULL, screen, sizeof(screen[0]) * SCREEN_WIDTH);
SDL_RenderClear(renderer);