Two pictures in one BSAVE file?
Two pictures in one BSAVE file?
(OP)
Someone was telling me that it is possible to put two or more pictures into one BSAVE file using the offset feature.
However, with some playing around with this, I couldn't get it to work. Does anyone know how to do it?
This is what I was trying
SCREEN 13
DIM pic%(500)
DIM pic2%(500)
'(code for GETting pictures here, putting one picture
'into pic% and the other picture into pic2%)
DEF SEG = VARSEG(pic%(0))
BSAVE "test.pic", 0
DEF SEG = VARSEG(pic2%(0))
BSAVE "test.pic", 500
'Then to load the pictures:
DEF SEG = VARSEG(pic%(0))
BLOAD "test.pic", 0
DEF SEG = VARSEG(pic2%(0))
BLOAD "test.pic", 500
PUT (10,10),pic%
PUT (100,100),pic2%
I kept getting errors, and I'm not sure what to do differently. If someone could guide me in the right direction, I would appreciate it. Thanks!
However, with some playing around with this, I couldn't get it to work. Does anyone know how to do it?
This is what I was trying
SCREEN 13
DIM pic%(500)
DIM pic2%(500)
'(code for GETting pictures here, putting one picture
'into pic% and the other picture into pic2%)
DEF SEG = VARSEG(pic%(0))
BSAVE "test.pic", 0
DEF SEG = VARSEG(pic2%(0))
BSAVE "test.pic", 500
'Then to load the pictures:
DEF SEG = VARSEG(pic%(0))
BLOAD "test.pic", 0
DEF SEG = VARSEG(pic2%(0))
BLOAD "test.pic", 500
PUT (10,10),pic%
PUT (100,100),pic2%
I kept getting errors, and I'm not sure what to do differently. If someone could guide me in the right direction, I would appreciate it. Thanks!
RE: Two pictures in one BSAVE file?
also if your array is 500 you might want to offset to 1000 since an integer is 2 bytes
Dim pic%(500) is the same as Dim pic(500) as integer
which is actually 1000 bytes of information...
for example...
the sceen is 320 x 200 in SCREEN 13
that is 64000 bytes...
but you only need to define 32001 bytes...
((totalx x totaly) / BytesPerInteger) - 1forZero
((320 x 200) / 2) - 1 = 31999
then add 2 bytes for the height and width
31999 + 2 = 32001
try this:
Dim scrn(32001) as integer
Screen 13
Get (0,0)-(319,199),Scrn
Line (0,0)-(319,199), 15
A$ = Input$(1)
Put (0,0),Scrn,Pset
Now, the offset should be in bytes, so try your code again, but double the integer for bytes... (500 integer = 1000 bytes)
DEF SEG = VARSEG(pic%(0))
BSAVE "test.pic", 0
DEF SEG = VARSEG(pic2%(0))
BSAVE "test.pic", 1000
DEF SEG = VARSEG(pic%(0))
BLOAD "test.pic", 0
DEF SEG = VARSEG(pic2%(0))
BLOAD "test.pic", 1000
Good Luck,
Tell me if it works
Have Fun, Be Young... Code BASIC

-Josh
http://cubee.topcities.com
RE: Two pictures in one BSAVE file?
Here's a copy of the complete code:
'---start---
SCREEN 13
DIM SCRN(32001) AS INTEGER
DIM PIC(1250) AS INTEGER
DIM PIC2(1250) AS INTEGER
DIM PIC3(1250) AS INTEGER
DIM PIC4(1250) AS INTEGER
GET (0, 0)-(319, 199), SCRN
LINE (0, 0)-(319, 199), 15
A$ = INPUT$(1)
PUT (0, 0), SCRN, PSET
FOR Y = 1 TO 5
FOR X = 1 TO 5
READ Z
LINE (X * 5 - 5, Y * 5 - 5)-(X * 5, Y * 5), Z, BF
NEXT
NEXT
FOR Y = 1 TO 5
FOR X = 1 TO 5
READ Z
LINE (X * 5 + 40, Y * 5 - 5)-(X * 5 + 45, Y * 5), Z, BF
NEXT
NEXT
GET (0, 0)-(25, 25), PIC%
GET (45, 0)-(70, 25), PIC2%
DEF SEG = VARSEG(PIC%(0))
BSAVE "TEST.PIC", 0, 1250
DEF SEG = VARSEG(PIC2%(0))
BSAVE "TEST.PIC", 1250, 1250
CLS
DEF SEG = VARSEG(PIC3%(0))
BLOAD "TEST.PIC", 0
DEF SEG = VARSEG(PIC4%(0))
BLOAD "TEST.PIC", 1250
PUT (10, 10), PIC3%, PSET
PUT (100, 100), PIC4%, PSET
DATA 1,0,0,0,1
DATA 0,1,0,1,0
DATA 0,0,1,0,0
DATA 0,1,0,1,0
DATA 1,0,0,0,1
DATA 4,0,4,0,4
DATA 0,3,0,3,0
DATA 2,0,2,0,2
DATA 0,1,0,1,0
DATA 5,0,5,0,5
'---stop---
RE: Two pictures in one BSAVE file?
Have Fun, Be Young... Code BASIC

-Josh
http://cubee.topcities.com
RE: Two pictures in one BSAVE file?
RE: Two pictures in one BSAVE file?
Have Fun, Be Young... Code BASIC

-Josh
http://cubee.topcities.com
RE: Two pictures in one BSAVE file?
RE: Two pictures in one BSAVE file?
BSAVE filename$, varptr(pic1%(0)), 500
BSAVE filename$, varptr(pic2%(1)), 500
but I don't know the structure of BSAVE so I'll study it some more.
"Pizza tastes good because its a combination of great foods" KenshinHimura's quote
RE: Two pictures in one BSAVE file?
DEF SEG = &HA000
BSAVE "screen13.scr", 0, 64000
and then load the screen and GET your tiles.
RE: Two pictures in one BSAVE file?
pic% is an integer by array 1250
integers are two bytes, you also seem to be forgetting that pic%(0) counts as 1.
so to figure out he size of the BSAVE file you have to use this code
1251*2
DEF SEG = VARSEG(PIC%(0))
BSAVE "TEST.PIC", 0, 2502
DEF SEG = VARSEG(PIC2%(0))
BSAVE "TEST.PIC", 2502, 2502