1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
;
; Stefan Haubenthal, 2005-12-24
; Christian Groessler, 2013-07-16
;
; unsigned char __fastcall__ _sysrmdir (const char* name);
;
; for SpartaDOS and MyDOS
;
.include "atari.inc"
.export __sysrmdir
.import __sysremove
.import __dos_type
.import findfreeiocb
.importzp tmp4
.ifdef UCASE_FILENAME
.import ucase_fn
.import addysp
.importzp tmp3
.ifdef DEFAULT_DEVICE
.importzp tmp2
.endif
.endif
.proc __sysrmdir
pha
lda __dos_type
cmp #OSADOS+1
bcc do_sparta ; OS/A and SpartaDOS
cmp #MYDOS
bne not_impl ; neither MyDOS, OS/A, nor SpartaDOS
pla
jmp __sysremove ; MyDOS
not_impl:
pla
lda #NVALID
rts
iocberr:
pla ; cleanup stack
pla
lda #TMOF
rts
do_sparta:
txa
pha
jsr findfreeiocb
bne iocberr ; no IOCB available
stx tmp4 ; remember IOCB
pla
tax
pla
.ifdef UCASE_FILENAME
.ifdef DEFAULT_DEVICE
ldy #$80
sty tmp2 ; set flag for ucase_fn
.endif
jsr ucase_fn
bcc ucok1
lda #183 ; see oserror.s
rts
ucok1:
.endif ; defined UCASE_FILENAME
ldy tmp4 ; IOCB index
sta ICBAL,y ; store pointer to filename
txa
sta ICBAH,y
tya
tax
lda #RMDIR
sta ICCOM,x
lda #0
sta ICAX1,x
lda #0
sta ICAX2,x
sta ICBLL,x
sta ICBLH,x
jsr CIOV
.ifdef UCASE_FILENAME
tya
pha
ldy tmp3 ; get size
jsr addysp ; free used space on the stack
pla
tay
.endif ; defined UCASE_FILENAME
bmi cioerr
lda #0
rts
cioerr: tya
rts
.endproc ; __sysrmdir
|