Update on 1.6.0 - Part 1 (Patreon)
Content
today we want to share some details about CEMU 1.6.0!
The update will be released in roughly two weeks. Once we have narrowed down the release date, we will post about it. There will be second update post in about a week or so. Or we may split it up into several smaller update posts.
List of changes in 1.6.0 so far:
- New texture cache (Milestone feature)
- Various graphical bug fixes
- Audio improvements
- Compatibility improvements
- Bugfixes as usual
That's the rough list of things that will make it into 1.6.0 with 100% guarantee. There is more to come, but we don't want to build up expectations and then have to disappoint our users when things don't turn out as intended.
The biggest change of 1.6.0 is the revamped texture manager & texture cache. This is one of the most complex parts of CEMU and also one of the oldest. As we understand more and more about the Wii U hardware some of the drawbacks of our old texture cache implementation became clear. Over time we managed to work around some of the limitations but it was always obvious to us that the solution is only temporary.
For the past weeks we have rewritten large parts of the texture manager code and it's now at a point where it works better than the previous solution. In the following we'll show some of the most well known bugs fixed by the new texture cache.
Super Mario Maker's mixed tilesets
If you have ever played multiple levels in one session of SMM then you probably have seen this bug where CEMU seems to confuse the tilesets:
This issue is now fixed in 1.6.0 thanks to the new texture cache!
What caused the bug?
First, a little technical background information. The issue stems from a core difference of PC and console architectures. On Wii U, both the CPU and the GPU share the same RAM, while on PC almost all graphic cards have their own dedicated memory (VRAM). For emulation this means that everytime a texture is created in RAM we have to copy it to VRAM. To put it simply, every texture exists twice.
The tricky part is that both the CPU (RAM) and the GPU (VRAM) can modify their respective copy of the texture and every change has to be mirrored to the other copy. Technically it isn't too complicated to perfectly duplicate any changes from RAM to VRAM and vice versa, but the performance penalty would be so large that not even simple 2D games would run at more than 1FPS.
To work around this issue we use a multitude of tricks to only copy textures if we are sure that they are needed. For example, it doesn't really matter if the texture in RAM is out of sync if the CPU never reads it.
So to get back to how this relates to the tileset bug in Super Maro Maker: The game would load a tileset textures via CPU and then use the GPU to dynamically update the moving parts (conveyor belts, coins, question blocks) periodically. This would lead to CEMU missing changes on the CPU side of the texture (namely, when a new tileset is loaded).
With 1.6.0 detection of such scenarios is much better and as a result the texture is correctly synchronized even when CPU and GPU modify their respective texture copies at nearly the same time.
Broken text rendering in some games
Up until 1.6.0, certain games had trouble rendering text. Sometimes letters would be missing or unreadable.
Darksiders 2 was affected the most (click on image to view in large):
What caused the bug?
The games suffering from this issue all use the same approach to render text. Initially they would allocate an empty texture, let's call it a font texture. Everytime a text needs to be rendered all the letters would be taken from the font texture. If a letter in a particual font and size was not present yet in the font texture, it would dynamically be added.
Here is an example of such a font texture from Darksiders 2. In case you are wondering, the blurry red letters are used for the background glow effect of the text.
Previously this would cause issues because CEMU would miss texture updates that changed only a small number of pixels (like adding a single letter).
In 1.6.0 this issue is fixed and even 1-pixel updates are correctly recognized. Here are some screenshots with the issue gone from previously affected games:
Super Mario Maker
DKC Tropical Freeze
Darksiders 2
More teaser images
Mario Kart 8 lighting fixed. Racer selection (before, after) and first race (before after)
New games playable! Here is one of them.
In other news: Changes to our Patreon
Early September we will switch to 'Charge upfront'. Essentially this means that new Patrons will have to pay their pledge before they can access the Patron-only content. This feature was recently added by Patreon as it became clear that it's really easy to cheat the system. (Become a Patron, download all the stuff, cancel your subscription before the end of the month.)
From our perspective, tricking the system is not fair towards our legitimate Patrons and us. It's worsened by the fact that each release we have to deal with leaks. It takes away time which we otherwise could invest in developing CEMU.
More details are available on Patreon's FAQ.
Please note that existing Patrons will not be affected by this change.
PS: We hope you enjoyed today's slightly more technical update. Let us know if you want to see more posts of this kind and/or if you have any questions or suggestions.
Disclaimer: As usual it's ok to talk about this post outside of Patreon and it's also ok to share any screenshots linked in this post. But please don't 1:1 quote this post outside of Patreon. Thanks!