PDA

View Full Version : Bitmap base address??



Harry1
01-26-2007, 05:38 AM
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[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

potatohead
01-26-2007, 02:18 PM
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.