summaryrefslogtreecommitdiff
path: root/vdp.hpp
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2023-05-07 20:38:17 +0300
committerOxore <oxore@protonmail.com>2023-05-07 20:39:32 +0300
commitf8a56f3c99fda938550ba6a1616c2fa4b41c19e9 (patch)
tree8b86ec58fe8773d2ae8853338ff6f95cce71d3f5 /vdp.hpp
parentf475974aeee25082d6384f69212a9d237d394477 (diff)
Impl basic sprite rendering
Diffstat (limited to 'vdp.hpp')
-rw-r--r--vdp.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/vdp.hpp b/vdp.hpp
index e811422..f506ca4 100644
--- a/vdp.hpp
+++ b/vdp.hpp
@@ -8,6 +8,19 @@
#include <cstddef>
#include <cstring>
+struct SpriteAttributeEntry {
+ uint16_t vpos;
+ uint16_t hpos;
+ uint16_t tile_id;
+ uint8_t link;
+ uint8_t palette_id;
+ uint8_t priority;
+ uint8_t vreverse;
+ uint8_t hreverse;
+ uint8_t vsize;
+ uint8_t hsize;
+};
+
class VDP {
public:
constexpr VDP(const uint32_t base_address_a = VDP_START): base_address(base_address_a) {}
@@ -80,6 +93,8 @@ class VDP {
size_t vcell_count);
void renderScrollALine(size_t line_index, size_t hcell_count, size_t vcell_count);
void renderScrollBLine(size_t line_index, size_t hcell_count, size_t vcell_count);
+ void renderSpritesLine(size_t line_index);
+ void renderSpriteOnTheLine(SpriteAttributeEntry, size_t line_index);
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);
@@ -123,4 +138,5 @@ class VDP {
uint8_t _cram[kCRAMSize]{};
uint8_t _vsram[kVSRAMSize]{};
uint32_t _rendered_buffer[kLinesPerScreenNTSC * kRenderWidth]{};
+ bool _unclosed_sprites_list{};
};