44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
|
//
|
||
|
// Created by william on 7/12/24.
|
||
|
//
|
||
|
|
||
|
#ifndef NES_EMULATOR_DBG_PATTERN_TABLE_H
|
||
|
#define NES_EMULATOR_DBG_PATTERN_TABLE_H
|
||
|
|
||
|
#include <string.h>
|
||
|
#include "../include/types.h"
|
||
|
|
||
|
#define PATTERN_BANK_SIZE 0x1000
|
||
|
#define PATTERN_TABLE_WIDTH 0x10
|
||
|
#define PATTERN_TABLE_SIZE (PATTERN_TABLE_WIDTH * PATTERN_TABLE_WIDTH)
|
||
|
#define PATTERN_SIZE 8
|
||
|
#define PATTERN_BYTES (PATTERN_SIZE * 2)
|
||
|
#define PATTERN_BORDER_WIDTH 1
|
||
|
#define PATTERN_BORDER_COLOR 0xff2223b2
|
||
|
#define PATTERN_DRAW_SIZE (PATTERN_SIZE + PATTERN_BORDER_WIDTH)
|
||
|
|
||
|
#define PATTERN_BANK_0 0
|
||
|
#define PATTERN_BANK_1 1
|
||
|
|
||
|
typedef unsigned int pixel;
|
||
|
|
||
|
typedef struct dbg_pattern {
|
||
|
byte data_low[PATTERN_SIZE];
|
||
|
byte data_high[PATTERN_SIZE];
|
||
|
} DebugPattern;
|
||
|
|
||
|
typedef struct dbg_pattern_table {
|
||
|
DebugPattern bank_0[PATTERN_TABLE_SIZE];
|
||
|
DebugPattern bank_1[PATTERN_TABLE_SIZE];
|
||
|
} DebugPatternTable;
|
||
|
|
||
|
void dbg_pattern_table_init();
|
||
|
|
||
|
DebugPattern dbg_pattern_get(int x, int y, int bank);
|
||
|
|
||
|
void dbg_pattern_draw(int x, int y, int bank, pixel *buffer, int buffer_width);
|
||
|
|
||
|
void dbg_pattern_draw_bank(int bank, pixel *buffer);
|
||
|
|
||
|
#endif //NES_EMULATOR_DBG_PATTERN_TABLE_H
|