Nice work! Could form the basis of a graphics cut/copy/paste type routine.tofro wrote:Something along the lines of this would probably work, I guess (untested, will also only work for screen areas that are byte-aligned )
Tobias
It might be worth giving it the full _pic file header 10 bytes, that way a simple SBYTES 'filename',address,mneed command could save the 'window' area cut or copied to file as a standard PE _pic file too:
Code: Select all
210 mneed = blen * y + 10 : Rem memory needed, +10 bytes for pic header
220 address = ALLOCATION(mneed)
225 poke_w address,hex('4AFC')
230 poke_w (address+2, w) : poke_w (address + 4, h) : Rem remember width and height
235 poke_w address+6,blen
236 poke address+8,mode_number
237 poke address+9,0 : REM spare byte
240 dstPtr = address + 8 : srcPtr = bstart
Word - $4AFC (19196 in decimal)
Word - width in pixels
Word - height in pixels
Word - line increment in bytes
Byte - mode number
Byte - spare (usually 0, used for something only by QDesign IIRC)
(goes into hiding before tofro objects to being given more work to do
