@@ -74,9 +74,6 @@ char mountedDVRPParty[MOUNT_LIMIT][MAX_NAME];
7474int latestDVRPMount = -1 ;
7575#endif
7676
77- #ifdef MX4SIO
78- int mx4sio_idx = -1 ; // To keep track of wich mass#:/ device represents MX4SIO
79- #endif
8077
8178int file_show = 1 ; //dlanor: 0==name_only, 1==name+size+time, 2==title+size+time
8279int file_sort = 1 ; //dlanor: 0==none, 1==name, 2==title, 3==mtime
@@ -170,7 +167,8 @@ typedef struct
170167int PSU_content ; //Used to count PSU content headers for the main header
171168
172169//USB_mass definitions for multiple drive usage
173- char USB_mass_ix [10 ] = {'0' , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
170+ char USB_mass_ix [USB_MASS_MAX_DRIVES ] = {'0' , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
171+ char USB_mass_bx [USB_MASS_MAX_DRIVES ] = {BD_UNKNOWN , BD_UNKNOWN , BD_UNKNOWN , BD_UNKNOWN , BD_UNKNOWN , BD_UNKNOWN , BD_UNKNOWN , BD_UNKNOWN , BD_UNKNOWN , BD_UNKNOWN };
174172int USB_mass_max_drives = USB_MASS_MAX_DRIVES ;
175173u64 USB_mass_scan_time = 0 ;
176174int USB_mass_scanned = 0 ; //0==Not_found_OR_No_Multi 1==found_Multi_mass_once
@@ -1292,36 +1290,40 @@ int readXFROM(const char *path, FILEINFO *info, int max)
12921290#endif
12931291void scan_USB_mass (void )
12941292{
1295- #ifdef MX4SIO
1293+ #ifdef BDM
12961294 static char DEVID [5 ];
12971295#endif
1298- int i , dd ;
1296+ int i , dd , x ;
12991297 iox_stat_t chk_stat ;
13001298 char mass_path [8 ] = "mass0:/" ;
13011299 if ((USB_mass_max_drives < 2 ) //No need for dynamic lists with only one drive
13021300 || (USB_mass_scanned && ((Timer () - USB_mass_scan_time ) < 5000 )))
13031301 return ;
13041302
1305- #ifdef MX4SIO
1306- mx4sio_idx = -1 ; //assume none is mx4sio // this MUST ALWAYS be after the USB_mass_scan_time check
1307- #endif
1308-
13091303 for (i = 0 ; i < USB_mass_max_drives ; i ++ ) {
13101304 mass_path [4 ] = '0' + i ;
1305+ #ifdef BDM
1306+ USB_mass_bx [i ] = BD_UNKNOWN ;
1307+ #endif
13111308 if (fileXioGetStat (mass_path , & chk_stat ) < 0 ) {
13121309 USB_mass_ix [i ] = 0 ;
13131310 continue ;
13141311 }
1315- #ifdef MX4SIO
1312+ #ifdef BDM
13161313 if ((dd = fileXioDopen (mass_path )) >= 0 ) {
13171314 int * intptr_ctl = (int * )DEVID ;
13181315 * intptr_ctl = fileXioIoctl (dd , USBMASS_IOCTL_GET_DRIVERNAME , "" );
13191316 fileXioDclose (dd );
1320- if (!strncmp (DEVID , "sdc" , 3 ))
1321- {
1322- mx4sio_idx = i ;
1323- DPRINTF ("%s: Found MX4SIO device at mass%d:/\n" , __func__ , i );
1324- }
1317+ for (x = BD_USB ; x < BD_COUNT ; x ++ )
1318+ {
1319+ if (!strcmp (DEVID , bdmnames [x ]))
1320+ {
1321+ USB_mass_bx [x ] = i ;
1322+ DPRINTF ("%s: Found %s device at mass%d:/\n" , __func__ , bdmnames [x ], i );
1323+ break ;
1324+ }
1325+ }
1326+
13251327 }
13261328#endif
13271329 USB_mass_ix [i ] = '0' + i ;
@@ -4370,19 +4372,26 @@ int getFilePath(char *out, int cnfmode)
43704372 else if ((file_show == 2 ) && files [top + i ].title [0 ] != 0 ) {
43714373 mcTitle = files [top + i ].title ;
43724374 } else { //Show normal file/folder names
4373- #ifdef MX4SIO
4375+ #ifdef BDM
43744376 if (path [0 ] == 0 ) { // we are on root. apply the unique "alias" here
4375- if ((!strncmp (files [top + i ].name , "mass" , 4 )) //
4376- && (files [top + i ].name [4 ] == ('0' + mx4sio_idx ) || (mx4sio_idx == 0 && files [top + i ].name [4 ] == ':' )) //index corresponds to mx4sio index, also assume that if device path index 4 is equal to ':' then it is index 0
4377- )
4378- strcpy (tmp , "mx4sio:" );
4377+ if ((!strncmp (files [top + i ].name , "mass" , 4 ))) {
4378+ int msindex = 0 ;
4379+ if (isdigit (files [top + i ].name [4 ]))
4380+ msindex = files [top + i ].name [4 ] - '0' ;
4381+
4382+ if (USB_mass_bx [msindex ] > BD_UNKNOWN ) {
4383+ bdmpaths [USB_mass_bx [msindex ]][bdmpathsindx [USB_mass_bx [msindex ]]] = '0' + msindex ;
4384+ strcpy (tmp , bdmpaths [msindex ]);
4385+ } else
4386+ strcpy (tmp , files [top + i ].name );
4387+ }
43794388 else
43804389 strcpy (tmp , files [top + i ].name );
4381- } else {
4382- strcpy (tmp , files [top + i ].name );
4383- }
4390+ } else {
4391+ strcpy (tmp , files [top + i ].name );
4392+ }
43844393#else
4385- strcpy (tmp , files [top + i ].name );
4394+ strcpy (tmp , files [top + i ].name );
43864395#endif
43874396 if (file_show > 0 ) { //Does display mode include file details ?
43884397 name_limit = 43 * 8 ;
0 commit comments