darthcloud / BlueRetro

Multiplayer Bluetooth controllers adapter for retro video game consoles
https://blueretro.io
Apache License 2.0
1.23k stars 104 forks source link

Add memory card support for Dreamcast #736

Closed breademan closed 10 months ago

breademan commented 11 months ago

This adds memory card support for the Dreamcast, mostly by using the existing framework for N64 memory cards. It switches which memory card file is loaded depending on what system is set in wired_adapter.system_id.

Since an entire 128KB memory card is loaded into RAM, it currently only supports one memory card.

It also saves ~1KB of IRAM by using a loop instead of several hundred NOPs. Timing should be within a few clock cycles of the older function per 100ns delay.

darthcloud commented 11 months ago

Thanks for contributing this! I'm hopeful to look at it sometime in august.

Hattmeiny commented 11 months ago

Hey, not sure what stage this is, but I did use this version of 1.8.3 HW1 and had my vitual memory card working. I did use it on HW2 with triggers on a different board and the system had issues. The controllers wouldn't sync to the blueretro board continuously, and when they did, it was intermittent. Have you seen anything like this on HW2 with this Virtual VMU version of 1.8.3?

jandal55 commented 10 months ago

I also have built this on HW1 and it seems to work absolutely perfectly so far. VMU is detected and lists from settings menu, and was able to save SFA3 game to it, and load it back again

darthcloud commented 10 months ago

I finally had the time to look a it and test it!

It work really well and the code is very high quality :)

I did remove the changes made to the memory card module. I want this code to stay system agnostic and to use a single file for memory card needs. It's makes things a lot easier to maintain.

As expected the DC BIOS will prompt user to format the emulated VMU itself.

Other than that I only made minor cleanup in the maple module.

I wrote a web interface to allow downloading/uploading VMU binary (compatible with Flycast files, likely other emu aswell) See beta web config: https://darthcloud.github.io/BlueRetroWebCfg_Beta/

I also wrote docs (still only in the beta wiki): Some rational behind the memory card module design: https://github.com/darthcloud/BlueRetroWiki/blob/master/BlueRetro-BLE-Web-Config-User-Manual.md#7---memory-card-manager-pages

And for the DC VMU manager: https://github.com/darthcloud/BlueRetroWiki/blob/master/BlueRetro-BLE-Web-Config-User-Manual.md#72---dc-vmu-manager-page

Thanks again, this is a really great contribution!!

darthcloud commented 10 months ago

It will merge next week after some more beta testing. Will be in v1.9

Hattmeiny commented 10 months ago

Awesome!

On Sat, Aug 19, 2023 at 7:52 PM Jacques Gagnon @.***> wrote:

It will merge next week after some more beta testing. Will be in v1.9

— Reply to this email directly, view it on GitHub https://github.com/darthcloud/BlueRetro/pull/736#issuecomment-1685142980, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ47TKOFGQC2FMBS6PKJMNLXWFNTDANCNFSM6AAAAAA2VS2GFQ . You are receiving this because you commented.Message ID: @.***>

breademan commented 10 months ago

Thanks for reviewing this and getting the web interface working, too! I'm glad I was able to help folks get VMUs working.

darthcloud commented 10 months ago

@breademan thanks for doing the hard work 🙂

Let me know if you are still working on your idea of multi player VMU.

Hattmeiny commented 10 months ago

To confirm, is this available to be used now on 1.8.4 or to be released later on the 1.9? Thanks!!

darthcloud commented 10 months ago

its not, it will be available when i make the next release