New Tool, qemu-unzip

Discussion and advice about emulating the QL on other machines.
Derek_Stewart
Font of All Knowledge
Posts: 3932
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: New Tool, qemu-unzip

Post by Derek_Stewart »

Hi,

I downloaded the qemu-unzip git zip file and compiled it on my Mint 19.3 laptop, I needed to install libzip-dev...

Strnagely, the complied executable is called "qem-unzip"

Running qem-unzip, with flightdeck demo from QL Homepage, gives
  • derek@lp1:./qem-unzip -d ~/flight ./flightdeck.zip
    Opening Zip ./flightdeck.zip
    Error opening zip file ./flightdeck.zip
Which is strange as:
  • derek@lp1:./qem-unzip ./flightdeck.zip
    Opening Zip ./flightdeck.zip
    Entry: Config
    00 00 17 BE 00 01 00 00 07 00 00 0F 66 6C 00 10 | ............fl..
    64 65 6D 6F 5F 44 45 31 37 5F 43 6F 6E 66 69 67 | demo_DE17_Config
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
    00 00 00 00 4D 69 58 20 00 01 05 31 00 00 00 00 | ....MiX ...1....
    Entry: Boot
    Entry: start.data
    Entry: uk_navaids.cde
    Entry: uk_world.cde
    Entry: FLIGHT.obj
    00 00 F9 1C 00 01 00 00 15 70 00 00 00 00 00 14 | .........p......
    64 65 6D 6F 5F 44 45 31 37 5F 46 4C 49 47 48 54 | demo_DE17_FLIGHT
    5F 6F 62 6A 00 00 00 00 00 00 00 00 00 00 00 00 | _obj............
    00 00 00 00 4D 69 58 25 00 01 05 38 00 00 00 00 | ....MiX%...8....
    Entry: MANUAL.doc
Seems to work, just the -d option has a problem, is there a space between the -d and the directory?


Regards,

Derek
User avatar
XorA
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: New Tool, qemu-unzip

Post by XorA »

Sparrowhawk wrote:
XorA wrote: Thats not something I would use as the Emulator does that conversion for me!
In Q-emulator, when I attach the folder where I qem-unzip'ed a zip file from Dilwyn's site and do a DIR FLP1_, I see the files with dot notation. Is that normal or have I missed something? It's always done that, I assumed it was a quirk that was needed for Q-emulator to work and that I had to rename things manually.
Damn I assumed Q-Emulator did that, sQLux does :-D

I added it after I needed it to compile a libc for c68 without munging files on host first!

Just FYI the name isnt specifically a reference to one particular emulator, as you saw from the bug you found I originally called it sqlux-unzip but it applies to a number of emulators so I renamed it QlEMulator-UNZIP :-D
But pull requests always welcome!
You are too kind when you assume I'd have a clue where to start - my knowedge of C is limited to reading the K&R book ;)
Never too late to start, qem-unzip uses standard C, nothing fancy :-D


User avatar
XorA
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: New Tool, qemu-unzip

Post by XorA »

Derek_Stewart wrote:Hi,

I downloaded the qemu-unzip git zip file and compiled it on my Mint 19.3 laptop, I needed to install libzip-dev...

Strnagely, the complied executable is called "qem-unzip"

Running qem-unzip, with flightdeck demo from QL Homepage, gives
  • derek@lp1:./qem-unzip -d ~/flight ./flightdeck.zip
    Opening Zip ./flightdeck.zip
    Error opening zip file ./flightdeck.zip
Which is strange as:
  • derek@lp1:./qem-unzip ./flightdeck.zip
    Opening Zip ./flightdeck.zip
    Entry: Config
    00 00 17 BE 00 01 00 00 07 00 00 0F 66 6C 00 10 | ............fl..
    64 65 6D 6F 5F 44 45 31 37 5F 43 6F 6E 66 69 67 | demo_DE17_Config
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
    00 00 00 00 4D 69 58 20 00 01 05 31 00 00 00 00 | ....MiX ...1....
    Entry: Boot
    Entry: start.data
    Entry: uk_navaids.cde
    Entry: uk_world.cde
    Entry: FLIGHT.obj
    00 00 F9 1C 00 01 00 00 15 70 00 00 00 00 00 14 | .........p......
    64 65 6D 6F 5F 44 45 31 37 5F 46 4C 49 47 48 54 | demo_DE17_FLIGHT
    5F 6F 62 6A 00 00 00 00 00 00 00 00 00 00 00 00 | _obj............
    00 00 00 00 4D 69 58 25 00 01 05 38 00 00 00 00 | ....MiX%...8....
    Entry: MANUAL.doc
Seems to work, just the -d option has a problem, is there a space between the -d and the directory?
It will work fine as long as -d option does not have a ~ in it, I forgot to account for that when the shell doesn't auto expand! The joys of *nix programming!

It will also work on bash (well the version I am using from Ubuntu 21.10) with the space as the shell decodes the ~ before the program sees it!


Derek_Stewart
Font of All Knowledge
Posts: 3932
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: New Tool, qemu-unzip

Post by Derek_Stewart »

Hi,

I had to put the complete file path to the decompress directory and the zip file.

Maybe I am a little bit out of date.

I will look at an upgrade.


Regards,

Derek
User avatar
XorA
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: New Tool, qemu-unzip

Post by XorA »

Derek_Stewart wrote:Hi,

I had to put the complete file path to the decompress directory and the zip file.

Maybe I am a little bit out of date.

I will look at an upgrade.
No need, I've just pushed what should fix this for you. Code now does shell expansion of passed filenames!


User avatar
XorA
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: New Tool, qemu-unzip

Post by XorA »

Now added Q-Emulator name escaping.

This will also switch . to _ as per Sparrowhawks ask.

This has been tested on a "Copy Protected" QL game, but only one, so possible there are still tweaks needed.

This escaping is turned on by -e on cmdline!


User avatar
Sparrowhawk
Super Gold Card
Posts: 624
Joined: Wed Dec 15, 2010 12:33 pm
Location: @131072
Contact:

Re: New Tool, qemu-unzip

Post by Sparrowhawk »

Nice! Thank you :)


a.k.a. Jean-Yves
User avatar
XorA
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: New Tool, qemu-unzip

Post by XorA »

So this has now been converted to rust!

Along the way fixing a long standing issue with the -d switch :-)


Post Reply