]> git.sur5r.net Git - cc65/blobdiff - libsrc/apple2/mli.s
Fixed gcc compiler warning (#867)
[cc65] / libsrc / apple2 / mli.s
index a1d05be8c6823a2bf9a20fcfd406c4a03327ed7a..891cbaa6bf8c1324f76f4d205f1fb0d10817c458 100644 (file)
@@ -6,6 +6,7 @@
 
         .import         __dos_type
 
+        .include        "apple2.inc"
         .include        "mli.inc"
 
         .bss
@@ -23,13 +24,27 @@ callmli:
         lda     __dos_type
         beq     oserr
 
-        ; Call MLI and return
-        jsr     $BF00          ; MLI call entry point
+        ; Save random counter
+        lda     RNDL
+        pha
+        lda     RNDH
+        pha
+
+        ; Call MLI
+        jsr     $BF00           ; MLI call entry point
 call:   .byte   $00
         .addr   mliparam
+
+        ; Restore random counter and return
+        tax
+        pla
+        sta     RNDH
+        pla
+        sta     RNDL
+        txa
         rts
 
         ; Load oserror code and return
-oserr:  lda     #$01           ; "Invalid MLI function code number"
+oserr:  lda     #$01            ; "Bad system call number"
         sec
         rts