Question about graphics 15 (31). if I load small picture in TurboBasic with BGET directli in the screem memory DPEEK(88), I can load only on 1 row (4 pixels) in line X -
BGET #1,DPEEK(88)+position,Lenght
The position is 0,4,8,12, etc in Line... how I can do the pixel position with this? ( 0,1,2,3,4,5,6,etc)
It wont be easy in TBXL, you will have to dive into the machine code as its a matter of bits not bytes :) One pixel is described by a pair of bits, not 1 byte (8bits).
in GR.15 one byte of data is always 4 pixel wide in Gr.15. You wont be able to use BGET to place your pixels on a fixed x,y coordinates without modifying single bytes.
Its a waste of time to try to achieve this in TBXL, I am not saying its impossible but an easier way would be to store an image in a string.
I've prepared once (in Atari Basic) a small procedure that dumped the GR.15 picture (I was using the text window as well) to the tape.
If I remember correctly it was very simple dumping byte per byte the screen memory and then loading the image to the same place back.
Minus of this thing is that each time you want to display the image on the screen you need to load it directly as it is not stored anywhere else.
I don't have an example but it was simple as :
GET #1,A POKE ADDRESS,A
stored in the loop processing addresses.
Another minus was the long "special signal" between the records as Atari Basic is very very slow. And another thing I was using the pic that did not cover the whole screen.
So summing up - my solution was not to load from disk/tape/file/whatever pixel by pixel but to load "low level" byte per byte. (you don't need to do anything with this later as long as you set up the colors)
Ah ok.. I've read your initial post now... my "solution" of course is as simple as it can be but won't work for you as you want to have something to actually load the picture in the specific position on the screen. (Above I meant only loading the WHOLE PICTURE BEING DISPLAYED ON THE SCREEN ;)