From 9150c891b9b43e69208dc4a70699f94bd771bedb Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Fri, 25 Sep 2020 09:02:06 +0200 Subject: [PATCH] Added DMA test that works! --- src/main/kc/include/mega65-dma.h | 2 -- src/test/kc/examples/mega65/dma-test.c | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kc/include/mega65-dma.h b/src/main/kc/include/mega65-dma.h index ad4f1e9f4..e950dc252 100644 --- a/src/main/kc/include/mega65-dma.h +++ b/src/main/kc/include/mega65-dma.h @@ -7,7 +7,6 @@ // DMAgic VHDL source https://github.com/MEGA65/mega65-core/blob/master/src/vhdl/gs4510.vhdl#L4364 // Xemu emulator source https://github.com/lgblgblgb/xemu/blob/master/xemu/f018_core.c - // Registers of the MEGA65 enchanced F018 DMAgic Controller struct F018_DMAGIC { // $D700 ADDRLSBTRIG DMAgic DMA list address LSB, and trigger DMA (when written). @@ -39,7 +38,6 @@ struct F018_DMAGIC { char MISC; }; - // F018A DMA list entry struct DMA_LIST_F018A { // DMA command diff --git a/src/test/kc/examples/mega65/dma-test.c b/src/test/kc/examples/mega65/dma-test.c index 31dc05b9d..a90a51a49 100644 --- a/src/test/kc/examples/mega65/dma-test.c +++ b/src/test/kc/examples/mega65/dma-test.c @@ -4,6 +4,8 @@ #include void main() { + // Map memory to BANK 0 : 0x00XXXX - giving access to I/O + memoryRemap(0,0,0); // Enable enable F018B mode DMA->EN018B = 1; // Set address of DMA list @@ -12,6 +14,8 @@ void main() { DMA-> ADDRMSB = >&DMA_SCREEN_UP; // Trigger the DMA (without option lists) DMA-> ADDRLSBTRIG = <&DMA_SCREEN_UP; + // Re-enable F018A mode + DMA->EN018B = 0; } // DMA list entry that scrolls the default screen up