]> git.sur5r.net Git - cc65/blobdiff - libsrc/cbm/scratch.s
Merge remote-tracking branch 'upstream/master'
[cc65] / libsrc / cbm / scratch.s
index e8ffad9d564a37a384f87edb29c3f58841f5a9b3..e1665e5a67899f3f2ffe314b5c1678cfb73269e3 100644 (file)
@@ -1,12 +1,12 @@
 ;
-; Ullrich von Bassewitz, 16.11.2002
+; Ullrich von Bassewitz, 2002-11-16, 2009-02-22
 ;
 ; Scratch a file on disk
 ;
 
         .export         scratch
-        .import         readdiskerror
-        .import         fnunit, fnlen, fncmd
+        .import         opencmdchannel, closecmdchannel, writefndiskcmd
+        .import         fnunit, fncmd
 
         .include        "cbm.inc"
 
 
 .proc   scratch
 
-        lda     #15             ; Command channel
-        ldx     fnunit          ; Unit
-        tay                     ; Secondary address
-        jsr     SETLFS
+        ldx     fnunit
+        jsr     opencmdchannel
+        bne     done
 
         lda     #'s'            ; Scratch command
         sta     fncmd
-        ldx     fnlen
-        inx                     ; Account for "S"
-        txa                     ; Length of name into A
-        ldx     #<fncmd
-        ldy     #>fncmd
-        jsr     SETNAM
-
-        jsr     OPEN
-        bcs     done
-
-        jsr     readdiskerror   ; Read the command channel
+        jsr     writefndiskcmd
 
         pha
-        lda     #15
-        jsr     CLOSE
+        ldx     fnunit
+        jsr     closecmdchannel
         pla
 
 done:   rts