Right, I forgot to mention I was experimenting with only half the screen. Anyways, the problem is this:
AliphaX: they're for accessing memory.. familiar with memory layout? (segments, offsets)
SlayersCafe2: a little
SlayersCafe2: Plasma just helped me a little
SlayersCafe2: so i understand how to use them with BSAVE
SlayersCafe2: so far i have this
SlayersCafe2: if i wanna save half the screen to a variable, i do this
SlayersCafe2:
Code:
DIM a(31999 + 4) as integer
DEF SEG = &HA000
BSAVE "image.dat", VARPTR(a), 32000
SlayersCafe2: the + 4 in the DIM is for the x,y coords, which i dont quite understand why i need them
SlayersCafe2: the def seg goes to the screen port
SlayersCafe2: and the VARPTR(a) sets the offset for the variable
SlayersCafe2: 32000 is the amount of bytes ill need to save all 320x200 pixels
AliphaX: that's kinda off
SlayersCafe2: which parts? help me understand please
AliphaX: the + 4 is for the width and height.. they need to be stored in the array, without them, PUT wouldn't know how big the image is
SlayersCafe2: how do i do that?
AliphaX: and actually, it is + 4 BYTES.. an integer is 2 bytes.. so really just + 2
SlayersCafe2: yeah but i need 2 integers
SlayersCafe2: x and y
SlayersCafe2: thats what PLasma said and it makes sense
AliphaX: yes, 1 integer for the x, 1 for the y.. so that's + 2..
SlayersCafe2: but an integer is 2 bytes
SlayersCafe2: so its 4 bytes altogether
SlayersCafe2: right?
SlayersCafe2: 2 integers * 2 bytes each = 4 bytes
AliphaX: the DIM statement creates arrays of integers, not arrays of bytes
SlayersCafe2: oh
SlayersCafe2: ok
SlayersCafe2: so its + 2?
AliphaX: yeah..
SlayersCafe2:
Code:
DIM a(31999 + 2) as integer
DEF SEG = &HA000
BSAVE "image.dat", VARPTR(a), 32000
SlayersCafe2: thyast the crrect code?
AliphaX: um..
AliphaX: are you saving directly off the screen? (you're not GET'ting the array first)
SlayersCafe2: yes, saving directly off the screen.. is it better to GET it?
AliphaX: well no, but why do you even need the array then?
SlayersCafe2: to save the screen to a variable for later use
SlayersCafe2: wait
SlayersCafe2: this is what i originally wanted to do
SlayersCafe2: save the screen to a file
SlayersCafe2: load another program... that program loads the file into a variable
AliphaX: wouldn't you just be putting it back on the screen again? what else could you do? 'cause I would just BLOAD directly to the screen
SlayersCafe2: the problem with that is i want to use this method to get 16x20 images off the screen in certain spots
SlayersCafe2: and then load them into a variable next time so i can move them around the screen and such
SlayersCafe2: the problem happens when i try to specify where to put the image when i load it
SlayersCafe2: it goes right onto the screen on the first line, in a straight line (top row) instead of a 16x20 array of pixels
SlayersCafe2: im probably using the wrong method, yes?