2525 int ACTION ;
2626#endif
2727
28+ static odroid_gamepad_state previousJoystickState ;
29+
2830#define AUDIO_SAMPLERATE 32000
2931#define AUDIO_FRAGSIZE (AUDIO_SAMPLERATE/NES_REFRESH_RATE)
3032
@@ -304,6 +306,7 @@ void osd_getinput(void)
304306 odroid_gamepad_state joystick ;
305307 odroid_input_gamepad_read (& joystick );
306308
309+
307310 if (joystick .values [ODROID_INPUT_MENU ]) {
308311 #ifdef CONFIG_IN_GAME_MENU_YES
309312 odroid_display_lock ();
@@ -335,6 +338,23 @@ void osd_getinput(void)
335338 odroid_overlay_game_settings_menu (NULL , 0 );
336339 }
337340
341+ // Scaling
342+ if (joystick .values [ODROID_INPUT_START ] && !previousJoystickState .values [ODROID_INPUT_RIGHT ] && joystick .values [ODROID_INPUT_RIGHT ])
343+ {
344+ uint8_t level = odroid_settings_Scaling_get ();
345+ uint8_t max = 2 ;
346+
347+ printf ("\n CHANGE SCALE: %d \n" , level );
348+
349+ level ++ ;
350+ if (level > max ) {level = 0 ;}
351+
352+ scalingMode = level ;
353+ odroid_settings_Scaling_set (level );
354+ //scaling_enabled = !scaling_enabled;
355+ //odroid_settings_ScaleDisabled_set(ODROID_SCALE_DISABLE_NES, scaling_enabled ? 0 : 1);
356+ }
357+
338358 // A
339359 if (!joystick .values [ODROID_INPUT_A ])
340360 b |= (1 << 13 );
@@ -377,6 +397,9 @@ void osd_getinput(void)
377397 changed >>= 1 ;
378398 b >>= 1 ;
379399 }
400+
401+ previousJoystickState = joystick ;
402+
380403}
381404
382405void osd_getmouse (int * x , int * y , int * button )
@@ -387,13 +410,14 @@ void osd_getmouse(int *x, int *y, int *button)
387410/**
388411 * Init/Shutdown
389412 */
390-
391413int osd_init ()
392414{
393415 log_chain_logfunc (osd_logprint );
394416
395417 osd_init_sound ();
396418
419+ previousJoystickState = odroid_input_read_raw ();
420+
397421 xTaskCreatePinnedToCore (& videoTask , "videoTask" , 2048 , NULL , 5 , NULL , 1 );
398422
399423 return 0 ;
0 commit comments