@@ -163,6 +163,11 @@ static void update_input(void)
163163 joypad0Buttons [BUTTON_4 ] = 0x00 ;
164164 joypad0Buttons [BUTTON_5 ] = 0x00 ;
165165 joypad0Buttons [BUTTON_6 ] = 0x00 ;
166+ joypad0Buttons [BUTTON_7 ] = 0x00 ;
167+ joypad0Buttons [BUTTON_8 ] = 0x00 ;
168+ joypad0Buttons [BUTTON_9 ] = 0x00 ;
169+ joypad0Buttons [BUTTON_s ] = 0x00 ;
170+ joypad0Buttons [BUTTON_d ] = 0x00 ;
166171
167172 joypad1Buttons [BUTTON_U ] = 0x00 ;
168173 joypad1Buttons [BUTTON_D ] = 0x00 ;
@@ -180,6 +185,11 @@ static void update_input(void)
180185 joypad1Buttons [BUTTON_4 ] = 0x00 ;
181186 joypad1Buttons [BUTTON_5 ] = 0x00 ;
182187 joypad1Buttons [BUTTON_6 ] = 0x00 ;
188+ joypad1Buttons [BUTTON_7 ] = 0x00 ;
189+ joypad1Buttons [BUTTON_8 ] = 0x00 ;
190+ joypad1Buttons [BUTTON_9 ] = 0x00 ;
191+ joypad1Buttons [BUTTON_s ] = 0x00 ;
192+ joypad1Buttons [BUTTON_d ] = 0x00 ;
183193
184194 if (libretro_supports_bitmasks )
185195 {
@@ -257,20 +267,30 @@ static void update_input(void)
257267 joypad1Buttons [BUTTON_PAUSE ] = 0xff ;
258268 if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_START ))
259269 joypad1Buttons [BUTTON_OPTION ] = 0xff ;
260- if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_X ))
270+ if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_X ) || ( input_state_cb ( 0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_p )? 1 : 0 ) )
261271 joypad1Buttons [BUTTON_0 ] = 0xff ;
262- if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_L ))
272+ if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_L ) || ( input_state_cb ( 0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_q )? 1 : 0 ) )
263273 joypad1Buttons [BUTTON_1 ] = 0xff ;
264- if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_R ))
274+ if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_R ) || ( input_state_cb ( 0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_w )? 1 : 0 ) )
265275 joypad1Buttons [BUTTON_2 ] = 0xff ;
266- if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_L2 ))
276+ if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_L2 ) || ( input_state_cb ( 0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_e )? 1 : 0 ) )
267277 joypad1Buttons [BUTTON_3 ] = 0xff ;
268- if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_R2 ))
278+ if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_R2 ) || ( input_state_cb ( 0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_r )? 1 : 0 ) )
269279 joypad1Buttons [BUTTON_4 ] = 0xff ;
270- if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_L3 ))
280+ if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_L3 ) || ( input_state_cb ( 0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_t )? 1 : 0 ) )
271281 joypad1Buttons [BUTTON_5 ] = 0xff ;
272- if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_R3 ))
282+ if (ret [1 ] & (1 << RETRO_DEVICE_ID_JOYPAD_R3 ) || ( input_state_cb ( 0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_y )? 1 : 0 ) )
273283 joypad1Buttons [BUTTON_6 ] = 0xff ;
284+ if ((input_state_cb (0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_u )? 1 : 0 ))
285+ joypad1Buttons [BUTTON_7 ] = 0xff ;
286+ if ((input_state_cb (0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_i )? 1 : 0 ))
287+ joypad1Buttons [BUTTON_8 ] = 0xff ;
288+ if ((input_state_cb (0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_o )? 1 : 0 ))
289+ joypad1Buttons [BUTTON_9 ] = 0xff ;
290+ if ((input_state_cb (0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_LEFTBRACKET )? 1 : 0 ))
291+ joypad1Buttons [BUTTON_s ] = 0xff ;
292+ if ((input_state_cb (0 , RETRO_DEVICE_KEYBOARD , 0 , RETROK_RIGHTBRACKET )? 1 : 0 ))
293+ joypad1Buttons [BUTTON_d ] = 0xff ;
274294}
275295
276296static void extract_basename (char * buf , const char * path , size_t size )
@@ -318,8 +338,8 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
318338 info -> timing .sample_rate = SAMPLERATE ;
319339 info -> geometry .base_width = game_width ;
320340 info -> geometry .base_height = game_height ;
321- info -> geometry .max_width = TOMGetVideoModeWidth ();
322- info -> geometry .max_height = TOMGetVideoModeHeight () ;
341+ info -> geometry .max_width = 652 ; // Highest value encountered during testing
342+ info -> geometry .max_height = vjs . hardwareTypeNTSC ? 240 : 256 ;
323343 info -> geometry .aspect_ratio = 4.0 / 3.0 ;
324344}
325345
@@ -548,5 +568,18 @@ void retro_run(void)
548568
549569 JaguarExecuteNew ();
550570 SoundCallback (NULL , sampleBuffer , vjs .hardwareTypeNTSC == 1 ?BUFNTSC :BUFPAL );
571+
572+ // Resolution changed
573+ if ((tomWidth != videoWidth || tomHeight != videoHeight ) && tomWidth > 0 && tomHeight > 0 )
574+ {
575+ videoWidth = tomWidth , videoHeight = tomHeight ;
576+ game_width = tomWidth , game_height = tomHeight ;
577+
578+ JaguarSetScreenPitch (game_width );
579+
580+ retro_get_system_av_info (& g_av_info );
581+ environ_cb (RETRO_ENVIRONMENT_SET_GEOMETRY , & g_av_info );
582+ }
583+
551584 video_cb (videoBuffer , game_width , game_height , game_width << 2 );
552585}
0 commit comments