Skip to content

Commit

Permalink
forgot to remove something from the header so it didnt compile. ignor…
Browse files Browse the repository at this point in the history
…e the stuff in comments i added in ppu.cpp
  • Loading branch information
Roeegg2 committed Jan 19, 2024
1 parent 84b1b5e commit 7718299
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/ppu.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace roee_nes {
void increment_coarse_x();
void increment_y();

void PPU::load_bg_shift_regs();
void load_bg_shift_regs();

uint16_t fetch_pt_byte(uint8_t byte_significance);

Expand Down
17 changes: 9 additions & 8 deletions src/ppu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,18 @@ namespace roee_nes {
static uint8_t run_cycles = 0;
static PPU_State where_did_i_stop = FETCH_NT;

if (curr_cycle == 0) {
// do later, but pretty much just idle
}
if (curr_cycle == 0)
cycles--; // do later, but pretty much just idle.

run_cycles += cycles;

for (uint8_t i = 0; i < cycles; i++) {
auto increment_mod_eight = [](uint8_t* foo) -> void { *foo = (*foo + 1) % 8; };
increment_mod_eight(&x);

if (1 <= curr_cycle <= 256) {
bg_regs.pt_shift_lsb <<= 1;
bg_regs.pt_shift_msb <<= 1;
// render pixel
}
// if (1 <= curr_cycle <= 256)
// NES_Screen.render_pixel(prepare_pixel());

if (where_did_i_stop == LOAD_SHIFT_REGS) {
load_bg_shift_regs();
where_did_i_stop = static_cast<PPU_State>(static_cast<int>(where_did_i_stop) + 1);
Expand Down Expand Up @@ -179,4 +176,8 @@ namespace roee_nes {
bg_regs.attr_shift_msb *= 0b11111111;

}

// void PPU::prepare_pixel(){

// }
}

0 comments on commit 7718299

Please sign in to comment.