Shop OBEX P1 Docs P2 Docs Learn Events
how would i match the number of tiles to fit my screen when using Graphics and VGA?? — Parallax Forums

how would i match the number of tiles to fit my screen when using Graphics and VGA??

laser-vectorlaser-vector Posts: 118
edited 2013-04-11 11:31 in Propeller 1
Hi,

i am having trouble understanding what i need to do to increase the number of tiles to fill my screen (if that is even possible given memory limitations).

i have taken a bit of code from Chip Gracy's Graphics Driver v1.0 and VGA_1024x768_Tile_Driver_With_Cursor.spin. I have tried changing variables here and there, but have not found anything that seems to make a desirable difference.

VGA_1024x768_Tile_Driver_With_Cursor.spin:
CON

  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

  cols = 64
  rows = 48
  tiles = cols * rows

  spacetile = $8000 + $20 << 6

  bitmap_base = $4000
  display_base = $6000

  w_x = 24
  w_y = 24
  w_left = w_x * 16
  w_right = w_left + 256
  w_top = (48 - w_y) * 16
  w_bottom = w_top - 128
  

OBJ

  vga     : "VGA_1024x768_Tile_Driver_With_Cursor"
  mouse   : "mouse"
  gr      : "graphics"

  
VAR

  long  col, row, color
  long  boxcolor, boxptr

  long  array[tiles/2]
  long  cursor[1+32]

  long  cursor_x, cursor_y, cursor_col, cursor_def
  

PUB start | i, j, k

  vga.start(16, @array, @vgacolors, @cursor_x, 0, 0)

  'start and setup graphics
  gr.start
  gr.setup(16, 8, 128, 64, bitmap_base)

  'fill screen with text
  print($100)
  'print_string(string("hello123"))

  'make some graphics tiles on the screen
  repeat i from 0 to 7
    repeat j from 0 to 15
      array.word[cols * (w_y + i) + j + w_x] := display_base + i << 6 + j <<9 + 21
 
  'keep updating screen
  repeat
    'do some graphics
    gr.clear
    
    gr.colorwidth(3,0)
    repeat i from 1 to 8
      gr.vec(0, 0, (k & $7F) << 3 + i << 4, k << 6 + i << 8, @vecdef)

    gr.textmode(20,7,6,5)
    gr.colorwidth(1,7)
    i := ||(k>>5 // 10) + "0"
    gr.textarc(0, 0, 80, 20, -k << 7 / 3, @i)
      
    gr.textmode(2,4,6,5)
    gr.colorwidth(2,2)
    gr.textarc(0, 0, 50, 40, k << 6, @@strings[k >> 8 & 3])
     'textarc(x, y, xr, yr, angle, string_ptr)
    gr.copy(display_base)
    k++

when i run this i get a small rectangular drawing space near the center of the screen, but i can not figure out how to make this drawing space any bigger.

any help on this would be great, im really looking for a drawing space that fills the screen so i can have different sized fonts in different parts of the screen. i am not opposed to trying different methods to accomplish this, any suggestions are very welcome!

thanks,
LV

Comments

  • RaymanRayman Posts: 14,665
    edited 2013-04-11 11:31
    You will definitely have memory problems trying to do graphics on full XGA screen...

    The Graphics Demo does double buffering on 16x12 tiles and uses all of memory.
    Here you have 64x48 tiles...

    You could use single buffering and do 2X as many tiles, but still nowhere near enough...
    Only real option is to strech the tiles so that fewer tiles fill the screen.

    So, you might as well use the regular VGA (640x480) for this...
Sign In or Register to comment.