Journal: 2024.11.18
Added 2024-11-19 04:21:05 +0000 UTC
## Fixing Desmume2015 for Provenance Lite
I managed to fix several issues:
✅ controls work
✅ screen style swap mostly works
Screen layouts are no longer completely fubar'd. We now store the parameters in a dictionary for `libretro.h` callbacks. This means that the inner core knows which state we're in and it draws mostly correctly now. The issue I still have is we're not updating the bounding rect correctly so in some modes, ❌ like over/under, we're only seeing one view at time. This is sort of work-around-able by swapping top/bottom, but for games where you need to see both screens, this is a non starter.I don't suspect this would be too difficult to fix but I stopped working on this for now for a big reason,
🚫 Touch controls no work!This is going to be a big lift. I need to basically create virtual "mouse" support for all the `libretro.h` cores, because Desmume2015 is a sub-class of `PVLibRetroCore`This is handled through a polling method. The correct way to do this is overriding `sendEvent`, storing all (most?, the last?) touch events in a queue and retrieving them in the callback.I have sample code of other cores that do this, such as PPSSPP and emuThree, and it looks like a multi-day project to develop, test and debug the inevitable errors.
## Start Airplay/Second screen support
This almost works.
I needed to add support to UIScene and UISceneDelegate, which also requires adding fields to `Info.plist` I hate using `Info.plist` it’s one of the most arcane parts of iOS/macOS apps. Even Swift PM doesn’t really support it yet.
What does work,
1. second screen as separate screen
2. Controls are showing only on main screen
3. Game isn’t showing on main screen
What doesn’t work
1. Game doesn’t show on second screen! It starts to draw but only 1 frame
I suspect I need to do something with the Metal setup when switching screens.
The code at least listens for new screens and when it’s detached, everything works as it should and draws on the primary device screen. So, at least it doesnt’ crash when switching screens, lol.
2. No actual AirPlay controls yet. No point in adding this until 1. Is working
## TVOS
Started work on restoring tvOS support.
Shockingly it built with minor changes. Most things played, but there are some bugs.
1. Menu UI colors are same for text and background unless highlighted, making them impossible to read except one-at-a-time.
2. Importer is fubar’d.
We wrote a whole new importer this week with help of another dev. It’s been merged but the old importer may have lost some functionality. tvOS can’t really use the new Swift UI interface and the new importer depends on a Swift UI queue manager. So, I probably need to hook the up in tvOS.


This is somewhat low priority since tvOS deletes roms at random and we don’t have working cloud sync yet. I would love to get proper S3, dropbox or iCloud sync support between iOS and tvOS to get around this, but that’s a big lift and has to wait for some other time.
## Other random shit I fixed
Fixed a crash in some of my optimizations of emuThree. I made some ARM/Neon optimizations during the week, and I mostly tested them, but I saw a crashing edge case and fixed it.
One game that used to work, *3D Streets of Rage* isn’t working at all anymore though so I may just roll back all my optimizations.
Added and then removed some Metal shaders, but left two. One that looks kind of like a Sony Trenton.
A gameboy shader, that’s a little rough around the edges,
oh, and a third, a generic LCD that also is a little too powerful at the moment.
I’ll have to tweak the parameters but they’re in there for now as-is. The LCD one isn’t bad depending on the game/system.
Conclusion
This was really two days works.
I may start doing this every day or so. This was a long one, I’ll have to get better at this.
Also Patreon's WYSIWYG editor is dogshit.
Cheers,
Joe