]> git.sur5r.net Git - cc65/commitdiff
Bug correction by Karri Kaksonen.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 6 Feb 2011 14:34:02 +0000 (14:34 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 6 Feb 2011 14:34:02 +0000 (14:34 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4964 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/lynx/open.s

index 3ef56cd03cafc2580b7ea04c80bd9749c3aaa367..88c8b8c8f9f5901d2569b2a183876d374290bbe1 100644 (file)
@@ -23,6 +23,7 @@
        .import         addysp,popax,pushax,decsp6,pusha0,pusheax,ldaxysp
        .import         aslax3,axlong,tosaddeax,steaxysp,stax0sp,incsp8
        .import         ldax0sp
+       .import         lynxskip0, lynxblock
        .importzp       _FileEntry
        .importzp       _FileStartBlock
        .importzp       _FileCurrBlock
@@ -118,6 +119,24 @@ flagsok:
        ldx     #$00
        lda     #$08
        jsr     _read
+       lda     _FileStartBlock
+       sta     _FileCurrBlock
+       jsr     lynxblock
+       lda     _FileBlockOffset
+       ldx     _FileBlockOffset+1
+       phx                             ; The BLL kit uses negative offsets
+       plx                             ; while tha basic Lynx uses positive
+       bmi     @1                      ; Make all offsets negative
+        eor    #$FF
+       pha
+       txa
+        eor    #$FF
+       bra     @2
+@1:    pha
+       txa
+@2:    tay
+       plx
+       jsr     lynxskip0
        jsr     stax0sp
        jmp     incsp8