PROJECT STATUS:
26 Jul 07 - I now have the gp2x's second cpu doing all of the mpeg decoding, and it's fast enough to play a low bitrate mpeg at 30 fps (when I say low bitrate, I'm talking 250kbps-500kbps which doesn't look that great but it's a lot better than the results I was getting before!). Getting the two cpu's to work together efficiently has been a little bit challenging but now I have got Dragon's Lair playing at full speed (better than "nearly" full speed) without sound. The cpu emulation thread is using a lot more processor power than it should be, so I should be able to free up some more cpu here and there. So my targets for now will be Dragon's Lair and Space Ace. The other games that use video overlay will take more work and may not ever be playable at full speed. We'll see ...
2 Jul 07 - Dragon's Lair now plays at nearly full speed if I disable sound! YUV hardware acceleration is working.
19 May 06 - The latest gp2x firmware provides TCP/IP networking support via the USB cable to the gp2x, which makes developing and debugging MUCH easier. I finally got the problems resolved with GCC4 and ARM assembly language (basically I worked around what I consider to be compiler bugs) and so I was able to do some profiling with daphne running Dragon's Lair. It looks like the SDL_GetTicks function is calling gettimeofday which apparently is a huge resource hog on the gp2x. So either optimizing SDL_GetTicks or replacing it completely should provide a nice speed boost. (SDL_GetTicks is used heavily to make sure that the emulation runs at the correct speed).
08 May 06 - Some gp2x hackers are currently doing some work to try to figure out how to use the second cpu for video decoding work. I currently feel that this is the best option. While I wait for them to make some progress, I will be working on other Daphne enhancements and fixes.
29 Mar 06 - I did some optimization work on m80 (z80 emulator, the cpu used by Dragon's Lair) yesterday. I was able to identify several unnecessary pieces of code that were getting executed often that can be removed. I also was able to re-arrange some critical code to make it run a lot faster. What does this mean? It means that we are one step closer to having Dragon's Lair run at full speed on the gp2x.
20 Mar 06 - Here is the problem with gcc4 and the branch macro, as far as I can tell:
The branch macro currently creates a line of code like this:
PC = PC + buf[PC++];
gcc2, gcc3, and visual studio all seem to interpret this line as:
tmp = buf[PC]; PC = PC + 1; PC = PC + tmp;
but gcc4 is (incorrectly?) interpreting it as:
tmp = PC + 1; PC = PC + buf[PC]; PC = tmp;
So far, this is the only problem that I know of concerning daphne and gcc4.
17 Mar 06 - I've been working on the gp2x port again (woohoo!). It seems that most of the gp2x development is being done with GCC 4, which unfortunately does not compile daphne's z80 emulator properly (GCC 2 and 3 both work fine). I did a little work on troubleshooting what is wrong, and found that the branch macro is not being compiled properly. I can probably provide a workaround for gcc4 (at the cost of a little speed). Hopefully that is the only bug in gcc 4 that will hinder things from working.
21 Feb 06 - Here's a little update for you guys. I am in the process of moving to a new house which is taking up a considerable amount of time. In addition, my wife's mother has become critically sick and is in critical condition in the hospital in Boise, Idaho (which is a 5 hour drive away from where we live). I made this drive last weekend and may end up doing it again. Therefore, this is not the best time for me to do work on the handheld project. The good news is that I will continue to work on it when I can, and I will continue to make progress on it. Though the progress may be slower at times (such as this one), it will still be moving forward.
2 Feb 06 - I am going to pursue the idea of trying to do a lot of heavy work using the 2nd cpu. First I will try writing a very small test program to run on the 2nd cpu to make sure I can communicate between cpu's with the necessary information.
27 Jan 06 - Ok, it looks like some people have successfully been able to use the 2nd cpu on the gp2x. Unfortunately, there are some restrictions to doing this, including the inability to do file I/O. It may be possible to do some clever tricks to have all file I/O only done on the 1st cpu, but this would require some fairly non-trivial redesign. Still, it's an option.
25 Jan 06 - I've successfully gotten the dragon's lair video to play on the gp2x using the gp2x's YUV surfaces. This is without any kind of emulation (it's just the video playing), but it is using the VLDP code.
18 Jan 06 - Good news! I got some of the hacker samples that have been released to compile and work properly using a different compiler. My previous attempt at this had failed, which was putting a serious roadblock in my way. RGB scaling is working. YUV scaling works in theory but I have not yet seen this working in action, and this is something we will need in order to get fixed resolution games like Super Don working.
09 Jan 06 - Looks like a few people in the gp2x hacking community have figured out how to support YUV surfaces! This is indeed a good sign. YUV surface support is equivalent to the hardware acceleration that Daphne already uses, and is a necessary thing in order to have Daphne play at full speed on the gp2x.
04 Jan 06 - In case I forgot to mention this here, the gp2x does have quite a bit of built-in hardware to accelerate video playback, and the 'official' video player seems to be able to handle xvid videos at full speed just fine (according to my tests). So it should be possible to get Daphne running at full speed. The main problem is that accessing these accelerated hardware features is unknown to most of the community at this point; documentation is sparse, and tutorials/examples are all but non-existant. Hackers have been figuring out how stuff works slowly. I've been looking at the linux kernel source changes made for the gp2x and also the mplayer source code changes.
03 Jan 06 - I just got back from a mini New Years vacation. Unfortunately, my optimizations were not enough to get Dragon's Lair playing at an acceptable speed. The current problem is that when playback begins, it needs to drop a bunch of frames before any video actually is displayed. I've seen this same problem when trying to play Daphne from a DVD. It may be because the play command takes 'too long' to get to the VLDP thread. This may be a problem on fast computers too, that just doesn't get noticed because only 1 frame needs to be dropped.
28 Dec 05 - I've rewritten the cpu code to only use integers and it seems to be working! I will test it on the gp2x soon to see how much of a speed improvement it yielded. My fingers are crossed
26 Dec 05 - As a stroke of ill luck, my wife and I both became extremely sick last Thursday (the 22nd) and are still feeling somewhat sick even now. Yes, we were sick through Christmas. I wasn't able to get much work done on the gp2x port during this time. I am hoping to get back to it tomorrow.
21 Dec 05 - I've been optimizing the timing stuff in Daphne, specifically replacing floating point operations with integer operations. For the heck of it, I tried running Dragon's Lair on the gp2x (in daphne) with a very low bit rate mpeg and no sound. It was pretty choppy, but the attract mode was running! I am hoping to get a nice boost from optimizing the cpu emulation stuff (which currently uses a lot of floating point math).
18 Dec 05 - I got the Dragon's Lair attract mode to play in 320x240 at 18 FPS (full speed is 24 FPS). This is encoded at a bitrate of 1000kbps, and the picture quality looks acceptable to me. Without video, I have it decoding around 40 FPS. I have a few ideas on some optimizations I can do to get the framerate up to where it needs to be.
17 Dec 05 - I've got Daphne (including vldp) completely compiled on the gp2x. I've got Dragon's Lair, Super Don, and Cliff Hanger running in 'noldp' mode. I also got seektest working using vldp, but it is currently too slow to be useful. After doing some research, I've discovered that the gp2x does not have a floating point unit, which means that I can get a lot of speed increase just by replacing many (all?) of the floating point functions that Daphne uses. Cliff Hanger in noldp mode currently uses about 50% of one of the cpu's according to my calculations. The 'sweet spot' is 5% or less, so we'll see what I am able to do.
16 Dec 05 - I've received the gp2x!! Dang, that was fast considering it came from the UK. I got shareware Quake's introduction working and am impressed with the framerate! Now I am checking out the SDK.
14 Dec 05 - I've received notification that the gp2x has been shipped.
10 Dec 05 - I've received a response from gbax. Thanks for your help!
![:)](./images/smilies/icon_smile.gif)
The response said that if I choose to go ahead with my order that it will be dispatched within the next few days. I've told them to go ahead and send it.
9 Dec 05 - I have a minor problem that maybe someone could help me with. I ordered the gp2x unit from
http://www.gbax.com, which is a UK site on the 5th. Then the next day, I learned that there was a US distributor, so I thought maybe I could get it faster from the US distributor. So I emailed the contact address (
sales@cdworld.co.uk) and asked them if it was too late to cancel my order. Unfortunately, I have not heard back from them. Now... the situation is even less simple than you think (name that movie):
- My credit card
has been charged
- I have no way of knowing if gbax canceled my order or if it's being shipped.
- I will be buying a house soon so my billing address will only be good for at most 2 more months (at minimum 1 more month) and for some reason, gbax either never asked for my shipping address or I missed the spot on the form to indicate that my shipping and billing address should be different.
- I talked to a representative to the US distributor and he said that they have no gp2x units in stock, so my original thought to order from the US distributor may not have been such a good idea.
So basically, what I need is for someone to help me get ahold of gbax in the UK and figure out what is going on with my order. Since my CC was charged, I am assuming that the order was not canceled and is being shipped very soon, which should work out fine. If my CC was charged but they are out of stock and won't be shipping for another month, there could be a problem since I am moving. If my order was canceled and they just didn't confirm the cancelation with me, then I need to re-order from the US distributor and wait for them to get more in stock.
I am hoping that someone reading this has access to more resources to resolve this problem than I have. Thanks for your help and patience. I want to get started on this project as badly as you do
5 Dec 05 - The unit has been ordered!
-------------------------------------------------------------------------------
PROJECT DESCRIPTION:
Due to popular demand (see
https://www.daphne-emu.com/phpBB2/viewtopic.php?t=1894 and
https://www.daphne-emu.com/phpBB2/viewtopic.php?t=1932) I am going to port Daphne to the new GP2X handheld! (official page is
http://www.gbax.com)
But I will need your help. I will need $200 to buy a unit to do the development on. If you guys provide the donations, I will provide my expert programming skills
![:)](./images/smilies/icon_smile.gif)
and together we will make this a reality.
I will update the donations received here.
People are excited about Daphne on a handheld, including me. I think it will be so cool to walk into work with lasergames running on a little screen, so I can show it to people without having to take time to do any installation. And think about those long vacations...
Send this post to news sites, your friends, anyone you can think of. I will track the donations received on here and let you guys know when we've reached our goal.
As of right now, we have reached our goal to get started on the project, but donations will still help to move the project forward!
Donators will get to beta test and will be the first to get to play the finished version ![:)](./images/smilies/icon_smile.gif)
As an added bonus, to show my appreciation, I will let donators decide what I work on in DAPHNE after I finish this project.
Even if you are strapped for cash, every little bit helps!
UPDATE : Wow, you guys are amazing!
Thanks go to:
Richard Weeks (
http://www.mygp2x.com)
Rockford
Brad Oldham
Michael Lenardon
Tony M. Victorino
Chip Sbrogna
Rikuum
Deadkat37
RCade
Martin Dolphin
yuckymucky
Guppy
Tough Joe
Soljr
Demolition Man
Vladamire Steelwolf
atar1g1rl
Jeremy Schwab
Jerryhargabyte
Scott Cartier
Colin Crisanti
Jason Tipton