@@ -146,6 +146,7 @@ int gameFPS; /* Auto(0), 60, 30, 15 */
146
146
int soundEnabled ; /* also acts as a boolean */
147
147
int customMidi ; /* Also acts as a boolean */
148
148
int maxMidiPlayers ; /* Maximum amount of MIDI Players allowed on FreeJ2ME at any given time */
149
+ int dumpAudioStreams ;
149
150
/* Variables used to manage the pointer speed when controlled from an analog stick */
150
151
int pointerXSpeed = 8 ;
151
152
int pointerYSpeed = 8 ;
@@ -356,6 +357,13 @@ static void check_variables(bool first_time_startup)
356
357
else if (!strcmp (var .value , "96" )) { maxMidiPlayers = 96 ; }
357
358
}
358
359
360
+ var .key = "freej2me_dumpaudiostreams" ;
361
+ if (Environ (RETRO_ENVIRONMENT_GET_VARIABLE , & var ) && var .value )
362
+ {
363
+ if (!strcmp (var .value , "off" )) { dumpAudioStreams = 0 ; }
364
+ else if (!strcmp (var .value , "on" )) { dumpAudioStreams = 1 ; }
365
+ }
366
+
359
367
var .key = "freej2me_pointertype" ;
360
368
if (Environ (RETRO_ENVIRONMENT_GET_VARIABLE , & var ) && var .value )
361
369
{
@@ -434,7 +442,7 @@ static void check_variables(bool first_time_startup)
434
442
435
443
436
444
/* Prepare a string to pass those core options to the Java app */
437
- snprintf (options_update , PIPE_MAX_LEN , "FJ2ME_LR_OPTS:|%lux%lu|%d|%d|%d|%d|%d|%d|%d" , screenRes [0 ], screenRes [1 ], rotateScreen , phoneType , gameFPS , soundEnabled , customMidi , maxMidiPlayers );
445
+ snprintf (options_update , PIPE_MAX_LEN , "FJ2ME_LR_OPTS:|%lux%lu|%d|%d|%d|%d|%d|%d|%d" , screenRes [0 ], screenRes [1 ], rotateScreen , phoneType , gameFPS , soundEnabled , customMidi , maxMidiPlayers , dumpAudioStreams );
438
446
optstrlen = strlen (options_update );
439
447
440
448
/* 0xD = 13, which is the special case where the java app will receive the updated configs */
@@ -494,7 +502,7 @@ void retro_init(void)
494
502
*/
495
503
check_variables (true);
496
504
497
- char resArg [2 ][4 ], rotateArg [2 ], phoneArg [2 ], fpsArg [3 ], soundArg [2 ], midiArg [2 ], maxMidiArg [3 ];
505
+ char resArg [2 ][4 ], rotateArg [2 ], phoneArg [2 ], fpsArg [3 ], soundArg [2 ], midiArg [2 ], maxMidiArg [3 ], dumpAudioArg [ 2 ] ;
498
506
sprintf (resArg [0 ], "%lu" , screenRes [0 ]); /* Libretro config Width */
499
507
sprintf (resArg [1 ], "%lu" , screenRes [1 ]); /* Libretro config Height */
500
508
sprintf (rotateArg , "%d" , rotateScreen );
@@ -503,16 +511,17 @@ void retro_init(void)
503
511
sprintf (soundArg , "%d" , soundEnabled );
504
512
sprintf (midiArg , "%d" , customMidi );
505
513
sprintf (maxMidiArg ,"%d" , maxMidiPlayers );
514
+ sprintf (dumpAudioArg , "%d" , dumpAudioStreams );
506
515
507
516
/* start java process */
508
517
char * javapath ;
509
518
Environ (RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY , & javapath );
510
519
char * outPath = malloc (sizeof (char ) * PATH_MAX_LENGTH );
511
520
fill_pathname_join (outPath , javapath , "freej2me-lr.jar" , PATH_MAX_LENGTH );
512
- char * params [] = { "java" , "-jar" , outPath , resArg [0 ], resArg [1 ], rotateArg , phoneArg , fpsArg , soundArg , midiArg , maxMidiArg , NULL };
521
+ char * params [] = { "java" , "-jar" , outPath , resArg [0 ], resArg [1 ], rotateArg , phoneArg , fpsArg , soundArg , midiArg , maxMidiArg , dumpAudioArg , NULL };
513
522
514
523
log_fn (RETRO_LOG_INFO , "Passing params: %s | %s | %s | %s | %s | %s | %s | %s | %s\n" , * (params + 3 ),
515
- * (params + 4 ), * (params + 5 ), * (params + 6 ), * (params + 7 ), * (params + 8 ), * (params + 9 ), * (params + 10 ));
524
+ * (params + 4 ), * (params + 5 ), * (params + 6 ), * (params + 7 ), * (params + 8 ), * (params + 9 ), * (params + 10 ), * ( params + 11 ) );
516
525
log_fn (RETRO_LOG_INFO , "Preparing to open FreeJ2ME's Java app (make sure freej2me-lr.jar is inside system/).\n" );
517
526
518
527
#ifdef __linux__
@@ -1005,7 +1014,7 @@ pid_t javaOpen(char *cmd, char **params)
1005
1014
1006
1015
log_fn (RETRO_LOG_INFO , "Opening: %s %s %s ...\n" , * (params + 0 ), * (params + 1 ), * (params + 2 ));
1007
1016
log_fn (RETRO_LOG_INFO , "Params: %s | %s | %s | %s | %s | %s | %s | %s | %s\n" , * (params + 3 ),
1008
- * (params + 4 ), * (params + 5 ), * (params + 6 ), * (params + 7 ), * (params + 8 ), * (params + 9 ), * (params + 10 ));
1017
+ * (params + 4 ), * (params + 5 ), * (params + 6 ), * (params + 7 ), * (params + 8 ), * (params + 9 ), * (params + 10 ), * ( params + 11 ) );
1009
1018
1010
1019
int fd_stdin = 0 ;
1011
1020
int fd_stdout = 1 ;
@@ -1134,15 +1143,15 @@ void javaOpen(char *cmd, char **params)
1134
1143
sprintf (cmdWin , "javaw -jar %s" , cmd );
1135
1144
1136
1145
log_fn (RETRO_LOG_INFO , "Opening: %s \n" , cmd );
1137
- for (int i = 3 ; i <= 10 ; i ++ ) /* There are 10 cmd arguments for now */
1146
+ for (int i = 3 ; i <= 11 ; i ++ ) /* There are 10 cmd arguments for now */
1138
1147
{
1139
1148
log_fn (RETRO_LOG_INFO , "Processing arg %d: %s \n" , i , * (params + i ));
1140
1149
sprintf (cmdWin , "%s %s" , cmdWin , * (params + i ));
1141
1150
}
1142
1151
1143
1152
log_fn (RETRO_LOG_INFO , "Creating proc: %s \n" , cmdWin );
1144
1153
log_fn (RETRO_LOG_INFO , "Params: %s | %s | %s | %s | %s | %s | %s | %s | %s\n" , * (params + 3 ),
1145
- * (params + 4 ), * (params + 5 ), * (params + 6 ), * (params + 7 ), * (params + 8 ), * (params + 9 ), * (params + 10 ));
1154
+ * (params + 4 ), * (params + 5 ), * (params + 6 ), * (params + 7 ), * (params + 8 ), * (params + 9 ), * (params + 10 ), * ( params + 11 ) );
1146
1155
1147
1156
GetStartupInfo (& startInfo );
1148
1157
startInfo .dwFlags = STARTF_USESTDHANDLES ;
0 commit comments