|
|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 940 (0x3ac)
Types: TextFile
Notes: UNIX file
Names: »f1.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
└─⟦2d53db1df⟧ UNIX Filesystem
└─⟦this⟧ »hr/src/desk/f1.c«
#include <stdio.h>
#include <smgr.h>
extern FONT_HEADER *aftable[];
char DEF_FONT[] = "/usr/hr/fonts/sysfont";
FM_init()
{
GETPTR f;
register int i;
extern int dskFntA,
dskFntH;
for ( i = 0; i < FM_MAXFONT; i++)
aftable[i] = (FONT_HEADER *)FONT_NULL;
i = FM_open(DEF_FONT);
if ( i != 0 )
{
fprintf(stderr, "Desktop font failed to open\n");
exit(0);
}
f.gfid = SYS_FID;
f.gch = ' ';
if ( FM_getch(&f) == -1 )
{
fprintf(stderr, "No desktop font parameters\n");
exit(0);
}
dskFntA = f.gascent;
dskFntH = f.gleading;
}
/*
**
*/
int *bmialloc(r)
register RECT r;
{
extern char *malloc();
return((int*)malloc(words_between(r.origin.x,r.corner.x)
*(r.corner.y-r.origin.y) << 1));
}
/*
**
*/
int words_between(left,right)
register int left,
right;
{
if (right <= left)
return 0;
left &= 0xfff0;
if ((right & 0x000f) != 0)
right = (right & 0xfff0) + 0x0010;
return ((right - left) >> 4);
}