Input Device Determination
Moderator: Moderators
Input Device Determination
In programming a multi-load game, is there a way to determine if the game was loaded from tape or disk (or whatever device number) without prompting the user? The goal is to load the subsequent part with the right device number.
You could assume the screen looks something like this:
Based on this assumption, you PEEK the screen for the LOAD command, and parse out the device number (if any).
Code: Select all
...
LOAD"FLEAS.PRG",8
SEARCHING FOR FLEAS.PR
G
LOADING
READY.
RUN
- Mike
- Herr VC
- Posts: 4845
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
And autostarting the next part is a one-liner:
Code: Select all
PRINT"{CLR}LOAD"CHR$(34)"<name>"CHR$(34)","PEEK(186):POKE631,19:POKE632,131:POKE198,2:END
I don't understand what POKE632,131 does. Looking up my VIC20 Programmers Reference Guide, I gather that you're putting two characters into the keyboard buffer, but I don't know what CHR$(131) does. I would have guessed you'd need to put in a bunch more keys, like "{home}{return}run{return}" (that's stuffing 6 keys into the keyboard buffer).
I've used this technique for almost all re-typed PaperSoft games to allow them to work for both tape or disk.Mike wrote:And autostarting the next part is a one-liner:
Code: Select all
PRINT"{CLR}LOAD"CHR$(34)"<name>"CHR$(34)","PEEK(186):POKE631,19:POKE632,131:POKE198,2:END
Mega-Cart: the cartridge you plug in once and for all.