home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Vectronix 2
/
VECTRONIX2.iso
/
FILES_07
/
LATTIC_3.ZIP
/
EXAMPLES
/
PRT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-05-14
|
1KB
|
69 lines
/*
* Emulate the Scrdmp() comnmand
*
* lc -L prt.c
*
* Copyright (c) 1990 HiSoft
*/
#include <osbind.h>
#include <stdlib.h>
#include <linea.h>
enum {MONO_ATARI, COLOUR_ATARI, DAISY, EPSON};
#define _prt_cnt 0x4ee
int lock(void)
{
*(short *)_prt_cnt=1; /* lock out ALT-Help handler */
}
int main(void)
{
static struct
{
char *blkptr;
unsigned short offset;
unsigned short width;
unsigned short height;
unsigned short left;
unsigned short right;
unsigned short srcres;
unsigned short dstres;
unsigned short *colpal;
unsigned short type;
unsigned short port;
char *masks;
} prt;
short palette[16];
short conf=Setprt(-1);
register int i;
prt.blkptr=Physbase(); /* dump the physical screen */
if (conf&1)
abort(); /* can't handle daisywheels */
else if (conf&4)
prt.type=EPSON;
else if (conf&2)
prt.type=COLOUR_ATARI;
else
prt.type=MONO_ATARI;
for (i=16; i--; )
palette[i]=Setcolor(i,-1);
prt.colpal=palette; /* get palette */
prt.port=(conf&16)>>4; /* port */
prt.srcres=Getrez(); /* screen resolution */
prt.dstres=(conf&8)>>3; /* printer resolution */
linea0(); /* init Line-A for _MAX */
prt.width=V_X_MAX; /* find screen width */
prt.height=V_Y_MAX; /* and height */
Supexec(lock); /* lock out ALT-Help */
return Prtblk(&prt); /* and dump */
}