The reason you get the MAV on read/writepixefast is because your loops go 1 pixel to many in each direction.
lockbuffer
[code]
for x=0 to gfx_width-1
for y=0 to gfx_height-1
writepixelfast x,y,16777215
next
next
unlockbuffer
lockbuffer
[code]
for x=0 to gfx_width-1
for y=0 to gfx_height-1
writepixelfast x,y,16777215
next
next
unlockbuffer