From ebe2a5e2cc69849c64bcb9c9944d457b6195b2ee Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sun, 14 Dec 2014 09:59:04 +0200 Subject: [PATCH] cellSail additions, updates and fixes --- rpcs3/Emu/SysCalls/Modules/cellSail.cpp | 23 +++++++++++-------- rpcs3/Emu/SysCalls/Modules/cellSail.h | 10 +++++++-- rpcs3/Gui/GameViewer.h | 30 ++++++++++++++----------- 3 files changed, 39 insertions(+), 24 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp index 3e22257a26..b4d1eba987 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp @@ -71,7 +71,7 @@ int cellSailDescriptorGetMediaInfo() int cellSailDescriptorSetAutoSelection(vm::ptr pSelf, bool autoSelection) { - cellSail->Todo("cellSailDescriptorSetAutoSelection(pSelf_addr=0x%x, autoSelection=%s)", pSelf.addr(), autoSelection ? "true" : "false"); + cellSail->Warning("cellSailDescriptorSetAutoSelection(pSelf_addr=0x%x, autoSelection=%s)", pSelf.addr(), autoSelection ? "true" : "false"); if (pSelf) { pSelf->autoSelection = autoSelection; @@ -84,7 +84,7 @@ int cellSailDescriptorSetAutoSelection(vm::ptr pSelf, bool a int cellSailDescriptorIsAutoSelection(vm::ptr pSelf) { cellSail->Warning("cellSailDescriptorIsAutoSelection(pSelf_addr=0x%x)", pSelf.addr()); - + if (pSelf) return pSelf->autoSelection; @@ -621,12 +621,17 @@ int cellSailPlayerCreateDescriptor(vm::ptr pSelf, s32 streamType cellSail->Todo("cellSailPlayerCreateDescriptor(pSelf_addr=0x%x, streamType=%d, pMediaInfo_addr=0x%x, pUri_addr=0x%x, ppDesc_addr=0x%x)", pSelf.addr(), streamType, pMediaInfo.addr(), pUri.addr(), ppDesc.addr()); + //cellSail->Todo("Descriptor: %i", sizeof(CellSailDescriptor)); + //cellSail->Todo("Player: %i", sizeof(CellSailPlayer)); + // TODO: Let the game allocate memory for the descriptor, setup the descriptor and pass it back to the game //CellSailDescriptor *pDesc = new CellSailDescriptor(); - //u32 descriptorAddress = pSelf->allocator->callbacks->pAlloc(pSelf->allocator->pArg, 4, descriptorAddress); - //cellSail->Error("Address: 0x%x", descriptorAddress); + //u32 descriptorAddress = pSelf->allocator->callbacks->pAlloc(pSelf->allocator->pArg, sizeof(CellSailDescriptor), sizeof(CellSailDescriptor)); + u32 descriptorAddress = Memory.Alloc(sizeof(CellSailDescriptor), sizeof(CellSailDescriptor)); + cellSail->Error("Address: 0x%x", descriptorAddress); //vm::ptr descriptor = vm::ptr::make(Memory.RealToVirtualAddr(&descriptorAddress)); + vm::ptr descriptor = vm::ptr::make(descriptorAddress); //descriptor->streamType = streamType; //descriptor->registered = false; @@ -766,16 +771,16 @@ int cellSailPlayerCancel() return CELL_OK; } -int cellSailPlayerSetPaused() +int cellSailPlayerSetPaused(vm::ptr pSelf, bool paused) { - UNIMPLEMENTED_FUNC(cellSail); + cellSail->Todo("cellSailPlayerSetPaused(pSelf_addr=0x%x, paused=)", pSelf.addr(), paused); return CELL_OK; } -int cellSailPlayerIsPaused() +int cellSailPlayerIsPaused(vm::ptr pSelf) { - UNIMPLEMENTED_FUNC(cellSail); - return CELL_OK; + cellSail->Warning("cellSailPlayerIsPaused(pSelf_addr=0x%x)", pSelf.addr()); + return pSelf->paused; } int cellSailPlayerSetRepeatMode(vm::ptr pSelf, s32 repeatMode, vm::ptr pCommand) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSail.h b/rpcs3/Emu/SysCalls/Modules/cellSail.h index 052133beaa..eb518f110d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSail.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSail.h @@ -1038,9 +1038,11 @@ struct CellSailDescriptor bool autoSelection; bool registered; be_t streamType; - be_t internalData[32]; + be_t internalData[31]; }; +static_assert(sizeof(CellSailDescriptor) == 0x100, "Invalid CellSailDescriptor size"); + struct CellSailStartCommand { be_t startType; @@ -1102,4 +1104,8 @@ struct CellSailPlayer be_t repeatMode; be_t descriptors; vm::ptr registeredDescriptors[2]; -}; \ No newline at end of file + bool paused = true; + be_t internalData[26]; +}; + +static_assert(sizeof(CellSailPlayer) == 0x100, "Invalid CellSailPlayer size"); \ No newline at end of file diff --git a/rpcs3/Gui/GameViewer.h b/rpcs3/Gui/GameViewer.h index e34271d45b..784e5309e0 100644 --- a/rpcs3/Gui/GameViewer.h +++ b/rpcs3/Gui/GameViewer.h @@ -183,13 +183,15 @@ public: void LoadSave(bool isLoad, const std::string& path, wxListView* list = NULL) { - if(isLoad) Init(); - else if(list) + if (isLoad) + Init(); + else if (list) { - for(int c=0; cGetColumnCount(); ++c) + for (int c = 0; c < list->GetColumnCount(); ++c) { Column* col = GetColumnByPos(c); - if(col) col->width = list->GetColumnWidth(c); + if (col) + col->width = list->GetColumnWidth(c); } } @@ -205,21 +207,21 @@ public: } \ } - for(u32 i=0; i