{APLGR/G.INC enables calling graphics routines in Apple's ROMs from Turbo Pascal programs. Requires the PCPI Z80 card (Applicard). Copyright 1984 by N.T.Carnevale. Permission granted for nonprofit use.} {Include after PCP and before APLGR/L or APLGR/H} {contains these routines used by both hi- & lores graphics: PROCEDURE _setpartition(part:partition); PROCEDURE _selectpage(pagenum:integer); PROCEDURE textscreen(pagenum:integer); } CONST _BPL=40; {# bytes/line of hi or lo res display} {software switches for control of graphics features} _GRFX=$C050; _TXT=$C051; _FULSCRN=$C052; _MXD=$C053; _PG1=$C054; _PG2=$C055; _LRS=$C056; _HRS=$C057; {temporary storage for parameters} _AREG=$9000; _YREG=$9001; _LOCXX=$9002; _XREG=$9002; TYPE partition=(FULLSCREEN,MIXED); _screenmode=(TEXT,GRAPHICS); (*********************************************************) PROCEDURE _setpartition(part:partition); {switch between full screen graphics and mixed text/graphics} BEGIN CASE part OF FULLSCREEN: _wrhostbyte(_FULSCRN,0); MIXED: _wrhostbyte(_MXD,0); END; END; PROCEDURE _selectpage(pagenum:integer); {switch to specified graphics page} BEGIN IF pagenum=1 THEN _wrhostbyte(_PG1,0) ELSE IF pagenum=2 THEN _wrhostbyte(_PG2,0) ELSE writeln('There is no page ',pagenum); END; PROCEDURE textscreen(pagenum:integer); {switch to specified text screen} BEGIN _selectpage(pagenum); _wrhostbyte(_TXT,0); END; FUNCTION _inrange(n,lolimit,hilimit:integer):boolean; {test for value outside of limits--used to prevent drawing outside the screen boundaries} BEGIN IF (n>=lolimit) AND (n<=hilimit) THEN _inrange:=TRUE ELSE _inrange:=FALSE; END; {end of APLGR/G}