Emulating Games Over the Web

13 August 2009
  • Today i cracked the issue i was having with running multiple threaded emulators. I traced the problem to how i handled loading the disk images and snapshots.
  • Also i found that i need a delay between starting each emulator. This is most likley somehting to do with lots of static references in the code, however im trying to modify the JPC source as little as possible to help with integration into future versions. So my solution was simply to put a pause of 2 seconds between starting each emulator instance.
  • I also found that under the code i needed to recreate the saved snapshots from my previous code.

16 June 2009
  • To help the task of spooling new emulator instances for different web users i must first implement a sessioning system so i know who the user is between HTTP requests. i did this today by setting a cookie in the browser called JSESSIONID which has a value of a random number. At every request i check to see if there is a JSESSIONID cookie, if there is not i create it with a rand as the value and create a new HTTPSession object and put it in a hashmap with the rand as the key. If there is a JSESSIONID cookie i take the HTTPSession object from the hashmap using the SESSIONID as the key. The HTTPSession object currently stores the SESSIONID and the users Emulator, it will later include username and any other information about a user.
  • I then rewrote the emulator initialising code so that it is created when a user request a game and doesnt already have an emulator, instead of just when the program starts. This isnt working at the moment unfortunatly. It does pretty well though, it will start up load the drives (i think) and load the state but then freezes. So i still have some work to do in this area most likley to do with threading which i havent looked into yet.

12 June 2009
  • In an effort for interface prettyness i implemented a set screenshot button which would save the current frame as a small jpeg that would be used in the games selection list. I then implemented the games list screen.

11 June 2009
  • Today i worked on interface prettyness. To make it so that you can select a game and it loads instantly ill need to make a configuration file and appropriate parsers etc to load both the disk image and the appropiate snapshot. Also i found that some games like monkey island give me memory errors when resuming in this way. But they dont if i load state to dos before loading the game. I will therefore add a requirereturn field to the configuration, so that i can save state in dos with the games path typed out. Then when the config is loaded it will load up into dos press return and end up in the game instantly.

10 June 2009
  • Spent some more time working on the mouse control, this looks like it will be difficult. It works but the emulator doesnt work in absolute coordinates it just sends changes in the mosues position to the virtual pc. This isnt a problem in an applet as you can capture the real mouse but i cant do this without objects. (as far as im aware)

08 June 2009
  • I emailed the JPC team on saturday asking about the doom over network thing. I hadnt been able to even get doom going let alone networked. I got a reply from Ian Preston of Oxfords Particle Physics department who gave me an early release of the JPC version 7 source big grin Ooooo Yeah. Also asneak peak at its new website. The new version will run doom and even graphical linuxs. The new code sports a virtual ethernet hub and virtual ethernet cards to connect to it. Today i have been getting the new code to complile and figuring out doom and networking. Current issues are doom seems to require IPX which isnt available and doom seems to run a little slow. i have emailed Ian asking about his experiences.


Jobs Before the 10th:
  • Get my changes into new code
  • Get doom running at a decent speed or other games to use as example
  • Hopefully get networking going
  • Find decent server to set it all up and cleanly run the program.

06 June 2009
  • In preparation for the open day on the 10th i decided to tackel the instability issues with (in an accent similar to borat) GREAT SUCCESS! Turns out that using the 'harddisk image from directory' feature doenst work to well. So i made up some proper images and started using them. Now im trying out a range of games to test the emulators capabilities. Also ide like to get network doom going since i found a wikipedia article that said it has been done.

  • I was working on mouse events tonight, and came into a few problems. Initially i noticed that the emulator made changes to the x and y coordinates + or - numbers to reflect direction rather than working in absolute positions. So i adapted my javasciprt in the interface to reflect this. But i found that a slow refresh rate made this loose synchronisity. So i adapted the interface to work in absolutes (scaled to the size of the browser window) and now i have the task of making the emulator do the same (not easy).

05 June 2009
  • Gave a presentation of my prototype during an Elvis meeting. Had instability issues.

19 May 2009
  • Working on mouse input, currently having problems with one click echoing and continously.

18 May 2009
  • Worked on pre-compressing vga frame, so that the frame doesnt have to be compressed after the browser reuqests a new frame. In the end i found that JPEG compression is sooo much faster than png compression tha i dont need to precompress frames to get a good frame rate.
  • Worked on Mapping KeyCodes between browser and emulator.The KB button with - and _ has a keycode of 109 in firefox but 45 in the emulator. Enter is 13 in the browser and 10 in the emulator.

16 May 2009
  • I started my blog
  • I made modifications to my prototype to make it grab the next frame only once the previous has finished loading. Rather than updating to a fixed internval.
  • Also i added the frame rate and time taken to download a single frame to the debugging info.

15 May 2009
  • Worked on Milestone 1 report
  • Read Susan Corbetts Digital Heritage: Legal Barriers to Conserving New Zealand's Early Video Games
  • Changed Method section to reflect methodologies used
  • Added new Screenshots
  • Milestone 1 submitted