home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Utilities
/
ACDPlay
/
src
/
V1.6
/
convert.s
< prev
next >
Wrap
Text File
|
1997-03-29
|
4KB
|
105 lines
* Konvertierungsprogramm für alte ACDPlay1.0/1.1-Konfigurationsdateien
* sollte am besten vom Installerskript aufgerufen werden
* Das Programm prüft, welche Version vorliegt und handelt dann
* entsprechend.
_LVOOpenLibrary EQU -552 * exec.library
_LVOCloseLibrary EQU -414
_LVOAllocVec EQU -684
_LVOFreeVec EQU -690
_LVOOpen EQU -30 * dos.library
_LVOClose EQU -36
_LVORead EQU -42
_LVOAllocDosObject EQU -228
_LVOFreeDosObject EQU -234
_LVOExamineFH EQU -390
move.l 4.w,A6
moveq #36,d0
lea DosName(pc),A1
jsr _LVOOpenLibrary(A6)
tst.l D0
beq.w Fehler_DosLib
lea DOSBase(pc),A0
move.l D0,(A0) * Adresse der Lib sichern
move.l D0,A6
move.l Filename(pc),D1 * Dateiname als Argument
move.l #1005,D2 * MODE_OLDFILE als Argument
jsr _LVOOpen(A6) * Open()
tst.l D0 * Ergebnis testen
beq.w Fehler_Open
lea FileHandle(pc),A0
move.l D0,(A0) * Struktur sichern
moveq #2,D1 * DOS_FIB als Argument
moveq #0,D2 * NULL für Tagliste
jsr _LVOAllocDosObject(A6) * AllocDosObject()
tst.l D0 * Ergebnis testen
beq.w Fehler_AllocDosObject
lea FIB(pc),A0
move.l D0,(A0) * FileInfoBlock sichern
move.l FileHandle(pc),D1 * FileHandle als Argument
move.l D0,D2 * FIB als Argument
jsr _LVOExamineFH(A6) * ExamineFH()
tst.l D0
beq.w Fehler_ExamineFH
move.l FIB(pc),A0 * Adresse des FIBs
move.l 17(A0),D0 * fib->fib_Size als Argument
tst.l D0 * aber erstmal testen
beq.w Fehler_ExamineFH
lea FIB_Size(pc),A0
move.l D0,(A0) * fib->fib_Size sichern
moveq #0,D1 * MEMF_ANY als Argument
move.l 4.w,A6 * ExecBase
jsr _LVOAllocVec(A6)
tst.l D0
beq.w Fehler_ExamineFH
lea Buffer(pc),A0
move.l D0,(A0) * Adresse sichern
move.l D0,D2 * Buffer als Argument
move.l FileHandle(pc),D1 * FileHandle als Argument
move.l FIB_Size(pc),D3 * fib->fib_Size als Argument
move.l DOSBase(pc),A6
jsr _LVORead(A6)
cmp.l FIB_Size,D0 * Vergleichen
bne.w Fehler_Read
Fehler_Read:
move.l Buffer(pc),A1
jsr _LVOFreeVec(A6)
Fehler_ExamineFH:
moveq #2,D1 * DOS_FIB als Argument
move.l FIB(pc),D2 * FIB als Argument
jsr _LVOFreeDosObject(A6)
Fehler_AllocDosObject:
move.l FileHandle(pc),D1 * FileHandle als Argument
jsr _LVOClose(A6) * Close()
Fehler_Open:
move.l DOSBase(pc),A1
move.l 4.w,A6
jsr _LVOCloseLibrary(A6)
Fehler_DosLib:
moveq #0,D0
rts
DosName: dc.b "dos.library",0
Filename: dc.b "ENVARC:acdplay.cfg",0
cnop 0,2
DOSBase: dc.l 0
FileHandle: dc.l 0
FIB: dc.l 0
FIB_Size: dc.l 0
Buffer: dc.l 0
END