diff options
author | Ian C <ianc@noddybox.co.uk> | 2016-06-06 20:58:33 +0100 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2016-06-06 20:58:33 +0100 |
commit | 66149104ae056b372b2bf4672704d3b62db412f3 (patch) | |
tree | ebc7e72335fd0510f87a995853072f24f10da218 /src/example/nes.asm | |
parent | 64286bce86befc5b48a65c60d871dca8ef269257 (diff) | |
parent | 6ae9e74d5b9e8cc69c33b7f707399b69632026d9 (diff) |
Merge branch 'master' of https://github.com/noddybox/casm
Diffstat (limited to 'src/example/nes.asm')
-rw-r--r-- | src/example/nes.asm | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/example/nes.asm b/src/example/nes.asm index 95f3a64..476df60 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 |