mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-05-12 11:43:16 -04:00
Compare commits
6 commits
86f5665cd0
...
aa834e83aa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa834e83aa | ||
|
|
e13befb925 | ||
|
|
f68bfadb56 | ||
|
|
9605b453da | ||
|
|
a2b754d829 | ||
|
|
c72ffa7a9a |
4 changed files with 317 additions and 294 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -34,12 +34,20 @@
|
||||||
/* Each diac_range_ struct defines a Unicode range that begins with
|
/* Each diac_range_ struct defines a Unicode range that begins with
|
||||||
* N diacritic characters, and continues with non-diacritic characters up to the
|
* 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
|
* 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
|
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] */
|
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(0xfe20, 0xfe30, 0), /* v1.0 - v8.0 */
|
||||||
DIAC_RANGE_ENTRY(0xfe70, 0xfe70, 1),
|
DIAC_RANGE_ENTRY(0xfe70, 0xfe70, 1),
|
||||||
DIAC_RANGE_ENTRY(0xff00, 0xff00, 0),
|
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),
|
DIAC_RANGE_ENTRY(0xffff, 0xffff, 0),
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MRU_MAX_LEN 32
|
#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];
|
static uint8_t diacritic_mru[MRU_MAX_LEN];
|
||||||
|
|
||||||
uint8_t i, itmp;
|
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 */
|
/* Search in MRU */
|
||||||
for (mru = 0, i = 0; mru < mru_len; mru++)
|
for (mru = 0, i = 0; mru < mru_len; mru++)
|
||||||
|
|
@ -244,13 +264,15 @@ Found:
|
||||||
diacritic_mru[0] = i;
|
diacritic_mru[0] = i;
|
||||||
|
|
||||||
diac = &diac_ranges[i];
|
diac = &diac_ranges[i];
|
||||||
|
|
||||||
|
bypass:
|
||||||
info = diac->info;
|
info = diac->info;
|
||||||
|
|
||||||
/* Update RTL */
|
/* Update RTL */
|
||||||
if (is_rtl)
|
if (is_rtl)
|
||||||
*is_rtl = ((DIAC_RTL & info) == DIAC_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*/
|
#else /*BOOTLOADER*/
|
||||||
inline bool is_diacritic(const ucschar_t char_code, bool *is_rtl)
|
inline bool is_diacritic(const ucschar_t char_code, bool *is_rtl)
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@
|
||||||
/* define this if you have a colour LCD */
|
/* define this if you have a colour LCD */
|
||||||
#define HAVE_LCD_COLOR
|
#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 this if you want album art for this target */
|
||||||
#define HAVE_ALBUMART
|
#define HAVE_ALBUMART
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,6 @@ static ICODE_ATTR int ata_wait_intrq(void)
|
||||||
if (IDE0_CFG & IDE_CFG_INTRQ)
|
if (IDE0_CFG & IDE_CFG_INTRQ)
|
||||||
return 1;
|
return 1;
|
||||||
ata_keep_active();
|
ata_keep_active();
|
||||||
yield();
|
|
||||||
} while (TIME_BEFORE(current_tick, timeout));
|
} while (TIME_BEFORE(current_tick, timeout));
|
||||||
|
|
||||||
return 0; /* timeout */
|
return 0; /* timeout */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue