Converting bmp files withe/black to propeller?
lcyepiz
Posts: 26
I trying to make a program c++ to convert bmp files to propeller format VGA 1024x768 Tile Driver
this is a 64x48 array of 16X16pixel 4 color
I draw a bmp file with paint of windows, i set atributes to 48X64 in pixel for a draw of 3X4blocks properties in black/white
from bmp format info, i get the data from 0x3E to 0x23D so hay have 384 bytes of ones and zeros (i don get align bytes)
The 384 bytes convert to 768 by duplicate info to (interleaved format)
The program generate 384x2=768bytes (interleaved format),
but this dont work
how is the format of t VGA 1024x768 Tile Driver?
The file dibuja.exe, get a bmp file 48x64 pixel and convert to dibujo.dat for propeller with VGA 1024x768 Tile Driver
can you help:
how arrange the bits of bmp to propeller format?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Juramento YAQUI.
Para ti no habr
this is a 64x48 array of 16X16pixel 4 color
I draw a bmp file with paint of windows, i set atributes to 48X64 in pixel for a draw of 3X4blocks properties in black/white
from bmp format info, i get the data from 0x3E to 0x23D so hay have 384 bytes of ones and zeros (i don get align bytes)
The 384 bytes convert to 768 by duplicate info to (interleaved format)
The program generate 384x2=768bytes (interleaved format),
but this dont work
how is the format of t VGA 1024x768 Tile Driver?
The file dibuja.exe, get a bmp file 48x64 pixel and convert to dibujo.dat for propeller with VGA 1024x768 Tile Driver
can you help:
how arrange the bits of bmp to propeller format?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Juramento YAQUI.
Para ti no habr
exe
566K
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quicker answers in the #propeller chat channel on freenode.net. Don't know squat about IRC? Download Pigin! So easy a caveman could do it...
http://folding.stanford.edu/ - Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Apps:· http://www.rayslogic.com/propeller/Programming/Programming.htm
My Prop Info: ·http://www.rayslogic.com/propeller/propeller.htm
My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
On the thread: http://forums.parallax.com/showthread.php?p=833043·there are several font-oriented graphics utilities (in C#) that you might be able to mod as well.
--trodoss
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the Propeller Powered SIG·fourm kindly hosted at Savage Circuits
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
There are color palettes. They consist of one long, each byte representing the propeller color assigned to the logical colors, 00, 01, 10, 11. Least significant byte = color 00. You can get the color values for most of the good colors by running graphics_palette.spin. I think that's TV only, but you can work that out. Others probably have color tables.
There are about 89 propeller colors, without pushing things. I think there are less on VGA, perhaps 64. In any case, the propeller color definition is 8 bits, 4 colors per long. I do not run VGA much.
There are up to 64 of these palettes available for use in tiles. They are located somewhere in the HUB memory, as a sequential block of 64 longs, commonly referred to as "colors" It is rare these are all used.
There are tiles.
A tile is 16 pixels wide, and either 16 or 32 pixels tall. In this driver, they are 32 pixels tall to match the font found in the Propeller ROM. Tiles are one long wide, up to 32 longs tall.
A tile may be assigned 4 colors by palette entry above.
The screen is a series of addresses and color definition words. The upper 6 bits of a screen word is an index into the color palette array, thus assigning the color to the tile. The lower 10 bits form the 64 byte aligned tile address.
Each tile in the screen may be pointed to any location in the Propeller 16 bit address space, so long as it is 64 byte aligned. Text comes from the ROM, with graphics generally being a sequential series of tiles that run from upper left, vertically down, filling to end at the lower right of the screen. Text in ROM starts at $8000, and color selection is used to draw one of two possible characters for the 256 entries found there. It's handy to define two color palettes for this purpose, one even and one odd. Color defs are: XX_XX_02_02 and XX_02_XX_02, where 02 is just black, and XX is a matching color to display that character.
There isn't enough HUB memory in the Propeller to assign all the tiles to graphics.
Doing a 48x64 should be pretty easy. The following things need to happen:
You need to establish the 6 color palettes, one for each tile and place them in the color array, with the others present for that driver. Or, if the image has less colors, just assign one, if you want to for a 4 color image. Because of the tile limitation, your image cannot contain more than 6x4 colors.
You need to put the image somewhere in the HUB memory, 64 byte aligned, because of how the tile addresses are only 10 bits.
You need to start the driver (duh!)
Finally, you need to set the addresses of 6 of the tiles to display the graphical image.
There will be 3 tiles horizontally, and 2 tiles vertically. Because that driver uses the 32 pixel tile, each tile is 128 bytes.
Say the image is located at $5000
Tile addresses would be:
0,0 = $5000 1,0=$5100 2,0 = $5200
0,1 = $5080 1,1=$5180 3,1 = $5280
The tile address format is ccccccAAAAAAAAAA c = color bits, A = address bits, which is just the actual address, shifted right 6 bits.
Combine color and address into the tile word, and write it to the screen array associated with the tile you want to be displaying it's part of your image.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Wondering how to set tile colors in the graphics_demo.spin?
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 7/7/2010 1:54:46 AM GMT