Shop OBEX P1 Docs P2 Docs Learn Events
16colour fat pixel bitmap display — Parallax Forums

16colour fat pixel bitmap display

BaggersBaggers Posts: 3,019
edited 2010-07-02 18:57 in Propeller 1
Hi All,
I've just this afternoon finished a huge workload, preparing a demo for the Edge mag, anyway, now to relax, and chill, I decided to do a 16colour bitmap display driver for the prop.
I've not done a graphics.spin type driver for it as of yet, as I've only just done the display driver.

Here it is anyway, [noparse]:)[/noparse]
It's currently set to Hybrid setup, but you can change the settings in the source at the top of JB_AMS.spin.

I've added a plot(x,y,colour)·function in the spin file, for starters, I'll add more over the weekend.
and post a pic [noparse]:)[/noparse].

Baggers.

EDIT oops, some issues with demo-board, will re-post when sorted [noparse];)[/noparse]· false alarm lol
I've left a border around the screen so you know it's still working lol. instead of clearing the screen.



Edit2:··· Just some extra info for you guys.
it uses, one 16colour palette ( refreshed from hubram palette at start of every frame).
it only uses 1 cog.
resolution is 128x192 4bit, top left pixel, is high nibble of first byte ( $X0 X being the colour index ) , and it's sequential, left to right, then top to bottom.
because it's fat pixel, ( like amstrad and C64 fat pixels ) it only uses 12KB of memory for the screen, like graphics.spin



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



Post Edited (Baggers) : 9/5/2009 9:53:06 AM GMT
«134

Comments

  • ColeyColey Posts: 1,110
    edited 2009-09-04 20:44
    yay! first download, sorta like I already knew it was coming lol

    Seriously folks, another great contribution from Baggers, he did this in his very precious spare time and he hasn't got much at the moment...

    Thanks Baggers!


    Coley

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PropGFX - The home of the Hybrid Development System and PropGFX Lite
  • BaggersBaggers Posts: 3,019
    edited 2009-09-04 21:10
    Posting a pic, so you can see it.


    attachment.php?attachmentid=63509

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
    800 x 417 - 364K
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-09-04 21:26
    WOW!!!

    Awesome job as usual!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-09-04 21:28
    DOUBLE WOW!

    Yes, I know what I'll be playing with this weekend after work and chores!!

    Nice Baggers!

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • HarleyHarley Posts: 997
    edited 2009-09-05 00:27
    Baggers, I'm wondering, is this VGA or for TV monitor?

    Might just be useful for my needs if the latter.yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • trodosstrodoss Posts: 577
    edited 2009-09-05 00:45
    hop.gifhop.gifhop.gif
    Triple WOW!

    So is that being made with a specific game in mind?
    Looks like that could be all sorts of fun. Something like that makes it very tempting to try to recreate one of the old Sierra (or SCUMM) games.

    Excellent work, as always!
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-05 05:22
    Just playing with the driver now and noticed it came up blank which I bypassed with a quick little dummy repeat. I thought I'd make it scroll, at least horizontally for a bit of fun.

    *Peter*

    PUB Main | i,c,x,y
    
      tv.start(@tvparams)
      frame:=0
      repeat
        VSync
        repeat y from 96 to 158
          i := @data+(y<<6)
          c := byte[i]
          bytemove(i,i+1,63)
          byte[noparse][[/noparse]i+63] := c
    
    [/i]
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-05 05:46
    More fun

    *Peter*

    PUB Main | i,c,x,y
    
      tv.start(@tvparams)
      frame:=0
      repeat
        VSync
        repeat y from 159 to 191
          i := @data+(y<<6)
          c := byte[i]
          bytemove(i,i+1,63)
          byte[noparse][[/noparse]i+63] := c
        if x&3 == 0
          repeat y from 96 to 158
            i := @data+(y<<6)
            c := byte[noparse][[/noparse]i+63]
            bytemove(i+65,i+64,63)
            byte[i] := c
        x++
    [/i][/i]
    
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-09-05 07:35
    Quote "Hi All,
    I've just this afternoon finished a huge workload, preparing a demo for the Edge mag, anyway, now to relax, and chill, I decided to do a 16colour bitmap display driver for the prop."

    If this is light entertainment, what would you have to do if you had been very naughty, and needed punishment??

    Definitely playing with this ( given half a chance, latter on )

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • BaggersBaggers Posts: 3,019
    edited 2009-09-05 09:44
    Hi guys, glad you all like it [noparse]:)[/noparse]

    Microcontrolled,
    Thanks!

    OBC,
    Thanks as always,·I had a feeling you'd like it lol

    Harley,
    It's for TV.

    trodoss,
    Unfortunately, it wasn't with a specific game in mind, but yeah that's always an option, I do like the SCUMM games [noparse]:)[/noparse]

    Peter,
    Nicely done [noparse];)[/noparse] although you probably need to change the code you posted, as whatever was in the [noparse][[/noparse] ]'s has changed the font to italics in the line c:=byte

    Toby,
    Yes, this is light entertainment, to be very naughty, and in need of punishment, I'd have done it whilst I was busy with my deadline lol [noparse]:)[/noparse] and it'd already have graphics.spin working with it etc. lol



    BTW, thought I'd add some extra details, to the first post.

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

    ·
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-05 10:01
    Yeah, that mCode should butt out of a [noparse][[/noparse] code ] construct I reckon. Here it is fixed up I think.

    What does it do? Try it (primitive animation)

    Actually I've got a fair bit of a work load on too but I'm tinkering with Sprite functions that can read areas of the bitmap and turn them into go anywhere sprites.

    *Peter*

    PUB Main | i,c,x,y
    
      tv.start(@tvparams)
      frame:=0
      repeat
        VSync
        repeat y from 159 to 191
          i := @data+(y<<6)
          c := byte[noparse][[/noparse] i ]
          bytemove(i,i+1,63)
          byte[noparse][[/noparse]i+63] := c
        if x&3 == 0
          Vsync
          repeat y from 96 to 158
            i := @data+(y<<6)
            c := byte[noparse][[/noparse]i+63]
            bytemove(i+65,i+64,63)
            byte[noparse][[/noparse] i ] := c
        x++
    
    
  • BaggersBaggers Posts: 3,019
    edited 2009-09-05 10:12
    Cool [noparse]:)[/noparse] nicely done Jakacki.

    try this [noparse]:)[/noparse]

    PUB Main | i,c,x,y
    
      tv.start(@tvparams)
      frame:=0
      repeat
        VSync
        repeat y from 159 to 191
          i := @data+(y<<6)
          c := byte[noparse][[/noparse] i ]
          bytemove(i,i+1,63)
          byte[noparse][[/noparse]i+63] := c
        repeat y from 64 to 95
          i := @data+(y<<6)
          c := byte[noparse][[/noparse] i ]
          bytemove(i,i+1,63)
          byte[noparse][[/noparse]i+63] := c
        if x&3 == 0
          Vsync
          repeat y from 96 to 158
            i := @data+(y<<6)
            c := byte[noparse][[/noparse]i+63]
            bytemove(i+65,i+64,63)
            byte[noparse][[/noparse] i ] := c
        x++
    
    

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

    ·
  • RaymanRayman Posts: 14,609
    edited 2009-09-05 12:00
    Nice work Baggers! Could something like this work on VGA too?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-05 13:41
    Ok, I've had a little bit more of a play and I have been implementing sprites and I can make up to 8 (or more) sprites from some part of the screen at present. Then I can move the sprite around and it automatically redraws that part of the screen when it moves. Still sorting out the bugs with multiple sprites and moving objects but it's starting to come together.

    The JB_AMS-PBJ.spin file will scroll the ground and move the chopper up and down while flying forward and over the top of other objects.

    *Peter*
  • hinvhinv Posts: 1,255
    edited 2009-09-05 14:35
    I wonder if it would be possible to do a 320x200 16 color graphics mode.
    It would have to be loaded in stages because only 768 bytes would be left in the hub.

    Doug
  • BaggersBaggers Posts: 3,019
    edited 2009-09-05 15:27
    Rayman & hinv, I don't think it'd be possible to do 16 colour in VGA, the way this is doing it, but I CAN do 320x240 driver, for 8bit but it'd have to be a tilemap renderer, which could then turn it to 16 colour.
    This driver as it stands, converts each word into 4 paletted pixel colours, inbetween each waitvid, which is helpful with it being fat pixels, as I don't think it'd be fast enough for 320x200 ( Doug ) but again, I can do a 320x200 16 colour graphics mode, but you'd have to have extra couple of cogs generating the display, so you'd have less than 768 bytes, as you'd also need a buffer for the scanline.

    Peter, Nice addition [noparse]:)[/noparse]

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

    ·
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-06 13:10
    Well it's that time of the night again where I get to play so I fixed up a little bug in my demo and took Baggers driver out for a test drive.

    This simple demo shows how easy it is to capture variable sized images from fixed areas of the screen and turn them into sprites which can be identified by an index. Since this is only a quick hack there is still a bug of sorts when sprites collide but the demo gives you an idea on how to animate a game.

    Other methods that could be added would animate the sprite in a similar manner to GIFs or simply flip them around. The sprite object could embedded speed and direction which would be handled from a sprite task.

    Next step besides bug fixes is to empower the sprite object more as touched upon and also have Mr Heli firing missiles as it is flying along.

    Ok, back to work for now.

    *Peter*
  • BaggersBaggers Posts: 3,019
    edited 2009-09-06 13:19
    Nice work Peter [noparse]:)[/noparse]
    Just to help you out a tad, what you have to do, is do the RestoreShadow, for all the sprites, then SaveShadow for all the sprites, then draw them [noparse];)[/noparse]
    If you want, I can knock up a PASM version that'll run in another cog if you want?

    Baggers.

    PS, good to see you're having fun with it [noparse]:)[/noparse]

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

    ·
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-06 13:30
    Yeah, I'm not really being serious doing it this way but Spin lets me muck about easily. It also allows others to see it's not so hard and maybe even just tweak it a bit too.

    I cut my teeth on machine code and assembly so you know Baggers, I'm not going to stop you "knocking up" a PASM version either, I know you're really itching to do it mate. jumpin.gif

    *Peter*

    P.S. HEY, haven't you got work to do too!
  • BaggersBaggers Posts: 3,019
    edited 2009-09-06 13:32
    rofl, you know me well [noparse]:)[/noparse]
    yeah, it is good that you're doing this in spin, it does help show others how doable things like this are.

    Baggers.

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

    ·
  • BaggersBaggers Posts: 3,019
    edited 2009-09-06 13:33
    to be honest, I planed on getting the sprite thing done, but you beat me to it [noparse]:)[/noparse] feather in your cap there Peter! lol

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

    ·
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-06 13:41
    Dunno about a feather as I don't wear a cap (it's called an Akubra mate!) although I'm sure you've got enough to give away but imagine how things could mushroom if everybody contributed a quick "hack"? Mushroom code!

    *Peter*
  • BaggersBaggers Posts: 3,019
    edited 2009-09-06 13:43
    did I say feather, I guess I mean propeller lol [noparse]:)[/noparse]

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

    ·
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-09-06 19:16
    @Peter,

    Any chance you could post that file in .spin format?
    I can't seem to open the .aspx format.

    Thanks!
    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • BaggersBaggers Posts: 3,019
    edited 2009-09-06 19:18
    OBC, There ya go·[noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-09-06 19:43
    Nice!

    @Baggers,

    Any chance I could talk you into adding a character driver to this?
    Something that would be able to import the attached?
    (Would make it nice to use trodoss's editor with this!)


    Thanks
    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • BaggersBaggers Posts: 3,019
    edited 2009-09-06 19:58
    LOL OBC, A character driver was also on the books [noparse]:)[/noparse]

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

    ·
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-09-06 20:04
    I think I'm gonna like this... [noparse]:)[/noparse]

    How was the ".BIT" format file created?

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • BaggersBaggers Posts: 3,019
    edited 2009-09-06 20:10
    It's my BMP converter, which I'll be releasing very soon, also [noparse]:)[/noparse]
    basically a dos app, give it an 8bit bmp file and it converts it any of the modes for PropGFX, and as Amstrad style modes are included in PropGFX, it works for this driver too [noparse]:)[/noparse]

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

    ·
  • BaggersBaggers Posts: 3,019
    edited 2009-09-06 20:44
    Hi All, again [noparse]:)[/noparse]
    Here it is, ( yes OBC, I did say it was soon lol roll.gif )
    It's my graphics converter, which converts 8bit bmp images to raw binary files, depending on what settings you use.
    It's a windows dos command line app [noparse];)[/noparse] basically you give it a filename ( with no extention )·8bit filename

    eg:-

    bmp8toLite mrheli.bmp -amsbitmap16

    That will make the .bit file, and a .pal file. as long as you're bmp is an 8bit bmp.

    Any troubles with it, get me on here, and post your bmp, so I can try it, and explain what you forgot, or what I didn't allow for lol.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
Sign In or Register to comment.