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

Function allocide

src/idecontrollers.cpp:165–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165static struct ide_board *allocide(struct ide_board **idep, struct romconfig *rc, int ch)
166{
167 struct ide_board *ide;
168
169 if (ch < 0) {
170 if (*idep) {
171 freencrunit(*idep);
172 *idep = NULL;
173 }
174 ide = xcalloc(struct ide_board, 1);
175 for (int i = 0; i < MAX_IDE_UNITS; i++) {
176 if (ide_boards[i] == NULL) {
177 ide_boards[i] = ide;
178 rc->unitdata = ide;
179 ide->rc = rc;
180 ide->self_ptr = idep;
181 if (idep)
182 *idep = ide;
183 return ide;
184 }
185 }
186 }
187 return *idep;
188}
189
190static struct ide_board *getideboard(uaecptr addr)
191{

Callers 2

add_ide_standard_unitFunction · 0.85
gvp_add_ide_unitFunction · 0.85

Calls 1

freencrunitFunction · 0.70

Tested by

no test coverage detected