From e6a47bfa89d3c71553696946862af092be3c8f1e Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Mon, 23 Feb 2015 17:09:52 +0200 Subject: [PATCH] Fix be_ts and fix loading in some modules --- rpcs3/Emu/SysCalls/Modules/cellCamera.cpp | 7 ++--- rpcs3/Emu/SysCalls/Modules/cellGem.cpp | 17 +++++------ rpcs3/Emu/SysCalls/Modules/cellMic.cpp | 17 +++++------ rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp | 7 ++--- rpcs3/Emu/SysCalls/Modules/cellRudp.cpp | 2 ++ rpcs3/Emu/SysCalls/Modules/cellSearch.cpp | 2 ++ rpcs3/Emu/SysCalls/Modules/cellSearch.h | 28 +++++++++---------- rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp | 2 ++ rpcs3/Emu/SysCalls/Modules/sceNp.cpp | 5 +--- rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp | 7 ++--- rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp | 7 ++--- rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp | 5 ---- rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp | 7 ++--- rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp | 7 ++--- 14 files changed, 47 insertions(+), 73 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp index f6c8e292e9..a6f8ee0372 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp @@ -562,13 +562,10 @@ int cellCameraRemoveNotifyEventQueue2() return CELL_OK; } -void cellCamera_unload() -{ - cellCameraInstance.m_bInitialized = false; -} - Module cellCamera("cellCamera", []() { + cellCameraInstance.m_bInitialized = false; + REG_FUNC(cellCamera, cellCameraInit); REG_FUNC(cellCamera, cellCameraEnd); REG_FUNC(cellCamera, cellCameraOpen); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp index 22ce3c49c5..01d7ef6ed0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp @@ -382,14 +382,11 @@ int cellGemWriteExternalPort() return CELL_OK; } -void cellGem_unload() -{ - cellGemInstance.m_bInitialized = false; -} - Module cellGem("cellGem", []() { - //cellGem.AddFunc(, cellGemAttributeInit); + cellGemInstance.m_bInitialized = false; + + //REG_FUNC(cellGem, cellGemAttributeInit); REG_FUNC(cellGem, cellGemCalibrate); REG_FUNC(cellGem, cellGemClearStatusFlags); REG_FUNC(cellGem, cellGemConvertVideoFinish); @@ -413,21 +410,21 @@ Module cellGem("cellGem", []() REG_FUNC(cellGem, cellGemGetState); REG_FUNC(cellGem, cellGemGetStatusFlags); REG_FUNC(cellGem, cellGemGetTrackerHue); - //cellGem.AddFunc(, cellGemGetVideoConvertSize); + //REG_FUNC(cellGem, cellGemGetVideoConvertSize); REG_FUNC(cellGem, cellGemHSVtoRGB); REG_FUNC(cellGem, cellGemInit); REG_FUNC(cellGem, cellGemInvalidateCalibration); REG_FUNC(cellGem, cellGemIsTrackableHue); REG_FUNC(cellGem, cellGemPrepareCamera); REG_FUNC(cellGem, cellGemPrepareVideoConvert); - //cellGem.AddFunc(, cellGemReadExternalPortDeviceInfo); + //REG_FUNC(cellGem, cellGemReadExternalPortDeviceInfo); REG_FUNC(cellGem, cellGemReset); REG_FUNC(cellGem, cellGemSetRumble); REG_FUNC(cellGem, cellGemSetYaw); REG_FUNC(cellGem, cellGemTrackHues); REG_FUNC(cellGem, cellGemUpdateFinish); REG_FUNC(cellGem, cellGemUpdateStart); - //cellGem.AddFunc(, cellGemVideoConvertAttributeInit); - //cellGem.AddFunc(, cellGemVideoConvertAttributeInitRgba); + //REG_FUNC(cellGem, cellGemVideoConvertAttributeInit); + //REG_FUNC(cellGem, cellGemVideoConvertAttributeInitRgba); REG_FUNC(cellGem, cellGemWriteExternalPort); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellMic.cpp b/rpcs3/Emu/SysCalls/Modules/cellMic.cpp index 28833558aa..e9c0c252e1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMic.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMic.cpp @@ -17,16 +17,16 @@ struct cellMicInternal } }; -cellMicInternal CellMicInstance; +cellMicInternal cellMicInstance; int cellMicInit() { cellMic.Warning("cellMicInit()"); - if (CellMicInstance.m_bCellMicInitialized) + if (cellMicInstance.m_bCellMicInitialized) return CELL_MICIN_ERROR_ALREADY_INIT; - CellMicInstance.m_bCellMicInitialized = true; + cellMicInstance.m_bCellMicInitialized = true; return CELL_OK; } @@ -35,10 +35,10 @@ int cellMicEnd() { cellMic.Warning("cellMicEnd()"); - if (!CellMicInstance.m_bCellMicInitialized) + if (!cellMicInstance.m_bCellMicInitialized) return CELL_MICIN_ERROR_NOT_INIT; - CellMicInstance.m_bCellMicInitialized = false; + cellMicInstance.m_bCellMicInitialized = false; return CELL_OK; } @@ -283,13 +283,10 @@ int cellMicGetDeviceIdentifier() return CELL_OK; } -void cellMic_unload() -{ - CellMicInstance.m_bCellMicInitialized = false; -} - Module cellMic("cellMic", []() { + cellMicInstance.m_bCellMicInitialized = false; + REG_FUNC(cellMic, cellMicInit); REG_FUNC(cellMic, cellMicEnd); REG_FUNC(cellMic, cellMicOpen); diff --git a/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp b/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp index 5ea8f9c321..db1f15452d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp @@ -118,13 +118,10 @@ int cellNetCtlGetNatInfo(vm::ptr natInfo) return CELL_OK; } -void cellNetCtl_unload() -{ - cellNetCtlInstance.m_bInitialized = false; -} - Module cellNetCtl("cellNetCtl", []() { + cellNetCtlInstance.m_bInitialized = false; + REG_FUNC(cellNetCtl, cellNetCtlInit); REG_FUNC(cellNetCtl, cellNetCtlTerm); diff --git a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp index 2b59475a8c..85fd59f9ac 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp @@ -200,6 +200,8 @@ s32 cellRudpProcessEvents() Module cellRudp("cellRudp", []() { + cellRudpInstance.m_bInitialized = false; + REG_FUNC(cellRudp, cellRudpInit); REG_FUNC(cellRudp, cellRudpEnd); REG_FUNC(cellRudp, cellRudpEnableInternalIOThread); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp index 5bda0c9e38..537b62c15d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp @@ -158,6 +158,8 @@ s32 cellSearchEnd() Module cellSearch("cellSearch", []() { + cellSearchInstance.m_bInitialized = false; + REG_FUNC(cellSearch, cellSearchInitialize); REG_FUNC(cellSearch, cellSearchFinalize); REG_FUNC(cellSearch, cellSearchStartListSearch); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSearch.h b/rpcs3/Emu/SysCalls/Modules/cellSearch.h index eb3d314f94..835bea7e9d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSearch.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSearch.h @@ -173,13 +173,13 @@ struct CellSearchContentId struct CellSearchResultParam { - CellSearchId searchId; + be_t searchId; be_t resultNum; }; struct CellSearchMusicListInfo { - CellSearchListType listType; + be_t listType; be_t numOfItems; be_t duration; char title[CELL_SEARCH_TITLE_LEN_MAX + 1]; @@ -190,7 +190,7 @@ struct CellSearchMusicListInfo struct CellSearchPhotoListInfo { - CellSearchListType listType; + be_t listType; be_t numOfItems; char title[CELL_SEARCH_TITLE_LEN_MAX + 1]; char reserved[3]; @@ -198,7 +198,7 @@ struct CellSearchPhotoListInfo struct CellSearchVideoListInfo { - CellSearchListType listType; + be_t listType; be_t numOfItems; be_t duration; char title[CELL_SEARCH_TITLE_LEN_MAX + 1]; @@ -218,8 +218,8 @@ struct CellSearchMusicInfo be_t quantizationBitrate; be_t playCount; be_t drmEncrypted; - CellSearchCodec codec; - CellSearchContentStatus status; + be_t codec; + be_t status; char diskNumber[8]; char title[CELL_SEARCH_TITLE_LEN_MAX + 1]; char reserved[3]; @@ -238,9 +238,9 @@ struct CellSearchPhotoInfo be_t takenDate; be_t width; be_t height; - CellSearchOrientation orientation; - CellSearchCodec codec; - CellSearchContentStatus status; + be_t orientation; + be_t codec; + be_t status; char title[CELL_SEARCH_TITLE_LEN_MAX + 1]; char reserved[3]; char albumTitle[CELL_SEARCH_TITLE_LEN_MAX + 1]; @@ -257,9 +257,9 @@ struct CellSearchVideoInfo be_t audioBitrate; be_t playCount; be_t drmEncrypted; - CellSearchCodec videoCodec; - CellSearchCodec audioCodec; - CellSearchContentStatus status; + be_t videoCodec; + be_t audioCodec; + be_t status; char title[CELL_SEARCH_TITLE_LEN_MAX + 1]; char reserved[3]; char albumTitle[CELL_SEARCH_TITLE_LEN_MAX + 1]; @@ -268,10 +268,10 @@ struct CellSearchVideoInfo struct CellSearchVideoSceneInfo { - CellSearchSceneType sceneType; + be_t sceneType; be_t startTime_ms; be_t endTime_ms; - CellSearchContentId videoId; + be_t videoId; char title[CELL_SEARCH_TITLE_LEN_MAX + 1]; char reserved[3]; char tags[CELL_SEARCH_TAG_NUM_MAX][CELL_SEARCH_TAG_LEN_MAX]; diff --git a/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp b/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp index 52d79242df..df6c8693c9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp @@ -176,6 +176,8 @@ s32 cellUsbdFreeMemory() Module cellUsbd("cellUsbd", []() { + cellUsbdInstance.m_bInitialized = false; + REG_FUNC(cellUsbd, cellUsbdInit); REG_FUNC(cellUsbd, cellUsbdEnd); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp index fcd948c3b0..82b7f305fe 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp @@ -1634,17 +1634,14 @@ int _sceNpSysutilClientFree() return CELL_OK; } -void sceNp_unload() +Module sceNp("sceNp", []() { sceNpInstance.m_bSceNpInitialized = false; sceNpInstance.m_bSceNp2Initialized = false; sceNpInstance.m_bScoreInitialized = false; sceNpInstance.m_bLookupInitialized = false; sceNpInstance.m_bSceNpUtilBandwidthTestInitialized = false; -} -Module sceNp("sceNp", []() -{ REG_FUNC(sceNp, sceNpInit); REG_FUNC(sceNp, sceNp2Init); REG_FUNC(sceNp, sceNpUtilBandwidthTestInitStart); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp index 440b8dc321..d47cfb7955 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp @@ -427,13 +427,10 @@ int sceNpClansRemoveChallenge() return CELL_OK; } -void sceNpClans_unload() -{ - sceNpClansInstance.m_bSceNpClansInitialized = false; -} - Module sceNpClans("sceNpClans", []() { + sceNpClansInstance.m_bSceNpClansInitialized = false; + REG_FUNC(sceNpClans, sceNpClansInit); REG_FUNC(sceNpClans, sceNpClansTerm); REG_FUNC(sceNpClans, sceNpClansCreateRequest); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp index 9f66688d2c..c7379c7821 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp @@ -312,13 +312,10 @@ int sceNpCommerce2DestroyReq() return CELL_OK; } -void sceNpCommerce2_unload() -{ - sceNpCommerce2Instance.m_bSceNpCommerce2Initialized = false; -} - Module sceNpCommerce2("sceNpCommerce2", []() { + sceNpCommerce2Instance.m_bSceNpCommerce2Initialized = false; + REG_FUNC(sceNpCommerce2, sceNpCommerce2ExecuteStoreBrowse); REG_FUNC(sceNpCommerce2, sceNpCommerce2GetStoreBrowseUserdata); REG_FUNC(sceNpCommerce2, sceNpCommerce2Init); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp index fff2e1fb18..48fa5385db 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp @@ -4,11 +4,6 @@ extern Module sceNpSns; -void sceNpSns_unload() -{ - // TODO: Unload SNS module -} - Module sceNpSns("sceNpSns", []() { // TODO: Register SNS module functions here diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp index 191977c7b5..fb657fe3c4 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp @@ -448,13 +448,10 @@ int sceNpTrophyGetGameIcon() return CELL_OK; } -void sceNpTrophy_unload() -{ - sceNpTrophyInstance.m_bInitialized = false; -} - Module sceNpTrophy("sceNpTrophy", []() { + sceNpTrophyInstance.m_bInitialized = false; + REG_FUNC(sceNpTrophy, sceNpTrophyGetGameProgress); REG_FUNC(sceNpTrophy, sceNpTrophyRegisterContext); REG_FUNC(sceNpTrophy, sceNpTrophyCreateHandle); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp index bbfb84c4c1..f9055f71d4 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp @@ -563,13 +563,10 @@ int sceNpTusDeleteMultiSlotDataVUserAsync() return CELL_OK; } -void sceNpTus_unload() -{ - sceNpTusInstance.m_bSceNpTusInitialized = false; -} - Module sceNpTus("sceNpTus", []() { + sceNpTusInstance.m_bSceNpTusInitialized = false; + REG_FUNC(sceNpTus, sceNpTusInit); REG_FUNC(sceNpTus, sceNpTusTerm); REG_FUNC(sceNpTus, sceNpTusCreateTitleCtx);