@@ -117,7 +117,7 @@ void update_display_func() {
117
117
previous_scaling_enabled = scaling_enabled ;
118
118
previous_filtering = filtering ;
119
119
previous_rotate = rotate ;
120
-
120
+
121
121
if (!scaling_enabled ) {
122
122
odroid_display_func = ili9341_write_frame_lynx_v2_original ;
123
123
} else {
@@ -193,21 +193,21 @@ NOINLINE void update_display_task()
193
193
xQueueSend (vidQueue , & param , portMAX_DELAY );
194
194
while (videoTaskIsRunning ) { vTaskDelay (1 ); }
195
195
printf ("VIDEO: Task: Stop done\n" );
196
-
196
+
197
197
printf ("VIDEO: Clear display\n" );
198
198
//odroid_display_lock();
199
199
ili9341_write_frame_lynx (NULL , NULL , false);
200
200
//odroid_display_unlock();
201
201
}
202
202
printf ("%s: Step #002\n" , __func__ );
203
203
TaskFunction_t taskFunc = & videoTask_mode0 ;
204
-
204
+
205
205
previous_scaling_enabled = scaling_enabled ;
206
206
previous_filtering = filtering ;
207
207
previous_rotate = rotate ;
208
-
208
+
209
209
my_setbutton_mapping (rotate );
210
-
210
+
211
211
if (!scaling_enabled ) {
212
212
switch (rotate ) {
213
213
case 0 : taskFunc = & videoTask_mode_original ; break ;
@@ -243,7 +243,7 @@ NOINLINE void update_display_task()
243
243
}
244
244
}
245
245
printf ("%s: Step #003\n" , __func__ );
246
-
246
+
247
247
printf ("\n************\n" );
248
248
printf ("\nVIDEO: Task: Start\n" );
249
249
@@ -262,7 +262,7 @@ void audioTask(void* arg)
262
262
{
263
263
// sound
264
264
struct audio_meta * param ;
265
-
265
+
266
266
AudioTaskIsRunning = true;
267
267
while (1 )
268
268
{
@@ -343,7 +343,7 @@ NOINLINE void DoMenuHome(bool save)
343
343
#ifdef CONFIG_IN_GAME_MENU_YES
344
344
odroid_display_lock ();
345
345
hud_menu ();
346
- printf ("\nACTION:%d\n" , ACTION );
346
+ printf ("\nACTION:%d\n" , ACTION );
347
347
switch (ACTION ) {
348
348
case 3 :
349
349
case 4 :
@@ -360,9 +360,9 @@ NOINLINE void DoMenuHome(bool save)
360
360
break ;
361
361
case 5 :
362
362
printf ("\nDELETE ROM\n" );
363
- break ;
364
- }
365
- ili9341_clear (0 );
363
+ break ;
364
+ }
365
+ ili9341_clear (0 );
366
366
odroid_display_unlock ();
367
367
#else
368
368
// Clear audio to prevent studdering
@@ -377,7 +377,7 @@ NOINLINE void DoMenuHome(bool save)
377
377
xQueueSend (vidQueue , & param , portMAX_DELAY );
378
378
while (videoTaskIsRunning ) { vTaskDelay (1 ); }
379
379
380
- odroid_gamepad_state joystick ;
380
+ odroid_gamepad_state joystick ;
381
381
odroid_input_gamepad_read (& joystick );
382
382
if (!joystick .values [ODROID_INPUT_START ] && !save )
383
383
{
@@ -400,7 +400,7 @@ NOINLINE void DoMenuHome(bool save)
400
400
// Set menu application
401
401
odroid_system_application_set (0 );
402
402
// Reset
403
- esp_restart ();
403
+ esp_restart ();
404
404
#endif
405
405
}
406
406
/*
@@ -488,10 +488,10 @@ inline void update_ui_fps() {
488
488
printf ("FPS:%f, BATTERY:%d [%d]\n" , fps , battery .millivolts , battery .percentage );
489
489
490
490
//printf("HEAP:0x%x, FPS:%f, BATTERY:%d [%d]\n", esp_get_free_heap_size(), fps, battery.millivolts, battery.percentage);
491
-
491
+
492
492
//vTaskGetRunTimeStats(pmem);
493
493
//printf(pmem);
494
-
494
+
495
495
frame = 0 ;
496
496
totalElapsedTime = 0 ;
497
497
/*if (config_ui_stats) {
@@ -588,9 +588,9 @@ size_t odroid_retro_audio_sample_batch_t(const int16_t *data, size_t frames) {
588
588
audio_update -> length = frames ;
589
589
// xQueueSend(audioQueue, &audio_update, portMAX_DELAY);
590
590
// *** odroid_audio_submit(audio_update->buffer, audio_update->length - 1);
591
-
591
+
592
592
odroid_audio_submit (audio_update -> buffer , audio_update -> length - 1 );
593
-
593
+
594
594
audio_update = (audio_update == & audio_update1 )?& audio_update2 :& audio_update1 ;
595
595
gAudioBuffer = audio_update -> buffer ;
596
596
#else
@@ -602,7 +602,7 @@ size_t odroid_retro_audio_sample_batch_t(const int16_t *data, size_t frames) {
602
602
uint16_t menuButtonFrameCount ;
603
603
odroid_gamepad_state previousState ;
604
604
bool ignoreMenuButton , menu_restart ;
605
-
605
+
606
606
void process_keys (odroid_gamepad_state * joystick )
607
607
{
608
608
#ifndef MY_KEYS_IN_CALLBACK
@@ -656,12 +656,12 @@ void process_keys(odroid_gamepad_state *joystick)
656
656
PowerDown();
657
657
}
658
658
*/
659
-
659
+
660
660
if (menuButtonFrameCount > 60 * 1 )
661
661
{
662
662
DoMenuHome (true);
663
663
}
664
-
664
+
665
665
if (!ignoreMenuButton && previousState .values [ODROID_INPUT_MENU ] && !joystick -> values [ODROID_INPUT_MENU ])
666
666
{
667
667
DoMenuHome (false);
@@ -677,7 +677,7 @@ void process_keys(odroid_gamepad_state *joystick)
677
677
{
678
678
update_display_task ();
679
679
}
680
-
680
+
681
681
// display_func_change = true;
682
682
//odroid_display_lock();
683
683
//ili9341_write_frame_lynx(NULL, NULL, false);
@@ -695,7 +695,7 @@ void process_keys(odroid_gamepad_state *joystick)
695
695
}
696
696
697
697
#ifdef MY_KEYS_IN_CALLBACK
698
- int16_t odroid_retro_input_state_t (unsigned port , unsigned device ,
698
+ int16_t odroid_retro_input_state_t (unsigned port , unsigned device ,
699
699
unsigned index , unsigned id ) {
700
700
int16_t rc ;
701
701
switch (id ) {
@@ -731,7 +731,7 @@ int16_t odroid_retro_input_state_t(unsigned port, unsigned device,
731
731
return rc ;
732
732
}
733
733
#else
734
- int16_t odroid_retro_input_state_t (unsigned port , unsigned device ,
734
+ int16_t odroid_retro_input_state_t (unsigned port , unsigned device ,
735
735
unsigned index , unsigned id ) {
736
736
return (1 <<id ) & retrolib_input_state_t ;
737
737
//return retrolib_input_state_t;
@@ -763,9 +763,9 @@ void odroid_retro_video_refresh_t(const void *data, unsigned width,
763
763
update_ui_fps ();
764
764
765
765
#ifdef MY_KEYS_IN_VIDEO
766
- odroid_gamepad_state joystick ;
766
+ odroid_gamepad_state joystick ;
767
767
odroid_input_gamepad_read (& joystick );
768
-
768
+
769
769
process_keys (& joystick );
770
770
previousState = joystick ;
771
771
#endif
@@ -777,9 +777,9 @@ void odroid_retro_video_refresh_t(const void *data, unsigned width,
777
777
xQueueSend (vidQueue , & data , portMAX_DELAY );
778
778
update_ui_fps ();
779
779
#ifdef MY_KEYS_IN_VIDEO
780
- odroid_gamepad_state joystick ;
780
+ odroid_gamepad_state joystick ;
781
781
odroid_input_gamepad_read (& joystick );
782
-
782
+
783
783
process_keys (& joystick );
784
784
previousState = joystick ;
785
785
#endif
@@ -798,11 +798,11 @@ void odroidgo_retro_init(void) {
798
798
printf ("File: ---\n" );
799
799
odroid_game .path = "/sd/roms/lynx/_debug.lnx" ;
800
800
}
801
-
801
+
802
802
odroid_game .data = NULL ;
803
803
odroid_game .size = 0 ;
804
804
odroid_game .meta = "dummy" ;
805
-
805
+
806
806
retro_set_environment (& odroidgo_env );
807
807
retro_set_audio_sample (& odroid_retro_audio_sample_t );
808
808
retro_set_video_refresh (& odroid_retro_video_refresh_t );
@@ -841,7 +841,7 @@ void app_loop(void)
841
841
while (true)
842
842
{
843
843
#ifndef MY_KEYS_IN_VIDEO
844
- odroid_gamepad_state joystick ;
844
+ odroid_gamepad_state joystick ;
845
845
odroid_input_gamepad_read (& joystick );
846
846
process_keys (& joystick );
847
847
#endif
@@ -857,29 +857,29 @@ NOINLINE void app_init(void)
857
857
{
858
858
printf ("lynx-handy (%s-%s).\n" , COMPILEDATE , GITREV );
859
859
// ESP_ERROR_CHECK( heap_trace_init_standalone(trace_record, NUM_RECORDS) );
860
-
860
+
861
861
framebuffer [0 ] = heap_caps_malloc (160 * 102 * 2 , MALLOC_CAP_8BIT | MALLOC_CAP_DMA );
862
862
if (!framebuffer [0 ]) abort ();
863
863
printf ("app_main: framebuffer[0]=%p\n" , framebuffer [0 ]);
864
864
865
865
framebuffer [1 ] = heap_caps_malloc (160 * 102 * 2 , MALLOC_CAP_8BIT | MALLOC_CAP_DMA );
866
866
if (!framebuffer [1 ]) abort ();
867
867
printf ("app_main: framebuffer[1]=%p\n" , framebuffer [1 ]);
868
-
868
+
869
869
//audio_update1.buffer = MY_MEM_ALLOC_FAST_EXT(unsigned short, AUDIO_BUFFER_SIZE, 1);
870
870
//audio_update2.buffer = MY_MEM_ALLOC_FAST_EXT(unsigned short, AUDIO_BUFFER_SIZE, 1);
871
871
audio_update1 .buffer = MY_MEM_ALLOC_FAST_EXT (short , AUDIO_BUFFER_SIZE , 1 );
872
872
audio_update2 .buffer = MY_MEM_ALLOC_FAST_EXT (short , AUDIO_BUFFER_SIZE , 1 );
873
-
873
+
874
874
gAudioBuffer = audio_update1 .buffer ;
875
875
#ifdef MY_AUDIO_MODE_V1
876
876
gAudioBufferPointer2 = gAudioBuffer ;
877
877
#endif
878
-
878
+
879
879
QuickSaveSetBuffer ( MY_MEM_ALLOC_SLOW (void , 512 * 1024 ) );
880
-
880
+
881
881
// ESP_ERROR_CHECK( heap_trace_start(HEAP_TRACE_LEAKS) );
882
-
882
+
883
883
nvs_flash_init ();
884
884
885
885
odroid_system_init ();
@@ -962,7 +962,7 @@ printf("lynx-handy (%s-%s).\n", COMPILEDATE, GITREV);
962
962
963
963
964
964
ili9341_init ();
965
-
965
+
966
966
char * cartName = odroid_settings_RomFilePath_get ();
967
967
printf ("%s: filename='%s'\n" , __func__ , cartName );
968
968
@@ -974,8 +974,8 @@ printf("lynx-handy (%s-%s).\n", COMPILEDATE, GITREV);
974
974
//xTaskCreatePinnedToCore(&videoTask, "videoTask", 1024 * 4, NULL, 5, &videoTaskHandle, 1);
975
975
audioQueue = xQueueCreate (1 , sizeof (uint16_t * ));
976
976
xTaskCreatePinnedToCore (& audioTask , "audioTask" , 2048 , NULL , 5 , NULL , 1 ); //768
977
-
978
-
977
+
978
+
979
979
esp_err_t r = odroid_sdcard_open (SD_BASE_PATH );
980
980
if (r != ESP_OK )
981
981
{
@@ -984,38 +984,38 @@ printf("lynx-handy (%s-%s).\n", COMPILEDATE, GITREV);
984
984
}
985
985
#ifdef CONFIG_IN_GAME_MENU_YES
986
986
hud_debug (odroid_util_GetFileName (cartName ));
987
- char * save_name = odroid_util_GetFileName (cartName );
987
+ char * save_name = odroid_util_GetFileName (cartName );
988
988
hud_check_saves (odroid_util_GetFileName (cartName ));
989
- #endif
990
-
989
+ #endif
990
+
991
991
odroid_display_lock ();
992
992
odroid_display_drain_spi ();
993
-
993
+
994
994
// ESP_ERROR_CHECK( heap_trace_start(HEAP_TRACE_LEAKS) );
995
995
printf ("LYNX-hande: 001\n" );
996
996
printf ("Version: %d; %d\n" , RETRO_API_VERSION , RETRO_MEMORY_VIDEO_RAM );
997
997
odroidgo_retro_init ();
998
998
//retro_init();
999
999
printf ("LYNX-hande: 002\n" );
1000
-
1000
+
1001
1001
printf ("Retro: API: %d\n" , retro_api_version ());
1002
1002
retro_get_system_info (& retro_info );
1003
1003
printf ("Retro: Info.library_name : %s\n" , retro_info .library_name );
1004
1004
printf ("Retro: Info.library_version : %s\n" , retro_info .library_version );
1005
1005
printf ("Retro: Info.need_fullpath : %d\n" , retro_info .need_fullpath );
1006
1006
printf ("Retro: Info.valid_extensions : %s\n" , retro_info .valid_extensions );
1007
1007
printf ("Retro: Info.block_extract : %d\n" , retro_info .block_extract );
1008
-
1008
+
1009
1009
odroid_display_unlock ();
1010
-
1010
+
1011
1011
if (!retro_load_game (& odroid_game )) {
1012
1012
printf ("LYNX-handy: 003 Gameload: Error\n" );
1013
1013
} else {
1014
1014
printf ("LYNX-handy: 003 Gameload: Ok\n" );
1015
1015
}
1016
-
1016
+
1017
1017
printf ("LYNX-handy: 003\n" );
1018
-
1018
+
1019
1019
// FIXME: Do some EMU stuff
1020
1020
// system_reset();
1021
1021
@@ -1030,7 +1030,7 @@ printf("lynx-handy (%s-%s).\n", COMPILEDATE, GITREV);
1030
1030
// system_reset();
1031
1031
}
1032
1032
odroidgo_retro_init_post ();
1033
-
1033
+
1034
1034
// ESP_ERROR_CHECK( heap_trace_stop() );
1035
1035
// heap_trace_dump();
1036
1036
@@ -1040,15 +1040,15 @@ printf("lynx-handy (%s-%s).\n", COMPILEDATE, GITREV);
1040
1040
totalElapsedTime = 0 ;
1041
1041
frame = 0 ;
1042
1042
scaling_enabled = odroid_settings_ScaleDisabled_get (ODROID_SCALE_DISABLE_SMS ) ? false : true;
1043
-
1043
+
1044
1044
odroid_ui_debug_enter_loop ();
1045
1045
startTime = xthal_get_ccount ();
1046
-
1046
+
1047
1047
dump_heap_info_short ();
1048
1048
printf ("unsigned char : %u\n" , sizeof (unsigned char ));
1049
1049
printf ("unsigned int : %u\n" , sizeof (unsigned int ));
1050
1050
printf ("unsigned long : %u\n" , sizeof (unsigned long ));
1051
-
1051
+
1052
1052
/*
1053
1053
uint32_t caps = MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT;
1054
1054
for (int i = 0; i < 64; i++) {
@@ -1068,7 +1068,7 @@ printf("lynx-handy (%s-%s).\n", COMPILEDATE, GITREV);
1068
1068
printf ("\n***********\nLoadState(%s)\n***********\n" , cartName );
1069
1069
LoadState (cartName );
1070
1070
}
1071
-
1071
+
1072
1072
update_display_task ();
1073
1073
}
1074
1074
@@ -1079,7 +1079,7 @@ void app_main(void)
1079
1079
}
1080
1080
1081
1081
void * my_special_alloc (unsigned char speed , unsigned char bytes , unsigned long size ) {
1082
- uint32_t caps = (speed ?MALLOC_CAP_INTERNAL :MALLOC_CAP_SPIRAM ) |
1082
+ uint32_t caps = (speed ?MALLOC_CAP_INTERNAL :MALLOC_CAP_SPIRAM ) |
1083
1083
( bytes == 1 ?MALLOC_CAP_8BIT :MALLOC_CAP_32BIT );
1084
1084
/*
1085
1085
if (speed) {
@@ -1120,7 +1120,7 @@ void SaveState()
1120
1120
1121
1121
1122
1122
char * pathName = odroid_sdcard_create_savefile_path (SD_BASE_PATH , fileName );
1123
- if (!pathName ) abort ();
1123
+ if (!pathName ) abort ();
1124
1124
1125
1125
FILE * f = fopen (pathName , "w" );
1126
1126
if (f == NULL )
@@ -1188,7 +1188,7 @@ void LoadState(const char* cartName)
1188
1188
}
1189
1189
else
1190
1190
{
1191
- printf ("LoadState: loadstate OK.\n" );
1191
+ printf ("LoadState: loadstate OK.\n" );
1192
1192
1193
1193
{
1194
1194
uint8_t buf [8 ];
0 commit comments