Page 1 of 7 12345 ... LastLast
Results 1 to 10 of 62

Thread: Daedalus R8 WIP News (Nintendo 64 emulator for the PSP)

                  
   
  1. #1
    DCEmu Regular skater9269's Avatar
    Join Date
    Jun 2006
    Posts
    258
    Rep Power
    67

    psp Daedalus R8 WIP News (Nintendo 64 emulator for the PSP)

    Strmnnrmn posted this over at his blog:

    Unexpected optmisations

    One of the things that I find most rewarding about programming is when you discover an unexpected improvement or optimisation by accident. You can spend weeks carefully tuning and optimising code, only to stumble across a glaring inefficiency in your code which you've never spotted before. One quick change and your application is suddenly noticably faster.

    In my daily job I rely heavily on debuggers and profilers to discover bottlenecks in the working on the Xbox, Microsoft provided some excellent performance analysis tools (I see they've finally released PIX for Windows). These days I tend to use AQtime as I'm PC based (it's also one of the few profilers I've found that can handle the size of our libraries at work without grinding to a shuddering halt.)

    Without these kind of tools it's a lot tougher profiling on the PSP. Over the past few months I've built a number of custom profiling tools into Daedalus to help me figure out where all the time is going, but the numbers I get out tend to be quite vague, and there's usually quite a large margin of error. I think this explains why the unexpected optimisation I've just found went undiscovered for so long.

    A couple of days ago I was browsing the ps2dev forums and came across this post. I was about to back out after a quick scan, when I noticed this comment from Soatome:

    PeterM wrote:
    but one waits for the vblank
    ...and that's sceCtrlReadBufferPositive (which you're using) you should use sceCtrlPeekBufferPositive instead.

    That's when I realised that when Daedalus was emulating a rom, it was stalling for a frame every time the rom read the status of the pad*. In other words by changing one line of code in Daedalus from

    sceCtrlReadBufferPositive
    to
    sceCtrlPeekBufferPositive

    I could get on average an instant 1fps speedup across all roms. What's more, I knew some roms read from the pad multiple times each frame, so they would see an even great speedup.

    Frustratingly I had to wait a couple of days before I could try this out. As I mentioned earlier I'm in the process up moving over to a new PC, and I had just moved Perforce over but hadn't set up the pspsdk, which required Cygwin. Daedalus requires libpng and zlib so I had to download and build them too. Then I had to set up Psplink, PuTTY and a whole host of other tools. You get the picture...

    Last night I finally managed to get a new build together with the updated code, and the results were every bit as good as I'd expected. In some cases I had to restart the rom just to make sure I wasn't mistaken. I know most of you just want to see some numbers, so here's a few of my observations:

    Mario now runs at at steady 15fps in most places, and around 20fps indoors etc (it reaches over 35fps in the main menu, and close to 30 in some scenes.) Zelda now runs at around 8fps in game, and up to 20fps in certain places. The 'nintendo' logo at the start runs at over 90fps The MarioKart Nintendo logo now runs at 30fps, and the main menu (with the flag) runs at a solid 15fps. In game it's a comfortable 12fps. Starfox runs at around 15fps - the intro runs at 25-30fps. Quest64 runs at 20fps.

    So all in all it's a pretty amazing improvement for a single-line change. Having said that, I think it would be a mistake to assume that this is an instant fix that will suddenly make everything fully-playable. Although some of the framerates I list above are excellent - faster than an native n64 even - not all roms show this improvement. Don't assume that all roms now run at 15+fps (because they don't.) There's still a lot more work to do to get from a sluggish 8fps to a more playable 15fps (in Zelda for instance). I still need to save a lot more cycles in order to support other features such as sound.

    Because this change makes such a big improvement I'm going to try and get another release out sooner rather than later. I don't like releasing builds too often as I think each revision should something worthwhile, but I think this qualifies There are a couple of other optimisations I want to get in this build, so while it might be ready this weekend, sometime early next week is more likely. The new features I had planned for this build will have to wait until R9.

    As always, I'll keep you posted.

    -StrmnNrmn

    *This actually reminds me of a funny story from one of the Xbox games I was working on. We were investigating a sudden slowdown that had been appeared a few days previously. Somehow I realised that the framerate doubled when you unplugged all the controllers. As it turned out someone was accidentally reinitialising the USB hub every frame, and removing the all controllers prevented this from happening.

    Awesome info for Nintendo 64 Emulation Fans.

  2. #2
    DCEmu Newsposter BelmontSlayer's Avatar
    Join Date
    May 2006
    Location
    USA
    Age
    37
    Posts
    384
    Rep Power
    0

    Default

    Here is the entire post...This is an awsome breakthrough!

    Unexpected optmisations

    One of the things that I find most rewarding about programming is when you discover an unexpected improvement or optimisation by accident. You can spend weeks carefully tuning and optimising code, only to stumble across a glaring inefficiency in your code which you've never spotted before. One quick change and your application is suddenly noticably faster.

    In my daily job I rely heavily on debuggers and profilers to discover bottlenecks in the working on the Xbox, Microsoft provided some excellent performance analysis tools (I see they've finally released PIX for Windows). These days I tend to use AQtime as I'm PC based (it's also one of the few profilers I've found that can handle the size of our libraries at work without grinding to a shuddering halt.)

    Without these kind of tools it's a lot tougher profiling on the PSP. Over the past few months I've built a number of custom profiling tools into Daedalus to help me figure out where all the time is going, but the numbers I get out tend to be quite vague, and there's usually quite a large margin of error. I think this explains why the unexpected optimisation I've just found went undiscovered for so long.

    A couple of days ago I was browsing the ps2dev forums and came across this post. I was about to back out after a quick scan, when I noticed this comment from Soatome:


    PeterM wrote:
    but one waits for the vblank


    ...and that's sceCtrlReadBufferPositive (which you're using)
    you should use sceCtrlPeekBufferPositive instead.




    That's when I realised that when Daedalus was emulating a rom, it was stalling for a frame every time the rom read the status of the pad*. In other words by changing one line of code in Daedalus from


    sceCtrlReadBufferPositive


    to


    sceCtrlPeekBufferPositive


    I could get on average an instant 1fps speedup across all roms. What's more, I knew some roms read from the pad multiple times each frame, so they would see an even great speedup.

    Frustratingly I had to wait a couple of days before I could try this out. As I mentioned earlier I'm in the process up moving over to a new PC, and I had just moved Perforce over but hadn't set up the pspsdk, which required Cygwin. Daedalus requires libpng and zlib so I had to download and build them too. Then I had to set up Psplink, PuTTY and a whole host of other tools. You get the picture...

    Last night I finally managed to get a new build together with the updated code, and the results were every bit as good as I'd expected. In some cases I had to restart the rom just to make sure I wasn't mistaken. I know most of you just want to see some numbers, so here's a few of my observations:

    Mario now runs at at steady 15fps in most places, and around 20fps indoors etc (it reaches over 35fps in the main menu, and close to 30 in some scenes.) Zelda now runs at around 8fps in game, and up to 20fps in certain places. The 'nintendo' logo at the start runs at over 90fps The MarioKart Nintendo logo now runs at 30fps, and the main menu (with the flag) runs at a solid 15fps. In game it's a comfortable 12fps. Starfox runs at around 15fps - the intro runs at 25-30fps. Quest64 runs at 20fps.

    So all in all it's a pretty amazing improvement for a single-line change. Having said that, I think it would be a mistake to assume that this is an instant fix that will suddenly make everything fully-playable. Although some of the framerates I list above are excellent - faster than an native n64 even - not all roms show this improvement. Don't assume that all roms now run at 15+fps (because they don't.) There's still a lot more work to do to get from a sluggish 8fps to a more playable 15fps (in Zelda for instance). I still need to save a lot more cycles in order to support other features such as sound.

    Because this change makes such a big improvement I'm going to try and get another release out sooner rather than later. I don't like releasing builds too often as I think each revision should something worthwhile, but I think this qualifies There are a couple of other optimisations I want to get in this build, so while it might be ready this weekend, sometime early next week is more likely. The new features I had planned for this build will have to wait until R9.

    As always, I'll keep you posted.

    -StrmnNrmn

    *This actually reminds me of a funny story from one of the Xbox games I was working on. We were investigating a sudden slowdown that had been appeared a few days previously. Somehow I realised that the framerate doubled when you unplugged all the controllers. As it turned out someone was accidentally reinitialising the USB hub every frame, and removing the all controllers prevented this from happening.
    I was asked to memorise what I did not understand; and, my memory being so good, it refused to be insulted in that manner. ~Aleister Crowley (1875-1947)

  3. #3
    DCEmu Legend Video_freak's Avatar
    Join Date
    Dec 2005
    Location
    Bay Area, California
    Posts
    2,892
    Rep Power
    104

    Default

    Yes! This is awesome news! R8 is going to be even more kick ass then R7.

  4. #4
    PSP User irondirgible's Avatar
    Join Date
    Dec 2005
    Location
    Minneapolis, Minnesota
    Posts
    67
    Rep Power
    0

    Default

    Quote Originally Posted by me, while reading the article
    holy crap, holy crap, holy crap...
    Awesome! I code a bit too, and its amazing how one little thing can have such a large effect.

  5. #5
    DCEmu Legend ACID's Avatar
    Join Date
    Feb 2006
    Location
    6 Feet Under
    Posts
    2,348
    Rep Power
    83

    Default

    Great catch keep up the great work.
    Thaks belmontslayer for the info.

  6. #6
    XBOX 360 User Kramer's Avatar
    Join Date
    May 2006
    Location
    Perth, Australia
    Age
    34
    Posts
    1,807
    Rep Power
    79

    Default

    woah he says zelda is running 8 fps in game thats a pretty big speedup from 4-5 fps

    -!-
    /\

  7. #7
    DCEmu Legend ACID's Avatar
    Join Date
    Feb 2006
    Location
    6 Feet Under
    Posts
    2,348
    Rep Power
    83

    Default

    It is i hope he stops sleeping and just consentrates on this emu. LOL just kiding but it is great improvement.

  8. #8
    DCEmu Old Pro BL4Z3D247's Avatar
    Join Date
    Jun 2006
    Location
    BL4Z3D 24/7 in CT
    Posts
    1,970
    Rep Power
    80

    Default

    i think he should throw a menu in R8 seeing how he just got another breakthrough so soon, instead of waiting for R9 to do it...that's just my opinion though, i just think it's a bit of a hastle doing a hard power off to exit/switch roms...either way all is greatly appreciated StrmnNrmn

  9. #9
    DCEmu Old Pro V3N0M's Avatar
    Join Date
    Mar 2006
    Location
    SoCal
    Age
    33
    Posts
    1,340
    Rep Power
    83

    Default

    Great work! I really can't believe how much progress StrmnNrmn has made. I really do think this emu will be far better than anyone expected. I really admire your work great job.

  10. #10
    PSP User Uruz 6's Avatar
    Join Date
    Jul 2006
    Location
    Salerno, Italy
    Posts
    339
    Rep Power
    67

    Default

    Great news

Page 1 of 7 12345 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •