MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / fcb

Function fcb

src/SB/Core/gc/iSnd.cpp:277–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275static void iSndMyAXFree(AXVPB**);
276
277static void fcb()
278{
279 if (!soundInited && iTRCDisk::IsDiskIDed())
280 {
281 return;
282 }
283
284 fc++;
285 S32 i;
286 S32 need_update = TRUE;
287 for (i = 0; i < 6; i++)
288 {
289 xSndVoiceInfo* gsnd_voice = &gSnd.voice[i];
290 U32 orig_flags = streams[i].vinf.flags;
291 if (streams[i].vinf.voice == NULL)
292 {
293 continue;
294 }
295
296 u16 addrHi = streams[i].vinf.voice->pb.addr.currentAddressHi;
297 if (orig_flags & 0xe0006)
298 {
299 continue;
300 }
301 u32 addr = addrHi << 16;
302 addr += streams[i].vinf.voice->pb.addr.currentAddressLo;
303 U32 dest = streams[i].dest_b;
304 dump_flags(orig_flags);
305
306 if (dest * 2 < addr && (orig_flags & 0x4000) == 0 && (orig_flags & 0x8) == 0)
307 {
308 streams[i].vinf.flags |= 0x4000;
309 streams[i].vinf.flags &= ~0x8000;
310 streams[i].vinf.flags &= ~0x2000;
311 if ((orig_flags & 0x1000000) && streams[i].source_b == 0)
312 {
313 streams[i].vinf.flags |= 0x2000000;
314 }
315 streams[i].x94 = streams[i].x90;
316 orig_flags = streams[i].vinf.flags;
317 }
318 else if (dest * 2 >= addr && (orig_flags & 0x8000) == 0)
319 {
320 streams[i].vinf.flags |= 0x8000;
321 streams[i].vinf.flags &= ~0x4000;
322 streams[i].vinf.flags &= ~0x1000;
323 if ((orig_flags & 0x1000000))
324 {
325 streams[i].vinf.flags |= 0x2000000;
326 }
327 orig_flags = streams[i].vinf.flags;
328 }
329
330 if ((orig_flags & 0x20) && (orig_flags & 0x4000))
331 {
332 streams[i].vinf.flags &= ~0x20;
333 dest = streams[i].dest_a * 2;
334 dest += streams[i].x24 & 0xFFFF;

Callers

nothing calls this directly

Calls 15

dump_flagsFunction · 0.85
AXSetVoiceLoopAddrFunction · 0.85
AXSetVoiceEndAddrFunction · 0.85
AXSetVoiceLoopFunction · 0.85
AXSetVoiceTypeFunction · 0.85
iSndMyAXFreeFunction · 0.85
DVDCancelAsyncFunction · 0.85
ARQRemoveRequestFunction · 0.85
AXSetVoiceStateFunction · 0.85
MIXReleaseChannelFunction · 0.85
AXAcquireVoiceFunction · 0.85
MIXInitChannelFunction · 0.85

Tested by

no test coverage detected