JohnEarnest / Mako

A simple virtual game console
Other
566 stars 39 forks source link

Embedding ROMs in Images (.png) #5

Open rmmh opened 12 years ago

rmmh commented 12 years ago

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).

JohnEarnest commented 12 years ago

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?

rmmh commented 12 years ago

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.