applying FS#10489: Rockboy - rotate directional keys when screen is rotated
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28695 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
418b7d4d78
commit
a0480c734a
2 changed files with 59 additions and 9 deletions
|
@ -134,10 +134,34 @@ void ev_poll(void)
|
|||
#else
|
||||
if(released) {
|
||||
ev.type = EV_RELEASE;
|
||||
if(released & options.LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); }
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
if (options.rotate == 1) /* if screen is rotated, rotate direction keys */
|
||||
{
|
||||
if(released & options.LEFT) {ev.code=PAD_DOWN; ev_postevent(&ev);}
|
||||
if(released & options.RIGHT) {ev.code=PAD_UP; ev_postevent(&ev);}
|
||||
if(released & options.DOWN) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
|
||||
if(released & options.UP) {ev.code=PAD_LEFT; ev_postevent(&ev);}
|
||||
}
|
||||
else if (options.rotate == 2) /* if screen is rotated, rotate direction keys */
|
||||
{
|
||||
if(released & options.LEFT) {ev.code=PAD_UP; ev_postevent(&ev);}
|
||||
if(released & options.RIGHT) {ev.code=PAD_DOWN; ev_postevent(&ev);}
|
||||
if(released & options.DOWN) {ev.code=PAD_LEFT; ev_postevent(&ev);}
|
||||
if(released & options.UP) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
|
||||
}
|
||||
else /* screen is not rotated, do not rotate direction keys */
|
||||
{
|
||||
if(released & options.LEFT) {ev.code=PAD_LEFT; ev_postevent(&ev);}
|
||||
if(released & options.RIGHT) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
|
||||
if(released & options.DOWN) {ev.code=PAD_DOWN; ev_postevent(&ev);}
|
||||
if(released & options.UP) {ev.code=PAD_UP; ev_postevent(&ev);}
|
||||
}
|
||||
#else
|
||||
if(released & options.LEFT) {ev.code=PAD_LEFT; ev_postevent(&ev);}
|
||||
if(released & options.RIGHT) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
|
||||
if(released & options.DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); }
|
||||
if(released & options.UP) { ev.code=PAD_UP; ev_postevent(&ev); }
|
||||
if(released & options.DOWN) {ev.code=PAD_DOWN; ev_postevent(&ev);}
|
||||
if(released & options.UP) {ev.code=PAD_UP; ev_postevent(&ev);}
|
||||
#endif
|
||||
if(released & options.A) { ev.code=PAD_A; ev_postevent(&ev); }
|
||||
if(released & options.B) { ev.code=PAD_B; ev_postevent(&ev); }
|
||||
if(released & options.START) {
|
||||
|
@ -151,10 +175,34 @@ void ev_poll(void)
|
|||
}
|
||||
if(pressed) { /* button press */
|
||||
ev.type = EV_PRESS;
|
||||
if(pressed & options.LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); }
|
||||
if(pressed & options.RIGHT) { ev.code=PAD_RIGHT; ev_postevent(&ev);}
|
||||
if(pressed & options.DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); }
|
||||
if(pressed & options.UP) { ev.code=PAD_UP; ev_postevent(&ev); }
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
if (options.rotate == 1) /* if screen is rotated, rotate direction keys */
|
||||
{
|
||||
if(pressed & options.LEFT) {ev.code=PAD_DOWN; ev_postevent(&ev);}
|
||||
if(pressed & options.RIGHT) {ev.code=PAD_UP; ev_postevent(&ev);}
|
||||
if(pressed & options.DOWN) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
|
||||
if(pressed & options.UP) {ev.code=PAD_LEFT; ev_postevent(&ev);}
|
||||
}
|
||||
else if (options.rotate == 2) /* if screen is rotated, rotate direction keys */
|
||||
{
|
||||
if(pressed & options.LEFT) {ev.code=PAD_UP; ev_postevent(&ev);}
|
||||
if(pressed & options.RIGHT) {ev.code=PAD_DOWN; ev_postevent(&ev);}
|
||||
if(pressed & options.DOWN) {ev.code=PAD_LEFT; ev_postevent(&ev);}
|
||||
if(pressed & options.UP) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
|
||||
}
|
||||
else /* screen is not rotated, do not rotate direction keys */
|
||||
{
|
||||
if(pressed & options.LEFT) {ev.code=PAD_LEFT; ev_postevent(&ev);}
|
||||
if(pressed & options.RIGHT) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
|
||||
if(pressed & options.DOWN) {ev.code=PAD_DOWN; ev_postevent(&ev);}
|
||||
if(pressed & options.UP) {ev.code=PAD_UP; ev_postevent(&ev);}
|
||||
}
|
||||
#else
|
||||
if(pressed & options.LEFT) {ev.code=PAD_LEFT; ev_postevent(&ev);}
|
||||
if(pressed & options.RIGHT) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
|
||||
if(pressed & options.DOWN) {ev.code=PAD_DOWN; ev_postevent(&ev);}
|
||||
if(pressed & options.UP) {ev.code=PAD_UP; ev_postevent(&ev);}
|
||||
#endif
|
||||
if(pressed & options.A) { ev.code=PAD_A; ev_postevent(&ev); }
|
||||
if(pressed & options.B) { ev.code=PAD_B; ev_postevent(&ev); }
|
||||
if(pressed & options.START) {
|
||||
|
|
|
@ -109,15 +109,17 @@ the gnuboy emulator. To start a game, open a ROM file saved as \fname{.gb} or
|
|||
\item[Set Keys (BUGGY)]
|
||||
Select this option to set a new keymapping.
|
||||
\opt{lcd_color}{
|
||||
\note{The direction keys are set for the normal screen orientation,
|
||||
not the rotated orientation.}
|
||||
\item[Screen Size.]
|
||||
Chose whether the original aspect ratio should be kept when scaling
|
||||
Choose whether the original aspect ratio should be kept when scaling
|
||||
the picture to the screen%
|
||||
% targets with bigger displays than the original gameboy
|
||||
\opt{gigabeat,h300,ipodcolor,ipodvideo,e200,e200v2}{
|
||||
or whether it should be displayed unscaled%
|
||||
}.
|
||||
\item[Screen Rotate.]
|
||||
Rotate the displayed picture by 90 degrees.
|
||||
Rotate the displayed picture and direction keys by 90 degrees.
|
||||
\item[Set Palette.]
|
||||
Pick one of a few predefined colour palettes.
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue