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

Function DLParser_Process

Source/HLEGraphics/DLParser.cpp:513–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511//
512//*****************************************************************************
513u32 DLParser_Process(u32 instruction_limit, DLDebugOutput * debug_output)
514{
515 #ifdef DAEDALUS_ENABLE_PROFILING
516 DAEDALUS_PROFILE( "DLParser_Process" );
517 #endif
518 if ( !CGraphicsContext::Get()->IsInitialised() || !gRenderer )
519 {
520 return 0;
521 }
522
523 // Shut down the debug console when we start rendering
524 // TODO: Clear the front/backbuffer the first time this function is called
525 // to remove any stuff lingering on the screen.
526 if(gFirstCall)
527 {
528 CGraphicsContext::Get()->ClearAllSurfaces();
529
530 gFirstCall = false;
531 }
532
533 // Update Screen only when something is drawn, otherwise several games ex Army Men will flash or shake.
534 if( g_ROM.GameHacks != CHAMELEON_TWIST_2 ) gGraphicsPlugin->UpdateScreen();
535
536 OSTask * pTask {(OSTask *)(g_pu8SpMemBase + 0x0FC0)};
537 u32 code_base {(u32)pTask->t.ucode & 0x1fffffff};
538 u32 code_size {pTask->t.ucode_size};
539 u32 data_base {(u32)pTask->t.ucode_data & 0x1fffffff};
540 u32 data_size {pTask->t.ucode_data_size};
541 u32 stack_size {pTask->t.dram_stack_size >> 6};
542
543 if ( gLastUcodeBase != code_base )
544 {
545 DLParser_InitMicrocode( code_base, code_size, data_base, data_size );
546 }
547
548 //
549 // Not sure what to init this with. We should probably read it from the dmem
550 //
551 gRDPOtherMode.L = 0x00500001;
552 gRDPOtherMode.H = 0;
553
554 gRDPFrame++;
555
556 CTextureCache::Get()->PurgeOldTextures();
557
558 // Initialise stack
559 gDlistStackPointer=0;
560 gDlistStack.address[0] = (u32)pTask->t.data_ptr;
561 gDlistStack.limit = -1;
562
563 gRDPStateManager.Reset();
564
565#ifdef DAEDALUS_DEBUG_DISPLAYLIST
566 gNumDListsCulled = 0;
567 gNumVertices = 0;
568 gNumRectsClipped = 0;
569 if (debug_output)
570 DLDebug_SetOutput(debug_output);

Callers 5

RunMethod · 0.85
ProcessDListMethod · 0.85
ProcessDListMethod · 0.85
DLDebugger_ProcessFunction · 0.85

Calls 15

DLParser_InitMicrocodeFunction · 0.85
DLDebug_SetOutputFunction · 0.85
DLDebug_DumpTaskInfoFunction · 0.85
DLParser_ProcessDListFunction · 0.85
FinishRDPJobFunction · 0.85
PurgeOldTexturesMethod · 0.80
SetVIScalesMethod · 0.80
ResetMatricesMethod · 0.80
BeginSceneMethod · 0.80
EndSceneMethod · 0.80
OnDisplayListCompleteMethod · 0.80
IsInitialisedMethod · 0.45

Tested by

no test coverage detected