You are viewing jorallan

 
 
27 September 2009 @ 11:26 pm
How not to rip off somebody else's code  
The Spectrum fans amongst you may be aware that there is now a Spectrum emulator, called ZX Gamer by Roger Boesch, available for the iPhone. There's one important thing about this emulator, and that is that it sucks. It doesn't just suck a little bit. In fact, it manages to suck so much that it actually runs slower than a real Spectrum (3.5 MHz) on my 3GS (600 MHz). Everyone else who's had the misfortune to download this app agrees, as it's currently got 13 ratings on the App Store, each of which gives it just one star.

Now, there's basically no way you can manage to write an emulator which runs that slowly, unless you write it in a completely inappropriate language. One completely inappropriate language to write a Spectrum emulator in would be JavaScript. However, Matt Westcott is a bit of a nutter (in an entirely good way) and in fact has done just that, calling it JSSpeccy.

Now this starts to get interesting... the three games distributed with ZX Gamer (Batty, Cyclone and Exolon) are three of the example games Matt put up for the JSSpeccy demo. Also, Mr Boesch contacted Matt to ask him some details about JSSpeccy's Z80 core implementation. What's now particularly interesting is that ZXGamer runs at exactly the same speed as JSSpeccy (which happily runs on the iPhone), taking just over 30 seconds to flip from the controls screen to the high score table on Batty. This could all be coincidence, and Mr Boesch has publicly stated that ZXGamer is not based on JSSpeccy. So that's alright then.

However, I'm well known to be a sucker for punishment, so I paid for and downloaded this sucky software, and after backing up my iPhone had a little snoop around the backup directory. I quickly found a couple of files...

$ cat 6573fa774785883cf41752388d5fa9d4b7d1a482.mdinfo
[ binary junk ]AppDomain-com.rogerboesch.zxgame[ more binary junk ]
 
For the uninitiated, that says that the file 6573... contains data relating to the application name "zxgame.rogerboesch.com". The .mdinfo file contains the metadata, while the actual file data is in...
 
$ head 6573fa774785883cf41752388d5fa9d4b7d1a482.mddata
function sign_extend(v) {
  return v < 128 ? v : v-256;
}
 
function z80_do_opcodes()
{
 
  while(tstates < event_next_event ) {
 
    var opcode;
 
Now, let's take a look at the JSSpeccy source....
 
function sign_extend(v) {
  return v < 128 ? v : v-256;
}
function z80_do_opcodes()
{
  while(tstates < event_next_event ) {
    var opcode;

Wow! Mr Boesch has managed to completely independently come up with his own Z80 core implementation which looks exactly like JSSpeccy's. What are the chances of that happening?

Disclaimer: JSSpeccy is basically a translation of Fuse's Z80 core (which was written by me) into JavaScript. What this does mean is the JSSpeccy is GPL code, and therefore so it would appear is ZXGamer. Where should we go from here?

 
 
Current Mood: annoyedannoyed
 
 
 
( 5 comments — Leave a comment )
Super thronos viginti quatuor: :(cngsoft on September 27th, 2009 11:34 pm (UTC)
Yikes, this is awful. The ripoff is shameless and the website is so blatantly fake that its even full of typos ("hundred of games", "Unfortunatelty", "will some days allow"...) including the gem of the crown: "XZ Spectrum".
Philip Kendalljorallan on September 28th, 2009 06:34 am (UTC)
I put some of that down to the fact that Mr Boesch's native language isn't English. But "XZ Spectrum" is pretty funny :-)
mattythorne on September 28th, 2009 08:57 am (UTC)
The use of the ternary operator in the sign_extend(v) function is more or less proof to me that Matt's code has been ripped off. Far more than a simple coincidence IMHO. When will we get an explanation from Herr. Boesch?
Philip Kendalljorallan on September 28th, 2009 09:38 am (UTC)
There's 1000+ lines of identical code in there - it's definitely not a coincidence! (I only quoted the first 10 or so here to keep this post reasonably short).

As for a response from Mr Boesch, he'll have seen my tweet on this subject, so he's going to be aware of this post. We'll wait and see.
mattythorne on September 28th, 2009 12:10 pm (UTC)
Herr Boesch gewesen ein frecher Junge!
( 5 comments — Leave a comment )