Program StarScrl_Demo; (* This program is a replica of StarScroll Demo Copyright Chris Wootton, 1990 which was published as a 10 Liner in Oct 1990 edition of Amstrad Computer User. Coding wise a lot of alterations were applied to produce a similar program (e.g. an area has been setup in memory for the matrix of the space ship and a Screen Hardware Roll has been used to generate the scrolling effect), otherwise the main difference in this version is the dreded 'ANY' key will Return you to CP/M! :) For those interested in the original program can download ACU1990.ZIP and find the original in ACU90B.DSK under the name of STARSCRL.BAS *) {$C-,U-} {$I FIRMWARE.LIB} (* While some routines in this program are CPC Specific, this Library file is used to bring additional CPC Specific routines into effect. *) const ship : array[0..15] of byte = (1,1,65,67,71,127,67,1, 128,128,130,194,226,254,194,128); var buffer : array[0..15] of byte absolute $AFA0; Procedure SetupScreen; Begin MODE(0); INK(0,0); INK(1,26); INK(2,26); INK(3,13); INK(4,6); BORDER(0); End; Procedure TXTSETMTABLE; { This routine sets up a Text Matrix Table which points to the Buffer array at $AFA0} Begin Inline($11/$FE/$00/ $21/$A0/$AF/ $CD/$9B/$BE/ $AB/$BB); End; Procedure SetupShip; { This bit of code simply copies the data for the Space Ship to the Matrix Area } var count : byte; begin for count:=0 to 15 do mem[$AFA0+count]:=ship[count]; end; Procedure SCR_HW_ROLL; { Used for Scrolling the Screen } begin Inline($06/$00/ $3E/$00/ $CD/$9B/$BE/ $4D/$BC); end; function testcpm : byte; { This program will only run in CP/M v2.2 } begin if (bdos($0c)<>$22) then begin testcpm:=0; writeln('Sorry this program will only run in CP/M 2.2'); end; end; var myship : string[2]; xpos : byte; xdir : integer; BEGIN { Main Routine } while (testcpm<>0) do begin Setupscreen; txtsetmtable; setupship; pen(4); myship:=chr(254)+chr(255); xpos:=16; xdir:=-1; Repeat xpos:=xpos+xdir; case xpos of 2 : xdir:=1; 18 : xdir:=-1; end; grapen(random(3)+1); plot(random(638),398); SCR_HW_ROLL; gotoxy(xpos,25); frame; write(myship); frame; until keypressed; pen(1); mode(2); resetcolor; testcpm:=0; end; { While Statement } END. { Main Routine }