All good now, the keypress routine from above was forcing the Compiler "Run (Y/N)" Option to make it believe I didn't want to run it anymore, hence the Reset. I've resolve it with a KMRESET (&BB03) to flush the keyboard buffer as the program exits.
So today I've rewritten another BASIC Demo which produces an amazing Mosiac Pattern in Mode 1, it looked great from BASIC, though the transition as a result of compiling it is stunning.
10 PROGRAM Mosiac;
20 (* Written IN BASIC by Nigel Myers, Published IN AA45 TYPE-ins *)
30 {$C-}
40
50 VAR xpos : integer;
60 ypos : integer;
70 col1 : char;
80 col2 : char;
90 ch : boolean;
100
110 FUNCTION inc(num : char) : char;
120 BEGIN
130 inline(#DD,#34,#02);
140 inc:=num
150 END;
160
170 FUNCTION key(ch:char) : boolean;
180 BEGIN
190 inline(#DD,#7E,#02,
200 #CD,#1E,#BB,
210 #28,#05,
220 #3E,#01,
230 #DD,#77,#03)
240 END;
250
260 PROCEDURE kmreset;
270 BEGIN
280 user(#bb03)
290 END;
300
310 PROCEDURE mode(num : char);
320 BEGIN
330 ra:=num;
340 user(#bc0e)
350 END;
360
370 PROCEDURE ink(ink,col : char);
380 BEGIN
390 ra:=ink;
400 rb:=col;
410 rc:=col;
420 user(#bc32)
430 END;
440
450 PROCEDURE border(col : char);
460 BEGIN
470 rb:=col;
480 rc:=col;
490 user(#bc38)
500 END;
510
520 PROCEDURE move(x,y : integer);
530 BEGIN
540 rde:=x; rhl:=y;
550 user(#bbc0)
560 END;
570
580 PROCEDURE drawr(x,y : integer;col : char);
590 BEGIN
600 ra:=col;
610 user(#bbde);
620 rde:=x;
630 rhl:=y;
640 user(#bbf9)
650 END;
660
670 FUNCTION rnd(range : integer) : integer;
680 VAR seed : integer;
690 result : real;
700 BEGIN
710 seed:=random(0);
720 result:=(range/maxint);
730 result:=(seed*result);
740 rnd:=trunc(result)
750 END;
760
770 BEGIN
780 mode(chr(1));
790 ink(chr(0),chr(0));
800 ink(chr(1),chr(6));
810 ink(chr(2),chr(18));
820 ink(chr(3),chr(11));
830 border(chr(0));
840 write(chr(23));
850 write(chr(1));
860 col1:=chr(1);
870 col2:=chr(0);
880 xpos:=1;
890 ypos:=1;
900 REPEAT
910 ch:=key(chr(66));
920 move(xpos,ypos);
930 drawr(639-xpos*2,0,col1);
940 move(xpos,399-ypos);
950 drawr(639-xpos*2,0,col1);
960 move(xpos,ypos);
970 drawr(0,399-ypos*2,col2);
980 move(639-xpos,ypos);
990 drawr(0,399-ypos*2,col2);
1000 ypos:=ypos+2;
1010 IF ypos>399 THEN BEGIN
1020 ypos:=1;
1030 col2:=chr(rnd(4))
1040 END;
1050 xpos:=xpos+4;
1060 IF xpos>639 THEN BEGIN
1070 xpos:=1;
1080 col1:=inc(col1)
1090 END;
1100 IF col1>chr(3) THEN col1:=chr(1);
1110 UNTIL ch=true;
1120 kmreset
1130 END.
[attachimg=1]