aboutsummaryrefslogtreecommitdiff
path: root/scroll/include/ppu.s
diff options
context:
space:
mode:
Diffstat (limited to 'scroll/include/ppu.s')
-rw-r--r--scroll/include/ppu.s12
1 files changed, 12 insertions, 0 deletions
diff --git a/scroll/include/ppu.s b/scroll/include/ppu.s
index 34410a0..f62d702 100644
--- a/scroll/include/ppu.s
+++ b/scroll/include/ppu.s
@@ -1,3 +1,15 @@
+;; WRITE_PPU_DATA is a macro that will write into PPUADDR the given address and
+;; into PPUDATA the given byte value.
+.macro WRITE_PPU_DATA address, value
+ bit $2002
+ lda #.HIBYTE(address)
+ sta $2006
+ lda #.LOBYTE(address)
+ sta $2006
+ lda #value
+ sta $2007
+.endmacro
+
.scope PPU
CONTROL = $2000
MASK = $2001