Mako icon indicating copy to clipboard operation
Mako copied to clipboard

Embedding ROMs in Images (.png)

Open rmmh opened this issue 13 years ago • 2 comments

I'd like to make it possible to embed ROMs in .png images, so you can host them as images and have a Mako web player that you point to the appropriate URL.

Something like this:

Imgur

Holds about 128KB of data. The Five game compresses down to 20KB with bzip2..

I'm not sure on the best way to do the border around the data region. It might be helpful to have it include text like "Mako ROM -- http://mako.github.com/1" (assuming that's a link to the web player).

rmmh avatar Mar 16 '12 20:03 rmmh

Actually, there's something even cooler you can do by taking advantage of how the PNG and ZIP file formats work- concatenate an image onto an executable JAR of the game:

cat ScreenShot0.png Mako.jar >Joined.png

like this:

http://i.imgur.com/NZu4G.png

If you download that image and rename it with a .jar extension, you should be able to run it as a desktop application. In my above example, the image and jar formed a file that was 57k in total.

Think that would work?

JohnEarnest avatar Mar 16 '12 20:03 JohnEarnest

I know about that trick, but there's the possibility that some image host might strip the extra data. Not that big of a deal, I guess.

It's neat to have it all self-contained like that, although if you remove the .java files and the unecessary classes you can shave another 20k off that size.

rmmh avatar Mar 16 '12 21:03 rmmh