HHays
09-11-2007, 10:22 PM
I have spent way longer on this than I'm willing to admit. I am attempting to display a tile - 16x16, 32x32 - whatever, using one of Chip's VGA objects. In general, Chip's objects inbed the base address of the bitmap in either the upper 10 bits, or the lower 10 bits (depending on the object) of a long-aligned word. The remaining 6 bits are used to specify a palette.
I have downloaded every VGA related object, lurked for 2 weeks, and studied, but I cannot seem to accomplish this. There are no examples of displaying a tile in VGA in any code that I can find. The closest thing is in a couple of Chip's demo's, the propeller hat (32x32) is displayed, but that is a cursor and doesn't apply here. I have shifted bits left, tried different ways of addressing the tile, etc.
Here is an example of my question. The code below is a snippet of Chip's 1024x768 demo, with some extraneous code removed. Let's say I wish to display the "propeller hat" in the DAT section. Without boring you folks with the many things I have tried, could someone please replace the question marks with the correct line(s) of code? I realize this is elementary, for some reason, I'm having a tough time of it.
I would of asked for help sooner, but deSilva scares me :[
Thanks!
CON
cols = 64
rows = 48
tiles = cols * rows
VAR
long col, row, color
long array[tiles/2]
OBJ
vga : "vga_1024x768_Driver"
PUB start | t, s
vga.start(16, @array, @vgacolors, 0, 0, 0)
?????????????????????????????????
DAT
propeller long
long %00000000_00000000_00000000_00000000
long %01111110_00000000_00000011_11111000
long %11111111_11110001_10111111_11111110
long %11111111_11111111_11111111_11111111
long %01111111_11111101_10001111_11111111
long %00011111_11000001_10000000_01111110
long %00000000_00000011_11000000_00000000
long %00000000_00000011_11000000_00000000
long %00000000_00000001_10000000_00000000
long %00000000_00001111_11110000_00000000
long %00000000_01111001_10011110_00000000
long %00000001_11110011_11001111_10000000
long %00000011_11100011_11000111_11000000
long %00000111_11000111_11100011_11100000
long %00001111_10000111_11100001_11110000
long %00011111_10000111_11100001_11111000
long %00011111_00000111_11100000_11111000
long %00111111_00001111_11110000_11111100
long %00111110_00001111_11110000_01111100
long %00111110_00001111_11110000_01111100
long %01111110_00001111_11110000_01111110
long %01111100_00001111_11110000_00111110
long %01111100_00011111_11111000_00111110
long %01111111_11111111_11111111_11111110
long %01111111_11110000_00001111_11111110
long %01111000_00000000_00000000_00011110
long %01100000_00000000_00000000_00000110
long %00111100_00000000_00000000_00111100
long %00001111_11110000_00001111_11110000
long %00000011_11111111_11111111_11000000
long %00000000_00011111_11111000_00000000
long %00000000_00000000_00000000_00000000
Post Edited (HHays) : 9/11/2007 8:56:34 PM GMT
I have downloaded every VGA related object, lurked for 2 weeks, and studied, but I cannot seem to accomplish this. There are no examples of displaying a tile in VGA in any code that I can find. The closest thing is in a couple of Chip's demo's, the propeller hat (32x32) is displayed, but that is a cursor and doesn't apply here. I have shifted bits left, tried different ways of addressing the tile, etc.
Here is an example of my question. The code below is a snippet of Chip's 1024x768 demo, with some extraneous code removed. Let's say I wish to display the "propeller hat" in the DAT section. Without boring you folks with the many things I have tried, could someone please replace the question marks with the correct line(s) of code? I realize this is elementary, for some reason, I'm having a tough time of it.
I would of asked for help sooner, but deSilva scares me :[
Thanks!
CON
cols = 64
rows = 48
tiles = cols * rows
VAR
long col, row, color
long array[tiles/2]
OBJ
vga : "vga_1024x768_Driver"
PUB start | t, s
vga.start(16, @array, @vgacolors, 0, 0, 0)
?????????????????????????????????
DAT
propeller long
long %00000000_00000000_00000000_00000000
long %01111110_00000000_00000011_11111000
long %11111111_11110001_10111111_11111110
long %11111111_11111111_11111111_11111111
long %01111111_11111101_10001111_11111111
long %00011111_11000001_10000000_01111110
long %00000000_00000011_11000000_00000000
long %00000000_00000011_11000000_00000000
long %00000000_00000001_10000000_00000000
long %00000000_00001111_11110000_00000000
long %00000000_01111001_10011110_00000000
long %00000001_11110011_11001111_10000000
long %00000011_11100011_11000111_11000000
long %00000111_11000111_11100011_11100000
long %00001111_10000111_11100001_11110000
long %00011111_10000111_11100001_11111000
long %00011111_00000111_11100000_11111000
long %00111111_00001111_11110000_11111100
long %00111110_00001111_11110000_01111100
long %00111110_00001111_11110000_01111100
long %01111110_00001111_11110000_01111110
long %01111100_00001111_11110000_00111110
long %01111100_00011111_11111000_00111110
long %01111111_11111111_11111111_11111110
long %01111111_11110000_00001111_11111110
long %01111000_00000000_00000000_00011110
long %01100000_00000000_00000000_00000110
long %00111100_00000000_00000000_00111100
long %00001111_11110000_00001111_11110000
long %00000011_11111111_11111111_11000000
long %00000000_00011111_11111000_00000000
long %00000000_00000000_00000000_00000000
Post Edited (HHays) : 9/11/2007 8:56:34 PM GMT