Re: [cc65] C64 fast-loader suggestion?

From: Gábor Lénárt <lgb1lgb.hu>
Date: 2011-12-16 16:51:08
On Fri, Dec 16, 2011 at 03:37:41PM +0100, silverdr@wfmh.org.pl wrote:
> 
> On 2011-12-16, at 13:19, Gábor Lénárt wrote:
> 
> >> Naive suggestion: Read the first two bytes via CHRIN and the rest via LOAD...
> > 
> > Yes, it was my idea too. A bit "dirty" solution, but if there is no better I
> > will take that theory.
> 
> It depends. Basically if you are the source of the data files, you can adjust for this. What I recall doing in the days was that my LOADable data files always had the two bytes of "default" load address at their beginnings. Whether I used them later on or not depended on the needs but they were there. Situation is of course more difficult if you have to deal with data files created elsewhere. Then the solution given by Oliver seem to be feasible, even if being not extremely "elegant" workaround.

Yes, I need other files, not my ones, where I can create a format I prefer.

Guys, please be patient, but one more question. What is the best way to do
this exactly?

1. JSR SETNAM (with: X/Y=file name, A=filename size)
2. JSR SETLFS (with: A=1, X=content of $BA, Y=0)
3. JSR LOAD (with: A=0, X/Y=buffer address)

this is the current one. I guess, I need to set buffer address + 2 for step
3, also I need to insert some more steps betweeen 2. and 3., however I am
not sure about that: I need OPEN the file then BASIN two bytes. Do I need to
close the file before LOAD then? Won't be LOAD bothered (ZP locations
modified etc) that I did OPEN/BASIC/CLOSE/whatever before calling LOAD as I
want to use the same params given by SETNAM+SETLFS? And can I use the very
same parameters as for LOAD for OPEN too, so I don't need call SETNAM/SETLFS
again before LOAD (as far as I know, SETNAM/SETLFS only sets some ZP
locations btw, nothing more).

Sorry, but I have no experience on I/O: I always wrote programs where no
need to do I/O just a basic stub with SYS, and direct HW programming no
KERNAL, whatever :)

Thanks in advance for the help.
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Dec 16 16:51:17 2011

This archive was generated by hypermail 2.1.8 : 2011-12-16 16:51:20 CET