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;
@ -84,7 +84,7 @@ int cellSailDescriptorSetAutoSelection(vm::ptr<CellSailDescriptor> pSelf, bool a
int cellSailDescriptorIsAutoSelection(vm::ptr<CellSailDescriptor> pSelf)
{
cellSail->Warning("cellSailDescriptorIsAutoSelection(pSelf_addr=0x%x)", pSelf.addr());
if (pSelf)
return pSelf->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();
else if(list)
if (isLoad)
Init();
else if (list)
{
for(int c=0; c<list->GetColumnCount(); ++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<m_columns.size(); ++i)
for (u32 i = 0; i < m_columns.size(); ++i)
{
ADD_COLUMN(pos, m_columns[i].def_pos, int, "position", 1);
ADD_COLUMN(width, m_columns[i].def_width, int, "width", 1);
ADD_COLUMN(shown, true, bool, "shown", 0);
}
if(isLoad)
if (isLoad)
{
//check for errors
for(u32 c1=0; c1<m_columns.size(); ++c1)
for (u32 c1 = 0; c1 < m_columns.size(); ++c1)
{
for(u32 c2=c1+1; c2<m_columns.size(); ++c2)
for (u32 c2 = c1 + 1; c2 < m_columns.size(); ++c2)
{
if(m_columns[c1].pos == m_columns[c2].pos)
if (m_columns[c1].pos == m_columns[c2].pos)
{
LOG_ERROR(HLE, "Columns loaded with error!");
Init();
@ -228,17 +230,19 @@ public:
}
}
for(u32 p=0; p<m_columns.size(); ++p)
for (u32 p = 0; p < m_columns.size(); ++p)
{
bool ishas = false;
for(u32 c=0; c<m_columns.size(); ++c)
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;
}
if(!ishas)
if (!ishas)
{
LOG_ERROR(HLE, "Columns loaded with error!");
Init();