summaryrefslogtreecommitdiff
path: root/macros.inc
diff options
context:
space:
mode:
Diffstat (limited to 'macros.inc')
-rw-r--r--macros.inc24
1 files changed, 24 insertions, 0 deletions
diff --git a/macros.inc b/macros.inc
new file mode 100644
index 0000000..78bbfad
--- /dev/null
+++ b/macros.inc
@@ -0,0 +1,24 @@
+DMA: macro mode,source,dest,len
+
+ pha
+
+ lda #@mode
+ sta DMAP0
+ lda #@dest
+ sta BBAD0
+ lda #@source & $ff
+ sta A1T0L
+ lda #{@source >> 8} & $ff
+ sta A1T0H
+ lda #{@source >> 16} & $ff
+ sta A1B0
+ lda #@len & $ff
+ sta DAS0L
+ lda #{@len >> 8} & $ff
+ sta DAS0H
+ lda #1
+ sta MDMAEN
+
+ pla
+
+ endm