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

Function addtocentry

src/blkdev.cpp:1301–1334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1299}
1300
1301static int addtocentry (uae_u8 **dstp, int *len, int point, int newpoint, int msf, uae_u8 *head, struct cd_toc_head *th)
1302{
1303 uae_u8 *dst = *dstp;
1304
1305 for (int i = 0; i < th->points; i++) {
1306 struct cd_toc *t = &th->toc[i];
1307 if (t->point == point) {
1308 if (*len < 8)
1309 return 0;
1310 int addr = t->paddress;
1311 if (msf)
1312 addr = lsn2msf (addr);
1313 dst[0] = 0;
1314 dst[1] = (t->adr << 4) | t->control;
1315 dst[2] = newpoint >= 0 ? newpoint : point;
1316 dst[3] = 0;
1317 dst[4] = addr >> 24;
1318 dst[5] = addr >> 16;
1319 dst[6] = addr >> 8;
1320 dst[7] = addr >> 0;
1321
1322 if (point >= 1 && point <= 99) {
1323 if (head[2] == 0)
1324 head[2] = point;
1325 head[3] = point;
1326 }
1327
1328 *len -= 8;
1329 *dstp = dst + 8;
1330 return 1;
1331 }
1332 }
1333 return -1;
1334}
1335
1336static int scsiemudrv (int unitnum, uae_u8 *cmd)
1337{

Callers 1

scsi_cd_emulateFunction · 0.85

Calls 1

lsn2msfFunction · 0.85

Tested by

no test coverage detected