@@ -323,7 +323,6 @@ static bool get_eject_state_cb(void) {
323323 */
324324static unsigned get_image_index_cb (void ) {
325325// log_cb(RETRO_LOG_DEBUG, "Disk control: get image index (%d)\n",diskIndex);
326- if (diskEjected) return diskCount + 1 ;
327326 return diskIndex;
328327}
329328
@@ -401,8 +400,7 @@ static bool set_initial_image_cb(unsigned index, const char *path) {return false
401400static bool get_image_path_cb (unsigned index, char *path, size_t len) {
402401 if (index >= diskCount) return false ;
403402 if (diskPaths[index].length () > 0 )
404- path=(char *)diskPaths[index].c_str ();
405- len=diskPaths[index].length ();
403+ strncpy (path, diskPaths[index].c_str (), len);
406404 log_cb (RETRO_LOG_DEBUG, " Disk control: get image path (%d) %s\n " ,index,path);
407405 return true ;
408406}
@@ -415,8 +413,7 @@ static bool get_image_path_cb(unsigned index, char *path, size_t len) {
415413static bool get_image_label_cb (unsigned index, char *label, size_t len) {
416414 if (index >= diskCount) return false ;
417415 if (diskNames[index].length () > 0 )
418- label=(char *)diskNames[index].c_str ();
419- len=diskNames[index].length ();
416+ strncpy (label, diskNames[index].c_str (), len);
420417 // log_cb(RETRO_LOG_DEBUG, "Disk control: get image label (%d) %s\n",index,label);
421418 return true ;
422419}
@@ -465,8 +462,10 @@ void retro_init(void)
465462 unsigned dci;
466463 if (environ_cb (RETRO_ENVIRONMENT_GET_DISK_CONTROL_INTERFACE_VERSION, &dci)) {
467464 environ_cb (RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE, &dccb_ext);
465+ log_cb (RETRO_LOG_DEBUG, " Using extended disk control interface\n " );
468466 } else {
469467 environ_cb (RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE, &dccb);
468+ log_cb (RETRO_LOG_DEBUG, " Using basic disk control interface\n " );
470469 }
471470
472471/* struct retro_led_interface led_interface;
@@ -580,7 +579,7 @@ void retro_get_system_info(struct retro_system_info *info)
580579{
581580 memset (info, 0 , sizeof (*info));
582581 info->library_name = " ep128emu" ;
583- info->library_version = " v1.2.3 " ;
582+ info->library_version = " v1.2.4 " ;
584583 info->need_fullpath = true ;
585584 info->valid_extensions = " img|dsk|tap|dtf|com|trn|128|bas|cas|cdt|tzx|wav|tvcwav|." ;
586585}
0 commit comments