Jump to content
IGNORED

MRQ File Format


bodgit

Recommended Posts

Hello,

 

I was wondering if it's possible to get a breakdown of the MRQ file format so I could write my own tooling to generate them. I can see all of the various strings are at the head of the file but it would be good to know how the box and screen images are packed.

  • Like 1
Link to comment
Share on other sites

I think I have figured most of it out with a bit of trial and error:

  • Offset 0: 4 bytes 'M', 'Q', 0, 0 (some sort of version here?)
  • Offset 4: Title, 48 bytes zero padded
  • Offset 52: Developer, 24 bytes zero padded
  • Offset 76: Publisher, 24 bytes zero padded
  • Offset 100: Year, 4 bytes zero padded (if necessary)
  • Offset 104: Some sort of flag bit field, 16-bit value
  • Offset 106: Load address, 32-bit value
  • Offset 110: Exec address, 32-bit value
  • Offset 114: Box art image, 88x124 pixels as 16-bit values, packed as RRRRRBBBBBGGGGGG
  • Offset 21938: Screenshot image, 88x56 pixels, as above

Which gets you to 31794 bytes. All multi-byte values are interpreted as big endian.

 

The only part I'm unsure about is the flag bit field starting at 104. Setting a custom load/exec address seems to toggle 0x1 which makes sense, but setting the EEPROM to 128 bytes (0) doesn't seem to change anything, but setting it to 256/512 bytes (1) or 1024/2048 bytes (2) toggles 0x2 or 0x4 respectively in the flags. I can also pass the undocumented value 3 which toggles 0x6 in the flags (i.e. a combination of the two). Larger values seem to loop back around like the value is AND'd with 0x3 and then shifted left by one bit.

 

Some of the home-brew titles have this 0x6 value (HMS Raptor was one I found) so either the EEPROM values are actually 0 = no EEPROM, 1, 2, 3 are the various sizes, or it is 0, 1, 2 for the various sizes (and every game implicitly has at least a 128 byte EEPROM) in which case what does passing 3 signify given it's not mentioned in the tool help?

Link to comment
Share on other sites

  • 4 weeks later...

'MQ' is the magic number for identification followed by 2 byte version. Current is 0.

 

Flags are --

 

Bit 0 : Custom load

Bit 1-2: EEPROM bye size (0:128, 1:256/512, 2:1024/2048)

 

Bit 0 must be set for the load and exec address to be used.

 

The rest is correct. :)

Link to comment
Share on other sites

3 hours ago, SainT said:

Flags are --

 

Bit 1-2: EEPROM bye size (0:128, 1:256/512, 2:1024/2048)

What about the home-brew games that have both of these EEPROM bits set? Here's the relevant bytes from the various .mrq files in the Reboot pack:

 

00000060  00 00 00 00 32 30 31 32  00 06 00 00 00 00 00 00  |....2012........|

00000060  00 00 00 00 32 30 31 31  00 00 00 00 00 00 00 00  |....2011........| (128 byte size)

00000060  00 00 00 00 32 30 31 33  00 06 00 00 00 00 00 00  |....2013........|

00000060  00 00 00 00 32 30 31 33  00 06 00 00 00 00 00 00  |....2013........|

00000060  00 00 00 00 32 30 31 32  00 06 00 00 00 00 00 00  |....2012........|

00000060  00 00 00 00 32 30 31 32  00 06 00 00 00 00 00 00  |....2012........|

00000060  00 00 00 00 32 30 30 39  00 00 00 00 00 00 00 00  |....2009........| (128 byte size)

00000060  00 00 00 00 32 30 31 30  00 04 00 00 00 00 00 00  |....2010........| (1024/2048 byte size)

 

Is that 0x06 a valid value?

Link to comment
Share on other sites

11 hours ago, bodgit said:

What about the home-brew games that have both of these EEPROM bits set? Here's the relevant bytes from the various .mrq files in the Reboot pack:

 

00000060  00 00 00 00 32 30 31 32  00 06 00 00 00 00 00 00  |....2012........|

00000060  00 00 00 00 32 30 31 31  00 00 00 00 00 00 00 00  |....2011........| (128 byte size)

00000060  00 00 00 00 32 30 31 33  00 06 00 00 00 00 00 00  |....2013........|

00000060  00 00 00 00 32 30 31 33  00 06 00 00 00 00 00 00  |....2013........|

00000060  00 00 00 00 32 30 31 32  00 06 00 00 00 00 00 00  |....2012........|

00000060  00 00 00 00 32 30 31 32  00 06 00 00 00 00 00 00  |....2012........|

00000060  00 00 00 00 32 30 30 39  00 00 00 00 00 00 00 00  |....2009........| (128 byte size)

00000060  00 00 00 00 32 30 31 30  00 04 00 00 00 00 00 00  |....2010........| (1024/2048 byte size)

 

Is that 0x06 a valid value?

 

Hmm, interesting, that's not currently used. I have a memory about it being used to indicate FLASH memory as used on the memory track, but that's not been implemented yet.

 

Link to comment
Share on other sites

Yeah, I haven't run Windows for over 20 years which is what prompted me to write my own implementation. Golang makes it super easy to cross compile so it was just a reasonable set of OS/CPU combinations. Apologies to any Solaris owners!

  • Like 1
Link to comment
Share on other sites

  • 8 months later...

i did some tinkering and research today on this subject and found out it is reletively easy to extract the images saved in the MRQ files

 

this is what i did to achieve this feat:

 

open any mrq file in a hex editor
using the functions of the hex editor select the selections and export the rew data for the box and screenshots,  offset 114 - 21937 (decimal) for the box, 21938 - end of file (decimal) for the screen shot
goto this website: https://rawpixels.net/
load either of the two images into the webpage
set the image size for the image you have loaded,  box 88 x 124, screen 88 x 56
set pixel format to RBGA
set bpp1 = 5, bpp2 = 5, bpp3 = 6, bpp4 = 0

 

you do not need to change any of the other options

 

you will then see theat the correct image is then displayed at the top of the page above the options,  right click on it and use te save image as option (firefox) if using another browser use that browsers save image option.

 

repeat for the other image, dont forget to change the image dimensions

you shouldnt need to change the bpp options again

Link to comment
Share on other sites

  • 1 month later...

Ok I am honestly lost while trying to create these things. When I download the .exe and then oepn it, it just pops up then goes away. I read in another thread that SainT said it needs to be opened in a Command Prompt. I figured out how to do that and then what do I do from there? I couldnot figure out where to attach an image or how to save an MRQ. Sorry if I sound stupid with regards to this. I was hoping could literally open a program, fill in these boxes, attach an image, and then hit save as .mrq and it would generate the item for me to put into the SD card folder but I cannot figure out how to save or where to ad the picture.

  • Like 1
Link to comment
Share on other sites

I've been trying to create .mrq files but without much success.  I'm following the instructions in the readme.  Per the readme:

The box art must be supplied as a 88 x 124 pixel 24bit colour PNG file and the screen shot as an 88 x 56 pixel 24bit colour PNG file.

 

I'm using these online sites to resize:

 

https://jpg2png.com

https://convertio.co/jfif-jpg/

https://onlinepngtools.com/resize-png

 

Images resized, mrq created, but images do not appear in the menu.  I'm doing something wrong, but I'm not sure what it is.

 

 

@UHATEIT

Readme explains it all.  Use notepad to get your syntax right and then paste it into the command line.  Example shows you must use "quotes" for the names / variables you select.

Jaguar SD Marquee Tool
This tool allows you to create MRQ files for the Jaguar SD. An MRQ contains box art, a screen shot and details about the publisher, developer and year of release of a game.

Command Line Usage
Usage: png2mrq.exe [switches]

Switches --
  -box      : Box art PNG, 88x124, 24bit colour
  -screen   : Screen shot PNG, 88x56, 24bit colour
  -title    : Game title, max 48 characters
  -dev      : Developer, max 24 characters
  -pub      : Publisher, max 24 characters
  -year     : Year, max 4 characters
  -out      : Optional output marquee filename
  -load     : Optional custom load, loadaddr,execaddr hex
  -eeprom   : Optional EEPROM size, 0:128, 1:256/512, 2:1024/2048 bytes
  -pngdir   : Optional directory for PNG files
  -mrqdir   : Optional directory for output MRQ files
To create an MRQ, specify the game details as switches to the png2mrq program along with accompanying box art and screenshot PNG files.

The box art must be supplied as a 88 x 124 pixel 24bit colour PNG file and the screen shot as an 88 x 56 pixel 24bit colour PNG file.

To use an MRQ, place it in the same directory as the game ROM with the same filename, but with the .MRQ file extension.

Only specify the optional parameters such size of the EEPROM or absolute load address if you know what they are. These values will only be used for homebrew software and otherwise should not be set.

Example
png2mrq -box box.png -screen screen.png -title "Super Ace Game" -dev "Best Dev Co" -pub "PubSoft" -year 1999
        -out "Best Game Ever.mrq"
Edited by rayik
fixed spelling
Link to comment
Share on other sites

I have tried to do this in command prompt and have downloaded this .exe program and it's unzipped and on my desktop. When i go into Command Prompt and copy the items in and hit enter i get the following error message:

 

'png2mrq' is not recognized as an internal or external command,
operable program or batch file.

 

Using the Generic items from Saturn from the first page, this is what I entered in and hoped to have something come out:

 

png2mrq -box N88124.png -screen N88x56.png -title "DEGZ" -dev "Not Included" -pub "Not Included" -year " NA " -out "DEGZ".mrq

 

With the info above, what am I doing wrong that this is not working?

Link to comment
Share on other sites

5 hours ago, UHATEIT said:

I have tried to do this in command prompt and have downloaded this .exe program and it's unzipped and on my desktop. When i go into Command Prompt and copy the items in and hit enter i get the following error message:

 

'png2mrq' is not recognized as an internal or external command,
operable program or batch file.

 

 

 

That error message says you are not in the same directory as the png2mrq program.

 

After opening command prompt did you change to the desktop directory? Command should be "cd desktop"  Once you are in the desktop directory, program will execute and give you messages in the command window.

Link to comment
Share on other sites

On 6/1/2020 at 3:53 AM, bodgit said:

Thanks for the explanation guys, very helpful. I've put my code up here: https://github.com/bodgit/retrohq

 

It's a small Golang library that does the hard work with a small CLI that wraps it. There are precompiled binaries for Linux, OS X and Windows. 

 

Thanks for that link.  I was wanting to make some MRQ files tonight.  :D

Link to comment
Share on other sites

35 minutes ago, rayik said:

 

That error message says you are not in the same directory as the png2mrq program.

 

After opening command prompt did you change to the desktop directory? Command should be "cd desktop"  Once you are in the desktop directory, program will execute and give you messages in the command window.

I am clueless with command prompt, I've never had to use it before, so I had to hit the magnifying glass on the bottom bar of windows 10 and then searched command prompt which came up and had something on the left side and then it would only allow me to paste that I showed above next to it. 

 

Sorry if I sound stupid with this I had thought this would be a simple point and click and it just isn't that way for me. But I definitely want this to work so I can create one for each game. 

Link to comment
Share on other sites

  • 1 year later...

ok so i have been messing with this for quite some time now as a project to get to grips with vb.net as apose to the now obsolete vb6 so i have decided to share what i have currently.  it will eventually be a windows based mrq file editor / creator, for now it will only currently save the images as png to a folder you choose and display the mrq held information.

 

usage is simple, just drag the mrq file you want to view onto the program to get started

mrq.exe

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...