improve match of SwapBuffers

This commit is contained in:
Misha 2023-12-25 15:44:22 -05:00
parent fd1b052923
commit bcd120f436
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
2 changed files with 14 additions and 4 deletions

View File

@ -787,7 +787,7 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame)
MxStreamController* stream = Streamer()->Open("\\lego\\scripts\\isle\\isle", MxStreamer::e_DiskStream); MxStreamController* stream = Streamer()->Open("\\lego\\scripts\\isle\\isle", MxStreamer::e_DiskStream);
MxDSAction ds; MxDSAction ds;
if (!stream) { if (1) {
stream = Streamer()->Open("\\lego\\scripts\\nocd", MxStreamer::e_DiskStream); stream = Streamer()->Open("\\lego\\scripts\\nocd", MxStreamer::e_DiskStream);
if (!stream) { if (!stream) {
return; return;

View File

@ -161,11 +161,11 @@ MxResult MxDSBuffer::FUN_100c67b0(
if (buffer->GetRefCount() != 0) { if (buffer->GetRefCount() != 0) {
// Note: *p_streamingAction is always null in MxRamStreamProvider // Note: *p_streamingAction is always null in MxRamStreamProvider
((MxDiskStreamController*)p_controller)->InsertToList74(buffer); ((MxDiskStreamController*) p_controller)->InsertToList74(buffer);
(*p_streamingAction)->SetUnknowna0(NULL); (*p_streamingAction)->SetUnknowna0(NULL);
} }
((MxDiskStreamController*)p_controller)->FUN_100c7cb0(*p_streamingAction); ((MxDiskStreamController*) p_controller)->FUN_100c7cb0(*p_streamingAction);
*p_streamingAction = NULL; *p_streamingAction = NULL;
result = SUCCESS; result = SUCCESS;
} }
@ -300,6 +300,10 @@ MxU8* MxDSBuffer::SwapBuffers()
do { do {
MxU32* ptr = (MxU32*) m_pIntoBuffer; MxU32* ptr = (MxU32*) m_pIntoBuffer;
switch (*ptr) { switch (*ptr) {
case FOURCC('L', 'I', 'S', 'T'):
case FOURCC('R', 'I', 'F', 'F'):
m_pIntoBuffer = (MxU8*) (ptr + 3);
break;
case FOURCC('M', 'x', 'O', 'b'): case FOURCC('M', 'x', 'O', 'b'):
case FOURCC('M', 'x', 'C', 'h'): case FOURCC('M', 'x', 'C', 'h'):
result = m_pIntoBuffer; result = m_pIntoBuffer;
@ -311,11 +315,17 @@ MxU8* MxDSBuffer::SwapBuffers()
return result; return result;
} }
goto done; goto done;
case FOURCC('M', 'x', 'D', 'a'):
case FOURCC('M', 'x', 'S', 't'): case FOURCC('M', 'x', 'S', 't'):
m_pIntoBuffer = (MxU8*) (ptr + 2); m_pIntoBuffer = (MxU8*) (ptr + 2);
break; break;
default: case FOURCC('M', 'x', 'H', 'd'):
m_pIntoBuffer = (MxU8*) ((MxU32) ptr + ptr[1] + 8);
break; break;
default:
m_pIntoBuffer = NULL;
m_pIntoBuffer2 = NULL;
return NULL;
} }
} while (m_pIntoBuffer <= m_pBuffer + (m_writeOffset - 8)); } while (m_pIntoBuffer <= m_pBuffer + (m_writeOffset - 8));
} }