Home Artists Posts Import Register

Downloads

Content

Hi Everyone!

It's only been a week since the last post, but there have been plenty of improvements and new features in the core, so let's take a look at what these are and how they work.


First new feature was two pass rendering for the RDP:

In two pass rendering mode the RDP can apply additional effects to a pixel. For example blend together two different textures, apply fog or use color blending from two different light sources. It will reduce the throughput of pixels, so only one pixels every two clock cycles can be drawn. That's why it's typically not used for all Polygons and assets.


Next on the list is the CPU Datacache:

You can see with the framecounter in the top left that the performance improved a lot. The reason is that until now the CPU was still missing the Datacache that the original MIPS cpu used in the N64 had. It's a 8 KByte memory directly inside the CPU that serves as lookup for data that is usually in the RDRAM.

As the RDRAM access in the N64 has very high latency(30 clock cycles and more), every single read or write to RDRAM would slow down the CPU a lot. With the Datacache, each read and write can instead be done without any additional waiting time.

However, there is a downside: it's a managed cache. To understand what that means, let us compare it against the datacache I added to the PSX core:

As the cache is a second place to store information, it has to be synchronized with the main memory. That means that if you write something to the cache it's not yet in main memory and if other chips than the CPU need this data, they will get old data. In opposite direction this is the same: if a different chip writes to RAM, the CPU will still use the old data it still has in the cache.

This problem has to be handled some way. The PSX cores datacache handles this by "snooping the bus". Every write that goes to RAM from a different component will update or invalidate the datacache entry and every write that the CPU does to the Cache will also be written to the RAM(write-through). This way the game doesn't have to care about the Datacache at all. Even more, it cannot know it has one.

The N64 datacache is different: it has a writeback policy, meaning it will only write its cache contents back to RAM when the game tells it should do that. And when other components write to RAM it will not know it, so the programmers need to take care to invalidate the cache contents manually. The advantage of this solution is the reduced hardware effort.

Why couldn't we just use the PSX way of cache for the N64 core then? The main reason is that some games might depend on the cache containing "stale" data. A game might depend on still fetching old data from cache, while the RAM was already overwritten. Also the timing would be very different and we want the core to be as accurate as possible.


Next feature on the list is EEPROM saving to sdcard:

You can not only save ingame now, the saves are also stored on sdcard and can be loaded back. Not a big feature, it's pretty standard for every core, but I felt it was time to add that now that some games are indeed playable.


Last but not least is the texture filter:

The N64 has its famous 3 point filtering and the core can now also do it. If you prefer the more pixelated look you can turn it off in the OSD.

To show you how it works, let's compare it against normal bilinear filtering, e.g. like the PSX cores aditional feature can do it:

Let's take this simple 2x2 pixel grass texture. The renderer requests to texture a polygon pixel with the texture value at the sample point of the big red dot.

Without filtering, the dark green color of the square the red dot is in would be used as color.

With bilinear filtering the 3 closest other texture pixels are also used for the final color calculation. The main color still contributes most to the final color and the other colors contribute less, depending on how far away their center is compared to the sample point, visualized by the thickness of the red lines.

How does that look with 3 point filtering?

You can see that the most distant texture pixel no longer contributes to the final color. The resulting color is also closer to the sample point color. Because the filtering is uneven, it will also give the graphics a characteristic look.


That's it for today. You can try all these new things with the build I attached to this article.

Have fun!

Comments

Anonymous

Whenever you're finished with these cores, if you ever wanted to write a book going into even more depth, I'd definitely buy it.

Anonymous

100% agree, even if it is just a tidied up version of these updates!

Pixel Cherry Ninja

Glad to finally be here. Thanks for all your work, it's definitely kept me busy.