Jump to content
IGNORED

Disk loading routine


Tezz

Recommended Posts

Hi all,

 

Does anyone have any advice on coding a good disk loading routine? The routine should enable chain loading and unpacking of individual programs (or sections).

 

Lets say for instance you have written a game or demo to be loaded in from a full disk. First you will want to display a short message "loading, please wait" then display a loading picture or intro then after a keypress load in the actual game/demo.

 

I am unsure of how to specify such a routine so that the memory locations that were used by the previous intro are wiped and are free to use for the actual game/demo.

 

I asume that the loading routine will reside someplace in memory thoughout all parts of the project in a place such as page 6. Then all other locations used can be over written during loading?

 

Any advice or source appreciated. I'm sure that it's childs play for you guys!

Link to comment
Share on other sites

I dunno...disk access is so fast (compared to tape), that a "Please wait" screen is really unneeded. And you can make your own programs autostart just by renaming them to autorun.sys. If you wanted 2 seperate programs (loader and program), you could just name the loading program autorun.sys...and that loader program just has a routine to display the message, load in new values to the hardware disk hander, and do a JMP to the actual program's initialization routine.

 

IIRC, to do the loading, vector $0354-5 holds the address where the next access will be sent to, $0358-9 holds the number of bytes being transferred, and $0352 holds the control value ($07=read, $0b=write). Load X with $10, and JSR to $E456.

Once that's done, you'd just JMP to the program that's now in memory.

Link to comment
Share on other sites

IIRC, to do the loading, vector $0354-5 holds the address where the next access will be sent to, $0358-9 holds the number of bytes being transferred, and $0352 holds the control value ($07=read, $0b=write). Load X with $10, and JSR to $E456.  

Once that's done, you'd just JMP to the program that's now in memory.

:) Cheers Nukey, got some idea of where to start from now.
Link to comment
Share on other sites

you have to set the SIO block...it's like

 

open#1,4,0,"d:filename" and there is an equivalent in assembler for that... vector for filename, channel, command etc... i can remember read it in de re atari...

 

a custom SIO discroutine is not so difficult as it might be... of course best is a custom one where you leave 2 pokey channels free for playling music while loading... ;)

Link to comment
Share on other sites

good routine (cc65) :

 

unsigned char *filename = "part1.dat";

 

const adr1=0x6010;

const adr2=0x9010;

 

int main(void)

{

FILE* plik = fopen(filename,"rb");

 

puts("Loading... Please Wait");

 

fread((unsigned char *)adr1,8000,1,plik);

fread((unsigned char *)adr2,8000,1,plik);

 

fclose(plik);

}

Link to comment
Share on other sites

tebe good routine (cc65) :

Hmm, don't recognise the format of your code? looks like C?

:?

 

Heaven/TQA open#1,4,0,"d:filename" and there is an equivalent in assembler for that... vector for filename, channel, command etc... i can remember read it in de re atari

Think I remember seeing this listing for SIO usage. thanks, I'll have to dig out my original hard copy of De Re and read up.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...