Q: How do I save my game when running JavaBoy on a web site?
A: In version 0.91 and above, JavaBoy supports sending save data to a website.
The data is sent as an HTTP post request to a specified URL.
What this means is that you need a server which supports some form of
scripting, and to write a script which performs the saving. Sample PHP
script is included in this archive which will do the job. The script
was kindly contributed by Daniel Fisher. This script saves text files
for each user. They are called 'saveram.php' and 'loadram.php'.
If your server doesn't support PHP, or you want to save in a different
way (perhaps to a database) you will have to write your own script. You
will need programming knowledge for this.
If you're using free web space, you're probably out of luck, as these almost
never support scripting. You can still use JavaBoy, but you won't be able
to save your game.
To set the URL used for saves, include the following in your <APPLET> tag:
<PARAM NAME="SAVERAMURL" VALUE="[Your URL Here]">
<PARAM NAME="LOADRAMURL" VALUE="[Your URL Here]">
<PARAM NAME="USERNAME" VALUE="[Your user here]">
The SaveRamURL is the address that save data is submitted to, and the
LoadRamURL is the address that data is loaded from. Any parameters included
in the urls are sent to the script as well.
The Username allows you to keep several user's saves private. The username
is passed to the url to allow the server to determine who's save is in use.
THis is entirely optional though, you may prefer to generate a user id and
append it to the base urls.
When enabled, two extra options appear on JavaBoy's applet menu, Save
and Load.
When Save is selected, JavaBoy opens a connection to the SaveRamURL.
The POST section of the request contains the folllowing fields:
'romname' - The filename of the ROM being played
'gamename' - The name of the game being played (internal ROM name)
'user' - The user that was passed to the applet as the 'USERNAME' parameter.
'datalength' - The number of bytes that need to be saved.
'data0' - The save data itself, a long string, the length of which is equal
to 'datalength'.
The applet doesn't require any particular response from the server.
When Loading data, a similar process occurs. This time, the user variable
is passed on the GET method of the URL, which lets the server determine
which user is performing the load. The 'gamename' variable and the
'romname' variable is sent via the POST method. The server must respond
with the 'data0' field which was sent to it when the game was saved.
If there was no save data, the user should return with the string
'NOSAVERAM'. A general error condition can be indicated by returning
'ERROR' followed on the same line with details of the error. The
details will be shown to the user.
Please note that to save, JavaBoy must be loaded from the same server
that is used to save the data. If these differ, Java will throw a security
exception. This is because all unsigned Java apps on a web page run in
a sandbox that doesn't allow them to contact servers other than the one
they were loaded from.
Q: How do I compile JavaBoy?
A: To compile JavaBoy, you will need the source archive, which can be found on the
downloads page. You will also need a compiler which supports Java 1.2 (Java2 Revision 1.2). You can find this on Sun's site, amoung others. Once you have this, simply
type:
The necessary .class files will then be created.
Q: What's the debugger for?
A: It's a tool that can be used to debug Gameboy games while they're in development. You can examine the internal state of the gameboy, and change it to see
how the game responds. It came in very handy to debug the emulator too.
Q: What's the meaning of life, the universe, and everything?
A: That's easy, it's 42.
Background graphics taken from The Legend of Zelda, Earthworm Jim, Gremlins 2, Tetris, Bubble Bobble, Super Marioland, Gradius 2, Bubble Ghost, Megaman, Super Marioland 3, Burger Time, Donkey Kong, Aladdin, Street Fighter 2, Spiderman.