Page 1 of 4 1234 LastLast
Results 1 to 10 of 33

Thread: UPDATED! - Further Daedalus R7 WIP Update from Strmnnrmn

                  
   
  1. #1
    DCEmu Regular
    Join Date
    Jan 2006
    Location
    UK
    Age
    47
    Posts
    308
    Rep Power
    68

    psp UPDATED! - Further Daedalus R7 WIP Update from Strmnnrmn

    From strmnnrmn's blog:

    http://strmnnrmn.blogspot.com/

    LOL I just realised I should have summarised the post for the tldr crowd.

    Basically R7 looks like having greater compatibility, more speed increases, and if all goes well the new release will be out by next weekend.

    For those of you who like the juicy details:



    More R7 Optimisations

    It's been a while since my last post, but I've still been hard at work with various optimisations for Daedalus R7.

    Although my main focus is on improving the dynamic recompiler, I've been looking at optimising a couple of other areas that I noticed were fairly expensive. The texture cache is one of the areas that I spent time tuning this week. This cache is used to avoid converting textures from the native n64 formats to psp formats every frame. I made a couple of fixes to improve the hashing function which gives much faster lookups in certain situations (such as tiled backdrops). I also provided an option to change the frequency at which the texture cache checks for updates to the textures. Many roms look fine when this check is entirely disabled, and this can give quite a nice speed boost.

    My main focus has continued to be on the dynamic recompiler. I've made a couple more bugfixes in this area. One bugfix involved detecting when roms were using self-modifying code. The fix involved dumping the contents of the dynarec cache so that the code is correctly regenerated for the updated instructions. This fix solves a couple of issues I was seeing with Quest64, and I'm sure it will help improve compatibility with a number of other roms too.

    The other dynarec issue I fixed was related to the way I was handling certain types of branch instructions. The MIPS processor has a set of 'branch likely' instructions which work slightly differently to regular branches and so I handle them separately in the dynamic recompiler. It turned out that I had forgotten to link together code fragments when they exited through a branch likely instruction. This fix gives a nice little speedup.

    The biggest bit of new development I've been doing on the dynarec is on optimising for various situations where I can determine the contents of a given register at the time I'm compiling the code. As an example, many roms use the following sequence to load an integer value from memory at a specific address:

    LUI $t0, 0x8033 // Load Upper Immediate - i.e. load t0 with 0x80330000
    LW $t0, 0x1234($t0) // Load Word - i.e. load t0 with the value at 0x80331234

    Previously I'd generate code for both of these instructions on the PSP. The LUI instruction is easy (if t0 is cached on the PSP then this is just one instruction). The LW is a lot more tricky. I have to call a function to convert the address on the n64 (0x80331234 in this case) to the address in the emulated memory on the PSP. Then I have to read from that address, or trigger an exception in the emulator if the memory address is invalid.

    With the changes I've just made, when I encounter the LUI instruction (or other instructions involving loading constant values into registers) I keep track of the fact that I've loaded t0 with 0x80330000. When I come to process the LW instruction, I can now determine that the desired address is 0x80331234. I can then map that address directly to the required location on the PSP, avoiding a function call in the generated code. By avoiding the function call I no longer need to flush cached registers back out to memory. Also, because I can tell in advance that the address lies in RAM (and isn't referencing a hardware register for instance) then I can also omit the code testing for an exception. Finally, in situations like the example above, I can don't need to generate any code for the initial LUI (as the register is immediately overwritten with the loaded value.)

    In summary this is a very nice optimisation - it generates fewer instructions (reducing the size of the dynarec code), it avoids unnecessarily flushing out cached registers, it avoids generating exception handling code, and it can eliminate redundant instructions (the initial LUI). In the best case, for 2 source instructions it will generate just 3 output instructions, compared to 12-13 for the unoptimised case.

    Unfortunately this approach only works with load and store instructions where the address can be determined in advance, but from the roms I've examined so far around 10-15% of the load/store instructions can be optimised in this way, which is enough to give a measurable benefit.

    I'm going to spend the rest of this week seeing which other parts of the dynarec engine can benefit from similar approaches. I have a couple of other features to implement (configurable controllers etc), if that all goes to plan I'll try and prepare R7 for a release next weekend.
    -StrmnNrmn

    Please see page 4 for the update. Thanks - Tsu

  2. #2
    Registered User NoQuarter's Avatar
    Join Date
    Dec 2005
    Posts
    2,106
    Rep Power
    0

    Default

    Man,you rock.I just wish I understood the programming involved.Are you planning to implement wireless 2player once you hit full speed?

  3. #3
    DCEmu Rookie
    Join Date
    Jun 2006
    Posts
    125
    Rep Power
    66

    Default

    wow, sounds great

    and I'm really happy you share all this information with us. it's useless to me :P, but I'm pretty sure somebody else will learn something from it, and maybe try to follow your steps in the future.

    thnx again, for everything.

  4. #4
    DCEmu Newbie
    Join Date
    Apr 2006
    Posts
    7
    Rep Power
    0

    Default

    august is getting better first the CPS2 emu, now R7. but I have a ? will wrestling games be compatible(just wondering?) but still great news

  5. #5
    DCEmu Old Pro SSaxdude's Avatar
    Join Date
    Dec 2005
    Location
    Suburbia, IL
    Posts
    1,928
    Rep Power
    79

    Default

    strmnnrmn is the best coder out there.

  6. #6
    DCEmu Old Pro pkmaximum's Avatar
    Join Date
    Jul 2005
    Posts
    1,055
    Rep Power
    73

    Default

    Its great to see we have such a deticated worker working on a N64 emu for us ^_^

  7. #7

    Default

    I can't wait! by the sounds of it....this will at least be 30 to 40 FPS

    Keep up the stunning work Strmnrmn

  8. #8
    PSP User shenske37's Avatar
    Join Date
    Dec 2005
    Location
    colorado
    Age
    35
    Posts
    77
    Rep Power
    0

    Default

    i appreciate all of the updates, it really builds up the hype! its amaizing that you have gained so much speed in this next release.

    i'm very glad to here that you are implementing configurable controls.

    i can't wait untill this next release, thanks strmnnrmn for your constant hard work!

  9. #9
    DCEmu Pro sroon's Avatar
    Join Date
    Nov 2005
    Location
    Hyrule
    Age
    34
    Posts
    726
    Rep Power
    74

    Talking Next weekend will be awsome!!!

    There's only one thing I can say. . . .TITS!!!
    Dude Zelda will be awsome to play!!
    I honestly cannot wait!!
    Keep it up Norm!!!(O)(O)

  10. #10

    Default

    love the work man and cant wait for this release but to zion i dont think mario is gonna be running at 30 to 40 fps just yet he did said % speed increase not fps increase but i wont be surprised if mario runs at 20 fps crossing fingers that zelda also gets a big increase too.

Page 1 of 4 1234 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
  •