Compare commits

...

6 commits

Author SHA1 Message Date
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
4 changed files with 317 additions and 294 deletions

File diff suppressed because it is too large Load diff

View file

@ -34,12 +34,20 @@
/* Each diac_range_ struct defines a Unicode range that begins with
* N diacritic characters, and continues with non-diacritic characters up to the
* base of the next item in the array, [info] packs RTL status and the count of
* diacritic chars after [base]. RTL occupies the MSB and CNT the (7) lower bits
* diacritic chars after [base]. RTL occupies the MSB and CNT the remaining bits
*/
#ifdef UNICODE32
//#define DIAC_UCSCHAR
#endif
struct diac_range
{
uint16_t base; /* Not ucschar_t until we need >16b */
#if defined(DIAC_UCSCHAR)
ucschar_t base;
#else
uint16_t base;
#endif
uint16_t info; /* [RTL:1 CNT:15] */
};
@ -192,7 +200,13 @@ static const struct diac_range diac_ranges[] =
DIAC_RANGE_ENTRY(0xfe20, 0xfe30, 0), /* v1.0 - v8.0 */
DIAC_RANGE_ENTRY(0xfe70, 0xfe70, 1),
DIAC_RANGE_ENTRY(0xff00, 0xff00, 0),
/* Final entry is a terminator */
#if defined(UNICODE32) && defined(DIAC_UCSCHAR)
DIAC_RANGE_ENTRY(0x010efa, 0x010f00, 1), /* v15.0 - v17.0 */
DIAC_RANGE_ENTRY(0x10ffff, 0xffff, 0),
#else
DIAC_RANGE_ENTRY(0xffff, 0xffff, 0),
#endif
};
#define MRU_MAX_LEN 32
@ -203,9 +217,15 @@ bool is_diacritic(const ucschar_t char_code, bool *is_rtl)
static uint8_t diacritic_mru[MRU_MAX_LEN];
uint8_t i, itmp;
uint8_t info, mru;
uint8_t mru;
uint16_t info;
const struct diac_range *diac;
const struct diac_range *diac = &diac_ranges[DIAC_NUM_RANGES - 1];
/* If the codepoint exceeds the terminating entry in our table
then treat it as non-diacritic. */
if (char_code >= diac->base)
goto bypass;
/* Search in MRU */
for (mru = 0, i = 0; mru < mru_len; mru++)
@ -244,13 +264,15 @@ Found:
diacritic_mru[0] = i;
diac = &diac_ranges[i];
bypass:
info = diac->info;
/* Update RTL */
if (is_rtl)
*is_rtl = ((DIAC_RTL & info) == DIAC_RTL);
return (char_code < (diac->base + (info & DIAC_CNT)));
return char_code < (uint32_t)(diac->base + (info & DIAC_CNT));
}
#else /*BOOTLOADER*/
inline bool is_diacritic(const ucschar_t char_code, bool *is_rtl)

View file

@ -22,6 +22,9 @@
/* define this if you have a colour LCD */
#define HAVE_LCD_COLOR
/* Define this if the LCD can shut down */
#define HAVE_LCD_SHUTDOWN
/* define this if you want album art for this target */
#define HAVE_ALBUMART

View file

@ -154,7 +154,6 @@ static ICODE_ATTR int ata_wait_intrq(void)
if (IDE0_CFG & IDE_CFG_INTRQ)
return 1;
ata_keep_active();
yield();
} while (TIME_BEFORE(current_tick, timeout));
return 0; /* timeout */