home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 128 24
/
q24.d81
/
t.magniprint
< prev
next >
Wrap
Text File
|
2022-08-28
|
6KB
|
148 lines
M A G N I P R I N T
by e. g. bell
Leave it to ed bell to come up with a new wrinkle on an old idea --
the screen dump. His small (5-block) routine allows a program to print
out anything that's displayed by the VDC chip, which can even be a 40-
column picture. The routine has several parameters so the printout can be
reversed, heightened, lengthened, and printed at different densities.
There are two versions of this 5-block ML routine on the disk. They
are called:
"magniprint.0b00" and
"magniprint.1300"
The only difference is the location at which they're assembled.
Generally, $1300 is a good place for 128 ML routines if you've opened up
the graphic area with a GRAPHIC1,1:GRAPHIC0:GRAPHIC5 sequence.
If the picture you want to print is a 40-column pic (like a DOODLE)
MAGNIPRINT looks at the graphic area (which is 40-columns), transfers the
data to the VDC chip, doubling each pixel horizontally so that the 80-
column screen now shows what would be on the 40-column screen if your
monitor was set for 40-columns. Then it prints the screen.
If you have an 80-column hi-res picture showing then MAGNIPRINT simply
prints out what is on your screen.
Here are the lines you need to have in your program in order to use
MAGNIPRINT. These are taken straight from the BASIC code for "library
print", which doubles as a demo for MAGNIPRINT and is found on Side Two of
LOADSTAR 128 #24.
20 dv=peek(186):ifdv<8thendv=8
30 scnclr:graphic1,1:graphic0:graphic5:fast
40 tem=dec("0b00")
50 bload"magniprint.0b00",u(dv),b0,p2816
These are needed near the beginning of your program to get MAGNIPRINT in
place.
Now it's time to get what you're going to print into the graphics area
($2000-$3fff). It could be drawn there by BASIC 7.0 commands like LINE,
CIRCLE, etc. Or it could be a hi-res picture like a Doodle picture, or
even one that has only a bitmap and no color. I personally would always
use a Doodle pic because I like Doodle and can draw with it. The BASIC
7.0 graphics commands are too slow for most uses, and anyway, in an 80-
column program the picture would have to be drawn blindly on the 40-column
screen. Of course, that may suit your purposes even better. Here's how
to load a 40-column hi-res pic.
400 bank15:bload"ddpic",u(dv),p7168:system
Doodle stores its pics with the color first ($1c00-1fff) followed by the
bitmap ($2000-3fff). 7168 is the decimal equivalent of $1c00 so the
Doodle pic will load at 7168 and the bitmap will be at the right place for
MAGNIPRINT. OCP ART STUDIO pics start with the bitmap and have the color
data after, so after you have chopped off the color and saved just the
bitmap with a machine language monitor:
s "ocp hi-res bitmap",08,2000,3fff
you can load load the pic with this command:
400 bank15:bload"ocp hi-res bitmap",u(dv),p8192:system
A pic without color data (like an FGM picture) would load the same way as
the OCP pic. [I'm afraid I know so little about the 80-column graphic
mode that I hesitate to say how to handle it, although ed assures me that
MAGNIPRINT will print what's on the 80-column graphic screen -- if you can
get something to show there. In my experience, David Darus' BASIC 8 is
the way to display 80-column graphics and it has its own super print
routines.]
Then, before you can display and print what's in the graphic area, you
need to set up the printer and some parameters. Like this:
430 close3:open3,4,7 :rem open channel to printer
440 poke250,0 :rem density 0=standard, 1=double,
2=double speed-double density,
3=quadruple density
450 poke251,0 :rem width 0=single, 128=double,
192=quadruple
460 poke252,0 :rem height 0=single, 128=double,
192=quadruple
470 poke253,0 :rem reverse 0=normal, 128=reverse
480 poke254,41 :rem columns 41=epson mode, 42=1525 mode,
80=80 column mode
490 poke166,0 :rem mode 0=epson, 1=1525
500 poke167,32 :rem bitmap only change this if your bitmap
is not at $2000 (8192)
510 ifmo=0thenprint#3,chr$(27)"a"; :rem epson tab
520 print#3,chr$(8) :rem graphic mode
To save room you can put all the POKEs on the same line. Now you are
ready to display and print.
530 system+3
The picture will be displayed and printed in a correctly proportioned,
small size. The printer will need to be reset, however.
540 ifmo=0thenprint#3,chr$(27)chr$(64):elseprint#3,chr$(15)
550 print#3:close3
These lines reset your printer for either mode.
But now you need to clear up your screen, which is showing the 40-
column picture on the 80-column screen. This next line does it, at the
expense of reinitializing just about everything. If you've moved BASIC up
to $4000 with a GRAPHIC1,1:GRAPHIC0:GRAPHIC5 sequence you need to redo it.
If you've set up a custom font, or are using a BASIC extension like
CONTROL80, you will need to re-install CONTROL80 (with a sys4864) and
reload and re-install the font. In LIBRARY PRINT I have the program go
back to line 70, which does the re-initialization of CONTROL80. Your
program will have to take care of what happens after you use these lines:
580 bank15:sys52684,71,25:sys65378:sys49152
590 graphic1,1:graphic0:graphic5
I recommend using the parameters listed above for testing your
program. Once you've got it printing correctly, you can try changing the
parameters.
MAGNIPRINT AND CONTROL80 TOGETHER
---------------------------------
Since CONTROL80 is only assembled at $1300, you must use the $0b00
version of MAGNIPRINT. Other than the fact that you have to re-install
CONTROL80 after printing with MAGNIPRINT, they work together quite well.
Check out the well-remarked code in LIBRARY PRINT to see how it's done.
FT
\\\\\ RETURN - Menu \\\\\