home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / GXY-INF.LHA / infos / install.s < prev    next >
Encoding:
Text File  |  1996-03-09  |  6.0 KB  |  270 lines

  1.                 include "dh0:code/include/exec/exec_lib.i"
  2. last    =    2*20        * letzter Block (11*79*2)
  3.  
  4.  
  5.  
  6. _LVOOutput     equ    -60        ;DOS: Output-Handle holen
  7. _LVOWrite     equ    -48        ;     Ausgabe
  8.  
  9. x:        move.l    a0,clineadd    * cli-command  addr
  10.         move.l    d0,clinelen    * cli-command  lenght
  11.  
  12.         move.l    #databuffer+2,datavector
  13.         move.l    #databuffer+512,curbufvector
  14.  
  15.  
  16.  
  17. _main        move.l    #dosname,a1        ;Name der DOS-Lib 
  18.         moveq    #0,d0            ;Version egal
  19.         move.l  _SysBase,a6        ;Basis Exec
  20.            jsr     _LVOOpenLibrary(a6)    ;DOS-Lib oeffnen
  21.         tst.l    d0            ;Fehler?
  22.         beq    fini            ;wenn Fehler, Ende
  23.         move.l    d0,DOSBase        ;Zeiger merken
  24.  
  25.         move.l    #curoff,tsource
  26.         move.l    #5,tlaenge
  27.         bsr    print
  28.  
  29.         move.l    #addtext,tsource
  30.         move.l    #(addtexte-addtext),tlaenge
  31.         bsr    print
  32.  
  33.         move.l    #text1,tsource
  34.         move.l    #(text1e-text1),tlaenge
  35.         bsr    print
  36.  
  37. mouse:        btst    #6,$bfe001
  38.         bne    mouse
  39.  
  40.                 move.l    #0,a1
  41.                 CALLEXEC FindTask               * Task suchen
  42.                 move.l  d0,ReplyPort+16            * MsgPort
  43.                 lea     ReplyPort,a1            * initialisieren und
  44.                 CALLEXEC AddPort                * einfügen
  45.  
  46.  
  47.                 lea     DiskIO0,a1              * IOTrackDisk laden
  48.                 move.l  #0,d0            * Laufwerk  dfx (0)
  49.                 moveq   #0,d1                   * keine Spezial-Flags
  50.                 lea     DevName,a0              * Name des Devices
  51.                 CALLEXEC OpenDevice             * Device öffnen
  52.         tst.l   d0                      * hat's geklappt?
  53.                 beq    drive1device       
  54.  
  55.         move.l    #noDrive0,tsource
  56.         move.l    #(noDrive0e-nodrive0),tlaenge
  57.         bsr    print
  58.         bra    Abort          
  59.  
  60. drive1device:
  61.  
  62.  
  63. ******************************************************************************
  64. starttest:    bsr    enter
  65.  
  66.         move    databuffer,d7
  67.         subq    #1,d7
  68.  
  69. nextblock:
  70.         move.l    curbufvector,a2
  71.         move.l    datavector,a3            
  72.         moveq    #0,d4
  73.         move    (a3),d4        * block auf der disk
  74.  
  75.         bsr    writeBlock
  76.  
  77.         add.l    #2,datavector
  78.         add.l    #512,curbufvector
  79.  
  80.         dbf    d7,nextblock        
  81. ****************************************************************************** 
  82.  
  83.         move.l    #endtxt,tsource
  84.         move.l    #endtxte-endtxt,tlaenge
  85.         bsr    print
  86.  
  87. endoftest:    
  88.  
  89.         jsr    -132(a6)
  90.         move.l    d0,$60004
  91.  
  92. ende:
  93.         lea     DiskIO0,a1
  94.                 CALLEXEC CloseDevice            * Device schließen
  95.  
  96.  
  97.  
  98. Abort:        lea     ReplyPort,a1
  99.         CALLEXEC RemPort                * Port entfernen
  100.  
  101. ente:
  102.  
  103.         move.l    #curon,tsource
  104.         move.l    #5,tlaenge
  105.         bsr    print
  106.  
  107.         move.l    DOSBase,a1        ;Basis der Lib
  108.         move.l  _SysBase,a6        ;Basis Exec
  109.             jsr     _LVOCloseLibrary(a6)    ;Funktion "Schliessen"
  110.  
  111.  
  112.  
  113. fini:
  114.         move.l    #00000,d0
  115.         rts                ;Return zum CLI
  116.  
  117.  
  118.  
  119.  
  120. ******************* S U B R O U T I N E S *******************************
  121.  
  122. writeBlock:    
  123.  
  124.  
  125.                 lea     DiskIO0,a1                                         
  126.                 move.l  #ReplyPort,14(a1)       * Nachrichten-Port laden
  127.         move.w  #3,28(a1)        * Kommando: schreiben
  128.         move.l  #512,36(a1)        * Länge: 512 Bytes * track
  129.         move.l  a2,40(a1)        * Adresse
  130.         asl.l    #8,d4
  131.         asl.l    #1,d4
  132.                 move.l    d4,44(a1)        * Byte-Offset startblock    
  133.         movem.l d1-d3/a1-a3,-(SP)               
  134.                 CALLEXEC DoIO                    
  135.         movem.l (SP)+,d1-d3/a1-a3    
  136.         move    d0,error
  137.         beq    return
  138.  
  139.         move.l    #noDisk0,tsource
  140.         move.l    #(noDisk0e-nodisk0),tlaenge
  141.         bsr    print
  142.         move.l    (sp)+,a0
  143.         bra    ende
  144.  
  145. return:
  146.                 lea     DiskIO0,a1                                         
  147.         move.w    #04,28(a1)        * Kommando: update
  148.         movem.l d1-d3/a1-a3,-(SP)               
  149.                 CALLEXEC DoIO                     
  150.         movem.l (SP)+,d1-d3/a1-a3    
  151.         rts                
  152.  
  153.             
  154. trackprint:
  155.         moveq    #0,d0
  156.         move    curblock,d0
  157.         beq    trpri_0
  158. trpri_0:    divu    #11,d0
  159.         lea     printbuffer,a0
  160.         move.b    #"0",(a0)
  161.         cmp    #100,d0
  162.         bmi    trpri_1
  163.         move.b    #"1",(a0)
  164.         sub    #100,d0
  165. trpri_1:    
  166.         lea    1(a0),a0
  167.         move.l    d0,d1
  168.         divu    #10,d0                
  169.         move.b    d0,(a0)
  170.         add.b    #$30,(a0)+
  171.         mulu    #10,d0
  172.         sub    d0,d1
  173.         move.b    d1,(a0)
  174.         add.b    #$30,(a0)+
  175.         move.b    #":",(a0)+
  176.         move.b    #" ",(a0)+
  177.         move.l    #printbuffer,tsource
  178.         move.l    #5,tlaenge
  179.         bsr    print
  180.         rts
  181.  
  182. enter:        move.l    #enterc,tsource
  183.         move.l    #1,tlaenge
  184.         bsr    print
  185.         rts
  186.  
  187. Print:            move.l    DOSBase,a6        ;DOS-Funktion rufen    
  188.         jsr    _LVOOutput(a6)        ;Hole Output-Handle
  189.         move.l    d0,d1            ;und in d1 merken
  190.  
  191.         move.l    tsource,d2        ;Address Text
  192.         move.l    tlaenge,d3            ;Laenge Text
  193.             move.l  DOSBase,a6             ;Basis DOS
  194.         jsr    _LVOWrite(a6)        ;Funktion "Schreiben"
  195.         rts
  196.  
  197.  
  198.  
  199.  
  200. *********************** Datenbereich **********************************
  201. savecounter:    dc.w    0        * anzahl der gesavten blöcke    
  202. datavector:    dc.l    0        * auf akkt DATENstand 
  203. curbufvector:    dc.l    0        * auf akkt BUFFERstand
  204. curgameblock:    dc.l    0        * zwischenspeicher  
  205. curtrainblock:    dc.l    0        * zwischenspeicher  
  206. curtrack:    dc.w    0        * akueller track
  207. curblock:    dc.w    0        * akueller block     
  208. lasblock:    dc.w    1749        * letzer track
  209.  
  210. clineadd:    dc.l    0        * cli-command
  211. clinelen:    dc.l    0        * cli-command
  212.  
  213. error:        dc.w    0        * ErrorStatus
  214. drive:        dc.l    0        * DFx (?)
  215. *********************** Datenbereich **********************************
  216.  
  217. tsource:    dc.l    0
  218. tlaenge:    dc.l    0
  219. DiskIO0:         ds.b     80                         * IOStdReq-Record drive 0
  220. ReplyPort:      ds.b     34                         * MsgPort-Record
  221. DevName:        dc.b     "trackdisk.device",0
  222.          even
  223.  
  224. Memory:         dc.l    0
  225.  
  226. DOSBase:     dc.l    0
  227. dosname:    dc.b    'dos.library',0
  228.          even
  229.  
  230.  
  231. text1:        dc.b       10,$1B,$5B,$31,$6D
  232.         dc.b    "                       Install the trainer now"
  233.         dc.b    $1B,$5B,$3b,$6D,10,"                   "
  234.         dc.b     "insert game disk in df0: and press mouse "
  235. text1e:        even
  236.  
  237. noDisk0:    dc.b    10,"No Disk in Drive df0:",10
  238. noDisk0e:    even
  239. noDrive0    dc.b    "Drive df0: not ready",10
  240. noDrive0e:    even
  241. endtxt:        dc.b    "                              All work done!",10
  242. endtxte:    even
  243. curoff:        dc.b    $1b,"[0 p"
  244.         even
  245. curon:        dc.b    $1b,"[1 p"
  246.         even
  247. nul:        dc.b    "0"
  248.         even
  249. one:        dc.b    "1"
  250.         even
  251. next:        dc.b    " "
  252.         even
  253. enterc:        dc.b    10
  254.         even
  255. equal:        dc.b    $1b,"[32m."
  256.         even
  257. nequal:        dc.b    $1b,"[31m."
  258.         even
  259. line:        dc.b    $1b,"M"        * return + Crs 1 zeile hoch
  260.         even
  261. printbuffer:    ds.b    100
  262.         even
  263. addtext:    incbin    "dh0:dfue/down/dytec.new"
  264. addtexte:                    * ADDZEXT *-*-*
  265.     
  266.         even
  267. databuffer:    
  268.         incbin    "dh0:test2.dat"        * DAtenfile von COMPARE
  269.  
  270.