Commit Graph

267 Commits

Author SHA1 Message Date
Thomas Martitz 706e6b7a75 Move VOL_NAMES definition to mv.h
Fits better and including dir.h is more messy for some places.

Change-Id: I3ec30dcc1ac2734ad3844c903238b6cc2f4e134c
2014-02-23 20:23:51 +01:00
Lorenzo Miori e876f4df6d Samsung YP-R1 target port
This is the basic port to the new target Samsung
YP-R1, which runs on a similar platform as YP-R0.
Port is usable, although there are still
some optimizations that have to be done.

Change-Id: If83a8e386369e413581753780c159026d9e41f04
2014-02-05 09:56:21 +01:00
Thomas Martitz 4ce39f7e73 buflib: Add a define telling the per-alloc overhead.
This allows buflib clients to more accurately estimate the total memory usage.
It's still not 100% accurate because the handle table grows in blocks, thus
buflib might use more memory that caused by allocations directly.

Change-Id: I68338bb94f510ad188fcb588aebf895b5f9197c5
2014-02-02 19:40:38 +01:00
Thomas Martitz 4ce1deacfd buflib: Properly support allocations without any name, to avoid wasting space
in micro-allocation scenarios.

Change-Id: I97a065bcfba8e0fda9b1670445e839e267c769c8
2014-02-02 19:40:38 +01:00
Thomas Martitz d66346789c buflib: Check the validity of of handles passed to buflib_get_data() in DEBUG builds.
Change-Id: Ic274bfb4a8e1a1a10f9a54186b9173dbc0faa4c8
2014-02-02 16:59:29 +01:00
Marcin Bukat 7ab237b025 buflib: Add crc field protecting buflib cookie integrity
This should catch the case of buffer misuse which results
in corrupted cookie of next allocation. The check is performed
on move_block() so it may be a bit late.

There is buflib_check_valid() provided which checks the
integrity of all cookies for given context.
On DEBUG build with --sdl-thread this check is carried out
for core_ctx on every context switch to catch problems earlier.

Change-Id: I999d4576084592394e3dbd3bdf0f32935ff5f601
Reviewed-on: http://gerrit.rockbox.org/711
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2014-01-16 10:17:39 +01:00
Thomas Martitz c23ce62829 fonts: Do not unload completely on USB.
The font engine can now perform cache lookups even if the font file is
closed, if the font was disabled with the new font_disable_all() function.
It is highly probable that the lookup succeeds but in the cache-miss case
a blank, full-width glyph will be returned.

Change-Id: I3c97e747d2a0ba30c7b495c6118c9f029d265b56
2014-01-15 23:37:39 +01:00
Thomas Martitz 64b9e1fa7b buflib: Add buflib_context_relocate().
This function relocates a buflib back buffer, updating pointers in struct
buflib_context. It does not move any data by itself.

The intended use-case is buflib-on-buflib, where a buflib back buffer is
allocated with buflib and attempted to be moved. The move_callback() can call
this and return BUFLIB_CB_OK on success. No move_callback() is called for the
subordinate buflib buffer, therefore it must not contain non-movable
allocations. The caller is generally responsible moving the data and all its
implications.

Change-Id: I869219f9cff786a172c9e917a5f34470073892e6
2013-12-22 23:11:32 +01:00
Thomas Martitz d25a512caf buflib: Try harder in buflib_alloc_maximum().
This function will now ask shrinkable allocations to give up all of their
memory. With future support of playback.c this can be used as a safe
replacement for audio_get_buffer().

Change-Id: I290a51d2c75254e66baf5698c41dc444dea6247a
2013-12-22 23:11:32 +01:00
Thomas Martitz af4e408555 buflib: Change buflib_available() and add buflib_allocatable().
buflib_allocatable() is what buflib_available() was before (it was in fact
simply renamed). It returns the largest contiguous block of memory. This
can be allocated and will definitely succeed, although larger allocations
may also succeed if the buffer can be compacted and shrinked.

buflib_available() now counts all free bytes, contiguous or not. This
better matches the description and how the caller use it.

Change-Id: I511e4eb5f4cf1821d957b3f4ef8a685ce40fe289
Reviewed-on: http://gerrit.rockbox.org/481
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
2013-07-07 10:46:07 +02:00
Marcin Bukat 0b29691324 Move load_firmware() to separate file
The idea is to share loading code between bootloaders and rolo().

Change-Id: I1656ed91946d7a05cb7c9fa7a16793c3c862a5cd
Reviewed-on: http://gerrit.rockbox.org/190
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-06-27 13:50:11 +02:00
Michael Sevakis 95e23defb0 Make fixepoint.c as a shared library (libfixedpoint.a).
Change-Id: Icc10d6e85f890c432f191233a4d64e09f00be43d
Reviewed-on: http://gerrit.rockbox.org/456
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-04-26 00:11:04 +02:00
Michael Sevakis 0c7b787398 Straighten out the mad twisted state of sound.c and related areas.
This is going right in since it's long overdue. If anything is goofed,
drop me a line or just tweak it yourself if you know what's wrong. :-)

Make HW/SW codec interface more uniform when emulating HW functionality
on SWCODEC for functions such as "audiohw_set_pitch". The firmware-to-
DSP plumbing is in firmware/drivers/audiohw-swcodec.c. "sound_XXX"
APIs are all in sound.c with none in DSP code any longer.

Reduce number of settings definitions needed by each codec by providing
defaults for common ones like balance, channels and SW tone controls.

Remove need for separate SIM code and tables and add virtual codec header
for hosted targets.

Change-Id: I3f23702bca054fc9bda40f49824ce681bb7f777b
2013-04-15 12:02:05 -04:00
Michael Sevakis f49e750531 Move fixedpoint.h to be accessible in /firmware.
Will need it soon enough.

Combine the contents of all the various fixedpoint.h files.
Not moving fixedpoint.c for now since I'm not sure where it
should be and it causes some dependency issues.

Change-Id: Ideacbca2ca78f9158c2b114b113c274f68e908d5
2013-04-10 13:28:35 -04:00
Thomas Martitz efe73e143a Fix database tool.
It was also broken functionally, probably since a while.So restore the
functionality. Run it on the dap, the tcd files will be placed into .rockbox folder.

Change-Id: Id7a6ce4389dfaf99799258902be80d630af0601c
2012-07-31 10:33:27 +02:00
Dominik Riebeling 2d9c0bab54 Add support for cp1252 (Western European) codepage.
In Europe Windows defaults to its own codepage cp1252 (also known as "WinLatin"
or "Windows-1252"). cp1252 adds some characters to ISO-8859-1.

Some mp3 tagging software on Windows uses cp1252 instead of ISO-8859-1. This
violates the ID3 specification, which requires tags to be ISO-8859-1 or
Unicode. However, similar violations are made for other codepages and supported
by Rockbox using the "Default Codepage" setting. Add support for cp1252 to
enable people using such broken tools to override the correct decoding to get
their tags displayed properly.

Change-Id: I9f2ec478afe2503e99ee8e6609416c92b0f453e0
Reviewed-on: http://gerrit.rockbox.org/209
Reviewed-by: Jens Arnold <amiconn@rockbox.org>
Tested-by: Jens Arnold <amiconn@rockbox.org>
2012-05-19 01:42:53 +02:00
Marcin Bukat 10829b2f78 Fix fat test program not compiling (FS#12646).
This changes the way creat() is wrapped around in native builds
so more experienced devs should look at it.

This patch forces to compile fat test in 32bit mode. Building
natively on x86-64 works just fine but our fat code apparently
can't deal with 64bit pointers/ints correctly.

Change-Id: I000015094f7db957ce826c22672608cd419908b0
Reviewed-on: http://gerrit.rockbox.org/228
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2012-05-08 13:00:14 +02:00
Michael Sevakis da6cebb6b0 Use buflib for the allocation of voice PCM resources.
Buffers are not allocated and thread is not created until the first
call where voice is required.

Adds a different callback (sync_callback) to buflib so that other
sorts of synchonization are possible, such as briefly locking-out the
PCM callback for a buffer move. It's sort of a messy addition but it
is needed so voice decoding won't have to be stopped when its buffer
is moved.

Change-Id: I4d4d8c35eed5dd15fb7ee7df9323af3d036e92b3
2012-05-02 17:22:28 -04:00
Michael Sevakis 2866063c3c Add a NO_INLINE attribute to gcc_extensions.
Will want later.

Change-Id: Ia1509e17f2346374305146ee98546c72f2f8a1ed
2012-04-26 16:04:43 -04:00
Marcin Bukat 2f8b44aae2 Add RKW firmware file format loader
Change-Id: I5283fdcdb8d263fd9375a6d29396f82650aeb686
2012-03-04 00:34:26 +01:00
Frank Gevaerts c6d20104eb Fix __PCTOOL__ dependencies on SIMULATOR
* filesize() is not POSIX, so it doesn't need stubbing or redirecting
* make the various directory functions use the sim_ versions for PCTOOL
* PCTOOL needs generic byteswap functions
* fix the database makefile to not use -DSIMULATOR anymore

Change-Id: Ic6abc4f662830b85626c751a472fa4a03e844871
2012-03-03 18:54:47 +01:00
Frank Gevaerts f7a4ee2ddc Don't redirect file IO to app_* for __PCTOOLS__ builds for dir functions.
Change-Id: If4dc6c373f09f24c9cea4620ea6443e01512b495
2012-03-03 18:23:09 +01:00
Frank Gevaerts 71953a4266 Don't redirect file IO to app_* for __PCTOOLS__ builds.
Change-Id: Id8c2d277d4f393cb1bf32654dbd1a21730fd8269
2012-03-03 18:08:40 +01:00
Thomas Martitz af4f2157b8 Fix lua unused-variable warning by introducing UNUSED_ATTR.
Change-Id: If19393db123e89e58545c9e0736e6fa32fccb810
2012-02-17 12:08:27 +01:00
Thomas Martitz 249bba03f1 Initial commit of the Samsung YP-R0 port.
This port is a hybrid native/RaaA port. It runs on a embedded linux system,
but is the only application. It therefore can implement lots of stuff that
native targets also implement, while leveraging the underlying linux kernel.

The port is quite advanced. User interface, audio playback, plugins work
mostly fine. Missing is e.g. power mangement and USB (see SamsungYPR0 wiki page).

Included in utils/ypr0tools are scripts and programs required to generate
a patched firmware. The patched firmware has the rootfs modified to load
Rockbox. It includes a early/safe USB mode.

This port needs a new toolchain, one that includes glibc headers and libraries.
rockboxdev.sh can generate it, but e.g. codesourcey and distro packages may
also work.

Most of the initial effort is done by Lorenzo Miori and others (on ABI),
including reverse engineering and patching of the original firmware,
initial drivers, and more. Big thanks to you.

Flyspray: FS#12348
Author: Lorenzo Miori, myself

Merry christmas to ypr0 owners! :)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31415 a1c6a512-1295-4272-9138-f99709370657
2011-12-24 11:56:46 +00:00
Boris Gjenero fdc29d0ea4 Add more INIT_ATTR and add config.h includes to header files with INIT_ATTR.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31370 a1c6a512-1295-4272-9138-f99709370657
2011-12-19 20:12:52 +00:00
Boris Gjenero ff1c567417 Remove USB time sync code when there's no RTC.
Without an RTC, Rockbox doesn't keep time. In that situation, USB time sync
previously did nothing but reported success. After this change, the USB time
sync request won't be recognized on those targets.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31319 a1c6a512-1295-4272-9138-f99709370657
2011-12-16 00:09:28 +00:00
Boris Gjenero 8414a44ad4 Remove conditional added around set_day_of_week in r31301.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31305 a1c6a512-1295-4272-9138-f99709370657
2011-12-15 21:49:48 +00:00
Boris Gjenero 871c7bd34c Add conditionals around functions that are only needed when RTC is present.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31301 a1c6a512-1295-4272-9138-f99709370657
2011-12-15 21:38:23 +00:00
Boris Gjenero 59e71ee80c Introduce USED_ATTR wrapper for __attribute__((used)).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31188 a1c6a512-1295-4272-9138-f99709370657
2011-12-09 15:33:59 +00:00
Boris Gjenero d51e598335 FS#12412 : Delete old buffer allocation code which has been replaced by core_alloc, and move buffer setup code to core_alloc.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31088 a1c6a512-1295-4272-9138-f99709370657
2011-11-29 00:42:27 +00:00
Fred Bauer 6f8564987f Finish r30818 revert
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30822 a1c6a512-1295-4272-9138-f99709370657
2011-10-22 08:23:52 +00:00
Fred Bauer 6f078c428f Change lru from double to single linked list. Only the font cache uses LRU and it never searches in reverse. Saves 2 bytes per glyph.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30818 a1c6a512-1295-4272-9138-f99709370657
2011-10-21 20:23:21 +00:00
Fred Bauer cd0102ba14 font_cache.c: Optimize and simplify cache search. ~25% font rendering boost
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30763 a1c6a512-1295-4272-9138-f99709370657
2011-10-16 20:17:44 +00:00
Thomas Martitz 4478b25ede core_alloc: Provide a tiny test allocation, which can be freed for debug purposes.
This allocation can be freed in the buflib debug menu (select it to free).
Doing a another allocation, e.g. by selecting another item in this debug menu
will cause compaction (all allocs move).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30719 a1c6a512-1295-4272-9138-f99709370657
2011-10-05 18:32:19 +00:00
Jonathan Gordon aa0f4a4bbe FS#12273 - use buflib for font storage. thanks to the testers :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
2011-09-24 13:19:34 +00:00
Thomas Martitz f7cff8bd69 Buflib: Stop caching the first unallocated block. It has little benefit but is complicated to keep up-to-date.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30487 a1c6a512-1295-4272-9138-f99709370657
2011-09-09 15:35:14 +00:00
Thomas Martitz 5296af838c Buflib: Clarification about invalid handles
* Enhance allocation function comments to better state the return value and what an invalid value is
* Change clients to check for "< 0" instead of "<= 0" or "== 0"
* Return -1 or -2 depending on the exact failure in buflib_alloc_ex.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30469 a1c6a512-1295-4272-9138-f99709370657
2011-09-07 23:16:29 +00:00
Thomas Martitz 7e14b935df Dircache: Allow dircache to be enabled without reboot.
Also add two dircache function, one of which does what dircache_disable()
did previously as this now also frees the dircache buffer.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30393 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 21:07:46 +00:00
Thomas Martitz d0b72e2590 GSoC/Buflib: Add buflib memory alocator to the core.
The buflib memory allocator is handle based and can free and
compact, move or resize memory on demand. This allows to effeciently
allocate memory dynamically without an MMU, by avoiding fragmentation
through memory compaction.

This patch adds the buflib library to the core, along with
convinience wrappers to omit the context parameter. Compaction is
not yet enabled, but will be in a later patch. Therefore, this acts as a
replacement for buffer_alloc/buffer_get_buffer() with the benifit of a debug
menu.

See buflib.h for some API documentation.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30380 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:01:33 +00:00
Thomas Martitz d1322b7159 GSoC/Buflib: Replace all direct accesses to audiobuf with buffer API functions.
Namely, introduce buffer_get_buffer() and buffer_release_buffer().
buffer_get_buffer() aquires all available and grabs a lock, attempting to
call buffer_alloc() or buffer_get_buffer() while this lock is locked will cause
a panicf() (doesn't actually happen, but is for debugging purpose).
buffer_release_buffer() unlocks that lock and can additionally increment the
audiobuf buffer to make an allocation. Pass 0 to only unlock if buffer was
used temporarily only.
buffer_available() is a replacement function to query audiobuflen, i.e. what's
left in the buffer.
Buffer init is moved up in the init chain and handles ipodvideo64mb internally.

Further changes happened to mp3data.c and talk.c as to not call the above API
functions, but get the buffer from callers. The caller is the audio system
which has the buffer lock while mp3data.c and talk mess with the buffer.
mpeg.c now implements some buffer related functions of playback.h, especially
audio_get_buffer(), allowing to reduce #ifdef hell a tiny bit.

audiobuf and audiobufend are local to buffer.c now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30308 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 15:13:00 +00:00
Thomas Martitz 1b7ff725c6 Revert "Introduce bsearch() and use it in tagtree.c."
It was committed by accident (it's on FS still).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30157 a1c6a512-1295-4272-9138-f99709370657
2011-07-18 18:57:50 +00:00
Thomas Martitz 74ab227b58 Introduce bsearch() and use it in tagtree.c.
bsearch() is a general purpose binary search function for arrays.
It's supposedly faster than looping over arrays.
The array needs to be sorted in ascending order under the provided
comparison function. If the key and array element are of the same kind,
then the same compare function can be used for qsort() and bsearch().

Code taken from glibc.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30155 a1c6a512-1295-4272-9138-f99709370657
2011-07-18 18:55:20 +00:00
Miika Pekkarinen 2bc133dce9 Try to handle dircache rebuild event properly. Playlist should now
cache new pointers to dircache items when dircache goes
offline and comes back onlineagain (during tagcache commit). This
should prevent wrong filenames to appear in playlist.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30047 a1c6a512-1295-4272-9138-f99709370657
2011-06-21 17:42:31 +00:00
Thomas Martitz af7aaae478 Dircache: Don't expose struct dircache_entry and pointers into the cache, use IDs instead.
Only integer IDs are exposed from dircache with this. This way the cache is isolated from other modules.
This is needed for my buflib gsoc project.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30038 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 20:12:42 +00:00
Thomas Martitz 0b9c57d33e Dircache: Move struct maindata declaration to dircache.c and actually check for DIRCACHE_MAGIC when loading from disk.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30037 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 20:12:35 +00:00
Thomas Martitz 52abbb186d Dircache: Change internal cache layout.
The dircache_entry structs are now allocated subsequently from the front, allowing to treat them as an array.  The d_names are allocated from the back (in reverse order, growing downwards).
This allows the cache to be moved around (needed for my buflib gsoc project). It is utilized when loading the cache from disk (on the h100), now the pointer to the cache begin doesn't need to be the same across reboots anymore.

This should save a bit memory usage, since there's no need for aligning padding bytes after d_names anymore.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30036 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 20:12:30 +00:00
Thomas Martitz e063725534 Dircache: Return the size of the result string in dircache_copy_path() so that callers don't need to call strlen on it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30034 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 20:12:15 +00:00
Thomas Martitz 60e4f20c38 Dircache: Remove dircache_entry::name_len.
It's reduntant, and enlarges the dircache unnecessarily. Saves 4 byte per file in the whole filesystem.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30032 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 20:07:35 +00:00
Thomas Martitz 26ec41b028 Move buffer.h to firmware/include.h to replace a useless malloc header.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30026 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 19:32:43 +00:00
Nils Wallménius 5fd9471c15 FS#12120. Convert FRACMUL macros into inline functions and fix typecasting for 64 bit platforms so that sims produce the same results as targets. Tweak the cf inline asm to not require an immediate value but add a FORCE_INLINE attribute to one of the cf functions to make sure it gets inlined as that saves both codesize and cycles.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29921 a1c6a512-1295-4272-9138-f99709370657
2011-05-24 10:44:12 +00:00
Bertrik Sikken 9c33dca647 Fix tabs in .c and .h files in firmware/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29832 a1c6a512-1295-4272-9138-f99709370657
2011-05-08 11:37:18 +00:00
Thomas Jarosch 6e9e6a7571 RaaA: Add initial Pandora support
More information: www.openpandora.org

Possible things to implement:
- Special button mappings
- Battery monitoring
- ALSA audio backend
- Automate creation of "pnd" (=binary) file

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29451 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 23:42:37 +00:00
Michael Sparmann 751303c2ac iPod Classic CE-ATA Support (Part 1 of 4: Cacheline align some statically allocated sector buffers)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29444 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 22:44:30 +00:00
Thomas Jarosch 5f037ac015 Initial maemo platform support
Adds Nokia N900, N810 and N800 support.

Features:
- Introduce maemo specific platform defines
- Play audio in silent mode
- Stop playback on incoming calls
- Battery level readout
- Bluetooth headset support
- Save CPU by disabling screen updates if the display
  is off or the app doesn't have input focus
- N900: GStreamer audio backend

Kudos to kugel for the code review.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29248 a1c6a512-1295-4272-9138-f99709370657
2011-02-08 20:05:25 +00:00
Frank Gevaerts 1980fc3a61 Also PREFIX() other filesystem functions. I hope I got them all now...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28929 a1c6a512-1295-4272-9138-f99709370657
2010-12-29 20:10:11 +00:00
Thomas Martitz 87c8be4a08 RaaA: Improve tagcache search to make the database built.
First, it add the ability to tagcache to walk through multiple search roots.
Second, it adds symlinks targets to the search roots if they're are not inside any of the current search roots, otherwise the symlink is ignored (unless it's a file).

The default search root is still /, so no search root will be actually added.
But the tagcache now isn't trapped by recursive symlinks anymore and successfully builds, and it's prepared for a future music directory setting.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28884 a1c6a512-1295-4272-9138-f99709370657
2010-12-23 19:02:18 +00:00
Thomas Martitz 2c2416094f Get rid of get_user_file_path and do the path handling in wrappers for open() and friends.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 a1c6a512-1295-4272-9138-f99709370657
2010-12-06 22:26:31 +00:00
Rafaël Carré 5a98ad2d7f format() (and its alias vuprintf) return values are uncheck -> void
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28119 a1c6a512-1295-4272-9138-f99709370657
2010-09-20 08:55:45 +00:00
Thomas Martitz 9940663f0c Fix sdl application build
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28004 a1c6a512-1295-4272-9138-f99709370657
2010-09-06 11:36:02 +00:00
Thomas Martitz eac36d5a09 struct DIR -> DIR, should fix most if not all reds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27970 a1c6a512-1295-4272-9138-f99709370657
2010-09-01 21:45:58 +00:00
Thomas Martitz 6eaab4d004 Ged rid of uisimulator/common/io.c for android builds.
Use host's functions for file i/o directly (open(), close() ,etc.), not the sim_* variants.
Some dir functions need to be wrapped still because we need to cache the parents dir's path (host's dirent doesn't let us know).
For the same reason (incompatibility) with host's dirent) detach some members from Rockbox' dirent struct and put it into an extra one,
the values can be retrieved via the new dir_get_info().

Get rid of the sim_ prefix for sleep as well and change the signature to unix sleep().

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27968 a1c6a512-1295-4272-9138-f99709370657
2010-09-01 21:29:34 +00:00
Thomas Martitz b16afb4356 Fix checkwps.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27905 a1c6a512-1295-4272-9138-f99709370657
2010-08-27 12:48:29 +00:00
Thomas Martitz 2c2e261648 Use system headers a bit more: use host's fcntl.h for O_RDONLY etc.
Removes the need to fix up those in the simulator.

Also work around some posix-mingw incompatibilities (e.g. getcwd()).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27904 a1c6a512-1295-4272-9138-f99709370657
2010-08-27 12:38:25 +00:00
Thomas Martitz 87409a2619 Move memset6() declaration to string-extra.h, kills a warning compiling for android since it ships a memory.h.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27789 a1c6a512-1295-4272-9138-f99709370657
2010-08-12 13:55:01 +00:00
Thomas Martitz 0e2286f226 Introduce NORETURN_ATTR wrapper for __attribute__((noreturn)), using this and a bit further cleanup in main gets rid of a warning when compiling for android.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27788 a1c6a512-1295-4272-9138-f99709370657
2010-08-12 13:38:25 +00:00
Thomas Martitz 9c0b2479f7 Rockbox as an application: add get_user_file_path().
For RaaA it evaluates user paths at runtime. For everything but codecs/plugins it will give the path under $HOME/.config/rockbox.org if write access is needed or if the file/folder in question exists there (otherwise it gives /usr/local/share/rockbox).
This allows for installing themes under $HOME as well as having config.cfg and other important files there while installing the application (and default themes) under /usr/local.

On the DAPs it's a no-op, returing /.rockbox directly.

Not converted to use get_user_file_path() are plugins themselves, because RaaA doesn't build plugins yet.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27656 a1c6a512-1295-4272-9138-f99709370657
2010-08-01 16:15:27 +00:00
Rafaël Carré 33f5b60999 strncpy.c / assert.h : need to include _ansi.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27549 a1c6a512-1295-4272-9138-f99709370657
2010-07-25 14:53:06 +00:00
Rafaël Carré a72aa856bd Move some gcc extensions to new gcc_extensions.h header
- Move ATTRIBUTE_PRINTF/ATTRIBUTE_SCANF from _ansi.h
  They are not related at all to this file, and this broke compilation
  with Code Sourcery GCC which ships its own _ansi.h
- Move LIKELY/UNLIKELY from system.h

There is likely a lot more GCC extensions used everywhere in the source,
conditionally on __GNUC__ or unconditionally

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27548 a1c6a512-1295-4272-9138-f99709370657
2010-07-25 14:44:29 +00:00
Thomas Martitz 35e8b1429a Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently).
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR).
The new define is to (de-)select code to compile on hosted platforms generally.

Should be no functional change to targets or the simulator.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 16:53:00 +00:00
Frank Gevaerts 530c25130f Make the sim buildable with mingw again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26037 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 22:57:52 +00:00
Frank Gevaerts 5d987d61cf Move include/sys along with libc/, so hosted (sim/RaaA) builds use the proper files for their OS
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26030 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 22:01:07 +00:00
Thomas Martitz 68947473e1 Move math.h to firmware/libc/include/ and fix slight incompatibilities between our and the host's math.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26020 a1c6a512-1295-4272-9138-f99709370657
2010-05-14 12:43:45 +00:00
Michael Sevakis 8ffbe2e467 Remove stray function prototype used only for long-ago-removed codec swapping. Function definition was removed when adding internal voice codec.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25868 a1c6a512-1295-4272-9138-f99709370657
2010-05-07 04:14:59 +00:00
Thomas Martitz 6ac64206f3 Revert r25854 which was bad for the database tool (I forgot it still needs the wrappers from uisimulator/common/io.c). Fix it so it works for both.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25856 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 22:17:34 +00:00
Thomas Martitz 3e400b2ae6 Fix checkwps by using host system's file IO (thanks to r25843/r25844) and by including a work around for systems that try to get intN_t via sys/types.h (which should be wrong, but well).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25854 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 21:49:09 +00:00
Thomas Martitz 50a6ca39ad Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 21:04:40 +00:00
Thomas Martitz 0a1d7c28b7 Make open() posix compliant api-wise. A few calls (those with O_CREAT) need the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 17:35:13 +00:00
Thomas Martitz c61e89c0ed Make creat() posix compliant API-wise. Shouldn't affect the core as it's wrapped via a static inline.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 17:35:04 +00:00
Tomer Shalev 56058c7213 FS#11187 - diacritic.c is in 'drivers' but it does not belong there
- Move diacritic.c to firmware/common
- The function is_diacritic returns bool now


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25526 a1c6a512-1295-4272-9138-f99709370657
2010-04-07 20:41:18 +00:00
Alexander Levin a57ec82a4e Set SVN keywords; small addition to the comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25522 a1c6a512-1295-4272-9138-f99709370657
2010-04-07 19:30:32 +00:00
Tomer Shalev b5466cd2ec Add comment to is_diacritic()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25521 a1c6a512-1295-4272-9138-f99709370657
2010-04-07 18:45:12 +00:00
Amaury Pouly 56069476be Get rid of the parent_dir field in dir_uncached.c by using the same FAT trick as in dircache. This should save ~20KB on 512B/sector targets and ~80KB on 2K/sector ones.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25105 a1c6a512-1295-4272-9138-f99709370657
2010-03-10 08:56:27 +00:00
Thomas Martitz f8edc32589 FS#10756 - Free unused init code
Introduce a new .init section for initialisation code, so that it can be copied to an area which is later overwritten before calling. The stack/bss can then overwrite that code, effectively freeing the code size that the initialisation routines need. Gives a few kB ram usage back.
Only implemented for PP and as3525 so far. More targets could be added, as well as more functions.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25013 a1c6a512-1295-4272-9138-f99709370657
2010-03-03 23:20:32 +00:00
Andree Buschmann 0b7dcd69c8 Remove tabs in firmware path (taking into account the original spacing).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24864 a1c6a512-1295-4272-9138-f99709370657
2010-02-22 21:24:09 +00:00
Amaury Pouly 62257ebc38 Remove obsolete comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24711 a1c6a512-1295-4272-9138-f99709370657
2010-02-16 23:17:28 +00:00
Amaury Pouly 53b1af7a61 -Cosmetic change in a comparison
-Move fat_dir structure out of dircache stack to RAM. Reduce dircache stack size (max level depth should stay be around 20). This should fix nano2g dircache stkov of FS#10679
-Change the structure returned by readdir_cached to match the one returned by readdir_uncached: remove useless fields to save space and avoid any potential incoherence
-Remove one field from the internal structure used by {opend,read,close}dir_cached because it was mostly redundant.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24708 a1c6a512-1295-4272-9138-f99709370657
2010-02-16 22:49:11 +00:00
Jonathan Gordon 1281b1c065 fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24645 a1c6a512-1295-4272-9138-f99709370657
2010-02-14 06:37:48 +00:00
Torne Wuff 6e9af8bd44 Add strlcat to core to match strlcpy (also add to plugin api). Some uses of strcat could probably do with being changed to this.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24141 a1c6a512-1295-4272-9138-f99709370657
2010-01-02 13:31:46 +00:00
Amaury Pouly 081da63d09 Add support for errno in plugins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24109 a1c6a512-1295-4272-9138-f99709370657
2009-12-24 17:07:20 +00:00
Tomer Shalev c2617dc4ed Diacritic display enhancements
- Use the fact that unicode code currently does not support chars above 0xffff
  (see utf8decode()), and change diacritic database's char code type to
  unsigned short from int. Also comment out database entries above unsupported
  range.

- Use const when possible.

- Iterate over buffer using the buffer's pointer, thus avoiding usage of some
  variables, and avoiding multiple access to the same array item.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23776 a1c6a512-1295-4272-9138-f99709370657
2009-11-28 17:07:57 +00:00
Tomer Shalev 7682cb5ca8 FS#10720 - Support for displaying diacritic characters
This commit corrects the display of diacritic characters, which exist in many
languages. Hopefully, it will make Rockbox much more usable for users of these
languages.

Diacritic information (which used to decide whether a given character is
diacritic or not) is taken from the Unicode Standard, Version 5.2.

This feature does not affect drawing performance much, as the diacritic
database is cached (simple MRU mechanism).

There may be room for further performance, footprint, and
code-reuse wise improvements, that could be worked on in the future.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23742 a1c6a512-1295-4272-9138-f99709370657
2009-11-24 20:41:42 +00:00
Thomas Martitz 1ddb91ad36 Rename vfnprintf to vuprintf (u stands for user for the user callback and data passed to it) to avoid confusion with file and buffer size related functions from the printf-family, and add a comment to its declaration.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23503 a1c6a512-1295-4272-9138-f99709370657
2009-11-03 21:20:09 +00:00
Frank Gevaerts 6e11572e07 Make the database tool buildable from configure.
Also update the checkwps makefile to make checkwps builds not break


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22998 a1c6a512-1295-4272-9138-f99709370657
2009-10-07 16:54:15 +00:00
Tomer Shalev 32d261e3f9 Have codepage name show in a comment
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22929 a1c6a512-1295-4272-9138-f99709370657
2009-10-04 21:55:53 +00:00
Nils Wallménius c8b87d76eb FS#10569 RTC driver cleanup
Change the RTC drivers so that the rtc_(read|write)_datetime functions now deal directly with the tm struct instead of passing a string of bcd digits to/from (set|get)_time .
This simplifies drivers for rtc's that do not use a bcd representation internally and cleans up some target specific code and #ifdefs in generic code. Implement simple stubs for the sim to avoid #ifdefing for that too.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22839 a1c6a512-1295-4272-9138-f99709370657
2009-09-26 14:58:32 +00:00
Maurus Cuelenaere 20b0dd2788 A new implementation of logf, logfdisplay and logfdump.
Flyspray: FS#10528
Author: Amaury Pouly


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22462 a1c6a512-1295-4272-9138-f99709370657
2009-08-21 22:54:23 +00:00
Frank Gevaerts ceccec503e Move yearday_to_daymonth() to usb_storage.c. It's the only user, this function is pretty specific, and it seems to be the cleanest way to avoid ram usage increases for unrelated targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22259 a1c6a512-1295-4272-9138-f99709370657
2009-08-11 20:03:59 +00:00
Frank Gevaerts 2dc50471ca Consolidate day of week calculation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22258 a1c6a512-1295-4272-9138-f99709370657
2009-08-11 19:30:19 +00:00
Frank Gevaerts ed73a3274c Add support for setting the clock using a special SCSI command. This is the same method that itunes uses, and there are host-side tools for it (e.g. libgpod)
Flyspray: FS#10514
Author: Laurent Papier and myself



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22255 a1c6a512-1295-4272-9138-f99709370657
2009-08-11 17:54:47 +00:00