Lynx update including file routines that access a file system on a cartridge
by Karri Kaksonen. git-svn-id: svn://svn.cc65.org/cc65/trunk@4892 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
41
libsrc/lynx/load.s
Normal file
41
libsrc/lynx/load.s
Normal file
@@ -0,0 +1,41 @@
|
||||
;
|
||||
; Karri Kaksonen, 2010
|
||||
;
|
||||
; lynx_load(fileno) is a convenience function that is widely used on the Lynx.
|
||||
; Basically this opens directory entry fileno and reads the content of the
|
||||
; file this points to into RAM.
|
||||
;
|
||||
; void lynx_load(int fileno)
|
||||
;
|
||||
.importzp _FileFileLen
|
||||
.importzp _FileDestAddr
|
||||
.import pushax,ldax0sp,pusha0,incsp2
|
||||
.import _openn
|
||||
.import _read
|
||||
.export _lynx_load
|
||||
|
||||
; ---------------------------------------------------------------
|
||||
; void __near__ __fastcall__ lynx_load (int)
|
||||
; ---------------------------------------------------------------
|
||||
|
||||
.segment "CODE"
|
||||
|
||||
.proc _lynx_load: near
|
||||
|
||||
.segment "CODE"
|
||||
|
||||
jsr pushax
|
||||
jsr ldax0sp
|
||||
jsr _openn
|
||||
lda #$01
|
||||
jsr pusha0
|
||||
lda _FileDestAddr
|
||||
ldx _FileDestAddr+1
|
||||
jsr pushax
|
||||
lda _FileFileLen
|
||||
ldx _FileFileLen+1
|
||||
jsr _read
|
||||
jmp incsp2
|
||||
|
||||
.endproc
|
||||
|
||||
Reference in New Issue
Block a user