146 Commits

Author SHA1 Message Date
Alex Duchesne
207de1c5f8 Merged rg_gui improvements from dev branch
This includes lots of bug fixes to the dialog system, better file picker, as well as the virtual keyboard.
2025-11-07 16:44:52 -05:00
Alex Duchesne
6e52462319 Enable UTF-8 support in FATFS for all targets
9e53e09c113a0dad9cb1fae5029bac667a60b76e
2025-11-07 15:34:31 -05:00
Alex Duchesne
59c033d7d5 Fixed various compilation warnings and runtime "errors"
- Fixed some typing or naming errors resulting in compilation warnings
- No longer show errors for ENOENT
- Adjusted some things regularly causing merge conflicts

All those things are fixed in dev branch but people tend to use master as a basis for their fork (which is usually a good idea!), and those specific items have come up in the issues.

So I'm exceptionally committing those fixes to master between releases.
2025-10-01 13:13:36 -04:00
Alex Duchesne
74a39a2860 SMS: Fixed broken input mapping in GG and SMS since 1.38 (#198) 2025-05-22 19:32:06 -04:00
Alex Duchesne
da12453ac4 NES: Fixed alternative MMC3 mappers realloc hack
There was a typo and likely memory corruption until now.
2025-03-31 13:11:33 -04:00
Alex Duchesne
c59c1048a3 SNES: Fixed type in printf format 2025-03-17 14:32:24 -04:00
Alex Duchesne
66c194a9b0 SNES: Reduced binary size by ~20KB
I refactored spc700.c:
- Replaced jump table by a switch. I'm aware that they're essentially the same thing (given our range), but the generated code is ~9KB less, so...
- Removed unnecessary inlining

Doesn't seem to have any performance impact, if anything it is marginally faster...

Possible improvements:
- Grouping identical instructions will reduce size further, but it might break the switch optimizations
- Finalizing the loop inside the function will certainly improve performance
2025-02-21 19:20:06 -05:00
Alex Duchesne
5fe002e10b SNES: Increase max rom size to the full 6MB (#172)
Will only work on targets with 8MB+
2025-02-21 19:19:15 -05:00
Alex Duchesne
f8494a89a2 NES: Fixed bogus corrections in rom_loadmem when crc32 isn't available (#181)
When loading a ROM, retro-go calcs the crc32 of the rom and searches for it in the database. If the CRC32 is 0, the last entry in the database will be selected, which is invalid.

This patch just confirms that the selected entry is valid.

A proper patch might be to not search the database at all if we don't have a crc function. But that would change multiple lines versus just this one!
2025-01-26 16:01:46 -05:00
Alex Duchesne
de5e8ae45a SNES: Fixed typo in SRTC register 2024-12-24 17:06:45 -05:00
Alex Duchesne
c97ec0b90f SNES: Prepare to merge upstream's APU
Upstream has ditched the old APU code and only uses blargg now.

This commit reduces the difference between the two.
2024-12-24 16:55:03 -05:00
Alex Duchesne
99ae023fd8 SNES: Added back support for DSP3 and DSP4
I've imported dsp.h from upstream at f9ae8fd. It had to be modified a bit to work (types, dynamic allocations) but not very much.
2024-12-24 15:12:54 -05:00
Alex Duchesne
b1ec74be44 SNES: Renamed save.h to snapshot.h 2024-12-24 15:06:44 -05:00
Alex Duchesne
2a245ba5a5 SNES: Print ROM size after loading 2024-12-24 14:03:32 -05:00
Alex Duchesne
48a164a8e5 SNES: Added support for 4MB rom (#172) 2024-12-24 13:43:42 -05:00
Alex Duchesne
6fd32003b8 SNES: Replaced some callocs with malloc
These allocations are filled when the emulator is reset, we were wasting precious milliseconds zeroing them!
2024-12-24 13:28:14 -05:00
Alex Duchesne
c95f6a81e5 Lynx: Fixed missing emulator options menu 2024-12-17 22:35:26 -05:00
Alex Duchesne
ae1c0d31db NES: Changed default palette to PVM
It's always been my favorite and the default nofrendo palette isn't the necessarily the best first impression...
2024-12-17 19:12:08 -05:00
Alex Duchesne
c615faa57c rg_system: Reverted default frameskip to 1
It's unfortunate but 0 causes audio glitches in some GBC games.

I will have to evaluate the best value for every console and not use a global default...
2024-12-17 17:23:34 -05:00
Alex Duchesne
a8565b952c Removed app.options entirely, now rely on the handler
The advantage is that the menu entries are generated on demand, so they'll always be up to date irt language.

I think it would be better if the options_handler was in charge of showing the dialog too.

It would allow in-app menus and it will also avoid the careless unbounded copying.

But this first step preserves the previous behavior.
2024-12-17 16:04:41 -05:00
Alex Duchesne
92da1ec155 rg_gui: Insert extra items in about menu items via a handler rather than an argument 2024-12-16 19:07:03 -05:00
Alex Duchesne
50121fc28b rg_gui: Removed duplicated translations
Many submenus now use the caller's label as title so that this inconsistency doesn't happen again.
2024-12-16 18:59:41 -05:00
Alex Duchesne
9d040ba753 GBC: Removed startup skipped frames 2024-12-16 18:21:33 -05:00
Alex Duchesne
becfd407b5 retro-core: removed the shared rg_app_t pointer, it caused a naming conflict with a lib I'm adding
No real downside here, the pointer wasn't used often and its value is static.
2024-12-03 15:42:11 -05:00
Alex Duchesne
b8c46a785e rg_system: Added app->frameTime to get expected frame time
retro-go now always maintains the expected time a frame should take (time between ticks).

I've added `rg_system_set_tick_rate` to replace `app->tickrate = N` to ensure frameTime is recalculated when tickrate changes.
2024-11-30 13:45:01 -05:00
Alex Duchesne
433491fd1d retro-core: Removed shared audio buffer
It wasn't used by all apps, wasteful.
2024-11-30 13:43:51 -05:00
Alex Duchesne
c5f9a75f13 retro-core: Fixed compilation warning
I've just removed _("<profile name>"), it is never seen by the user, it is always replaced when the dialog loads/changes.
2024-11-23 16:09:28 +00:00
Raphael Texier
7b4a99cba8
Adding Localization support (#159)
* Innitial commit

Localization for retro-go using a simple 0(n) lookup function called rg_gettext()

* adding language settings in options menu

* adding more gettext()

* new lookup function

* adding "For these changes to take effect you must restart your device." gui alert + fixing gettext() function

* modifying the gui dialog

* updating struct syntax

* update struct syntax (again)

* creating the python tool for localization

* updating tool + adding missing translations

* moving stuff to libs + starting writing readme

* adding missing "libs/localization" folder import in cmakelist + added the "fixme for rg_system"

* synthax adjust + moving back stuff from libs to retro-go

* removing trailing spaces

* adding the enum for language ids

* updating documentation according to the latest changes

* small tweaks

* Moved LOCALIZATION.md to the root folder

Whilst it is mostly relevant to libretro-go, it really is project-wide documentation.

* rg_localization: Got rid of the switch, made GUI dynamic

This makes adding a language more straightforward.

I kept the *msg *fr *en for now to avoid updating translations.h, but it could be replaced by the GCC extension as such:

[RG_LANG_EN] = "...",
[RG_LANG_FR] = "...",

So that adding a language is really just updating the enum...

* rg_localization: translations is const, we can use RG_COUNT

* rg_gui: Fixed language selection

* rg_localization: No need to validate rg_language in rg_gettext

It should always be valid, there's no need to validate it.

* rg_gui: Show language name in the log

* rg_localization: Got rid of the Translation struct

I am not 100% positive this is a good move...

Benefits:
- One less thing to change when adding a language
- Less code is always better

Cons:
- It doesn't make it clear what the "key" is (the english text)
- If in the future we need to add things like flags it will have to be returned to a struct

* updated python tool + updating translations

* added missing translations

* audio filter wrong translation

* fix : "a propose de retro-go"

---------

Co-authored-by: Alex Duchesne <ducalex007@gmail.com>
2024-11-16 13:04:50 -05:00
Alex Duchesne
45d010690c retro-core: Moved keymap_snes.h to main_snes.c (for now) 2024-10-17 15:07:28 -04:00
Alex Duchesne
a7f7435a72 Removed unnecessary esp-idf components
These were required with previous versions of esp-idf, but it seems to build fine now without them on 4.4/5.0
2024-09-19 14:42:02 -04:00
Alex Duchesne
3d3cbb0ff9 Moved all Wi-Fi configuration from launcher to rg_gui
More apps might want to use wifi.

The file server remains in the launcher for now. But it could make sense to move it to retro-go at some point.

Big part of the new code in rg_gui is copy pasted from the launcher and needs some cleanup...
2024-08-29 22:43:36 -04:00
Alex Duchesne
0cf255bec6 Updated sdkconfig and partition sizes for esp-idf 5.0
Silenced some deprecations. I'm aware of them but there's no easy way to fix them as long as we support 4.x.

We're a bit over 4MB now. Oh well.
2024-08-27 13:23:15 -04:00
Alex Duchesne
f8eba73736 SNES: Fixed ambiguous includes 2024-08-24 12:51:27 -04:00
Alex Duchesne
990b1b8f3e NES: Fixed ambiguous includes 2024-08-24 12:31:39 -04:00
Alex Duchesne
df5713e595 Fixed SDL2 build
It doesn't run but it builds!
2024-08-22 16:23:36 -04:00
Alex Duchesne
6b7c1f88ec SNES: Removed LAGFIX that didn't really work 2024-07-31 21:17:30 -04:00
Alex Duchesne
e9fe01b3af SNES: Removed support for interleaved ROMs
They are uncommon nowadays and this entire thing interfers with something I'm trying to achieve.
2024-07-31 16:06:12 -04:00
Alex Duchesne
86289ff3bc rg_storage: Added some flags to file read/write functions
Notable ones include:
- alignment flags (round up the allocation to a specific size)
- a flag to use a user-provided buffer instead of creating one
2024-07-26 13:50:51 -04:00
Alex Duchesne
cd322a1bf8 SNES: Fixed heap corruption if ROM isn't the expected size
I'm sure there are other side effects that I'm missing, but for now it no longer destroys the allocation table.
2024-07-22 20:56:11 -04:00
Alex Duchesne
2be65bb764 NES: Replaced raw iNES flags by booleans
The rom_t structure is more useful and flexible that way.
2024-07-22 17:45:42 -04:00
Alex Duchesne
dd8d716093 PCE: Fixed compilation warnings in esp-idf 5+ 2024-07-22 17:40:32 -04:00
Alex Duchesne
a9e3732020 LYNX: Fixed compilation warnings in esp-idf 5+ 2024-07-22 17:40:26 -04:00
Alex Duchesne
763a5dc5ea rg_storage: rg_storage_unzip_file is now present even if ZIP support disabled
This reverts the previous commit. Applications don't have to care about the presence of zip support, just that unzipping failed for any reason.

If an application really needs to know if ZIP support is present, it can of course still `#if RG_ZIP_SUPPORT`.
2024-07-22 17:09:21 -04:00
Alex Duchesne
003ade2fe3 Added #if RG_ZIP_SUPPORT fences to fix compilation failure 2024-07-22 16:57:43 -04:00
Alex Duchesne
6ccf13d537 LYNX: Remove unused variable 2024-07-22 16:50:26 -04:00
Alex Duchesne
12a0e96ce8 Experimental ZIP support (#132)
This adds zip support to GB, GBC, NES, SNES, SMS, GG, COL, PCE, LYNX, MD/GEN

The first file in the ZIP is loaded.

Still to fix:
    - Be smarter about picking a file in the zip
    - Reduce unzip memory usage to allow loading larger ROMs
    - Maybe use miniz' ZIP implementation instead of my own
2024-07-22 16:47:22 -04:00
Alex Duchesne
dfa117c5c6 NES: Fixed data offset when loading a ROM 2024-07-21 16:54:42 -04:00
Alex Duchesne
21e0b5fbc0 NES: Fixed all possible memory leaks when loading/unloading games
In retro-go this never happened because we can't swap roms in the UI.

But the new code is also simpler so it's still valuable.
2024-07-21 12:12:12 -04:00
Alex Duchesne
e38f3eee2f NES: Expose SRAM load/save functions
I needed it to debug something and we might as well keep it.
2024-07-21 12:04:09 -04:00
Alex Duchesne
51a03bbd36 rg_utils: Added rg_extension_match 2024-07-16 19:36:10 -04:00