Shop OBEX P1 Docs P2 Docs Learn Events
Atari 2600 style-esq display driver — Parallax Forums

Atari 2600 style-esq display driver

BaggersBaggers Posts: 3,019
edited 2009-10-20 03:43 in Propeller 1
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]


2600_Driver.JPG

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

Comments

  • jazzedjazzed Posts: 11,803
    edited 2009-10-17 18:49
    Nice picture. Slight reflection in there [noparse]:)[/noparse]

    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
  • BaggersBaggers Posts: 3,019
    edited 2009-10-17 19:28
    Hi Jazzed, can you change COGS to 4, that should make it look fine!, not enough oomph, me thinks!
    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
  • jazzedjazzed Posts: 11,803
    edited 2009-10-17 19:44
    Baggers said...
    Hi Jazzed, can you change COGS to 4, that should make it look fine!, not enough oomph, me thinks!

    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]

    Cool. Works great! [noparse]:)[/noparse]
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-10-17 20:46
    The only problem is ... they remind me of the impossible promises that the sales team give out and then land onto me. bless.

    This prop thing, is versitile!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • BaggersBaggers Posts: 3,019
    edited 2009-10-17 21:49
    Glad it works for you jazzed [noparse];)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • potatoheadpotatohead Posts: 10,261
    edited 2009-10-18 06:19
    This rocks! Nice, simple, and fun.

    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!
  • BaggersBaggers Posts: 3,019
    edited 2009-10-18 08:59
    glad you like it guys [noparse]:)[/noparse] hopefully this will bring more games our way also!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-10-19 14:17
    Been quietly playing with this over the weekend... Nice work Baggers!

    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.
  • BaggersBaggers Posts: 3,019
    edited 2009-10-19 14:21
    Lol Jeff, thanks, I was wondering why you were soooooooo quiet, and hadn't already posted, I hadn't thought because it's kept you that quiet and busy lmao ;D

    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

    ·
  • BradCBradC Posts: 2,601
    edited 2009-10-19 14:29
    I nearly wet myself when I saw that Hero screen. I've installed 2600 and C64 emulators exclusively to play that game. I *love* it [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • BaggersBaggers Posts: 3,019
    edited 2009-10-19 15:15
    Don't worry BradC, you'll be able to play it, maybe a little while, as I'm gonna be busy this week, but next week I'll get it playing [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • potatoheadpotatohead Posts: 10,261
    edited 2009-10-19 15:26
    I like that game too. It's one of the best VCS titles. The guys at Activision really knew how to use the machine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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!
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-10-19 15:32
    Stupid question...

    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.
  • potatoheadpotatohead Posts: 10,261
    edited 2009-10-19 16:09
    Yep.

    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!
  • BaggersBaggers Posts: 3,019
    edited 2009-10-19 20:06
    Hi All,

    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
  • trodosstrodoss Posts: 577
    edited 2009-10-19 22:42
    Very nice addition!
    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.
    Baggers said...
    Sprites only go over the bitmap background, ...
    Completely missed that part the first time around tongue.gif Would have saved me hours of tinkering.

    Post Edited (trodoss) : 10/20/2009 3:26:17 AM GMT
  • potatoheadpotatohead Posts: 10,261
    edited 2009-10-19 22:45
    Yeah, the sprites are the text, on the VCS.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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!
  • trodosstrodoss Posts: 577
    edited 2009-10-20 01:12
    Good learning about how the VCS works [noparse];)[/noparse]
    I think I might need to 'scale down' what I planned on using it for. Maybe something like Joust?
  • potatoheadpotatohead Posts: 10,261
    edited 2009-10-20 03:43
    Joust would be excellent. Background is well within the limits presented in this driver, and you've plenty of sprites!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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!
Sign In or Register to comment.