From b5397045db290c234a1e779b64538933f93b37b6 Mon Sep 17 00:00:00 2001 From: Oxore Date: Mon, 3 Oct 2022 02:05:09 +0300 Subject: Begin implementing DMA: impl memory to VRAM --- vdp.hpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'vdp.hpp') diff --git a/vdp.hpp b/vdp.hpp index 9357377..030b38e 100644 --- a/vdp.hpp +++ b/vdp.hpp @@ -57,8 +57,8 @@ class VDP { kScrollSize = 16, kWindowHorizontalPosition = 17, kWindowVertialPosition = 18, - kDMACounterLow = 19, - kDMACounterHigh = 20, + kDMALengthCounterLow = 19, + kDMALengthCounterHigh = 20, kDMASourceAddressLow = 21, kDMASourceAddressMid = 22, kDMASourceAddressHigh = 23, @@ -69,10 +69,18 @@ class VDP { void writeControl(uint16_t value); uint16_t readData(uint8_t address_mode, uint16_t address); uint16_t readStatusRegister() const; - + uint8_t* baseFromAddressMode(uint8_t address_mode); const char* addressModeToString(uint8_t address_mode); const char* regIDToString(RegID); + static void runDMAMemoryToVRAM( + uint8_t* base, + uint32_t source_address, + uint16_t destination_address, + uint16_t transfer_size); + static void runDMAVRAMFill(uint8_t* base); + static void runDMAVRAMCopy(uint8_t* base); + static constexpr size_t kRegistersCount = static_cast(RegID::kRegistersCount); static constexpr size_t kVRAMSize = 64*1024; static constexpr size_t kCRAMSize = 64*2; -- cgit v1.2.3