aboutsummaryrefslogtreecommitdiff
path: root/src/example/nes.asm
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2016-05-26 11:08:05 +0100
committerIan C <ianc@noddybox.co.uk>2016-05-26 11:08:05 +0100
commit6ae9e74d5b9e8cc69c33b7f707399b69632026d9 (patch)
tree4b9c2e0e393edd1e19fefa84c11c5a319de28d3a /src/example/nes.asm
parent663c4fc9de4d8167cb02e9fdd5e87547437399f6 (diff)
Added extra NES ROM options.
Diffstat (limited to 'src/example/nes.asm')
-rw-r--r--src/example/nes.asm20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/example/nes.asm b/src/example/nes.asm
index 8228914..4598a41 100644
--- a/src/example/nes.asm
+++ b/src/example/nes.asm
@@ -6,6 +6,7 @@
option nes-vector,reset,start
option nes-vector,nmi,nmi
option nes-vector,brk,nmi
+ option nes-mirror,horizontal
vsync: macro
.wait
@@ -15,18 +16,27 @@ vsync: macro
start: org $c000
- sei
+ ; Clear decimal and setup stack
+ ;
cld
ldx #$ff
txs
- ; this sets up the PPU. Apparently.
+ ; Wait for the PPU. Recommended practice is clear the flag, and
+ ; wait for 2 VBL signals
+ ;
+ bit $2002
+ vsync
+ vsync
+
+ ; Setup PPU
+ ;
lda #%00001000
sta $2000
lda #%00011110
sta $2001
- ; Set PPU to palette
+ ; Setup the palette
;
loadpalette:
lda #$3f
@@ -34,8 +44,6 @@ loadpalette:
lda #$00
sta $2006
- ; Load the palette
- ;
ldx #0
.loop lda palette,x
sta $2007
@@ -52,7 +60,7 @@ loadpalette:
load_namemap:
lda #$20
sta $2006
- lda #$20
+ lda #$40
sta $2006
ldx #0