randyrossi / bmc64

A bare metal Commodore 64 emulator for the Raspberry Pi with true 50hz/60hz smooth scrolling, low input latency and better audio/video sync.
GNU General Public License v3.0
473 stars 56 forks source link

A way to autostart a PRG or D64 automatically on boot? #185

Open PaulSlocum opened 3 years ago

PaulSlocum commented 3 years ago

Normally it's easy to do this with VICE using a command line argument, but I can't find any command line call to VICE in the BCM64 file set. Is there any built-in way to autoload a PRG or D64 other than setting a default cartridge like MMC64 and using that to autoload a PRG?

randyrossi commented 3 years ago

For cartridges, there is a menu option under Cartridge called 'Set current cart default (Need Save)' . Attach your cartridge, then select that menu item and then save your settings. Next boot should auto load that cartridge.

I think there is a way to do it with disks too but you would have to edit vice.ini file and add it manually since there is no menu option.

Try AutostartPrgDiskImage here : https://vice-emu.sourceforge.io/vice_6.html

(But I've never tried the disk method)

On Tue, Jul 20, 2021 at 5:19 PM Paul Slocum @.***> wrote:

Normally it's easy to do this with VICE using a command line argument, but I can't find any command line call to VICE in the BCM64 file set. Is there any built-in way to autoload a PRG or D64 other than setting a default cartridge like MMC64 and using that to autoload a PRG?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/randyrossi/bmc64/issues/185, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3HKEL6A7MLL4EDLEGQHLTYXR67ANCNFSM5AWT6XGA .

-- Randy Rossi

PaulSlocum commented 3 years ago

Thanks for the answer, I think the AutostartPrgDiskImage is not quite the same thing that I need (it looks like it is a container for autostarted PRGs), but I think it should be possible to autostart a PRG using an emulated MMC64 cartridge and emulated MMC64 sd-card. I'll report back on what I find.

PaulSlocum commented 3 years ago

I can open a new issue if you prefer, but I'm not able to get the MMC64 cartridge emulation to work on BMC64. (The MMC64 cartridge does have the ability to auto-start PRGs on boot.)

I have the v1.04 MMC64 BIOS image and an SD card image that I use with a real MMC Replay on a real Commodore 64. This works as expected on VICE on my Mac, but when I try it on BMC64 it doesn't seem to boot. I just get a black screen and F12 does not bring up the menu. Here are the three MMC-related lines of the vice.ini file:

MMC64BIOSfilename="/carts/C64/mmcbios104.bin" MMC64imagefilename="/carts/C64/mmc64MikeSD_2a.img" MMC64=1

If I remove the 'MMC64imagefilename' line, then it boots but hangs with a red screen, so it appears that the problem may be related to reading the MMC SD disk image file. I believe the red screen indicates that it did successfully load the MMC64 BIOS. That's what happens on VICE on my Mac when I include the a good BIOS image but don't set the SD card disk image file.

PaulSlocum commented 3 years ago

Hey, sorry to bug you, but I was wondering if you had any thoughts about the issue with the MMC64 cartridge.

Also, since I'm finding that there's not an easy way to autostart a PRG or D64 on boot using a default cartridge, I'd like to put in a feature request for the ability to somehow specify a PRG or D64 to autostart as if you had specified it on the VICE command line. I'm not sure if there's an easy way to do this, but I figured it was worth asking.

Even if I had the MMC64 cartridge working, it's still rather cumbersome to auto-boot a PRG since you have to set up a custom boot.bin and then create an MMC64 disk image file.

The reason that I need to autostart a program on boot is that I'm setting up a Commodore 64 museum display, and I need to make it so that it's really easy for attendants to turn on and start up to the Commodore 64 program that we're showing.

randyrossi commented 3 years ago

I just remembered I have an undocumented feature that might work for you.

Add enable_demo=true to your cmdline.txt file.

Then place a file called demo.txt in the sdcard root. In demo.txt, you can follow this format:

The format is:

[operation],[file],[timeout],[mode],[joyswap]

where:

[operation] is one of:

r = reset to basic

s = snapshot

d = diskswap

c = cartridge

dc = detach cartridge (causes reset)

dd = detach disk

#

[timeout] is the timeout in seconds

[mode] is one of:

i = timeout will be reset by any user activity

n = timeout will not be reset by user activity

[joyswap] is one of:

1 = joy port assignments swapped from saved settings

0 = joy port assignments not swapped

This was meant for a kiosk I setup at World of Commodore and it cycles through several snapshots or cartridges. It can even disk swap at after a certain number of seconds expires for multiple disk demos. But if someone starts using the machine (after you loaded a game, for example) it delays moving on to the next entry so they can play it or use the machine uninterrupted. In your case, try attaching whatever cartridge or program you want to load, then save a snapshot. Then add something like this to demo.txt

s,snapshotfile.vsf,30000,i,0

So when you start BMC64, it should just load that state immediately. It should work for any program you loaded before the snapshot.

If you want to see the script I used at WOC, take a look at this file:

https://github.com/randyrossi/bmc64/blob/master/demo.txt

Let me know if that works for you.

On Fri, Jul 30, 2021 at 4:56 PM Paul Slocum @.***> wrote:

Hey, sorry to bug you, but I was wondering if you had any thoughts about the issue with the MMC64 cartridge.

Also, since I'm finding that there's not an easy way to autostart a PRG or D64 on boot using a default cartridge, I'd like to put in a feature request for the ability to somehow specify a PRG or D64 to autostart as if you had specified it on the VICE command line. I'm not sure if there's an easy way to do this, but I figured it was worth asking.

Even if I had the MMC64 cartridge working, it's still rather cumbersome to auto-boot a PRG since you have to set up a custom boot.bin and then create an MMC64 disk image file.

The reason that I need to autostart a program on boot is that I'm setting up a Commodore 64 museum display, and I need to make it so that it's really easy for attendants to turn on and start up to the Commodore 64 program that we're showing.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/randyrossi/bmc64/issues/185#issuecomment-890149386, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3HKCY7KVWY33C4L4MSOLT2MGYPANCNFSM5AWT6XGA .

-- Randy Rossi

PaulSlocum commented 2 years ago

Thank you, this is great. I do public Commodore 64 installations somewhat regularly and will definitely be using this feature in the future. I'd encourage you to add it to the official documentation because I bet other people would find this useful too.

I got a snapshot autostarting on boot using demo.txt, but the one thing I could not get to work is the interactivity timeout. I don't necessarily need it for this project, but it would be nice to have the interactive timeout working for some projects. This is the demo.txt line that I tried:

s,/snapshots/C64/FINALE_1c.vsf,60,i,0

In this case, the only controllers I have hooked up are two joysticks through GPIO using the Boffintronics adapter that you helped me get working in the other thread. Even if I unplug the joysticks it never resets, and I do not have any USB devices hooked up. If change the demo.txt 'mode' to 'n' so that it does not depend on interactivity, then it does correctly reset every 60 seconds.

randyrossi commented 2 years ago

Good that works for you. Not sure why the timeout isn't working though. According to the code, the timer should be reset on keyboard or joystick activity. What happens if you run a joystick tester app? Does it show any activity even without your joysticks plugged in?

On Mon, Aug 2, 2021 at 3:00 PM Paul Slocum @.***> wrote:

Thank you, this is great. I do public Commodore 64 installations somewhat regularly and will definitely be using this feature in the future. I'd encourage you to add it to the official documentation because I bet other people would find this useful too.

I got a snapshot autostarting on boot using demo.txt, but the one thing I could not get to work is the interactivity timeout. I don't necessarily need it for this project, but it would be nice to have the interactive timeout working for some projects. This is the demo.txt line that I tried:

s,/snapshots/C64/FINALE_1c.vsf,60,i,0

In this case, the only controllers I have hooked up are two joysticks through GPIO using the Boffintronics adapter that you helped me get working in the other thread. Even if I unplug the joysticks it never resets, and I do not have any USB devices hooked up. If change the demo.txt 'mode' to 'n' so that it does not depend on interactivity, then it does correctly reset every 60 seconds.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/randyrossi/bmc64/issues/185#issuecomment-891257935, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3HKHB3XFDYK4US5GDRVLT23TNDANCNFSM5AWT6XGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

-- Randy Rossi