;
; ALL APPLI NEAD TO START WITH THIS AND TO END WITH THE BOTTOM'S LABEL'S
;
; PILI BINARY MAIN  = main code, always called in first, need to be only once in memory
; PILI BINARY xxxx  = programme chain‚ (maxi 9999), each header needs to exist only once
pili_header:
     JR start                   ; jump to start of prog
     dl pili_bottom-pili_header ; /* size of binary image */
     db "PILI BINARY MAIN "     ; header for beta, main application
     db 0                       ; null terminate
     DL $+0                     ; Initialise $ counter here
;   information on the program
DispInfo:
     db 1                       ; No button=0, OK button=1 (same as infobox function)
     db " **** PILI HYPERTEXT DEMO **** "; infobox title
     db 0dh                     ; change line
     db "Written by P.Dehlinger            "; Informations
     db 0dh                     ; change line
     db "Graphics by Bo Lorentzen              "; Informations
     db 0dh                     ; change line
     $DATE_TIME                 ; get date and time of compile, (null terminate)



; include file for library definitions and virtual registers assignement
 include fncall.inc

;-----------------------------------------------------------------------------
;
;
;
; YOU PROGRAMM START
;

start:
     FNCALL16 DisplayImg,Ztext         ; display the picture
     FNCALL16 InfoBox,DispInfo,sto0    ; diplay the information window, no answers into registers if -1
     RLD32  sto2,100
     LOOP   sto2,$
;    FNCALL08 clearscreen,0            ; clear the screen

     RLD32  sto0,HyperFn           ; where to write the file name
     FNCALL08 SelectPcFile,sto0,sto1
     CMP08  sto1,1
     JRNZ   error

     FNCALL08 clearscreen,0        ; clear the screen

 ; filename address still in sto0
     FNCALL08 HyperHelp,sto0,sto1  ; display explication hypertext help
     CMP16  sto1,1000
     JRC    endprog
error:
     FNCALL08 clearscreen,1        ; clear the screen (inverted) => error
     RLD32  sto2,200
     LOOP   sto2,$
endprog:
     RESET                         ; restart program after end or error
; program data's
HyperFn:
     db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
     db 0

Ztext:
     dw ztext_bot-ztext_data  ; size of image
ztext_data:
  binclude ztextimg.bin
ztext_bot:

;-------------------------------------------------------------------------
;
;
;     *********************** END OF PROGRAMM *********************
;
;

pili_bottom: ; NEED TO BE THERE FOR HEADER

  end
