Author Topic: Vice C64 opk creation with mksquashfs  (Read 2270 times)

romanaOne (OP)

  • *
  • Posts: 12
Vice C64 opk creation with mksquashfs
« on: October 03, 2015, 04:03:44 pm »
I found a VICE C64 floating around these forums and it works very well with d64 and prg images. It looks like all the hard work is already done.

I put the VICE folder in apps and created a link to x64 in the menu.
You just hit the L button to pop up the menu--no need to mess with the onscreen keyboard and LOAD"*"--- and pick autostart image and browse to the d64/prg file. You can also open cartridge images, including Easyflash multicart images full of games, easily selectable from a menu.

This install is slightly cumbersome and all this emulator really needs is to be wrapped up in an opk.
To make an opk of VICE/x64 I need to create a .desktop file and use mksquashfs?

Is there a guide on how to do this? Or has someone already done it?
Do I just do (after editing the desktop file):
Code: [Select]
mksquashfs ./VICE c64.opk
The man page shows a lot of options, so I'm just wondering if I need to set anything.

David Knight

  • **
  • Posts: 577
Re: Vice C64 opk creation with mksquashfs
« Reply #1 on: October 03, 2015, 07:23:10 pm »
See here for a detailed explanation on OPK creation.

http://wiki.surkow.com/OPK

You will need your executable, a desktop file (default.gcw0.desktop) and although not essential it would be good to include an icon.

I'd recommend unpacking the many OPK files around to see how it works. If you get stuck it's definitely worth checking out the IRC channel for help.

Alas I believe there was a reason why the C64 emulator was not packaged although I am not familiar with this emulator so I don't know the reason why.

romanaOne (OP)

  • *
  • Posts: 12
Re: Vice C64 opk creation with mksquashfs
« Reply #2 on: October 03, 2015, 09:30:02 pm »
ok, I made the opk and used a pretty icon. Actually, it was included with the binary along with C128, and VIC20 emulators. x64 seems to work fine. I tried a few games from one of my EasyFlash 1.1MB cart images (I'm a C64 fan.)

The only issue I see is that the emulator wants to write some config file to the squashfs and gives an error when you exit. This isn't too bad a problem. Games run full speed, fullscreen, with sound.

But I guess this could be a problem if you want to save snapshots or read/write disk images. I only want to play arcade games on a little handheld like gcw with no keyboard, so this is actually good enough.

Does the squashfs have to be readonly? Can I make it writeable?






Surkow

  • * Administrator
  • Posts: 592
Re: Vice C64 opk creation with mksquashfs
« Reply #3 on: October 03, 2015, 09:45:44 pm »
Squashfs images are mounted read only - you can't change this. You need to write to $HOME/.program for storing configuration files or other writable data.

This wiki page explains to you where it is located. You'll have to modify the sources and recompile the binary.

zear

  • * Moderator
  • Posts: 2379
Re: Vice C64 opk creation with mksquashfs
« Reply #4 on: October 03, 2015, 09:50:11 pm »
And to add up to @Surkow 's comment - $HOME location should be determined during runtime, rather than hardcoding the path. This is because $HOME might be different from unit to unit and between firmware revisions.

Here is an example of how to determine the current $HOME location from C code:
https://github.com/zear/TripleTrapled/blob/master/src/fileio.c#L11

romanaOne (OP)

  • *
  • Posts: 12
Re: Vice C64 opk creation with mksquashfs
« Reply #5 on: October 03, 2015, 11:08:58 pm »
On the version of vice x64 in Ubuntu 15.10, you can specify the config file to use at runtime:
Code: [Select]
x64 -config $HOME/.sdl-vicerc
I'm not sure why this isn't working in the desktop file. There's no error, x64 just fails to start.

Code: [Select]
Exec=x64 -config $HOME/.sdl-vicerc
Oh well. Looks like this might be more trouble than it's worth. Having a vice folder in apps and manually creating a link in the menu isn't so much work compared to setting up the tools and finding the vice source LOL. I might even prefer keeping my vice executable, roms, disks, config file and gamesave snapshots all in the one, writeable folder anyway.

btw, I really like how simple the filesystem layout is.

zear

  • * Moderator
  • Posts: 2379
Re: Vice C64 opk creation with mksquashfs
« Reply #6 on: October 03, 2015, 11:12:38 pm »
That's probably because $HOME is an environment variable, while gmenu2x executes binaries pointed to by the .desktop file directly, without passing them to a shell (like sh/bash).
What you can do, as a workaround, is to write your own sh script:
Code: [Select]
#!/bin/sh
x64 -config $HOME/.sdl-vicerc
And then pass it to the exec line:
Code: [Select]
Exec=./your_script.sh

The line #!/bin/sh tells the launching process to explicitly execute the shell, which will handle syntax like $HOME.

But I still think a cleaner approach is to modify the source code. It might be required if you want to meet the rest of the repository guidelines, plus compiling with the latest GCW Zero compiler is always a good idea.

romanaOne (OP)

  • *
  • Posts: 12
Re: Vice C64 opk creation with mksquashfs
« Reply #7 on: October 04, 2015, 12:57:09 am »
I know what an environment variable is.
First thing I tried was specifying the full path to the file. Tried copying the file there in case x64 can't create it. Same result: a black flash and back to the menu. (Just didn't want to type it all in the post.)

I'm going to look into setting up the toolchain just to experiment, but I don't know about this version of vice. It looks like whoever ported it for gcw0 took away most of the command line options: you don't even get  -help.

I also found a TI99/4A emulator binary "DIngux-TI99"  (compiled for GP2X or Dingoo or something ) that works well  on GCW0. (Again just for arcade game carts, I'm not about to type in BASIC or fiddle with disk images on a handheld.) But I run into the same dumb issue if I want to stuff it in an OPK: saves and config files have to be moved to home because squashfs is read-only.  Or I can just leave the binary and all it needs in a folder in apps and create a launcher icon manually. I'm inclined to just do that again.

I dunno about clean/elegant. I'm liking folders a lot more than strange, read-only compressed filesystems. But there's no reason we can't have both: this isn't Nintendo!


 

Post a new topic