nesemu/gui/pattern_window.h

38 lines
922 B
C

//
// Created by william on 6/14/24.
//
#ifndef NES_EMULATOR_PATTERN_WINDOW_H
#define NES_EMULATOR_PATTERN_WINDOW_H
#include <SDL.h>
#include "window.h"
#include "../include/types.h"
#define PW_ROW_TILE_COUNT 16
typedef struct pattern_tile {
byte x;
byte y;
byte data_low[8];
byte data_high[8];
} PatternTile;
typedef struct nes_pattern_window {
NesSdlContext sdl_context;
PatternTile tiles_bank_0[PW_ROW_TILE_COUNT * PW_ROW_TILE_COUNT];
PatternTile tiles_bank_1[PW_ROW_TILE_COUNT * PW_ROW_TILE_COUNT];
SDL_Texture *texture;
} NesPatternWindow;
void pattern_window_init(NesPatternWindow *window);
void pattern_window_uninit(NesPatternWindow *window);
void pattern_window_build_table(NesPatternWindow *window, byte* pattern_memory);
void pattern_window_render(NesPatternWindow *window);
void pattern_window_present(NesPatternWindow *window);
#endif //NES_EMULATOR_PATTERN_WINDOW_H