diff options
Diffstat (limited to 'lib/nes/sys')
| -rw-r--r-- | lib/nes/sys/ppu.cc | 16 | ||||
| -rw-r--r-- | lib/nes/sys/ppu.hh | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/lib/nes/sys/ppu.cc b/lib/nes/sys/ppu.cc index 5b9f5db..56e99a8 100644 --- a/lib/nes/sys/ppu.cc +++ b/lib/nes/sys/ppu.cc @@ -74,7 +74,7 @@ namespace nes::sys case 1: { // Load the tile pattern for the background from the name table. - fetch_cycle_.tile = tile{ read8(address{ 0x2000 } + internal_.v.get_tile_address()) }; + fetch_cycle_.background_tile = tile{ read8(address{ 0x2000 } + internal_.v.get_tile_address()) }; break; } case 3: @@ -88,15 +88,15 @@ namespace nes::sys auto const shift = ((internal_.v.get_coarse_y() & 0b00010u) << 1) | ((internal_.v.get_coarse_x() & 0b00010u) << 0); - fetch_cycle_.palette = static_cast<palette>((read8(addr) >> shift) & 0b11); + fetch_cycle_.background_palette = static_cast<palette>((read8(addr) >> shift) & 0b11); break; } case 5: { // Load bitplane 0 for the background tile's pattern. - fetch_cycle_.bitplane_0 = get_tile_bitplane( + fetch_cycle_.pattern_bitplane_0 = get_tile_bitplane( control_.get_background_pattern_table(), - fetch_cycle_.tile, + fetch_cycle_.background_tile, internal_.v.get_fine_y(), bitplane::_0); break; @@ -104,9 +104,9 @@ namespace nes::sys case 7: { // Load bitplane 1 for the background tile's pattern. - fetch_cycle_.bitplane_1 = get_tile_bitplane( + fetch_cycle_.pattern_bitplane_1 = get_tile_bitplane( control_.get_background_pattern_table(), - fetch_cycle_.tile, + fetch_cycle_.background_tile, internal_.v.get_fine_y(), bitplane::_1); break; @@ -116,7 +116,7 @@ namespace nes::sys // Fetch cycle done -> build the tile row for the background. current_background_ = next_background_; next_background_ = get_tile_row( - fetch_cycle_.palette, fetch_cycle_.bitplane_0, fetch_cycle_.bitplane_1); + fetch_cycle_.background_palette, fetch_cycle_.pattern_bitplane_0, fetch_cycle_.pattern_bitplane_1); break; } default: @@ -697,4 +697,4 @@ namespace nes::sys default: return rgb::from_hex(0x000000); } } -} // namespace nes::sys
\ No newline at end of file +} // namespace nes::sys diff --git a/lib/nes/sys/ppu.hh b/lib/nes/sys/ppu.hh index 898ddd3..d82056e 100644 --- a/lib/nes/sys/ppu.hh +++ b/lib/nes/sys/ppu.hh @@ -217,10 +217,10 @@ namespace nes::sys tile_row next_background_{}; struct { - tile tile{ 0 }; - palette palette{ 0 }; - u8 bitplane_0{ 0 }; - u8 bitplane_1{ 0 }; + tile background_tile{ 0 }; + palette background_palette{ 0 }; + u8 pattern_bitplane_0{ 0 }; + u8 pattern_bitplane_1{ 0 }; } fetch_cycle_{}; // Data populated during the fetch cycle. evaluated_sprite sprites_[8]{}; // Evaluated sprites. u32 sprite_count_{ 0 }; // Number of evaluated sprites in sprites_. @@ -284,4 +284,4 @@ namespace nes::sys auto ref_color(color_index) -> color&; auto resolve_color(color) const -> rgb; }; -} // namespace nes::sys
\ No newline at end of file +} // namespace nes::sys |
