BSAVING PICTURES...

8 posts / 0 new
Last post
A2forever's picture
Offline
Last seen: 6 years 10 months ago
Joined: Dec 20 2003 - 10:38
Posts: 226
BSAVING PICTURES...

can you guys tell me , and it's been a long time ago , but i think i remember , there was a way to bsave a picture , but i don't remember the A$ or L$ lengths , can someone tell me what it is? i would appreciate it , this way I can do a HGR or HGR2 and load it in , i am doing alot of screen dumps of games and utilities from the past.

thanks.

A2forever

Offline
Last seen: 8 years 5 months ago
Joined: Apr 10 2006 - 20:01
Posts: 1013
BSAVE HGR,A$2000,L$2000 BSAV

BSAVE HGR,A$2000,L$2000
BSAVE HGR2,A$4000,L$2000

Offline
Last seen: 2 years 12 months ago
Joined: Dec 24 2007 - 09:25
Posts: 183
what is that A$ and L$ stuff

what is that A$ and L$ stuff

Offline
Last seen: 8 years 5 months ago
Joined: Apr 10 2006 - 20:01
Posts: 1013
Re: what is that A$ and L$ stuff

what is that A$ and L$ stuff

See the DOS/ProDOS commands FAQ and look up BSAVE and BLOAD.

Offline
Last seen: 9 months 1 week ago
Joined: Dec 19 2003 - 18:53
Posts: 906
You need the manuals

This is a fine example of why manuals and tutorials save time. If you are new to Apple II's, get A Touch of AppleSoft (BASIC).

In the examples given, HGR and HGR2 are the names he is giving to the files that will be saved in DOS 3.3. A$ is followed by the starting point, of the file to be saved, in it's memory location as given in hexadecimal numbers. L$ is followed by the length of the file as given in hexadecimal numbers.

On Apple II computers, in their memory (map) the storage location for the HGR screen is $2000-$3FFF , and for HGR2 is $4000-$5FFF.

Hexadecimal math is based on 16 (decimal) numbers being represented in one character space. Decimal math is 10 based, (count your fingers, assuming you have the normal count). Why 16? Because computers use binary math, 1's and 0's: i.e. a location in memory is either ON(1) or OFF(0). There are sixteen possible permutations of four binary numbers.

Example 1:Binary #0000 = Decimal #0 = Hexadecimal #00

Example 2:Binary #0001 = Decimal #1 = Hexadecimal #01

Example 3:Binary #0010 = Decimal #2 = Hexadecimal #02

Example 4:Binary #0011 = Decimal #3 = Hexadecimal #03

Example 5:Binary #0111 = Decimal #9 = Hexadecimal #09

Example 6:Binary #1000 = Decimal #10 = Hexadecimal #0A

Example 7:Binary #1001 = Decimal #11 = Hexadecimal #0B

Example 8:Binary #1111 = Decimal #15 = Hexadecimal #0F

Example 9:Binary #00010000 = Decimal #16 = Hexadecimal #10

Time for you to learn from the manuals, and possibly Wikipedia (for the hex math). A good book on Apple Assembly language would be fine too, once you've mastered BASIC.

Mutant Pie

A2forever's picture
Offline
Last seen: 6 years 10 months ago
Joined: Dec 20 2003 - 10:38
Posts: 226
Thankyou..

Mutant Pie;

thanks ever so much for the excellent info , will check it out , remember , its been over 20 years since I even concidered messing with any BASIC COMMANDS.

Thanks again.

A2forever

2Eor2C's picture
Offline
Last seen: 12 years 4 months ago
Joined: Dec 19 2003 - 14:45
Posts: 39
Simple as pie

A2forever-

Here's a neat prog called The Grafx FiLeR that'll let you easily save HGR and HGR2 pictures. It's no hassle! BSaving pictures becomes easy as a cake : simply boot (PR#6) the disk with the screen you want to save showing ; after that just follow thru the menus. You can even rotate, flip, swap and inverse at will. Has many other cool built-in features as well! Give it a try and you won't ever have to remember all the A$ and L$ gimmick again! Smile

IMAGE(http://img292.imageshack.us/img292/3880/gfxfilerbwmc7.jpg)
Just click above to get the Apple II disk image file : gfxfiler.dsk.gz (55KB)

Apple II Forever!

Offline
Last seen: 16 years 1 month ago
Joined: Mar 6 2008 - 06:10
Posts: 1
To begin with for everyone's

To begin with for everyone's benefit, BSAVE Means BINARY SAVE and BLOAD means BINARY LOAD, and any part of the Apple II's memory can be BSaved to disk and BLoaded again later. The A$ is the address of the memory being saved in hex (hexadecimal which is base 16) and the L$ is the length of the chunk of memory being saved.

My wikipedia article at http://en.wikipedia.org/wiki/BSAVE_(graphics_image_format) will tell you what you might have forgotten about some of this.

If you want to BSave some Apple II images in Windows XP you can download a copy of my ClipShop program at http://www.clipshop.ca/ and also read ClipShop's helpfile.

You might also want to download my Apple II screen demo diskimage at http://www.clipshop.ca/DiskImages/index.htm which has a slideshow program for HGR written in BASIC included.

And if you are seriously interested in taking this further I have another web page that you may want to visit at http://www.clipshop.ca/Aztec/index.htm which will get you started.

The following example in the C programming language describes the difference between the two screen addresses and the two graphics modes (mixed text and graphics) and graphics only on the Apple II. The selection of the screen mode is independent of the screen address.

#define PAGEONE poke(49236,0)
#define PAGETWO poke(49237,0)
#define TEXTMODE 0
#define GRAFMODE 2 /* graphics only */

setcrtmode(CRTMODE)
unsigned int CRTMODE;
{
switch(CRTMODE)
{
case TEXTMODE:
poke(49233,0);
PAGEONE;
break;
default :
poke(49239,0); /* hi res */
PAGETWO ; /* avoid prodos load address */
poke(49232,0); /* set graphics */
poke(49234,0); /* full graphics */

}

}

The following example in the C programming language BSAVES a HI-RES screen which is 280 pixels x 192 rasters (or L$2000 = 8192 bytes) in length in the screen memory area. If we were to BSAVE a mixed text and graphics mode screen we would still be BSAVING the whole screen area since the display on the Apple II is interleaved, even though only 160 rasters displays.

/* bsave a file from hires screen 2 */

bsave(savex)
char *savex;
{
int fh;

if((fh=bopen(savex, O_WRONLY|O_TRUNC|O_CREAT,0xc3)) != -1)
{
write(fh,(char *)0x4000,0x2000);
close(fh);
}
}

The following is the complimentary BLOAD command written in the C programming language.

bload(name)
char *name;
{
int fh;
fh = open(name,O_RDONLY,0xc3);
read(fh,(char *)0x4000,0x2000);
close(fh);
}

Bill Buckels

Log in or register to post comments