Commit graph

51 commits

Author SHA1 Message Date
Thomas Martitz
cae4ae2c71 Second try: Introduce plugin_crt0.c that every plugin links.
It handles exit() properly, calling the handler also when the plugin returns
normally (also make exit() more standard compliant while at it).
It also holds PLUGIN_HEADER, so that it doesn't need to be in each plugin anymore.

To work better together with callbacks passed to rb->default_event_handler_ex() introduce exit_on_usb() which will call the exit handler before showing the usb screen and exit() after it.
In most cases rb->default_event_handler_ex() was passed a callback which was manually called at all other return points. This can now be done via atexit().

In future plugin_crt0.c could also handle clearing bss, initializing iram and more.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27873 a1c6a512-1295-4272-9138-f99709370657
2010-08-24 14:30:46 +00:00
Thomas Martitz
93cb949372 Revert "Introduce plugin_crt0.c that every plugin links."
Too much errors and no time to fix them now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27863 a1c6a512-1295-4272-9138-f99709370657
2010-08-23 17:12:26 +00:00
Thomas Martitz
abdc5935be Introduce plugin_crt0.c that every plugin links.
It handles exit() properly, calling the handler also when the plugin returns
normally (also it makes exit() more standard compliant while at it).
It also holds PLUGIN_HEADER, so that it doesn't need to be in each plugin anymore.

To work better together with callbacks passed to rb->default_event_handler_ex introduce exit_on_usb() which will call the exit handler before showing the usb screen and exit() after it.
In most cases it was passed a callback which was manually called at all other return points. This can now be done via atexit().

In future plugin_crt0.c could also handle clearing bss, initializing iram and more.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27862 a1c6a512-1295-4272-9138-f99709370657
2010-08-23 16:56:49 +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
Thomas Martitz
e919b5d5b9 Fix disastrous variable shadowing, change casts to unsigned in (cygwin doesn't like mode_t there, and unsigned int should be equally correct) and check the correct bitmask in sim_open().
Should repair filesystem accesses on the sim.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25881 a1c6a512-1295-4272-9138-f99709370657
2010-05-07 16:56: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
Karl Kurbjun
069bafe215 Accept FS #10271 by Christian Beier: Automatically disable voice upon rockdoom startup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24063 a1c6a512-1295-4272-9138-f99709370657
2009-12-18 04:25:56 +00:00
Nils Wallménius
afe08ed8b2 Remove private memcpy wrapper that is no longer needed since r19847 and may cause issues with newer gcc versions, inspired by patch in FS#10676 by Duy Nguyen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23178 a1c6a512-1295-4272-9138-f99709370657
2009-10-14 22:34:11 +00:00
Nils Wallménius
3200d04d75 Make the formatter functions used by the settings return a pointer to avoid usless copying of lang strings, this brought with it a long chain of const correctness and a few random cleanups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22440 a1c6a512-1295-4272-9138-f99709370657
2009-08-20 16:47:44 +00:00
Maurus Cuelenaere
64b227e3ba Doom: re-add the missing modulus operation I removed in r22097
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22098 a1c6a512-1295-4272-9138-f99709370657
2009-08-01 16:10:25 +00:00
Maurus Cuelenaere
da0e0e564a Doom: prevent division by zero
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22097 a1c6a512-1295-4272-9138-f99709370657
2009-08-01 16:07:03 +00:00
Jonathan Gordon
af9f405651 Accept FS#10094 by Teruaki Kawashima:
Replace the old menu API with the "new" one (a very long time overdue so huge thanks for the work.)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21306 a1c6a512-1295-4272-9138-f99709370657
2009-06-16 04:25:21 +00:00
Andrew Mahone
23d9812273 loader-initialized global plugin API:
struct plugin_api *rb is declared in PLUGIN_HEADER, and pointed to by
__header.api

the loader uses this pointer to initialize rb before calling entry_point

entry_point is no longer passed a pointer to the plugin API

all plugins, and pluginlib functions, are modified to refer to the
global rb

pluginlib functions which only served to copy the API pointer are
removed

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19776 a1c6a512-1295-4272-9138-f99709370657
2009-01-16 10:34:40 +00:00
Frank Gevaerts
8c08511013 revert plugin_api part of r18830, as this was the wrong solution for those
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18831 a1c6a512-1295-4272-9138-f99709370657
2008-10-18 23:50:05 +00:00
Frank Gevaerts
ae7391b187 code police : fix some multiply defined variables
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18830 a1c6a512-1295-4272-9138-f99709370657
2008-10-18 23:31:29 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Steve Bavin
6526577818 Plugin parameters should be const.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17492 a1c6a512-1295-4272-9138-f99709370657
2008-05-13 09:57:56 +00:00
Robert Kukla
1317ebb1a0 m:robe 100: a few button defines and other greyscale related changes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17030 a1c6a512-1295-4272-9138-f99709370657
2008-04-07 22:09:14 +00:00
Jens Arnold
2aa0c4c66b Doom: Keep the light on during gameplay.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16004 a1c6a512-1295-4272-9138-f99709370657
2008-01-06 14:05:55 +00:00
Nicolas Pennequin
9ff40579c3 Hopefully the last fix for crosscompilation of sims with mingw32.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15048 a1c6a512-1295-4272-9138-f99709370657
2007-10-09 18:44:07 +00:00
Jens Arnold
a4f0de0f9d Doom: * Fix voicing numerous options as 'yes'. voice_id is an id, not a pointer. *Fix struct menu_item <-> struct opt_items messup (caused no problems but still...).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14960 a1c6a512-1295-4272-9138-f99709370657
2007-10-02 19:53:35 +00:00
Kevin Ferrare
011a325e32 Makes apps and plugins interract with directories using a posix-like api instead of calling dircache / simulator functions (no additionnal layer added, only a cosmetic change)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13943 a1c6a512-1295-4272-9138-f99709370657
2007-07-20 17:06:55 +00:00
Karl Kurbjun
aec5814d43 Some fixes to doom dehacked loading - make embedded dehacked files actually load, fix end of file detection in the string loader, fix ammo changes, fix bex code pointers. Also added the * flag to sscanf - still only tested against rockdoom sscanf calls.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13547 a1c6a512-1295-4272-9138-f99709370657
2007-06-03 22:03:36 +00:00
Jonathan Gordon
77a458a464 Move the old api out of the core and into the plugin lib.
ew plugins shuold use the new api and not this one.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13358 a1c6a512-1295-4272-9138-f99709370657
2007-05-08 11:55:43 +00:00
Jens Arnold
4d6374c923 Get rid of the 'center' parameter for splashes. There were only 2 of almost 500 splashes which were not centered.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12807 a1c6a512-1295-4272-9138-f99709370657
2007-03-16 21:56:08 +00:00
Paul Louden
d17de72c60 Make our Doom plugin see the Doom wad we provide and list "Freedoom" as
its own entry in the supported game list.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12353 a1c6a512-1295-4272-9138-f99709370657
2007-02-17 17:51:44 +00:00
Karl Kurbjun
b47a43aa28 Doom for the Gigabeat and some code reduction
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12051 a1c6a512-1295-4272-9138-f99709370657
2007-01-17 18:52:24 +00:00
Karl Kurbjun
7e6f74e429 Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11738 a1c6a512-1295-4272-9138-f99709370657
2006-12-13 04:44:17 +00:00
Tomasz Malesinski
80da8b141c FS#6357, patch 1: let iramcopy and bss share the same space in codecs and
plugins. Currently, in case of plugins using IRAM bss is cleared twice,
once in the loader, once in PLUGIN_IRAM_INIT. For codecs, bss is cleared only
during codec initialization. Also, removed double variables in codecs
storing a pointer to codec_api.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11606 a1c6a512-1295-4272-9138-f99709370657
2006-11-26 18:31:41 +00:00
Michael Sevakis
acc29d95be SWCODEC/IRAM: Save voice IRAM when a plugin initializes its IRAM. Defines two macros for declaring and initializing IRAM. Plugins should use these instead. See mp3_encoder, doom, etc. for details. Further tweaks in buffer restoration after other use. Hiding of some interfaces that should only be used by buffer management.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11544 a1c6a512-1295-4272-9138-f99709370657
2006-11-18 02:18:29 +00:00
Karl Kurbjun
d6b0c97312 Don't need to remove the backdrop for all plugins - leave it up for some.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11526 a1c6a512-1295-4272-9138-f99709370657
2006-11-15 06:14:27 +00:00
Karl Kurbjun
4caa676a9c Deboost under all exits for rockdoom thanks to patch 5851 by David Dent
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11100 a1c6a512-1295-4272-9138-f99709370657
2006-10-01 01:07:45 +00:00
Karl Kurbjun
26dd5c5e9c Fix the menu start for rockdoom
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10097 a1c6a512-1295-4272-9138-f99709370657
2006-06-10 18:47:11 +00:00
Dave Chapman
830ec63b4b Stop playback before starting to use IRAM
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9947 a1c6a512-1295-4272-9138-f99709370657
2006-05-15 21:25:43 +00:00
Karl Kurbjun
65c15eb50b Better video update, add options to startup menu, change default screensize
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9754 a1c6a512-1295-4272-9138-f99709370657
2006-04-22 03:48:15 +00:00
Karl Kurbjun
9f2be9b17f Add in error return if appropriate.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9702 a1c6a512-1295-4272-9138-f99709370657
2006-04-17 05:01:33 +00:00
Karl Kurbjun
b0722d11c1 Changed the way the addons and demos menus are displayed and built. Should be a good setup for adding multiple wad files as addons. Need to add some status feedback to let the user know what has been selected previously.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9701 a1c6a512-1295-4272-9138-f99709370657
2006-04-17 04:38:26 +00:00
Karl Kurbjun
c87f98ce7f Finally add support for unlimited number of addons and demos. Also cleaned up the code and made a general function to handle the addons and demos.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9700 a1c6a512-1295-4272-9138-f99709370657
2006-04-17 03:09:29 +00:00
Karl Kurbjun
6f8af215b9 Some code cleanup. Adds Always run to configuration options.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9697 a1c6a512-1295-4272-9138-f99709370657
2006-04-17 00:37:51 +00:00
Karl Kurbjun
4e2a74c2b4 Slight code cleanups, fixed sound parameter - now it saves. Old configurations will be reset.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9682 a1c6a512-1295-4272-9138-f99709370657
2006-04-15 22:08:36 +00:00
Karl Kurbjun
993545b4fb Start of profiling support for doom.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9667 a1c6a512-1295-4272-9138-f99709370657
2006-04-14 21:07:56 +00:00
Christian Gmeiner
a91b794cb2 use #ifdef x instead of #if defined(x)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9581 a1c6a512-1295-4272-9138-f99709370657
2006-04-09 15:00:30 +00:00
Christian Gmeiner
eb7d4f88ea HAVE_ADJUSTABLE_CPU_FREQ isn't defined for simulators, so we don't have to check for simulator builds before using cpu_boost()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9580 a1c6a512-1295-4272-9138-f99709370657
2006-04-09 14:50:43 +00:00
Karl Kurbjun
8ae6802697 Fix up configurable keys, edit exit string, more work needs to be done on menu keys
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9506 a1c6a512-1295-4272-9138-f99709370657
2006-04-04 23:13:50 +00:00
Karl Kurbjun
0926f64e44 Add configurable keys to Doom, enter, escape and run still need to be handled. More game keys need to be added to the options.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9494 a1c6a512-1295-4272-9138-f99709370657
2006-04-04 17:53:29 +00:00
Karl Kurbjun
1123ab64cd Updates doom menu w/ new graphics, now requires rockdoom.wad: http://alamode.mines.edu/~kkurbjun/rockdoom.wad
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9468 a1c6a512-1295-4272-9138-f99709370657
2006-04-03 20:03:02 +00:00
Karl Kurbjun
6e3371110e Finishing touches
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9460 a1c6a512-1295-4272-9138-f99709370657
2006-04-03 17:11:42 +00:00
Karl Kurbjun
546d96c46f Properly ifdef H300 video code, fix commented line handling rockbox volume
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9439 a1c6a512-1295-4272-9138-f99709370657
2006-04-02 20:45:24 +00:00
Karl Kurbjun
51db2d3f2c Update adds prboom's high resolution support, also makes the scaling for platforms w/ resolution less then 320x200 much nicer. IDoom's lookup table code has been removed. Also fixed a pallete bug. Some graphic errors are present in menu and status bar. Also updates some headers and output formatting.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9418 a1c6a512-1295-4272-9138-f99709370657
2006-04-02 01:52:44 +00:00
Dave Chapman
39876971a8 Do not export load_main_backdrop() via the plugin API. Plugins should allocate their own buffer and use lcd_set_backdrop()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9313 a1c6a512-1295-4272-9138-f99709370657
2006-03-28 16:04:11 +00:00