diff --git a/sources/PPU/PPU.cpp b/sources/PPU/PPU.cpp index c3b0fa3..329fb5f 100644 --- a/sources/PPU/PPU.cpp +++ b/sources/PPU/PPU.cpp @@ -80,7 +80,6 @@ namespace ComSquare::PPU case ppuRegisters::vmaddh: this->_vmadd.vmaddh = data; break; - //! @info should must be in vblank for the write (and write it to the screen )? and increment vram address after; case ppuRegisters::vmdatal: if (!this->_inidisp.fblank) { this->_vmdata.vmdatal = data; @@ -138,13 +137,14 @@ namespace ComSquare::PPU void PPU::update(unsigned cycles) { (void)cycles; - int inc = 0; + int inc = getVramAddress(); uint32_t pixelTmp = 0xFFFFFFFF; //pixelTmp |= this->_inidisp.brightness; if (!this->_inidisp.fblank) { for (int x = 0; x < 448; x++) { for (int y = 0; y < 512; y++) { - this->_renderer.putPixel(x, y, (uint32_t)_vram[inc++] << 8U + 0xFFU); + //this->_renderer.putPixel(x, y, ((uint32_t)_vram[inc++] << 8U) + 0xFFU); + this->_renderer.putPixel(x, y, (uint32_t)this->_bus->read(inc++)); } } } diff --git a/sources/PPU/PPU.hpp b/sources/PPU/PPU.hpp index 836d017..8a8073f 100644 --- a/sources/PPU/PPU.hpp +++ b/sources/PPU/PPU.hpp @@ -286,7 +286,7 @@ namespace ComSquare::PPU }; uint8_t raw; } _bgnba[2]; - //! @brief BGXXOFS Register (BG1/2/3/4 Horizontal and Vertical Scroll) + //! @brief BGXXOFS Register (BG1/2/3/4 Horizontal and Vertical Scrolls) union { struct { uint16_t offsetBg: 10;