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

Function DLParser_SetCustom

Source/HLEGraphics/DLParser.cpp:357–421  ·  view source on GitHub ↗

This is called from Microcode.cpp after a custom ucode has been detected and cached This function is only called once per custom ucode set Main resaon for this function is to save memory since custom ucodes share a common table ucode: custom ucode (ucode>= MAX_UCODE) offset: offset to normal ucode this custom ucode is based of ex GBI0

Source from the content-addressed store, hash-verified

355// offset: offset to normal ucode this custom ucode is based of ex GBI0
356//*************************************************************************************
357static void DLParser_SetCustom( u32 ucode, u32 offset )
358{
359 memcpy( &gCustomInstruction, &gNormalInstruction[offset], 1024 ); // sizeof(gNormalInstruction)/MAX_UCODE
360
361#if defined(DAEDALUS_DEBUG_DISPLAYLIST) || defined(DAEDALUS_ENABLE_PROFILING)
362 memcpy( gCustomInstructionName, gNormalInstructionName[ offset ], 1024 );
363#endif
364
365 // Start patching to create our custom ucode table ;)
366 switch( ucode )
367 {
368 case GBI_GE:
369 SetCommand( 0xb4, DLParser_RDPHalf1_GoldenEye, "G_RDPHalf1_GoldenEye" );
370 break;
371 case GBI_WR:
372 SetCommand( 0x04, DLParser_GBI0_Vtx_WRUS, "G_Vtx_WRUS" );
373 SetCommand( 0xb1, DLParser_Nothing, "G_Nothing" ); // Just in case
374 break;
375 case GBI_SE:
376 SetCommand( 0x04, DLParser_GBI0_Vtx_SOTE, "G_Vtx_SOTE" );
377 break;
378 case GBI_LL:
379 SetCommand( 0x80, DLParser_Last_Legion_0x80, "G_Last_Legion_0x80" );
380 SetCommand( 0x00, DLParser_Last_Legion_0x00, "G_Last_Legion_0x00" );
381 SetCommand( 0xe4, DLParser_TexRect_Last_Legion, "G_TexRect_Last_Legion" );
382 break;
383 case GBI_PD:
384 SetCommand( 0x04, DLParser_Vtx_PD, "G_Vtx_PD" );
385 SetCommand( 0x07, DLParser_Set_Vtx_CI_PD, "G_Set_Vtx_CI_PD" );
386 SetCommand( 0xb4, DLParser_RDPHalf1_GoldenEye, "G_RDPHalf1_GoldenEye" );
387 break;
388 case GBI_DKR:
389 SetCommand( 0x01, DLParser_Mtx_DKR, "G_Mtx_DKR" );
390 SetCommand( 0x04, DLParser_GBI0_Vtx_DKR, "G_Vtx_DKR" );
391 SetCommand( 0x05, DLParser_DMA_Tri_DKR, "G_DMA_Tri_DKR" );
392 SetCommand( 0x07, DLParser_DLInMem, "G_DLInMem" );
393 SetCommand( 0xbc, DLParser_MoveWord_DKR, "G_MoveWord_DKR" );
394 SetCommand( 0xbf, DLParser_Set_Addr_DKR, "G_Set_Addr_DKR" );
395 SetCommand( 0xbb, DLParser_GBI1_Texture_DKR,"G_Texture_DKR" );
396 break;
397 case GBI_CONKER:
398 SetCommand( 0x01, DLParser_Vtx_Conker, "G_Vtx_Conker" );
399 SetCommand( 0x05, DLParser_Tri1_Conker, "G_Tri1_Conker" );
400 SetCommand( 0x06, DLParser_Tri2_Conker, "G_Tri2_Conker" );
401 SetCommand( 0x10, DLParser_Tri4_Conker, "G_Tri4_Conker" );
402 SetCommand( 0x11, DLParser_Tri4_Conker, "G_Tri4_Conker" );
403 SetCommand( 0x12, DLParser_Tri4_Conker, "G_Tri4_Conker" );
404 SetCommand( 0x13, DLParser_Tri4_Conker, "G_Tri4_Conker" );
405 SetCommand( 0x14, DLParser_Tri4_Conker, "G_Tri4_Conker" );
406 SetCommand( 0x15, DLParser_Tri4_Conker, "G_Tri4_Conker" );
407 SetCommand( 0x16, DLParser_Tri4_Conker, "G_Tri4_Conker" );
408 SetCommand( 0x17, DLParser_Tri4_Conker, "G_Tri4_Conker" );
409 SetCommand( 0x18, DLParser_Tri4_Conker, "G_Tri4_Conker" );
410 SetCommand( 0x19, DLParser_Tri4_Conker, "G_Tri4_Conker" );
411 SetCommand( 0x1a, DLParser_Tri4_Conker, "G_Tri4_Conker" );
412 SetCommand( 0x1b, DLParser_Tri4_Conker, "G_Tri4_Conker" );
413 SetCommand( 0x1c, DLParser_Tri4_Conker, "G_Tri4_Conker" );
414 SetCommand( 0x1d, DLParser_Tri4_Conker, "G_Tri4_Conker" );

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected