Commit graph

37578 commits

Author SHA1 Message Date
William Wilgus
8bf6dc521f filetypes.c compress builtin filetypes
the builtin audio filetypes all use an int to signal (FILE_ATTR_AUDIO)
it takes less space to give them their own array and apply the attrib at runtime

bit of const correctness and some other small cleanup

Change-Id: I1cc3de9fe4ec1d5e49c8154cffdef3f05cf0b235
2024-11-19 07:12:41 -05:00
Christian Soffke
75282a1683 Playlist Viewer: Remove forward declarations
Change-Id: I16faf5e43001e139fc8affc942ee8dbf49f99bb1
2024-11-18 06:15:18 +01:00
Vencislav Atanasov
38df1ff311 Fix target order and formatting in case block
Added Creative Zen V (95) to the list, since it was missing.

Change-Id: I2f0115835db82d1bedba3ccc97bcb405af3d1dd9
2024-11-16 22:12:22 -05:00
Vencislav Atanasov
1451fa2cbb Reorder targets by number
Change-Id: I9c437fbb0949c18251b2b9cfea04e9e82ebecdb4
2024-11-16 21:48:15 -05:00
Christian Soffke
78bea2a7ac playlist: Remove playlist_get_required_bufsz
Change-Id: I00cf26a2502f1b31cab8d896bf8eb1ae2626020a
2024-11-16 12:18:03 -05:00
Christian Soffke
953fcef05e gui: Fix unsuccesful attempt at loading default viewer iconset
The default viewer icons file seems to have
been removed in the rewrite of buildzip.pl
(see commit 66b6fdb).

So, this only worked accidentally, once some
theme put a viewers.bmp file in the icons folder,
potentially leading to confusing behavior.

Deactivating viewer icons (instead of reverting
to some default file) when they are set to "-"
is probably expected behavior at this point.

Change-Id: I5010764676c67592bf20abfb3d0780edb1d555d4
2024-11-16 12:14:00 -05:00
Christian Soffke
ff2f9123f6 gui: splash(-progress): use theme colors, +1px spacing
Change-Id: I5867b1fd3086bda2973f75a3ad1c1223e22dc0ae
2024-11-16 18:10:37 +01:00
Solomon Peachy
15a4eb0422 debug: Correct most of the sector_t printf()s
The 'll' printf modifier is currently broken.  Fortunately all but
one of the uses is printing MB instead of bytes, which means we can
cast the value to a 'unsigned long' without risk of overflow/wraps.

...There's one remaining use ('%llx') which still needs to be sorted
out.

Change-Id: I89f406f6c085be153531d1ec1f2a314ae172b129
2024-11-15 07:28:55 -05:00
Solomon Peachy
9bf033dd66 ata: Prefer using "virtual" sector size where possible
Normally, if a device uses larger physical sector size than the logical
size and supports so-called "512e" mode, we let the device deal with
partial sector reads/writes.

However, if MAX_VIRT_SECTOR_SIZE is defined, we support
partitioning/filesystems that use a larger "virtual" sector than the
logical sector.  typically this matches the physical sector size of the
drive, which means that despite a small logical sector size, all I/O
is done in terms of the physical sector size.

Therefore, when MAX_VIRT_SECTOR_SIZE and MAX_PHYS_SECTOR_SIZE are
enabled (currently only ipod5g and ipod6g), prefer software-based
partial sector I/O.

Change-Id: I0815ad0a2f987b89bb2debfbf3d0ed64cdf85525
2024-11-15 07:24:08 -05:00
Solomon Peachy
120906dc8b ata: Ensure that the bounce buffer is minimum 32-bit aligned
Basically, if STORAGE_ALIGN_ATTR isn't defined, define it to be
sizeof(uint32_t) in the ATA code.

Change-Id: I13de61788cb71e3e8d3a956ab5f2e251471ce76d
2024-11-15 07:24:08 -05:00
Solomon Peachy
d36ef610c2 x1000: fix yellow in prior commit
Change-Id: I5809fab0148d4869cdc86212e8386590090d4320
2024-11-13 19:58:48 -05:00
Dana Conrad
1fb906500a x1000: LCD DMA fix
Credit ZappBranigan2972 on the forums

Change-Id: Ia4d498d215d8f365156f15965b715832202bec8a
2024-11-13 18:26:30 -05:00
Solomon Peachy
d0aaa37d33 ata: Panic if we get a drive with unaligned logical sectors.
If identify device word 209 is valid, check to see if the drive report
on the alignment of LBA0 with respect to physical sector 0.

If it's not aligned, bail immediately.  Supporting this properly
won't be hard, but it's not someting we want to do unless necessary.

Change-Id: I3d5bb8fad9e32fff43dfb6454393728d7c01b93b
2024-11-13 07:27:56 -05:00
Solomon Peachy
044ba60bcf ATA: Add some more logf debugging
Change-Id: If1f919c43d02a974e478018750c60e3619db1505
2024-11-12 08:11:18 -05:00
Solomon Peachy
461704f803 misc: Fix some compile warnings when logf is enabled
Change-Id: I67b611cbbbe33113853f36da5047ba799f1dda5d
2024-11-12 08:11:18 -05:00
Solomon Peachy
3d1dcebebb ipod6g: Wrap more DMA functionality with HAVE_ATA_DMA
No functional change.

We always have it turned in for ipod6g, but this makes some of the
flow/logic easier to follow.

Change-Id: I3abeace4f70afb197e819e0944e0e76f4edc4800
2024-11-12 08:11:18 -05:00
Christian Soffke
cb7b6fd572 skin parser: Fix crash that can occur when same bmp is loaded multiple times
img may have already been loaded, in which case
bm.data will intentionally have been set to NULL
(see NOTE in load_skin_bmp)

Also see commit 01cbb79 and previous fix 35f9a5b

Change-Id: I581ed63836f30a6b669b3d1fd5886fc1b3664386
2024-11-12 13:39:19 +01:00
Christian Soffke
8e2b11cd3c pugins: PictureFlow: Fix album not found
Each artist name is only stored once, regardless of case,
so we have to perform a case-insensitive comparison with
the current artist.

Change-Id: I571c0e49c032a6d5c64f6e3289513ba7fe279cb8
2024-11-12 01:57:42 -05:00
Christian Soffke
9b20f59ac6 plugins: Simple Viewer: Exit when pressing Select, or (on iPods) Menu/Left
Change-Id: I63d9c90f30783115f9fad70dae1818ad90ba79dd
2024-11-12 07:55:48 +01:00
Solomon Peachy
d6e2b5d3cf Enable use of ATA DMA on Philips GoGear HDD1630 and HDD6630
These are PP502x-based devices shipped with ATA drives.  However,
PIO is flaky when used with the various ATA/CF<->SD adapters, so
turn it in across the board.

Change-Id: I65384d95e2e4498eb03f43ac990b01e0c6d060c5
2024-11-11 16:29:56 -05:00
Solomon Peachy
a4fe20a278 filestr_cache: Some more 64-bit sector_t fixes
This isn't strictly needed for FAT32, but the core file cache code
needs to be able to reference >32bit sector addresses.

Change-Id: I57838f1228c1d45f6a8c4755c5d1f9063c13b3dd
2024-11-11 10:38:58 -05:00
Christian Soffke
c67294913f Fix get_token_value from 7288d9e
Change-Id: I3d1b2fc37c0baa1cb178215889bf91808ba4287f
2024-11-11 08:21:12 +01:00
William Wilgus
27c5db15e3 [Fix Red] #3 cfg_vals missing brace
Change-Id: I76ce21f5109d7ce3ca0d04dcf8f226a3f468ee8c
2024-11-10 23:59:40 -05:00
William Wilgus
4c34e150f7 [Fix Red] #2 7288d9e Move cfg_vals from settings_list
agc settings..

Change-Id: I695c9c8300fb5d4a544b12e3185dfec39cf7fbbc
2024-11-10 22:59:31 -05:00
William Wilgus
9baadd4a95 [Fix Red] 7288d9e Move cfg_vals from settings_list, expand settings_dumper
Change-Id: Ic1dc9eb46b5eed8adc1888e8b7e58d45f4f1c57a
2024-11-10 22:30:30 -05:00
William Wilgus
7288d9e5d2 Move cfg_vals from settings_list, expand settings_dumper
cfg_vals aren't needed for most settings

F_TABLE_SETTING, F_CHOICE_SETTING, F_BOOL_SETTING

can use cfg_vals but only a few custom settings use it otherwise
for these settings we define F_HAS_CFGVALS and use the setting union instead (as these all use UNUSED)

noticed that settings_dumper missed most cfg values so didn't show text setting values

saves ~300 bytes

Change-Id: Ie504c8cfe2a6cf471117c3afe5cf9a770a7f1784
2024-11-10 21:53:22 -05:00
Solomon Peachy
3e95b13b7a ata: Fix yellow in some bootloaders, introduced in c61ad40812
Change-Id: I0058fd5339e27505b6f8e4533fda07a1352a5329
2024-11-09 18:07:14 -05:00
Solomon Peachy
c8e1da8e90 ipod5g/6g: support DEFAULT_VIRT_SECTOR_SIZE
This way if there's no valid partition/filesystem we still report the
"correct" sector size out via USB.

Update the ipod5g/6g bootloaders so they do the right thing too.

Change-Id: I0d93ae7e6664f1591d8edf1c0252c586e329cd4b
2024-11-09 17:48:09 -05:00
Solomon Peachy
1516c48a37 storage: Support a default virtual sector size
Normally, we figure out the virual sector size from the filesystem info.
However, if there's no filesystem, we fall back to the hardware's
logical sector size.

Some device firmware (eg ipod5g/6g) need their partition tables set up
with larger-than-logical sector sizes; this way we can present the
"correct" sector size to maintain interoperability with the stock
firmware and make it so that the drive can still be properly partitioned
from within rockbox.

This patch adds support for DEFAULT_VIRT_SECTOR_SIZE.  Nothing uses it yet.

Change-Id: Iae746a50ffc37c51abb2c9b82d3c4596f1fa7559
2024-11-09 17:48:00 -05:00
Solomon Peachy
c61ad40812 storage: Wrap runtime variable sector size with MAX_VARIABLE_LOG_SECTOR
When enabled this allows 512n and 4Kn drives to be used with a single build.
(So far all ATA SSDs use 512 byte logical sectors)

Change-Id: I902d2318ca8abb581699c0bca68d6e3ec227d064
2024-11-09 16:34:06 -05:00
Solomon Peachy
bc6c189dcb storage: rename MAX_LOG_SECTOR_SIZE to MAX_VIRT_SECTOR_SIZE
Change-Id: I34f00748c1b0935d65af5f0fc6bdd13356ff31e1
2024-11-09 16:32:40 -05:00
Solomon Peachy
7ecab006c0 fat: Allow use of variable logical sector sizes
Only used if MAX_LOG_SECTOR_SIZE is defined

This allows a single build to seamlessly work with (eg) 512B or 4K sectors.

Change-Id: I85d2a6612afca6a1d7a3bd49c588b5745ab2b220
2024-11-09 16:32:40 -05:00
Roman Artiukhin
e519356c47 plugin: don't start plugin when another non-tsr plugin is running
Change-Id: Ie5fc8220e5d586a5493992719c55e9d2f235b090
2024-11-09 04:26:15 -05:00
Christian Soffke
eb91595988 fileop: display progress bar for single file deletion
Change-Id: Id895eb270b8ce1ad483c508c98d6318ba6069cf0
2024-11-09 04:25:48 -05:00
Solomon Peachy
42b63daebb ipod6g: Swap STORAGE_NEEDS_BOUNCE_BUFFER for STORAGE_WANTS_ALIGN
Change-Id: Ie34ffe0e022c8416ec9b2d4c39733a15c205eb3d
2024-11-07 21:08:15 -05:00
Solomon Peachy
3664d382e0 ata: if drive doesn't advertise a nonstandard sector size, default to 512
...Instead of SECTOR_SIZE, which might be different.  This way
we can properly validate the value.

Change-Id: I8e6ae5882792f301ac580a144556af94772f4cfe
2024-11-07 18:15:26 -05:00
Solomon Peachy
9dd2781b87 ipod6g: Use storage bounce buffer for ipod6g
Change-Id: I987357bd6795b988802997f92b6d64f36cd24f43
2024-11-07 16:44:25 -05:00
Christian Soffke
0386469794 Fix incorrect UI font id in some plugins
see commit f19f3ef

Change-Id: I417929eaa9303d439725fb4f0c20d104de54f8b0
2024-11-07 17:45:09 +01:00
Roman Artiukhin
ee365f21c4 show track info: skip Comment and codec string copies
Comment copy was added in c647e62c as workaround for FS#11033 and no longer needed (I tested really long lines and scroll no longer throw any errors on my Sansa e200v2)

Change-Id: I96a5b26096829034692dffc2abc730ff2bdd5d9c
2024-11-07 07:59:52 -05:00
Roman Artiukhin
da478aaa32 metadata: mp3: Simplify comment tag processing
Avoid unnecessary string comparison.

Change-Id: Ib1c5622f7b7760c43c4763930dc4ef6b409dbc05
2024-11-07 07:53:41 -05:00
Roman Artiukhin
2156d9874f metadata: mp3: Improve support for long tags
Increase buffer size by 368 bytes by using id3v1buf.
Limit tag size only if metadata fails to fit without limitation.

Change-Id: I82d551ac75c2e8fcb9ff0ef318445e0e6a1f8148
2024-11-07 07:53:08 -05:00
Solomon Peachy
9e70991174 disk: Simplify LOG_SECTOR_SIZE() definition
Change-Id: I49cca4fe5e92f7b443427c2b8e95bae8955b9ea0
2024-11-07 07:51:14 -05:00
Solomon Peachy
f58fad943e diskcache: Size the buffers for MAX_LOG_SECTOR_SIZE
Because if we get a logical sector size > min sector size
we'll trigger buffer overflows.

Change-Id: Ibd24f91a0f8601fbd8c5a5dfeef4ebe5c081f664
2024-11-07 07:49:17 -05:00
Solomon Peachy
e29ddfb6be ata: Support for ATA logical sector sizes > 512B
Basically this requires un-hardcoding SECTOR_SIZE everywhere, in
favor of using a variable containing what was reported in IDENTIFY INFO.

Note that the rest of the storage subsystem still needs to be fixed up!

Change-Id: I7f2dbd54ff2bc16b15010721e011949cbf308e12
2024-11-07 07:48:17 -05:00
Solomon Peachy
c3d06d21df mikmod: Properly render with fonts larger than 6x8 pixels.
Change-Id: Ib3f8c2cf84e7b6565bb8a00b74e8a662b9980824
2024-11-06 20:18:45 -05:00
Solomon Peachy
10abb34e54 mikmod: Use current theme fonts, not the cut-down SYSFONT
Change-Id: Ia5fff04b22fbad1081fcca6c66bbb7ea7f82fef8
2024-11-06 15:18:33 -05:00
Solomon Peachy
d1ffaa8949 convbdf: Properly support a compiled sysfont of over 64K.
The 'struct font' definition says:

    const void *offset;           /* offsets into bitmap data,
                                     uint16_t if bits_size < 0xFFDB else uint32_t*/

However convbdf was unconditionally using 'unsigned short' without
checking bits_size. This generated a bogus table if used with an
uncapped SYSFONT due to offeset overflows.  And a pile of complier
warnings.

That said, we're still capping SYSFONT at 255 chars due to space
constraints -- 14-Rockbox-mix jumps from 2.6K to 1022K if left
uncapped.  Yowza.

Change-Id: I4577da08ab1633ab7abbc167523196f38c8a348a
2024-11-06 09:40:06 -05:00
Solomon Peachy
000a575d13 storage: Make ramdisk use the global SECTOR_SIZE definition
Change-Id: I0c2fe75ea425107f1cd64acf42ff8c00cee07456
2024-11-04 21:10:51 -05:00
Solomon Peachy
2824bd5f16 ipod6g: Support MAX_PHYS_SECTOR_SIZE of 4K
This lets us *natively* handle varying physical sector sizes
without playing games and lying about the logical sector size.

(The original drives use 4K _physical_ sectors with 512B logical
 sectors, but you have to access everything in 4K blocks...)

Achieve this by splitting the MAX_PHYS_SECTOR_SIZE code out
of the main ATA driver and re-using it.

Change-Id: I0bc615ab4562f1e3e83171a8633c74fb60c7da1f
2024-11-04 07:33:26 -05:00
William Wilgus
d60dee6188 tagtree cleanup first letter menu code
no functional difference just some code shared and trimming of
unnecessary format strings

Change-Id: Ia6165508556790ea825e630a79946fbd2dafd9c1
2024-11-03 13:59:29 -05:00