diff options
author | Oxore <oxore@protonmail.com> | 2022-10-03 02:05:09 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2022-10-03 02:05:09 +0300 |
commit | b5397045db290c234a1e779b64538933f93b37b6 (patch) | |
tree | 16feb8aabd2f3ae1714e3fbaeea79fc89a6e6c2b /vdp.hpp | |
parent | 872d2c2766536a372af5d1048bed7514078f9d31 (diff) |
Begin implementing DMA: impl memory to VRAM
Diffstat (limited to 'vdp.hpp')
-rw-r--r-- | vdp.hpp | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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<size_t>(RegID::kRegistersCount); static constexpr size_t kVRAMSize = 64*1024; static constexpr size_t kCRAMSize = 64*2; |