Zip to MDV

Discussion and advice about emulating the QL on other machines.
Aleex820
ROM Dongle
Posts: 2
Joined: Tue Mar 05, 2019 6:00 pm

Zip to MDV

Post by Aleex820 »

Hello, all!

I would like to use QLAY (inside DOSBox) as an emulator for Sinclair QL. QLAY uses MDV images
and this is not the favorite format for distributing QL software. Yet, there is a tool, mdvtool
( https://github.com/mist-devel/mist-bina ... ls/mdvtool ) which
seems to do a very good job, since it can create MDV images from zip files, preserving of course
the structure. But, I was not able to compile it, neither on Linux, nor on Windows.
Does anyone have a compiled version of that program?
Thanks!


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

Re: Zip to MDV

Post by Derek_Stewart »

Hi,

mdvtool is compiled with mingw32, but completely untested.

I found compiled version, which may not work.
mdvtool.exe.zip
Compiled MDVTOOL
(14.24 KiB) Downloaded 237 times
Probably best to compile the source again.
mdvtool_src.zip
MDVTOOL source code
(7 KiB) Downloaded 198 times


Regards,

Derek
Aleex820
ROM Dongle
Posts: 2
Joined: Tue Mar 05, 2019 6:00 pm

Re: Zip to MDV

Post by Aleex820 »

Thanks for your reply!

I tested the executable giving various parameters,
but unfortunately, as you have guessed, it doesn't work.
It gives the error message: Assertion failed: sizeof(file_t) == 64, file mdvtool.c, line 789

I will try again to compile from the source.


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Zip to MDV

Post by NormanDunbar »

Sounds like the usual problem I'm in the middle of fixing for qxltools. Structure field alignments. :(

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
XorA
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Zip to MDV

Post by XorA »

NormanDunbar wrote:Sounds like the usual problem I'm in the middle of fixing for qxltools. Structure field alignments. :(
Yeah it was never in the C spec that you could guarantee the placement or alignment of structure members, people just learned to rely on behaviour from certain compilers.

Modern compilers move the values to generate less instructions on modern wide bussed CPU's

G


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

Re: Zip to MDV

Post by Derek_Stewart »

Hi,

I tried to compile the mdvtool.c file, which gave an error:
mdvtool.c: In function ‘zip_import’:
mdvtool.c:585:27: warning: implicit declaration of function ‘zip_get_file_extra’; did you mean ‘zip_get_file_comment’? [-Wimplicit-function-declaration]
const char *extra = zip_get_file_extra(zip, i, &len, 0);
^~~~~~~~~~~~~~~~~~
zip_get_file_comment
mdvtool.c:585:27: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
/tmp/cc254guW.o: In function `zip_import':
mdvtool.c:(.text+0x192c): undefined reference to `zip_get_file_extra'
collect2: error: ld returned 1 exit status
Makefile:7: recipe for target 'mdvtool' failed
make: *** [mdvtool] Error 1
Looks like mdvtools uses zip_get_file_extra, but ZIPDEV library, it has been removed and now the function is: zip_file_extra_field_get

There maybe be other parameters passed in the new function. So replacing the function name may not work.


Regards,

Derek
User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: Zip to MDV

Post by mk79 »

XorA wrote:Yeah it was never in the C spec that you could guarantee the placement or alignment of structure members, people just learned to rely on behaviour from certain compilers.

Modern compilers move the values to generate less instructions on modern wide bussed CPU's
True, but I've never come across any that didn't have a #pragma pack support and with that the layout is again well defined.


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

Re: Zip to MDV

Post by XorA »

mk79 wrote:
XorA wrote:Yeah it was never in the C spec that you could guarantee the placement or alignment of structure members, people just learned to rely on behaviour from certain compilers.

Modern compilers move the values to generate less instructions on modern wide bussed CPU's
True, but I've never come across any that didn't have a #pragma pack support and with that the layout is again well defined.
Yes but that gets quickly into #if/#define messes as they are compile (and in some cases compiler version specific *glares at gcc*), would have been nice if the spec gods had acknowledged the heavy use of C in embedded and just gave us a new packed datatype :-D


Tuna
ROM Dongle
Posts: 20
Joined: Fri Dec 21, 2018 1:25 pm

Re: Zip to MDV

Post by Tuna »

The compilation problems were why I started QLFiler in Java - it can read .zip .mdv and .win files and 'just works' on any system with a Java runtime.

However, there didn't seem to be any interest in the project so I didn't go any further with the needed write functions to save out .mdv files.

Code is here if you're interested: https://github.com/atoone/ql-filer


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

Re: Zip to MDV

Post by Derek_Stewart »

Hi Tuna,

I am interested in QLFiler, but have no experience of Java.

Wolfgang Lenerz wrote a programme called QXLWINREADER in Java to read and write to QWA container files, which is a useful application.


Regards,

Derek
Post Reply