Page 2 of 2

Re: New Tool, qemu-unzip

Posted: Wed Jan 26, 2022 2:57 pm
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?

Re: New Tool, qemu-unzip

Posted: Wed Jan 26, 2022 2:59 pm
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

Re: New Tool, qemu-unzip

Posted: Wed Jan 26, 2022 3:02 pm
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!

Re: New Tool, qemu-unzip

Posted: Wed Jan 26, 2022 3:15 pm
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.

Re: New Tool, qemu-unzip

Posted: Wed Jan 26, 2022 3:39 pm
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!

Re: New Tool, qemu-unzip

Posted: Fri Apr 08, 2022 10:55 pm
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!

Re: New Tool, qemu-unzip

Posted: Sun Apr 10, 2022 9:16 am
by Sparrowhawk
Nice! Thank you :)

Re: New Tool, qemu-unzip

Posted: Thu Feb 09, 2023 9:40 pm
by XorA
So this has now been converted to rust!

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