I have added the file access instructions:
FOPEN, FCLOSE, FREAD, FWRITE, FDELETE, FSCRATCH, FSAVE, FLOAD, FRESTORE, FSTATUS.
To show this, I have made a program that replays a very little movie direct from disk:
Note that the first screen with scrolling title is in extended Basic and you'll notice the speed display when it goes to the Assembly routine for the animation.
Note 2: the FastLoader has been upgraded, you can see that at the very beginning, only few seconds are required to load and compile.
Here is the source code:
100 CALL CLEAR::DIM A$(60)
$MLC X 110 10 3000
300 GOSUB 1500::CALL CHAR(48,"7EFFFFFFFFFFFF7E")
330 CALL CLEAR::CALL LINK("TINTIN",Z)
335 CALL CLEAR::PRINT "THE END..."::END
;
; here define theborder for the film effect
;
1500 CALL CHAR(96,"C0C0C0FFFFFFFFFF060606FEFEFEFEFEC0C0C0C0C0C0C0C00606060606060606")
;
; borders white on black
; and text yellow on black
;
1510 RESTORE 2000::CALL CLEAR::CALL SCREEN(2)::CALL COLOR(9,16,2)
1515 FOR I=1 TO 8::CALL COLOR(I,12,2)::NEXT I
;
; display text with borders and centers
;
1520 READ R$::I=LEN(R$)::J=INT(I/2)::IF I=0 THEN RETURN
1530 PRINT "`a"&RPT$(" ",12-J)&R$&RPT$(" ",12+J-I)&"`a";
1540 READ R$::I=LEN(R$)::J=INT(I/2)::IF I=0 THEN RETURN
1550 PRINT "bc"&RPT$(" ",12-J)&R$&RPT$(" ",12+J-I)&"bc";::GOTO 1520
2000 DATA " "," ","WELCOME TO A NEW WORLD"
2010 DATA " "," "," "," "
2020 DATA "NO 3D EFFECT"," "," "," "
2030 DATA "NO SOUND"," "," "," "
2040 DATA "NO COLOR"," "," "," "
2050 DATA "NO STORY"," "," "," "
2060 DATA "NO SPEILBERG"," "," "," "
2070 DATA " "
2080 DATA "ONLY..."
2090 DATA " "," "," "," "," "," "," "," "," "," "," "," ",""
;
; here MLC routine TINTIN
;
$TINTIN
HIGHMEM 0
SCREEN 1 ; black background
FOR I 12 15
COLOR I 16 1 ; white on black for the "movie"
NEXT
FOR I 4 11
COLOR I 3 1 ; green for text
NEXT
COLOR 6 4 1 ; light green for great title
STARTDATA
STRING " PURE... "
STRING " "
STRING " 0 0 0 00 0 0 0 00 "
STRING "000 00 0 000 00 0 "
STRING " 0 0 0 0 0 0 0 0 "
STRING " 0 0 0 0 0 0 0 0 "
STRING " 0 0 0 0 0 0 0 0 0 0 "
STRING " 00 00 000 000 00 00 000 000"
STRING " "
STRING " `flrx "
STRING " agmsy "
STRING " bhntz "
STRING " ciou{ "
STRING " djpv| "
STRING " ekqw} "
STRING " "
STRING " DIRECT STREAM FROM DISK! "
STRING " (MY LITTLE COMPILER) "
ENDDATA M
;
; this assembly routine turns every ASCII char to
; its screen equivalent: ASCII+96
;
$[
mov @M,r0 ; points to text bloc
li r1,>6060 ; offset for XB characters on screen
li r2,288 ; 18 lines with 16 words
; here
a r1,*r0+ ; add offset to chars
dec r2 ; counter
jne -3 ; jump "here" if not finished
$]
BMOVECTOV M 576 96 ; copy text to third screen line
STARTDATA ; prepares the PAB for file access
BYTE 0 ; no Opcode for now
FLAGS sequential, internal, fixed, input
WORD 1536 ; address for definition of char 96 and followings
BYTE 240 ; max length
BYTE 240 ; length
WORD 0 ; no rec number for sequential
BYTE 0 ; offset unused
BYTE 10 ; name is 10 bytes long
STRING "DSK1.VIDEO"
ENDDATA A
LET B &h831A
GETTABLE B(0) P ; peek(831A) = VDP address of free space
SUB P 22 ; place for PAB so P = PAB ADDRESS
BMOVECTOV A 22 P ; copy PAB to VDP Ram
FOPEN P ; open the file
IF= ; if OK, go on!
REPEAT
FRESTORE P ; to beginning of file
NDO N 5 ; five images
PUTTABLE P(5) 240 ; size to read.
FREAD P ; read 240 bytes into char defs
NDO X 3000 ; little wait loop
NLOOP
NLOOP
KEY 0 ; a key pressed?
UNTIL>= ; if no, go on
ENDIF
PUTPARAM 1 Z ; return Z, the file error code (if any)
$$
$END
Guillaume.
Edited by moulinaie, Mon Jan 9, 2012 4:35 PM.














