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

Function MemoryUpdateSPStatus

Source/Core/Memory.cpp:605–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605void MemoryUpdateSPStatus( u32 flags )
606{
607#ifdef DEBUG_SP_STATUS_REG
608 DBGConsole_Msg( 0, "----------" );
609 if (flags & SP_CLR_HALT) DBGConsole_Msg( 0, "SP: Clearing Halt" );
610 if (flags & SP_SET_HALT) DBGConsole_Msg( 0, "SP: Setting Halt" );
611 if (flags & SP_CLR_BROKE) DBGConsole_Msg( 0, "SP: Clearing Broke" );
612 // No SP_SET_BROKE
613 if (flags & SP_CLR_INTR) DBGConsole_Msg( 0, "SP: Clearing Interrupt" );
614 if (flags & SP_SET_INTR) DBGConsole_Msg( 0, "SP: Setting Interrupt" );
615 if (flags & SP_CLR_SSTEP) DBGConsole_Msg( 0, "SP: Clearing Single Step" );
616 if (flags & SP_SET_SSTEP) DBGConsole_Msg( 0, "SP: Setting Single Step" );
617 if (flags & SP_CLR_INTR_BREAK) DBGConsole_Msg( 0, "SP: Clearing Interrupt on break" );
618 if (flags & SP_SET_INTR_BREAK) DBGConsole_Msg( 0, "SP: Setting Interrupt on break" );
619 if (flags & SP_CLR_SIG0) DBGConsole_Msg( 0, "SP: Clearing Sig0 (Yield)" );
620 if (flags & SP_SET_SIG0) DBGConsole_Msg( 0, "SP: Setting Sig0 (Yield)" );
621 if (flags & SP_CLR_SIG1) DBGConsole_Msg( 0, "SP: Clearing Sig1 (Yielded)" );
622 if (flags & SP_SET_SIG1) DBGConsole_Msg( 0, "SP: Setting Sig1 (Yielded)" );
623 if (flags & SP_CLR_SIG2) DBGConsole_Msg( 0, "SP: Clearing Sig2 (TaskDone)" );
624 if (flags & SP_SET_SIG2) DBGConsole_Msg( 0, "SP: Setting Sig2 (TaskDone)" );
625 if (flags & SP_CLR_SIG3) DBGConsole_Msg( 0, "SP: Clearing Sig3" );
626 if (flags & SP_SET_SIG3) DBGConsole_Msg( 0, "SP: Setting Sig3" );
627 if (flags & SP_CLR_SIG4) DBGConsole_Msg( 0, "SP: Clearing Sig4" );
628 if (flags & SP_SET_SIG4) DBGConsole_Msg( 0, "SP: Setting Sig4" );
629 if (flags & SP_CLR_SIG5) DBGConsole_Msg( 0, "SP: Clearing Sig5" );
630 if (flags & SP_SET_SIG5) DBGConsole_Msg( 0, "SP: Setting Sig5" );
631 if (flags & SP_CLR_SIG6) DBGConsole_Msg( 0, "SP: Clearing Sig6" );
632 if (flags & SP_SET_SIG6) DBGConsole_Msg( 0, "SP: Setting Sig6" );
633 if (flags & SP_CLR_SIG7) DBGConsole_Msg( 0, "SP: Clearing Sig7" );
634 if (flags & SP_SET_SIG7) DBGConsole_Msg( 0, "SP: Setting Sig7" );
635#endif
636
637 // If !HALT && !BROKE
638
639 bool start_rsp {false}, stop_rsp {false};
640 u32 clr_bits {}, set_bits {};
641
642 if (flags & SP_CLR_HALT)
643 {
644 clr_bits |= SP_STATUS_HALT;
645 start_rsp = true;
646 }
647 else if (flags & SP_SET_HALT)
648 {
649 set_bits |= SP_STATUS_HALT;
650 stop_rsp = true;
651 }
652
653 if (flags & SP_SET_INTR) // Shouldn't ever set this?
654 {
655 Memory_MI_SetRegisterBits(MI_INTR_REG, MI_INTR_SP);
656 R4300_Interrupt_UpdateCause3();
657 }
658 else if (flags & SP_CLR_INTR)
659 {
660 Memory_MI_ClrRegisterBits(MI_INTR_REG, MI_INTR_SP);
661 R4300_Interrupt_UpdateCause3();
662 }

Callers

nothing calls this directly

Calls 2

RSP_HLE_ProcessTaskFunction · 0.85

Tested by

no test coverage detected