Taking Suggestions for new graphics driver.
Kye
Posts: 2,200
Hey guys, I've been working on an update to my last·VGA graphics driver.
(You can find it here, http://forums.parallax.com/showthread.php?p=780597)
So far I re-wrote the whole engine and all the code. The new driver is a·BEAST compared to the other one. I'll already gotten it to work on every other monitor I've tried so far and it allows for alot more features than my last one. The driver is a tile driver also.
So, in the public interface I have:
Scrolling Portions of the screen up - as in you can select any rectangular (or square) portion of the screen and scroll its contents up any number of lines with any background color to be scrolled in.
Scrolling Portions of the screen·down - as in you can select any rectangular (or square) portion of the screen and scroll its contents·down any number of lines with any background color to be scrolled in.
Displaying 2D boxes of any color of your choice (64 different choices).
Displaying 3D boxes (the beveled ones)·of any color of your choice (7 different choices).
Displaying 4D boxes (the beveled and ticker-taped ones)·of any color of your choice (7 different choices).
Displaying strings that will wrap arround the screen. (Propeller font)
Displaying characters on screen. (Propeller font).
Displaying custom 16x16 tiles using any 4 byte color you want (This allows for·ANY custom·image or whatever to be displayed!).
Selecting forground and background colors for any tile·using a F-RGB B-RGB selection.
Now, the·driver supports 4 colors per tile (all tiles are built·out of a·16 longs). It pretty much pushes the propeller chip to its max using·ONE Processor. The display area is 512x480·pixles or 32x30 tiles.·I wasn't trying to build a multi-processor driver here so the display area is capped to what just one processor was able to do.
Anyway,·the driver will also support a mouse cusor overlay using a seperate display buffer, the second display·buffer will allow sprites to be drawn on the screen. However, due to the lack of memory I plan to only expand the buffers size to·fit a small mouse cusor.
So, what else should I add to the public interface? I'm not sure what other useful features would be needed for a tile driver.
I've made one odd feature already called marque which scrolls characters from right to left across the screen. It allows an arbitary number of strings to be scrolled across the screen at the same time seamlessy.
That said, are there any other cool features that would be usefull for a tile driver that come to mind?
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 3/15/2009 9:02:29 PM GMT
(You can find it here, http://forums.parallax.com/showthread.php?p=780597)
So far I re-wrote the whole engine and all the code. The new driver is a·BEAST compared to the other one. I'll already gotten it to work on every other monitor I've tried so far and it allows for alot more features than my last one. The driver is a tile driver also.
So, in the public interface I have:
Scrolling Portions of the screen up - as in you can select any rectangular (or square) portion of the screen and scroll its contents up any number of lines with any background color to be scrolled in.
Scrolling Portions of the screen·down - as in you can select any rectangular (or square) portion of the screen and scroll its contents·down any number of lines with any background color to be scrolled in.
Displaying 2D boxes of any color of your choice (64 different choices).
Displaying 3D boxes (the beveled ones)·of any color of your choice (7 different choices).
Displaying 4D boxes (the beveled and ticker-taped ones)·of any color of your choice (7 different choices).
Displaying strings that will wrap arround the screen. (Propeller font)
Displaying characters on screen. (Propeller font).
Displaying custom 16x16 tiles using any 4 byte color you want (This allows for·ANY custom·image or whatever to be displayed!).
Selecting forground and background colors for any tile·using a F-RGB B-RGB selection.
Now, the·driver supports 4 colors per tile (all tiles are built·out of a·16 longs). It pretty much pushes the propeller chip to its max using·ONE Processor. The display area is 512x480·pixles or 32x30 tiles.·I wasn't trying to build a multi-processor driver here so the display area is capped to what just one processor was able to do.
Anyway,·the driver will also support a mouse cusor overlay using a seperate display buffer, the second display·buffer will allow sprites to be drawn on the screen. However, due to the lack of memory I plan to only expand the buffers size to·fit a small mouse cusor.
So, what else should I add to the public interface? I'm not sure what other useful features would be needed for a tile driver.
I've made one odd feature already called marque which scrolls characters from right to left across the screen. It allows an arbitary number of strings to be scrolled across the screen at the same time seamlessy.
That said, are there any other cool features that would be usefull for a tile driver that come to mind?
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 3/15/2009 9:02:29 PM GMT
Comments
I haven't had a chance to run your driver yet. I look forward to trying it soon. You mention different choices for button styles etc and it would be great to see some photos of the various options.
One question I have about graphics bitmaps - can they be scrolled? If so which directions, and is it reasonably quick? (ie just updating the starting address offset, not actually rotating memory obviously) ?
Thanks for your efforts on all these drivers.
regards
tubular
You will need all three files.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
First VGA driver that runs on my monitor with
_clkmode = xtal1 + pll8x
_xinfreq = 14_318_180 ' 5_000_000
And no modifications to timings
44.7KHz / 86Hz
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Prop Tools under Development or Completed (Index)
· Emulators (Micros eg Altair, and Terminals eg VT100) - index
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Well, I guess then that I'll leave it at that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Have you done the mouse-cursor release ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontroled.
Unfortunately, I won't be releasing it to the public since my partner for the project I am working on has insisted that I do not do so.
However, don't worry, the driver is built for a commercial educational platform for students and hobbyist designed on the propeller chip. That will be released in the future, but not right now. All features of the driver will be aviable to use in a different format...
Anyway, thanks for asking about this project and·I'll be posting more details about what the platform is·I'm taking about in the near future. For now, if you want to mess with the current driver go right on ahead.
... And Just for teasers because I can't resist.... ·... Here's the API
The driver runs at (640·x 480) now and has a print cusor (like in·a shell interface or like in·dos) and a mouse cusor.
I am really happy with how this code turned out because I was able to get everything I wanted working (used every register in the processor and almost every clock cycle.) If you check arround in the forums you'll find some posts about my first version of this driver and how I was working on it. I really need to say thank you also to Chip for all the help he provided - I wouldn't have managed to get everything working without his aid (his code was really useful).
[code]
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Video Engine │
│ │
│ Author: Kwabena W. Agyeman │
│ Updated: 5/28/2009 │
│ Designed For: P8X32A │
│ │
│ Copyright (c) 2009 Kwabena W. Agyeman │
│ See end of file for terms of use. │
│ │
│ Driver Info: │
│ │
│ The video engine runs a VGA driver in the next free cog on the propeller chip when called. │
│ │
│ The driver, is only guaranteed and tested to work at an 80Mhz system clock or higher. The driver is designed for the P8X32A │
│ so port B will not be operational. │
│ │
│ Nyamekye, │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Object "videoEngine" Interface:
PUB displayColors(foregroundRed, foregroundGreen, foregroundBlue, backgroundRed, backgroundGreen, backgroundBlue)
PUB displayBoxColors(state, red, green, blue)
PUB displayBlink(rate)
PUB printCharacters(characters, colors)
PUB printCharacter(character, colors)
PUB printSettings(color, startRow, startColumn, endRow, endColumn)
PUB scrollCharacters(characters, character, colors, row, startColumn, endColumn)
PUB scrollUp(lines, color, startRow, startColumn, endRow, endColumn)
PUB scrollDown(lines, color, startRow, startColumn, endRow, endColumn)
PUB display3DBox(colors, startRow, startColumn, endRow, endColumn)
PUB display3DFrame(colors, startRow, startColumn, endRow, endColumn)
PUB display2DBox(color, startRow, startColumn, endRow, endColumn)
PUB display2DFrame(color, startRow, startColumn, endRow, endColumn)
PUB displayCharacters(characters, colors, row, column)
PUB displayCharacter(character, colors, row, column)
PUB displayTile(address, colors, row, column)
PUB getMouseCursorRow
PUB getMouseCursorColumn
PUB getMouseCursorPointer
PUB getLumaBufferAddress(row, column)
PUB getChromaBufferColors(row, column)
PUB changePrintCursorSettings(rate, color)
PUB changeMouseCursorSettings(address, color)
PUB changeDisplaySettings(state)
PUB returnChromaBufferAddress
PUB returnLumaBufferAddress
PUB videoEngine(mouseXPositionAddress, mouseYPositionAddress)
Program: 760 Longs
Variable: 1,870 Longs
0 1 2 3 Pin Group
240
Pin 0, 8, 16, 24 ──── Vertical Sync
240
Pin 1, 9, 17, 25 ──── Horizontal Sync
470
Pin 2, 10, 18, 26 ──┳─ Blue Video
240│
Pin 3, 11, 19, 27 ──┘
470
Pin 4, 12, 20, 28 ──┳─ Green Video
240│
Pin 5, 13, 21, 29 ──┘
470
Pin 6, 14, 22, 30 ──┳─ Red Video
240│
Pin 7, 15, 23, 31 ──┘
5V
└─ 5V
┌─ Vertical Sync Ground
┌─ Hoirzontal Sync Ground
┌─ Blue Return
┌─ Green Return
┌─ Red Return
__________________________________________________________________________________________________________________
PUB displayColors(foregroundRed, foregroundGreen, foregroundBlue, backgroundRed, backgroundGreen, backgroundBlue)
14 Stack Longs
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Returns the properly formated non box color word using the selected values. │
│ │
│ Non box colors should be in the format of: │
│ │
│ %RR_GG_BB_xx_RR_GG_BB_xx Where R is red, G is green, and B is blue. x is ignored. A single word can hold a color. │
│ │
│ The upper RGB color is the foreground color. The lower RGB color is the background color. │
│ │
│ ForegroundRed - Brightness of foreground red .. (0 - 3). │
│ ForegroundGreen - Brightness of foreground green .. (0 - 3). │
│ ForegroundBlue - Brightness of foreground blue .. (0 - 3). │
│ BackgroundRed - Brightness of background red .. (0 - 3). │
│ BackgroundGreen - Brightness of background green .. (0 - 3). │
│ BackgroundBlue - Brightness of background blue .. (0 - 3). │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
______________________________________________
PUB displayBoxColors(state, red, green, blue)
7 Stack Longs
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Returns the properly formated box color long using the selected values. │
│ │
│ Box colors should be in the format of: │
│ │
│ $TL_BR_S_C │
│ │
│ Where TL is %RR_GG_BB_xx color byte for the top and left box sides. │
│ │
│ Where BR is %RR_GG_BB_xx color byte for the bottom and right box sides. │
│ │
│ Where S is %RR_GG_BB_xx color byte for the special box parts. │
│ │
│ Where C is %RR_GG_BB_xx color byte for the center of the box. │
│ │
│ %RR_GG_BB_xx Where R is red, G is green, and B is blue. x is ignored. │
│ │
│ State - Bevel the box up if state and down if not state. │
│ Red - Input red into box colors, yes or no. │
│ Green - Input green into box colors, yes or no. │
│ Blue - Input blue into box colors, yes or no. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
_______________________
PUB displayBlink(rate)
4 Stack Longs
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Switches the return value back and forth between true and false depending on the elasped time. │
│ │
│ Returns true or false depending on the time elasped. │
│ │
│ Rate - 3 for fast blink rate .. 2 for medium blink rate .. 1 for slow blink rate .. 0 for off (returns false always). │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
________________________________________
PUB printCharacters(characters, colors)
28 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Prints characters to the screen inside of the print box defined by print settings. │
│ │
│ Characters - A pointer to a string of characters to be printed. │
│ Colors - Foreground and background colors to use. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
______________________________________
PUB printCharacter(character, colors)
23 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Prints a character to the screen inside of the print box defined by print settings. │
│ │
│ 0 - Move the cursor left. │
│ 1 - Move the cursor right. │
│ 8 - Backspace - move the cursor back one space and delete the character underneath it. │
│ 9 - Tab - move the cursor right a number of spaces. │
│ 10 - Linefeed - move the cursor down. │
│ 11 - Vertical Tab - move the cursor up. │
│ 12 - Formfeed - move the cursor back to the origin defined in print settings and clear the screen. │
│ 13 - Carriage Return - move the cursor back to the start of the line. │
│ Other - Print the character on screen and move the cursor to the right one space. │
│ │
│ Character - Character to be printed. │
│ Colors - Foreground and background colors to use. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
___________________________________________________________________
PUB printSettings(color, startRow, startColumn, endRow, endColumn)
31 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Changes the print box size and position. The box hieght will be forced to be even. │
│ │
│ Color - Color to clear the slected area with. │
│ StartRow - Row to start the print box at. │
│ StartColumn - Column to start the print box at. │
│ EndRow - Row to end at - must be under startRow. │
│ EndColumn - Column to end at. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
_________________________________________________________________________________
PUB scrollCharacters(characters, character, colors, row, startColumn, endColumn)
26 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Scrolls the characters from right to left across the specified area. Scrolls in blank space when out of characters. │
│ │
│ Characters - A pointer to the string of characters to be displayed. │
│ Character - The index of the character to be displayed in the characters string when called. │
│ Colors - Foreground and background colors to use. │
│ Row - Row to scroll characters on, row 29 is not a valid row. │
│ StartColumn - Column to scroll characters to. │
│ EndColumn - Column to scroll characters from. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
_____________________________________________________________________
PUB scrollUp(lines, color, startRow, startColumn, endRow, endColumn)
13 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Scrolls the contents of whatever is in the specified area up and scrolls in blank space of the selected color. │
│ │
│ Lines - Number of rows to scroll up. │
│ Color - Background color to scroll in. │
│ StartRow - Row to scroll to. │
│ StartColumn - Column to start scrolling at. │
│ EndRow - Row to scroll from - must be under startRow. │
│ EndColumn - Column to end scrolling at. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
_______________________________________________________________________
PUB scrollDown(lines, color, startRow, startColumn, endRow, endColumn)
13 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Scrolls the contents of whatever is in the specified area down and scrolls in blank space of the selected color. │
│ │
│ Lines - Number of rows to scroll down. │
│ Color - Background color to scroll in. │
│ StartRow - Row to scroll from. │
│ StartColumn - Column to start scrolling at. │
│ EndRow - Row to scroll to - must be under startRow. │
│ EndColumn - Column to end scrolling at. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
___________________________________________________________________
PUB display3DBox(colors, startRow, startColumn, endRow, endColumn)
27 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Displays a 3D box starting at the specified row on the specified column with specified width and height. │
│ │
│ Colors - Box colors to use. │
│ StartRow - Row to start drawing at. │
│ StartColumn - Column to start at. │
│ EndRow - Row to end at - must be under startRow. │
│ EndColumn - Column to end at - must be to the right of startColumn. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
_____________________________________________________________________
PUB display3DFrame(colors, startRow, startColumn, endRow, endColumn)
19 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Displays a 3D frame starting at the specified row on the specified column with specified width and height. │
│ │
│ Colors - Box colors to use. │
│ StartRow - Row to start drawing at. │
│ StartColumn - Column to start at. │
│ EndRow - Row to end at - must be under startRow. │
│ EndColumn - Column to end at - must be to the right of startColumn. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
__________________________________________________________________
PUB display2DBox(color, startRow, startColumn, endRow, endColumn)
12 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Displays a 2D box starting at the specified row on the specified column with specified width and hieght. │
│ │
│ Color - Box color to use. │
│ StartRow - Row to start drawing at. │
│ StartColumn - Column to start at. │
│ EndRow - Row to end at. │
│ EndColumn - Column to end at. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
____________________________________________________________________
PUB display2DFrame(color, startRow, startColumn, endRow, endColumn)
12 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Displays a 2D frame starting at the specified row on the specified column with specified width and height. │
│ │
│ Color - Box color to use. │
│ StartRow - Row to start drawing at. │
│ StartColumn - Column to start at. │
│ EndRow - Row to end at. │
│ EndColumn - Column to end at. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
_______________________________________________________
PUB displayCharacters(characters, colors, row, column)
25 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Displays a string of characters starting at the specified column on the specified row. The displayed string of │
│ characters ends when it goes off screen. Will not display box characters. Characters require a tile below them. │
│ │
│ Characters - A pointer to the string of characters to be displayed. │
│ Colors - Foreground and background colors to use. │
│ Row - Row to start displaying characters on, row 29 is not a valid row. │
│ Column - Column to start displaying characters on. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
_____________________________________________________
PUB displayCharacter(character, colors, row, column)
18 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Displays a character at the specified column on the specified row. Will not display box characters. Characters require a │
│ tile below them. │
│ │
│ Character - Character to display. │
│ Colors - Foreground and background colors to use. │
│ Row - Row to display the character on, row 29 is not a valid row. │
│ Column - Column to display the character on. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
______________________________________________
PUB displayTile(address, colors, row, column)
11 Stack Longs - Ignore Return Value
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Displays a four colored tile at the specified column on the specified row. │
│ │
│ A tile should be formated in this way: │
│ │
│ address long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ long %%0123012301230123 │
│ │
│ The tile image should be reversed to display properly. │
│ │
│ The address of the first long is the address of the tile. │
│ │
│ Each tile has has 16 longs and each long has 16 pixels. Each pixel should have a value of 0 - 3. │
│ │
│ Each pixel maps to one of the four color bytes (%RR_GG_BB_xx) in a color long │
│ (%RR_GG_BB_xx_RR_GG_BB_xx_RR_GG_BB_xx_RR_GG_BB_xx). 0 maps to the lowest byte... 3 maps to the highest byte... etc. │
│ │
│ Address - A pointer to a tile. │
│ Colors - A color long describing that tile. │
│ Row - Row to display the on. │
│ Column - Column to display the on. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
______________________
PUB getMouseCursorRow
3 Stack Longs
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Returns the current mouse cursor row. │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
_________________________
PUB getMouseCursorColumn
3 Stack Longs
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Returns the current mouse cursor column. │
└──────────────────────────────────────────────────────────────&#