diff options
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp b/Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp index fcf8346d36..fa1fc7d943 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp @@ -54,23 +54,28 @@ static void ExecuteDisplayList(u32 address, u32 size) u8* old_pVideoData = g_pVideoData;
u8* startAddress = Memory_GetPtr(address);
- g_pVideoData = startAddress;
- // temporarily swap dl and non-dl(small "hack" for the stats)
- Statistics::SwapDL();
+ //Avoid the crash if Memory_GetPtr failed ..
+ if (startAddress!=0)
+ {
+ g_pVideoData = startAddress;
- while((u32)(g_pVideoData - startAddress) < size)
- {
- Decode();
- }
- INCSTAT(stats.numDListsCalled);
- INCSTAT(stats.thisFrame.numDListsCalled);
+ // temporarily swap dl and non-dl(small "hack" for the stats)
+ Statistics::SwapDL();
- // un-swap
- Statistics::SwapDL();
+ while((u32)(g_pVideoData - startAddress) < size)
+ {
+ Decode();
+ }
+ INCSTAT(stats.numDListsCalled);
+ INCSTAT(stats.thisFrame.numDListsCalled);
- // reset to the old pointer
- g_pVideoData = old_pVideoData;
+ // un-swap
+ Statistics::SwapDL();
+
+ // reset to the old pointer
+ g_pVideoData = old_pVideoData;
+ }
}
bool FifoCommandRunnable()
|
