Tezz Posted April 19, 2004 Share Posted April 19, 2004 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! Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted April 19, 2004 Share Posted April 19, 2004 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. Quote Link to comment Share on other sites More sharing options...
Tezz Posted April 19, 2004 Author Share Posted April 19, 2004 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. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted April 19, 2004 Share Posted April 19, 2004 Hang on...there's a problem with the above. It assumes that the file to be read is open Can't recall how to do that within ML... Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted April 19, 2004 Share Posted April 19, 2004 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... Quote Link to comment Share on other sites More sharing options...
tebe Posted April 19, 2004 Share Posted April 19, 2004 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); } Quote Link to comment Share on other sites More sharing options...
Tezz Posted April 20, 2004 Author Share Posted April 20, 2004 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. Quote Link to comment Share on other sites More sharing options...
tebe Posted April 20, 2004 Share Posted April 20, 2004 Tezz, it's C (cc65 is a small C for 8-bit computers) www.cc65.org http://atariarea.histeria.pl/artykuly.php?...z_artykul&id=45 Quote Link to comment Share on other sites More sharing options...
Tezz Posted April 20, 2004 Author Share Posted April 20, 2004 tebe Tezz, it's C (cc65 is a small C for 8-bit computers) www.cc65.org http://atariarea.histeria.pl/artykuly.php?akcja=pokaz_artykul&id=45 Cool, missed that one, didn't know that there was a C compiler for the A8. Gonna check that one right out! Quote Link to comment Share on other sites More sharing options...
tebe Posted April 20, 2004 Share Posted April 20, 2004 compiler for PC, Linux, OS/2 ftp://ftp.musoftware.de/pub/uz/cc65/ atari library "cc65-atari-2.10.0-1.zip" cc65 compiler for win32 "cc65-win32-2.10.0a-1.zip" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.