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

Postby Aleex820 » Thu Mar 07, 2019 7:39 pm

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
QL Wafer Drive
Posts: 1233
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: Zip to MDV

Postby Derek_Stewart » Thu Mar 07, 2019 10:25 pm

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 13 times

Probably best to compile the source again.
mdvtool_src.zip
MDVTOOL source code
(7 KiB) Downloaded 16 times


Regards,

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

Re: Zip to MDV

Postby Aleex820 » Sat Mar 09, 2019 8:35 am

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
Super Gold Card
Posts: 677
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Zip to MDV

Postby NormanDunbar » Sat Mar 09, 2019 8:52 am

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?
If at first you don't succeed, don't take up skydiving!
If you think your job is pointless, remember, there's someone in Germany who fits indicators to BMWs.
User avatar
XorA
Super Gold Card
Posts: 577
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Zip to MDV

Postby XorA » Sat Mar 09, 2019 11:19 am

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
QL Wafer Drive
Posts: 1233
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: Zip to MDV

Postby Derek_Stewart » Sat Mar 09, 2019 2:42 pm

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
Gold Card
Posts: 316
Joined: Sun Feb 02, 2014 10:54 am

Re: Zip to MDV

Postby mk79 » Sun Mar 10, 2019 9:24 pm

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
Super Gold Card
Posts: 577
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Zip to MDV

Postby XorA » Mon Mar 11, 2019 2:09 pm

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: 19
Joined: Fri Dec 21, 2018 1:25 pm

Re: Zip to MDV

Postby Tuna » Mon Mar 11, 2019 9:04 pm

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
QL Wafer Drive
Posts: 1233
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: Zip to MDV

Postby Derek_Stewart » Tue Mar 12, 2019 6:04 pm

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

Who is online

Users browsing this forum: No registered users and 0 guests