Difference between revisions of "Palette"

From veswiki
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 
To change the background color two columns of the VRAM is used to set the background for each row.  
 
To change the background color two columns of the VRAM is used to set the background for each row.  
  
You need to set column 125 and 126, that's along the red vertical lines on the right side in the [http://www.bingbangboom.us/productions/veswiki/images/1/1b/Videocart5fullscreen.png full VRAM screenshot] when using plot and blir routines from this wiki you'll use columns 121 and 122 as the upper right visible corner of the game area in MESS are relocated to coordinates 0,0 instead of 4,4.
+
You need to set column 125 and 126, that's along the red vertical lines on the right side in the [http://www.bingbangboom.us/productions/veswiki/images/1/1b/Videocart5fullscreen.png full VRAM screenshot] when using plot and blit routines from this wiki you'll use "columns" 121 and 122 as the upper right visible corner of the game area in MESS are relocated to coordinates 0,0 instead of 4,4.
  
 
The palette can be set using the [[Snippet:Blit|BlitGraphic]] routine, just define a tall box 2x58 pixels at coordinates (121,0). Then you set the color for each row using two bits, one byte sets four rows.<br>
 
The palette can be set using the [[Snippet:Blit|BlitGraphic]] routine, just define a tall box 2x58 pixels at coordinates (121,0). Then you set the color for each row using two bits, one byte sets four rows.<br>

Revision as of 10:12, 29 May 2014

To change the background color two columns of the VRAM is used to set the background for each row.

You need to set column 125 and 126, that's along the red vertical lines on the right side in the full VRAM screenshot when using plot and blit routines from this wiki you'll use "columns" 121 and 122 as the upper right visible corner of the game area in MESS are relocated to coordinates 0,0 instead of 4,4.

The palette can be set using the BlitGraphic routine, just define a tall box 2x58 pixels at coordinates (121,0). Then you set the color for each row using two bits, one byte sets four rows.
To set the total visible area (in MESS) of 102x58 you need 14,5 bytes, just pad it up to an even 15 bytes with zeroes.

If you cut and paste this data, you can just change the ones and zeroes in the end to change palette.

	; palette

gfx.palette.parameters:
	.byte	clear			; color 1
	.byte	green			; color 2
	.byte	121			; x position
	.byte	0			; y position
	.byte	2			; width
	.byte	58			; height
	.word	gfx.palette.data	; address for the graphics

gfx.palette.data:
		.byte	%10101010, %10101010, %00100010, %00100010, %00100010, %00100010, %00100010
		.byte	%00100010, %00001000, %10100001, %00010001, %00010001, %00010001, %00010001
		.byte	%00010000

The background colors are coded like this:

00 black
01 lt. grey
10 lt. blue
11 lt. green