diff options
author | Oxore <oxore@protonmail.com> | 2023-05-06 21:03:55 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2023-05-06 21:52:08 +0300 |
commit | 18eb8db9c253601ca05dc02b2003e3a3eaebc5ed (patch) | |
tree | 5a6e6a86d853495cd4a6afe4cb5e35abfffbe850 /vdp.hpp | |
parent | c32d616e1e014df30a8a50491b879e7599ba3243 (diff) |
Impl scroll A static rendering
Diffstat (limited to 'vdp.hpp')
-rw-r--r-- | vdp.hpp | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -10,18 +10,19 @@ class VDP { public: - VDP(const uint32_t base_address_a = VDP_START): base_address(base_address_a) {} + constexpr VDP(const uint32_t base_address_a = VDP_START): base_address(base_address_a) {} uint32_t Read(uint32_t offset, enum bitness); void Write(uint32_t offset, enum bitness, uint32_t value); bool Scanline(); // Returns true if display disabled or vblank happened void Reset(); - const uint32_t* GetRenderedBuffer() const { return _rendered_buffer; } + constexpr const uint32_t* GetRenderedBuffer() const { return _rendered_buffer; } const uint32_t base_address; - static constexpr size_t render_height = 224; - static constexpr size_t render_width = 320; - static constexpr size_t render_buffer_size = 320*224*4; + static constexpr size_t kRenderHeight = 224; + static constexpr size_t kRenderWidth = 320; + static constexpr size_t render_buffer_size = kRenderWidth * kRenderHeight * + sizeof(*reinterpret_cast<VDP*>(4)->GetRenderedBuffer()); private: struct StatusRegister { @@ -70,6 +71,7 @@ class VDP { kRegistersCount, ///< Keep it last }; + void renderScrollALine(size_t line_index, size_t hcell_count); void writeData(uint8_t address_mode, uint16_t address, uint16_t value); void writeControl(uint16_t value); uint16_t readData(uint8_t address_mode, uint16_t address); @@ -112,5 +114,5 @@ class VDP { uint8_t _vram[kVRAMSize]{}; uint8_t _cram[kCRAMSize]{}; uint8_t _vsram[kVSRAMSize]{}; - uint32_t _rendered_buffer[kLinesPerScreenNTSC * render_width]{}; + uint32_t _rendered_buffer[kLinesPerScreenNTSC * kRenderWidth]{}; }; |