nesemu/gui/dbg_nametable.h

45 lines
890 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"
2024-07-23 20:46:13 -04:00
#define NAMETABLE_BANK_SIZE 0x3c0
#define NAMETABLE_ROW_WIDTH 32
#define NAMETABLE_COL_HEIGHT 30
2024-07-23 18:50:11 -04:00
2024-08-03 21:51:31 -04:00
typedef struct dbg_tile {
2024-07-23 20:46:13 -04:00
int tile_id;
2024-08-03 21:51:31 -04:00
int attribute;
2024-07-23 18:50:11 -04:00
} DebugTile;
typedef struct dbg_nametable {
DebugTile bank_0[NAMETABLE_BANK_SIZE];
DebugTile bank_1[NAMETABLE_BANK_SIZE];
bool vertical_mirroring;
} DebugNameTable;
2024-07-23 20:46:13 -04:00
/**
* Initializes the debug tile_id.
2024-07-23 20:46:13 -04:00
*/
void dbg_nametable_init();
2024-07-23 18:50:11 -04:00
/**
* Updates the debug tile_id. Updates the tiles from the PPU memory.
2024-07-23 18:50:11 -04:00
*/
void dbg_nametable_update();
/**
* Renders a tile_id bank to a buffer.
2024-07-23 18:50:11 -04:00
* @param bank
* @param buffer
*/
void dbg_nametable_render_bank(int bank, pixel *buffer);
#endif //NES_EMULATOR_DBG_NAMETABLE_H