errno/oserrno stuff is cleaned up, saved some bytes in dialog box functions

git-svn-id: svn://svn.cc65.org/cc65/trunk@775 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst 2001-07-04 22:08:13 +00:00
parent fc51f7f77f
commit ebce3ebbc3
54 changed files with 105 additions and 110 deletions

View file

@ -119,9 +119,6 @@
#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

View file

@ -4,10 +4,10 @@
#
# 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

View file

@ -6,7 +6,7 @@
; char BlkAlloc (struct tr_se output[], int length);
.import popax
.import popax, __oserror
.export _BlkAlloc
.include "../inc/jumptab.inc"
@ -19,6 +19,6 @@ _BlkAlloc:
sta r4L
stx r4H
jsr BlkAlloc
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; int CalcBlksFree (void);
.import __oserror
.export _CalcBlksFree
.include "../inc/jumptab.inc"
@ -13,7 +14,7 @@
_CalcBlksFree:
jsr CalcBlksFree
stx errno
stx __oserror
lda r4L
ldx r4H
rts

View file

@ -6,6 +6,7 @@
; char ChangeDiskDevice (char newDriveNumber);
.import __oserror
.export _ChangeDiskDevice
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_ChangeDiskDevice:
jsr ChangeDiskDevice
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char ChkDkGEOS (void);
.import __oserror
.export _ChkDkGEOS
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_ChkDkGEOS:
jsr ChkDkGEOS
stx errno
stx __oserror
lda isGEOS
rts

View file

@ -9,7 +9,7 @@
; sectnum_t - 16bit
;
.import dio_params
.import dio_params, __oserror
.export _dio_read
.include "../inc/geossym.inc"
.include "../inc/jumptab.inc"
@ -18,7 +18,7 @@
jsr dio_params
jsr ReadBlock
stx errno
stx __oserror
txa
rts

View file

@ -9,7 +9,7 @@
; sectnum_t - 16bit
;
.import dio_params
.import dio_params, __oserror
.export _dio_write
.include "../inc/geossym.inc"
.include "../inc/jumptab.inc"
@ -18,7 +18,7 @@
jsr dio_params
jsr WriteBlock
stx errno
stx __oserror
txa
rts

View file

@ -9,7 +9,7 @@
; sectnum_t - 16bit
;
.import dio_params
.import dio_params, __oserror
.export _dio_write_verify
.include "../inc/geossym.inc"
.include "../inc/jumptab.inc"
@ -18,7 +18,7 @@
jsr dio_params
jsr VerWriteBlock
stx errno
stx __oserror
txa
rts

View file

@ -6,7 +6,7 @@
; char FreeBlock (struct tr_se *TS);
.import gettrse
.import gettrse, __oserror
.export _FreeBlock
.include "../inc/jumptab.inc"
@ -17,6 +17,6 @@ _FreeBlock:
sta r6L
stx r6H
jsr FreeBlock
stx errno
stx __oserror
txa
rts

View file

@ -6,7 +6,7 @@
; char GetBlock (struct tr_se *myTS, char *buffer);
.import popax
.import popax, __oserror
.import gettrse
.export _GetBlock
@ -21,6 +21,6 @@ _GetBlock:
sta r1L
stx r1H
jsr GetBlock
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char GetDirHead (void);
.import __oserror
.export _GetDirHead
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_GetDirHead:
jsr GetDirHead
stx errno
stx __oserror
txa
rts

View file

@ -8,6 +8,7 @@
; (fills curName[17] with current disk's name)
.importzp ptr4, ptr3
.import __oserror
.export _GetPtrCurDkNm
.include "../inc/jumptab.inc"
@ -30,5 +31,5 @@ namelp: lda (ptr4),y
bne namelp
fin: lda #0
sta (ptr3),y
stx errno
stx __oserror
rts

View file

@ -6,6 +6,7 @@
; char NewDisk (void);
.import __oserror
.export _NewDisk
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_NewDisk:
jsr NewDisk
stx errno
stx __oserror
txa
rts

View file

@ -6,7 +6,7 @@
; char NxtBlkAlloc (struct tr_se *startTS, struct tr_se output[], int length );
.import popax
.import popax, __oserror
.import gettrse
.importzp ptr4
.export _NxtBlkAlloc
@ -25,6 +25,6 @@ _NxtBlkAlloc:
sta r3L
stx r3H
jsr NxtBlkAlloc
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char OpenDisk (void);
.import __oserror
.export _OpenDisk
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_OpenDisk:
jsr OpenDisk
stx errno
stx __oserror
txa
rts

View file

@ -6,7 +6,7 @@
; char PutBlock (struct tr_se *myTS, char *buffer);
.import popax
.import popax, __oserror
.import gettrse
.export _PutBlock
@ -21,6 +21,6 @@ _PutBlock:
sta r1L
stx r1H
jsr PutBlock
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char PutDirHead (void);
.import __oserror
.export _PutDirHead
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_PutDirHead:
jsr PutDirHead
stx errno
stx __oserror
txa
rts

View file

@ -6,7 +6,7 @@
; char ReadBlock (struct tr_se myTS, char *buffer);
.import popax
.import popax, __oserror
.import gettrse
.export _ReadBlock
@ -21,6 +21,6 @@ _ReadBlock:
sta r1L
stx r1H
jsr ReadBlock
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char ReadBuff (struct tr_se);
.import __oserror
.import gettrse
.export _ReadBuff
@ -17,6 +18,6 @@ _ReadBuff:
sta r1L
stx r1H
jsr ReadBuff
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char SetGEOSDisk (void);
.import __oserror
.export _SetGEOSDisk
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_SetGEOSDisk:
jsr SetGEOSDisk
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; struct tr_se SetNextFree (struct tr_se *startTS);
.import __oserror
.import gettrse
.export _SetNextFree
@ -17,7 +18,7 @@ _SetNextFree:
sta r3L
stx r3H
jsr SetNextFree
stx errno
stx __oserror
lda r3L
ldx r3H
rts

View file

@ -6,7 +6,7 @@
; char VerWriteBlock (struct tr_se *myTS, char *buffer);
.import popax
.import popax, __oserror
.import gettrse
.export _VerWriteBlock
@ -21,6 +21,6 @@ _VerWriteBlock:
sta r1L
stx r1H
jsr VerWriteBlock
stx errno
stx __oserror
txa
rts

View file

@ -6,7 +6,7 @@
; char WriteBlock (struct tr_se *myTS, char *buffer);
.import popax
.import popax, __oserror
.import gettrse
.export _WriteBlock
@ -21,6 +21,6 @@ _WriteBlock:
sta r1L
stx r1H
jsr WriteBlock
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char WriteBuff (struct tr_se*);
.import __oserror
.import gettrse
.export _WriteBuff
@ -17,6 +18,6 @@ _WriteBuff:
sta r1L
stx r1H
jsr WriteBuff
stx errno
stx __oserror
txa
rts

View file

@ -8,6 +8,7 @@
.export _DlgBoxFileSelect
.import popa, popax
.import _DoDlgBox
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
@ -15,13 +16,6 @@
.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
@ -38,10 +32,7 @@ DB_FS_reload:
lda #<paramStrFileSelect
ldx #>paramStrFileSelect
sta r0L
stx r0H
jsr DoDlgBox
lda r0L
jsr _DoDlgBox
cmp #DISK
bne DB_FS_Fin
jsr OpenDisk

View file

@ -7,11 +7,10 @@
; 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"
@ -24,11 +23,7 @@ _DlgBoxGetString:
stx ptr2+1
lda #<paramStrGetString
ldx #>paramStrGetString
sta r0L
stx r0H
jsr DoDlgBox
lda r0L
rts
jmp _DoDlgBox
paramStrGetString:
.byte DEF_DB_POS | 1

View file

@ -7,10 +7,9 @@
; 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"
@ -18,11 +17,7 @@ _DlgBoxOk:
jsr DB_get2lines
lda #<paramStrOk
ldx #>paramStrOk
sta r0L
stx r0H
jsr DoDlgBox
lda r0L
rts
jmp _DoDlgBox
paramStrOk:
.byte DEF_DB_POS | 1

View file

@ -7,10 +7,9 @@
; 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"
@ -18,11 +17,7 @@ _DlgBoxOkCancel:
jsr DB_get2lines
lda #<paramStrOkCancel
ldx #>paramStrOkCancel
sta r0L
stx r0H
jsr DoDlgBox
lda r0L
rts
jmp _DoDlgBox
paramStrOkCancel:
.byte DEF_DB_POS | 1

View file

@ -7,10 +7,9 @@
; 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"
@ -18,11 +17,7 @@ _DlgBoxYesNo:
jsr DB_get2lines
lda #<paramStrYesNo
ldx #>paramStrYesNo
sta r0L
stx r0H
jsr DoDlgBox
lda r0L
rts
jmp _DoDlgBox
paramStrYesNo:
.byte DEF_DB_POS | 1

View file

@ -6,6 +6,7 @@
; char AppendRecord (void);
.import __oserror
.export _AppendRecord
.include "../inc/jumptab.inc"
@ -14,6 +15,6 @@
_AppendRecord:
jsr AppendRecord
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char CloseRecordFile (void);
.import __oserror
.export _CloseRecordFile
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_CloseRecordFile:
jsr CloseRecordFile
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char DeleteFile (char *myName);
.import __oserror
.export _DeleteFile
.include "../inc/jumptab.inc"
@ -15,6 +16,6 @@ _DeleteFile:
sta r0L
stx r0H
jsr DeleteFile
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char DeleteRecord (void);
.import __oserror
.export _DeleteRecord
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_DeleteRecord:
jsr DeleteRecord
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char FindFile (char *myName);
.import __oserror
.export _FindFile
.include "../inc/jumptab.inc"
@ -15,6 +16,6 @@ _FindFile:
sta r6L
stx r6H
jsr FindFile
stx errno
stx __oserror
txa
rts

View file

@ -7,7 +7,7 @@
; 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"
@ -24,7 +24,7 @@ _FindFTypes:
sta r6L
stx r6H
jsr FindFTypes
stx errno
stx __oserror
; return (fileMax - r7H)
lda tmpFileMax
sec

View file

@ -7,7 +7,7 @@
; char FollowChain (struct tr_se *myTrSe, char *buffer);
.export _FollowChain
.import popax
.import popax, __oserror
.import gettrse
.include "../inc/jumptab.inc"
@ -21,6 +21,6 @@ _FollowChain:
sta r1L
stx r1H
jsr FollowChain
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char FreeFile (struct trse myTrSe[]);
.import __oserror
.export _FreeFile
.include "../inc/jumptab.inc"
@ -15,6 +16,6 @@ _FreeFile:
sta r9L
stx r9H
jsr FreeFile
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; struct filehandle* Get1stDirEntry (void);
.import __oserror
.export _Get1stDirEntry
.include "../inc/diskdrv.inc"
@ -13,7 +14,7 @@
_Get1stDirEntry:
jsr Get1stDirEntry
stx errno
stx __oserror
lda r5L
ldx r5H
rts

View file

@ -6,6 +6,7 @@
; char GetFHdrInfo (struct filehandle *myFile);
.import __oserror
.export _GetFHdrInfo
.include "../inc/jumptab.inc"
@ -15,6 +16,6 @@ _GetFHdrInfo:
sta r9L
stx r9H
jsr GetFHdrInfo
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; struct filehandle* GetNxtDirEntry (void);
.import __oserror
.export _GetNxtDirEntry
.include "../inc/diskdrv.inc"
@ -13,7 +14,7 @@
_GetNxtDirEntry:
jsr GetNxtDirEntry
stx errno
stx __oserror
lda r5L
ldx r5H
rts

View file

@ -6,6 +6,7 @@
; char InsertRecord (void);
.import __oserror
.export _InsertRecord
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_InsertRecord:
jsr InsertRecord
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char NextRecord (void);
.import __oserror
.export _NextRecord
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_NextRecord:
jsr NextRecord
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char OpenRecordFile (char *myName);
.import __oserror
.export _OpenRecordFile
.include "../inc/jumptab.inc"
@ -15,6 +16,6 @@ _OpenRecordFile:
sta r0L
stx r0H
jsr OpenRecordFile
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char PointRecord (char recordNum);
.import __oserror
.export _PointRecord
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_PointRecord:
jsr PointRecord
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char PreviousRecord (void);
.import __oserror
.export _PreviousRecord
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_PreviousRecord:
jsr PreviousRecord
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char ReadByte (void);
.import __oserror
.export _ReadByte
.include "../inc/jumptab.inc"
@ -13,5 +14,5 @@
_ReadByte:
jsr ReadByte
stx errno
stx __oserror
rts

View file

@ -7,7 +7,7 @@
; char ReadFile (struct tr_se *myTS, char *buffer, int length);
.export _ReadFile
.import popax
.import popax, __oserror
.import gettrse
.include "../inc/jumptab.inc"
@ -24,6 +24,6 @@ _ReadFile:
sta r1L
stx r1H
jsr ReadFile
stx errno
stx __oserror
txa
rts

View file

@ -7,7 +7,7 @@
; char ReadRecord (char *buffer, int length);
.export _ReadRecord
.import popax
.import popax, __oserror
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
@ -19,6 +19,6 @@ _ReadRecord:
sta r7L
stx r7H
jsr ReadRecord
stx errno
stx __oserror
txa
rts

View file

@ -7,7 +7,7 @@
; char RenameFile (char *source, char *target);
.export _RenameFile
.import popax
.import popax, __oserror
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
@ -19,6 +19,6 @@ _RenameFile:
sta r6L
stx r6H
jsr RenameFile
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char SaveFile (struct fileheader *myHeader);
.import __oserror
.export _SaveFile
.include "../inc/jumptab.inc"
@ -15,6 +16,6 @@ _SaveFile:
sta r9L
stx r9H
jsr SaveFile
stx errno
stx __oserror
txa
rts

View file

@ -6,6 +6,7 @@
; char UpdateRecordFile (void);
.import __oserror
.export _UpdateRecordFile
.include "../inc/jumptab.inc"
@ -13,6 +14,6 @@
_UpdateRecordFile:
jsr UpdateRecordFile
stx errno
stx __oserror
txa
rts

View file

@ -7,7 +7,7 @@
; char WriteRecord (char *buffer, int length);
.export _WriteRecord
.import popax
.import popax, __oserror
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
@ -19,6 +19,6 @@ _WriteRecord:
sta r7L
stx r7H
jsr WriteRecord
stx errno
stx __oserror
txa
rts

View file

@ -120,8 +120,6 @@ TURBO_DD00_CPY = $8f ; from 1541 turbo
STATUS = $90
curDevice = $ba
;
errno = $91 ; custom error return code
;
irqvec = $0314
bkvec = $0316
nmivec = $0318