nesemu/gui/dbg_nametable.h

37 lines
742 B
C
Raw Normal View History

2024-07-23 18:50:11 -04:00
//
// Created by william on 7/23/24.
//
#ifndef NES_EMULATOR_DBG_NAMETABLE_H
#define NES_EMULATOR_DBG_NAMETABLE_H
#include <stdbool.h>
#include "../include/types.h"
#include "dbg_pattern_table.h"
#define NAMETABLE_BANK_SIZE 0x3bf
typedef struct db_tile {
byte tile_id;
} DebugTile;
typedef struct dbg_nametable {
DebugTile bank_0[NAMETABLE_BANK_SIZE];
DebugTile bank_1[NAMETABLE_BANK_SIZE];
bool vertical_mirroring;
} DebugNameTable;
/**
* Updates the debug nametable. Updates the tiles from the PPU memory.
*/
void dbg_nametable_update();
/**
* Renders a nametable bank to a buffer.
* @param bank
* @param buffer
*/
void dbg_nametable_render_bank(int bank, pixel *buffer);
#endif //NES_EMULATOR_DBG_NAMETABLE_H