home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG094.ARC
/
HIRES5A.I
< prev
next >
Wrap
Text File
|
1979-12-31
|
4KB
|
101 lines
{ Inline machine-code version of HiRes and HiDot with comments/mnemonics
Written by Daniel Prager 1986 }
{This code is an adaption of the HiDot function created by Daniel Prager 1986
to use the full Premium Graphics in Hires mode
modification by R.K.Hallworth, Donvale Christian School, April 1987}
Var ConOutAdr,CursPos :integer; {store location of bios VDU driver}
VDUstatus :array [1..5] of byte;{ESC,CURSPOS,LINE,UNDERLINE,INVERSE}
Const
UsedPCGs=0;
Procedure ClearHiRes;
Var RAMBank,PCGByte:integer;
Begin
port[28]:=144;
For PCGByte:=0 to $7FF do Mem[$F000+PCGByte]:=0;
port[28]:=128;
For PCGByte:=0 to $7FF do Mem[$F000+PCGByte]:=32
end;
Procedure VduOut(Ch:Char);
Var Bt,count,PCGNo,PCGBank:byte;
PCGPos:Integer;
Scratch : array [0..15] of Byte; {Scratch for desired PCG}
procedure StorePCG(Ch:Char);
begin
inline( {SELECT CHARACTER ROM ON}
$3E/ $01/ { LD A,1 }
$D3/ $0B/ { OUT (ROMPORT),A }
{Ord(Ch)*16 + $F000 }
$3A/CH/ { LD A,(CH) }
$6F/ { LD L,A }
$26/0/ { LD H,0 }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$29/ { ADD HL,HL }
$11/$F000/ { LD DE,$F000 }
$19/ { ADD HL,DE }
{Move Character to SCRATCH}
$11/SCRATCH/ { LD DE,SCRATCH }
$01/16/0/ { LD BC,16 }
$ED/$B0/ { LDIR }
$AF/ { XOR A }
$D3/ $0B { OUT (ROMPORT),A }
)
end;
Procedure Invert;
begin
inline( $06/16/ { LD B,16 }
$21/SCRATCH/ { LD HL,SCRATCH }
$7E/ {LOOP: LD A,(HL) }
$2F/ { CPL }
$77/ { LD (HL),A }
$23/ { INC HL }
$10/$FA) { DJNZ LOOP }
end;
Procedure ScrollUp(LineWidth:integer);
begin
inline( {Select Screen}
$18/14/ { JR START }
$11/$F000/ {MOVE: LD DE,$F000 }
{$21/$F040/} { LD HL,$F040 }
$2A/LineWidth/ { LD HL,(LineWidth) }
$26/$F0/ { LD H,$F0 }
$01/960/ { LD BC,960 }
$ED/$B0/ { LDIR }
$C9/ { RET }
$3E/ $00/ {:START LD A,0 }
$D3/ $0B/ { OUT (ROMPORT),A }
$CD/*-17/ { CALL MOVE }
$3E/144/ { LD A,144 }
$D3/28/ { OUT (28),A }
$CD/*-24/ { CALL MOVE }
$3E/128/ { LD A,128 }
$D3/28/ { OUT (28),A }
$3E/32/ { LD A,32 }
$06/64/ { LD B,64 }
$21/$F3C0/ { LD HL,$F3C0 }
$77/ {LOOP: LD (HL),A }
$23/ { INC HL }
$10/$FC) { DJNZ LOOP }
end;