MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / sys_command_info

Function sys_command_info

src/blkdev.cpp:1098–1136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1096 return di2;
1097}
1098struct device_info *sys_command_info (int unitnum, struct device_info *di, int quick)
1099{
1100 struct device_info *dix;
1101
1102 dix = sys_command_info_session (unitnum, di, quick, -1);
1103 if (dix && dix->media_inserted && !quick && !dix->audio_playing) {
1104 TCHAR *name = NULL;
1105#ifdef AMIBERRY
1106 uae_u8 buf[4096];
1107#else
1108 uae_u8 buf[2048];
1109#endif
1110 if (sys_command_cd_read(unitnum, buf, 16, 1)) {
1111 if ((buf[0] == 1 || buf[0] == 2) && !memcmp(buf + 1, "CD001", 5)) {
1112 TCHAR *p;
1113#ifdef AMIBERRY
1114 char vol[33];
1115 char sysid[33];
1116 memcpy(vol, buf + 40, 32);
1117 vol[32] = 0;
1118 memcpy(sysid, buf + 8, 32);
1119 sysid[32] = 0;
1120 au_copy(dix->volume_id, 32, vol);
1121 au_copy(dix->system_id, 32, sysid);
1122#else
1123 au_copy(dix->volume_id, 32, (uae_char*)buf + 40);
1124 au_copy(dix->system_id, 32, (uae_char*)buf + 8);
1125#endif
1126 p = dix->volume_id + _tcslen(dix->volume_id) - 1;
1127 while (p > dix->volume_id && *p == ' ')
1128 *p-- = 0;
1129 p = dix->system_id + _tcslen(dix->system_id) - 1;
1130 while (p > dix->system_id && *p == ' ')
1131 *p-- = 0;
1132 }
1133 }
1134 }
1135 return dix;
1136}
1137
1138#define MODE_SELECT_6 0x15
1139#define MODE_SENSE_6 0x1a

Callers 15

sys_cddev_openFunction · 0.85
devinfoFunction · 0.85
scsiemul_switchscsiFunction · 0.85
dev_resetFunction · 0.85
getunitinfoFunction · 0.85
cd_statusline_labelFunction · 0.85
blkdev_cd_changeFunction · 0.85
blkdev_get_infoFunction · 0.85
blkdev_enterguiFunction · 0.85
blkdev_exitguiFunction · 0.85
scsi_cd_emulateFunction · 0.85
open_unitFunction · 0.85

Calls 3

sys_command_info_sessionFunction · 0.85
sys_command_cd_readFunction · 0.85
au_copyFunction · 0.85

Tested by

no test coverage detected