]> git.sur5r.net Git - cc65/blobdiff - libsrc/apple2/mli.s
Fixed gcc compiler warning (#867)
[cc65] / libsrc / apple2 / mli.s
index 535ec737e58e0b2c8846c87dc24a72b3943f485a..891cbaa6bf8c1324f76f4d205f1fb0d10817c458 100644 (file)
@@ -4,32 +4,47 @@
 ; Apple ProDOS 8 MLI
 ;
 
-        .import                __dos_type
+        .import         __dos_type
 
-        .include       "mli.inc"
+        .include        "apple2.inc"
+        .include        "mli.inc"
 
         .bss
 
-mliparam:       .tag   MLI
+mliparam:.tag   MLI
 
         .data
 
 callmli:
         ; Store parameters
-        sta    call
-        stx    mliparam
+        sta     call
+        stx     mliparam
 
         ; Check for ProDOS 8
-        lda    __dos_type
-        beq    oserr
-
-        ; Call MLI and return
-        jsr    ENTRY
-call:   .byte  $00
-        .word  mliparam
+        lda     __dos_type
+        beq     oserr
+
+        ; 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
\ No newline at end of file
+        rts