Tuesday, March 06, 2007

R10 Plan of Action

Before I went away on holiday I asked you what you thought I should look at working on for the next release of Daedalus. Over 200 of you replied, and I've greatly enjoyed reading what you've had to say. There were some brilliant suggestions, so many thanks for your contributions.

It seems pretty clear to me that speed is the single biggest issue that most people want to see addressed. Many people also mentioned compatibility and savestate or save game support, but in nowhere near the same kind of numbers as those wanting speed improvements.

Based on your feedback my current plan is to release Daedalus R10 at the end of March, focusing mostly on speed improvements. If I can fit in any easy compatibility fixes, I'll do this too*.

Several people have asked what possibilities remain for optimisation. Here's a short list of things I know need more work:
  • In many games, a lot of the time spent executing dynamically recompiled code is doing things which can potentially be emulated at a high level. For instance, over 5% of the time spent executing dynarec code in Mario64 is just converting matrices from floating point to fixed point format. Another 4-5% of the time is spent in a loop invalidating areas of the data cache (which is irrelevent in an emulator.)
  • Some of the most expensive fragments are those which branch to themselves (i.e. those doing many loops). I can optimise for this to avoid loading and flushing cached registers on each iteration through the loop.
  • I can implement a frameskip option (I had intended to implement this for R9, but forgot!)
  • I can make use of the Media Engine (as Exophase suggested in conversation, as the ME can't access VRAM, it might make more sense to execute Audio and Display Lists on the main CPU, and run the N64 CPU emulation on the PSP ME)
  • There are certain situations where I fail to create fragments in the dynamic recompiler - for instance if the code being recompiled writes to a hardware register, this triggers an interrupt and causes fragment generation to be aborted. I should be able to deal with situations such as this more gracefully.
  • The fragment generator can do a lot more to improve register caching, and eliminating redundant 64-bit operations.
  • There are many situations where N64 roms busy wait. I detect very simple occurances of this, but not all of them. If I manually identify more complex examples I can have the fragment generator optimise them away.
  • Some roms are causing the dynarec fragment cache to be repeatedly dumped and recreated (I think Banjo Kazooie is one example of this). Fixing this may just involve tweaking a couple of magic numbers.
  • I currently optimise memory accesses under the assumption that most accesses are in the range 0x80000000 - 0x80800000, which is incorrect in the case of roms that make heavy use of virtual memory, or access RAM through the mirrored range at 0xa0000000. I can improve the trace recorder to collect information on which range a memory access fell in, and generate code to speculatively optimise for this.
  • Now that the dynarec engine is producing much better code, the cost of display list processing is becoming more significant, and may finally be worth profiling and optimising.
That's quite a big list, so I doubt I'll be able to work on these things before the end of March, but I think it shows there's still a lot of scope for further optimisation.

-StrmnNrmn

*Just this morning, I figured out why the Expansion Pak support was broken, so Majora's Mask and a couple of other games relying on this are booting correctly now :)

27 comments:

Anonymous said...

Great! I always have those sudden, spontaneous thoughts about how to fix a coding error...

The frameskip is the biggest deal for me, because some things, such as starfox and mario kart, they move really smoothly, but slowly...So i could just easily give up a bit of smoothness for a bit of speed and make up for the lack of speed while you work on the new releases.

I'm interested to know what other good games use the expansion pack.

skatterfelt said...

That's quite a list! You neglected to mention which items on the list would likely improve speed the most--after all, the items with the greatest returns should be first focus.

Putting the N64 proc on the ME strikes me as a novel (and possibly difficult) concept. Do you think you'll pull that off before the end of March?

Unknown said...

AWESOME!!!I can't wait!!!
Keep up the good work StrmNrmn!!!:)

Anonymous said...

I think you should look into implementing a framerate limiter if it isn't too much work, Mario 64 and some other games actually run too fast at times lol

god0fgod said...

I agree with Adam i did find that to happen a few times in R9 and because R10 will be faster a frame limit should be implemented.

A said...

Great job with R9 StrmNrmn!!

Wanted to let you know of something I noticed with Daedalus. On the actual N64 it seems that the whole screen has some sort of AA filtering across it, resulting in a slightly blurry effect. I've noticed that Daedalus doesn't do this, and because of that some straight lines and edges seem jaggy. Is there any way to incorporate this rendering sytle with hitting the CPU/fps? If not nvm.. :)

Keep up the GREAT work! :D

staroz said...

Nice work!
I realy like your work and I am
very proud to see you growing a lot of better than before.
There is a smal problem with Zelda Ocarina Of Time. When you are in the deku tree than sometimes is freezes. Pleas fix the problem :).
Thank you very much!!!!!!!!!!!!!

Aqua Chaos...

Morgan said...

Yes I have also noticed this emulator needs a speed limit for some roms such as Mario, that could peopbably be a nice quick add for Daedalus. Nice to see you updating us often, StrmnNrmn does this expansion pack fix correct Goldeneye or DKR. I just want to see DKR, Goldeneye, & SSB working so anything you can do to get ANY of these working would be great. Anyway please address the two isues I talked about in my last post for R10 (says R8 in "about" section, and the more than 8roms flickering on the UI).


ps. Wally don't talk trash because if StrmnNrmn didn't want my post to be read he wouldn't have posted it with the filter.

Unknown said...

Wow, that list really got my hopes up for this emulator (don't worry, they have always been high). I didn't know there was so much to work on. I have very high hopes for the future. I can't wait to have Zelda OoT, Mario 64, SSB, Mario Kart, GoldenEye, and a few other classic games at playable speeds with few errors. Thank you very much and keep up the GREAT work (but take your time and do more of that stuff on your "fun" list :D).

Carll said...

Well i been using this since R7 great work! sure brings back alot of memories! Can't believe its been 11 years since N64 came out. One thing i don't under stand is how can Mario64 runs almost perfect and Doom 64 is all bad graphic's and don't run? Also, this likely the best emulator for the PSP so why are you working alone? or you like it that way?
great work keep it up!:)

Simon White said...

Nice to hear of more developments!

Glad you have considered peoples replies about speed. For me that and audio is crucial. Its not fun playing a game if it wont play how it should do!

Good luck with D10!

Unknown said...

Top three things that would be cool in no order:
1. Me Audio
2. Frameskip
3. Super Smash Bros

Right now, frameskip would help a lot of games, like Mario Kart. You would only need like 1 or 2 frameskip for it to be almost perfect. ME audio will just help quite a bit. Super Smash Bros is the last game i pretty much want to work for the psp.

BTW, i'm joshisposer but it uses my google account

MikE said...

Nice dude! Can't wait to play Majora's Mask!!!!!!!!

Nico said...

Great to know your attack plan!
And happy to see there's so many things to still improve.

Great work!

MaX_SLayeR said...

Hey, In Zelda Ocarina Of Time, I beat the first dungeon. I was saving constantly, just in case it froze. When I was heading towards the Castle, my game froze =/ . So when I re-loaded the game, I was back at the beginning with only my sword. I was wondering if you can fix the saves. (I had no problem with speed, I could have sworn the game was going at normal N64 speed)

Unknown said...

you are the coolest.

but i still think you should work a lot on saving...

and yeah i noticed also in zelda oot in the deku tree it freezes sometimes, like when you try to open the door to go back into the main room after you get the slingshot. it's annoying...but super mario 64 and starfox 64 work almost perfectly, good work! cant wait for R10.

btw are you mormon xD just asking

Lunasicc said...

Hey StrmnNrmn, nice job the emulator. I was wondering if you could implement a loading bar in the menu's GUI, sort of like SNES9X Tyl. It may seem pointless but it lets the user know the status of the rom loading and doesnt leave them wondering if their psp froze up.

If you have time after all the speed improvements it would be a nice little addition. Let me know what you think.

Again thanks!

Unknown said...

You Rock! Thanks for puttin in the time for all of us.
:)

Unknown said...

mmmmz, can you please fix an bug in 007 the world is not enough?
Its a small bug...
the weapon/gadget is not drawed.
you can shoot, but you cant see the gun.
Also the audio is not working on that game.
even if its turned on.

Anonymous said...

Man, keep up working on it, you'll make many people smile when running the N64 at the PSP system!

Take my suggestion: in the readme file, put the compatibility list! How some games work, known issues and so on!

If you want me to test some games, please e-mail me! I'll say if it works or not!

We count on you!
SKEDAR
skedar_one@hotmail.com

_Psycho said...

It's always so interesting and good to learn to read your blog. Lots of very good informations for my brain :)

Unknown said...

staroz, far as i know Legend of Zelda Ocarina Of Time doesnt crash if you turn dynamic recompiler off, but instead you get 5fps max if your lucky (same for SSB, turn dynamic off and you can gt past the title screen)

Thanks for all your hard work strmnnrmn, cant wait for r10 with expansion support

Unknown said...

Keep The Good work StrmnNrmn, Can't wait for the new improves :D

Cheers from Mexico

JacoPOP said...

I think you should create a poll in which people votes for the games they want to play.. I think that an emulator which runs perfectly a dozen of games will have more success.. than one which emulates all the games in a bad way.

You know that people wants to play Mario games, Zelda games, Rareware games and just maybe a few little..
I don't think you have to worry about compatibility.

The day you will emulate Mario64 at 90-100% will be the day you'll become famous :) keep that in mind :)

I absolutely don't care about SAVESTATES because they are useless.. why don't play games with the original saving options?? In my opinion using savestates is cheating..

Frameskip, instead, shold be useful for someone.. But i'm sure i'm not going to play a game SERIOUSLY (hours and hours) untill it is fully playable.

You are great. The differences between R8 and R9 were great!
Hope you'll manage to do something similar in the next release!

Greetings from Italy

Tinnus said...

Andrew: that's not an effect of the N64, that's an effect of the TV :)

That's why all pre-PS1-N64 emulators (NES, SNES, Genesis) look far worse on PC monitors compared to the consoles in a Tv screen. The TV "blurs" the image.

NoOneInParticular said...

Strmnnrmn, I found something that I don't know if anyone's noticed: The anolog stick mapping is off. Sometimes, it reads it as if the nub is still moving when it is in fact, not. You have no idea how difficult certain stages of Mario64 were because of this! XD

Either way, you've done an impressive job! O.O Oh God! I can't wait to play Zelda OOT MQ while on the bus! :3

Anonymous said...

Morgan: I doubt it will rectify those games as they dont rely on extra RDRAM being avaailable