2006-01-04 09:56:04 +00:00
|
|
|
;
|
|
|
|
; Stefan Haubenthal, 2005-12-24
|
2013-07-15 23:29:49 +00:00
|
|
|
; Christian Groessler, 2013-07-16
|
2006-01-04 09:56:04 +00:00
|
|
|
;
|
|
|
|
; unsigned char __fastcall__ _sysrmdir (const char* name);
|
2013-07-15 23:29:49 +00:00
|
|
|
;
|
|
|
|
; for SpartaDOS and MyDOS
|
2006-01-04 09:56:04 +00:00
|
|
|
;
|
|
|
|
|
2013-07-15 23:29:49 +00:00
|
|
|
.include "atari.inc"
|
2013-05-09 11:56:54 +00:00
|
|
|
.export __sysrmdir
|
|
|
|
.import __sysremove
|
2013-07-15 23:29:49 +00:00
|
|
|
.import __dos_type
|
|
|
|
.import findfreeiocb
|
2013-07-23 22:40:09 +00:00
|
|
|
.importzp tmp4
|
|
|
|
.ifdef UCASE_FILENAME
|
|
|
|
.import ucase_fn
|
2013-07-15 23:29:49 +00:00
|
|
|
.import addysp
|
|
|
|
.importzp tmp3
|
2013-07-23 22:40:09 +00:00
|
|
|
.ifdef DEFAULT_DEVICE
|
|
|
|
.importzp tmp2
|
|
|
|
.endif
|
|
|
|
.endif
|
2013-07-15 23:29:49 +00:00
|
|
|
|
|
|
|
.proc __sysrmdir
|
|
|
|
|
|
|
|
pha
|
|
|
|
lda __dos_type
|
|
|
|
cmp #OSADOS+1
|
|
|
|
bcc do_sparta ; OS/A and SpartaDOS
|
2016-05-24 22:51:40 +00:00
|
|
|
cmp #MYDOS
|
|
|
|
bne not_impl ; neither MyDOS, OS/A, nor SpartaDOS
|
2013-07-15 23:29:49 +00:00
|
|
|
pla
|
2016-05-24 22:51:40 +00:00
|
|
|
jmp __sysremove ; MyDOS
|
2013-07-15 23:29:49 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2013-07-23 22:40:09 +00:00
|
|
|
.ifdef DEFAULT_DEVICE
|
|
|
|
ldy #$80
|
|
|
|
sty tmp2 ; set flag for ucase_fn
|
|
|
|
.endif
|
2013-07-15 23:29:49 +00:00
|
|
|
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
|
2006-01-04 09:56:04 +00:00
|
|
|
|
2013-07-15 23:29:49 +00:00
|
|
|
.endproc ; __sysrmdir
|