Tuesday, May 01, 2007

Beyond expectations

Lately I've been quite obsessed with Super Mario 64 DS. First idea to get it rendering more accurately was to fix compressed textures support. I had just finished writing a compressed textures demo when masscat committed fixes to my code compressed handling code on the CVS, so I forgot about compressed textures, as he already fixed them.

After that, I worked on getting transparency and translucency better, so the water and the tree shadows looked as expected. After that, only the holes on some meshes were left, and the sky clipping. The first one was fixed rather easy, as I made a big mistake on my code to change matrices per vertex. I assumed that the matrices were changed at most per primitive, not per vertex! After discussing it with masscat, I just realized my mistake and fixed it in a few minutes (in fact, I had already coded the needed stuff in the past). The second one was just simple depth clipping, so it was easily fixable.

After getting Super Mario 64 DS to render almost perfect (only shadow support missing and some tweaking), I wanted to start the new core. Basically what I call the "new core" is just adding FIFO and Quad Strip reordering support to the current one. The first one is needed to emulate properly the FIFO GFX irq, which are used on almost all advanced 3D games. Without it, games like FF3, New Super Mario Bros, Sonic Rush or Golden Eye:Rogue Agent, would simply freeze. Quad Strip reordering is needed because it uses a different format than the standard PC gfx card one. As I wanted to be sure if the GFX FIFO irq was what made several games freeze (the ones listed above), I just hacked the support, and got some impressive results. In the near future I'll start proper support, but as of now it's fun to see some more games looking perfect.

The usual screenshots to end...




There will be a few that'll recognize the post title: sorry, but I just couldn't resist :P

38 comments:

Unknown said...

Excellent work

Anonymous said...

I can't wait for the next version.
And play Castlevania.\o/

Unknown said...

shash!!!!!! cooL!!!
I can't wait till the next build/wip
\o
Nice work.
But, how many FPS you get in these games? Are you still working on speed? And, just a suggestion, wouldn't it be nice if you record some videos???? \o/
Anyway! Keep on with the hard work.

Anonymous said...

thanks shash
nice work

Unknown said...

And, just a suggestion, wouldn't it be nice if you record some videos???? [2]

shash said...

FPS varies between 15 and 35 fps, depending on game and scene, on a P4 2.6ghz. I won't record any videos, as it's time consuming, compared to doing a few screenshots.

Anonymous said...

shash
can you post screenshot if we make our petition??
can you post screenshoot of FFIII??

Unknown said...

Wow, really impressive. Nice work! Those screenshots look great.

LuchoKun said...

wow though I don't understand half of the things you wrote, I can see that is good :P ganbatte shash!

Unknown said...

You do know that quad-strip reordering WILL make your most hated game(because of the fans) run, and nintendogs too...

shash said...

ElJuez: FF3 looks a bit glitched actually. It's playable, but doesn't look perfect still, so I'll wait until I fix it to make a proper screenshot.

XTra: Well, it'll make FF3 look perfect, and those games you mentioned won't run anyway due to CPU issues :P

Federelli said...

Congrats :), now get rid of those hacks :P.

lowlines said...

Small note with Super Mario 64 DS
in the original n64 version the portrait beyond the first Bowser level has a transition between a picture of Peach to Bowser that most n64 emulators had troubles emulating . Now I dunno whether or not this effect is already working in NDS emulation but if your looking at perfecting that game there's something to check lol

Unknown said...

low lines: It also occurred in the NGC's Luigi's Mansion near the end of the game, but I think NGC emulators aren't developed well enough to get there :)

Shakir said...

are u considering to improve speed on the next release like recompiler because as far as i am seeing that is all that is left but yet without it i am sure it will still look very good.

cyclonmaster said...

Nice to hear some progress. Good luck shash

shash said...

Low lines: I didn't play long enough (in fact, I didn't play more than 2 minutes) to know if that's supported or glitches.

Shakir: A recompiler will come in the future, once the 3D core is more complete, but optimizing when some basic features aren't finished is dangerous.

Unknown said...

Of course, a runtime recompiler! It went through my mind but I forgot to mention it!
The thing that'd be even better is a recompiler that keeps the recompiled machine code in a file for fast loading.
BTW wouldn't recompiling be incompatible with different processors such as amd64, ix86, ET64?

Also, try updating the CVS from things like "some optimizations" and "some tiny fixes" from the forums, would be great.

shash said...

xtra: Why would you prefer to load over disk than to calculate it? There's no way you're getting faster speed from loading it from disk if it's generated code :P

Yes, recompilers must be targeted over a certain platform. If I start one, it'll target 32 bits CPUs.

I'll update the CVS with that code, whenever it's ready and I've enough time to do so, no pressure. If it's not already committed, there's a good reason behind.

Unknown said...

Okay... I'm sorry.
Whenever the recompiler is complete and if it'd be spring break I'd be glad to develop an amd64 port.

John-Hiroshi said...

Impressive

Alberto said...

Very nice development shash. Now with 0.7.0 out, we can see that these latest improvements weren't implemented, is the code still to unstable to add to the general release?

shash said...

Death: The code is stable, just not committed. It's a long story, and right now I'm kinda busy atm, I might do a new post or whatever to explain why this happened, whenever I find some free time.

Alberto said...

I understand. Real life always takes precedence. Glad to hear you've worked out the kinks you mentioned.
Keep up the good work, don't doubt it's appreciated. ;-)

Anonymous said...

These improvements are to the next release 0.8.0?

shash said...

fullthrottle: I don't know, I can't predict the future.

Anonymous said...

Getting impressed by these screenshots, I downloaded and compiled the CVS version yesterday, as instructed on the readme, with Dev-Cpp. And wanted to test it with New Super Mario Bros immediately, I set the proper save option and turned off the sound, but still, after a short time the first demo begins, the game still freezes.
I don't know if I have done something wrong, or need special libraries/definitions, but didn't get anything.

Unknown said...

The pictures here haven't been added to the emu yet, since he made this right before the last release and it didn't get added. There's a new wip version out now, but I don't think its added there either.

shash said...

The changes that made this games work or look like this have not been committed to the CVS.

Unknown said...

I just saw the Newsflash at the wip page and now I wonder if you'll add your work in the 7.1 version? I won't complain if you don't so there's no presure :P

shash said...

No

Anonymous said...

Can you tell at least what did you do concretely as "hacking the support"? Did you bypass something, or changed some codes, or something else?
Thanks.

shash said...

belgther: it's not exactly easy to explain if you don't have some knowledge of DS hardware, but it's as easy as faking certain stuff, so games think that it's working as intended.

Geomancer said...

Hi, please, if you have time, update more often this blog, because is a great source of information of the development of this great emulator, and I love to come and read. Keep with the hard job and I wish you the best.

Geomancer

Unknown said...

update your blog kthx

izaakoh said...

COol~~~

Shakir said...

so shash what do u think is left in yer version of desmume becuz it seems tht almost all games are doing great so maybe just fill us up as to what u think may be needed thanks

shash said...

shakir: it probably won't ever released, so don't hold your breath.