forked from len0rd/rockbox
Make Select change the scroll direction in Sudoku on Ipods (FS#8428 by Henri Valta).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19247 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
797e8f42ba
commit
92f34edf70
3 changed files with 46 additions and 15 deletions
|
@ -211,6 +211,12 @@ static const char default_game[9][9] =
|
||||||
|
|
||||||
#endif /* Layout */
|
#endif /* Layout */
|
||||||
|
|
||||||
|
#ifdef SUDOKU_BUTTON_CHANGEDIR
|
||||||
|
int invertdir=0;
|
||||||
|
#else
|
||||||
|
#define invertdir 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CFGFILE_VERSION 0 /* Current config file version */
|
#define CFGFILE_VERSION 0 /* Current config file version */
|
||||||
#define CFGFILE_MINVERSION 0 /* Minimum config file version to accept */
|
#define CFGFILE_MINVERSION 0 /* Minimum config file version to accept */
|
||||||
|
|
||||||
|
@ -1450,36 +1456,52 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
||||||
/* move cursor left */
|
/* move cursor left */
|
||||||
case SUDOKU_BUTTON_LEFT:
|
case SUDOKU_BUTTON_LEFT:
|
||||||
case (SUDOKU_BUTTON_LEFT | BUTTON_REPEAT):
|
case (SUDOKU_BUTTON_LEFT | BUTTON_REPEAT):
|
||||||
if (state.x==0) {
|
if ( (state.x==0&&invertdir==0) || (state.y==0&&invertdir==1) ) {
|
||||||
#ifndef SUDOKU_BUTTON_UP
|
#ifndef SUDOKU_BUTTON_UP
|
||||||
if (state.y==0) {
|
if ( (state.y==0&&invertdir==0) || (state.x==0&&invertdir==1)) {
|
||||||
move_cursor(&state,8,8);
|
move_cursor(&state,8,8);
|
||||||
} else {
|
} else {
|
||||||
|
if (invertdir==0) {
|
||||||
move_cursor(&state,8,state.y-1);
|
move_cursor(&state,8,state.y-1);
|
||||||
|
} else {
|
||||||
|
move_cursor(&state,state.x-1,8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
move_cursor(&state,8,state.y);
|
move_cursor(&state,8,state.y);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
if (invertdir==0) {
|
||||||
move_cursor(&state,state.x-1,state.y);
|
move_cursor(&state,state.x-1,state.y);
|
||||||
|
} else {
|
||||||
|
move_cursor(&state,state.x,state.y-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* move cursor right */
|
/* move cursor right */
|
||||||
case SUDOKU_BUTTON_RIGHT:
|
case SUDOKU_BUTTON_RIGHT:
|
||||||
case (SUDOKU_BUTTON_RIGHT | BUTTON_REPEAT):
|
case (SUDOKU_BUTTON_RIGHT | BUTTON_REPEAT):
|
||||||
if (state.x==8) {
|
if ( (state.x==8&&invertdir==0) || (state.y==8&&invertdir==1) ) {
|
||||||
#ifndef SUDOKU_BUTTON_DOWN
|
#ifndef SUDOKU_BUTTON_DOWN
|
||||||
if (state.y==8) {
|
if ( (state.y==8&&invertdir==0) || (state.x==8&&invertdir==1) ) {
|
||||||
move_cursor(&state,0,0);
|
move_cursor(&state,0,0);
|
||||||
} else {
|
} else {
|
||||||
|
if (invertdir==0) {
|
||||||
move_cursor(&state,0,state.y+1);
|
move_cursor(&state,0,state.y+1);
|
||||||
|
} else {
|
||||||
|
move_cursor(&state,state.x+1,0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
move_cursor(&state,0,state.y);
|
move_cursor(&state,0,state.y);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
if (invertdir==0) {
|
||||||
move_cursor(&state,state.x+1,state.y);
|
move_cursor(&state,state.x+1,state.y);
|
||||||
|
} else {
|
||||||
|
move_cursor(&state,state.x,state.y+1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1543,6 +1565,13 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SUDOKU_BUTTON_CHANGEDIR
|
||||||
|
case SUDOKU_BUTTON_CHANGEDIR:
|
||||||
|
/* Change scroll wheel direction */
|
||||||
|
invertdir=!invertdir;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
if (rb->default_event_handler(button) == SYS_USB_CONNECTED) {
|
if (rb->default_event_handler(button) == SYS_USB_CONNECTED) {
|
||||||
/* Quit if USB has been connected */
|
/* Quit if USB has been connected */
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
#define SUDOKU_BUTTON_MENU BUTTON_MENU
|
#define SUDOKU_BUTTON_MENU BUTTON_MENU
|
||||||
#define SUDOKU_BUTTON_LEFT BUTTON_SCROLL_BACK
|
#define SUDOKU_BUTTON_LEFT BUTTON_SCROLL_BACK
|
||||||
#define SUDOKU_BUTTON_RIGHT BUTTON_SCROLL_FWD
|
#define SUDOKU_BUTTON_RIGHT BUTTON_SCROLL_FWD
|
||||||
#define SUDOKU_BUTTON_ALTTOGGLE BUTTON_SELECT
|
#define SUDOKU_BUTTON_CHANGEDIR BUTTON_SELECT
|
||||||
#define SUDOKU_BUTTON_TOGGLE BUTTON_RIGHT
|
#define SUDOKU_BUTTON_TOGGLE BUTTON_RIGHT
|
||||||
#define SUDOKU_BUTTON_TOGGLEBACK BUTTON_LEFT
|
#define SUDOKU_BUTTON_TOGGLEBACK BUTTON_LEFT
|
||||||
#define SUDOKU_BUTTON_POSSIBLE BUTTON_PLAY
|
#define SUDOKU_BUTTON_POSSIBLE BUTTON_PLAY
|
||||||
|
|
|
@ -35,10 +35,12 @@ settings.
|
||||||
\opt{IRIVER_H10_PAD}{\ButtonScrollUp{} / \ButtonScrollDown{} / \ButtonLeft{} / \ButtonRight}
|
\opt{IRIVER_H10_PAD}{\ButtonScrollUp{} / \ButtonScrollDown{} / \ButtonLeft{} / \ButtonRight}
|
||||||
& Move the cursor\\
|
& Move the cursor\\
|
||||||
%
|
%
|
||||||
|
\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect & Change cursor move direction\\}
|
||||||
|
%
|
||||||
\opt{RECORDER_PAD}{\ButtonPlay}
|
\opt{RECORDER_PAD}{\ButtonPlay}
|
||||||
\opt{ONDIO_PAD}{\ButtonMenu}
|
\opt{ONDIO_PAD}{\ButtonMenu}
|
||||||
\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect{} / \ButtonOn}
|
\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect{} / \ButtonOn}
|
||||||
\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonLeft{} / \ButtonSelect{} / \ButtonRight}
|
\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonLeft{} / \ButtonRight}
|
||||||
\opt{IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD}{\ButtonSelect}
|
\opt{IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD}{\ButtonSelect}
|
||||||
\opt{IRIVER_H10_PAD}{\ButtonRew}
|
\opt{IRIVER_H10_PAD}{\ButtonRew}
|
||||||
\opt{SANSA_E200_PAD}{\ButtonScrollBack{} / \ButtonScrollFwd}
|
\opt{SANSA_E200_PAD}{\ButtonScrollBack{} / \ButtonScrollFwd}
|
||||||
|
@ -48,7 +50,7 @@ settings.
|
||||||
\opt{RECORDER_PAD}{Long \ButtonPlay}
|
\opt{RECORDER_PAD}{Long \ButtonPlay}
|
||||||
\opt{ONDIO_PAD}{Long \ButtonMenu+\ButtonDown}
|
\opt{ONDIO_PAD}{Long \ButtonMenu+\ButtonDown}
|
||||||
\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{Long \ButtonOn}
|
\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{Long \ButtonOn}
|
||||||
\opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonLeft{} / \ButtonSelect{} / \ButtonRight}
|
\opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonLeft{} / \ButtonRight}
|
||||||
\opt{IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD}{Long \ButtonSelect}
|
\opt{IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD}{Long \ButtonSelect}
|
||||||
\opt{IRIVER_H10_PAD}{Long \ButtonRew}
|
\opt{IRIVER_H10_PAD}{Long \ButtonRew}
|
||||||
\opt{SANSA_E200_PAD}{Long \ButtonScrollBack{} / \ButtonScrollFwd}
|
\opt{SANSA_E200_PAD}{Long \ButtonScrollBack{} / \ButtonScrollFwd}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue