summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy/events.c
diff options
context:
space:
mode:
authorTom Ross <midgey@rockbox.org>2007-02-06 21:41:08 +0000
committerTom Ross <midgey@rockbox.org>2007-02-06 21:41:08 +0000
commit2882b26a996839f09956fa59617c63f2c3abac72 (patch)
treef7c4fbdc4857f6af11b30c1e7bdf467d43d5963e /apps/plugins/rockboy/events.c
parent1026c0f5b26ef82e6acfc32e1fd74c5594e53619 (diff)
Major Rockboy update.
1) Adapt Rockboy to smaller screens (H10, X5, and iPod Nano). 2) Add the ability to use a preset palette on color targets. Choose 'Set Palette' from the main menu. 3) Clean up the code to remove any unused code and variables. 4) Changed tabs to spaces. 5) Disable reading and writing sound when sound is disabled. 6) Disbable writing to the RTC since it is not implemented yet. 7) Minor optimizations from WAC gnuboy CE and iBoy. 8) Massive clean up of code to make it appear consistent. 9) Change all C++ style comments to C style. 10) Completely reorganize dynarec. Add fixmes to all unimplemented opcodes. Add debug writes for all opcodes. Attempt to implement a few opcodes myself. 11) Silence some warnings when built using dynarec. 12) Minor reshuffling of IRAM, may or not offer a speed increase. 13) Include fixes found in the short-lived gnuboy CVS. All in all, there's about a 10% improvement on my test roms when sound is disabled and slight improvement with sound. Especially noticable when there are few sprites on screen and less action is occurring. See FS #6567. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12216 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy/events.c')
-rw-r--r--apps/plugins/rockboy/events.c45
1 files changed, 15 insertions, 30 deletions
diff --git a/apps/plugins/rockboy/events.c b/apps/plugins/rockboy/events.c
index 5a34ce81e5..c018f7ce53 100644
--- a/apps/plugins/rockboy/events.c
+++ b/apps/plugins/rockboy/events.c
@@ -8,10 +8,6 @@
#include "rockmacros.h"
#include "input.h"
-
-char keystates[MAX_KEYS];
-int nkeysdown;
-
#define MAX_EVENTS 32
static event_t eventqueue[MAX_EVENTS];
@@ -20,34 +16,23 @@ static int eventhead, eventpos;
int ev_postevent(event_t *ev)
{
- int nextevent;
- nextevent = (eventhead+1)%MAX_EVENTS;
- if (nextevent == eventpos)
- return 0;
- eventqueue[eventhead] = *ev;
- eventhead = nextevent;
- return 1;
+ int nextevent;
+ nextevent = (eventhead+1)%MAX_EVENTS;
+ if (nextevent == eventpos)
+ return 0;
+ eventqueue[eventhead] = *ev;
+ eventhead = nextevent;
+ return 1;
}
int ev_getevent(event_t *ev)
{
- if (eventpos == eventhead)
- {
- ev->type = EV_NONE;
- return 0;
- }
- *ev = eventqueue[eventpos];
- eventpos = (eventpos+1)%MAX_EVENTS;
- if (ev->type == EV_PRESS)
- {
- keystates[ev->code] = 1;
- nkeysdown++;
- }
- if (ev->type == EV_RELEASE)
- {
- keystates[ev->code] = 0;
- nkeysdown--;
- if (nkeysdown < 0) nkeysdown = 0;
- }
- return 1;
+ if (eventpos == eventhead)
+ {
+ ev->type = EV_NONE;
+ return 0;
+ }
+ *ev = eventqueue[eventpos];
+ eventpos = (eventpos+1)%MAX_EVENTS;
+ return 1;
}