ProDOS 8 requires an page-aligned 1kB IO-buffer for every open file. The implementation using posix_memalign() is universally correct but quite expensive. There I added support for overriding this implementation with maybe limited (i.e. to one open file) but cheaper custom implementations.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4142 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc
2009-09-10 09:59:26 +00:00
parent 19397b742d
commit d91fe6b877
5 changed files with 28 additions and 5 deletions

View File

@@ -12,7 +12,7 @@
.import pushname, popname
.import errnoexit, oserrexit
.import _posix_memalign, _free
.import iobuf_alloc, iobuf_free
.import addysp, incsp4, incaxy, pushax, popax
.include "zeropage.inc"
@@ -70,7 +70,7 @@ found: tya
ldx #>$0100
jsr pushax ; Preserves A
ldx #>$0400
jsr _posix_memalign
jsr iobuf_alloc
tay ; Save errno code
; Restore fdtab slot
@@ -206,7 +206,7 @@ freebuffer:
; Free I/O buffer
lda #$00
ldx fdtab + FD::BUFFER+1,y
jmp _free
jmp iobuf_free
closeallfiles:
; All open files