When failing to load content in the companion ui when HAVE_MENU is not
defined RetroArch will crash in just about every input and video driver.
Even if several sanity checks are added the dummy core will immediately
exit.
Now it will print that it failed to load the core in the companion ui
and reinit the dummy core to match the behavior with the null menu
driver.
For contentless cores like 2048 and the retropad RetroArch will save png
files with the content field missing.
-181227-133151.png
Now RetroArch will save png files with the correct names for contentless
cores.
2048-181227-133151.png
RetroPad Remote-181227-133202.png
Cores with content will have no change in behavior.
Akumajou Dracula (J)-181227-133232.png
And with cores that support content and no content such as 4DO both
variations will work.
4DO-181227-144102.png
LuciennesQuest-181227-144118.png
Fixes https://github.com/libretro/RetroArch/issues/7828
== DETAILS
Fixes a bug where content CRC32 is not calculated when content loading
is done by the core instead of libretro. This impacts the ability to
do accurate content matching on netplay.
This notably affects MAME, but is by no means limited to MAME.
Change summary:
- adds a method to the crc32 implementation that calculates crc32 for
a file (as opposed to an in-memory buffer)
- fix a minor bug that would print the "core will load its own content"
right before attempting to load compressed content
- in the actual "core will load its own content" path, calculate the CRC32
and log it before returning
== TESTING
Tested locally on OSX:
- loaded content
- started netplay
- confirmed CRC showing in netplay data
- verified CRC32 against external crc32 tool
== DETAILS
In attempting to identify where netplay lobby errors were occuring,
I found that the code which does the content search was pretty messy,
so I've cleaned it up.
- Search is now more efficient. Playlists are only iterated over once,
instead of twice.
- Error messages are more helpful
- Eliminated goto abuse
- code is easier to follow and has comments describing the logical
flow.
== TESTING
Tested lightly locally, although hard to test thoroughly due to tight
netplay requirements.