Qbasicnews.com

Full Version: Bload & Bsave
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
So anyway, i just got done reading a tutorial over at www.qb4all.com showing how to use BLOAD AND BSAVE.

So What i did to test it out is this


Code:
dim tile(15)

screen 13

for y = 1 to 5
for x = 1 to 5

read z

pset (x,y),z

next: next

get (0,0)-(5,5).tile


def seg = varseg(tile(0))

Bsave "tile.gfx",varptr(tile(0)),25


data 1,1,1,1,1
data 1,1,1,1,1
data 1,1,1,1,1
data 1,1,1,1,1
data 1,1,1,1,1


Then I closed that program and opened a new one to see if i could recall the .gfx file and draw my graphic using the put command. Needless to say it didnt work. (No Suprise there). So to do this i did this.

Code:
dim test(15)

screen 13

def seg = varseg(test(0))

bload "tile.gfx",varptr(test(0))


put (10,10),test


Could Some please tell me what i did wrong. Also If your out there Zire just want to give you a thx for all the help lately.
Code:
DIM test(15)
SCREEN 13

DEF SEG = VARSEG(test(0))
BLOAD "tile.gfx", VARPTR(test(0))
DEF SEG
PUT (10, 10), test

Code:
DIM tile(15)

SCREEN 13

FOR y = 1 TO 5
FOR x = 1 TO 5

READ z

PSET (x, y), z

NEXT: NEXT

SLEEP

GET (1, 1)-(5, 5), tile

PUT (20, 20), tile


DEF SEG = VARSEG(tile(0))

BSAVE "tile.gfx", VARPTR(tile(0)), 30

DEF SEG


DATA 1,1,1,1,1
DATA 1,1,1,1,1
DATA 1,1,1,1,1
DATA 1,1,1,1,1
DATA 1,1,1,1,1

that code works, i have tried it. remember a few things:

1. RTFM - "READ THE F*CKING MANUAL" before posting such questions. I guess you are using qb4.5 and it has EXCELLENT help. It gives you not only all details of the command (like bload, bsave etc...) but also A *WORKING* EXAMPLE.

2. Look at this command:
Code:
BSAVE "tile.gfx", VARPTR(tile(0)), 30

The last argument is 30, set it large enough for it accomodate your graphic. I dont remember the exact formula for each screen mode. Yep, it varies according to the screen mode.

3. Know what your code is doing. DEF SEG changes the working program segment to soemthing else. Obviously you need to change it back. So DEF SEG without any argument does it for you. EVERYTHING IS THERE IN QB'S EXCELLENT HELP.

Look pal I dont have anything against you but it just pisses me off to see the amount of dedication you "newbies" show towards making your program work :evil:
Thx for all the help man, for your info i checked the online help cause my qb doesnt have the help file. I still didnt understand it so i had to post it. So do us all a favor and get off the newbie post cause that is probably why it is here. FOR NEWBIES.

P.S. Take the keyboard out of your ass its not healthy
Hey, u can downlaod qb4.5 w/help on my website

http://www.atosoftqb.digitalblackie.com/files

should be QB45.ZIP

Oz~
Heh, BBQ just got charred.

(FYI: DEF SEG does not change DS. It only sets the segment used for BSAVE/BLOAD and PEEK/POKE. You do not have to change it back to the default after you set it.)
Quote:Thx for all the help man, for your info i checked the online help cause my qb doesnt have the help file. I still didnt understand it so i had to post it. So do us all a favor and get off the newbie post cause that is probably why it is here. FOR NEWBIES.

P.S. Take the keyboard out of your ass its not healthy

Which help did you check? Qbasic written by the tooth fairy?

Heres a link @ this site. Complete online QB help manual:
http://qbasicnews.com/qboho/qckadvr.bloadx.shtml

WTF?! I must be Einstein to use google!
http://www.basicusers.net/tutorials/mall...ndex.shtml

Is that magic?!

Loose the arrogance first. Secondly, try to do things yourself and find the answers on your own otherwise you will not amount to anything. Be resourceful. Even a 3year old can do a google search. A newbie doesnt mean you have to be an idiot.

When theres a working example, and the internet is crammed with them including QB's help, its not *that* difficult to spot the differences between a working example and your own program.

If you dont want to listen to my advice, its ok. You'll learn it the hard way, *iff* you are gonna be any kind of a professional :rotfl:

Quote:(FYI: DEF SEG does not change DS. It only sets the segment used for BSAVE/BLOAD and PEEK/POKE. You do not have to change it back to the default after you set it.)

You are looking at potentially unstable programs :barf:. Its a good practice to always change the segment back to QB's DS. You cant say what bugs might creep into your program if you dont.
Quote:
Plasma Wrote:(FYI: DEF SEG does not change DS. It only sets the segment used for BSAVE/BLOAD and PEEK/POKE. You do not have to change it back to the default after you set it.)

You are looking at potentially unstable programs :barf:. Its a good practice to always change the segment back to QB's DS. You cant say what bugs might creep into your program if you dont.

It's obvious that you don't know what you are talking about.

Code:
;***
; B$DSEG - Set BASIC Segment Address (DEF SEG w/parameter)
;
; Purpose:
;  Runtime Entry Point. Save given segment address in b$seg
;
; Input:
;  new segment address
;
; Output:
;  [b$seg] set.
;
; Modifies:
;    NONE
;
;******************************************************************************
cProc    B$DSEG,<PUBLIC,FAR>    
parmW    newseg            
cBegin                
    MOV    AX,newseg    ; get...
    MOV    [b$seg],AX    ; and save new b$seg value
cEnd

QB doesn't care what b$seg is set to. It's not going to make your program any more "unstable" than setting a = 31839.
Whatever you think "Great master of QB" :wink:
:roll:
And to think I got a "final warning" for flaming n00bs.

Is it just me who thinks wildcard/Oracle confused me and TBBQ?



EDIT: This is a joke.
Pages: 1 2