home *** CD-ROM | disk | FTP | other *** search
- include "dh0:code/include/exec/exec_lib.i"
- last = 2*20 * letzter Block (11*79*2)
-
-
-
- _LVOOutput equ -60 ;DOS: Output-Handle holen
- _LVOWrite equ -48 ; Ausgabe
-
- x: move.l a0,clineadd * cli-command addr
- move.l d0,clinelen * cli-command lenght
-
- move.l #databuffer+2,datavector
- move.l #databuffer+512,curbufvector
-
-
-
- _main move.l #dosname,a1 ;Name der DOS-Lib
- moveq #0,d0 ;Version egal
- move.l _SysBase,a6 ;Basis Exec
- jsr _LVOOpenLibrary(a6) ;DOS-Lib oeffnen
- tst.l d0 ;Fehler?
- beq fini ;wenn Fehler, Ende
- move.l d0,DOSBase ;Zeiger merken
-
- move.l #curoff,tsource
- move.l #5,tlaenge
- bsr print
-
- move.l #addtext,tsource
- move.l #(addtexte-addtext),tlaenge
- bsr print
-
- move.l #text1,tsource
- move.l #(text1e-text1),tlaenge
- bsr print
-
- mouse: btst #6,$bfe001
- bne mouse
-
- move.l #0,a1
- CALLEXEC FindTask * Task suchen
- move.l d0,ReplyPort+16 * MsgPort
- lea ReplyPort,a1 * initialisieren und
- CALLEXEC AddPort * einfügen
-
-
- lea DiskIO0,a1 * IOTrackDisk laden
- move.l #0,d0 * Laufwerk dfx (0)
- moveq #0,d1 * keine Spezial-Flags
- lea DevName,a0 * Name des Devices
- CALLEXEC OpenDevice * Device öffnen
- tst.l d0 * hat's geklappt?
- beq drive1device
-
- move.l #noDrive0,tsource
- move.l #(noDrive0e-nodrive0),tlaenge
- bsr print
- bra Abort
-
- drive1device:
-
-
- ******************************************************************************
- starttest: bsr enter
-
- move databuffer,d7
- subq #1,d7
-
- nextblock:
- move.l curbufvector,a2
- move.l datavector,a3
- moveq #0,d4
- move (a3),d4 * block auf der disk
-
- bsr writeBlock
-
- add.l #2,datavector
- add.l #512,curbufvector
-
- dbf d7,nextblock
- ******************************************************************************
-
- move.l #endtxt,tsource
- move.l #endtxte-endtxt,tlaenge
- bsr print
-
- endoftest:
-
- jsr -132(a6)
- move.l d0,$60004
-
- ende:
- lea DiskIO0,a1
- CALLEXEC CloseDevice * Device schließen
-
-
-
- Abort: lea ReplyPort,a1
- CALLEXEC RemPort * Port entfernen
-
- ente:
-
- move.l #curon,tsource
- move.l #5,tlaenge
- bsr print
-
- move.l DOSBase,a1 ;Basis der Lib
- move.l _SysBase,a6 ;Basis Exec
- jsr _LVOCloseLibrary(a6) ;Funktion "Schliessen"
-
-
-
- fini:
- move.l #00000,d0
- rts ;Return zum CLI
-
-
-
-
- ******************* S U B R O U T I N E S *******************************
-
- writeBlock:
-
-
- lea DiskIO0,a1
- move.l #ReplyPort,14(a1) * Nachrichten-Port laden
- move.w #3,28(a1) * Kommando: schreiben
- move.l #512,36(a1) * Länge: 512 Bytes * track
- move.l a2,40(a1) * Adresse
- asl.l #8,d4
- asl.l #1,d4
- move.l d4,44(a1) * Byte-Offset startblock
- movem.l d1-d3/a1-a3,-(SP)
- CALLEXEC DoIO
- movem.l (SP)+,d1-d3/a1-a3
- move d0,error
- beq return
-
- move.l #noDisk0,tsource
- move.l #(noDisk0e-nodisk0),tlaenge
- bsr print
- move.l (sp)+,a0
- bra ende
-
- return:
- lea DiskIO0,a1
- move.w #04,28(a1) * Kommando: update
- movem.l d1-d3/a1-a3,-(SP)
- CALLEXEC DoIO
- movem.l (SP)+,d1-d3/a1-a3
- rts
-
-
- trackprint:
- moveq #0,d0
- move curblock,d0
- beq trpri_0
- trpri_0: divu #11,d0
- lea printbuffer,a0
- move.b #"0",(a0)
- cmp #100,d0
- bmi trpri_1
- move.b #"1",(a0)
- sub #100,d0
- trpri_1:
- lea 1(a0),a0
- move.l d0,d1
- divu #10,d0
- move.b d0,(a0)
- add.b #$30,(a0)+
- mulu #10,d0
- sub d0,d1
- move.b d1,(a0)
- add.b #$30,(a0)+
- move.b #":",(a0)+
- move.b #" ",(a0)+
- move.l #printbuffer,tsource
- move.l #5,tlaenge
- bsr print
- rts
-
- enter: move.l #enterc,tsource
- move.l #1,tlaenge
- bsr print
- rts
-
- Print: move.l DOSBase,a6 ;DOS-Funktion rufen
- jsr _LVOOutput(a6) ;Hole Output-Handle
- move.l d0,d1 ;und in d1 merken
-
- move.l tsource,d2 ;Address Text
- move.l tlaenge,d3 ;Laenge Text
- move.l DOSBase,a6 ;Basis DOS
- jsr _LVOWrite(a6) ;Funktion "Schreiben"
- rts
-
-
-
-
- *********************** Datenbereich **********************************
- savecounter: dc.w 0 * anzahl der gesavten blöcke
- datavector: dc.l 0 * auf akkt DATENstand
- curbufvector: dc.l 0 * auf akkt BUFFERstand
- curgameblock: dc.l 0 * zwischenspeicher
- curtrainblock: dc.l 0 * zwischenspeicher
- curtrack: dc.w 0 * akueller track
- curblock: dc.w 0 * akueller block
- lasblock: dc.w 1749 * letzer track
-
- clineadd: dc.l 0 * cli-command
- clinelen: dc.l 0 * cli-command
-
- error: dc.w 0 * ErrorStatus
- drive: dc.l 0 * DFx (?)
- *********************** Datenbereich **********************************
-
- tsource: dc.l 0
- tlaenge: dc.l 0
- DiskIO0: ds.b 80 * IOStdReq-Record drive 0
- ReplyPort: ds.b 34 * MsgPort-Record
- DevName: dc.b "trackdisk.device",0
- even
-
- Memory: dc.l 0
-
- DOSBase: dc.l 0
- dosname: dc.b 'dos.library',0
- even
-
-
- text1: dc.b 10,$1B,$5B,$31,$6D
- dc.b " Install the trainer now"
- dc.b $1B,$5B,$3b,$6D,10," "
- dc.b "insert game disk in df0: and press mouse "
- text1e: even
-
- noDisk0: dc.b 10,"No Disk in Drive df0:",10
- noDisk0e: even
- noDrive0 dc.b "Drive df0: not ready",10
- noDrive0e: even
- endtxt: dc.b " All work done!",10
- endtxte: even
- curoff: dc.b $1b,"[0 p"
- even
- curon: dc.b $1b,"[1 p"
- even
- nul: dc.b "0"
- even
- one: dc.b "1"
- even
- next: dc.b " "
- even
- enterc: dc.b 10
- even
- equal: dc.b $1b,"[32m."
- even
- nequal: dc.b $1b,"[31m."
- even
- line: dc.b $1b,"M" * return + Crs 1 zeile hoch
- even
- printbuffer: ds.b 100
- even
- addtext: incbin "dh0:dfue/down/dytec.new"
- addtexte: * ADDZEXT *-*-*
-
- even
- databuffer:
- incbin "dh0:test2.dat" * DAtenfile von COMPARE
-
-