Skip to content

Commit e1ea10c

Browse files
authored
Merge pull request #2428 from jackchentwkh/fix_pushbuffer_subroutine
fix COMMAND_TYPE_CALL pushbuffer command handling
2 parents 971318a + 67f21d5 commit e1ea10c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/core/hle/D3D8/XbPushBuffer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,15 @@ extern void EmuExecutePushBufferRaw
469469
LOG_TEST_CASE("Pushbuffer COMMAND_TYPE_JUMP_LONG");
470470
dma_get_jmp_shadow = dma_get;
471471
dma_get = (uint32_t *)(CONTIGUOUS_MEMORY_BASE | (word & COMMAND_WORD_MASK_JUMP_LONG));
472+
//NV2A uses COMMAND_TYPE_JUMP_LONG as return for COMMAND_TYPE_CALL. we clear the subr_active here to indicate we have returned from COMMAND_TYPE_CALL.
473+
subr_active = false;
472474
continue; // while
473475
case COMMAND_TYPE_CALL: // Note : NV2A return is said not to work?
474476
if (subr_active) {
475477
LOG_TEST_CASE("Pushbuffer COMMAND_TYPE_CALL while another call was active!");
476478
// TODO : throw DMA_PUSHER(CALL_SUBR_ACTIVE);
477-
return; // For now, don't even attempt to run through
479+
// For now, don't even attempt to run through, this should never happened, if it happened, the pgraph handler will go crazy.
480+
CxbxrAbort("Pushbuffer COMMAND_TYPE_CALL called without return!");
478481
}
479482
else {
480483
LOG_TEST_CASE("Pushbuffer COMMAND_TYPE_CALL");

0 commit comments

Comments
 (0)