From 736db8789e2c57a3febb8a2f62e125a46eb6bb3e Mon Sep 17 00:00:00 2001
From: "ol.sc" 
Date: Fri, 11 Sep 2009 19:54:29 +0000
Subject: [PATCH] Much better approach for ProDOS 8 IO-buffer custom
 implementations - the first one was actually kind of stupid.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4155 b7a2c559-68d2-44c3-8de9-860c34a00d81
---
 libsrc/apple2/iobuf.s |  7 ++-----
 libsrc/apple2/mli.inc |  1 -
 libsrc/apple2/mli.s   | 11 +++--------
 3 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/libsrc/apple2/iobuf.s b/libsrc/apple2/iobuf.s
index fc412c241..699f3d901 100644
--- a/libsrc/apple2/iobuf.s
+++ b/libsrc/apple2/iobuf.s
@@ -4,12 +4,9 @@
 ; Default ProDOS 8 I/O buffer management
 ; 
 
-        .export		iobuf_alloc, iobuf_free
-        .export		iobuf_init,  iobuf_done
-        .import		iobuf_nop
+        .export		iobuf_alloc, iobuf_free, iobuf_mli
         .import		_posix_memalign, _free
 
 iobuf_alloc := _posix_memalign
 iobuf_free  := _free
-iobuf_init  := iobuf_nop
-iobuf_done  := iobuf_nop
+iobuf_mli   := $BF00
diff --git a/libsrc/apple2/mli.inc b/libsrc/apple2/mli.inc
index 6c29b275e..2134c8785 100644
--- a/libsrc/apple2/mli.inc
+++ b/libsrc/apple2/mli.inc
@@ -114,7 +114,6 @@ EOF_COUNT       = 2
         .global         mliparam
         .global         callmli
 
-ENTRY   :=      $BF00		; MLI call entry point
 DEVNUM  :=      $BF30		; Most recent accessed device
 DATELO  :=      $BF90		; Bits 15-9 = Year, 8-5 = Month, 4-0 = Day
 TIMELO  :=      $BF92		; Bits 12-8 = Hour, 5-0 = Minute
diff --git a/libsrc/apple2/mli.s b/libsrc/apple2/mli.s
index 48e09e718..9469ce960 100644
--- a/libsrc/apple2/mli.s
+++ b/libsrc/apple2/mli.s
@@ -5,8 +5,7 @@
 ;
 
         .import         __dos_type
-        .import         iobuf_init, iobuf_done
-        .export         iobuf_nop
+        .import         iobuf_mli
 
         .include        "mli.inc"
 
@@ -26,16 +25,12 @@ callmli:
         beq     oserr
 
         ; Call MLI and return
-        jsr     iobuf_init
-        jsr     ENTRY
+        jsr     iobuf_mli
 call:   .byte   $00
         .addr   mliparam
-        jmp     iobuf_done
+        rts
 
         ; Load oserror code and return
 oserr:  lda     #$01		; "Invalid MLI function code number"
         sec
-        ; Fall through
-
-iobuf_nop:
         rts
-- 
2.39.5