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

Function findtoc

src/blkdev_cdimage.cpp:135–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134
135static struct cdtoc *findtoc (struct cdunit *cdu, int *sectorp, bool data)
136{
137 int i;
138 int sector;
139
140 if (*sectorp < 0)
141 return NULL;
142 sector = *sectorp;
143 for (i = 0; i <= cdu->tracks; i++) {
144 struct cdtoc *t = &cdu->toc[i];
145 if (t->address - t->index1 > sector) {
146 if (i == 0) {
147 *sectorp = 0;
148 return t;
149 }
150 t--;
151 sector -= t->address - t->index1;
152 if (!data && sector < t->pregap)
153 return NULL; // pregap silence
154 *sectorp = sector;
155 return t;
156 }
157 }
158 return NULL;
159}
160
161static int do_read (struct cdunit *cdu, struct cdtoc *t, uae_u8 *data, int sector, int offset, int size, bool audio)
162{

Callers 3

cdda_play_func2Function · 0.85
command_rawreadFunction · 0.85
command_readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected