Moved the 'file' files from 'geos-cbm' to 'geos-common' which are believed to work as-is on Apple GEOS too. 'FollowChain' isn't available on Apple GEOS.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5437 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -29,7 +29,8 @@ CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
|
||||
#--------------------------------------------------------------------------
|
||||
# Directories
|
||||
|
||||
DIRS = dlgbox
|
||||
DIRS = dlgbox \
|
||||
file
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Directives
|
||||
|
||||
32
libsrc/geos-common/file/Makefile
Normal file
32
libsrc/geos-common/file/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# makefile for CC65 runtime library
|
||||
#
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Object files
|
||||
|
||||
S_OBJS += get1stdirentry.o \
|
||||
getnxtdirentry.o \
|
||||
openrecordfile.o \
|
||||
closerecordfile.o \
|
||||
nextrecord.o \
|
||||
previousrecord.o \
|
||||
pointrecord.o \
|
||||
deleterecord.o \
|
||||
insertrecord.o \
|
||||
appendrecord.o \
|
||||
readrecord.o \
|
||||
writerecord.o \
|
||||
updaterecordfile.o \
|
||||
findfile.o \
|
||||
getfhdrinfo.o \
|
||||
readfile.o \
|
||||
savefile.o \
|
||||
freefile.o \
|
||||
deletefile.o \
|
||||
renamefile.o \
|
||||
findftypes.o \
|
||||
readbyte.o \
|
||||
getfile.o \
|
||||
sysremove.o \
|
||||
sysrename.o
|
||||
17
libsrc/geos-common/file/appendrecord.s
Normal file
17
libsrc/geos-common/file/appendrecord.s
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char AppendRecord (void);
|
||||
|
||||
.import setoserror
|
||||
.export _AppendRecord
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_AppendRecord:
|
||||
|
||||
jsr AppendRecord
|
||||
jmp setoserror
|
||||
16
libsrc/geos-common/file/closerecordfile.s
Normal file
16
libsrc/geos-common/file/closerecordfile.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char CloseRecordFile (void);
|
||||
|
||||
.import setoserror
|
||||
.export _CloseRecordFile
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_CloseRecordFile:
|
||||
jsr CloseRecordFile
|
||||
jmp setoserror
|
||||
19
libsrc/geos-common/file/deletefile.s
Normal file
19
libsrc/geos-common/file/deletefile.s
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char DeleteFile (char *myName);
|
||||
|
||||
.import setoserror
|
||||
.export _DeleteFile
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_DeleteFile:
|
||||
sta r0L
|
||||
stx r0H
|
||||
jsr DeleteFile
|
||||
jmp setoserror
|
||||
17
libsrc/geos-common/file/deleterecord.s
Normal file
17
libsrc/geos-common/file/deleterecord.s
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char DeleteRecord (void);
|
||||
|
||||
.import setoserror
|
||||
.export _DeleteRecord
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_DeleteRecord:
|
||||
jsr DeleteRecord
|
||||
jmp setoserror
|
||||
19
libsrc/geos-common/file/findfile.s
Normal file
19
libsrc/geos-common/file/findfile.s
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char FindFile (char *myName);
|
||||
|
||||
.import setoserror
|
||||
.export _FindFile
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_FindFile:
|
||||
sta r6L
|
||||
stx r6H
|
||||
jsr FindFile
|
||||
jmp setoserror
|
||||
38
libsrc/geos-common/file/findftypes.s
Normal file
38
libsrc/geos-common/file/findftypes.s
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char FindFTypes (char *buffer, char fileType, char fileMax, char *Class);
|
||||
|
||||
.export _FindFTypes
|
||||
.import popax, popa, setoserror
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.code
|
||||
|
||||
_FindFTypes:
|
||||
sta r10L
|
||||
stx r10H
|
||||
jsr popa
|
||||
sta r7H
|
||||
sta tmpFileMax
|
||||
jsr popa
|
||||
sta r7L
|
||||
jsr popax
|
||||
sta r6L
|
||||
stx r6H
|
||||
jsr FindFTypes
|
||||
jsr setoserror
|
||||
; return (fileMax - r7H)
|
||||
lda tmpFileMax
|
||||
sec
|
||||
sbc r7H
|
||||
rts
|
||||
|
||||
.bss
|
||||
|
||||
tmpFileMax: .res 1
|
||||
19
libsrc/geos-common/file/freefile.s
Normal file
19
libsrc/geos-common/file/freefile.s
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char FreeFile (struct trse myTrSe[]);
|
||||
|
||||
.import setoserror
|
||||
.export _FreeFile
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_FreeFile:
|
||||
sta r9L
|
||||
stx r9H
|
||||
jsr FreeFile
|
||||
jmp setoserror
|
||||
20
libsrc/geos-common/file/get1stdirentry.s
Normal file
20
libsrc/geos-common/file/get1stdirentry.s
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Alliance' Witkowiak
|
||||
;
|
||||
; 26.10.99
|
||||
|
||||
; struct filehandle* Get1stDirEntry (void);
|
||||
|
||||
.import __oserror
|
||||
.export _Get1stDirEntry
|
||||
|
||||
.include "diskdrv.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_Get1stDirEntry:
|
||||
jsr Get1stDirEntry
|
||||
stx __oserror
|
||||
lda r5L
|
||||
ldx r5H
|
||||
rts
|
||||
19
libsrc/geos-common/file/getfhdrinfo.s
Normal file
19
libsrc/geos-common/file/getfhdrinfo.s
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char GetFHdrInfo (struct filehandle *myFile);
|
||||
|
||||
.import setoserror
|
||||
.export _GetFHdrInfo
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_GetFHdrInfo:
|
||||
sta r9L
|
||||
stx r9H
|
||||
jsr GetFHdrInfo
|
||||
jmp setoserror
|
||||
32
libsrc/geos-common/file/getfile.s
Normal file
32
libsrc/geos-common/file/getfile.s
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 4.4.2003
|
||||
|
||||
; char __fastcall__ GetFile(char flag, const char *fname, const char *loadaddr, const char *datadname, char *datafname);
|
||||
|
||||
.export _GetFile
|
||||
.import popa, popax, setoserror
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_GetFile:
|
||||
sta r3L
|
||||
stx r3H
|
||||
jsr popax
|
||||
sta r2L
|
||||
stx r2H
|
||||
jsr popax
|
||||
sta r7L
|
||||
stx r7H
|
||||
jsr popax
|
||||
sta r6L
|
||||
stx r6H
|
||||
jsr popa
|
||||
sta r0L
|
||||
lda #0
|
||||
sta r10L
|
||||
jsr GetFile
|
||||
jmp setoserror
|
||||
20
libsrc/geos-common/file/getnxtdirentry.s
Normal file
20
libsrc/geos-common/file/getnxtdirentry.s
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Alliance' Witkowiak
|
||||
;
|
||||
; 26.10.99
|
||||
|
||||
; struct filehandle* GetNxtDirEntry (void);
|
||||
|
||||
.import __oserror
|
||||
.export _GetNxtDirEntry
|
||||
|
||||
.include "diskdrv.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_GetNxtDirEntry:
|
||||
jsr GetNxtDirEntry
|
||||
stx __oserror
|
||||
lda r5L
|
||||
ldx r5H
|
||||
rts
|
||||
16
libsrc/geos-common/file/insertrecord.s
Normal file
16
libsrc/geos-common/file/insertrecord.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char InsertRecord (void);
|
||||
|
||||
.import setoserror
|
||||
.export _InsertRecord
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_InsertRecord:
|
||||
jsr InsertRecord
|
||||
jmp setoserror
|
||||
16
libsrc/geos-common/file/nextrecord.s
Normal file
16
libsrc/geos-common/file/nextrecord.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char NextRecord (void);
|
||||
|
||||
.import setoserror
|
||||
.export _NextRecord
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_NextRecord:
|
||||
jsr NextRecord
|
||||
jmp setoserror
|
||||
19
libsrc/geos-common/file/openrecordfile.s
Normal file
19
libsrc/geos-common/file/openrecordfile.s
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char OpenRecordFile (char *myName);
|
||||
|
||||
.import setoserror
|
||||
.export _OpenRecordFile
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_OpenRecordFile:
|
||||
sta r0L
|
||||
stx r0H
|
||||
jsr OpenRecordFile
|
||||
jmp setoserror
|
||||
16
libsrc/geos-common/file/pointrecord.s
Normal file
16
libsrc/geos-common/file/pointrecord.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char PointRecord (char recordNum);
|
||||
|
||||
.import setoserror
|
||||
.export _PointRecord
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_PointRecord:
|
||||
jsr PointRecord
|
||||
jmp setoserror
|
||||
16
libsrc/geos-common/file/previousrecord.s
Normal file
16
libsrc/geos-common/file/previousrecord.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char PreviousRecord (void);
|
||||
|
||||
.import setoserror
|
||||
.export _PreviousRecord
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_PreviousRecord:
|
||||
jsr PreviousRecord
|
||||
jmp setoserror
|
||||
18
libsrc/geos-common/file/readbyte.s
Normal file
18
libsrc/geos-common/file/readbyte.s
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char ReadByte (void);
|
||||
|
||||
.import __oserror
|
||||
.export _ReadByte
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_ReadByte:
|
||||
jsr ReadByte
|
||||
stx __oserror
|
||||
ldx #0
|
||||
rts
|
||||
27
libsrc/geos-common/file/readfile.s
Normal file
27
libsrc/geos-common/file/readfile.s
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char ReadFile (struct tr_se *myTS, char *buffer, int length);
|
||||
|
||||
.export _ReadFile
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_ReadFile:
|
||||
sta r2L
|
||||
stx r2H
|
||||
jsr popax
|
||||
sta r7L
|
||||
stx r7H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr ReadFile
|
||||
jmp setoserror
|
||||
22
libsrc/geos-common/file/readrecord.s
Normal file
22
libsrc/geos-common/file/readrecord.s
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char ReadRecord (char *buffer, int length);
|
||||
|
||||
.export _ReadRecord
|
||||
.import popax, setoserror
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_ReadRecord:
|
||||
sta r2L
|
||||
stx r2H
|
||||
jsr popax
|
||||
sta r7L
|
||||
stx r7H
|
||||
jsr ReadRecord
|
||||
jmp setoserror
|
||||
22
libsrc/geos-common/file/renamefile.s
Normal file
22
libsrc/geos-common/file/renamefile.s
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char RenameFile (char *old, char *new);
|
||||
|
||||
.export _RenameFile
|
||||
.import popax, setoserror
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_RenameFile:
|
||||
sta r0L
|
||||
stx r0H
|
||||
jsr popax
|
||||
sta r6L
|
||||
stx r6H
|
||||
jsr RenameFile
|
||||
jmp setoserror
|
||||
22
libsrc/geos-common/file/savefile.s
Normal file
22
libsrc/geos-common/file/savefile.s
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char SaveFile (char skip, struct fileheader *myHeader);
|
||||
|
||||
.import setoserror
|
||||
.import popa
|
||||
.export _SaveFile
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_SaveFile:
|
||||
sta r9L
|
||||
stx r9H
|
||||
jsr popa
|
||||
sta r10L
|
||||
jsr SaveFile
|
||||
jmp setoserror
|
||||
20
libsrc/geos-common/file/sysremove.s
Normal file
20
libsrc/geos-common/file/sysremove.s
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 19.07.2005
|
||||
|
||||
; unsigned char __fastcall__ _sysremove (const char* name);
|
||||
|
||||
.export __sysremove
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
__sysremove:
|
||||
sta r0L
|
||||
stx r0H
|
||||
jsr DeleteFile
|
||||
txa
|
||||
ldx #0
|
||||
rts
|
||||
24
libsrc/geos-common/file/sysrename.s
Normal file
24
libsrc/geos-common/file/sysrename.s
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 19.07.2005
|
||||
|
||||
; unsigned char __fastcall__ _sysrename (const char* oldname, const char* newname);
|
||||
|
||||
.export __sysrename
|
||||
.import popax
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
__sysrename:
|
||||
sta r0L
|
||||
stx r0H
|
||||
jsr popax
|
||||
sta r6L
|
||||
stx r6H
|
||||
jsr RenameFile
|
||||
txa
|
||||
ldx #0
|
||||
rts
|
||||
16
libsrc/geos-common/file/updaterecordfile.s
Normal file
16
libsrc/geos-common/file/updaterecordfile.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char UpdateRecordFile (void);
|
||||
|
||||
.import setoserror
|
||||
.export _UpdateRecordFile
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_UpdateRecordFile:
|
||||
jsr UpdateRecordFile
|
||||
jmp setoserror
|
||||
22
libsrc/geos-common/file/writerecord.s
Normal file
22
libsrc/geos-common/file/writerecord.s
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 25.12.1999, 2.1.2003
|
||||
|
||||
; char WriteRecord (char *buffer, int length);
|
||||
|
||||
.export _WriteRecord
|
||||
.import popax, setoserror
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_WriteRecord:
|
||||
sta r2L
|
||||
stx r2H
|
||||
jsr popax
|
||||
sta r7L
|
||||
stx r7H
|
||||
jsr WriteRecord
|
||||
jmp setoserror
|
||||
Reference in New Issue
Block a user