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

Function DBWrite

src/dolphin/src/OdemuExi2/DebuggerDriver.c:391–428  ·  view source on GitHub ↗

* --INFO-- * Address: 80221CF0 * Size: 000260 */

Source from the content-addressed store, hash-verified

389 * Size: 000260
390 */
391BOOL DBWrite(const void* src, u32 size)
392{
393 u32 v;
394 u32 busyFlag;
395 BOOL interrupts;
396
397 interrupts = OSDisableInterrupts();
398
399 do
400 {
401 DBGReadStatus(&busyFlag);
402 } while (busyFlag & 2);
403
404 SendCount++;
405 v = ((SendCount & 1) ? 0x1000 : 0);
406
407 while (!DBGWrite(v | 0x1c000, (u32*)src, ROUND_UP(size, 4)))
408 ;
409
410 do
411 {
412 DBGReadStatus(&busyFlag);
413 } while (busyFlag & 2);
414
415 v = (SendCount << 0x10) | 0x1F000000 | size;
416 while (!DBGWriteMailbox(v))
417 ;
418
419 do
420 {
421 while (!DBGReadStatus(&busyFlag))
422 ;
423 } while (busyFlag & 2);
424
425 OSRestoreInterrupts(interrupts);
426
427 return 0;
428}
429
430/*
431 * --INFO--

Callers

nothing calls this directly

Calls 4

OSDisableInterruptsFunction · 0.85
DBGReadStatusFunction · 0.85
DBGWriteFunction · 0.85
DBGWriteMailboxFunction · 0.85

Tested by

no test coverage detected