Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Going nuts with IDE64 and KERNAL Loading...
2013-07-14 17:48
TWW

Registered: Jul 2009
Posts: 545
Going nuts with IDE64 and KERNAL Loading...

Why does this:

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Set correct working path

    // SETMSG (Turn off KERNAL Messages)
    lda #$00
    jsr $ff90

    // SETLFS
    ldx #12    // Drive No
    ldy #15    // Command Channel
    lda #1     // Logical File No
    jsr $ffba

    // SETNAM
    lda #PathNameEnd-PathName
    ldx #<PathName
    ldy #>PathName
    jsr $ffbd

    // OPEN (Sends Command)
    jsr $ffc0

    // Close Logical File
    lda #$01
    jsr $ffc3

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Load the File

    // SETLFS
    ldx #12    // Device Number
    ldy #0     // Command (0 = Read / 1 = write / 255 = No Command)
    lda #1     // Logical File Number
    jsr $ffba

    // SETNAM
    lda #FileNameEnd-FileName
    ldx #<FileName
    ldy #>FileName
    jsr $ffbd

    // OPEN the file
    jsr $ffc0

    // CHKIN
    ldx #$01
    jsr $ffc6

    // CHRIN to load the data
    ldy #$00
!:  jsr $ffcf
    sta $1000,y
    dey
    bne !-

    // Close Logical File
    lda #$01
    jsr $ffc3
    rts

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PathName:
    .text "CD:XXX"
    PathNameEnd:
FileName:
    .text "YYY"
    FileNameEnd:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Produce 256 byte of data from the file @ memory address $6800, Fill the rest of the memory with a repeating sequence of data (non related to the file loaded) and last but not least, scrolls the screen upwards in a never ending loop?

The filemanager and normal dos calls work good. SC(27398)
2013-07-14 18:53
soci

Registered: Sep 2003
Posts: 480
It's because you've forgot to call $ffcc to restore the standard input before closing the file.
2013-07-14 20:26
TWW

Registered: Jul 2009
Posts: 545
Indeed ;-)

Cheers.
2013-07-15 08:53
Grue

Registered: Dec 2001
Posts: 162
// SETLFS
ldx #12 // Drive No

I'd use ldx $ba to make it more compatible :)
2013-07-15 09:22
chatGPZ

Registered: Dec 2001
Posts: 11386
ldx $ba
beq *+4
ldx #8

:)
2013-07-15 09:25
iAN CooG

Registered: May 2002
Posts: 3194
ldx $ba
cpx #$08
bcs *+4
ldx #$08
even better
2013-07-15 09:35
chatGPZ

Registered: Dec 2001
Posts: 11386
no, that breaks eg netload (or anything else that uses #7) - if anything compare against #4, not #8
2013-07-15 10:06
Flavioweb

Registered: Nov 2011
Posts: 463
Quote: ldx $ba
beq *+4
ldx #8

:)


Should be "BNE *+4"...
No?
2013-07-15 11:00
chatGPZ

Registered: Dec 2001
Posts: 11386
indeed :)
2013-07-15 16:27
tlr

Registered: Sep 2003
Posts: 1790
Quote: no, that breaks eg netload (or anything else that uses #7) - if anything compare against #4, not #8

I usually use 8, but maybe 4 is better.
; set device number to 8 if it is less than 8
        lda     #8
        cmp     $ba
        bcc     skp
        sta     $ba
skp:
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
iAN CooG/HVSC
csabanw
algorithm
Guests online: 118
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.21 sec.