Commit graph

39048 commits

Author SHA1 Message Date
Solomon Peachy
5ce96b84d8 pcm_mixer: Explicitly initialize the mixer frequency in the pcm init path
Change-Id: I5b79dbb0608ef182fd5592797c6211ce5299999c
2026-03-28 08:55:07 -04:00
Solomon Peachy
a84a38dd87 pcm: Fix up some compile warnings that show up under some sim builds
firmware/pcm_mixer.c:36:35: warning: conversion from ‘long unsigned int’ to ‘unsigned int’ changes value from ‘18446744073709551615’ to ‘4294967295’ [-Woverflow]
   36 | static unsigned int mixer_sampr = -1UL;
      |
firmware/pcm_mixer.c:269:21: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  269 |     if (mixer_sampr == -1UL)
      |                     ^~

So drop the 'L' and everything is peachy.

Change-Id: I9440d3300931be229c6c4b01bdc1d09b55c34d88
2026-03-28 08:54:33 -04:00
Solomon Peachy
daef425c59 pcm_mixer: Get default sample rate from pcm layer.
Change-Id: I6eccb37556e70f23112bbb0e26f4a45ac0930245
2026-03-28 08:16:04 -04:00
Solomon Peachy
759ef2767a pcm: Make pcm_is_ready a per-sink property instead of a global.
All that matters is that the _current_ sink is ready, not all possible
sinks.  When switching sinks we will need to ensure tehy are initialized
before switching over.

Change-Id: I341f7e9dcb4e2add4d0b292b68b69eb08dec0194
2026-03-28 07:09:54 -04:00
Solomon Peachy
ae724ba5f3 as3525: PCM driver init references the sink directly
Change-Id: I42e8f04214790676d6f177669cdeda58fa8e8c28
2026-03-25 10:13:36 -04:00
mojyack
9b207bfb91 plugins: pacbox: remove hw_freq_sampr usage
Change-Id: I365b4f901dd2fbcc22bf1a8009a9d9b58a1da556
2026-03-25 07:35:52 -04:00
Aidan MacDonald
da53cc0f14 echoplayer: pcm: increase SAI FIFO buffer depth
Change the SAI FIFO threshold so that it is always
kept topped up at maximum; DMA needs to do single
transfers to the peripheral now. Ignore FEIF errors
since they seem to occur constantly with this setup
(though it's not exactly clear why this happens).

FEIF only indicates that the SAI made a DMA request
while the DMA FIFO is empty, which isn't a fatal error.
The DMA channel will simply service the request when
it is ready.

Keeping the SAI FIFO constantly full increases the
overall timing margin before underrun so losing the
FEIF info isn't a big deal in practice.

Change-Id: I16eb1cbb17039db76938bd86c4921b8060c83556
2026-03-25 07:33:19 -04:00
Solomon Peachy
2578411f00 Fix red in 9c708e3876
Test build didn't catch this due to a dependency failure.  (WTF?)

Change-Id: I0487a02e9fad8b6bec9b93066619aef04c838d3b
2026-03-25 07:30:27 -04:00
mojyack
9c708e3876 plugins: midi: remove HW_SAMPR_CAPS usage
Change-Id: Ie4962cf6d4f2f9078fa348f8f6f638cfbc0047a5
2026-03-25 07:02:49 -04:00
Solomon Peachy
e923b354a6 FS#13836 - Remove the pcm sink_mutex to unbreak usb_dac mode
The purpose of the mutex is to make it possible to switch pcm sinks
safely, but pcm_play_lock/unlock and pcm_set_frequency need to be
called from IRQ context which is fundamentally incompatible with
our mutex implementation.

The proper path forward will be to promote the counter-based per-sink
lock/unlock implementation to the pcm core, and only allowing sink
switching when the counter is 0.

In the mean time, just remove sink_mutex entirely as the sink switching
code has yet to be committed.

Change-Id: I029459d7ec6ea47c6e2b8fce52d203129a282832
2026-03-21 08:06:20 -04:00
William Wilgus
db849f5f8a OpenPlugins reset start_in_screen when database record is deleted
This is more of an ease of use enhancement than a bug
but it should prevent the annoyance of the  message about the missing entry
without needing to go and reset the start in screen setting

Change-Id: I15eb005ce254eb0f0d3f2543abf710b68468a8b3
2026-03-19 12:05:51 -04:00
Aidan MacDonald
acd3a5f0ce echoplayer: implement ADC to read battery voltage
Change-Id: I8043e7d2f02c10cb8c9d9ec59b7d216945431481
2026-03-18 12:51:51 +00:00
Aidan MacDonald
684b3d8c49 make: enable fixedpoint library for bootloaders
Change-Id: I8a4975d4e2e8b6af4d3dbfaeb752032f43789453
2026-03-18 12:51:51 +00:00
William Wilgus
314becf2ac FS#13824 - In keyremap plugin in "test keymap" context is wrong
The context was supplied with context|flag but expected context x flag

Also fixes a bug where the user export doesn't show the correct save location
if changed -- it still saved properly anyway..

Change-Id: I061d63e15475d2cb73d070737dc18d56d7800472
2026-03-14 11:28:00 -04:00
Vencislav Atanasov
72969fee7e 3ds: Makefile improvements
- Allow overriding of the smdhtool and 3dsxtool programs
- Introduce dependencies in ctru.make for 3dsx and cia packages
- Build these packages when the binary is built
- Copy instead of moving the cia package when building a zip
- Properly clean all build artifacts when make clean is used

Change-Id: I2069bcc44d6ab6031ef61ed9980f92ff9a913bc9
2026-03-13 17:52:32 +02:00
Vencislav Atanasov
a77c5d2219 3ds: Various fixes, mostly for compiler warnings
- Move all devkitpro includes before the Rockbox ones so that the macros which are both conflicting and unused can be undef'd
- Remove unused result variables
- Exclude an unused function from being compiled for this target
- Fix hex number formatting
- Fix the return value of dummy functions
- Fix macro redefinition in the plugins keypad config
- Remove duplicate button mapping
- Turn off -Wchar-subscripts as it's already handled in Rockbox's ctype.h

Change-Id: I3f5a3d492c585f233277a380feaea5fe877a044f
2026-03-13 10:24:36 -04:00
Solomon Peachy
6246e9b4d3 FS#13831 - Updated Turkish Translation (Emre Çebi)
Change-Id: I6b7f27dcfacad4bc03d3299cf9ca46faf1b64a29
2026-03-13 10:12:17 -04:00
Vencislav Atanasov
78a785d656 3ds: Minor Makefile changes
- Fix the macOS check so that it only includes the linker command line and not the whole block
- Remove a dash from the .map file name, likely a typo
- Don't remove the .elf file after packaging, so that it can be used to debug any issues with the build

Change-Id: I9639263169e027c9702ac617eb8209b1707e11f4
2026-03-11 22:38:47 +02:00
Vencislav Atanasov
aa834e83aa 3ds: Fix crash on shutdown
It is required to call gfxExit() before exiting the app if gfxInit() was previously called. Otherwise, the GSP thread continues to run after the stack is invalidated. The missing code is already in lcd_shutdown(), but it was never called because HAVE_LCD_SHUTDOWN was not defined for the ctru target.

Change-Id: I8999df6372cd593c5b52478028ad7421b23d5f92
2026-03-11 22:26:44 +02:00
mojyack
e13befb925 pp5020: ata: do not yield in ata_wait_intrq()
Confirmed on iFlash-modded ipodvideo, USB mass storage connections
frequently fail with bus resets during mount on macOS, and trigger
"reset high-speed USB device" errors on Linux during sequential
reads.

The root cause is: storage_read_sectors() calls yield() via
ata_wait_intrq(), which switches to the main thread running
handle_usb_events() loop. This calls send_event(GUI_EVENT_ACTIONUPDATE),
triggering LCD redraw that takes approximately 110ms. This stalls the
ATA DMA completion, causing the USB bulk transfer to time out from the
host's perspective.

This commit removes the yield to prevent the reading thread from being
preempted by the lengthy LCD redraw during DMA completion.

This also improves sequential read throughput from ~13MB/s to ~18MB/s.

Change-Id: Ia552f97aa0169c93c4f21e250d13dc3a626661d4
2026-03-10 18:17:41 -04:00
Solomon Peachy
f68bfadb56 FS#13819 : Updated Spanish Translation (Javier Gutiérrez Gertrúdix)
Errors and Capitalization

Change-Id: I637d07b7b72b137dd4fbdf67cc2fd0b92330729b
2026-03-10 15:58:56 -04:00
Aidan MacDonald
9605b453da Fix yellow in c72ffa7a9a ("diacritic: Critical bugfixes")
Change-Id: Ie780cab7e9926165cab1e48319c6743e3b6accb1
2026-03-10 10:14:42 +00:00
Solomon Peachy
a2b754d829 unicode: Support diacritic marks > 0xffff (disabled for now)
* Terminating record of the max unicode codepoint (0x10ffff)
 * Add in Arabic diacritic marks in the 0x10efa..10efff range

This is currently disasbled due to it effectively doubling the
size of our diacritic table. The diacritics added are unlikely
to be seen in practice as they are used only in some formal
Quaranic contexts.  If we identify other diacritic marks above
0xffff, then we can turn this code on.

Change-Id: I50c2eace18c70be6fe7199fccab190e7da401089
2026-03-09 21:57:34 -04:00
Solomon Peachy
c72ffa7a9a diacritic: Critical bugfixes
* When the codepoint > 0xffff, don't overflow past the end
   of our diacritic table (Fixed by William Wilgus)
 * Truncation of the 'info' field causes the RTL flag to be dropped
   (RTL flag is b15 but we truncate it into an 8-bit variable)

Both bugs introduced in a2c10f6189 (September 2025)

Change-Id: Id5425606f2cf91d3b3a81f4b67a97d546de81e41
2026-03-09 21:52:37 -04:00
William Wilgus
86f5665cd0 [bugfix] FS#13709 - Mpegplayer conflicts with additional fonts in the theme
FONT_UI is a placeholder when it gets assigned it isn't resolved
immediately

when its time to resolve the font it is processed with font_get(int font)
first it sets it to the last slot
and then decrements till it gets a valid font

I think this is intended to allow the largest
chance of getting a loaded font

instead if global_status->font_id has been set use that
similar to how the screen helper does

Change-Id: If97e504466265fafecbe07b7b72adb4808b67e6a
2026-03-09 11:05:32 -04:00
Aidan MacDonald
add06955a2 firmware: add copyright headers to core_alloc.c/h
These files have been missing copyright headers since
they were added in comit d0b72e2590 ("GSoC/Buflib:
Add buflib memory alocator to the core.").

Thomas Martitz seems to be the original author, which
is documented in the commit metadata and backed up by
emails from the rockbox-dev archive, for example [1].

[1]: https://www.rockbox.org/mail/archive/rockbox-dev-archive-2011-08/0000.shtml

Change-Id: Id1a3abd4975674ffbc6f7e9123ee57d49bcaa38e
2026-03-09 10:26:18 +00:00
William Wilgus
951cbdbec6 [bugfix] FS#13812 - ZXBox always returns a leak file handles error
tapefiles return a leak handle error if it is quit before end of tape is
reached, ensure it always gets closed on exit

Change-Id: I0f6224c7164fd87c209166be9e10d62d6a644a50
2026-03-08 12:07:53 -04:00
William Wilgus
4503d63ec8 [bugfix] zxbox unsupported files crash OOB access to extension list
invalid files return -1 but thats not checked before accessing
invalid array position

Change-Id: Ic07cca250e2584e2e95fa7c41085b254f94ad591
2026-03-08 11:26:12 -04:00
Solomon Peachy
7d88ab4ef4 FS#13817 - Update Romanian Translations (Mihai Alexandru Vasiliu)
Change-Id: Ib21a169258afba27aae44b8387896461f43eb797
2026-03-08 08:27:58 -04:00
Aidan MacDonald
d6d4ff7af2 make: fix '--plugins=' option not being respected in all cases
If the list of plugins given to configure did not include
a subdir-based plugin, then all subdir-based plugins would
be built (since SELECTED_PLUGINS_SUBDIRS is empty then).

To prevent this issue use an explicit value ('DEFAULT') to
signal that we want to build the standard set of plugins.

Change-Id: I42d9dc8d754ed9ac1cd4b5c62c0a106ca3dfcd91
2026-03-07 21:57:34 +00:00
William Wilgus
a5853b1173 FS#13796 - Add search to text editor plugin
Adds a case-insensitive find function to text_editor

Change-Id: I8d4bc7a65d2659d5f6aec0304e69905bf2ffe0e1
2026-03-07 12:58:04 -05:00
Solomon Peachy
c397746033 Translation updates:
* Slovak (Matej Golian)
  * Spanish (Javier Gutiérrez Gertrúdix)

Change-Id: I4d61779faffac552c21f4bd7d7fb7081919f8d36
2026-03-06 19:31:23 -05:00
Aidan MacDonald
a80911a0ce plugins: clean up IRAM memory region definitions
Check for USE_IRAM to determine if IRAM should be used.
SoCs that don't define USE_IRAM no longer need to define
IRAMSIZE to 0 either.

When IRAM is not used, any symbols bound for IRAM will
be discarded instead of linking them in DRAM. In theory
these symbols shouldn't exist, since nothing should be
placed into IRAM sections to begin with for !USE_IRAM.
If an IRAM section attribute leaks into the plugin/codec
anyway, it should now cause a link time error.

Change-Id: I55c1854cfe8beb5cb09b865336906f9945084b33
2026-03-06 16:26:35 -05:00
Aidan MacDonald
c9172d4ff8 plugins: clean up target DRAM/IRAM mapping defines
Move the definition of DRAMSIZE into the SoC-specific
ifdef block below. This keeps the memory map defines
for a SoC together in one place and as a result it is
much easier to understand.

Change-Id: Ie7293616a3c572b381cfeab3531751562c19a9c4
2026-03-06 16:26:04 -05:00
Solomon Peachy
e8daf314be mrobe500: fix yellow in a24142b234
LCD_FUDGE is now defined in the cpu header, as it's needed for memory
layouts.

Change-Id: I3a91581286cb7765f8217da34c6c87c15e74b399
2026-03-06 16:24:13 -05:00
Aidan MacDonald
a24142b234 firmware: cleanup duplicated DM320 LCD memory defines
Move the rather large block of code that's been copied
in three separate linker scripts into the CPU header.

Change-Id: I9f38e4901fa4ff699f00d97064a9cdaf7cfd6aab
2026-03-06 15:55:35 -05:00
Aidan MacDonald
99dd797169 firmware: cleanup PortalPlayer NOCACHE_BASE defines
Move the definition of NOCACHE_BASE to the CPU headers
instead of having them copy-and-pasted in a few places.

Change-Id: Ibbab27a5a07906d46dbd4dd9065f2238bc885d6b
2026-03-06 14:15:29 -05:00
Solomon Peachy
408f155f53 build: fix red in 7eeb4e4302
STORAGE_WANTS_ALIGN needs to be ignored for simulator builds

Change-Id: I4d788f91d3d1ed81c0621b9adac985ca188d918c
2026-03-06 13:37:27 -05:00
Aidan MacDonald
7eeb4e4302 firmware: refactor CACHEALIGN_BITS/SIZE defines
Mostly motivated by PP needing CACHEALIGN_SIZE in linker
scripts, which can't include system.h, so move these to
cpu.h instead. Also gets rid of the default 32 byte line
size that was used if the target didn't define alignment
itself. RK24xx, DM320, and JZ4740 were missing this but
have been confirmed (from datasheets) to use 32-byte cache
lines.

Add checks to make sure the macros are appropriately
(un)defined based on the HAVE_CPU_CACHE_ALIGN define,
and make sure their values are consistent when they
are defined.

Disable HAVE_CPU_CACHE_ALIGN for hosted targets since it
arguably doesn't matter if there's a cache, if we aren't
responsible for cache maintenance.

A few files in rbcodec use CACHEALIGN_SIZE, but these
can be converted to MEM_ALIGN_SIZE, which is identical
to CACHEALIGN_SIZE if the latter is defined. On other
targets, it aligns to at least sizeof(intptr_t).

Change-Id: If8cf8f6ec327dc3732f4cd5022a858546b9e63d6
2026-03-06 14:49:00 +00:00
Aidan MacDonald
e61bf40542 make: define PLUGIN when preprocessing plugin linker scripts
This matches the behavior of codecs, which define CODEC,
and is needed to get an accurate definition of USE_IRAM
out of config.h.

Change-Id: I84855ba88d01495bb63c609b3e4d67922b908440
2026-03-06 14:49:00 +00:00
Aidan MacDonald
dbfedcd65e stm32h743: rename CPU header to match other platform conventions
Change-Id: Ie7564df983aed460947ebde3bf73f8147d5bc974
2026-03-06 14:01:38 +00:00
Aidan MacDonald
7bf1c79cb5 make: have preprocess2file fail on error
The preprocess2file helper is mainly used to preprocess
linker scripts, but piping the preprocessor output to
'grep' masks the exit code of gcc, so if it fails (eg.
due to an #error directive) then it does not cause the
build to fail like it should.

In this particular case the grep commands don't seem to
be doing anything, since the "-P" option suppresses line
markers, which "grep -v ^$(_hash)" is probably meant to
filter out. The intent behind "grep -v ^$$" is unclear
since the preprocessor doesn't seem to output any line
beginning with '$', but in any event it seems unnecessary.

Change-Id: Ie23f5de1fe1bfb5890c7b2f3c7fa05401931d89f
2026-03-06 13:28:24 +00:00
Aidan MacDonald
676d3b6432 plugins: always include cpu.h in linker script
Change-Id: I5a5dad0c6094735fa3af676667232571bf0efdf3
2026-03-05 21:13:50 +00:00
Aidan MacDonald
f44b6c78e0 misc: respect standard __ASSEMBLER__ define in CPU headers
The JZ47xx and S5L87xx processor families used their own
special defines (__ASSEMBLY__ and ASM respectively) in
their CPU headers to check if they were included from an
assembly source file.

For GCC the standard seems to be __ASSEMBLER__, so check
for that instead and remove the non-standard symbols.
Being more consistent across platforms makes it easier to
include cpu.h from cross-platform files (eg. plugin.lds).

Change-Id: I282930cad34e1a2ff18166f3b4338548b34f4a49
2026-03-05 21:13:50 +00:00
Aidan MacDonald
5a236963e4 misc: get rid of unused LOADADDRESS define in makefiles
Change-Id: I990aaca9b0b8230efba09c87ace2430fbfa29b74
2026-03-05 20:11:07 +00:00
Aidan MacDonald
cf1e3fd5a3 misc: remove leftover pnx0101 support code
Remove now-unused stuff related to the PNX0101 processor,
which was missed during the removal of the IFP-7xx port.

Change-Id: I5ff248b3e83cb67a357743130c3e51ed84a720e5
2026-03-05 15:41:06 +00:00
Aidan MacDonald
58ffe7bc34 plugins: remove default value of DRAMORIG
Change-Id: Ia5efdbef207890682bfd8aa8cacce32d7e79c2b2
2026-03-05 10:31:35 -05:00
Solomon Peachy
d76c9c992c FS#13746: open_plugin_run() doesn't handle "not found" properly
If the specified key wasn't found, we would fall back to trying to launch
a plugin with the LANG_* key.  This will fail, resulting in an error
that spells out the (inappropriate) LANG_* text.

Instead, fail out with a more appropriate error.

Change-Id: I046878f87a2ef2bc994d0b7d037359695a18d392
2026-03-05 08:40:12 -05:00
Solomon Peachy
ba69fb9bbf doom: Rework audio init to properly respect pcm_sink capabilities
Try to use 11KHz if possible, if that's not an option, fall
back to 44KHz which is always available.  Simulators always use
44KHz.

Change-Id: I7547e7c1bddf7ce4634f7fd7bc64d4a5c9b62c29
2026-03-05 07:51:27 -05:00
mojyack
f81126bcf0 plugins: test_sampr: remove hw_freq_sampr usage
Change-Id: Iaf9f7f495364fd87db8e25f4ce147540b370f82b
2026-03-05 07:43:25 -05:00