Merge pull request #896 from tambry/SailThings

cellSail additions, updates and fixes
This commit is contained in:
B1ackDaemon 2014-12-14 12:02:36 +02:00
commit e5718ed264
3 changed files with 39 additions and 24 deletions

View File

@ -71,7 +71,7 @@ int cellSailDescriptorGetMediaInfo()
int cellSailDescriptorSetAutoSelection(vm::ptr<CellSailDescriptor> 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;
@ -621,12 +621,17 @@ int cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> 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<CellSailDescriptor> descriptor = vm::ptr<CellSailDescriptor>::make(Memory.RealToVirtualAddr(&descriptorAddress));
vm::ptr<CellSailDescriptor> descriptor = vm::ptr<CellSailDescriptor>::make(descriptorAddress);
//descriptor->streamType = streamType;
//descriptor->registered = false;
@ -766,16 +771,16 @@ int cellSailPlayerCancel()
return CELL_OK;
}
int cellSailPlayerSetPaused()
int cellSailPlayerSetPaused(vm::ptr<CellSailPlayer> 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<CellSailPlayer> pSelf)
{
UNIMPLEMENTED_FUNC(cellSail);
return CELL_OK;
cellSail->Warning("cellSailPlayerIsPaused(pSelf_addr=0x%x)", pSelf.addr());
return pSelf->paused;
}
int cellSailPlayerSetRepeatMode(vm::ptr<CellSailPlayer> pSelf, s32 repeatMode, vm::ptr<CellSailStartCommand> pCommand)

View File

@ -1038,9 +1038,11 @@ struct CellSailDescriptor
bool autoSelection;
bool registered;
be_t<s32> streamType;
be_t<u64> internalData[32];
be_t<u64> internalData[31];
};
static_assert(sizeof(CellSailDescriptor) == 0x100, "Invalid CellSailDescriptor size");
struct CellSailStartCommand
{
be_t<u32> startType;
@ -1102,4 +1104,8 @@ struct CellSailPlayer
be_t<s32> repeatMode;
be_t<s32> descriptors;
vm::ptr<CellSailDescriptor> registeredDescriptors[2];
bool paused = true;
be_t<u64> internalData[26];
};
static_assert(sizeof(CellSailPlayer) == 0x100, "Invalid CellSailPlayer size");

View File

@ -183,13 +183,15 @@ public:
void LoadSave(bool isLoad, const std::string& path, wxListView* list = NULL)
{
if(isLoad) Init();
if (isLoad)
Init();
else if (list)
{
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);
}
}
@ -233,7 +235,9 @@ public:
bool ishas = false;
for (u32 c = 0; c < m_columns.size(); ++c)
{
if(m_columns[c].pos != p) continue;
if (m_columns[c].pos != p)
continue;
ishas = true;
break;
}