Start a specific program within a pnd


Eight Bit

Hardcore Member
Joined
Nov 16, 2008
Messages
1,979
Age
49
Location
Amsterdam, Netherlands
Website
Visit site
Hi all,


I picked up programming 6502 assembly again and I got Relaunch64 ( http://www.popelganda.de/relaunch64.html ) to run on my Pandora for that purpose.Yay! \o/


When I start Relaunch from within Canseco's C64 toolkit command line, I can use the ACME compiler in that to compile my code into a file that I can run in a C64 emulator. This all works great!


Now the thing is.. I can add some lines to the compile script to make it automatically start the compiled program in an emulator. Now of course I have Vice PND installed but that has a couple run scripts and programs inside. I can't just pnd_run it.


What I tried, was to just have Vice's C64 emulator running already and add the folowing line to the script in relaunch64: /mnt/utmp/vice/bin/x64 OUTFILE


which was supposed to start the created program in the emu. At least I thought it would. It appeared this does not work as I get an error that X64 can't find the c64 kernel rom which is weird because I already have an instance of x64 running fine. Also it's a bit messy because I have to start the emulator manually. It would be nicer if the script could handle that. The question now is, how do I start the C64 emu that's inside the pnd along with some other emulators (c16, vic20, c128, pet etc) with OUTFILE behind it to specify which program it has to start with from a command line or Relaunch64 compile script..


I hope someone knows the answer :)


Cheers and thanks!


8
 
Unfortunately, pickle's Vice doesn't seem to accept command line arguments through its script, but it shouldn't be impossible to hack it by modifying some of its scripts using the appdata folder.


If I remember the command-line pnd_run.sh correctly, by default it runs the first application target, which in this case will be run_x64.sh.


You can see all this my mounting the pnd. It's an iso9660 file with some extensions, so you can mount it simply and have a dig around inside it.  That's what I've done this far only:
 


mkdir /media/sdcard/mnt
sudo mount /media/sdcard/Download/vice.pnd /media/sdcard/mnt




Then, you can look into the PXML.xml to confirm what I've said thus far, and modify the run_x64.sh file by copying it to vice's appdata folder, then tweaking it.  I'd try to see if you can pass an argument to bin/x64 (which run_x64.sh calls) to make that pick up a default file, and if so you could modify run_x64.sh dynamically to call the emulator to emulate that file.


I've not actually tried any of this on my Pandora yet though, so I can't say how feasible it is.
 
Well, I do this when I want to start Audacious from command line (via ssh X11 forwarding):

Code:
/usr/pandora/scripts/pnd_run.sh -p /media/PANCARDA/pandora/menu/audacious.pnd -e scripts/audacious2_cli.sh

The audacious2_cli.sh script is a modified version of the script included with the PND. Seems pnd_run.sh can also supply arguments to command executed via -a argument.


The audacious2_cli.sh script actually is stored in the appdata dir for audacious PND:

Code:
$ ls /media/PANCARDA/pandora/appdata/audacious/scripts/                  
audacious2_cli.sh

And when the PND is mounted it automatically ends up in the /mnt/utmp/audacious/scripts/ dir (due to union FS magic ^_^ ). So the pnd_run.sh command above can execute it as if it was part of the original PND.
 
Last edited by a moderator:
I'll try something with those suggestions.


Of course I want this altered vice start-up script only to be active when I'm compiling some code and not when I start vice to watch other productions or play a game so I foresee troubles.:)


Is there not a way to just mount PND's without starting their programs or something? Or is my train of thought a bit to simple now? :D
 
I'll try something with those suggestions.


Of course I want this altered vice start-up script only to be active when I'm compiling some code and not when I start vice to watch other productions or play a game so I foresee troubles.:)

That's why I suggested making a second script to do what you want. Running the PND normally (via menu/desktop) will execute the original script, while the custom script would only run by invoking pnd_run.sh with the right arguments (-e your_script.sh -a arguments).

Is there not a way to just mount PND's without starting their programs or something? Or is my train of thought a bit to simple now? :D

Yes:

Code:
/usr/pandora/scripts/pnd_run.sh -p /media/PANCARDA/pandora/menu/codeblocks.pnd -m

You have to manually unmount it later though, so the PND can run when launched normally. Unmounting is done using -u flag instead of -m.
 
Oh, cool.  I never knew that you could just mount it using pnd_run.  I've always just mounted it as an iso9660 image using the mount command (as I documented above), but presumably this union mounts the appdata folder too, so modifying scripts is even easier :)
 
That's why I suggested making a second script to do what you want. Running the PND normally (via menu/desktop) will execute the original script, while the custom script would only run by invoking pnd_run.sh with the right arguments (-e your_script.sh -a arguments).



Oh, I get it now! I'll try that out! Thanks! :)

You have to manually unmount it later though, so the PND can run when launched normally. Unmounting is done using -u flag instead of -m.



This is really handy! I didn't know it either. Could I not, for instance auto mount a whole bunch of stuff on start-up so that it's available as if it was installed on my system?
 
Also FYI,  pnd_run which resides in /usr/bin/ is a different program than: /usr/pandora/scripts/pnd_run.sh
 
This is really handy! I didn't know it either. Could I not, for instance auto mount a whole bunch of stuff on start-up so that it's available as if it was installed on my system?

Yes. But I think there's a limit on the number of PNDs which can be mounted at the same time (due to limited number of loopback devices I think).
 
Yes, there is like 9 or 10 loopback devices.


It should be enough anyway (I use a similar mecanism in codeblocks too, automounting wxPython and MonoRT at launch, and unmounting them when quitting).
 
Just an update, I got everything working quite nicely now. I code, I press F5 and it compiles and starts vice running my program. Couldn't be easier.
I did end up just using another copy of vice running from SD in the project folder
Left... Right... It works :) Thanks for help
 
Back
Top