#define STATUS *(char*)0x90
#define curDevice *(char*)0xba
-/* Here's my own errno location, I hope this won't confilct with anything... */
-#define errno *(char*)0x91
-
#define irqvec *(unsigned int*)0x0314
#define bkvec *(unsigned int*)0x0316
#define nmivec *(unsigned int*)0x0318
#
# Maciej 'YTM/Elysium' Witkowiak
-OBJ_DIRS=disk dlgbox file graph menuicon memory mousesprite process system
+OBJ_DIRS=devel disk dlgbox file graph menuicon memory mousesprite process system
all:
- @for i in devel $(OBJ_DIRS); do $(MAKE) -C $$i; done
+ @for i in $(OBJ_DIRS); do $(MAKE) -C $$i; done
@mv devel/crt0.o ../geos.o
@for i in $(OBJ_DIRS); do $(AR) a ../geos.lib $$i/*.o; done
; char BlkAlloc (struct tr_se output[], int length);
- .import popax
+ .import popax, __oserror
.export _BlkAlloc
.include "../inc/jumptab.inc"
sta r4L
stx r4H
jsr BlkAlloc
- stx errno
+ stx __oserror
txa
rts
; int CalcBlksFree (void);
+ .import __oserror
.export _CalcBlksFree
.include "../inc/jumptab.inc"
_CalcBlksFree:
jsr CalcBlksFree
- stx errno
+ stx __oserror
lda r4L
ldx r4H
rts
; char ChangeDiskDevice (char newDriveNumber);
+ .import __oserror
.export _ChangeDiskDevice
.include "../inc/jumptab.inc"
_ChangeDiskDevice:
jsr ChangeDiskDevice
- stx errno
+ stx __oserror
txa
rts
; char ChkDkGEOS (void);
+ .import __oserror
.export _ChkDkGEOS
.include "../inc/jumptab.inc"
_ChkDkGEOS:
jsr ChkDkGEOS
- stx errno
+ stx __oserror
lda isGEOS
rts
; sectnum_t - 16bit
;
- .import dio_params
+ .import dio_params, __oserror
.export _dio_read
.include "../inc/geossym.inc"
.include "../inc/jumptab.inc"
jsr dio_params
jsr ReadBlock
- stx errno
+ stx __oserror
txa
rts
; sectnum_t - 16bit
;
- .import dio_params
+ .import dio_params, __oserror
.export _dio_write
.include "../inc/geossym.inc"
.include "../inc/jumptab.inc"
jsr dio_params
jsr WriteBlock
- stx errno
+ stx __oserror
txa
rts
; sectnum_t - 16bit
;
- .import dio_params
+ .import dio_params, __oserror
.export _dio_write_verify
.include "../inc/geossym.inc"
.include "../inc/jumptab.inc"
jsr dio_params
jsr VerWriteBlock
- stx errno
+ stx __oserror
txa
rts
; char FreeBlock (struct tr_se *TS);
- .import gettrse
+ .import gettrse, __oserror
.export _FreeBlock
.include "../inc/jumptab.inc"
sta r6L
stx r6H
jsr FreeBlock
- stx errno
+ stx __oserror
txa
rts
; char GetBlock (struct tr_se *myTS, char *buffer);
- .import popax
+ .import popax, __oserror
.import gettrse
.export _GetBlock
sta r1L
stx r1H
jsr GetBlock
- stx errno
+ stx __oserror
txa
rts
; char GetDirHead (void);
+ .import __oserror
.export _GetDirHead
.include "../inc/jumptab.inc"
_GetDirHead:
jsr GetDirHead
- stx errno
+ stx __oserror
txa
rts
; (fills curName[17] with current disk's name)
.importzp ptr4, ptr3
+ .import __oserror
.export _GetPtrCurDkNm
.include "../inc/jumptab.inc"
bne namelp
fin: lda #0
sta (ptr3),y
- stx errno
+ stx __oserror
rts
; char NewDisk (void);
+ .import __oserror
.export _NewDisk
.include "../inc/jumptab.inc"
_NewDisk:
jsr NewDisk
- stx errno
+ stx __oserror
txa
rts
; char NxtBlkAlloc (struct tr_se *startTS, struct tr_se output[], int length );
- .import popax
+ .import popax, __oserror
.import gettrse
.importzp ptr4
.export _NxtBlkAlloc
sta r3L
stx r3H
jsr NxtBlkAlloc
- stx errno
+ stx __oserror
txa
rts
; char OpenDisk (void);
+ .import __oserror
.export _OpenDisk
.include "../inc/jumptab.inc"
_OpenDisk:
jsr OpenDisk
- stx errno
+ stx __oserror
txa
rts
; char PutBlock (struct tr_se *myTS, char *buffer);
- .import popax
+ .import popax, __oserror
.import gettrse
.export _PutBlock
sta r1L
stx r1H
jsr PutBlock
- stx errno
+ stx __oserror
txa
rts
; char PutDirHead (void);
+ .import __oserror
.export _PutDirHead
.include "../inc/jumptab.inc"
_PutDirHead:
jsr PutDirHead
- stx errno
+ stx __oserror
txa
rts
; char ReadBlock (struct tr_se myTS, char *buffer);
- .import popax
+ .import popax, __oserror
.import gettrse
.export _ReadBlock
sta r1L
stx r1H
jsr ReadBlock
- stx errno
+ stx __oserror
txa
rts
; char ReadBuff (struct tr_se);
+ .import __oserror
.import gettrse
.export _ReadBuff
sta r1L
stx r1H
jsr ReadBuff
- stx errno
+ stx __oserror
txa
rts
; char SetGEOSDisk (void);
+ .import __oserror
.export _SetGEOSDisk
.include "../inc/jumptab.inc"
_SetGEOSDisk:
jsr SetGEOSDisk
- stx errno
+ stx __oserror
txa
rts
; struct tr_se SetNextFree (struct tr_se *startTS);
+ .import __oserror
.import gettrse
.export _SetNextFree
sta r3L
stx r3H
jsr SetNextFree
- stx errno
+ stx __oserror
lda r3L
ldx r3H
rts
; char VerWriteBlock (struct tr_se *myTS, char *buffer);
- .import popax
+ .import popax, __oserror
.import gettrse
.export _VerWriteBlock
sta r1L
stx r1H
jsr VerWriteBlock
- stx errno
+ stx __oserror
txa
rts
; char WriteBlock (struct tr_se *myTS, char *buffer);
- .import popax
+ .import popax, __oserror
.import gettrse
.export _WriteBlock
sta r1L
stx r1H
jsr WriteBlock
- stx errno
+ stx __oserror
txa
rts
; char WriteBuff (struct tr_se*);
+ .import __oserror
.import gettrse
.export _WriteBuff
sta r1L
stx r1H
jsr WriteBuff
- stx errno
+ stx __oserror
txa
rts
.export _DlgBoxFileSelect
.import popa, popax
+ .import _DoDlgBox
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
.include "../inc/geosmac.ca65.inc"
_DlgBoxFileSelect:
-; sta r5L
-; stx r5H
-; jsr popa
-; sta r7L
-; jsr popax
-; sta r10L
-; stx r10H
sta tmp_r5
stx tmp_r5+1
lda #<paramStrFileSelect
ldx #>paramStrFileSelect
- sta r0L
- stx r0H
- jsr DoDlgBox
- lda r0L
+ jsr _DoDlgBox
cmp #DISK
bne DB_FS_Fin
jsr OpenDisk
; char DlgBoxGetString (char *string, char strlen, char *line1,char *line2);
.export _DlgBoxGetString
- .import DB_get2lines
+ .import DB_get2lines, _DoDlgBox
.importzp ptr2, ptr3, ptr4
.import popa, popax
-
- .include "../inc/jumptab.inc"
+
.include "../inc/geossym.inc"
.include "../inc/const.inc"
stx ptr2+1
lda #<paramStrGetString
ldx #>paramStrGetString
- sta r0L
- stx r0H
- jsr DoDlgBox
- lda r0L
- rts
+ jmp _DoDlgBox
paramStrGetString:
.byte DEF_DB_POS | 1
; char DlgBoxOk (char *line1,char *line2);
.export _DlgBoxOk
- .import DB_get2lines
+ .import DB_get2lines, _DoDlgBox
.importzp ptr3, ptr4
- .include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
.include "../inc/const.inc"
jsr DB_get2lines
lda #<paramStrOk
ldx #>paramStrOk
- sta r0L
- stx r0H
- jsr DoDlgBox
- lda r0L
- rts
+ jmp _DoDlgBox
paramStrOk:
.byte DEF_DB_POS | 1
; char DlgBoxOkCancel (char *line1,char *line2);
.export _DlgBoxOkCancel
- .import DB_get2lines
+ .import DB_get2lines, _DoDlgBox
.importzp ptr3, ptr4
- .include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
.include "../inc/const.inc"
jsr DB_get2lines
lda #<paramStrOkCancel
ldx #>paramStrOkCancel
- sta r0L
- stx r0H
- jsr DoDlgBox
- lda r0L
- rts
+ jmp _DoDlgBox
paramStrOkCancel:
.byte DEF_DB_POS | 1
; char DlgBoxYesNo (char *line1,char *line2);
.export _DlgBoxYesNo
- .import DB_get2lines
+ .import DB_get2lines, _DoDlgBox
.importzp ptr3, ptr4
- .include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
.include "../inc/const.inc"
jsr DB_get2lines
lda #<paramStrYesNo
ldx #>paramStrYesNo
- sta r0L
- stx r0H
- jsr DoDlgBox
- lda r0L
- rts
+ jmp _DoDlgBox
paramStrYesNo:
.byte DEF_DB_POS | 1
; char AppendRecord (void);
+ .import __oserror
.export _AppendRecord
.include "../inc/jumptab.inc"
_AppendRecord:
jsr AppendRecord
- stx errno
+ stx __oserror
txa
rts
; char CloseRecordFile (void);
+ .import __oserror
.export _CloseRecordFile
.include "../inc/jumptab.inc"
_CloseRecordFile:
jsr CloseRecordFile
- stx errno
+ stx __oserror
txa
rts
; char DeleteFile (char *myName);
+ .import __oserror
.export _DeleteFile
.include "../inc/jumptab.inc"
sta r0L
stx r0H
jsr DeleteFile
- stx errno
+ stx __oserror
txa
rts
; char DeleteRecord (void);
+ .import __oserror
.export _DeleteRecord
.include "../inc/jumptab.inc"
_DeleteRecord:
jsr DeleteRecord
- stx errno
+ stx __oserror
txa
rts
; char FindFile (char *myName);
+ .import __oserror
.export _FindFile
.include "../inc/jumptab.inc"
sta r6L
stx r6H
jsr FindFile
- stx errno
+ stx __oserror
txa
rts
; char FindFTypes (char *buffer, char fileType, char fileMax, char *Class);
.export _FindFTypes
- .import popax, popa
+ .import popax, popa, __oserror
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
sta r6L
stx r6H
jsr FindFTypes
- stx errno
+ stx __oserror
; return (fileMax - r7H)
lda tmpFileMax
sec
; char FollowChain (struct tr_se *myTrSe, char *buffer);
.export _FollowChain
- .import popax
+ .import popax, __oserror
.import gettrse
.include "../inc/jumptab.inc"
sta r1L
stx r1H
jsr FollowChain
- stx errno
+ stx __oserror
txa
rts
; char FreeFile (struct trse myTrSe[]);
+ .import __oserror
.export _FreeFile
.include "../inc/jumptab.inc"
sta r9L
stx r9H
jsr FreeFile
- stx errno
+ stx __oserror
txa
rts
; struct filehandle* Get1stDirEntry (void);
+ .import __oserror
.export _Get1stDirEntry
.include "../inc/diskdrv.inc"
_Get1stDirEntry:
jsr Get1stDirEntry
- stx errno
+ stx __oserror
lda r5L
ldx r5H
rts
; char GetFHdrInfo (struct filehandle *myFile);
+ .import __oserror
.export _GetFHdrInfo
.include "../inc/jumptab.inc"
sta r9L
stx r9H
jsr GetFHdrInfo
- stx errno
+ stx __oserror
txa
rts
; struct filehandle* GetNxtDirEntry (void);
+ .import __oserror
.export _GetNxtDirEntry
.include "../inc/diskdrv.inc"
_GetNxtDirEntry:
jsr GetNxtDirEntry
- stx errno
+ stx __oserror
lda r5L
ldx r5H
rts
; char InsertRecord (void);
+ .import __oserror
.export _InsertRecord
.include "../inc/jumptab.inc"
_InsertRecord:
jsr InsertRecord
- stx errno
+ stx __oserror
txa
rts
; char NextRecord (void);
+ .import __oserror
.export _NextRecord
.include "../inc/jumptab.inc"
_NextRecord:
jsr NextRecord
- stx errno
+ stx __oserror
txa
rts
; char OpenRecordFile (char *myName);
+ .import __oserror
.export _OpenRecordFile
.include "../inc/jumptab.inc"
sta r0L
stx r0H
jsr OpenRecordFile
- stx errno
+ stx __oserror
txa
rts
; char PointRecord (char recordNum);
+ .import __oserror
.export _PointRecord
.include "../inc/jumptab.inc"
_PointRecord:
jsr PointRecord
- stx errno
+ stx __oserror
txa
rts
; char PreviousRecord (void);
+ .import __oserror
.export _PreviousRecord
.include "../inc/jumptab.inc"
_PreviousRecord:
jsr PreviousRecord
- stx errno
+ stx __oserror
txa
rts
; char ReadByte (void);
+ .import __oserror
.export _ReadByte
.include "../inc/jumptab.inc"
_ReadByte:
jsr ReadByte
- stx errno
+ stx __oserror
rts
; char ReadFile (struct tr_se *myTS, char *buffer, int length);
.export _ReadFile
- .import popax
+ .import popax, __oserror
.import gettrse
.include "../inc/jumptab.inc"
sta r1L
stx r1H
jsr ReadFile
- stx errno
+ stx __oserror
txa
rts
; char ReadRecord (char *buffer, int length);
.export _ReadRecord
- .import popax
+ .import popax, __oserror
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
sta r7L
stx r7H
jsr ReadRecord
- stx errno
+ stx __oserror
txa
rts
; char RenameFile (char *source, char *target);
.export _RenameFile
- .import popax
+ .import popax, __oserror
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
sta r6L
stx r6H
jsr RenameFile
- stx errno
+ stx __oserror
txa
rts
; char SaveFile (struct fileheader *myHeader);
+ .import __oserror
.export _SaveFile
.include "../inc/jumptab.inc"
sta r9L
stx r9H
jsr SaveFile
- stx errno
+ stx __oserror
txa
rts
; char UpdateRecordFile (void);
+ .import __oserror
.export _UpdateRecordFile
.include "../inc/jumptab.inc"
_UpdateRecordFile:
jsr UpdateRecordFile
- stx errno
+ stx __oserror
txa
rts
; char WriteRecord (char *buffer, int length);
.export _WriteRecord
- .import popax
+ .import popax, __oserror
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
sta r7L
stx r7H
jsr WriteRecord
- stx errno
+ stx __oserror
txa
rts
STATUS = $90
curDevice = $ba
;
-errno = $91 ; custom error return code
-;
irqvec = $0314
bkvec = $0316
nmivec = $0318