| |
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) |
|
| |
soci
Registered: Sep 2003 Posts: 480 |
It's because you've forgot to call $ffcc to restore the standard input before closing the file. |
| |
TWW
Registered: Jul 2009 Posts: 545 |
Indeed ;-)
Cheers. |
| |
Grue
Registered: Dec 2001 Posts: 162 |
// SETLFS
ldx #12 // Drive No
I'd use ldx $ba to make it more compatible :) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
ldx $ba
beq *+4
ldx #8
:) |
| |
iAN CooG
Registered: May 2002 Posts: 3194 |
ldx $ba
cpx #$08
bcs *+4
ldx #$08
even better |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
no, that breaks eg netload (or anything else that uses #7) - if anything compare against #4, not #8 |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
Quote: ldx $ba
beq *+4
ldx #8
:)
Should be "BNE *+4"...
No? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
indeed :) |
| |
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: |