6 Commits

Author SHA1 Message Date
sakuramipha
4de01d3ae6 Add savestate image 2023-06-27 06:39:32 +01:00
sakuramipha
9532db042f general fixes idk 2023-06-27 06:36:28 +01:00
sakuramipha
e5b2921ff3 fix juxtapose (hopefully) 2023-06-26 17:35:43 +01:00
sakuramipha
72c4884faf Media fixes pt2 2023-06-26 05:07:40 +01:00
sakuramipha
f609315495 Media fixes 2023-06-26 04:52:40 +01:00
sakuramipha
9d4f7205db Initial push 2023-06-26 04:33:54 +01:00
38 changed files with 140 additions and 320 deletions

View File

@@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
echo '========== Installing gulp & dependencies =========='
sudo apt-get update && sudo apt-get install graphicsmagick
sudo apt-get install graphicsmagick
- name: Build
env:
TENANT: 'citra'

View File

@@ -138,11 +138,7 @@ Then, turn on the Use Custom Texture option in Graphics -> Enhancements and you
The following are previews of some awesome texture pack projects by the community. They aren't finished yet, but stay tuned! You can also check out the `#mods-and-texture-packs` channel on the Citra Discord server.
{{< single-title-imgs-compare
"Left: Custom Textures, Right: Original"
"./texturepack-post.png"
"./normal-post.png"
>}}
{{< juxtapose id="ec2bf8ba-a025-11ea-a7cb-0edaf8f81e27" >}}
Click [here](https://cdn.knightlab.com/libs/juxtapose/latest/embed/index.html?uid=ec2bf8ba-a025-11ea-a7cb-0edaf8f81e27) to see a larger version of the above juxtapose.
@@ -157,11 +153,7 @@ Along with the change, Breadfish64 has brought in several high quality upscaling
Seeing that some of these shaders don't work that well with Citra, he even wrote one himself, and [it works really great](https://www.youtube.com/watch?v=8epkdJ4OhQ0)!
Try it out and see how it looks.
{{< single-title-imgs-compare
"Left: unfiltered, Right: ScaleForce"
"./unfiltered.png"
"./levelup.png"
>}}
{{< juxtapose id="5435de18-8d65-11ea-a879-0edaf8f81e27" >}}
Click [here](https://cdn.knightlab.com/libs/juxtapose/latest/embed/index.html?uid=5435de18-8d65-11ea-a879-0edaf8f81e27) to see a larger version of the above juxtapose.
@@ -690,5 +682,3 @@ There are always many more ways to improve, and contributions are always welcome
If you'd like to contribute, hop in our [Discord](https://citra-emu.org/discord) or IRC (freenode #citra-dev). If you can't contribute code, consider subscribing on [Patreon](https://patreon.com/citraemu)!
We are also looking for blog post writers! Reach out to us on [Discord](https://citra-emu.org/discord) if you are interested.
{{< imgs-compare-include-end >}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 MiB

View File

@@ -92,11 +92,8 @@ Nearest Neighbour is a texture filter which is particularly effective at making
All of these texture filters, including our shiny new Nearest Neighbour texture filter, can be found in `Emulation -> Configure -> Graphics -> Renderer` in Citra! (`Citra -> Preferences` on MacOS)
{{< single-title-imgs-compare
"Left: unfiltered, Right: Nearest Neighbour"
"./linear.png"
"./nn.png"
>}}
<style>.juxtapose-35vh { display:block; margin:auto; width:100%; height:35vh; }</style>
{{< juxtapose id="cc0544e8-aba2-11ed-b5bd-6595d9b17862" class="juxtapose-35vh" >}}
## Better Support for Picture-in-Picture Custom Layouts ([#6247](https://github.com/citra-emu/citra/pull/6247)) by [SomeDudeOnDiscord](https://github.com/SomeDudeOnDiscord)
@@ -415,5 +412,3 @@ If you are looking to contribute to Citra or just want to get involved with our
Additionally, were still looking for writers! If you are interested in being a writer of these blog posts, please reach out to us on [Discord](https://discord.com/invite/FAXfZV9).
Thank you for reading and keep your eyes peeled here, there is more to come in the future!
{{< imgs-compare-include-end >}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 313 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -1,14 +1,13 @@
+++
date = "2023-07-18T20:00:00+01:00"
date = "2023-06-26T00:00:00+01:00"
title = "Citra Progress Report 2023 Q2"
tags = [ "progress-report" ]
author = "autumnburra"
coauthor = "emufan_4568"
forum = 845615
+++
Doesn't it feel like it was just yesterday when Citra released its first progress report in years? It certainly was exciting, finally reaching a point of having tangible progress and being able to share it with everyone!
As we said in the [previous progress report](https://citra-emu.org/entry/citra-progress-report-2023-q1/), Citra is alive and well, and as a result, we have even more Citra improvements to talk about. So, dear reader, it's time for another progress report which is sure to excite you!
Didnt it feel like it was only yesterday when Citra released its first progress report in years? It certainly was exciting, finally reaching a point of having tangible progress and being able to share it with everyone!
As we said in the [previous progress report](https://citra-emu.org/entry/citra-progress-report-2023-q1/), Citra is alive and well, and as a result, we have a lot more new Citra improvements to talk to you about. So, dear reader, it's time for another progress report which will be sure to excite you!
# Contents
1. [Home Menu]({{< relref "#home-menu" >}})
@@ -19,21 +18,36 @@ As we said in the [previous progress report](https://citra-emu.org/entry/citra-p
1. [Miscellaneous]({{< relref "#miscellaneous" >}})
1. [Conclusion]({{< relref "#conclusion" >}})
# HOME Menu
# Home Menu
The hallmark of the 3DS, and any Nintendo console in fact, is the HOME Menu.
With each console generation carrying a unique aesthetic, its no surprise that so many people hold it near and dear to their hearts. The soothing music, pleasing visuals, and the nostalgia alone are plenty of reasons to want to emulate it alongside the actual games. Its also very important for the preservation of the 3DS, something that the recent closure of the Nintendo eShop for the 3DS and Wii U has made abundantly clear.
However, there was a small problem in fulfilling this dream: it didnt actually work in Citra…
To cut a long story short, there were a lot of problems that needed to be overcome. The HOME menu in Citra had always been plagued with problems. You couldn't launch system applets or regular titles from it, the themes didn't work, the setup would often softlock (preventing users from completing it), and a bunch more issues meant that the HOME menu was far from usable.
To cut a long story short, there were a lot of problems that needed to be overcome. The HOME menu in Citra had always been plagued with problems. You couldn't launch system applets or regular titles from it, the themes didn't work, the setup would often softlock (preventing users from completing it), and a bunch more issues meant that the home menu was far from usable.
Something had to change, and fast. Citra needed to expand and find that special developer with the ability to undertake such a massive effort.
Enter [Steveice10](https://github.com/Steveice10), the author of [FBI](https://github.com/Steveice10/FBI), legendary title manager for the 3DS. A staple homebrew app of a modded 3DS. With their extensive knowledge of the 3DS operating system and all of its inner workings, they joined the Citra team in order to tackle this issue once and for all.
### Add option to configure to download system files from Nintendo Update Service ([#6269](https://github.com/citra-emu/citra/pull/6269), [#6356](https://github.com/citra-emu/citra/pull/6356)) by [Steveice10](https://github.com/Steveice10) and [B3n30](https://github.com/B3n30)
### Add Config block enums documented by 3dbrew ([#6206](https://github.com/citra-emu/citra/pull/6206)) by [SachinVin](https://github.com/SachinVin)
With the goal of making the HOME menu fully accessible in mind, Steveice10s work began. However, before any accuracy improvements could be made, there was the matter of the accessibility of the HOME Menu. Dumping the 3DS System NAND for use in Citra was, relatively speaking, a cumbersome process.
Upon opening a 3DS for the first time, you will be met with a handy setup guide before being able to access anything else on the system. Needless to say, its also the first thing you will encounter when booting the HOME Menu on Citra.
Unfortunately, it has also been plagued with issues ever since the beginning of the emulators life. Attempting to load the most important and well known feature of the 3DS setup guide, the Nintendo 3DS User Agreement, would cause the emulator to freeze, thus preventing anyone from actually completing it!
{{< gifv src="eula-broken.mp4" title="" >}}
It wasn't until recently that the cause of this freeze was really understood. As it turns out, the settings app preloads the software keyboard applet for later use. When the Nintendo 3DS User Agreement is launched, it is supposed to close this preloaded applet, so that it can load the EULA applet instead.
However, due to a combination of missing logic to provide applets with the correct slot (Application, Library Applet, System Applet, or Home Menu), and the command to close an applet not being implemented, the settings app was unaware that the keyboard applet remained loaded.
By implementing the additional state management required for applets, the accuracy of Citras applet manager has been improved tremendously, bringing it closer to the real APT behavior of the 3DS.
This means that the old workarounds required to get the HOME Menu to boot are no longer required! Not only that, but launching system applets now also works perfectly.
{{< gifv src="eula.mp4" title="" >}}
## Add option to configure to download system files from Nintendo Update Service ([#6269](https://github.com/citra-emu/citra/pull/6269), [#6356](https://github.com/citra-emu/citra/pull/6356)) by [Steveice10](https://github.com/Steveice10) and [B3n30](https://github.com/B3n30)
With the goal of making the HOME menu fully accessible in mind, Steveice10s work began. However, before any progress on accuracy improvements could be made, there was the matter of accessibility of the HOME Menu. Dumping the System NAND for use in Citra was, relatively speaking, a cumbersome process.
Building off of the past work of another Citra developer, B3N30, these PRs add the ability to download the 3DS system files from Nintendo servers directly from Citras GUI! This requires you to dump the necessary keys from your console, the process for which is detailed in our [AES Keys guide.](https://citra-emu.org/wiki/aes-keys/)
@@ -44,19 +58,19 @@ Alongside these download options, there is also a setting to select what region
Do note that you still can dump all of the necessary data to use the HOME menu in Citra straight from your 3DS using [threeSD](https://github.com/zhaowenlan1779/threeSD/wiki/Quickstart-Guide), this is just an easier way of doing so!
{{< figure src="download.png"
title="A simple way to download all the system files you need for Citra." >}}
title="" >}}
### Implement PrepareToStartApplication, StartApplication, and WakeupApplication ([#6280](https://github.com/citra-emu/citra/pull/6280)) by [Steveice10](https://github.com/Steveice10) and [Subv](https://github.com/Subv/)
With the accessibility issue resolved, Steveice10 could now begin working on making the HOME menu more usable in Citra.
Continuing on the trend of reviving abandoned projects from the past, this PR implements some important APT service calls used by the HOME Menu in order to start applications. Originally the work of Subv, it addresses one of the longest standing issues with HOME Menu emulation, which was that attempting to launch anything from it would result in an instant crash.
Continuing on the trend of reviving abandoned projects from the past, this PR implements some important APT service calls used by the HOME Menu in order to start applications. Originally the work of Subv, a Citra developer who is currently not working on the project. It addresses one of the longest standing issues with HOME Menu emulation, which was that attempting to launch anything from it would result in an instant crash.
The implementation had been left untouched and neglected for years, until Steveice10 cleaned up the code and finally got it merged into Citra.
The implementation had been left untouched and neglected for years, until Steveice10 cleaned up the code and got it finally merged into Citra.
The benefits arent limited to just the HOME Menu, however. While these functions are mainly used by the HOME Menu, this doesnt mean that games cant take advantage of them either. A notable example is Teenage Mutant Ninja Turtles: Master Splinters Training Pack, which attempts to shut itself down in order to launch its games, causing an unexpected crash. Now its fully playable!
{{< figure src="tmnt.png"
title="We're happy to finally see you, Michelangelo!" >}}
title="" >}}
### Fully stub nim:u service. ([#6290](https://github.com/citra-emu/citra/pull/6290)) by [Steveice10](https://github.com/Steveice10)
@@ -66,85 +80,59 @@ Without this service properly implemented, Citra would exhibit strange glitches,
Citra did, in fact, have a portion of this module semi-implemented in the past, but it wasnt exactly put to good use. Back in 2017, Citra developer Subv added the [CheckForSysUpdateEvent syscall](https://github.com/citra-emu/citra/pull/2974), which allowed the HOME Menu to boot.
However, doing anything other than just looking at the pretty background would softlock the emulator. One of the caveats of this addition was that the LLE NIM applet, used for handling title installations as mentioned above, needed to be enabled from the debugging menu, which wasnt very user-friendly or obvious.
To address this issue, Steveice10 implemented stubs for the nim:u service based on their own reverse engineering work of the 3DS.
{{< figure src="lle.png"
title="" >}}
To address this issue, Steveice10 implemented full stubs for the nim:u service based on their own reverse engineering work of the 3DS.
All the information they uncovered has been added to [3dbrew](https://www.3dbrew.org/wiki/NIM_Services) to contribute to the ongoing effort to better understand the 3DSs operating system. Feel free to take a look if youre interested in the dark arts of HLE emulator development!
The result of all of this? All of the aforementioned issues have disappeared and it is now possible to launch apps without enabling LLE NIM, as the HLE stubs are accurate enough to satisfy the HOME Menu!
The result of all of this? All of the aforementioned issues have disappeared and it is now possible to launch apps without enabling LLE NIM, as the HLE stubs are accurate enough to satisfy the Home Menu!
{{< sidebyside "image" ""
"broken.png=Where is everything..?"
"working.png=Oh! My games are here!" >}}
"broken.png=filler"
"working.png=filler" >}}
### Return installed titles in GetNumTickets and GetTicketList stubs. ([#6292](https://github.com/citra-emu/citra/pull/6292)) by [Steveice10](https://github.com/Steveice10)
When games are installed to the 3DS, they come with a ticket that provides the console with the rights and encryption keys to launch it. Citra doesnt care about these tickets, so it usually discards them when installing a CIA file. However, the HOME Menu uses two commands, GetNumTickets and GetTicketList, to determine what titles are installed on the system when populating the application grid. Since we have no tickets, none of your installed titles would appear on the HOME Menu.
Whats the point of being able to access the HOME Menu if I cant launch my games?
Instead of returning an empty list of tickets, we can pretend that any installed CIA has a ticket. That way the HOME Menu will discover and display games correctly.
Instead of returning an empty list of tickets, we can pretend that any installed CIA has a ticket. That way the home menu will discover and display games correctly.
{{< mp4 src="open.mp4" title="It's just like unwrapping a gift on Christmas!" >}}
{{< gifv src="open.mp4" title="" >}}
Currently, only .cia (CTR Importable Archive) installed titles are detected by the HOME Menu. If you would like to try this out in Citra yourself, make sure your games are dumped as .cia files and installed into Citra via `File > Install CIA…`. Other files, such as .3ds and .cxi, still need to be launched from the Citra game list as normal.
### Implement additional applet state management ([#6303](https://github.com/citra-emu/citra/pull/6303)) by [Steveice10](https://github.com/Steveice10)
## Fix HLE applet pre-start lifecycle ([#6362](https://github.com/citra-emu/citra/pull/6362)) by [Steveice10](https://github.com/Steveice10)
Upon booting a 3DS for the first time, you will be met with a handy setup guide before being able to access anything else on the system. Needless to say, its also the first thing you will encounter when booting the HOME Menu in Citra.
Unfortunately, it has also been riddled with issues ever since the beginning of the emulators life. Attempting to load the most important and well-known feature of the 3DS setup guide, the Nintendo 3DS User Agreement, would cause the emulator to freeze, thus preventing anyone from actually completing it!
{{< mp4 src="eula-broken.mp4" title="Well... that isn't supposed to happen." >}}
It wasn't until recently that the cause of this freeze was really understood. As it turns out, the settings app preloads the software keyboard applet for later use. When the Nintendo 3DS User Agreement is launched, it is supposed to close this preloaded applet, so that it can load the EULA applet instead.
However, due to a combination of missing logic to provide applets with the correct slot (Application, Library Applet, System Applet, or HOME Menu), and the command to close an applet not being implemented, the settings app was unaware that the keyboard applet remained loaded.
By implementing the additional state management required for applets, the accuracy of Citras applet manager has been improved tremendously, bringing it closer to the real [APT](https://www.3dbrew.org/wiki/NS_and_APT_Services) behavior of the 3DS.
This means that the old workarounds required to get the HOME Menu to boot are no longer required! Not only that, but launching system applets now also works perfectly.
{{< mp4 src="eula.mp4" title="Now you have another EULA you can skip-I mean, thoroughly read!" >}}
### Add Config block enums documented by 3dbrew ([#6206](https://github.com/citra-emu/citra/pull/6206)) by [SachinVin](https://github.com/SachinVin)
Even if one managed to bypass the broken EULA, completing the HOME menu setup still wasn't possible! Upon reaching the Parental Controls setup screen, the emulator would warn the user of a fatal error, with the only options being either continuing, which would freeze Citra, or aborting entirely. This was the last piece of the puzzle to make the setup screen fully usable and it had to be resolved.
Following the advice given by the popup and looking at the generated log files, developer SachinVin spotted some configuration blocks Citra was missing and were being accessed by the setup screen. Adding those missing [configs](https://www.3dbrew.org/wiki/Config_Savegame) fixed opening the Settings applet and, combined with the improved applet state management, allowed the system setup to be completed.
### Implement app management support (suspend, resume, close, etc) ([#6322](https://github.com/citra-emu/citra/pull/6322)) by [Steveice10](https://github.com/Steveice10)
So far, weve discussed using the HOME Menu, launching games and applets from it, and completing the system setup process. However, it feels as though were forgetting about something…
So far, weve discussed using the HOME Menu, launching games and applets from it and completing the system setup process. Though, it feels as though were forgetting about something…
Oh! Doesnt the 3DS let you exit out of apps and back into the HOME Menu, what about that? Well, fear not, weve got you all covered.
By implementing support for most application management commands and home button notifications, operations such as suspending, resuming, and closing applications from the HOME Menu are now supported in Citra!
By implementing support for most application management commands and home button notifications, operations such as suspending, resuming, and closing applications from the HOME Menu are now fully supported in Citra!
In addition, the GSP module is now able to capture the screen framebuffers, which correctly emulates the effect when suspending applications. All in all, with these changes you can easily boot the HOME menu and use it to launch system applets and games, suspend or close them, and then launch another game or applet!
In addition, the GSP module is now able to capture the screen framebuffers, which correctly emulates the effect when suspending applications. All in all, with these changes you can easily boot the HOME menu and use it to launch system applets and games, suspend or close them, and then launch another game or applet!
{{< youtube g1ZXWpl7_2M >}}
{{< youtube BxQsn1wzNvE >}}
Exploring the `File` menu will also yield a pleasant surprise: theres now a dedicated “Boot Home Menu” option in the GUI for Citra. This will both automatically detect the correct HOME Menu application, and adjust your region setting based on the firmware region that youre attempting to launch. In the past, the HOME Menu was entirely hidden from the game list, forcing potential users to go on a wild goose chase inside the NAND folder in an attempt to find the correct application file for their corresponding region.
*video is a placeholder for now until we get the actual videos uploaded*
Exploring the `File` menu will also yield a pleasant surprise: theres now a dedicated “Boot Home Menu” option in the GUI for Citra. This will both automatically detect the correct home menu application, and adjust your region setting based on the firmware region that youre attempting to launch. In the past, the HOME Menu was entirely hidden from the game list, forcing potential users to go on a wild goose chase inside the NAND folder in an attempt to find the correct application file for their corresponding region.
You can now say goodbye to wasting time trying to find the correct app name, as Citra will take care of that for you!
{{< figure src="boot.png"
title="Hey, there's even a way to launch the region you want!" >}}
title="" >}}
But this doesnt mean that our work is done, far from it. Steveice10 has added a very early approximation of DSP sleep, so that apps will not hang while trying to sleep the DSP when suspending titles. However, some games, such as Pokémon X, may still get stuck on this or exhibit annoying audio artifacts in the process.
Additionally, some titles (e.g. Super Mario 3D Land) can crash if you try to close them from the HOME menu. This is because some services, required for cleaning up kernel resources, are unimplemented currently. Most built-in titles, such as Mii Maker or Nintendo 3DS Sound, should work fine, however. Our experimental Canary builds contain some fixes for these aforementioned issues. These fixes still need more testing before being merged into Nightly though, so we encourage you to give it a try and report any bugs you come across!
But this doesnt mean that our work is done, far from it. Steveice10 has added a very early approximation of DSP sleep, so that apps will not just hang while trying to sleep the DSP when suspending. However, some games, such as Pokemon X, may still get stuck on this or exhibit annoying audio artifacts in the process.
Some apps (e.g. Super Mario 3D Land) may also crash if you try to close them from the HOME menu, due to some services needed for cleaning up kernel resources that are currently not implemented. Most built-in titles, such as Mii Maker or 3DS Sound, should work fine, but DSP sleep still needs more work in order to make it accurate enough for most games and system applets.
### Fix HLE applet pre-start lifecycle ([#6362](https://github.com/citra-emu/citra/pull/6362)) by [Steveice10](https://github.com/Steveice10)
After the aformentioned APT improvements had been merged, we started receiving reports of certain games, such as Bravely Second: End Layer, [crashing](https://github.com/citra-emu/citra/issues/6361). This game, as well as others, crashed when the Mii selection dialog was activated. In the absence of system files, Citra will use an open source replacement for Miis. But, after setting up the HOME menu, there's no need to use the replacement and the native 3DS selection will be shown instead. Any Miis you create through Mii Maker will be available in the games you play! However, none of that would be relevant, if the native selection always crashed, right? So, Steveice10 investigated the issue and discovered that the now more accurate applet handling had exposed further inaccuracies. More specifically, problems arose when CancelLibraryApplet was called on an applet that hadn't started yet, as it would fail to receive the cancellation message and de-register itself.
"What's the fix?" you might ask. Firstly, Steveice ensured that the applet update event starts immediately on creation. Then he implemented a distinction between running and active applets to determine what the update event should do each cycle. This fixed the crashing issues, not only in Bravely Second, but in Super Mario 3D Land as well. Enjoy selecting your Miis!
{{< mp4 src="mii.mp4" title="Wow! An actual Mii selector!" >}}
### Add stub for ns:c service ([#6409](https://github.com/citra-emu/citra/pull/6409)) by [Steveice10](https://github.com/Steveice10)
## Skip address range checks for privileged memory (un)map ([#6407](https://github.com/citra-emu/citra/pull/6407)) by [Steveice10](https://github.com/Steveice10)
The ns:c service was introduced with firmware version 5.0.0-11, and appears to be used only by the Instruction Manual applet for triggering SD/Game Card removal errors when ejecting the media that the manual is stored on.
By implementing a stub for the aforementioned service, the instruction manual now works on Citra!
{{< figure src="manual.png"
title="Very important for the preservation of the 3DS." >}}
### Skip address range checks for privileged memory (un)map ([#6407](https://github.com/citra-emu/citra/pull/6407)) by [Steveice10](https://github.com/Steveice10)
title="" >}}
Another corner of the HOME Menu that never quite worked was the Internet Browser applet, which would mysteriously cause the execution to break, alongside a healthy dose of memory errors.
```
@@ -155,23 +143,21 @@ Another corner of the HOME Menu that never quite worked was the Internet Browser
[ 19.449282] HW.Memory <Error> core/memory.cpp:Read:469: unmapped Read32 @ 0x000000C8 at PC 0x0028117C
```
These errors occured because Citras code for loading CROs (relocatable code, similar to DLLs on Windows) did not allow parts of the internet browsers code to be mapped into memory.
By inspecting the kernel through disassembly, Steveice10 determined that the address range checks that Citra used for maps/unmaps were not actually used when mapping privileged executable memory, such as in this case. Thus, skipping these checks for the privileged case allowed the Internet Browser applet to load properly.
These errors occur because Citras code for loading CROs (relocatable code, similar to DLLs on Windows) did not allow parts of the internet browsers code to be mapped into memory.
By inspecting the kernel through disassembly, Steveice10 determined that the address range checks that Citra used for maps/unmaps were not actually used when mapping privileged executable memory, such as this case. Thus, skipping these checks for the privileged case allowed the Internet Browser applet to load properly.
Do note that this is **not** fully functional in Citra at the moment. You will **not** be able to browse the web from inside Citra using the Internet Browser.
{{< figure src="browser.png"
title="I wonder what the bookmarks include..." >}}
And there you have it! All the changes we have made in Citra to majorly improve the functionality of the HOME Menu. Of course, not everything is perfect just yet, but we are working hard to ensure that this vital part of the 3DS experience is preserved through Citra. There will be more updates in the future on this, keep an eye out if you're interested.
title="" >}}
# Android
### Storage Access Framework ([#6313](https://github.com/citra-emu/citra/pull/6313)) by [hank121314](https://github.com/hank121314)
## Storage Access Framework ([#6313](https://github.com/citra-emu/citra/pull/6313)) by [hank121314](https://github.com/hank121314)
Oh boy, where to even begin with this one…
Storage Access Framework, which is often abbreviated to SAF, is Googles method of implementing scoped storage. On its own, the idea has merit; with scoped storage, apps can't see all of your files or access any data from other apps, meaning you dont have to worry about any of your personal data being stolen by bad actors.
Storage Access Framework, which is often abbreviated to SAF, is Googles method of implementing scoped storage. On its own the idea has merit; with scoped storage, apps can't see all of your files or access any data from other apps, meaning you dont have to worry about any of your personal data being stolen by malicious individuals.
This implementation of that idea though, is absolute garbage. When using SAF, apps cannot access files outside of their data directory without using so-called “content URIs” for addressing them.
Citra, however, being a native C++ program, assumes that files can be addressed with paths that are delimited by slashes and can be stored as strings. Updating the entire codebase to use these URIs would be a massive undertaking for little benefit.
@@ -198,60 +184,54 @@ As Android is an ever evolving operating system, there are many technologies tha
Android TV support for Citra was planned in the past, but due to a lack of testers and developers, it had to unfortunately be scrapped. Thankfully, with time and effort, we are able to provide support for launching Citra on an Android TV as we initially hoped!
### Citra Android theme overhaul! ([#6332](https://github.com/citra-emu/citra/pull/6332) [#6335](https://github.com/citra-emu/citra/pull/6335), [#6351](https://github.com/citra-emu/citra/pull/6351), [#6355](https://github.com/citra-emu/citra/pull/6355), [#6349](https://github.com/citra-emu/citra/pull/6349)) by [t895](https://github.com/t895)
## Citra Android theme overhaul! ([#6332](https://github.com/citra-emu/citra/pull/6332) [#6335](https://github.com/citra-emu/citra/pull/6335), [#6351](https://github.com/citra-emu/citra/pull/6351), [#6355](https://github.com/citra-emu/citra/pull/6355), [#6349](https://github.com/citra-emu/citra/pull/6349)) by [t895](https://github.com/t895)
As mentioned in the previous progress report, we are looking to modernize Citra in many ways and get it up to speed with other emulators. This also includes modernization of the Android app!
To give the apps theming a breath of fresh air, t895, developer for the Android apps of the emulators Dolphin and yuzu, has stepped up to this task.
Starting off with how the app responds to touch navigation, t895 ported over a [PR from Dolphin](https://github.com/dolphin-emu/dolphin/pull/11327) which aimed to upgrade the UI animations to something a bit more modern, and also helps with how fast you can get around the app! This change, although it looks small, greatly improves the user experience of Citra.
Starting off with how the app responds to touch navigation, t895 ported over a [PR from Dolphin](https://github.com/dolphin-emu/dolphin/pull/11327) which aimed to upgrade the UI animations to something a bit more modern, and also helps with how fast you can get around the app! This change, although it looks small, helps the user experience of Citra greatly, even if it isnt noticeable to many.
Next up on the list of changes is starting the migration of the UI to the Material 3 system, introduced in Android 12. [Material 3](https://m3.material.io/) is the latest design system from Google, giving developers the tools and inspiration needed to create a beautiful looking app.
As humans, we are all about aesthetically pleasing design, and this migration proves just that for the Citra app. This change includes upgrades to the layout of the app, the themes, icons, colors, and so many more changes just to make it squeaky clean!
As humans, we are all about aesthetically pleasing design, and this migration proves just that for the Citra app. This change includes upgrades to the layout of the app, the themes, icons, the general colors that the Citra app uses and so many more changes just to make it squeaky clean!
Next, were turning our focus towards the app icon for Citra. Beginning with Android 13, but being supported by devices running API level 26 (Android 8) or newer, apps have the option to enable the use of themed icons on the home screen. This means that the app icon will match the theme of the phone the best it can, to match the general aesthetic of the phone. For example, with themed icons, Citra will be able to tell if your phone is in light mode or dark mode, and change its icon design accordingly. A neat little change, but one that will help Citra blend in nicely with the rest of the phone if you choose so.
Next were turning our focus towards the app icon for Citra. Beginning with Android 13, but being supported by devices running API level 26 (Android 8) or newer, apps have the option to enable the use of themed icons on the home screen. This means that the app icon will match the theme of the phone the best it can, to match the general aesthetic of the phone. For example, with themed icons, Citra will be able to tell if your phone is in light mode or dark mode, and change its icon design accordingly. A neat little change, but one that will help Citra blend in nicely with the rest of the phone if you choose that.
Not long to go now… splash screens! Introduced in Android 12, but being supported by devices running API level 23 (Android 6) or newer, splash screens bring a nifty little Citra logo that pops up when you open the app to let you know it is launching correctly and to smoothly transition you from the rest of the phone into Citra to fully immerse yourself in the joy that is 3DS emulation!
And finally, edge-to-edge display. No longer do you need to worry about that pesky navigation bar at the bottom of your phone getting in the way. Citra now renders right to the edge of your screen, giving you a full display of your favorite games.
And finally, edge-to-edge display. No longer do you need to worry about that pesky system bar at the bottom of your phone getting in the way. Citra now displays the gameplay right to the edge of your screen, giving you a full display of your favorite games.
All of these changes add up into one big overhaul of our UI, bringing the freshest look right to your device! We have more planned for our UI on Android in the future, so keep an eye out here and well update you when we can!
{{< sidebyside "image" ""
"themeb4.jpg=Old"
"themenew.jpg=New" >}}
"themeb4.jpg=filler"
"themenew.jpg=filler" >}}
### Avoid reopening files every time a shader needs to be written. ([#6344](https://github.com/citra-emu/citra/pull/6344)) by [SachinVin](https://github.com/SachinVin)
Shader stutter is pretty annoying, no matter how you put it. Citra has always had issues with it, mainly because we are at the mercy of the OpenGL driver. Most drivers do end up taking their sweet time when compiling shaders, however after merging the new SAF implementation, it became much-much worse than before, with individual stutters reaching a mind-boggling 5 seconds even on powerful hardware.
Shader stutter is pretty annoying, no matter how you put it. Not to mention that Citra has always had issues with it, mainly because we are at the mercy of the OpenGL driver. Most drivers do end up taking their sweet time when compiling shaders, however after merging the new SAF implementation, it somehow became much-much worse than before, with stutter reaching a mind-boggling 5 seconds even on powerful hardware.
So what gives?
As it turns out, our disk shader cache opens the cache file every time a new shader is generated in order to serialize it. Thats fine and dandy over on Citra Desktop, where ignoring the characteristics of the storage medium, file access is relatively fast. It also reduces the chance of shader cache corruption when Citra crashes or is terminated abnormally, which is really important for any emulator. But with SAF added to the mix, the overhead of that method just became too much to bear.
As it turns out, our disk shader cache opens the cache file every time a new shader is generated in order to serialize it. Thats okay over on desktop Citra, where ignoring the characteristics of the storage medium, file access is relatively fast. It also reduces the chance of shader cache corruption when Citra crashes or is terminated abnormally, which is really important for any emulator. But with SAF added to the mix, the overhead of that method just became too much to bear.
In the end, the solution came from developer SachinVin, who rewrote the disk cache to only open the file once at the beginning of the emulation session.
### Turn GameInfo into a class ([#6494](https://github.com/citra-emu/citra/pull/6494)) by [JosJuice](https://github.com/JosJuice)
SAF strikes again! The slowness of file operations negatively impacted the user experience by making the game list incredibly slow to load. For users who only have a small handful of games in their game list, this wasn't particularly noticeable. However, for anyone with a large enough game library, the loading speed became unbearable.
The only way to alleviate this issue is to limit file access as much as possible, and that's what was done with this PR. Utilizing their android expertise from their work over at Dolphin, JosJuice managed to speed up the process by centralizing game information queries to a single class, instead of having separate file access calls for fetching the TitleID, title name, game icon, etc. This ended up saving a bunch of time that was wasted on opening the same file multiple times.
### Open cheats by long pressing game in game list ([#6491](https://github.com/citra-emu/citra/pull/6491)) by [JosJuice](https://github.com/JosJuice)
Normally to edit a cheat for a game, youd have to edit it whilst the game was running. This was fine if the cheat codes were working, but what if they were causing the game to crash? Youd have no way of disabling them unless you crawled through the hell that is the Android file manager.
A simple fix to this, based off of a similar addition to Citra Desktop that well get to later, involves enabling cheat code editing by long pressing the game in the main menu of Citra. This allows users to modify cheat codes directly from Citra, regardless of whether a game is running or not. The previous method of adding cheat codes in Citra still remains.
A simple fix to this, based off of a similar addition to Citra Desktop that well get to later, involves enabling cheat code editing by long pressing the game in the main menu of Citra. This allows users to modify cheat codes directly from Citra, regardless of whether a game is running or not. The previous way of adding cheat codes to Citra still remains.
### Offload CIA installation to background thread ([#6508](https://github.com/citra-emu/citra/pull/6508)) by [SachinVin](https://github.com/SachinVin)
With the addition of SAF, some things in Citra Android slowed down a lot, to no fault of our own. Thats just how SAF works, sadly.
One of these is the installation of CIA (CTR Importable Archive) files. These are mainly used to install games, update files, and DLC files. With the installation of these being so much slower than previous Citra builds without SAF, Android believes that the app has frozen and forces it to crash due to the installation running on the UI thread.
One of these is the installation of CIA (CTR Importable Archive) files. These are mainly used to install games, update files and DLC files. With the installation of these being so much slower than previous Citra builds without SAF, Android believes that the app has frozen and forces it to crash, due to the installation running on the UI thread.
By offloading CIA installations to the background thread instead, we now prevent Android from accidentally terminating Citra prematurely. But, how are you, as a user, meant to know if your installation is actually working?
This is where the new notification progress bar comes into play. This convenient progress bar notification allows you to monitor your CIA installation, even when Citra is minimized! It also will notify you if the installation has been successful or if it has failed, which is handy to know.
This is where the new notification progress bar comes into play. Weve added a convenient progression bar as a notification for you to monitor your CIA installation, even when Citra is minimized! It also will notify you if the installation has been successful or if it has failed, which is handy to know.
{{< figure src="ciainstall.jpg"
title="Installing updates and DLC has never been easier!" >}}
title="" >}}
# macOS
@@ -266,19 +246,19 @@ This ensures that the camera will resume again after the emulation is paused, re
### Fix global settings being inaccessible on macOS ([#6235](https://github.com/citra-emu/citra/pull/6235)) by [Steveice10](https://github.com/Steveice10)
As we mentioned earlier on, we recently added per-game settings to Citra! However, in the beginning, they also broke the global settings! This was a big deal, as the main way to configure your Citra instance was now lost.
Fortunately, the fix was relatively simple; manually specifying the roles for the key menu actions, such as About and Preferences, instead of relying on the default Qt heuristics. With this, the global settings are once again accessible!
Fortunately, the fix was relatively simple; manually specifying the roles for the key menu actions such as About and Preferences instead of relying on the default Qt heuristics. With this, the global settings are once again accessible!
### Generate universal macOS build ([#6240](https://github.com/citra-emu/citra/pull/6240), [#6321](https://github.com/citra-emu/citra/pull/6321)) by [Steveice10](https://github.com/Steveice10)
## Generate universal macOS build ([#6240](https://github.com/citra-emu/citra/pull/6240), [#6321](https://github.com/citra-emu/citra/pull/6321)) by [Steveice10](https://github.com/Steveice10)
Somewhat recently, Apple released a new processor for their devices utilizing the ARM architecture, named Apple silicon (M1/M2). Citras x86_64 macOS builds technically worked with these new devices through Rosetta 2, in the sense that your game would launch, but it would also result in game bugs; freezing and crashing pretty frequently.
Building it natively for ARM was often a solution, a solution inaccessible to the average user, unfortunately. An official Citra build was needed for users running those Apple silicon devices.
However, as you may be aware, Apple does not support OpenGL 4.3, which presented us with a big issue. Apple officially only supports Metal, their own proprietary graphics API, adding support for which would require a lot of work. So, how are we going to get Apple silicon devices to run on Citra when macOS isnt even a supported platform?
Banking off of the fact that we have a new Vulkan graphics backend quickly making its way into Citra (have we mentioned that yet?), we can utilize MoltenVK, a mature translation layer that converts Vulkan API calls to appropriate Metal ones. With this solution in mind, Steveice10 got to work implementing a universal macOS build for Citra that covers both x86_64 and arm64.
However, as you may be aware, Apple does not support OpenGL 4.3, which is what Citra uses now. This presented us with a lot more issues. How are we going to get Apple silicon devices to run on Citra when macOS isnt even a supported platform?
Banking off of the fact that we have a new Vulkan graphics backend quickly making its way into Citra (have we mentioned that yet?), Steveice10 got to work implementing a universal macOS build for Citra that covers both x86_64 and arm64.
Initially, Citra was set up to build a universal app for both architectures all at once. However, due to a new library introduced with Vulkan not supporting multi-arch building correctly, we had to change approaches. Instead, we now build for x86_64 and ARM separately and combine the app at the end, giving us the same result without having to worry about adapting build scripts for multi-arch.
However, due to a new library introduced with Vulkan not supporting multi-arch building correctly, we had to quickly change how we build for both x86_64 and arm64 within the CI for Citra (continuous integration) just to ensure that these new arm64 builds actually worked!
The PR is currently not usable in the latest Nightly, as it is dependent on Vulkan being merged into Citra. It is, however, available to use in Canary. If you have an Apple silicon device and want to use Citra, please switch to the latest experimental Canary release, downloadable through our installer.
The PR is currently not usable in the latest Nightly, as it is dependent on Vulkan being merged into Citra. It is, however, available to use in Canary. If you have an Apple silicon device and want to use Citra, please switch to the latest experimental Canary release, downloadable through our [installer](https://citra-emu.org/download/).
### Bump macOS target to 11 (Big Sur) ([#6325](https://github.com/citra-emu/citra/pull/6325)) by [Steveice10](https://github.com/Steveice10)
@@ -287,95 +267,70 @@ By upgrading our macOS target to 11 (Big Sur), we can ensure that all features u
# Graphics
### Prepare frontend for multiple graphics APIs ([#6347](https://github.com/citra-emu/citra/pull/6347)) by [GPUCode](https://github.com/GPUCode)
For being the first PR in our attempt to move away from OpenGL, this one is quite mundane on the surface compared to the other ones. However, it lays the foundations to allow Citra to support multiple rendering backends by abstracting key rendering functionality into common classes.
A neat result of that effort is that the Software renderer no longer depends on OpenGL hardware acceleration for presentation. This means Citra can technically run on systems without a GPU using the Software renderer. Additionally, the Software renderer has been turned into a Graphics API, so its much more obvious when its being used. Before, in order to enable Software rendering, one had to disable the Hardware Renderer option, which wasnt really made obvious to the user. Now, weve added a handy little drop down to choose which Graphics API youd like to use!
### Rasterizer cache refactor ([#6375](https://github.com/citra-emu/citra/pull/6375)) by [GPUCode](https://github.com/GPUCode)
Looking at the name of the PR, its not immediately obvious what this PR aims to achieve. What it does is rework several important aspects of GPU emulation that had remained untouched for years.
One of these is that it greatly simplifies texture uploading and downloading, the methods for which had quickly grown to be complex and hard to understand over the years. This was most notably seen when using custom textures combined with texture filters, where the code would just fail, resulting in some pretty messed up looking textures. But more on that later. To summarize, this code is now much simpler and more optimized!
Another pain point of the old cache was mipmap handling. A mipmap is a sequence of textures, each of which is a progressively lower resolution representation of the same image. Many 3DS games use mipmaps in order to make graphics look cleaner at a distance.
Citras problem was that the old cache considered them as separate textures, requiring an expensive tree-like structure to maintain and properly sync them. In addition to this, every surface allocated an excessive amount of mipmaps which increased memory usage, especially when texture filtering was used.
By having surfaces own the entire mipmap range, the cache can directly upload and use mipmaps without needing to sync them. This reduces the amount of surfaces cached and, in turn, the lookup overhead. So these changes not only make mipmaps faster, they also fixed a few games that didnt work correctly before, most notably the homebrew port of the game Portal, which displayed nothing but a blue void when using the hardware renderer.
All of these changes are indeed quite nice, but whats especially interesting are the OpenGL specific optimizations.
After a bit of profiling, GPUCode found that the backend was handling certain operations inefficiently, which really hurt performance on less-than-stellar drivers, such as Android phones utilizing a Mali GPU. By taking the time to correct some of these, the performance of these GPUs have been significantly increased by at least 40%! Even better, the annoying graphical flickering that could be observed on some lower-end Mali devices has now disappeared as well.
{{< sidebyside "image" ""
"portalbroke.png=Before..."
"portalfix.png=And after!" >}}
### HP Bar Fix for some games ([#6334](https://github.com/citra-emu/citra/pull/6334)) by [Polar-Zero](https://github.com/Polar-Zero)
Question time! Have you heard of something called texture tiling? If you are a graphics developer, you probably have. The rest of us, not so much. As a concept, its actually pretty simple: you take an image and chop it into smaller NxN squares of pixels. Such an arrangement can be beneficial for graphics hardware for multiple reasons, so its no surprise that the 3DS also makes use of this feature to speed up texture processing. More specifically, we should mention that the tile size is 8x8.
In many many video games, players rely on a HP bar to determine how much health their character has left. This is important in fighting games, for example Metal Max 4, to tell the player if theyre going to die soon or not!
Imagine the horror Citra users came across when in some games, like the aforementioned JRPG, the HP bar just did not display correctly! How were you meant to tell if you needed to heal or retreat?
With this information, it wouldnt be wrong to assume that texture dimensions must be a multiple of 8, otherwise dividing it into tiles wouldnt really make sense. And in general this assumption holds true, the vast majority of games respect this limitation in their textures. Until they dont…
Now we get to the fun part: what happens if the texture is smaller than a tile? Being confronted with that question, Citra developer [wwylele](https://github.com/wwylele) came to the conclusion, after some tests, that such a configuration was not supported by the PICA GPU the 3DS uses. Due to this, the original code that handled these textures was promptly removed when [support for mipmaps](https://github.com/citra-emu/citra/pull/3910) was implemented. Said removal caused [unexpected issues](https://github.com/citra-emu/citra/issues/5139) however, when health bars of all things suddenly went missing in some games. Imagine the horror Citra users came across when in those games the HP bar just did not display correctly! How were you meant to tell if you needed to heal or retreat?
This issue was again brought to our attention when first time contributor, Polar-Star, opened a pull request reimplementing the code that was removed. With this change, HP bars are fixed and because this bug negatively affected core gameplay of certain games, we opted to accept this change. We are still investigating this issue to figure out the proper hardware behavior in this case, though we suspect its not too far off from this.
This being an issue since late 2020, first time contributor Polar-Star set out to fix this once and for all. By allowing the rasterizer cache control over 4x4 and 8x4 textures properly, HP bars are finally fixed and give the player to view their stats once again!
{{< figure src="hpbar.png"
title="Left: Broken, Right: Fixed" >}}
title="" >}}
### Fix distance vector used when calculating lighting distance attenuation. ([#6366](https://github.com/citra-emu/citra/pull/6366)) by [Steveice10](https://github.com/Steveice10)
## Fix distance vector used when calculating lighting distance attenuation. ([#6366](https://github.com/citra-emu/citra/pull/6366)) by [Steveice10](https://github.com/Steveice10)
Citra is often referred to as the “Pokémon emulator”, and you wouldnt be too wrong to assume that. Pokémon games have, by far, been the most popular for the 3DS platform, and this translates over to Citra as well.
Citra is often referred to as the “Pokémon emulator”, and you wouldnt be too wrong to assume that. The Pokémon games have, by far, been the most popular for the 3DS platform, and this translates over to Citra as well.
So naturally, when something breaks in the game, it tends to get [overreported](https://github.com/search?q=repo%3Acitra-emu%2Fcitra+pokemon&type=issues&p=2). This is one of those issues that has plagued Pokémon X/Y for a while, so one would assume the solution is quite sophisticated. Right?
This issue, strangely enough, just made all the backgrounds in some key cutscenes completely black! The [GitHub issue](https://github.com/citra-emu/citra/issues/4499) for this glitch was first opened in 2018, but at the time it wasnt really known what was causing it. Whats more, the black backgrounds persisted even when using the Software renderer, which is Citras most accurate (and slowest) rendering option.
Given this information, it was most likely a fundamental accuracy issue, which deterred a lot of people from looking into it due to the difficulty of fixing such a thing.
Fast forward a year and [hamish-milne](https://github.com/hamish-milne), the mastermind behind one of the most popular features on Citra, save states, attempted to find the cause of this glitch that had eluded many. After poking around for a while, they determined the problem laid in the fragment lighting emulation code.
Fast forward a year and hamish-milne, the mastermind behind one of the most popular features on Citra, save states, attempted to find the cause of this glitch that had eluded many. After poking around for a while, they determined the problem laid in the fragment lighting emulation code.
For those who arent aware, PICA, the 3DSs GPU, does not support programmable pixel shaders like more modern systems. This means that Citra must generate a host fragment shader to emulate the fixed function pipeline the GPU exposes. What they ended up discovering is that changing how LUT indices are generated for the distance attenuation feature fixed the background lighting. The issue was finally solved!
{{< figure src="discord.png"
title="" >}}
Unfortunately, this wasnt the end. After performing some tests, Citra developer [wwylele](https://github.com/wwylele) determined that the solution was not accurate to the hardware and could potentially break games. Due to this, the proposed solution could not be accepted into the codebase.
Unfortunately, this wasnt the end. After performing some tests, Citra developer [wwylele](https://github.com/wwylele) determined that the solution was not accurate to the hardware and thus could not be accepted into the codebase.
{{< sidebyside "image" ""
"lut3ds.png=3DS"
"lutnew.png=Citra" >}}
"lut3ds.png=filler"
"lutnew.png=filler" >}}
And after that, the issue was yet again abandoned throughout Citras developer drought. Until recently.
Steveice10 picked up the issue and after writing a couple of basic hardware tests, came to the conclusion that the bug was different from what everyone had believed. It turns out that Citra always used the view vector when distance attenuation was enabled, something that doesnt really make sense for directional light, which is usually a directional vector rather than a concrete position. By correcting the code to use the correct length, it not only fixed the background issue, but improved the lighting accuracy in general!
{{< sidebyside "image" ""
"xybefore.png=Um, where did the Earth go?!"
"xynew.png=Finally, the world is back!" >}}
"xybefore.png=filler"
"xynew.png=filler" >}}
### Custom textures rewrite ([#6452](https://github.com/citra-emu/citra/pull/6452)) by [GPUCode](https://github.com/GPUCode)
## Custom textures rewrite ([#6452](https://github.com/citra-emu/citra/pull/6452)) by [GPUCode](https://github.com/GPUCode)
Weve all been there: controller is properly connected and ready at hand (or keyboard if you prefer, we dont judge), your favorite game is dumped, set up and ready to be experienced on a shiny new computer, devoid of the limitations imposed by the original hardware. You launch it and… it looks so pixelated and blurry.
What gives?
Fortunately, emulators have your back and provide many options that increase fidelity. Resolution scaling, anti-aliasing, and texture filtering can enhance the experience greatly. Having these options is especially important in Citra due to how the 3DS screens are known for their low resolution, compared to modern HD screens.
Fortunately, emulators have your back and provide many options that increase fidelity. Resolution scaling, anti-aliasing and texture filtering can enhance the experience greatly. Having these options is especially important in Citra due to how the 3DS screens are known for their low resolution, compared to modern HD screens.
Often, though, cranking up the resolution isnt enough. Due to VRAM limitations, textures in 3DS games can look blurry and lack detail when viewed outside of the confines of the console itself. The aforementioned texture filtering feature is useful for upscaling these in-game textures, to make them look better, but the results vary between filters and arent always perfect.
As such, Citra allows for custom textures to be used as well, a feature [first added](https://github.com/citra-emu/citra/pull/4868) back in 2019 from developer [khang06](https://github.com/khang06). Since then, many custom texture packs have surfaced, made by talented artists. We are grateful to our community that made this all possible!
The implementation wasnt without its faults, though. It only supported the .png file format, which forces a choice between hefty file sizes or long decompression times. The loading stutter could be mitigated by using the preload textures option, but that requires a ton of RAM and would often freeze Citra without any indication of progress. Another limitation of the previous system was that mipmaps were unsupported.
The implementation wasnt without its faults, though. It only supported the .png file format, which forces a choice between hefty file sizes or long decompression times. The loading stutter could be mitigated by using the preload textures option, but that requires a ton of RAM and often would freeze Citra without any indication of progress. Another limitation of the previous system was that mipmaps were unsupported.
This actually made sense from a developer standpoint at the time, since it avoided graphical glitches from missing mipmaps that manifest as black textures at a distance, and made texture replacement an easier process overall. However this hidden abstraction made the code more complex and prevented pack creators from providing their own mipmaps in cases where such a thing was desirable.
Most important, however, was the notorious texture filter incompatibility with custom textures, one of the most well known Citra bugs ever! Being first uncovered by a rasterizer cache change made by developer [BreadFish64](https://github.com/citra-emu/citra/pull/5710), the bug would result in messed up textures over time, making the game slowly unplayable.
One might say, "That's easy then! Why not just revert the PR that caused it?"
Well, the change in question is actually quite desirable: it removes fully invalid textures from the cache, in order to speed up lookups and performance. It was briefly mentioned in our [previous progress report](https://citra-emu.org/entry/citra-progress-report-2023-q1/), go read it if you havent already!
Well the change in question is actually quite desirable: it removes fully invalid textures from the cache, in order to speed up lookups and performance. It was briefly mentioned in our [previous progress report](https://citra-emu.org/entry/citra-progress-report-2023-q1/), go read it if you havent already!
{{< figure src="mmbroke.png"
title="Did someone turn off the lights?" >}}
(insert picture)
Another thing to consider is the hashing algorithm being used to identify the textures. Up until this point Citra used the deswizzled and decoded texture data as it was the most convenient option at the time. Said approach presents issues though when other graphics APIs enter the picture, namely Vulkan. As a low-level API, Vulkan accurately reports the host GPUs capabilities, meaning that certain formats Citra expects might not be natively supported, requiring conversions to work. Such conversions break the previously trusted hashing, which could lead to missing textures.
With the hopes of fixing the aforementioned issues, GPUCode embarked on a journey of fully rewriting the custom textures implementation. The result is a greatly improved system with a bunch of cool new features, like support for compressed formats such as BC7/BC5/ASTC and their container file formats DDS/KTX. By using these formats, the size of a texture pack can be decreased significantly while also maintaining decent image quality. Note that the BCn formats are unsupported on Android devices. So, if a creator wants to target mobile, we recommend either sticking to png, or having an alternative ASTC version of the pack.
With the hopes of fixing the aforementioned issues, GPUCode embarked on a journey of fully rewriting the custom textures implementation. The result is a greatly improved system with a bunch of cool new features, like support for compressed formats like BC7/BC5/ASTC and their container file formats DDS/KTX. By using these formats, the size of a texture pack can be decreased significantly while also maintaining decent image quality. Note that the BCn formats are unsupported on Android devices. So, if a creator wants to target mobile, we recommend either sticking to png, or having an alternative ASTC version of the pack.
Async texture loading is also supported to mitigate loading stutters, which are especially noticeable on Android with the recent SAF implementation we mentioned before. Weve also added a new hotkey to toggle between normal and HD textures without restarting the game, which is especially useful for demonstration purposes. Oh, and the icing on the cake: texture filtering with custom textures should now work as expected!
{{< figure src="mmfix.png"
title="Ahhh, much better." >}}
(insert picture)
Alongside this new implementation, a new method of hashing textures has been introduced, which not only guarantees compatibility with any graphics API Citra currently supports or might add in the future, but is also much faster, as it requires less input data than before. Of course, we understand the utmost importance of maintaining compatibility with existing packs, so loading the older hashing format is still fully supported. Although we recommend that new packs be created with the new format so they can benefit from the above improvements.
@@ -383,91 +338,54 @@ The introduction of the new hash has made it necessary to distinguish between ne
And before ending this segment, we have to talk about one more thing… Remember how the goal of custom textures is to enhance the respective beyond the limits of the original console? In the interest of achieving that goal we have added another feature to the custom textures implementation which we are sure pack creators will love: custom normal maps. Normal maps are very widely used in computer graphics to give the illusion of detail without the cost of rendering more polygons. Pretty neat right? Youve most likely played a game that uses normal maps.
{{< figure src="normalstair.jpg"
title="The power of normal maps is real!" >}}
(insert picture)
Needless to say, 3DS games also use normal maps to increase detail of certain objects. The low available VRAM however limits their usage considerably. Imagine how much better games could look if they used normal maps for most textures instead of a select few? Well, wonder no longer! Custom normal maps are now a reality! Simply adding the .norm prefix before the file extension is enough to make use of this great new feature.
By taking advantage of the fixed-function nature of the PICA200, we can easily apply the normal map to any scene that enables fragment lighting, which is the only requirement for it to work. Attempting to use custom normal maps on scenes without lighting will print an error in the log, so watch out for that when trying it out.
{{< mp4 src="brickwall.mp4" >}}
We would like to credit [Nerrel](https://www.youtube.com/@Nerrel) for providing us with this awesome demonstration of how normal maps can enhance games like The Legend of Zelda: Majora's Mask 3D. They have started working on incorporating this feature in their [MM3DHD](https://github.com/DeathWrench/MM3DHD) project and we are definitely excited to see the results of this endeavour.
### Textures loading screen ([#6478](https://github.com/citra-emu/citra/pull/6478)) by [luc-git](https://github.com/luc-git)
Using preloaded custom textures is usually quite taxing on the system RAM, especially if you dont have much to begin with. Loading can be very slow and, at times, even freeze your entire PC!
By adding a loading screen, you can now track the progression of your preloaded custom textures as your game boots. It also works as an indicator to let your PC know that the app has not frozen, and to not enter it into a “not responding” state. Additionally, this solves the issue of Citras inability to be stopped whilst preloading custom textures, which is handy if you need to stop it for any reason whatsoever.
### Rasterizer cache refactor v2 ([#6479](https://github.com/citra-emu/citra/pull/6479)) by [GPUCode](https://github.com/GPUCode)
## Add MMPX texture filter ([#6564](https://github.com/citra-emu/citra/pull/6564)) by [stuken](https://github.com/stuken)
It's a given that all great movies get a sequel. And because the first refactor was so good, we decided to make a second one! Well, not quite, but we promise this one is worthwhile too. More specifically, it contained the last pieces needed to fully abstract the video core from OpenGL, fixed a handful of regressions from the first one, and even provided some performance improvements.
Due to the large amount of changes introduced by the previous PR, it was natural for some regressions to slip through the cracks. As we learned the hard way, messing with many parts of the GPU emulation at the same time can result in strange bugs. For example, players of Digimon World Re:Digitize: Decode [reported](https://github.com/citra-emu/citra/issues/6481) that some models went missing after the merge, which was caused by an erroneous change to the OpenGL viewport.
{{< sidebyside "image" ""
"digimonbroke.png=Where are you little monster?"
"digimonfix.png=Oh, here!" >}}
Next, let's talk about Disney. Not the company, but a pretty obscure game they made for the Nintendo 3DS called Disney Art Academy, where you get to draw Mickey Mouse and his friends using the touchscreen and stylus. Given that the core gameplay mechanics require use of the touchscreen and stylus, not many people choose to emulate this title. So we were surprised when a bug report came in, stating that the game had become completely broken after the first refactor.
{{< figure src="disneybroke.png"
title="This will haunt our dreams..." >}}
After some digging, GPUCode found out that the new mipmap implementation was the culprit that robbed Mickey of his face. To go into more detail, texture downloads were not adjusted to account for multi-level surfaces and thus readbacks of these surfaces did not function correctly. Rendering and reading back from multi-level surfaces is quite unusual and not something we often see in games. Regardless, we are happy it was reported to us so that we could promptly fix it!
{{< figure src="disneyfix.png"
title="Mickey got his face back!" >}}
Alright, what about the performance improvement then? Indeed, by changing the data structure used to store surfaces, Citra is now able to cache and search for them more quickly and efficiently. The old interval map was ditched in favour of a simple page table. Memory locality has also been improved by taking [inspiration](https://github.com/citra-emu/citra/blob/master/src/common/slot_vector.h) from [yuzu](https://yuzu-emu.org/)'s texture cache. All in all, this change should yield a couple of extra frames in games that perform many cache operations and especially in cases where interval map lookups would [slow](https://github.com/citra-emu/citra/pull/5183) things down.
### Add MMPX texture filter ([#6564](https://github.com/citra-emu/citra/pull/6564)) by [stuken](https://github.com/stuken)
What's better than 5 texture filters? Well, how about 6! Introducing the MMPX texture filter, implemented by first time contributor, [stuken](https://github.com/stuken).
What's better than 5 texture filters? Well, what about 6! Introducing the MMPX texture filter, implemented by first time contributor, [stuken](https://github.com/stuken).
MMPX is a texture filter centered around the preservation of those classic pixel art styles we typically see in 8- and 16-bit era video games. Sprites, fonts, you name it, its been given a sweet pixel art style with this new texture filter!
This new texture filter can be enabled in `Emulation -> Configure -> Graphics -> Renderer` (`Citra -> Preferences` on macOS).
{{< single-title-imgs-compare
"Left: unfiltered, Right: MMPX"
"./none.png"
"./mmpx.png"
>}}
{{< juxtapose id="e103936e-1122-11ee-b5bd-6595d9b17862" >}}
# Audio
### Implement OpenAL backend ([#6450](https://github.com/citra-emu/citra/pull/6450)) by [Steveice10](https://github.com/Steveice10)
## Implement OpenAL backend ([#6450](https://github.com/citra-emu/citra/pull/6450)) by [Steveice10](https://github.com/Steveice10)
OpenAL, or in Citra's case a variant of OpenAL, OpenAL Soft, is an audio API designed for efficient rendering of multichannel audio.
OpenAL is an audio API designed for efficient rendering of multichannel three-dimensional positional audio. Basically, this API adds realism back to game audio by simulating attenuation and material densities. Attenuation is the degradation of sound over distance in a real world setting, due to factors such as room acoustics and alike, while material density relates to how sounds interact with different materials in a given space.
It supports a wide variety of a platforms and can now be used in case Cubeb, our default audio backend, fails for any reason. To get this working in Citra, though, a few things had to be changed first.
In Citra, however, we do not use this for positional audio. It is there just in case Cubeb, our default audio backend, fails for any reason. To get this working in Citra, though, a few things had to be changed first.
Before this PR, the input audio settings UI assumed that only the Cubeb backend would be used, and, unlike output, did not have a proper selector for other options. The input UI was edited to allow “Real Device (OpenAL)” to be selected, along with “Real Device (Cubeb)” as before.
By changing these UI options, along with internal code cleanup to make managing output and input devices more consistent, we can improve Citras portability as a whole. We also use OpenAL Soft, as it supports iOS, while Cubeb does not.
Citra uses an implementation of OpenAL called OpenAL Soft. By changing these UI options, along with internal code cleanup to make managing output and input devices more consistent, we can improve Citras portability as a whole. We also use OpenAL Soft, as it supports iOS, while Cubeb does not.
### Implement Apple AudioToolbox AAC decoder ([#6510](https://github.com/citra-emu/citra/pull/6510)) by [Steveice10](https://github.com/Steveice10)
Apple devices, like Macs and iPhones, use a framework called AudioToolbox to provide interfaces for recording, playback, and stream parsing. This framework can be used to encode and decode different audio formats, such as AAC.
AAC audio might be something youre already familiar with in Citra. It was a big reason as to why Pokémon X and Y couldnt be played properly for many many years. But thankfully, that hasnt been an issue for a while now!
Apple devices, like Macs and iPhones, use a framework called AudioToolbox to provide interfaces for recording, playback, and stream parsing. This framework can be used to encode and decode different audio formats, such as AAC
AAC audio might be something youre already familiar with in Citra. It was a big reason as to why Pokemon X and Y couldnt be played properly for many many years. But thankfully, that hasnt been an issue for a while now!
By implementing an AAC decoder backend using the AudioToolbox library, we are able to eliminate the FFmpeg dependency on macOS. And, yes, Pokémon X and Y still work on macOS with this change.
By implementing an AAC decoder backend using the AudioToolbox library, we are able to eliminate the FFmpeg dependency on macOS. And, yes, Pokemon X and Y still work on macOS with this change.
### Dynamically load fdk-aac and FFmpeg at runtime ([#6570](https://github.com/citra-emu/citra/pull/6570)) by [Steveice10](https://github.com/Steveice10)
This PR allows Citra to dynamically load the fdk-aac and FFmpeg libraries. These are difficult to distribute due to licensing reasons, but necessary to support features like AAC audio on Linux.
This PR introduces a cross-platform library loading utility, as Citra supports many different platforms, as well as dynamically loading both fdk-aac and FFmpeg.
This also allows for the Linux AppImages (Yeah, we have those now. More on those later!) to use AAC decoding, so long as the required libraries are already installed on the system. As mentioned just above, Pokémon X and Y rely on AAC audio for the game to have any audio in the first place, and now this works on the AppImages too!
This allows for the Linux AppImages (Yeah, we have those now. More on those later!) to use AAC decoding, so long as the required libraries are already installed on the system. As mentioned just above, Pokemon X and Y rely on AAC audio for the game to have any audio in the first place, and now this works on the AppImages too!
However, this change also has an implication for those who use the built-in video dumper. To use the video dumper, youll now have to install FFmpeg yourself, from either their official website or via your package manager of choice.
However, this change also has an implication for those who use the built-in video dumper. To use the video dumper, youll now have to install FFmpeg yourself, from either their official website or via your package manager of choice
# Miscellaneous
### Migrate to Qt6 ([#6418](https://github.com/citra-emu/citra/pull/6418),[#6435](https://github.com/citra-emu/citra/pull/6435),[#6682](https://github.com/citra-emu/citra/pull/6435)) by [Steveice10](https://github.com/Steveice10)
Out with the old and in with the new! Citra has now migrated to Qt6, which brings with it many benefits such as improved [HiDPI support](https://doc.qt.io/qt-6/highdpi.html#conceptual-model), reworked [multimedia libraries](https://doc.qt.io/qt-6/qtmultimedia-changes-qt6.html), as well as better [styling support for Windows](https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5). Needless to say, quite a few changes were needed to be able to support this new version, with the camera implementation being one of the most challenging parts due to the aforementioned multimedia changes. As a result of this change, it's important to mention that, alongside other projects like [Dolphin](https://el.dolphin-emu.org/blog/2022/07/07/dolphin-progress-report-may-and-june-2022/?cr=el), Citra has now dropped support for Windows 7, Windows 8, and 8.1, with Windows 10 becoming the minimum required version. A dwindling user base, combined with security concerns due to lack of regular security updates, have contributed to our decision to make the jump to Qt6, and drop support for these operating systems to focus on their more modern successors.
The changes don't stop there. With the introduction of Qt6, Steveice10 also completely reworked the way Qt dependencies are handled. Instead of needing to manually build and package Qt releases on our [ext-windows-bin](https://github.com/citra-emu/ext-windows-bin), Citra's build system now uses [aqtinstaller](https://github.com/miurahr/aqtinstall), which automatically downloads prebuilt binaries directly from Qt's servers. An added bonus is that we also get more flexibility when it comes to upgrading or adding new Qt libraries!
### Move CPU speed slider to debug tab and Report Compatibility to help menu ([#6250](https://github.com/citra-emu/citra/pull/6250)) by [FearlessTobi](https://github.com/FearlessTobi)
One of the more common issues our Citra support team comes across is users configuring the CPU Clock Speed slider to be either insanely high or low causing their games to freeze. As changing the CPU Clock Speed is very unstable, a warning about this exact issue is given in the UI to deter people from changing it, but that hasnt stopped some users from messing with this setting anyways, nor some misinformed content creators from recommending their viewers play with it
@@ -485,27 +403,27 @@ This PR adds a simple popup to explain to the user that GBA Virtual Console ROMs
Recently added to Citra, the per-game settings bring a new way to configure the settings of Citra on a game-by-game basis. However, not all settings were added with this in one go, as we were unsure which settings most users would find relevant to have here.
After hearing your feedback, we decided to add most of the graphical enhancement options to the per-game settings. This includes features such as the resolution upscaling, custom textures, texture filters, and the options for the screen layout. This way, you have many more ways to customize your games to your heart's content, without having to change the global settings around every time you swap games!
After hearing your feedback, we decided to add most of the graphical enhancement options to the per-game settings. This includes features such as the resolution upscaling, custom textures, texture filters and the options for the screen layout. This way, you have many more ways to customize your games to your heart's desires, without having to change settings around for each individual game!
On top of this, we also moved the cheats section to the per-game settings instead of being in the global settings. By being available in the per-game settings, cheats can be managed more easily, and are now configurable when a game is not running.
On top of this, we also moved the cheats section to the per-game settings instead of being in the global settings. By being available in the per-game settings, cheats are able to be managed more easily for each game they are for, and are now configurable when a game is not running.
{{< figure src="cheats.png"
title="Look, Ma! New settings!" >}}
title="" >}}
### Add consolidated GodMode9 key dumping script ([#6396](https://github.com/citra-emu/citra/pull/6396)) by [Steveice10](https://github.com/Steveice10)
## Add consolidated GodMode9 key dumping script ([#6396](https://github.com/citra-emu/citra/pull/6396)) by [Steveice10](https://github.com/Steveice10)
Something a bit different here… weve made our own GodMode9 dumping script!
If youre somehow unaware, GodMode9 is a homebrew full-access file browser for the 3DS, allowing you access to pretty much everything on the console. This app is vital for playing games in Citra, as you must use this to dump your games, updates, DLC, and anything else you may want from your 3DS. GodMode9 can utilize dumping scripts to easily dump a bunch of things at once that the user may want, such as how ThreeSD works.
If youre somehow unaware, GodMode9 is a homebrew full access file browser for the 3DS, allowing you access to pretty much everything on the console. This app is vital for playing games on Citra, as you must use this to dump your games, updates, DLC and anything else you may want from your 3DS. GodMode9 can utilize dumping scripts to easily dump a bunch of things at once that the user may want, such as how the infamous ThreeSD works.
This script is used to dump all the keys needed for Citra into one file, which simplifies things a lot. In the past, you would have to dump many different files such as `Boot9`, `Sector0x96`, and `NATIVE_FIRM` just to get encrypted games running on Citra.
Now, with the new system file download option through the Nintendo Update Service (NUS) in Citra, which relies on encryption keys in order to be used, it was a good time to find a way to streamline this dumping process once and for all.
This script is used to dump all the keys needed for Citra into one file, which simplifies things a lot. In the past, you would have to dump many different files such as `Boot9`, `Sector0x96` and `NATIVE_FIRM` just to get encrypted games running on Citra.
Now with the new system file download option through the Nintendo Update Service (NUS) in Citra, which relies on encryption keys in order to be used, it is best time to find a way to streamline this dumping process for once and for all.
This new dumping script loosely follows the existing aes_keys.txt format which is supported by Citra, but adds a few new secrets that will be needed for things such as encrypted Amiibo support. This ensures that whatever is needed for use in Citra will be dumped with ease using this script.
The download link and instructions for using this dumping script can be found on our [AES keys guide](https://citra-emu.org/wiki/aes-keys/). We hope that this will help make your Citra setup experience just that little bit smoother!
### Add Citra AppImage builds ([#6404](https://github.com/citra-emu/citra/pull/6404)) by [TGP17](https://github.com/TGP17)
## Add Citra AppImage builds ([#6404](https://github.com/citra-emu/citra/pull/6404)) by [TGP17](https://github.com/TGP17)
An AppImage is a format for distributing portable software on Linux in a compact and simple way. AppImages dont require any outside installation, and can just be run as is. This makes it very easy to use different programs on Linux, especially to those who are new to the operating system, as using the CLI can be intimidating or just plain time consuming.
@@ -517,40 +435,38 @@ Nowadays, Citras development has come a long way to where an AppImage is a fe
Carrying on with the theme of common errors from users… broken save states…
Pretty much every Citra user has seen this at some point. You save your game using save states, update Citra and… what? My save is now broken? How did this happen?
To give a short summary of what happens, save states dont just save your game, they save the entire state of Citra. Kinda in the name there. When an update is pushed to Citra that changes the state, the previous save states become invalid. This is why it is so important that you do not rely on save states to save your game progression and that you frequently save in-game.
To give a short summary of what happens, save states dont just save your game, they save the entire state of Citra. Kinda in the name there. When an update to Citra that changes the state happens, the previous save states become invalid. This is why it is so important that you do not rely on save states to save your game progression and that you always save in-game.
Unfortunately, many people do not realize this. Which causes a lot of distress at lost progression and a lot of frustration fiddling around with older builds to get the saves working again. Simple solution? Warn the people of what might happen when using save states. At the very least, this might help people to not lose their progress.
Unfortunately, many people do not realize this. Which causes a lot of distress at lost progression and a lot of frustration fiddling around with older builds to get the saves working again. Simple solution? Warn the people of what might happen when using save states. At least that will help people to not lose their progress… right…?
{{< figure src="savestate.png"
title="Don't skip this, it's important!" >}}
title="" >}}
### yuzu ports by [Morph1984](https://github.com/Morph1984) and [FearlessTobi](https://github.com/FearlessTobi)
## yuzu ports by [Morph1984](https://github.com/Morph1984) and [FearlessTobi](https://github.com/FearlessTobi)
### Enable High DPI fixes for Qt >= 5.14 ([#6262](https://github.com/citra-emu/citra/pull/6262)) originally by [Morph1984](https://github.com/Morph1984)
On higher DPI monitors, any information window, such as the game compatibility reporting tool, would be scaled incorrectly, resulting in massive text size that could not be read due to it getting cut off.
On higher DPI monitors, any information window, such as the game compatibility reporting tool, would be scaled incorrectly, resulting in massive text size that could not be read due to it cutting off.
By utilizing Qts new high DPI application attributes for scaling a window, paired with a heuristic to select an integer scale value dependent on the current screen resolution, the scaling issue that has plagued Citra for four and a half years is finally resolved!
### Port multiplayer related PRs from yuzu ([#6319](https://github.com/citra-emu/citra/pull/6319)) originally by [SoRadGaming](https://github.com/SoRadGaming) and [unfamiliarplace](https://github.com/unfamiliarplace)
Just a few multiplayer additions here for ease when playing multiplayer in Citra with your friends!
Just a few multiplayer additions here for ease when playing multiplayer on Citra with your friends!
First off, we have support for hostnames and IPv6 when using Direct Connect! Direct Connect is used to, well, directly connect to someone without having to search through the multiplayer lobby or if theyre hosting unlisted! In the past, the only way to connect to an unlisted room was via an IP address.
This wasn't ideal, as it requires knowing the exact IP address in order to connect. With this change, it allows for Citra to use a domain address, as well as IPv6, as an input method to connect to a multiplayer server.
First off, we have support for hostnames and IPv6 when using Direct Connect! Direct Connect is used to, well, directly connect to someone without having to search through the multiplayer lobby, or if theyre hosting unlisted! In the past, the only way to connect to an unlisted room was via an IP address.
This isnt ideal, as it requires knowing the exact IP address to type in to connect. With this change, it allows for Citra to use a domain address, as well as IPv6, as an input method to connect to a multiplayer server.
And then we have an option to tidy up the multiplayer lobby a bit more, a toggle to hide empty rooms! Sick of shifting through each room manually to see if there is anyone to play with? Fret not, with a simple click of this button, you will be shown rooms that have at least one other person to play with!
And then we have something to clean up the multiplayer lobby a little bit more, a toggle to hide empty rooms! Sick of shifting through each room manually to see if there is anyone to play with? Fret not, with a simple click of this button and you will be shown rooms that have at least one other person in to play with!
Both of these additions help make the multiplayer experience in Citra just that little bit better and allow you to enjoy playing with ease, which we all love.
# Conclusion
Well, thats a wrap! It has been an incredible couple of months for Citra development. We are definitely picking up speed, the likes of which we have not seen here for years, and as promised, the progress reports are continuing.
A massive thanks goes out to the Citra community, especially the developers. None of these achievements would have been possible without all of the people involved here keeping this emulator afloat. These reports give us the opportunity to showcase the talented people working on this project, so you best believe theyre going to be long!
Well, thats a wrap! It has been an incredible couple of months for Citra development. We are definitely picking up speed, the likes of which we have not seen here for years, and as promised, the reports are continuing.
A massive thanks goes out to the Citra community, especially the developers. None of this shown here would have been possible without all of the people involved here keeping this emulator afloat. These reports give us the opportunity to showcase the talented people working on this project, so you best believe theyre going to be long!
If you want to support this project, we have a [Patreon](https://www.patreon.com/citraemu)! Donations to the Patreon go directly to our team to assist with obtaining hardware for testing and keeping our servers up and running. Donations are not required, but are greatly appreciated!
If you are looking to contribute to Citra or just want to get involved with our community, you can find us on our [Discord server](https://discord.com/invite/FAXfZV9) or on our IRC channel (#citra @ [Libera.Chat](https://libera.chat/)).
To those of you who made it to the end, thanks for reading! We have many more exciting things to tell you all about in the future, so stay tuned!
{{< imgs-compare-include-end >}}
To those of you who made it until the end, thanks for reading! We have many more exciting things to talk to you all about in the future, so stay tuned!

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 701 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

@@ -3,54 +3,18 @@ title = "Custom Textures"
description = "Custom texture features for displaying custom graphics packs."
+++
Citra has the ability to dump game textures and load custom texture packs. Game textures will be dumped as **`.png`** files. Texture packs may contain either **`.png`**, **`.dds`** or **`.ktx`** files. Supported compression formats include **`BCn`** and the various **`ASTC`** block variations.
Citra has the ability to dump game textures and load custom texture packs. Currently, only **`.PNG`** files are supported, but it is expected that more formats will come in the future.
## Instructions for dumping textures
* Open `Emulation > Configure...` in Citra's menu and go to `Graphics > Enhancements`.
* Enable **`Dump textures`** and click **`OK`**.
* Now open a game of your choice, and start playing. As you keep playing, the textures used by the game will be dumped as **`.png`** files.
* Now open a game of your choice, and start playing. As you keep playing, the textures used by the game will be dumped as **`.PNG`** files.
- Right-click on your game in the games list and select **`Open Texture Dump Location`** to open the dump folder.
- The dump folder will contain a template **`pack.json`** file, that is used for configuration options. This file **must** be copied in the load folder.
## Instructions for replacing textures
* Right-click on your game in the games list and select **`Open Custom Texture Location`** to open the folder where custom textures will be loaded from.
* Place your custom texture **`.png`** files in the folder.
* Place your custom texture **`.PNG`** files in the folder.
* In `Emulation > Configure... > Graphics > Enhancements`, enable **`Use Custom Textures`** and click **`OK`**.
- Additionally, if you want your custom textures to be pre-loaded to RAM, enable **`Preload Custom Textures`** as well. This will help improve the performance but will also increase memory usage.
## Texture dumping
Citra will dump textures when they are used by the game and uploaded from the guest VRAM to the host memory. Dumped textures may only have power-of-two dimensions in order to avoid dumping host framebuffers.
The texture dumper will write a template **`pack.json`** file in the dump directory, which should be copied in the `load` folder when testing the texture pack. By default, textures will be dumped using the new hashing method. If a texture pack exists in the load folder, the dumper will use the same hashing method as that pack. Regardless of the hashing method, packs should still load correctly on any recent build of Citra. For any concerns regarding pack compatibility, possible breakages or feature requests please contact us either on [GitHub](https://github.com/citra-emu/citra/issues/) or on our [Discord server](https://citra-emu.org/discord/), as this is still a very new feature.
The filename of dumped textures is comprised of various information about the guest texture. For example, the filename **"tex1_256x256_543624189C94B105_12_mip0.png"** includes the guest texture dimensions **256x256**, the texture hash **543624189C94B105**, the guest pixel format **12** and the mipmap level of the texture **mip0**
## Pack configuration
The custom textures rework introduced a new json configuration file for texture packs, which is used to distinguish between old and new packs. It contains information about the pack such as name, author, as well as other configuration options like the used hash format, automatic mipmap generation and control for texture flipping. The latter two options are **unsupported** when compressed texture formats are used.
The new hashing option is recommended for new texture packs and is enabled by default. Advantages include faster hashing, as it requires less input data compared to the old hash and better compatibility between graphics APIs. In order to maintain compatibility with existing packs, loading the older hashing format is still fully supported. Usage of the old hash occurs either when the pack.json file does not exist in the texture pack load folder, or the **`use_new_hash`** option is disabled.
The configuration file also allows for hash mappings, which means textures can have arbitrary filenames that don't strictly adhere to the dumper naming guidelines. For example:
```
"textures" : {
"114BFC385ED72F15" : "logo.png"
"22B8C43233F640AE" : "sky.png"
}
```
## Normal maps
The new custom texture system supports custom normal maps. This feature allows creators to add additional details to objects that would not be possible with only diffuse maps.
Normal maps have the same filename as their diffuse counterpart, with an added **`.norm`** prefix before the file extension. For example the normal map for dumped texture **texture.png** will be named **texture.norm.png**. This applies for all supported file types and for hash mappings.
There are limitations to when custom normal maps may be used. Most notably, the scene must enable fragment lighting. In the absence of lighting normal maps will **not** function and show the following error in the log:
```
[ 24.086113] Render.OpenGL <Warning> video_core\renderer_opengl\gl_rasterizer.cpp:OpenGL::RasterizerOpenGL::BindMaterial:598: Custom normal map used but scene has no light enabled
```

View File

@@ -1,2 +0,0 @@
<script src="https://cdn.jsdelivr.net/npm/juxtaposejs@1.1.6/build/js/juxtapose.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/juxtaposejs@1.1.6/build/css/juxtapose.css">

View File

@@ -0,0 +1,2 @@
<iframe src="https://cdn.knightlab.com/libs/juxtapose/latest/embed/index.html?uid={{ .Get "id" }}"
{{ if .Get "class" }}class="{{ .Get "class" }}"{{ else }}style="display:block; margin:auto; width:100%; height:45vh;" {{ end }}frameborder="0"></iframe>

View File

@@ -1,15 +0,0 @@
<figure>
<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
<video preload="auto" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" controls>
<source src="{{ .Get "src" }}" type="video/mp4">
Your browser doesn't support mp4 video. :(
</video>
</div>
{{ with .Get "title" }}
<figcaption>
<h4>
{{ . }}
</h4>
</figcaption>
{{ end }}
</figure>

View File

@@ -1,30 +0,0 @@
{{ $title := .Get 0 }}
{{ $originals := (.Page.Resources.ByType "image") }}
<div class="columns is-bottom-marginless">
<div class="column is-bottom-paddingless juxtapose">
{{ range $param := last 2 .Params }}
<!-- image -->
{{ $items := split $param "|" }}
{{ $src := (index $items 0) }}
{{ $subtitle := (index $items 1) }}
{{ $split_src := split $src "." }}
{{ $extension := index $split_src (sub (len $split_src) 1) }}
{{- if eq $extension "png" -}}
{{ $original := $originals.GetMatch (printf "*%s" (path.Base $src)) }}
{{ $resized_width := math.Min $original.Width 1024 }}
{{ $resized := $original.Resize (print $resized_width "x q90 jpg" ) }}
<img src="{{ $resized.Permalink }}" alt="{{ $title }}">
{{- else -}}
<img src="{{ $src }}" alt="{{ $title }}">
{{- end -}}
{{ end }}
</div>
</div>
{{ with "title" }}
<figcaption>
<h4 style="text-align: center">
{{ $title }}
</h4>
</figcaption>
{{ end }}