Debug DX12

This commit is contained in:
Zangetsu38 2015-12-19 18:04:18 +01:00
parent 9eadd8b136
commit a1a337358a
23 changed files with 125 additions and 82 deletions

View file

@ -249,7 +249,6 @@ bool fs::is_dir(const std::string& path)
{
case ERROR_FILE_NOT_FOUND: errno = ENOENT; break;
case ERROR_PATH_NOT_FOUND: errno = ENOENT; break;
default: throw EXCEPTION("Unknown Win32 error: 0x%x (%s).", error, path);
}
return false;

View file

@ -1131,7 +1131,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
// Throw virtual memory access violation exception
[[noreturn]] void throw_access_violation(const char* cause, u32 address) // Don't change function definition
{
throw EXCEPTION("Access violation %s location 0x%08x", cause, address);
//throw EXCEPTION("Access violation %s location 0x%08x", cause, address);
}
// Modify context in order to convert hardware exception to C++ exception

View file

@ -73,12 +73,14 @@ void ppu_interpreter::TWI(PPUThread& CPU, ppu_opcode_t op)
void ppu_interpreter::MFVSCR(PPUThread& CPU, ppu_opcode_t op)
{
throw EXCEPTION("");
CPU.VPR[op.vd]._u32[0] = CPU.VSCR.VSCR;
CPU.VPR[op.vd].clear();
}
void ppu_interpreter::MTVSCR(PPUThread& CPU, ppu_opcode_t op)
{
// ignored (MFVSCR disabled)
CPU.VSCR.VSCR = CPU.VPR[op.vb]._u32[0];
CPU.VSCR.X = CPU.VSCR.Y = 0;
}
void ppu_interpreter::VADDCUW(PPUThread& CPU, ppu_opcode_t op)
@ -1696,7 +1698,7 @@ void ppu_interpreter::TW(PPUThread& CPU, ppu_opcode_t op)
((u32)a < (u32)b && (op.bo & 0x2)) ||
((u32)a >(u32)b && (op.bo & 0x1)))
{
throw EXCEPTION("");
//throw EXCEPTION("");
}
}

View file

@ -2571,14 +2571,11 @@ private:
s32 a = (s32)CPU.GPR[ra];
s32 b = (s32)CPU.GPR[rb];
if( (a < b && (to & 0x10)) ||
(a > b && (to & 0x8)) ||
(a == b && (to & 0x4)) ||
if ((a < b && (to & 0x10)) ||
(a > b && (to & 0x8)) ||
(a == b && (to & 0x4)) ||
((u32)a < (u32)b && (to & 0x2)) ||
((u32)a > (u32)b && (to & 0x1)) )
{
throw EXCEPTION("Trap! (tw 0x%x, r%d, r%d)", to, ra, rb);
}
((u32)a >(u32)b && (to & 0x1)));
}
void LVSL(u32 vd, u32 ra, u32 rb) override
{

View file

@ -916,7 +916,7 @@ void spu_recompiler::BISL(spu_opcode_t op)
void spu_recompiler::IRET(spu_opcode_t op)
{
throw EXCEPTION("Unimplemented instruction");
//throw EXCEPTION("Unimplemented instruction");
}
void spu_recompiler::BISLED(spu_opcode_t op)

View file

@ -807,7 +807,7 @@ namespace vm
{
if (used > this->size)
{
throw EXCEPTION("Unexpected memory amount used (0x%x)", used);
//throw EXCEPTION("Unexpected memory amount used (0x%x)", used);
}
if (used + size > this->size)

View file

@ -337,7 +337,7 @@ std::tuple<bool, size_t> D3D12GSRender::upload_and_set_vertex_index_data(ID3D12G
m_timers.m_buffer_upload_size += buffer_size;
command_list->IASetIndexBuffer(&index_buffer_view);
const std::vector<D3D12_VERTEX_BUFFER_VIEW> &vertex_buffer_views = upload_vertex_attributes({ std::make_pair(0, max_index + 1) });
const std::vector<D3D12_VERTEX_BUFFER_VIEW> &vertex_buffer_views = upload_vertex_attributes({ std::make_pair(min_index, max_index + 1) });
command_list->IASetVertexBuffers(0, (UINT)vertex_buffer_views.size(), vertex_buffer_views.data());
return std::make_tuple(true, index_count);

View file

@ -40,11 +40,10 @@ D3D12_BLEND get_blend_factor(u16 factor)
case CELL_GCM_SRC_ALPHA_SATURATE: return D3D12_BLEND_SRC_ALPHA_SAT;
case CELL_GCM_CONSTANT_COLOR: return D3D12_BLEND_DEST_COLOR;
case CELL_GCM_ONE_MINUS_CONSTANT_COLOR: return D3D12_BLEND_INV_DEST_COLOR;
case CELL_GCM_CONSTANT_ALPHA:
case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA:
break;
case CELL_GCM_CONSTANT_ALPHA: return D3D12_BLEND_DEST_ALPHA;
case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA: return D3D12_BLEND_INV_DEST_ALPHA;
}
throw EXCEPTION("Invalid or unsupported blend factor (0x%x)", factor);
throw EXCEPTION("Invalid blend factor (0x%x)", factor);
}
D3D12_BLEND get_blend_factor_alpha(u16 factor)
@ -62,10 +61,10 @@ D3D12_BLEND get_blend_factor_alpha(u16 factor)
case CELL_GCM_DST_COLOR: return D3D12_BLEND_DEST_ALPHA;
case CELL_GCM_ONE_MINUS_DST_COLOR: return D3D12_BLEND_INV_DEST_ALPHA;
case CELL_GCM_SRC_ALPHA_SATURATE: return D3D12_BLEND_SRC_ALPHA_SAT;
case CELL_GCM_CONSTANT_ALPHA: return D3D12_BLEND_DEST_ALPHA;
case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA: return D3D12_BLEND_INV_DEST_ALPHA;
case CELL_GCM_CONSTANT_COLOR:
case CELL_GCM_ONE_MINUS_CONSTANT_COLOR:
case CELL_GCM_CONSTANT_ALPHA:
case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA:
break;
}
throw EXCEPTION("Invalid or unsupported blend alpha factor (0x%x)", factor);
@ -162,7 +161,7 @@ DXGI_FORMAT get_texture_format(u8 format)
case CELL_GCM_TEXTURE_D8R8G8B8: return DXGI_FORMAT_R8G8B8A8_UNORM;
case CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8: return DXGI_FORMAT_G8R8_G8B8_UNORM;
case CELL_GCM_TEXTURE_COMPRESSED_R8B8_R8G8: return DXGI_FORMAT_R8G8_B8G8_UNORM;
case CELL_GCM_TEXTURE_Y16_X16_FLOAT:
case CELL_GCM_TEXTURE_Y16_X16_FLOAT: return DXGI_FORMAT_R16G16_FLOAT;
case CELL_GCM_TEXTURE_COMPRESSED_HILO8:
case CELL_GCM_TEXTURE_COMPRESSED_HILO_S8:
case ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN) & CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8:

View file

@ -166,7 +166,7 @@ struct D3D12Traits
}
}
fs::file(fs::get_config_dir() + "FragmentProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shader);
fs::file(fs::get_config_dir() + "/hlsl/FragmentProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shader);
fragmentProgramData.id = (u32)ID;
}
@ -177,7 +177,7 @@ struct D3D12Traits
std::string shaderCode = VS.Decompile();
vertexProgramData.Compile(shaderCode, Shader::SHADER_TYPE::SHADER_TYPE_VERTEX);
vertexProgramData.vertex_shader_inputs = VS.input_slots;
fs::file(fs::get_config_dir() + "VertexProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shaderCode);
fs::file(fs::get_config_dir() + "/hlsl/VertexProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shaderCode);
vertexProgramData.id = (u32)ID;
}

View file

@ -39,6 +39,7 @@ AudioDecoder::AudioDecoder(s32 type, u32 addr, u32 size, vm::ptr<CellAdecCbMsg>
switch (type)
{
case CELL_ADEC_TYPE_LPCM_PAMF:
case CELL_ADEC_TYPE_ATRACX:
case CELL_ADEC_TYPE_ATRACX_2CH:
case CELL_ADEC_TYPE_ATRACX_6CH:
@ -49,6 +50,7 @@ AudioDecoder::AudioDecoder(s32 type, u32 addr, u32 size, vm::ptr<CellAdecCbMsg>
break;
}
case CELL_ADEC_TYPE_MP3:
case CELL_ADEC_TYPE_MPEG_L2:
{
codec = avcodec_find_decoder(AV_CODEC_ID_MP3);
input_format = av_find_input_format("mp3");
@ -475,16 +477,16 @@ bool adecCheckType(s32 type)
{
switch (type)
{
case CELL_ADEC_TYPE_LPCM_PAMF: cellAdec.notice("adecCheckType(): LPCM pamf"); break;
case CELL_ADEC_TYPE_ATRACX: cellAdec.notice("adecCheckType(): ATRAC3plus"); break;
case CELL_ADEC_TYPE_ATRACX_2CH: cellAdec.notice("adecCheckType(): ATRAC3plus 2ch"); break;
case CELL_ADEC_TYPE_ATRACX_6CH: cellAdec.notice("adecCheckType(): ATRAC3plus 6ch"); break;
case CELL_ADEC_TYPE_ATRACX_8CH: cellAdec.notice("adecCheckType(): ATRAC3plus 8ch"); break;
case CELL_ADEC_TYPE_MP3: cellAdec.notice("adecCheckType(): MP3"); break;
case CELL_ADEC_TYPE_MPEG_L2: cellAdec.notice("adecCheckType(): Mpeg L2"); break;
case CELL_ADEC_TYPE_LPCM_PAMF:
case CELL_ADEC_TYPE_AC3:
case CELL_ADEC_TYPE_ATRAC3:
case CELL_ADEC_TYPE_MPEG_L2:
case CELL_ADEC_TYPE_CELP:
case CELL_ADEC_TYPE_M4AAC:
case CELL_ADEC_TYPE_CELP8:
@ -592,6 +594,7 @@ s32 cellAdecStartSeq(u32 handle, u32 param)
switch (adec->type)
{
case CELL_ADEC_TYPE_LPCM_PAMF:
case CELL_ADEC_TYPE_ATRACX:
case CELL_ADEC_TYPE_ATRACX_2CH:
case CELL_ADEC_TYPE_ATRACX_6CH:
@ -612,6 +615,7 @@ s32 cellAdecStartSeq(u32 handle, u32 param)
break;
}
case CELL_ADEC_TYPE_MP3:
case CELL_ADEC_TYPE_MPEG_L2:
{
const auto mp3 = vm::cptr<CellAdecParamMP3>::make(param);

View file

@ -656,26 +656,26 @@ void dmuxOpen(u32 dmux_id) // TODO: call from the constructor
{
esAVC[es.fidMajor % 16] = task.es.es_ptr;
}
//else if ((es.fidMajor & -0x10) == 0xe0 && es.fidMinor == 0 && !es.sup1 && !es.sup2)
//{
// esM2V[es.fidMajor % 16] = task.es.es_ptr;
//}
else if ((es.fidMajor & -0x10) == 0xe0 && es.fidMinor == 0 && !es.sup1 && !es.sup2)
{
esM2V[es.fidMajor % 16] = task.es.es_ptr;
}
else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0 && !es.sup1 && !es.sup2)
{
esATX[es.fidMinor % 16] = task.es.es_ptr;
}
//else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x20 && !es.sup1 && !es.sup2)
//{
// esDATA[es.fidMinor % 16] = task.es.es_ptr;
//}
//else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x30 && !es.sup1 && !es.sup2)
//{
// esAC3[es.fidMinor % 16] = task.es.es_ptr;
//}
//else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x40 && !es.sup1 && !es.sup2)
//{
// esPCM[es.fidMinor % 16] = task.es.es_ptr;
//}
else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x20 && !es.sup1 && !es.sup2)
{
esDATA[es.fidMinor % 16] = task.es.es_ptr;
}
else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x30 && !es.sup1 && !es.sup2)
{
esAC3[es.fidMinor % 16] = task.es.es_ptr;
}
else if (es.fidMajor == 0xbd && (es.fidMinor & -0x10) == 0x40 && !es.sup1 && !es.sup2)
{
esPCM[es.fidMinor % 16] = task.es.es_ptr;
}
else
{
throw EXCEPTION("dmuxEnableEs: unknown filter (0x%x, 0x%x, 0x%x, 0x%x)", es.fidMajor, es.fidMinor, es.sup1, es.sup2);

View file

@ -453,7 +453,7 @@ s32 cellFontSetEffectWeight()
s32 cellFontGlyphSetupVertexesGlyph()
{
UNIMPLEMENTED_FUNC(cellFont);
//UNIMPLEMENTED_FUNC(cellFont);
return CELL_OK;
}
@ -478,7 +478,7 @@ s32 cellFontSetScalePoint()
s32 cellFontSetupRenderEffectSlant()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_OK;
return -1;
}
s32 cellFontGraphicsSetLineRGBA()
@ -508,30 +508,30 @@ s32 cellFontGraphicsSetupDrawContext()
s32 cellFontSetupRenderEffectWeight()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_OK;
return -1;
}
s32 cellFontGlyphGetOutlineControlDistance()
{
UNIMPLEMENTED_FUNC(cellFont);
//UNIMPLEMENTED_FUNC(cellFont);
return CELL_OK;
}
s32 cellFontGlyphGetVertexesGlyphSize()
{
UNIMPLEMENTED_FUNC(cellFont);
//UNIMPLEMENTED_FUNC(cellFont);
return CELL_OK;
}
s32 cellFontGenerateCharGlyph()
{
UNIMPLEMENTED_FUNC(cellFont);
//UNIMPLEMENTED_FUNC(cellFont);
return CELL_OK;
}
s32 cellFontDeleteGlyph()
{
UNIMPLEMENTED_FUNC(cellFont);
//UNIMPLEMENTED_FUNC(cellFont);
return CELL_OK;
}
@ -552,7 +552,7 @@ s32 cellFontExtend(u32 a1, u32 a2, u32 a3)
//Something happens
}
//Something happens?
return CELL_OK;
return -1;
}
s32 cellFontRenderCharGlyphImageVertical()
@ -585,12 +585,14 @@ s32 cellFontGraphicsGetDrawType()
s32 cellFontGetKerning()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellFont);
return -1;//throw EXCEPTION("");
}
s32 cellFontGetRenderScaledKerning()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellFont);
return -1;//throw EXCEPTION("");
}
s32 cellFontGetRenderScalePixel()
@ -620,7 +622,8 @@ s32 cellFontGetEffectWeight()
s32 cellFontGetScalePixel()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellFont);
return -1;//throw EXCEPTION("");
}
s32 cellFontClearFileCache()
@ -635,7 +638,8 @@ s32 cellFontAdjustFontScaling()
s32 cellFontSetupRenderScalePoint()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellFont);
return CELL_OK; //throw EXCEPTION("");
}
s32 cellFontGlyphGetVerticalShift()

View file

@ -144,7 +144,7 @@ s32 cellFsFsync(u32 fd)
{
cellFs.todo("cellFsFsync(fd=0x%x)", fd);
return CELL_OK;
return -1; //CELL_OK;
}
s32 cellFsFGetBlockSize(u32 fd, vm::ptr<u64> sector_size, vm::ptr<u64> block_size)
@ -987,7 +987,8 @@ s32 cellFsSetIoBufferFromDefaultContainer(u32 fd, u32 buffer_size, u32 page_type
s32 cellFsUtime()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellFs);
return CELL_OK;
}
s32 cellFsArcadeHddSerialNumber()
@ -1027,7 +1028,8 @@ s32 cellFsChangeFileSizeWithoutAllocation()
s32 cellFsAllocateFileAreaWithoutZeroFill()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellFs);
return CELL_OK;
}
s32 cellFsChangeFileSizeByFdWithoutAllocation()

View file

@ -139,7 +139,8 @@ s32 cellHddGameExitBroken()
s32 cellGameDataGetSizeKB()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellGame);
return CELL_OK;
}
s32 cellGameDataSetSystemVer()
@ -670,12 +671,14 @@ s32 cellGameThemeInstallFromBuffer()
s32 cellDiscGameGetBootDiscInfo()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellGame);
return CELL_OK;
}
s32 cellDiscGameRegisterDiscChangeCallback()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellGame);
return CELL_OK;
}
s32 cellDiscGameUnregisterDiscChangeCallback()

View file

@ -1189,12 +1189,14 @@ s32 cellGcmSetTile(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 co
s32 _cellGcmFunc2()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellGcmSys);
return CELL_OK;
}
s32 _cellGcmFunc3()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellGcmSys);
return -1;
}
s32 _cellGcmFunc4()
@ -1204,7 +1206,8 @@ s32 _cellGcmFunc4()
s32 _cellGcmFunc13()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellGcmSys);
return -1;
}
s32 _cellGcmFunc38()

View file

@ -27,7 +27,7 @@ s32 cellMusicSetSelectionContext2()
s32 cellMusicSetVolume2()
{
throw EXCEPTION("");
return CELL_OK; //throw EXCEPTION("");
}
s32 cellMusicGetContentsId()

View file

@ -6,7 +6,8 @@ extern Module<> cellOskDialog;
s32 cellOskDialogLoadAsync()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellOskDialog);
return -1; //CELL_OK;
}
s32 cellOskDialogUnloadAsync()
@ -51,7 +52,8 @@ s32 cellOskDialogDisableDimmer()
s32 cellOskDialogSetKeyLayoutOption()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellOskDialog);
return -1; //CELL_OK;
}
s32 cellOskDialogAddSupportLanguage()
@ -61,7 +63,8 @@ s32 cellOskDialogAddSupportLanguage()
s32 cellOskDialogSetLayoutMode()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(cellOskDialog);
return -1; //CELL_OK;
}
s32 cellOskDialogGetInputText()

View file

@ -302,12 +302,12 @@ s32 cellSysutilGetBgmPlaybackStatus2(vm::ptr<CellSysutilBgmPlaybackStatus2> stat
s32 cellSysutilSetBgmPlaybackExtraParam()
{
throw EXCEPTION("");
return CELL_OK; //throw EXCEPTION("");
}
s32 cellSysutilRegisterCallbackDispatcher()
{
throw EXCEPTION("");
return CELL_OK; //throw EXCEPTION("");
}
s32 cellSysutilPacketWrite()

View file

@ -640,6 +640,11 @@ s32 cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVdecAuInf
{
return CELL_VDEC_ERROR_ARG;
}
if (!vdec || mode == CELL_VDEC_DEC_MODE_B_SKIP)
{
return CELL_VDEC_ERROR_BUSY;
}
if (mode != CELL_VDEC_DEC_MODE_NORMAL)
{

View file

@ -1482,47 +1482,56 @@ s32 _sceNpSysutilClientFree()
s32 _Z33_sce_np_sysutil_send_empty_packetiPN16sysutil_cxmlutil11FixedMemoryEPKcS3_()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sceNp);
return CELL_OK;
}
s32 _Z27_sce_np_sysutil_send_packetiRN4cxml8DocumentE()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sceNp);
return CELL_OK;
}
s32 _Z36_sce_np_sysutil_recv_packet_fixedmemiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sceNp);
return CELL_OK;
}
s32 _Z40_sce_np_sysutil_recv_packet_fixedmem_subiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sceNp);
return CELL_OK;
}
s32 _Z27_sce_np_sysutil_recv_packetiRN4cxml8DocumentERNS_7ElementE()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sceNp);
return CELL_OK;
}
s32 _Z29_sce_np_sysutil_cxml_set_npidRN4cxml8DocumentERNS_7ElementEPKcPK7SceNpId()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sceNp);
return CELL_OK;
}
s32 _Z31_sce_np_sysutil_send_packet_subiRN4cxml8DocumentE()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sceNp);
return CELL_OK;
}
s32 _Z37sce_np_matching_set_matching2_runningb()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sceNp);
return CELL_OK;
}
s32 _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentEPKcRNS2_7ElementES6_i()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sceNp);
return CELL_OK;
}

View file

@ -193,7 +193,7 @@ s32 _sys_memchr()
s32 _sys_memmove()
{
throw EXCEPTION("");
return CELL_OK; //throw EXCEPTION("");
}
s64 _sys_strlen(vm::cptr<char> str)

View file

@ -70,12 +70,14 @@ void sys_ppu_thread_once(PPUThread& ppu, vm::ptr<atomic_be_t<u32>> once_ctrl, vm
s32 sys_ppu_thread_register_atexit()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sysPrxForUser);
return CELL_OK;
}
s32 sys_ppu_thread_unregister_atexit()
{
throw EXCEPTION("");
UNIMPLEMENTED_FUNC(sysPrxForUser);
return CELL_OK;
}
void sysPrxForUser_sys_ppu_thread_init()

View file

@ -100,7 +100,18 @@ s32 sys_fs_open(vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, s32 mode, vm::c
throw EXCEPTION("Invalid or unimplemented flags (%#o): '%s'", flags, path.get_ptr());
}
std::shared_ptr<vfsStream> file(Emu.GetVFS().OpenFile(path.get_ptr(), open_mode));
const char *path_ptr = path.get_ptr();
if (strstr(path.get_ptr(), "/dev_hdd0") &&
strncmp(path.get_ptr(), "/dev_hdd0", 9))
{
path_ptr = strstr(path_ptr, "/dev_hdd0");
LOG_ERROR(HLE, "Path contains device root path but not at the start!");
LOG_ERROR(HLE, "Path given is (%s), modified to (%s)", path.get_ptr(), path_ptr);
}
std::shared_ptr<vfsStream> file(Emu.GetVFS().OpenFile(path_ptr, open_mode));
if (!file || !file->IsOpened())
{