Jump to content



codyr783's Photo

codyr783

Member Since 3 Feb 2007
OFFLINE Last Active Feb 20 2012 9:48 PM

Topics I've Started

Random Color Problem

Wed Feb 15, 2012 6:27 PM

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