18

Good news, my c64 ist still running after lots of years spending time on my attic..
But what I always wanted to know is:

How can I automatically load & run a program from a floppy disk that is already inserted
when I switch on the c64?

Some auto-running command like load "*",8,1 would be adequate...

Regards
MoC

Jens Björnhager
  • 5,632
  • 3
  • 27
  • 47

6 Answers6

10

You write that a command that you type in, like LOAD"*",8,1 would be adequate. Can I assume, then, that the only problem with that particular command is that it only loads, but doesn't automatically run, the program? If so, you have a number of solutions:

  1. If it's a machine language program, then you should type LOAD"<FILENAME>",8,1: and then (without pressing <RETURN>) press <SHIFT>+<RUN/STOP>.

  2. If it's a BASIC program, type LOAD"<FILENAME>",8: and then (without pressing <RETURN>) press <SHIFT>+<RUN/STOP>.

  3. It is possible to write a BASIC program such that it automatically runs when you load it with LOAD"<FILENAME>",8,1. To do so, first add the following line to the beginning of your program:

    0 POKE770,131:POKE771,164
    

    Then issue the following commands to save the program:

    PRINT"{CLR}":POKE770,113:POKE771,168:POKE43,0;POKE44,3:POKE157,0:SAVE"<FILENAME>",8
    
Psychonaut
  • 859
  • 8
  • 22
8

This is not possible without some custom cartridge.

One way to fix this would be getting the Retro Replay cartridge and hacking your own code for it.

Johan Kotlinski
  • 25,185
  • 9
  • 78
  • 101
4

Not 100% relevant, but C128 can autoboot disks in C128 mode. For example Ultima V (which has musics on C128 but not on C64 or C128 in C64 mode) autoboots.

As for cartridges, I'd recommend 1541 Ultimate 2. It can also run games from module rom images (although Prince of Persia doesn't work for me for some reason, perhaps software issue?), but you also get rather good floppy emulator (which also makes it easier to transfer stuff to real disks), REU, tape interface (if you order it) etc.

Jupp3
  • 221
  • 1
  • 1
  • It can also autoboot disks in CP/M mode and autoboot a C128 program that'd switch over to C64 mode. I think it's also possible to autoboot and run some C64 programs in an *almost* C64 mode, but it wasn't 100% compatible. – Feneric Jul 21 '16 at 20:19
  • If you have a 128, this is very relevant. You can autoboot a program to run in C64 mode. As you mention, C64-mode is not 100% compatible with an actual C64, but it’s, like 99.something% compatible. If you’re a demo scene hacker, writing a very advanced game, or otherwise pushing the 64 to its limits, you might hit the corners where the 128’s 64 mode is different, but in general you won’t notice any differences at all. – Mark Reed Dec 01 '20 at 06:46
4

I doubt there is a way to do it; you would need a cartridge which handles this case and I don't think one like that exists.

tenfour
  • 36,141
  • 15
  • 83
  • 142
4

A better and more suitable solution is EasyFlash actually. Retro Replay is commonly used with its own ROM. Since it is a very useful cartridge by default ROM, I would never flash another ROM to it. Also it is more expensive than EasyFlash if you don't have any of those cartridges.

At the moment, I have Prince Of Persia (!) ROM written to my EasyFlash and when I open my c64, it autoruns just like you asked for.

Emir Akaydın
  • 5,708
  • 1
  • 29
  • 57
0

If you are working with a ML program, there are several methods. If you aren't worried about ever returning to normal READY prompt without a RESET, you can have a small loader that loads into the stack ($0100-$01FF) The loader would just load the next section of code, then jump to it. It would start at $0102 and needs to be as small as possible. Many times, the next piece to load is only 2 characters, so the file name can be placed at $0100 & $0101. Then all you need to do is set LFS, SETNAM, LOAD, then JMP to it. Fill the rest of the stack area with $01. It is also rather safe to only save $0100-$010d so that the entire program will fit on a single disk block.

One issue with this, is that it clears out past stack entries (so, your program will need to reset the stack pointer back to the top.) If your program tries to do a normal RTS out of itself, random things can occur. If you want to exit the program, you'll need to jmp to the reset vector ($FFFC by default,) to do so.

Thaao
  • 1
  • 1