Commit graph

38432 commits

Author SHA1 Message Date
Solomon Peachy
caaea275eb libspc: Temporarily disable problematic armv4 asm optimization
asm volatile (
    "mov    %[t0], %[out], asr #11  \n"
    "mul    %[out], %[t0], %[envx]  \n"
    : [out]"+r"(output), [t0]"=&r"(t0)
    : [envx]"r"((int) voice->envx));

This is resulting in "Rd and Rm should be different in mul" error,
because the compiler is putting [out] and [t0] into the same
register.

After some poking there doesn't appear to be a sane way to change
the constraints, so just disable it for now.

Change-Id: I7827713c8aadb27f0bf4a6f4a3e1d910c6193686
2025-09-21 15:39:35 -04:00
Solomon Peachy
bb251ba603 surfansf28: Hook up CONTEXT_YESNOSCREEN
Change-Id: I6faa43c95dffaf92d91f6b96f57acb164cf5b364
2025-09-21 15:39:35 -04:00
Solomon Peachy
977b6ef692 Toolchains: Update to GCC 9.5.0
GCC 9.5.0, binutils 2.38, gmp 6.1.2, mpfr 4.1.1, mpc 1.2.1, isl 0.18

Native:

  * arm - mini2g, nano2g, ipod6g works
  * mips - xduoox3 works
  * m68k - binaries untested

Hosted:

  * arm - samsungypr0 works
  * mips - xduoox3ii works
  * Android NDK - unchanged at GCC 4.9.4

Change-Id: I80faed4c74f7238265bf7a19b794e8476c351411
2025-09-21 09:03:00 -04:00
Solomon Peachy
5a1a5de3e3 build: Use 'nproc' instead of counting /proc/cpuinfo entries
Change-Id: If3b31504bcd37692ad109bb2779620e2302aa9fa
2025-09-21 09:03:00 -04:00
Solomon Peachy
5323c49fe6 configure: remove redundant ARG_ARM_THUMB checks
Change-Id: I25a5e631605173596de5971ff8d9bd7b7500791f
2025-09-21 09:03:00 -04:00
Solomon Peachy
d7d80a0c3a misc: Fix up more gcc9 warnings
Change-Id: Ia2f763ca7494c6a93b48bdd347a91f3d1a967f29
2025-09-21 09:03:00 -04:00
Solomon Peachy
b71fb1f12a misc: Fix some build warnings with gcc9
ata-creativezen looks like a legit memory-trashing bug, the rtc fixes
are bitwise inversion of a bool, and the remaining are just unused
static variables.

Change-Id: I1a818d4839cd3a54ca6e85f26feb743a4a9d29dc
2025-09-21 00:18:28 -04:00
Solomon Peachy
6340e79cda ipod6g: Improve power management with CE-ATA devices
* IDENTIFY_INFO flags that signify power management are _optional_
 * CE-ATA always supports STANDBY IMMEDIATE and FLUSH CACHE EXT

Change-Id: I7d575437d91f02267021fe680b9b49914e79291e
2025-09-17 08:23:41 -04:00
Solomon Peachy
44ce302348 janitorial: move FAT code from firmware/drivers to firmware/common
It's not a "driver" that interacts with hardware.

Change-Id: I7d688e1086aa118569ebc1440e20b48d0ae4881e
2025-09-17 08:23:41 -04:00
Solomon Peachy
6150e556fe unicode: Turn on 32-bit unicode for targets with >2MB RAM
Change-Id: I199dc928fc9a88fa4bff7bdb3dc03bb212612f6f
2025-09-16 20:56:16 -04:00
James D. Smith
d86240cf91 APEv2: AA: Fix a couple of bugs.
Change-Id: I1345d53f904d9c529dd6e2a7875dab97ffc9c2f3
2025-09-16 20:29:32 -04:00
Solomon Peachy
5c38669476 fat: Fix warning with fat_file_sector_size with (MAX_VARIABLE_LOG_SECTOR && HAVE_MULTIVOLUME)
Change-Id: I9bc7206b8121645688f5901ab448eba4077cba92
2025-09-16 16:50:32 -04:00
Solomon Peachy
9644bb5d9d ipod6g: CE-ATA uses a 4K block size at minimum
Therefore, turn on MAX_VARIABLE_LOG_SECTOR so we can support 512B and 4K
sector sizes.  Additionally, correct the interpretation of identify info
word 106 in CE-ATA mode.

Change-Id: I24dc7dd4a8617fcb60ed87c0c1be98d00dbdfa30
2025-09-16 15:12:16 -04:00
Solomon Peachy
4960a3b753 ipod: Turn on SMART support for all PP502x-based iPods
Unless you've modded the device with modern CF or mSATA storage, it's
not likely to achieve anything.  the original hard drives (supposedly)
lack SMART support, and none of the SD adapters bother to emulate it.

Change-Id: Id3cbe717c64947faf4b23d8c84a04b822cfb35da
2025-09-16 10:59:57 -04:00
Solomon Peachy
c307fd5525 ata: Parameterize the SMART query, add support to primary ATA driver
There are numerous sub-commands, this makes it possible to call the others.

Also in this patch is the ability for the "default" ATA driver to
query smart data too

Change-Id: Ie3aaf9e0b2d7a5d25d09dea34e4f10ee29047e1b
2025-09-16 09:52:05 -04:00
Solomon Peachy
e09829a71d debug: Log if SMART is supported in the debug menu
This is the first step towards enabling this feature for all ATA
devices.

Only the ipod6g supports it out of the box with its stock storage device
but with the prevalence of flash/ssd mods of one sort or another, this
really should be determined at runtime.

Change-Id: Ie35d97fd857bec8213cd0a2ad80695e8bb04a2d6
2025-09-15 19:35:51 -04:00
Solomon Peachy
bb605c91a4 usb_storage: Support 12/16-byte ATA passthrough
This is an unofficial command that many USB<->ATA chipsets support,
allowing direct passthrough of ATA commands to the device.

We don't pass things through as-is; instead we only intercept and handle
requests for IDENFITY INFO and SMART.  Everything else will return an
error.

Change-Id: I3bbb76990e5f6f0512f6eb42825fa505475b2ecd
2025-09-15 18:04:11 -04:00
Solomon Peachy
14157860b9 rgnano: Shrink CODEC and PLUGIN buffer sizes to reasonable sizes
(From 4MB->2MB and 8MB->2MB, respectively)

This is a hosted platform with a decent amount of free RAM; however
plugins and codecs are dlopen() which doesn't count against those
buffers.  Furthermore, the rgnano uses musl libc which does NOT
implement dlclose() so plugins, codecs, etc stick around in RAM
indefinitely even if they are never used again.

By shrinking these buffers we free up a bit more headroom for dlopen()
to leak, and for the host OS to provide disk caches and whatnot.

Change-Id: Ie657bd3b9fc8bd2a1f4bbc07debe3b10538c41c3
2025-09-13 08:44:38 -04:00
Solomon Peachy
c14ea0e01e samsung ypr0/r1: Shrink audio buffer from 31 to 23MB.
This frees up some headroom in the OS for things like dlopen() and
more effective disk caches.

Change-Id: I8b8dca65ad70adecfcbe674129c294e5ab3b21bb
2025-09-13 08:44:38 -04:00
Solomon Peachy
19ee9363d1 ibasso: Rejigger RAM and buffer sizes a little
Shrink audio buffer from ~256MB to ~192MB.  Increase plugin buffer size
to 2MB, not that it should matter given how much extra RAM this platform has.

This leaves plenty of room for the base OS to do what it needs to do.

Change-Id: I59ca235b9cf80cf86d406e4a144fee7d7784ed5d
2025-09-13 08:44:38 -04:00
Solomon Peachy
b497e71708 hibylinux: Shrink PLUGIN_BUFFER to 512K
Hosted platforms use dlopen() for plugin loading, and hibylinux is
relatively RAM constrained, so shrink this will free up more memory to
the OS for plugins to use.

Change-Id: I6b7cb17b964eaf5afc4958db242dfe4b82178e2e
2025-09-13 08:44:38 -04:00
Solomon Peachy
32d52e0415 hosted: Shrink audiobuffer to (MEMORY_SIZE-1) megabytes
This represents a 256K increase from the former (MEMORYSIZE-0.75), and
is necessary due to the growth in our binary sizes over the past decade
or so.

It is debatable if this is enough given that our actual memory
usage is approximately (MEMORYSIZE+3) megabytes (plus runtime OS
overhead) for the typical hosted build, but giving the host OS a bit
more breathing room is warranted.

Change-Id: I53e044585a32efd50a85e68d64fd21921eda01a3
2025-09-12 23:15:11 -04:00
Solomon Peachy
161f8c0e24 configure: Document the 'memory' parameter for hosted builds
Change-Id: I49979cf20fd5405bbb90dff297f5e695e046f2b9
2025-09-12 20:50:17 -04:00
Solomon Peachy
a2c10f6189 unicode: Support characters beyond the first unicode plane
We used 16-bit variables to store the 'character code' everywhere but
this won't let us represent anything beyond U+FFFF.

This patch changes those variables to a custom type that can be 32 or 16
bits depending on the build, and adjusts numerous internal APIs and
datastructures to match.  This includes:

 * utf8decode() and friends
 * font manipulation, caching, rendering, and generation
 * on-screen keyboard
 * FAT filesystem (parsing and generating utf16 LFNs)
 * WIN32 simulator platform code

Note that this patch doesn't _enable_ >16bit unicode support; a followup
patch will turn that on for appropriate targets.

Appears to work on:

  * hosted linux, native, linux simulator in both 16/32-bit modes.

Needs testing on:

  * windows and macos simulator (16bit+32bit)

Change-Id: Iba111b27d2433019b6bff937cf1ebd2c4353a0e8
2025-09-12 09:24:30 -04:00
Hairo R. Carela
2a88253426 rbutil: add qt version check for setIniCodec
QSettings::setIniCodec was deprecated in qt6, this fixes building with it.
Change-Id: Icd2ac05bb0a9f56181823a25a9307ac791664d88
2025-09-11 21:39:52 -04:00
Christian Soffke
fe038d5d4b manual: album art tag: fix width/height mixup
Change-Id: Ied765faba5256dc383fbd5a133fc58e2317bdda4
2025-09-10 22:30:03 +02:00
Solomon Peachy
471624a75d DSP: put filter_process() into IRAM on all PP50xx CPUs
(Instead of just the slowest 500x family)

Change-Id: I39229d8765ff8c07da115e71909a60546597f603
2025-09-10 08:21:23 -04:00
Solomon Peachy
c6db7114f8 as3525: Fix build warning with newer toolchains
Change-Id: I3dad32caf0dc087b717ed76b900f414aa1608bc2
2025-09-09 10:03:22 -04:00
Solomon Peachy
01a62372ff flac: Fix build on Cowon D2.
Not enough IRAM on this target to support larger MAX_BLOCKSIZE even with
only 2ch.

Change-Id: I91675b9eb294f8af3f7d17aa9c76c7cb83ce0bd7
2025-09-09 08:09:45 -04:00
Christian Soffke
c5e5a537c0 shortcuts: respect talk_menu setting when deleting shortcut
Change-Id: I6f06db5a41c402eeb3703a25c5d51fd0e4fe354f
2025-09-09 05:59:38 +02:00
Solomon Peachy
a98a8ce131 FLAC: Conditionally increase MAX_BLOCKSIZE to 8KB
High-frequency files increasingly use a block size of over 4608B, which
means we need larger buffers to decode them.  However, larger buffers no
longer fit in IRAM on less-capable devices, hurting performance for
"normal" file playback.

On our slowest devices (M68K and PP-based devices), this is not worth
the tradeoff as they will likely not have enough CPU oomph to decode and
downmix these files in realtime.

S5L87xx-based devices have the raw performance to do this, so we decided
to err on the side of wider file compatibility at the cost of some
performance.

All other devices are unaffected.

Change-Id: I7344cf4c8c6b7b5c14f1ea67381160665d6ece5b
2025-09-08 22:51:46 -04:00
Christian Soffke
ebe961a2a8 plugins: playing time: fix possible stack overflow
Change-Id: Ieb38e84e8c4126741d4630de3594fd16a360d1ed
2025-09-09 02:29:49 +02:00
Solomon Peachy
eb03c7b4d0 build: Newer toolchains need a few tweaks to linker options.
Pull those fixes in now

Change-Id: I71c373ecc9d062ca997eb940c7d84a94e2d678aa
2025-09-07 15:40:44 -04:00
Solomon Peachy
e9b8413f49 Revert "Toolchains: Update to GCC 10.5.0"
I pushed the wrong working tree AGAIN

This reverts commit b92033f716.
2025-09-07 15:22:31 -04:00
Solomon Peachy
2c0bcc0be9 xrick: finally fix the red.
Change-Id: I1e0b4e2d77c8988a286051d391d99aeb7907f9c4
2025-09-07 15:21:59 -04:00
Solomon Peachy
b92033f716 Toolchains: Update to GCC 10.5.0
All toolchain dependencies are circa the GCC 10.5.0 release:

  GCC 10.5.0, binutils 2.40, gmp 6.2.1, mpfr 4.1.1, mpc 1.3.1, isl 0.24

Native:

 * arm - mini2g, nano2g works
       - ipod6g hangs at logo display
 * mips - xduoox3 works
 * m68k - binaries untested

Hosted:

 * arm - samsungypr0 works
 * mips - xduoox3ii works
 * Android NDK - unchanged at GCC 4.9.4

Change-Id: Ic157255d76030e66325719e64331f553cb7c4363
2025-09-07 15:11:52 -04:00
Solomon Peachy
5953569ce5 xrick: Fix up a questionable choice of include paths
Change-Id: I60589f2151270349176d10505c3d75ab00fff9d4
2025-09-07 15:11:52 -04:00
Solomon Peachy
79582121ea xrick: Fix Makefile construct that made xrick includes global
Change-Id: Iac8e3c0ff4bba6d5da70042fd47a23392f3133bf
2025-09-07 13:40:41 -04:00
Solomon Peachy
3f71709152 s5l77xx: Correct definitions of VICADDRESS(n) and AESINADDR
By switching them from (const void* volatile*) to (void* volatile*)

The 'const' bit was causing GCC>4 to optimize away writes to those
addresses when compiled with -Os, badly breaking the interrupt handler.

Change-Id: Ia4b0ca37e082bddf78e084b80a5e550894645f1a
2025-09-07 10:02:40 -04:00
Solomon Peachy
da02b5921f s5l8702: Clean up the IRQ handler code slightly
* move all state into IRAM
 * eliminate dummy variables
 * get rid of 'naked' attribute and (slightly wasteful) hand-written asm
   in favor of auto-created 'interrupt' code

Change-Id: Ie6a2e12a4c1a0faa6ae89504cf931657044bd457
2025-09-07 09:59:45 -04:00
Solomon Peachy
fb8b52eaf1 s5l8702: CONSTify the clocking setup
Change-Id: I88f7a2e176606b718d778a5a4a5756c4c4b58c03
2025-09-07 09:11:11 -04:00
Solomon Peachy
afa096e8b9 misc: More fallthrough annotations
Change-Id: Iec45e339005de79535f11d15e77e60ee1e53a5f9
2025-09-07 08:06:56 -04:00
Christian Soffke
978a486d87 plugins: pictureflow: adjust PF_TRACKLIST behavior
Clarifies presumably intentional fall-through for
PF_TRACKLIST and fixes unwanted behavior of
PF_TRACKLIST while scrolling, which may have
started playback instead of showing the track list.

(affected keymaps at the moment are only SANSA_FUZE_PAD,
SAMSUNG_YH820_PAD, SAMSUNG_YH92X_PAD, and FIIO_M3K_PAD)

Change-Id: I335dd1b4a2152caed966b73aaa189bcfddc79734
2025-09-07 04:57:43 +02:00
Solomon Peachy
34f34bb7f1 misc: Fix a small pile of warnings found with diagnostics turned way up
* possible null pointer dereferences
 * non-annotated fallthroughs in case statements

Change-Id: I2332e0e0a4203ceca0999291ead112b8ab94c613
2025-09-06 21:31:58 -04:00
Solomon Peachy
d51d49550c FS13585: Display corruption in robotfindskitten game
When you're using a "large" screen device, and the message doesn't need
to scroll, parts of the previous mesage are left behind.

Work around this by explicitly clearing the messgage with a loooong
blank string.

Change-Id: I02f7789eb6567e92ecca174c40dabc4b580ac045
2025-09-06 12:44:11 -04:00
Solomon Peachy
e4e50e36f1 rbcodec: Force use of -O2 for dsp code
We already use targeted optimization for most codecs, and the
DSP code is just as performance-sensitive.

Improves mp3 decoding performance by a whopping 1% wwhen PBE is
turned on.

Change-Id: I801a6624c0f7068b6cd67961ad3b08f809b92fca
2025-09-06 08:44:32 -04:00
Solomon Peachy
4de25f7020 font: glpyh_cache_load() is now NO_INLINE
It is particularly stack-heavy (>1.25K, >2.25K with 32-bit unicode)

Its only caller was font_load_ex() but that can be called recursively
which _really_ blew up the stack.

Change-Id: I211cd33ca3478b2bd01d3ddcf6c890399af2fb9c
2025-09-05 20:02:46 -04:00
Solomon Peachy
16c9ef64b0 misc: Ensure stacks are always aligned with the native pointer size.
Change-Id: Ie7efae914dcb43be98bbb71bae9b765b2d87d817
2025-09-05 19:43:11 -04:00
Solomon Peachy
695698b918 SID: Don't uselessly upconvert from 16bpp mono to 28bpp stereo
cRSID natively renders its output as a 16bit mono stream.  There's no
reason to not use it as-is, and save a bunch of CPU cycles in the
process.

Change-Id: Ib934c05e77298e377053b29db91d1f05fb65eb76
2025-09-02 20:19:22 -04:00
Solomon Peachy
6f7dbc2153 FS#13661: Major Spanish translation update (Sergio Delgado)
* Added some missing strings and updated some others that made no sense
   (were literal/poor translations).
 * More usage of music-relevant terms.
 * This translation fits a standard-internationally spoken Spanish,
   supported with the use of DLE (Spanish language dictionary) of RAE
   (Real Spanish Academmy)

Change-Id: Ie891520bcafe1e880e25dd42ce81393b1f10840d
2025-08-31 21:31:04 -04:00