dMZX Forums: mzxinfo - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

mzxinfo Revamped and reduxed

#1 User is offline   Revvy 

  • Jeez guys, there's no need to be narky.
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,520
  • Joined: 05-March 01
  • Gender:Male
  • Location:Ontario, Canada

Posted 21 December 2007 - 05:43 AM

While chatting with Wervyn this evening I came up with a method to quickly and hackily determine whether all the support files for an MZX game are present and accounted for. This program simply finds all periods in the world and grabs as many sensible characters from either side as possible. That means that it'll give you a few false positives in all likelihood, but on the other hand it has actually notified me of a couple missing files from some of my doz games.

So, usage:

c:\mzx> mzxinfo test.mzx
foo.mod - FAILED
bar.pal - FAILED

c:\mzx> mzxinfo test.mzx -a
foo.mod - FAILED
foobar.s3m - SUCCESS
bar.pal - FAILED

c:\mzx> mzxinfo doz2002\44111\44111.mzx
doz2002\44111\atomic05.sam - FAILED


Understand? You should usually be able to tell when something's a false positive, but if you're seeing a file name that looks like it's missing the first character or something, you can probably ignore it. From my investigations, mzx seems to throw some random crap in the world file, which seems to include partial filenames on occasion.

Hope this helps people! Source and executable (windows only) in the zip, the source is under the WTFPL.

Attached File(s)


<+AFK> Bringing whisky to my mother is like irrigating a lake.

<+AFK> dormando's apathy is palpable.
* AFK palpates
<dormando> stop that

<Malwyn> undressing with revvy a little over a metre away. new definition of awkward.
0

#2 User is offline   Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,961
  • Joined: 12-October 00
  • Gender:Male

Posted 21 December 2007 - 06:57 AM

You wonderful bastard.

This is going to make my next archive update plans less painful. Thank you.
angelic stream - shed sanguine - ill-adapt - avis - para/lyser - renaissance - dead tangent - phosphene blur - birth breeds death - ________ - painted glass - lagniappe

<Exophase> HES STEALING MAH AIRSHIP!!!!!!11111111
0

#3 User is offline   paulguy 

  • No furry sex
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,548
  • Joined: 14-July 02
  • Gender:Male

Posted 21 December 2007 - 07:26 AM

I made something like this in MZX once but it didn't check for the existence of files.


Why-Fi: but I'M MATURE ENOUGH TO BE A MODERATOR!!!!!!!!!!
0

#4 User is offline   ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 21 December 2007 - 09:33 PM

I hacked together an alternative program to do this better; it semantically parses any MZX world from 2.00 upwards and extracts both the default board MOD and the robot bytecodes. It implements a subset robotic parser and finds certain commands known to deal with input files.

Handles worlds and boards.

http://devzero.co.uk.../mzx/checkres.c
http://devzero.co.uk...zx/checkres.exe (windows binary)

TODO:
  • Parsing/ignoring of MZX strings.
  • Directory handling/changing based on input. Not too hot about this one, can think of situations where it will break.
--ajs.
0

#5 User is offline   Revvy 

  • Jeez guys, there's no need to be narky.
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,520
  • Joined: 05-March 01
  • Gender:Male
  • Location:Ontario, Canada

Posted 29 December 2007 - 01:20 AM

And the most to-date version of checkres is now released. This archive contains the win32 build of checkres, along with a batch file to make it easier to use and a readme. Go wild! Use and abuse!

checkres.zip
<+AFK> Bringing whisky to my mother is like irrigating a lake.

<+AFK> dormando's apathy is palpable.
* AFK palpates
<dormando> stop that

<Malwyn> undressing with revvy a little over a metre away. new definition of awkward.
0

#6 User is offline   CJA 

  • «≡larch bucket≡»
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,262
  • Joined: 23-June 05
  • Gender:Male
  • Location:......@.c....

Posted 29 December 2007 - 01:58 AM

The oasis in the desert... merely a mirage.

(404)
0

#7 User is offline   Sai'ke 

  • =)
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,272
  • Joined: 08-September 02
  • Gender:Not Telling

Posted 29 December 2007 - 03:01 AM

Might be an idea to add this into the mzx releases someday?
Everything is a potato to a degree you do not realize till you have tried to make it into fries.
- Bertrand Potato
0

#8 User is offline   ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 29 December 2007 - 03:24 AM

Yes, it'll probably be in 2.82. This release is really just for the DoZ. Hopefully Revvy gets round to fixing the link.

--ajs.
0

#9 User is offline   Revvy 

  • Jeez guys, there's no need to be narky.
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,520
  • Joined: 05-March 01
  • Gender:Male
  • Location:Ontario, Canada

Posted 29 December 2007 - 04:22 AM

Hee hee, whoopsies! Link fixed!
<+AFK> Bringing whisky to my mother is like irrigating a lake.

<+AFK> dormando's apathy is palpable.
* AFK palpates
<dormando> stop that

<Malwyn> undressing with revvy a little over a metre away. new definition of awkward.
0

#10 User is offline   Revvy 

  • Jeez guys, there's no need to be narky.
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,520
  • Joined: 05-March 01
  • Gender:Male
  • Location:Ontario, Canada

Posted 13 January 2008 - 06:00 PM

I made a fix to checkres a while ago that deals with partial charsets properly. You can grab the updated win32 build at the same URL as above.
<+AFK> Bringing whisky to my mother is like irrigating a lake.

<+AFK> dormando's apathy is palpable.
* AFK palpates
<dormando> stop that

<Malwyn> undressing with revvy a little over a metre away. new definition of awkward.
0

#11 User is offline   mzxgiant 

  • DigitalMZX Server Ninja & Code Monkey
  • Group: DigiStaff
  • Posts: 1,127
  • Joined: 02-January 01
  • Gender:Male
  • Location:Rochester, NY

Posted 13 January 2008 - 08:00 PM

This is only semi-offtopic, but is there a tech reference to the MZX file format anywhere?
0

#12 User is offline   afkHideki 

  • Member
  • PipPip
  • Group: Members
  • Posts: 123
  • Joined: 09-September 07

Posted 13 January 2008 - 08:11 PM

mzxgiant, on Jan 13 2008, 02:00 PM, said:

This is only semi-offtopic, but is there a tech reference to the MZX file format anywhere?

Are you looking for this, mate?
0

#13 User is offline   mzxgiant 

  • DigitalMZX Server Ninja & Code Monkey
  • Group: DigiStaff
  • Posts: 1,127
  • Joined: 02-January 01
  • Gender:Male
  • Location:Rochester, NY

Posted 13 January 2008 - 08:54 PM

That'd be it, thanks! :D
0

#14 User is offline   ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 13 January 2008 - 10:20 PM

Actually you want filef268.txt, the older file format only covers 2.51. Exo hasn't changed the world format since. There's a couple of places the file is ambiguous, the source code for checkres should help you out there.

--ajs.
0

#15 User is offline   Exophase 

  • Laughing on the inside.
  • Group: DigiStaff
  • Posts: 7,155
  • Joined: 23-October 00
  • Gender:Male
  • Location:Cleveland, OH

Posted 14 January 2008 - 12:10 AM

ajs, on Jan 13 2008, 05:20 PM, said:

Actually you want filef268.txt, the older file format only covers 2.51. Exo hasn't changed the world format since. There's a couple of places the file is ambiguous, the source code for checkres should help you out there.

--ajs.

As far as I'm aware, the world format hasn't been changes since 2.51 save for the different magic numbers (which have been updated for the most part).

In fact, it probably hasn't changed since 2.0.
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~

"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay

Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
0

#16 User is offline   ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 14 January 2008 - 12:29 AM

Correct, I meant filef200.txt not filef268.txt. What you said about the SAV vs MZX format is completely correct, and having checked, you are correct that the world format has not changed since 2.00. I was clearly confusing SAV and MZX files. Regardless, "fileform.txt" (as originally linked) is only useful for 1.x worlds.

These file format documents are badly named, filef268.txt actually only covers changes to the SAV file, but the other documents contain an entire spec. I'll look to consolodate these documents (at least filef200.txt and filef268.txt). Another useful task would be to figure out which of the SAV file breaking features were introduced in which version (necessary to fix a bug on the current regression list).

For 2.00+ world files + partially correct SAV info:
http://megazeux.svn....ld/filef200.txt

For current SAV info; doesn't cover all possible SAVs (something I'll hopefully fix for 2.82):
http://megazeux.svn....cs/filef268.txt

--ajs.
0

#17 User is offline   Koji 

  • End
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 6,644
  • Joined: 15-November 01
  • Gender:Not Telling
  • Location:US, NC

Posted 14 January 2008 - 03:22 AM

I don't know if any of these things successfully emulate this, but what about file resources that are addressed by expression

like "file_('loopcount').ext" put in some loop.

The only way for this sort of file detection would be to incorporate this into world testing.

A simple mechanism would be to have a log that mzx writes to when it cannot find a file (or other problems).
0

#18 User is offline   Exophase 

  • Laughing on the inside.
  • Group: DigiStaff
  • Posts: 7,155
  • Joined: 23-October 00
  • Gender:Male
  • Location:Cleveland, OH

Posted 14 January 2008 - 04:09 AM

Koji, on Jan 13 2008, 10:22 PM, said:

I don't know if any of these things successfully emulate this, but what about file resources that are addressed by expression

like "file_('loopcount').ext" put in some loop.

The only way for this sort of file detection would be to incorporate this into world testing.

A simple mechanism would be to have a log that mzx writes to when it cannot find a file (or other problems).

Or you could make it include all file_[0-9]*.ext instead...
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~

"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay

Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
0

#19 User is offline   Koji 

  • End
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 6,644
  • Joined: 15-November 01
  • Gender:Not Telling
  • Location:US, NC

Posted 14 January 2008 - 05:07 AM

what? you'd check for every number 0 to 2^31 - 1? :D

Of course that's hyperbole, but who knows what a counters value could be unless you are doing it with running data? Also note, variable strings...

So are we also going to check for file_[a-z]*.ext as well?

EDIT: also not to mention all the possible false errors these checks would supply if the actual code never uses some of these values.

This post has been edited by Koji: 14 January 2008 - 05:09 AM

0

#20 User is offline   Wervyn 

  • I can see you
  • Group: DigiStaff
  • Posts: 1,855
  • Joined: 24-December 00
  • Gender:Male
  • Location:Caras Galadhon

Posted 14 January 2008 - 01:59 PM

Yes, individually. You wouldn't run a regex on the directory to match files, because that would make too much sense. Honestly Koji, THINK some?

"Tetris is Tetris."
To lie is to change the truth.
..Ignorance is to be unaware of the truth.
....Incompetence is to be unable to grasp the truth.
......And escape is to run away from the truth.
It is useless to run, since the truth is right next to you.

-Wervyn
0

#21 User is offline   ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 14 January 2008 - 06:54 PM

@Koji: Obviously procedurally generated strings aren't handled by the tool very well, and you've identified a few reasons why this isn't possible to compensate for statically. With some clever logic or just UNIX command line tools you could transform the results into regular expressions, iterations, whatever the hell you wanted -- it still wouldn't be a catch-all. The tool doesn't necessarily provide a solution for all use-cases.

However, even _if_ you get a false positive for something like "set&i&.chr" you should at least have the common sense to check the current directory for files matching this pattern. The tool has still helped you identify the pattern, and nobody said it was a substitute for good testing.

Mostly the tool was engineered for rushed scenarios like DoZs (Pyro was affected in a way that he wouldn't have been if he'd used checkres) and for Terryn's archive updates. It isn't perfect and we accept patches.

--ajs.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users