Atari 2600 style-esq display driver
Baggers
Posts: 3,019
Hi All,
Here's the first draft of my Atari-2600-style display driver, ( with a difference )
It's designed specifically for people to make games, with a LOW memory overhead.
The display is 160x192, the background is either wide bitmap ( 40x192 ) or charmap ( 20x24 ) you can select each scanline to be either bitmap or charmap.
Bitmap data is 8 bytes per scanline, 5 bytes for 40 pixels, one bit per pixel, followed by two bytes for background and foreground colours, and the last byte in the 8 bytes isn't used at the moment, I'm thinking of making this a border colour ( let me know if you want it to be a border colour )
the background is 20*24 words, high byte is palette, and low byte is character number. chars are 8x8 pixels and 16 colours, and are taken from the same charset as the sprites.
Sprites only go over the bitmap background, and each sprite in the sprite drawlist is defined in 4 bytes, Xpos, Ypos, Palette, Charnum
I've also included my grabber for grabbing the sprset.bmp into sprset.chr and sprset.pal
I'll be making a mod in it to generate the wide bitmap data to go straight into the driver as a raw data file
I'll also be making a helper cog, so that you can do sprite collisions with sprites, or background.
Enjoy,
Baggers.
PS, it's only using 1 cog for TV driver, and 3 Cogs for rendering scanlines, it has at the moment 96 8x8 sprites but can easily do 128 or more on a Hybrid, I don't know it's full limit, I've not pushed it, as 96 is more than enough for a game [noparse]:D[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
Here's the first draft of my Atari-2600-style display driver, ( with a difference )
It's designed specifically for people to make games, with a LOW memory overhead.
The display is 160x192, the background is either wide bitmap ( 40x192 ) or charmap ( 20x24 ) you can select each scanline to be either bitmap or charmap.
Bitmap data is 8 bytes per scanline, 5 bytes for 40 pixels, one bit per pixel, followed by two bytes for background and foreground colours, and the last byte in the 8 bytes isn't used at the moment, I'm thinking of making this a border colour ( let me know if you want it to be a border colour )
the background is 20*24 words, high byte is palette, and low byte is character number. chars are 8x8 pixels and 16 colours, and are taken from the same charset as the sprites.
Sprites only go over the bitmap background, and each sprite in the sprite drawlist is defined in 4 bytes, Xpos, Ypos, Palette, Charnum
I've also included my grabber for grabbing the sprset.bmp into sprset.chr and sprset.pal
I'll be making a mod in it to generate the wide bitmap data to go straight into the driver as a raw data file
I'll also be making a helper cog, so that you can do sprite collisions with sprites, or background.
Enjoy,
Baggers.
PS, it's only using 1 cog for TV driver, and 3 Cogs for rendering scanlines, it has at the moment 96 8x8 sprites but can easily do 128 or more on a Hybrid, I don't know it's full limit, I've not pushed it, as 96 is more than enough for a game [noparse]:D[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
zip
31K
Comments
I was able to get the demo going to a point on my 5MHz protoboard and NTSC monitor. Without interlace mode the picture seems to draw every other line. With interlace, the demo is about half the screen ... 16x16 tiles I guess. Other than a flicker every few seconds, it looks fine ... I guess the flicker is because of my slow clock.
Nice demo. Thanks for sharing.
--Steve
I've also tidied up COGS into their setup config areas, and sorted out clk speeds for hydra, and proto/demo boards, and sorted PINS out [noparse]:D[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
Cool. Works great! [noparse]:)[/noparse]
This prop thing, is versitile!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Thanks for writing it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
I've been thinking that with the addition of some text scroller routines and a sprite routine,
we could glue this onto Femto for a little BASIC gaming action. Very temping..
(My Propeller project list is piling up!)
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Yeah would be good to get some basic going with it, maybe if Bean's basic is open, then we could mod that, as basic to PASM is gonna be mega fast and sweet!, I'm looking forward to his basic compiler [noparse]:)[/noparse]
Jim.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Where's the block of code that sets up the background? In the dat section?
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
In the dat, you will find 192 numbered longs. That IS the background. Just edit the ones and zeros to make pixels appear or not, and the first byte after that is the 0 color, the second byte is the 1 color, and the last byte is unused.
00 bytes mean the text display is used, and that's defined a bit farther down.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Just an extra mod to the bmp8tolite app [noparse]:)[/noparse]
I've included a bmp, to show you a 160x128 image layout, that when grabbed by
bmp8tolite scr1 -2600
will grab the screen ( grabbing one·pixel then skipping 3 pixels and repeating so that it grabs 40 pixels per line, it will convert colours ( my old rgb way, next week I'll convert it to use Hue and luminance to convert the palette. ) first pixel colour of every row, is considered background colour ( 0 ) and any colour different to that will register as a ( 1 ) and the last different colour it finds on that line becomes the foreground colour.
if you use an image 160x192 then it'll be the full display, and you can then just replace the screen data with·(for example )·FILE "scr1.VCS"
I will however ( next week ) put in an ( if first pixel is certain purple colour·then use text display·so you don't have to manually alter the vcs file )
enjoy.
the screen can be pretty much any Y height, but X size has to be divisible by 40. it will take screensize/40 as pixel step.
edit: done it already, use this new file use purple 255,0,255 for use text display.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
Post Edited (Baggers) : 10/19/2009 8:17:26 PM GMT
I had been trying to create the screen manually by trial-and-error (with emphasis on the 'error')
Only *after* I had been working on a great tile-based screen did I figure out that you had to draw the backdrop 'Atari-style,' as you can't have sprites overlay text [noparse]:([/noparse] In retrospect, I should have known better (2600's didn't work that way). [noparse][[/noparse]Edit:] Would be a 'nice to have,' but likely is another driver altogher.
Completely missed that part the first time around Would have saved me hours of tinkering.
Post Edited (trodoss) : 10/20/2009 3:26:17 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
I think I might need to 'scale down' what I planned on using it for. Maybe something like Joust?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!