MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / Process

Method Process

Source/Core/PIF.cpp:317–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315void IController::OnRomClose() {}
316
317void IController::Process()
318{
319#ifdef DAEDALUS_DEBUG_PIF
320 memcpy(mpInput, mpPifRam, 64);
321 DPF_PIF("");
322 DPF_PIF("");
323 DPF_PIF("*********************************************");
324 DPF_PIF("** **");
325#endif
326
327 u32 count {}, channel {};
328 u32 *tmp {(u32*)mpPifRam};
329 if ((tmp[0] == 0xFFFFFFFF) &&
330 (tmp[1] == 0xFFFFFFFF) &&
331 (tmp[2] == 0xFFFFFFFF) &&
332 (tmp[3] == 0xFFFFFFFF))
333 {
334 #ifdef DAEDALUS_DEBUG_CONSOLE
335 DBGConsole_Msg(0, "[YDecrypting PifRam]");
336 #endif
337 n64_cic_nus_6105();
338 return;
339 }
340
341 // Read controller data here (here gets called fewer times than CONT_READ_CONTROLLER)
342 CInputManager::Get()->GetState( mContPads );
343
344 while(count < 64)
345 {
346 u8 *cmd {&mpPifRam[count]};
347
348 // command is ready
349 if(cmd[0] == CONT_TX_SIZE_FORMAT_END)
350 {
351 break;
352 }
353
354 // dummy data..
355 if((cmd[0] == CONT_TX_SIZE_DUMMYDATA) || (cmd[0] == CONT_TX_SIZE_CHANRESET))
356 {
357 count++;
358 continue;
359 }
360
361 #ifdef DAEDALUS_ENABLE_ASSERTS
362 DAEDALUS_ASSERT( (cmd[0] != 0xB4) || (cmd[0] != 0x56) || (cmd[0] != 0xB8), "PIF : NOP command? %02x", cmd[0] );
363 #endif
364 // next channel
365 if(cmd[0] == CONT_TX_SIZE_CHANSKIP)
366 {
367 count++;
368 channel++;
369 continue;
370 }
371
372 // 0-3 = controller channel
373 if( channel < PC_EEPROM )
374 {

Callers 1

DMA_SI_CopyToDRAMFunction · 0.45

Calls 1

GetStateMethod · 0.45

Tested by

no test coverage detected