• Please review our updated Terms and Rules here

Commodore app launcher -- how to load and run without getting overwritten first?

Warty

Member
Joined
May 29, 2017
Messages
33
Location
Minneapolis, MN
Hi all. If this should be in the Commodore forum, apologies, please move. That seemed to be mostly hardware problems.

I have written a file manager for the CBM II (B-series). 2-panel deal, pretty orthodox. You can copy files, delete files, rename things, sort directories, etc. I'd like to add the ability to pick a PRG and launch it. BTW, I'm writing this in cc65.

So... I know how to get it loading. The problem is that cc65 is in RAM bank 1, and I'm pretty sure the Kernal load routine is going to put it into that same bank 1. Every file could, in theory, specify a different load add, but chances seem pretty high that the loaded code is going to overwrite my running code. So when Kernal load returns, there will be something else there, and 99.99% of the time that's got to end in a jam.

1 backup plan is to maybe just pre-build a BASIC 4.0 DLOAD command, clear screen, type it out, put cursor at end, exit, and hope the user hits enter. This seems pretty foolproof, but a bit clumsy.

Surely someone has solved this kind of problem before? What should I be trying to do?Screen Shot 2023-02-05 at 11.13.42 AM.png
 
Last edited:
Haven't done programming on the B128, but on a C64 the dynamic keyboard is the way to go. Say you want to run a BASIC program: clear the screen, go two down, print LOAD"PROGRAM",8, go four down, print RUN, home the cursor, and
Code:
POKE 198,2:POKE631,13:POKE632,13

Then just END. What happens is, the C64 prints one-down and READY., "presses" RETURN on your LOAD command, presses RETURN on your RUN command, and the program runs without conflicting with yours because your program already terminated. I'm quite sure there's a similar means available on the B128 but I don't have my B128 programmer's reference guide handy to get the exact addresses.
 
Thank you! That was perfect.

All I had to do was put "DLOAD..." on one line, then down a few "run", and then put 2 enters in the keyboard buffer. works like a charm!

On CBMII, the relevant memory points are:
1675723868777.png
1675723813943.png

Screen Shot 2023-02-06 at 4.48.08 PM.png
 
Back
Top