codyr783 Posted February 16, 2012 Share Posted February 16, 2012 (edited) I'm trying to set the color to green, but instead I get a random color every time I play the .bin. I want to use Color_Grass as the color. This is my first go at this so help would be appreciated. processor 6502 include "vcs.h" include "macro.h" SEG ORG $F000 Color_Grass = #$D5 Reset StartOfFrame ;vertical blank processing lda #0 sta VBLANK lda #2 sta VSYNC sta WSYNC ;VSYNCH sta WSYNC sta WSYNC lda #0 sta VSYNC ;VBLANK REPEAT 37 sta WSYNC REPEND Picture: ldx #$05 REPEAT 170 stx COLUBK sta WSYNC REPEND ldx Color_Grass REPEAT 22 stx COLUBK sta WSYNC REPEND lda #%01000010 sta VBLANK ; end of screen - enter blanking REPEAT 30 ;overscan(30) sta WSYNC REPEND jmp StartOfFrame ;TitleScreen lda #0 ORG $FFFA .word Reset ; NMI .word Reset ; RESET .word Reset ; IRQ END Edited February 16, 2012 by codyr783 Quote Link to comment Share on other sites More sharing options...
RevEng Posted February 16, 2012 Share Posted February 16, 2012 short story: you're using memory location $D5 for the grass color, not the value $D5. "Color_Grass = #$D5" doesn't cause a substitution of "#$D5" for every occurance of "Color_Grass". It literally puts the value $D5 into Color_Grass. The # is ignored. To do what you want, lose the hash when you set Color_Grass and then add a hash when you actually use it, like " ldx #Color_Grass" Quote Link to comment Share on other sites More sharing options...
codyr783 Posted February 16, 2012 Author Share Posted February 16, 2012 Okay, I understand now. I appreciate the help. Quote Link to comment Share on other sites More sharing options...
RevEng Posted February 16, 2012 Share Posted February 16, 2012 Not a problem! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.