Shop OBEX P1 Docs P2 Docs Learn Events
Bitmap base address?? — Parallax Forums

Bitmap base address??

Harry1Harry1 Posts: 29
edited 2007-01-26 07:18 in Propeller 1
I am currently implementing a program that uses this method (shown below) from the graphics class and i am wondering what is and what i should put for the bitmap base address. Thanks in advance

PUB setup(x_tiles, y_tiles, x_origin, y_origin, base_ptr) | bases_ptr, slices_ptr
'' Set bitmap parameters
''
''·· x_tiles······· - number of x tiles (tiles are 16x16 pixels each)
''·· y_tiles······· - number of y tiles
''·· x_origin······ - relative-x center pixel
''·· y_origin······ - relative-y center pixel
''·· base_ptr······ - base address of bitmap
· setcommand(_loop, 0)································· 'make sure last command finished
· repeat bases_ptr from 0 to x_tiles - 1 <# 31········· 'write bases
··· bases[noparse][[/noparse]bases_ptr] := base_ptr + bases_ptr * y_tiles << 6
· y_tiles <<= 4········································ 'adjust arguments and do setup command
· y_origin := y_tiles - y_origin - 1
· bases_ptr := @bases
· slices_ptr := @slices
· setcommand(_setup, @x_tiles)
· bitmap_base := base_ptr······························ 'retain high-level bitmap data
· bitmap_longs := x_tiles * y_tiles

Comments

  • potatoheadpotatohead Posts: 10,260
    edited 2007-01-26 07:18
    Figure out how big your bitmap is, then subtract that amount from the 32K upper RAM limit. That's where a single page of bitmap memory would fit. If you double buffer, multiply your bitmap memory by two, then subtract.
Sign In or Register to comment.