Page 1 of 2

Zip to MDV

Posted: Thu Mar 07, 2019 7:39 pm
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!

Re: Zip to MDV

Posted: Thu Mar 07, 2019 10:25 pm
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 240 times
Probably best to compile the source again.
mdvtool_src.zip
MDVTOOL source code
(7 KiB) Downloaded 202 times

Re: Zip to MDV

Posted: Sat Mar 09, 2019 8:35 am
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.

Re: Zip to MDV

Posted: Sat Mar 09, 2019 8:52 am
by NormanDunbar
Sounds like the usual problem I'm in the middle of fixing for qxltools. Structure field alignments. :(

Cheers,
Norm.

Re: Zip to MDV

Posted: Sat Mar 09, 2019 11:19 am
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

Re: Zip to MDV

Posted: Sat Mar 09, 2019 2:42 pm
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.

Re: Zip to MDV

Posted: Sun Mar 10, 2019 9:24 pm
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.

Re: Zip to MDV

Posted: Mon Mar 11, 2019 2:09 pm
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

Re: Zip to MDV

Posted: Mon Mar 11, 2019 9:04 pm
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

Re: Zip to MDV

Posted: Tue Mar 12, 2019 6:04 pm
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.