@@ -12,6 +12,7 @@ struct ConsoleTab
1212 void (* loadingProc )();
1313 void (* drawingProc )();
1414 void (* keyDownProc )(uint32 );
15+ void (* touchRdProc )();
1516 void (* leavingProc )();
1617};
1718
@@ -103,26 +104,38 @@ void PlayTabDrawing()
103104 iprintf (PlayerState ? PlayButton : PauseButton );
104105}
105106
107+ void PlayTabPlayButtonPressed ()
108+ {
109+ s16 index = 7 * CurrentPage + PageSelection ;
110+ if (PlayerLoadedFileIndex != index )
111+ {
112+ c_goto (18 ,10 );
113+ iprintf ("Loading..." );
114+ ppm_loadAnimationData ();
115+ c_goto (18 ,10 );
116+ iprintf (" " );
117+ PlayerLoadedFileIndex = index ;
118+ }
119+ PlayerState = 1 - PlayerState ;
120+ iprintf (PlayerState ? PlayButton : PauseButton );
121+ PlayerThumbnailNeedsRedraw = true;
122+ }
123+
106124void PlayTabKeyDown (uint32 input )
107125{
108126 if (input & KEY_A )
109127 {
110- s16 index = 7 * CurrentPage + PageSelection ;
111- if (PlayerLoadedFileIndex != index )
112- {
113- c_goto (18 ,10 );
114- iprintf ("Loading..." );
115- ppm_loadAnimationData ();
116- c_goto (18 ,10 );
117- iprintf (" " );
118- PlayerLoadedFileIndex = index ;
119- }
120- PlayerState = 1 - PlayerState ;
121- iprintf (PlayerState ? PlayButton : PauseButton );
122- PlayerThumbnailNeedsRedraw = true;
128+ PlayTabPlayButtonPressed ();
123129 }
124130}
125131
132+ void PlayTabRdTouch ()
133+ {
134+ if (104 <=touch .px && touch .px < 152 && 72 <=touch .py && touch .py < 120 )
135+ PlayTabPlayButtonPressed ();
136+
137+ }
138+
126139void PlayTabLeaving ()
127140{
128141 PlayerState = PAUSED ;
@@ -141,20 +154,23 @@ void initTabs()
141154 FilesTab .loadingProc = TabNoAction ;
142155 FilesTab .drawingProc = FilesTabDrawing ;
143156 FilesTab .keyDownProc = FilesTabKeyDown ;
157+ FilesTab .touchRdProc = TabNoAction ;
144158 FilesTab .leavingProc = TabNoAction ;
145159 FilesTab .left = & PlayTab ;
146160 FilesTab .right = & InfoTab ;
147161
148162 InfoTab .loadingProc = InfoTabLoading ;
149163 InfoTab .drawingProc = InfoTabDrawing ;
150164 InfoTab .keyDownProc = TabNoAction ;
165+ InfoTab .touchRdProc = TabNoAction ;
151166 InfoTab .leavingProc = TabNoAction ;
152167 InfoTab .left = & FilesTab ;
153168 InfoTab .right = & PlayTab ;
154169
155170 PlayTab .loadingProc = PlayTabLoading ;
156171 PlayTab .drawingProc = PlayTabDrawing ;
157172 PlayTab .keyDownProc = PlayTabKeyDown ;
173+ PlayTab .touchRdProc = PlayTabRdTouch ;
158174 PlayTab .leavingProc = PlayTabLeaving ;
159175 PlayTab .left = & InfoTab ;
160176 PlayTab .right = & FilesTab ;
0 commit comments