Saturday, November 15, 2008

C64 for iPhone: There and back again

Lately, I've had a chance to play some more with the iPhone (and I'm really enjoying XCode).  The title, 'There and back again' eludes to the fact that in my quest to have a C64 on my iPhone, I started by porting Frodo, and then ported VICE.  Now I'm 'back again' to Frodo.

Why?

I'll spare all the technical details for another post, but essentially the design of VICE (written in C) was not optimal for achieving playable performance out of a mobile CPU, like the iPhone.  Frodo is a much smaller code base, written in C++ and designed in such a way that GCC's optimizations were fully utilised.  I've spent time fixing some lingering issues with Frodo the last few days and now have iFrodo running 100% emulation speed at 25fps.  I could run the emulator at 50fps, but frame buffer access is not optimal in the public SDK today, adding significant overhead. When running Frodo in 'turbo' mode, the emulator runs up to 900%!

I fixed an issue in the 'fake' drive emulation, where many games would fail to load using the 'fast drive mode'.  This mode typically loads games in less than a couple of seconds at 100% emulation (even fast in turbo mode).  I found they would work when enabling the 'Emulate 1571' switch, but given this emulates the 6502 CPU similar to a real 1571 drive, it can take many minutes to load a game in some cases.  With that fix, the majority of games can load in fast mode.  For usability, I also updated the fast drive code to alert the user when a game requires the 1571 emulation, so it doesn't just crash, leaving you wondering.

I also found out that some games are cracked in such a way that are incompatible with Frodo (such as Wizball and Fist II).  I located alternative images of these games that worked, so Frodo is a go!

I resolved some remaining issues with the 'touch stick', and now can play games effectively.  I think the idea has turned out great in practice.  I chose this over the more popular on-screen 'D' pad and fire button, which forces the user to press a specifically targeted area, that is difficult to master without any tactile feedback.  What lead to my design was that I attended a User Experience seminar, presented by Chris Nodder of Nielsen Norman Group (ironically, their website appears to be an example of poor design) and learnt about Fitts' Law.  I've alloted the whole screen to joystick function, meaning you can watch the game and not your fingers.

The majority of work left is related to
  • Saving state when the app is terminated (such as by the Home button or an incoming phone call).
  • save / load named game state and
  • landscape mode.
I'll create a video demonstration the emulator in action on a physical device very soon.

This all helps with some of the issues I had with mSID too - so I'll post an update on that shortly.

20 comments:

Anonymous said...

Fantastic news, can't wait for further updates! I really, really want to play C64 games on my iPhone. I know nothing about the technical stuff but I'm following this blog closely because I desperately want games like Wizball and Defender of the Crown! There must be a huge demand for such games.

Hopefully there'll be a way to get these on Appstore with minimal legal issues (I read some earlier posts expressing doubts about how this can all be achieved). Anyway, good luck with it all. :)

Anonymous said...

Excellent !

I can't wait for a release.....

Anonymous said...

Excellent !

I can't wait for a release.....

Anonymous said...

Thank you for keeping up with this. I so want to play miner 2049er on my iphone.

Timothy Barrington-Smythe said...

Given there's not even been so much as a screenshot for the SID player in almost 3 months since MSid was announced, I give up hoping and waiting. It's been over a year now. We've got a poxy SC68 player, but no SID.

Anonymous said...

Thanks for working on this, I'm excited to see it. And, seeing as I'm not contributing to this project at all, I will be patient, and happy to get it whenever it becomes available.

-David

Anonymous said...

hi there and thanks for working on this emulator..im very excited to hear any news so please keep us posted, and let me know if there is a way to donate to support your efforts!

Scott

Stuart said...

Thanks mate. Watch this space :)

Anonymous said...

Take a look at this one:
http://de.youtube.com/watch?v=ShFgu8mTAyc

NoP said...

So?

I think U will loose this race... the others make it better,faster than you...

Stuart said...

The SID player will be coming in the new year, as I have been focused on my other iPhone project.

As I mentioned earlier, stay tuned...

Anonymous said...

the above link is of a sid player, not an emualtor? whats your point????

Anonymous said...

Yes the link shows a video of a finished sid player. It says coming soon to your appStore.

Anonymous said...

Hi Stuart

Still very excited at the prospect of this..how are things going?

Stuart said...

I've been actively working on it with a partner, and we are getting close, mate! There are still some 'administrative' details being worked out, such as a release date; however, we are close. For all the Commodore nostalgics, I'm very certain you won't be disappointed ;-)

Anonymous said...

hi there..sorry to be a pest... any new news?

masterro said...

Waiting for the release

Stuart said...

No worries. I wish there was more I could say right now, but do keep an eye on this blog!

Anonymous said...

hasn't been an update on like three months
Is this project still a go?

daniel said...

Hey, I'm on the 3.0 beta. Any chance of helping with testing?