Shop OBEX P1 Docs P2 Docs Learn Events
Looking for help to understand Ray's PSB Graphic Demo — Parallax Forums

Looking for help to understand Ray's PSB Graphic Demo

Don MDon M Posts: 1,652
edited 2012-12-20 02:12 in Propeller 1
I've been playing with Ray's demo. I've altered some of the code in the Graphics Demo method and I can see where the certain graphics and text are made and altered. What I don't understand is what limits the size of the black graphics display box? I'm guessing it has something to do with this portion of the code but I don't understand it. Can someone try and explain to me how this works?

Comments

  • RaymanRayman Posts: 14,667
    edited 2012-12-19 15:00
    I'm trying to think of a good example...
    Maybe the code at the bottom of this page would help:
    http://www.rayslogic.com/propeller/Programming/Programming.htm

    Where the bullet starts with: "I really like the 1024x768 (XGA) tile driver "
    Does that help any?
  • Don MDon M Posts: 1,652
    edited 2012-12-19 15:07
    So can I replace some of the code in the demo with the code from your page?
  • RaymanRayman Posts: 14,667
    edited 2012-12-19 15:08
    That's what I would try, yes.
    If you can't figure it out, I'll help more...
  • Don MDon M Posts: 1,652
    edited 2012-12-19 15:18
    It doesn't like "array". I tried changing it to "screen" and it compiled but the LCD screen is all jarbled up.

    edit: removed code
  • RaymanRayman Posts: 14,667
    edited 2012-12-19 15:29
    Ok, can you post this latest version? I'll try to fix that up for you (might take a little while though)...
  • Don MDon M Posts: 1,652
    edited 2012-12-19 15:47
    If you mean the latest PSB Graphics object it's attached to the first post above. Is that what you meant?
  • RaymanRayman Posts: 14,667
    edited 2012-12-19 16:10
    ok, I'm busy with kids now, will try later
  • RaymanRayman Posts: 14,667
    edited 2012-12-19 16:37
    Ok, forget what I said earlier...

    I think you were on the right track, starting with the original PSB_GraphicsDemo...

    The variables:
    x_tiles = 16
    y_tiles = 12
    GraphicsXOffset=6
    GraphicsYOffset=3

    should let you control the size and position of the graphics window.

    But, I should mention that this demo uses double buffering and reserves a very large amount of memory for graphics...
  • Don MDon M Posts: 1,652
    edited 2012-12-19 18:49
    Here's what I messed with and no real luck:


    I have the offsets set to 0 so that the screen starts at the upper left hand corner (0, 0). I tried changing the x_tiles and y_tiles but anything over the values you have there cause the screen to go funky. It adds a bunch of garbage as though it's pulling it out of memory from somewhere where it isn't supposed to? I can go smaller without any problem.

    Any further clues?
    Is it even possible to have the whole screen be a graphics area?
    Does it have to be double buffered?
    Is it a memory size issue?

    Sorry for all the questions but I want to understand how it works.
  • Don MDon M Posts: 1,652
    edited 2012-12-19 19:38
    Let me ask you this- would your DVI Graphics Shield adaptor with the 4.3" interface solve this?
  • Don MDon M Posts: 1,652
    edited 2012-12-20 02:08
    Ray- please accept my apologies. Sorry if I caused you any grief by attaching your code. I should have just attached a link to it.

    This whole posting discussion lately has me not wanting to come here for help or to discuss anything.
  • RaymanRayman Posts: 14,667
    edited 2012-12-20 02:12
    That example uses up almost all of memory... So, I think that's why you can't make it bigger...
    You can definitely make it bigger by making it single buffer. That's what PSB_Paint does to cover most of the screen.
    I think you just need to make these changes to do that:
    _stack = ($3000 + 100) >> 2 'accomodate display memory and stack
    bitmap_base = $5000
    display_base = $5000

    You might want to look to see this was done in PSB_Paint

    There is still not enough memory to cover the entire screen though...

    The Graphics Shield does free you of memory limitations. But, I'm still working to make it easy to draw multiple fonts quickly.
    Soon though, it will be much easier to draw different fonts, anywhere you want...

    If you still have trouble (it is a bit complicated, I must say), I'll make some time later this week to code up what you want..
Sign In or Register to comment.