Tile debugger

This commit is contained in:
william 2024-08-13 21:49:48 -04:00
parent d1ddcb1b0f
commit 77b37fc3b6
4 changed files with 26 additions and 5 deletions

View File

@ -1,5 +1,5 @@
set(HEADERS ppu.h palette.h colors.h)
set(SOURCE ppu.c palette.c)
set(HEADERS ppu.h palette.h colors.h tile_debugger.h)
set(SOURCE ppu.c palette.c tile_debugger.c)
add_library(nes_ppu ${SOURCE} ${HEADERS})

View File

@ -134,9 +134,10 @@ void ppu_draw_tile() {
}
byte ppu_get_pattern(byte tile_index, byte high) {
byte tile_row_index = (ppu_state.scanline + ppu_state.y_scroll) % 8;
address pattern_addr = ppu_state.bg_pattern_table_addr | tile_index << 4 | high << 3 | tile_row_index;
return ppu_read(pattern_addr);
return tile_index;
// byte tile_row_index = (ppu_state.scanline + ppu_state.y_scroll) % 8;
// address pattern_addr = ppu_state.bg_pattern_table_addr | tile_index << 4 | high << 3 | tile_row_index;
// return ppu_read(pattern_addr);
}
void ppu_fetch_tile(bool render) {

10
ppu/tile_debugger.c Normal file
View File

@ -0,0 +1,10 @@
//
// Created by william on 8/13/24.
//
#include "tile_debugger.h"
byte tile_encode_number(byte num) {
// 8 segment display
}

10
ppu/tile_debugger.h Normal file
View File

@ -0,0 +1,10 @@
//
// Created by william on 8/13/24.
//
#ifndef NES_EMULATOR_TILE_DEBUGGER_H
#define NES_EMULATOR_TILE_DEBUGGER_H
#include "../include/types.h"
#endif //NES_EMULATOR_TILE_DEBUGGER_H