mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-13 18:28:35 +12:00
Merge branch 'master' into patch-1
This commit is contained in:
commit
34622933f3
41 changed files with 1065 additions and 253 deletions
|
@ -172,7 +172,7 @@ std::pair<Executable, llvm::ExecutionEngine *> Compiler::Compile(const std::stri
|
||||||
|
|
||||||
SetPc(m_ir_builder->getInt32(m_state.current_instruction_address));
|
SetPc(m_ir_builder->getInt32(m_state.current_instruction_address));
|
||||||
|
|
||||||
m_ir_builder->CreateRet(exit_instr_i32);
|
m_ir_builder->CreateRet(m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusBlockEnded));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the function has a default exit block then generate code for it
|
// If the function has a default exit block then generate code for it
|
||||||
|
@ -182,8 +182,7 @@ std::pair<Executable, llvm::ExecutionEngine *> Compiler::Compile(const std::stri
|
||||||
PHINode *exit_instr_i32 = m_ir_builder->CreatePHI(m_ir_builder->getInt32Ty(), 0);
|
PHINode *exit_instr_i32 = m_ir_builder->CreatePHI(m_ir_builder->getInt32Ty(), 0);
|
||||||
exit_instr_list.push_back(exit_instr_i32);
|
exit_instr_list.push_back(exit_instr_i32);
|
||||||
|
|
||||||
m_ir_builder->CreateRet(exit_instr_i32);
|
m_ir_builder->CreateRet(m_ir_builder->getInt32(0));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add incoming values for all exit instr PHI nodes
|
// Add incoming values for all exit instr PHI nodes
|
||||||
|
@ -255,7 +254,7 @@ RecompilationEngine::RecompilationEngine()
|
||||||
, m_last_cache_clear_time(std::chrono::high_resolution_clock::now())
|
, m_last_cache_clear_time(std::chrono::high_resolution_clock::now())
|
||||||
, m_compiler(*this, CPUHybridDecoderRecompiler::ExecuteFunction, CPUHybridDecoderRecompiler::ExecuteTillReturn, CPUHybridDecoderRecompiler::PollStatus) {
|
, m_compiler(*this, CPUHybridDecoderRecompiler::ExecuteFunction, CPUHybridDecoderRecompiler::ExecuteTillReturn, CPUHybridDecoderRecompiler::PollStatus) {
|
||||||
|
|
||||||
FunctionCache = (Executable *)memory_helper::reserve_memory(VIRTUAL_INSTRUCTION_COUNT * sizeof(Executable));
|
FunctionCache = (ExecutableStorageType *)memory_helper::reserve_memory(VIRTUAL_INSTRUCTION_COUNT * sizeof(ExecutableStorageType));
|
||||||
// Each char can store 8 page status
|
// Each char can store 8 page status
|
||||||
FunctionCachePagesCommited = (char *)malloc(VIRTUAL_INSTRUCTION_COUNT / (8 * PAGE_SIZE));
|
FunctionCachePagesCommited = (char *)malloc(VIRTUAL_INSTRUCTION_COUNT / (8 * PAGE_SIZE));
|
||||||
memset(FunctionCachePagesCommited, 0, VIRTUAL_INSTRUCTION_COUNT / (8 * PAGE_SIZE));
|
memset(FunctionCachePagesCommited, 0, VIRTUAL_INSTRUCTION_COUNT / (8 * PAGE_SIZE));
|
||||||
|
@ -264,15 +263,15 @@ RecompilationEngine::RecompilationEngine()
|
||||||
}
|
}
|
||||||
|
|
||||||
RecompilationEngine::~RecompilationEngine() {
|
RecompilationEngine::~RecompilationEngine() {
|
||||||
m_address_to_function.clear();
|
m_executable_storage.clear();
|
||||||
join();
|
join();
|
||||||
memory_helper::free_reserved_memory(FunctionCache, VIRTUAL_INSTRUCTION_COUNT * sizeof(Executable));
|
memory_helper::free_reserved_memory(FunctionCache, VIRTUAL_INSTRUCTION_COUNT * sizeof(ExecutableStorageType));
|
||||||
free(FunctionCachePagesCommited);
|
free(FunctionCachePagesCommited);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RecompilationEngine::isAddressCommited(u32 address) const
|
bool RecompilationEngine::isAddressCommited(u32 address) const
|
||||||
{
|
{
|
||||||
size_t offset = address * sizeof(Executable);
|
size_t offset = address * sizeof(ExecutableStorageType);
|
||||||
size_t page = offset / 4096;
|
size_t page = offset / 4096;
|
||||||
// Since bool is stored in char, the char index is page / 8 (or page >> 3)
|
// Since bool is stored in char, the char index is page / 8 (or page >> 3)
|
||||||
// and we shr the value with the remaining bits (page & 7)
|
// and we shr the value with the remaining bits (page & 7)
|
||||||
|
@ -281,7 +280,7 @@ bool RecompilationEngine::isAddressCommited(u32 address) const
|
||||||
|
|
||||||
void RecompilationEngine::commitAddress(u32 address)
|
void RecompilationEngine::commitAddress(u32 address)
|
||||||
{
|
{
|
||||||
size_t offset = address * sizeof(Executable);
|
size_t offset = address * sizeof(ExecutableStorageType);
|
||||||
size_t page = offset / 4096;
|
size_t page = offset / 4096;
|
||||||
memory_helper::commit_page_memory((u8*)FunctionCache + page * 4096, 4096);
|
memory_helper::commit_page_memory((u8*)FunctionCache + page * 4096, 4096);
|
||||||
// Reverse of isAddressCommited : we set the (page & 7)th bit of (page / 8) th char
|
// Reverse of isAddressCommited : we set the (page & 7)th bit of (page / 8) th char
|
||||||
|
@ -289,25 +288,22 @@ void RecompilationEngine::commitAddress(u32 address)
|
||||||
FunctionCachePagesCommited[page >> 3] |= (1 << (page & 7));
|
FunctionCachePagesCommited[page >> 3] |= (1 << (page & 7));
|
||||||
}
|
}
|
||||||
|
|
||||||
const Executable RecompilationEngine::GetCompiledExecutableIfAvailable(u32 address)
|
const Executable RecompilationEngine::GetCompiledExecutableIfAvailable(u32 address) const
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(m_address_to_function_lock);
|
|
||||||
if (!isAddressCommited(address / 4))
|
if (!isAddressCommited(address / 4))
|
||||||
commitAddress(address / 4);
|
|
||||||
if (!Ini.LLVMExclusionRange.GetValue())
|
|
||||||
return FunctionCache[address / 4];
|
|
||||||
std::unordered_map<u32, ExecutableStorage>::iterator It = m_address_to_function.find(address);
|
|
||||||
if (It == m_address_to_function.end())
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
u32 id = std::get<3>(It->second);
|
u32 id = FunctionCache[address / 4].second;
|
||||||
if (id >= Ini.LLVMMinId.GetValue() && id <= Ini.LLVMMaxId.GetValue())
|
if (Ini.LLVMExclusionRange.GetValue() &&
|
||||||
|
(id >= Ini.LLVMMinId.GetValue() && id <= Ini.LLVMMaxId.GetValue()))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return std::get<0>(It->second);
|
return FunctionCache[address / 4].first;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecompilationEngine::NotifyBlockStart(u32 address) {
|
void RecompilationEngine::NotifyBlockStart(u32 address) {
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(m_pending_address_start_lock);
|
std::lock_guard<std::mutex> lock(m_pending_address_start_lock);
|
||||||
|
if (m_pending_address_start.size() > 10000)
|
||||||
|
m_pending_address_start.clear();
|
||||||
m_pending_address_start.push_back(address);
|
m_pending_address_start.push_back(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,14 +341,14 @@ void RecompilationEngine::Task() {
|
||||||
|
|
||||||
if (!m_current_execution_traces.empty()) {
|
if (!m_current_execution_traces.empty()) {
|
||||||
for (u32 address : m_current_execution_traces)
|
for (u32 address : m_current_execution_traces)
|
||||||
work_done_this_iteration |= ProcessExecutionTrace(address);
|
work_done_this_iteration |= IncreaseHitCounterAndBuild(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!work_done_this_iteration) {
|
if (!work_done_this_iteration) {
|
||||||
// Wait a few ms for something to happen
|
// Wait a few ms for something to happen
|
||||||
auto idling_start = std::chrono::high_resolution_clock::now();
|
auto idling_start = std::chrono::high_resolution_clock::now();
|
||||||
std::unique_lock<std::mutex> lock(mutex);
|
std::unique_lock<std::mutex> lock(mutex);
|
||||||
cv.wait_for(lock, std::chrono::milliseconds(250));
|
cv.wait_for(lock, std::chrono::milliseconds(10));
|
||||||
auto idling_end = std::chrono::high_resolution_clock::now();
|
auto idling_end = std::chrono::high_resolution_clock::now();
|
||||||
idling_time += std::chrono::duration_cast<std::chrono::nanoseconds>(idling_end - idling_start);
|
idling_time += std::chrono::duration_cast<std::chrono::nanoseconds>(idling_end - idling_start);
|
||||||
}
|
}
|
||||||
|
@ -375,7 +371,7 @@ void RecompilationEngine::Task() {
|
||||||
s_the_instance = nullptr; // Can cause deadlock if this is the last instance. Need to fix this.
|
s_the_instance = nullptr; // Can cause deadlock if this is the last instance. Need to fix this.
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RecompilationEngine::ProcessExecutionTrace(u32 address) {
|
bool RecompilationEngine::IncreaseHitCounterAndBuild(u32 address) {
|
||||||
auto It = m_block_table.find(address);
|
auto It = m_block_table.find(address);
|
||||||
if (It == m_block_table.end())
|
if (It == m_block_table.end())
|
||||||
It = m_block_table.emplace(address, BlockEntry(address)).first;
|
It = m_block_table.emplace(address, BlockEntry(address)).first;
|
||||||
|
@ -465,26 +461,25 @@ void RecompilationEngine::CompileBlock(BlockEntry & block_entry) {
|
||||||
if (!AnalyseBlock(block_entry))
|
if (!AnalyseBlock(block_entry))
|
||||||
return;
|
return;
|
||||||
Log() << "Compile: " << block_entry.ToString() << "\n";
|
Log() << "Compile: " << block_entry.ToString() << "\n";
|
||||||
|
|
||||||
|
{
|
||||||
|
// We create a lock here so that data are properly stored at the end of the function.
|
||||||
|
/// Lock for accessing compiler
|
||||||
|
std::mutex local_mutex;
|
||||||
|
std::unique_lock<std::mutex> lock(local_mutex);
|
||||||
|
|
||||||
const std::pair<Executable, llvm::ExecutionEngine *> &compileResult =
|
const std::pair<Executable, llvm::ExecutionEngine *> &compileResult =
|
||||||
m_compiler.Compile(fmt::format("fn_0x%08X", block_entry.address), block_entry.address, block_entry.instructionCount);
|
m_compiler.Compile(fmt::format("fn_0x%08X", block_entry.address), block_entry.address, block_entry.instructionCount);
|
||||||
|
|
||||||
// If entry doesn't exist, create it (using lock)
|
|
||||||
std::unordered_map<u32, ExecutableStorage>::iterator It = m_address_to_function.find(block_entry.address);
|
|
||||||
if (It == m_address_to_function.end())
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(m_address_to_function_lock);
|
|
||||||
std::get<1>(m_address_to_function[block_entry.address]) = nullptr;
|
|
||||||
if (!isAddressCommited(block_entry.address / 4))
|
if (!isAddressCommited(block_entry.address / 4))
|
||||||
commitAddress(block_entry.address / 4);
|
commitAddress(block_entry.address / 4);
|
||||||
}
|
|
||||||
|
|
||||||
std::get<1>(m_address_to_function[block_entry.address]) = std::unique_ptr<llvm::ExecutionEngine>(compileResult.second);
|
m_executable_storage.push_back(std::unique_ptr<llvm::ExecutionEngine>(compileResult.second));
|
||||||
std::get<0>(m_address_to_function[block_entry.address]) = compileResult.first;
|
|
||||||
std::get<3>(m_address_to_function[block_entry.address]) = m_currentId;
|
|
||||||
Log() << "Associating " << (void*)(uint64_t)block_entry.address << " with ID " << m_currentId << "\n";
|
Log() << "Associating " << (void*)(uint64_t)block_entry.address << " with ID " << m_currentId << "\n";
|
||||||
|
FunctionCache[block_entry.address / 4] = std::make_pair(compileResult.first, m_currentId);
|
||||||
m_currentId++;
|
m_currentId++;
|
||||||
block_entry.is_compiled = true;
|
block_entry.is_compiled = true;
|
||||||
FunctionCache[block_entry.address / 4] = compileResult.first;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<RecompilationEngine> RecompilationEngine::GetInstance() {
|
std::shared_ptr<RecompilationEngine> RecompilationEngine::GetInstance() {
|
||||||
|
@ -508,13 +503,21 @@ ppu_recompiler_llvm::CPUHybridDecoderRecompiler::~CPUHybridDecoderRecompiler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 ppu_recompiler_llvm::CPUHybridDecoderRecompiler::DecodeMemory(const u32 address) {
|
u32 ppu_recompiler_llvm::CPUHybridDecoderRecompiler::DecodeMemory(const u32 address) {
|
||||||
ExecuteFunction(&m_ppu, 0);
|
// TODO: exception_ptr doesnt work, should add every possible exception
|
||||||
|
if (ExecuteFunction(&m_ppu, 0) == ExecutionStatus::ExecutionStatusPropagateException)
|
||||||
|
{
|
||||||
|
std::exception_ptr exn = m_ppu.pending_exception;
|
||||||
|
m_ppu.pending_exception = nullptr;
|
||||||
|
std::rethrow_exception(exn);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 ppu_recompiler_llvm::CPUHybridDecoderRecompiler::ExecuteFunction(PPUThread * ppu_state, u64 context) {
|
u32 ppu_recompiler_llvm::CPUHybridDecoderRecompiler::ExecuteFunction(PPUThread * ppu_state, u64 context) {
|
||||||
auto execution_engine = (CPUHybridDecoderRecompiler *)ppu_state->GetDecoder();
|
auto execution_engine = (CPUHybridDecoderRecompiler *)ppu_state->GetDecoder();
|
||||||
return ExecuteTillReturn(ppu_state, 0);
|
if (ExecuteTillReturn(ppu_state, 0) == ExecutionStatus::ExecutionStatusPropagateException)
|
||||||
|
return ExecutionStatus::ExecutionStatusPropagateException;
|
||||||
|
return ExecutionStatus::ExecutionStatusReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the branch type from a branch instruction
|
/// Get the branch type from a branch instruction
|
||||||
|
@ -544,7 +547,8 @@ static BranchType GetBranchTypeFromInstruction(u32 instruction)
|
||||||
u32 ppu_recompiler_llvm::CPUHybridDecoderRecompiler::ExecuteTillReturn(PPUThread * ppu_state, u64 context) {
|
u32 ppu_recompiler_llvm::CPUHybridDecoderRecompiler::ExecuteTillReturn(PPUThread * ppu_state, u64 context) {
|
||||||
CPUHybridDecoderRecompiler *execution_engine = (CPUHybridDecoderRecompiler *)ppu_state->GetDecoder();
|
CPUHybridDecoderRecompiler *execution_engine = (CPUHybridDecoderRecompiler *)ppu_state->GetDecoder();
|
||||||
|
|
||||||
execution_engine->m_recompilation_engine->NotifyBlockStart(ppu_state->PC);
|
// A block is a sequence of contiguous address.
|
||||||
|
bool previousInstContigousAndInterp = false;
|
||||||
|
|
||||||
while (PollStatus(ppu_state) == false) {
|
while (PollStatus(ppu_state) == false) {
|
||||||
const Executable executable = execution_engine->m_recompilation_engine->GetCompiledExecutableIfAvailable(ppu_state->PC);
|
const Executable executable = execution_engine->m_recompilation_engine->GetCompiledExecutableIfAvailable(ppu_state->PC);
|
||||||
|
@ -552,14 +556,30 @@ u32 ppu_recompiler_llvm::CPUHybridDecoderRecompiler::ExecuteTillReturn(PPUThread
|
||||||
{
|
{
|
||||||
auto entry = ppu_state->PC;
|
auto entry = ppu_state->PC;
|
||||||
u32 exit = (u32)executable(ppu_state, 0);
|
u32 exit = (u32)executable(ppu_state, 0);
|
||||||
if (exit == 0)
|
if (exit == ExecutionStatus::ExecutionStatusReturn)
|
||||||
return 0;
|
return ExecutionStatus::ExecutionStatusReturn;
|
||||||
|
if (exit == ExecutionStatus::ExecutionStatusPropagateException)
|
||||||
|
return ExecutionStatus::ExecutionStatusPropagateException;
|
||||||
execution_engine->m_recompilation_engine->NotifyBlockStart(ppu_state->PC);
|
execution_engine->m_recompilation_engine->NotifyBlockStart(ppu_state->PC);
|
||||||
|
previousInstContigousAndInterp = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// if previousInstContigousAndInterp is true, ie previous step was either a compiled block or a branch inst
|
||||||
|
// that caused a "gap" in instruction flow, we notify a new block.
|
||||||
|
if (!previousInstContigousAndInterp)
|
||||||
|
execution_engine->m_recompilation_engine->NotifyBlockStart(ppu_state->PC);
|
||||||
u32 instruction = vm::ps3::read32(ppu_state->PC);
|
u32 instruction = vm::ps3::read32(ppu_state->PC);
|
||||||
u32 oldPC = ppu_state->PC;
|
u32 oldPC = ppu_state->PC;
|
||||||
|
try
|
||||||
|
{
|
||||||
execution_engine->m_decoder.Decode(instruction);
|
execution_engine->m_decoder.Decode(instruction);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
ppu_state->pending_exception = std::current_exception();
|
||||||
|
return ExecutionStatus::ExecutionStatusPropagateException;
|
||||||
|
}
|
||||||
|
previousInstContigousAndInterp = (oldPC == ppu_state->PC);
|
||||||
auto branch_type = ppu_state->PC != oldPC ? GetBranchTypeFromInstruction(instruction) : BranchType::NonBranch;
|
auto branch_type = ppu_state->PC != oldPC ? GetBranchTypeFromInstruction(instruction) : BranchType::NonBranch;
|
||||||
ppu_state->PC += 4;
|
ppu_state->PC += 4;
|
||||||
|
|
||||||
|
@ -568,7 +588,10 @@ u32 ppu_recompiler_llvm::CPUHybridDecoderRecompiler::ExecuteTillReturn(PPUThread
|
||||||
if (Emu.GetCPUThreadStop() == ppu_state->PC) ppu_state->fast_stop();
|
if (Emu.GetCPUThreadStop() == ppu_state->PC) ppu_state->fast_stop();
|
||||||
return 0;
|
return 0;
|
||||||
case BranchType::FunctionCall: {
|
case BranchType::FunctionCall: {
|
||||||
ExecuteFunction(ppu_state, 0);
|
u32 status = ExecuteFunction(ppu_state, 0);
|
||||||
|
// TODO: exception_ptr doesnt work, should add every possible exception
|
||||||
|
if (status == ExecutionStatus::ExecutionStatusPropagateException)
|
||||||
|
return ExecutionStatus::ExecutionStatusPropagateException;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BranchType::LocalBranch:
|
case BranchType::LocalBranch:
|
||||||
|
|
|
@ -24,6 +24,13 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace ppu_recompiler_llvm {
|
namespace ppu_recompiler_llvm {
|
||||||
|
enum ExecutionStatus
|
||||||
|
{
|
||||||
|
ExecutionStatusReturn = 0, ///< Block has hit a return, caller can continue execution
|
||||||
|
ExecutionStatusBlockEnded, ///< Block has been executed but no return was hit, at least another block must be executed before caller can continue
|
||||||
|
ExecutionStatusPropagateException, ///< an exception was thrown
|
||||||
|
};
|
||||||
|
|
||||||
class Compiler;
|
class Compiler;
|
||||||
class RecompilationEngine;
|
class RecompilationEngine;
|
||||||
class ExecutionEngine;
|
class ExecutionEngine;
|
||||||
|
@ -779,7 +786,7 @@ namespace ppu_recompiler_llvm {
|
||||||
* Get the executable for the specified address if a compiled version is
|
* Get the executable for the specified address if a compiled version is
|
||||||
* available, otherwise returns nullptr.
|
* available, otherwise returns nullptr.
|
||||||
**/
|
**/
|
||||||
const Executable GetCompiledExecutableIfAvailable(u32 address);
|
const Executable GetCompiledExecutableIfAvailable(u32 address) const;
|
||||||
|
|
||||||
/// Notify the recompilation engine about a newly detected block start.
|
/// Notify the recompilation engine about a newly detected block start.
|
||||||
void NotifyBlockStart(u32 address);
|
void NotifyBlockStart(u32 address);
|
||||||
|
@ -848,15 +855,16 @@ namespace ppu_recompiler_llvm {
|
||||||
/// Block table
|
/// Block table
|
||||||
std::unordered_map<u32, BlockEntry> m_block_table;
|
std::unordered_map<u32, BlockEntry> m_block_table;
|
||||||
|
|
||||||
/// Lock for accessing m_address_to_function.
|
|
||||||
std::mutex m_address_to_function_lock;
|
|
||||||
|
|
||||||
int m_currentId;
|
int m_currentId;
|
||||||
|
|
||||||
// Store pointer to every compiled function/block.
|
/// (function, id).
|
||||||
// We need to map every instruction in PS3 Ram so it's a big table
|
typedef std::pair<Executable, u32> ExecutableStorageType;
|
||||||
// But a lot of it won't be accessed. Fortunatly virtual memory help here...
|
|
||||||
Executable *FunctionCache;
|
/// Virtual memory allocated array.
|
||||||
|
/// Store pointer to every compiled function/block and a unique Id.
|
||||||
|
/// We need to map every instruction in PS3 Ram so it's a big table
|
||||||
|
/// But a lot of it won't be accessed. Fortunatly virtual memory help here...
|
||||||
|
ExecutableStorageType* FunctionCache;
|
||||||
|
|
||||||
// Bitfield recording page status in FunctionCache reserved memory.
|
// Bitfield recording page status in FunctionCache reserved memory.
|
||||||
char *FunctionCachePagesCommited;
|
char *FunctionCachePagesCommited;
|
||||||
|
@ -864,10 +872,8 @@ namespace ppu_recompiler_llvm {
|
||||||
bool isAddressCommited(u32) const;
|
bool isAddressCommited(u32) const;
|
||||||
void commitAddress(u32);
|
void commitAddress(u32);
|
||||||
|
|
||||||
/// (function, module containing function, times hit, id).
|
/// vector storing all exec engine
|
||||||
typedef std::tuple<Executable, std::unique_ptr<llvm::ExecutionEngine>, u32, u32> ExecutableStorage;
|
std::vector<std::unique_ptr<llvm::ExecutionEngine> > m_executable_storage;
|
||||||
/// Address to ordinal cahce. Key is address.
|
|
||||||
std::unordered_map<u32, ExecutableStorage> m_address_to_function;
|
|
||||||
|
|
||||||
/// The time at which the m_address_to_ordinal cache was last cleared
|
/// The time at which the m_address_to_ordinal cache was last cleared
|
||||||
std::chrono::high_resolution_clock::time_point m_last_cache_clear_time;
|
std::chrono::high_resolution_clock::time_point m_last_cache_clear_time;
|
||||||
|
@ -883,9 +889,9 @@ namespace ppu_recompiler_llvm {
|
||||||
RecompilationEngine & operator = (const RecompilationEngine & other) = delete;
|
RecompilationEngine & operator = (const RecompilationEngine & other) = delete;
|
||||||
RecompilationEngine & operator = (RecompilationEngine && other) = delete;
|
RecompilationEngine & operator = (RecompilationEngine && other) = delete;
|
||||||
|
|
||||||
/// Process an execution trace.
|
/// Increase usage counter for block starting at addr and compile it if threshold was reached.
|
||||||
/// Returns true if a block was compiled
|
/// Returns true if block was compiled
|
||||||
bool ProcessExecutionTrace(u32);
|
bool IncreaseHitCounterAndBuild(u32 addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Analyse block to get useful info (function called, has indirect branch...)
|
* Analyse block to get useful info (function called, has indirect branch...)
|
||||||
|
|
|
@ -1752,21 +1752,37 @@ void Compiler::BC(u32 bo, u32 bi, s32 bd, u32 aa, u32 lk) {
|
||||||
CreateBranch(CheckBranchCondition(bo, bi), target_i32, lk ? true : false);
|
CreateBranch(CheckBranchCondition(bo, bi), target_i32, lk ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static u32
|
||||||
|
wrappedExecutePPUFuncByIndex(PPUThread &CPU, u32 index)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
execute_ppu_func_by_index(CPU, index);
|
||||||
|
return ExecutionStatus::ExecutionStatusBlockEnded;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
CPU.pending_exception = std::current_exception();
|
||||||
|
return ExecutionStatus::ExecutionStatusPropagateException;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Compiler::HACK(u32 index) {
|
void Compiler::HACK(u32 index) {
|
||||||
Call<void>("execute_ppu_func_by_index", &execute_ppu_func_by_index, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt32(index & EIF_USE_BRANCH ? index : index & ~EIF_PERFORM_BLR));
|
llvm::Value *status = Call<u32>("wrappedExecutePPUFuncByIndex", &wrappedExecutePPUFuncByIndex, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt32(index & EIF_USE_BRANCH ? index : index & ~EIF_PERFORM_BLR));
|
||||||
|
llvm::BasicBlock *cputhreadexitblock = GetBasicBlockFromAddress(m_state.current_instruction_address, "early_exit");
|
||||||
|
llvm::Value *isCPUThreadExit = m_ir_builder->CreateICmpEQ(status, m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusPropagateException));
|
||||||
|
llvm::BasicBlock *normal_execution = GetBasicBlockFromAddress(m_state.current_instruction_address, "normal_execution");
|
||||||
|
m_ir_builder->CreateCondBr(isCPUThreadExit, cputhreadexitblock, normal_execution);
|
||||||
|
m_ir_builder->SetInsertPoint(cputhreadexitblock);
|
||||||
|
m_ir_builder->CreateRet(m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusPropagateException));
|
||||||
|
|
||||||
|
m_ir_builder->SetInsertPoint(normal_execution);
|
||||||
if (index & EIF_PERFORM_BLR || index & EIF_USE_BRANCH) {
|
if (index & EIF_PERFORM_BLR || index & EIF_USE_BRANCH) {
|
||||||
auto lr_i32 = index & EIF_USE_BRANCH ? GetPc() : m_ir_builder->CreateTrunc(m_ir_builder->CreateAnd(GetLr(), ~0x3ULL), m_ir_builder->getInt32Ty());
|
auto lr_i32 = index & EIF_USE_BRANCH ? GetPc() : m_ir_builder->CreateTrunc(m_ir_builder->CreateAnd(GetLr(), ~0x3ULL), m_ir_builder->getInt32Ty());
|
||||||
CreateBranch(nullptr, lr_i32, false, (index & EIF_USE_BRANCH) == 0);
|
CreateBranch(nullptr, lr_i32, false, (index & EIF_USE_BRANCH) == 0);
|
||||||
}
|
}
|
||||||
// copied from Compiler::SC()
|
|
||||||
//auto ret_i1 = Call<bool>("PollStatus", m_poll_status_function, m_state.args[CompileTaskState::Args::State]);
|
|
||||||
//auto cmp_i1 = m_ir_builder->CreateICmpEQ(ret_i1, m_ir_builder->getInt1(true));
|
|
||||||
//auto then_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "then_true");
|
|
||||||
//auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true");
|
|
||||||
//m_ir_builder->CreateCondBr(cmp_i1, then_bb, merge_bb);
|
|
||||||
//m_ir_builder->SetInsertPoint(then_bb);
|
|
||||||
//m_ir_builder->CreateRet(m_ir_builder->getInt32(0xFFFFFFFF));
|
|
||||||
//m_ir_builder->SetInsertPoint(merge_bb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Compiler::SC(u32 lev) {
|
void Compiler::SC(u32 lev) {
|
||||||
|
@ -1788,7 +1804,7 @@ void Compiler::SC(u32 lev) {
|
||||||
auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true");
|
auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true");
|
||||||
m_ir_builder->CreateCondBr(cmp_i1, then_bb, merge_bb);
|
m_ir_builder->CreateCondBr(cmp_i1, then_bb, merge_bb);
|
||||||
m_ir_builder->SetInsertPoint(then_bb);
|
m_ir_builder->SetInsertPoint(then_bb);
|
||||||
m_ir_builder->CreateRet(m_ir_builder->getInt32(0xFFFFFFFF));
|
m_ir_builder->CreateRet(m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusBlockEnded));
|
||||||
m_ir_builder->SetInsertPoint(merge_bb);
|
m_ir_builder->SetInsertPoint(merge_bb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5199,11 +5215,21 @@ void Compiler::CreateBranch(llvm::Value * cmp_i1, llvm::Value * target_i32, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
SetPc(target_i32);
|
SetPc(target_i32);
|
||||||
Function *fn = m_module->getFunction(fmt::format("function_0x%08X", target_address));
|
// Function *fn = m_module->getFunction(fmt::format("function_0x%08X", target_address));
|
||||||
if (fn)
|
llvm::Value *execStatus;
|
||||||
m_ir_builder->CreateCall2(fn, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt64(0));
|
// if (fn)
|
||||||
else
|
// execStatus = m_ir_builder->CreateCall2(fn, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt64(0));
|
||||||
Call<u32>("execute_unknown_function", nullptr, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt64(0));
|
// else
|
||||||
|
execStatus = Call<u32>("execute_unknown_function", nullptr, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt64(0));
|
||||||
|
|
||||||
|
llvm::BasicBlock *cputhreadexitblock = GetBasicBlockFromAddress(m_state.current_instruction_address, "early_exit");
|
||||||
|
llvm::Value *isCPUThreadExit = m_ir_builder->CreateICmpEQ(execStatus, m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusPropagateException));
|
||||||
|
llvm::BasicBlock *normal_execution = GetBasicBlockFromAddress(m_state.current_instruction_address, "normal_execution");
|
||||||
|
m_ir_builder->CreateCondBr(isCPUThreadExit, cputhreadexitblock, normal_execution);
|
||||||
|
m_ir_builder->SetInsertPoint(cputhreadexitblock);
|
||||||
|
m_ir_builder->CreateRet(m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusPropagateException));
|
||||||
|
m_ir_builder->SetInsertPoint(normal_execution);
|
||||||
|
|
||||||
m_ir_builder->CreateBr(GetBasicBlockFromAddress(m_state.current_instruction_address + 4));
|
m_ir_builder->CreateBr(GetBasicBlockFromAddress(m_state.current_instruction_address + 4));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -5221,15 +5247,25 @@ void Compiler::CreateBranch(llvm::Value * cmp_i1, llvm::Value * target_i32, bool
|
||||||
SetPc(target_i32);
|
SetPc(target_i32);
|
||||||
if (target_is_lr && !lk) {
|
if (target_is_lr && !lk) {
|
||||||
// Return from this function
|
// Return from this function
|
||||||
m_ir_builder->CreateRet(m_ir_builder->getInt32(0));
|
m_ir_builder->CreateRet(m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusReturn));
|
||||||
}
|
}
|
||||||
else if (lk) {
|
else if (lk) {
|
||||||
BasicBlock *next_block = GetBasicBlockFromAddress(m_state.current_instruction_address + 4);
|
BasicBlock *next_block = GetBasicBlockFromAddress(m_state.current_instruction_address + 4);
|
||||||
m_ir_builder->CreateCall2(m_execute_unknown_function, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt64(0));
|
|
||||||
|
llvm::Value *execStatus = m_ir_builder->CreateCall2(m_execute_unknown_function, m_state.args[CompileTaskState::Args::State], m_ir_builder->getInt64(0));
|
||||||
|
|
||||||
|
llvm::BasicBlock *cputhreadexitblock = GetBasicBlockFromAddress(m_state.current_instruction_address, "early_exit");
|
||||||
|
llvm::Value *isCPUThreadExit = m_ir_builder->CreateICmpEQ(execStatus, m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusPropagateException));
|
||||||
|
llvm::BasicBlock *normal_execution = GetBasicBlockFromAddress(m_state.current_instruction_address, "normal_execution");
|
||||||
|
m_ir_builder->CreateCondBr(isCPUThreadExit, cputhreadexitblock, normal_execution);
|
||||||
|
m_ir_builder->SetInsertPoint(cputhreadexitblock);
|
||||||
|
m_ir_builder->CreateRet(m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusPropagateException));
|
||||||
|
m_ir_builder->SetInsertPoint(normal_execution);
|
||||||
|
|
||||||
m_ir_builder->CreateBr(next_block);
|
m_ir_builder->CreateBr(next_block);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_ir_builder->CreateRet(m_ir_builder->getInt32(-1));
|
m_ir_builder->CreateRet(m_ir_builder->getInt32(ExecutionStatus::ExecutionStatusBlockEnded));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -536,6 +536,11 @@ public:
|
||||||
|
|
||||||
std::function<void(PPUThread& CPU)> custom_task;
|
std::function<void(PPUThread& CPU)> custom_task;
|
||||||
|
|
||||||
|
/// When a thread has met an exception, this variable is used to retro propagate it through stack call.
|
||||||
|
/// Note that exception_ptr is similar to shared_ptr and doesn't need to be freed, but need a nullptr
|
||||||
|
/// to be assigned.
|
||||||
|
std::exception_ptr pending_exception;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PPUThread(const std::string& name);
|
PPUThread(const std::string& name);
|
||||||
virtual ~PPUThread() override;
|
virtual ~PPUThread() override;
|
||||||
|
|
|
@ -289,6 +289,9 @@ template<typename T> std::string FragmentProgramDecompiler::GetSRC(T src)
|
||||||
ret += AddConst();
|
ret += AddConst();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 3: // ??? Used by a few games, what is it?
|
||||||
|
LOG_ERROR(RSX, "Src type 3 used, please report this to a developer.");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_ERROR(RSX, "Bad src type %d", u32{ src.reg_type });
|
LOG_ERROR(RSX, "Bad src type %d", u32{ src.reg_type });
|
||||||
Emu.Pause();
|
Emu.Pause();
|
||||||
|
@ -315,7 +318,10 @@ std::string FragmentProgramDecompiler::BuildCode()
|
||||||
{
|
{
|
||||||
//main += fmt::format("\tgl_FragColor = %c0;\n", m_ctrl & 0x40 ? 'r' : 'h');
|
//main += fmt::format("\tgl_FragColor = %c0;\n", m_ctrl & 0x40 ? 'r' : 'h');
|
||||||
|
|
||||||
if (m_ctrl & 0xe) main += m_ctrl & 0x40 ? "\tgl_FragDepth = r1.z;\n" : "\tgl_FragDepth = h2.z;\n";
|
if (m_ctrl & 0xe)
|
||||||
|
{
|
||||||
|
main += m_ctrl & 0x40 ? "\tgl_FragDepth = r1.z;\n" : "\tgl_FragDepth = h0.z;\n";
|
||||||
|
}
|
||||||
|
|
||||||
std::stringstream OS;
|
std::stringstream OS;
|
||||||
insertHeader(OS);
|
insertHeader(OS);
|
||||||
|
|
|
@ -282,6 +282,14 @@ enum
|
||||||
CELL_GCM_CONTEXT_DMA_NOTIFY_MAIN_0 = 0x6660420F,
|
CELL_GCM_CONTEXT_DMA_NOTIFY_MAIN_0 = 0x6660420F,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// User Clip Values
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_GCM_USER_CLIP_PLANE_DISABLE = 0,
|
||||||
|
CELL_GCM_USER_CLIP_PLANE_ENABLE_LT = 1,
|
||||||
|
CELL_GCM_USER_CLIP_PLANE_ENABLE_GE = 2,
|
||||||
|
};
|
||||||
|
|
||||||
struct CellGcmControl
|
struct CellGcmControl
|
||||||
{
|
{
|
||||||
atomic_be_t<u32> put;
|
atomic_be_t<u32> put;
|
||||||
|
@ -1440,9 +1448,10 @@ static const std::string GetMethodName(const u32 id)
|
||||||
{ NV4097_SET_TRANSFORM_BRANCH_BITS, "NV4097_SET_TRANSFORM_BRANCH_BITS" }
|
{ NV4097_SET_TRANSFORM_BRANCH_BITS, "NV4097_SET_TRANSFORM_BRANCH_BITS" }
|
||||||
};
|
};
|
||||||
|
|
||||||
for(auto& s: METHOD_NAME_LIST) {
|
for (auto& s: METHOD_NAME_LIST)
|
||||||
|
{
|
||||||
if (s.id == id)
|
if (s.id == id)
|
||||||
return "CELL_GCM_" + s.name;
|
return s.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt::format("unknown/illegal method [0x%08x]", id);
|
return fmt::format("unknown/illegal method [0x%08x]", id);
|
||||||
|
|
|
@ -300,7 +300,7 @@ s32 cellFontGetRenderCharGlyphMetrics(vm::ptr<CellFont> font, u32 code, vm::ptr<
|
||||||
|
|
||||||
s32 cellFontRenderCharGlyphImage(vm::ptr<CellFont> font, u32 code, vm::ptr<CellFontRenderSurface> surface, float x, float y, vm::ptr<CellFontGlyphMetrics> metrics, vm::ptr<CellFontImageTransInfo> transInfo)
|
s32 cellFontRenderCharGlyphImage(vm::ptr<CellFont> font, u32 code, vm::ptr<CellFontRenderSurface> surface, float x, float y, vm::ptr<CellFontGlyphMetrics> metrics, vm::ptr<CellFontImageTransInfo> transInfo)
|
||||||
{
|
{
|
||||||
cellFont.Log("cellFontRenderCharGlyphImage(font=*0x%x, code=0x%x, surface=*0x%x, x=%f, y=%f, metrics=*0x%x, trans=*0x%x)", font, code, surface, x, y, metrics, transInfo);
|
cellFont.Notice("cellFontRenderCharGlyphImage(font=*0x%x, code=0x%x, surface=*0x%x, x=%f, y=%f, metrics=*0x%x, trans=*0x%x)", font, code, surface, x, y, metrics, transInfo);
|
||||||
|
|
||||||
if (!font->renderer_addr)
|
if (!font->renderer_addr)
|
||||||
{
|
{
|
||||||
|
@ -374,7 +374,7 @@ s32 cellFontGetEffectSlant(vm::ptr<CellFont> font, vm::ptr<float> slantParam)
|
||||||
|
|
||||||
s32 cellFontGetFontIdCode(vm::ptr<CellFont> font, u32 code, vm::ptr<u32> fontId, vm::ptr<u32> fontCode)
|
s32 cellFontGetFontIdCode(vm::ptr<CellFont> font, u32 code, vm::ptr<u32> fontId, vm::ptr<u32> fontCode)
|
||||||
{
|
{
|
||||||
cellFont.Todo("cellFontGetFontIdCode(font=*0x%x, code=0x%x, fontId=*0x%x, fontCode=*0x%x)", font, code, fontId, fontCode);
|
cellFont.Todo("cellFontGetFontIdCode(font=*0x%x, code=%d, fontId=*0x%x, fontCode=*0x%x)", font, code, fontId, fontCode);
|
||||||
|
|
||||||
// TODO: ?
|
// TODO: ?
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
|
|
@ -789,7 +789,6 @@ s32 sdata_unpack(const std::string& packed_file, const std::string& unpacked_fil
|
||||||
cellFs.Warning("cellFsSdataOpen: Compressed SDATA files are not supported yet.");
|
cellFs.Warning("cellFsSdataOpen: Compressed SDATA files are not supported yet.");
|
||||||
return CELL_EFSSPECIFIC;
|
return CELL_EFSSPECIFIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SDATA file is NOT compressed
|
// SDATA file is NOT compressed
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -826,7 +825,7 @@ s32 sdata_unpack(const std::string& packed_file, const std::string& unpacked_fil
|
||||||
|
|
||||||
s32 cellFsSdataOpen(PPUThread& ppu, vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, vm::cptr<void> arg, u64 size)
|
s32 cellFsSdataOpen(PPUThread& ppu, vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, vm::cptr<void> arg, u64 size)
|
||||||
{
|
{
|
||||||
cellFs.Log("cellFsSdataOpen(path=*0x%x, flags=%#o, fd=*0x%x, arg=*0x%x, size=0x%llx)", path, flags, fd, arg, size);
|
cellFs.Notice("cellFsSdataOpen(path=*0x%x, flags=%#o, fd=*0x%x, arg=*0x%x, size=0x%llx)", path, flags, fd, arg, size);
|
||||||
|
|
||||||
if (flags != CELL_FS_O_RDONLY)
|
if (flags != CELL_FS_O_RDONLY)
|
||||||
{
|
{
|
||||||
|
|
|
@ -122,12 +122,12 @@ s32 cellHddGameCheck(PPUThread& ppu, u32 version, vm::cptr<char> dirName, u32 er
|
||||||
|
|
||||||
// TODO ?
|
// TODO ?
|
||||||
|
|
||||||
//funcStat(result, get, set);
|
funcStat(ppu, result, get, set);
|
||||||
|
|
||||||
//if (result->result != CELL_HDDGAME_CBRESULT_OK && result->result != CELL_HDDGAME_CBRESULT_OK_CANCEL)
|
if (result->result != CELL_HDDGAME_CBRESULT_OK && result->result != CELL_HDDGAME_CBRESULT_OK_CANCEL)
|
||||||
//{
|
{
|
||||||
// return CELL_HDDGAME_ERROR_CBRESULT;
|
return CELL_HDDGAME_ERROR_CBRESULT;
|
||||||
//}
|
}
|
||||||
|
|
||||||
// TODO ?
|
// TODO ?
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,13 @@ s32 cellGameSetExitParam()
|
||||||
throw EXCEPTION("");
|
throw EXCEPTION("");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellGameGetHomeDataExportPath()
|
s32 cellGameGetHomeDataExportPath(vm::ptr<char> exportPath)
|
||||||
{
|
{
|
||||||
throw EXCEPTION("");
|
cellGameExec.Warning("cellGameGetHomeDataExportPath(exportPath=0x%x)", exportPath);
|
||||||
|
|
||||||
|
// TODO: PlayStation home is defunct.
|
||||||
|
|
||||||
|
return CELL_GAME_ERROR_NOAPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellGameGetHomePath()
|
s32 cellGameGetHomePath()
|
||||||
|
|
|
@ -44,16 +44,20 @@ u32 map_offset_pos = 0;
|
||||||
*/
|
*/
|
||||||
u32 gcmGetLocalMemorySize(u32 sdk_version)
|
u32 gcmGetLocalMemorySize(u32 sdk_version)
|
||||||
{
|
{
|
||||||
if (sdk_version >= 0x00220000) {
|
if (sdk_version >= 0x00220000)
|
||||||
|
{
|
||||||
return 0x0F900000; // 249MB
|
return 0x0F900000; // 249MB
|
||||||
}
|
}
|
||||||
if (sdk_version >= 0x00200000) {
|
if (sdk_version >= 0x00200000)
|
||||||
|
{
|
||||||
return 0x0F200000; // 242MB
|
return 0x0F200000; // 242MB
|
||||||
}
|
}
|
||||||
if (sdk_version >= 0x00190000) {
|
if (sdk_version >= 0x00190000)
|
||||||
|
{
|
||||||
return 0x0EA00000; // 234MB
|
return 0x0EA00000; // 234MB
|
||||||
}
|
}
|
||||||
if (sdk_version >= 0x00180000) {
|
if (sdk_version >= 0x00180000)
|
||||||
|
{
|
||||||
return 0x0E800000; // 232MB
|
return 0x0E800000; // 232MB
|
||||||
}
|
}
|
||||||
return 0x0E000000; // 224MB
|
return 0x0E000000; // 224MB
|
||||||
|
@ -428,7 +432,8 @@ s32 cellGcmSetDisplayBuffer(u32 id, u32 offset, u32 pitch, u32 width, u32 height
|
||||||
{
|
{
|
||||||
cellGcmSys.Log("cellGcmSetDisplayBuffer(id=0x%x,offset=0x%x,pitch=%d,width=%d,height=%d)", id, offset, width ? pitch / width : pitch, width, height);
|
cellGcmSys.Log("cellGcmSetDisplayBuffer(id=0x%x,offset=0x%x,pitch=%d,width=%d,height=%d)", id, offset, width ? pitch / width : pitch, width, height);
|
||||||
|
|
||||||
if (id > 7) {
|
if (id > 7)
|
||||||
|
{
|
||||||
cellGcmSys.Error("cellGcmSetDisplayBuffer: CELL_EINVAL");
|
cellGcmSys.Error("cellGcmSetDisplayBuffer: CELL_EINVAL");
|
||||||
return CELL_EINVAL;
|
return CELL_EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -440,7 +445,8 @@ s32 cellGcmSetDisplayBuffer(u32 id, u32 offset, u32 pitch, u32 width, u32 height
|
||||||
buffers[id].width = width;
|
buffers[id].width = width;
|
||||||
buffers[id].height = height;
|
buffers[id].height = height;
|
||||||
|
|
||||||
if (id + 1 > Emu.GetGSManager().GetRender().m_gcm_buffers_count) {
|
if (id + 1 > Emu.GetGSManager().GetRender().m_gcm_buffers_count)
|
||||||
|
{
|
||||||
Emu.GetGSManager().GetRender().m_gcm_buffers_count = id + 1;
|
Emu.GetGSManager().GetRender().m_gcm_buffers_count = id + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -736,9 +742,9 @@ u64 cellGcmGetLastFlipTime()
|
||||||
return Emu.GetGSManager().GetRender().m_last_flip_time;
|
return Emu.GetGSManager().GetRender().m_last_flip_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellGcmGetLastSecondVTime()
|
u64 cellGcmGetLastSecondVTime()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
cellGcmSys.Todo("cellGcmGetLastSecondVTime()");
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
extern Module cellL10n;
|
extern Module cellL10n;
|
||||||
|
|
||||||
//translate code id to code name. some codepage may has another name.
|
// Translate code id to code name. some codepage may has another name.
|
||||||
// If this makes your compilation fail, try replace the string code with one in "iconv -l"
|
// If this makes your compilation fail, try replace the string code with one in "iconv -l"
|
||||||
bool _L10nCodeParse(s32 code, std::string& retCode)
|
bool _L10nCodeParse(s32 code, std::string& retCode)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ bool _L10nCodeParse(s32 code, std::string& retCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//translate code id to code name.
|
// Translate code id to code name.
|
||||||
// If this makes your compilation fail, try replace the string code with one in "iconv -l"
|
// If this makes your compilation fail, try replace the string code with one in "iconv -l"
|
||||||
bool _L10nCodeParse(s32 code, u32& retCode)
|
bool _L10nCodeParse(s32 code, u32& retCode)
|
||||||
{
|
{
|
||||||
|
@ -885,9 +885,14 @@ s32 UTF16toUTF32()
|
||||||
throw EXCEPTION("");
|
throw EXCEPTION("");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 l10n_convert_str()
|
s32 l10n_convert_str(s32 cd, vm::cptr<void> src, vm::ptr<u32> src_len, vm::ptr<void> dst, vm::ptr<u32> dst_len)
|
||||||
{
|
{
|
||||||
throw EXCEPTION("");
|
cellL10n.Warning("l10n_convert_str(cd=%d, src=*0x%x, src_len=*0x%x, dst=*0x%x, dst_len=*0x%x)", cd, src, src_len, dst, dst_len);
|
||||||
|
|
||||||
|
s32 src_code = cd >> 16;
|
||||||
|
s32 dst_code = cd & 0xffff;
|
||||||
|
|
||||||
|
return L10nConvertStr(src_code, src, src_len, dst_code, dst, dst_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 EUCJPstoJISs()
|
s32 EUCJPstoJISs()
|
||||||
|
@ -990,9 +995,10 @@ s32 MSJISstoUCS2s()
|
||||||
throw EXCEPTION("");
|
throw EXCEPTION("");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 l10n_get_converter()
|
s32 l10n_get_converter(u32 src_code, u32 dst_code)
|
||||||
{
|
{
|
||||||
throw EXCEPTION("");
|
cellL10n.Warning("l10n_get_converter(src_code=%d, dst_code=%d)", src_code, dst_code);
|
||||||
|
return (src_code << 16) | dst_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 GB18030stoUTF8s()
|
s32 GB18030stoUTF8s()
|
||||||
|
@ -1157,7 +1163,6 @@ s32 UTF8stoUCS2s()
|
||||||
throw EXCEPTION("");
|
throw EXCEPTION("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Module cellL10n("cellL10n", []()
|
Module cellL10n("cellL10n", []()
|
||||||
{
|
{
|
||||||
REG_FUNC(cellL10n, UCS2toEUCJP);
|
REG_FUNC(cellL10n, UCS2toEUCJP);
|
||||||
|
|
|
@ -11,8 +11,16 @@ extern Module sys_io;
|
||||||
s32 cellMouseInit(u32 max_connect)
|
s32 cellMouseInit(u32 max_connect)
|
||||||
{
|
{
|
||||||
sys_io.Warning("cellMouseInit(max_connect=%d)", max_connect);
|
sys_io.Warning("cellMouseInit(max_connect=%d)", max_connect);
|
||||||
if(Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_ALREADY_INITIALIZED;
|
|
||||||
if(max_connect > 7) return CELL_MOUSE_ERROR_INVALID_PARAMETER;
|
if (Emu.GetMouseManager().IsInited())
|
||||||
|
{
|
||||||
|
return CELL_MOUSE_ERROR_ALREADY_INITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (max_connect > 7)
|
||||||
|
{
|
||||||
|
return CELL_MOUSE_ERROR_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
Emu.GetMouseManager().Init(max_connect);
|
Emu.GetMouseManager().Init(max_connect);
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
@ -22,8 +30,16 @@ s32 cellMouseInit(u32 max_connect)
|
||||||
s32 cellMouseClearBuf(u32 port_no)
|
s32 cellMouseClearBuf(u32 port_no)
|
||||||
{
|
{
|
||||||
sys_io.Log("cellMouseClearBuf(port_no=%d)", port_no);
|
sys_io.Log("cellMouseClearBuf(port_no=%d)", port_no);
|
||||||
if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED;
|
|
||||||
if(port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_INVALID_PARAMETER;
|
if (!Emu.GetMouseManager().IsInited())
|
||||||
|
{
|
||||||
|
return CELL_MOUSE_ERROR_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (port_no >= Emu.GetMouseManager().GetMice().size())
|
||||||
|
{
|
||||||
|
return CELL_MOUSE_ERROR_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
//?
|
//?
|
||||||
|
|
||||||
|
@ -33,7 +49,12 @@ s32 cellMouseClearBuf(u32 port_no)
|
||||||
s32 cellMouseEnd()
|
s32 cellMouseEnd()
|
||||||
{
|
{
|
||||||
sys_io.Log("cellMouseEnd()");
|
sys_io.Log("cellMouseEnd()");
|
||||||
if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED;
|
|
||||||
|
if (!Emu.GetMouseManager().IsInited())
|
||||||
|
{
|
||||||
|
return CELL_MOUSE_ERROR_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
Emu.GetMouseManager().Close();
|
Emu.GetMouseManager().Close();
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +62,11 @@ s32 cellMouseEnd()
|
||||||
s32 cellMouseGetInfo(vm::ptr<CellMouseInfo> info)
|
s32 cellMouseGetInfo(vm::ptr<CellMouseInfo> info)
|
||||||
{
|
{
|
||||||
sys_io.Log("cellMouseGetInfo(info=*0x%x)", info);
|
sys_io.Log("cellMouseGetInfo(info=*0x%x)", info);
|
||||||
if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED;
|
|
||||||
|
if (!Emu.GetMouseManager().IsInited())
|
||||||
|
{
|
||||||
|
return CELL_MOUSE_ERROR_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
const MouseInfo& current_info = Emu.GetMouseManager().GetInfo();
|
const MouseInfo& current_info = Emu.GetMouseManager().GetInfo();
|
||||||
info->max_connect = current_info.max_connect;
|
info->max_connect = current_info.max_connect;
|
||||||
|
@ -57,8 +82,15 @@ s32 cellMouseGetInfo(vm::ptr<CellMouseInfo> info)
|
||||||
s32 cellMouseInfoTabletMode(u32 port_no, vm::ptr<CellMouseInfoTablet> info)
|
s32 cellMouseInfoTabletMode(u32 port_no, vm::ptr<CellMouseInfoTablet> info)
|
||||||
{
|
{
|
||||||
sys_io.Log("cellMouseInfoTabletMode(port_no=%d, info=*0x%x)", port_no, info);
|
sys_io.Log("cellMouseInfoTabletMode(port_no=%d, info=*0x%x)", port_no, info);
|
||||||
if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED;
|
if (!Emu.GetMouseManager().IsInited())
|
||||||
if(port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_INVALID_PARAMETER;
|
{
|
||||||
|
return CELL_MOUSE_ERROR_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (port_no >= Emu.GetMouseManager().GetMice().size())
|
||||||
|
{
|
||||||
|
return CELL_MOUSE_ERROR_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
info->is_supported = 0; // Unimplemented: (0=Tablet mode is not supported)
|
info->is_supported = 0; // Unimplemented: (0=Tablet mode is not supported)
|
||||||
info->mode = 1; // Unimplemented: (1=Mouse mode)
|
info->mode = 1; // Unimplemented: (1=Mouse mode)
|
||||||
|
@ -69,8 +101,14 @@ s32 cellMouseInfoTabletMode(u32 port_no, vm::ptr<CellMouseInfoTablet> info)
|
||||||
s32 cellMouseGetData(u32 port_no, vm::ptr<CellMouseData> data)
|
s32 cellMouseGetData(u32 port_no, vm::ptr<CellMouseData> data)
|
||||||
{
|
{
|
||||||
sys_io.Log("cellMouseGetData(port_no=%d, data=*0x%x)", port_no, data);
|
sys_io.Log("cellMouseGetData(port_no=%d, data=*0x%x)", port_no, data);
|
||||||
if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED;
|
if (!Emu.GetMouseManager().IsInited())
|
||||||
if(port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_NO_DEVICE;
|
{
|
||||||
|
return CELL_MOUSE_ERROR_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
if (port_no >= Emu.GetMouseManager().GetMice().size())
|
||||||
|
{
|
||||||
|
return CELL_MOUSE_ERROR_NO_DEVICE;
|
||||||
|
}
|
||||||
|
|
||||||
MouseData& current_data = Emu.GetMouseManager().GetData(port_no);
|
MouseData& current_data = Emu.GetMouseManager().GetData(port_no);
|
||||||
data->update = current_data.update;
|
data->update = current_data.update;
|
||||||
|
|
|
@ -1,9 +1,20 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "Emu/System.h"
|
||||||
|
#include "Emu/IdManager.h"
|
||||||
#include "Emu/Memory/Memory.h"
|
#include "Emu/Memory/Memory.h"
|
||||||
|
#include "Emu/SysCalls/Callback.h"
|
||||||
#include "Emu/SysCalls/Modules.h"
|
#include "Emu/SysCalls/Modules.h"
|
||||||
|
|
||||||
|
#include "cellMusic.h"
|
||||||
|
|
||||||
extern Module cellMusic;
|
extern Module cellMusic;
|
||||||
|
|
||||||
|
struct music2_t
|
||||||
|
{
|
||||||
|
vm::ptr<CellMusic2Callback> func;
|
||||||
|
vm::ptr<void> userData;
|
||||||
|
};
|
||||||
|
|
||||||
s32 cellMusicGetSelectionContext()
|
s32 cellMusicGetSelectionContext()
|
||||||
{
|
{
|
||||||
throw EXCEPTION("");
|
throw EXCEPTION("");
|
||||||
|
@ -99,9 +110,32 @@ s32 cellMusicSelectContents()
|
||||||
throw EXCEPTION("");
|
throw EXCEPTION("");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellMusicInitialize2()
|
s32 cellMusicInitialize2(s32 mode, s32 spuPriority, vm::ptr<CellMusic2Callback> func, vm::ptr<void> userData)
|
||||||
{
|
{
|
||||||
throw EXCEPTION("");
|
cellMusic.Todo("cellMusicInitialize2(mode=%d, spuPriority=%d, func=*0x%x, userData=*0x%x)", mode, spuPriority, func, userData);
|
||||||
|
|
||||||
|
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
|
||||||
|
{
|
||||||
|
cellMusic.Todo("Unknown player mode: 0x%x", mode);
|
||||||
|
return CELL_MUSIC2_ERROR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
named_thread_t(WRAP_EXPR("CellMusicInit"), [=]()
|
||||||
|
{
|
||||||
|
const auto music = fxm::make_always<music2_t>();
|
||||||
|
music->func = func;
|
||||||
|
music->userData = userData;
|
||||||
|
|
||||||
|
Emu.GetCallbackManager().Register([=](CPUThread& CPU) -> s32
|
||||||
|
{
|
||||||
|
vm::var<u32> ret(CPU);
|
||||||
|
*ret = CELL_OK;
|
||||||
|
func(static_cast<PPUThread&>(CPU), CELL_MUSIC2_EVENT_INITIALIZE_RESULT, ret, userData);
|
||||||
|
return CELL_OK;
|
||||||
|
});
|
||||||
|
}).detach();
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellMusicSetVolume()
|
s32 cellMusicSetVolume()
|
||||||
|
|
134
rpcs3/Emu/SysCalls/Modules/cellMusic.h
Normal file
134
rpcs3/Emu/SysCalls/Modules/cellMusic.h
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace vm { using namespace ps3; }
|
||||||
|
|
||||||
|
// Error Codes
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_MUSIC_OK = 0,
|
||||||
|
CELL_MUSIC_CANCELED = 1,
|
||||||
|
CELL_MUSIC_PLAYBACK_FINISHED = 0x8002c101,
|
||||||
|
CELL_MUSIC_ERROR_PARAM = 0x8002c102,
|
||||||
|
CELL_MUSIC_ERROR_BUSY = 0x8002c103,
|
||||||
|
CELL_MUSIC_ERROR_NO_ACTIVE_CONTENT = 0x8002c104,
|
||||||
|
CELL_MUSIC_ERROR_NO_MATCH_FOUND = 0x8002c105,
|
||||||
|
CELL_MUSIC_ERROR_INVALID_CONTEXT = 0x8002c106,
|
||||||
|
CELL_MUSIC_ERROR_PLAYBACK_FAILURE = 0x8002c107,
|
||||||
|
CELL_MUSIC_ERROR_NO_MORE_CONTENT = 0x8002c108,
|
||||||
|
CELL_MUSIC_DIALOG_OPEN = 0x8002c109,
|
||||||
|
CELL_MUSIC_DIALOG_CLOSE = 0x8002c10A,
|
||||||
|
CELL_MUSIC_ERROR_GENERIC = 0x8002c1FF,
|
||||||
|
CELL_MUSIC2_OK = CELL_MUSIC_OK,
|
||||||
|
CELL_MUSIC2_CANCELED = CELL_MUSIC_CANCELED,
|
||||||
|
CELL_MUSIC2_PLAYBACK_FINISHED = CELL_MUSIC_PLAYBACK_FINISHED,
|
||||||
|
CELL_MUSIC2_ERROR_PARAM = CELL_MUSIC_ERROR_PARAM,
|
||||||
|
CELL_MUSIC2_ERROR_BUSY = CELL_MUSIC_ERROR_BUSY,
|
||||||
|
CELL_MUSIC2_ERROR_NO_ACTIVE_CONTENT = CELL_MUSIC_ERROR_NO_ACTIVE_CONTENT,
|
||||||
|
CELL_MUSIC2_ERROR_NO_MATCH_FOUND = CELL_MUSIC_ERROR_NO_MATCH_FOUND,
|
||||||
|
CELL_MUSIC2_ERROR_INVALID_CONTEXT = CELL_MUSIC_ERROR_INVALID_CONTEXT,
|
||||||
|
CELL_MUSIC2_ERROR_PLAYBACK_FAILURE = CELL_MUSIC_ERROR_PLAYBACK_FAILURE,
|
||||||
|
CELL_MUSIC2_ERROR_NO_MORE_CONTENT = CELL_MUSIC_ERROR_NO_MORE_CONTENT,
|
||||||
|
CELL_MUSIC2_DIALOG_OPEN = CELL_MUSIC_DIALOG_OPEN,
|
||||||
|
CELL_MUSIC2_DIALOG_CLOSE = CELL_MUSIC_DIALOG_CLOSE,
|
||||||
|
CELL_MUSIC2_ERROR_GENERIC = CELL_MUSIC_ERROR_GENERIC,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_MUSIC_INITIALIZING_FINISHED = 1,
|
||||||
|
CELL_SYSUTIL_MUSIC_SHUTDOWN_FINISHED = 4, // Was 3 in 1.03, changed to 4 in 1.1
|
||||||
|
CELL_SYSUTIL_MUSIC_LOADING_FINISHED = 5,
|
||||||
|
CELL_SYSUTIL_MUSIC_UNLOADING_FINISHED = 7,
|
||||||
|
CELL_SYSUTIL_MUSIC_RELEASED = 9,
|
||||||
|
CELL_SYSUTIL_MUSIC_GRABBED = 11,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_MUSIC2_INITIALIZING_FINISHED = CELL_SYSUTIL_MUSIC_INITIALIZING_FINISHED,
|
||||||
|
CELL_SYSUTIL_MUSIC2_SHUTDOWN_FINISHED = CELL_SYSUTIL_MUSIC_SHUTDOWN_FINISHED,
|
||||||
|
CELL_SYSUTIL_MUSIC2_LOADING_FINISHED = CELL_SYSUTIL_MUSIC_LOADING_FINISHED,
|
||||||
|
CELL_SYSUTIL_MUSIC2_UNLOADING_FINISHED = CELL_SYSUTIL_MUSIC_UNLOADING_FINISHED,
|
||||||
|
CELL_SYSUTIL_MUSIC2_RELEASED = CELL_SYSUTIL_MUSIC_RELEASED,
|
||||||
|
CELL_SYSUTIL_MUSIC2_GRABBED = CELL_SYSUTIL_MUSIC_GRABBED,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_MUSIC_EVENT_STATUS_NOTIFICATION = 0,
|
||||||
|
CELL_MUSIC_EVENT_INITIALIZE_RESULT = 1,
|
||||||
|
CELL_MUSIC_EVENT_FINALIZE_RESULT = 2,
|
||||||
|
CELL_MUSIC_EVENT_SELECT_CONTENTS_RESULT = 3,
|
||||||
|
CELL_MUSIC_EVENT_SET_PLAYBACK_COMMAND_RESULT = 4,
|
||||||
|
CELL_MUSIC_EVENT_SET_VOLUME_RESULT = 5,
|
||||||
|
CELL_MUSIC_EVENT_SET_SELECTION_CONTEXT_RESULT = 6,
|
||||||
|
CELL_MUSIC_EVENT_UI_NOTIFICATION = 7,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_MUSIC2_EVENT_STATUS_NOTIFICATION = CELL_MUSIC_EVENT_STATUS_NOTIFICATION,
|
||||||
|
CELL_MUSIC2_EVENT_INITIALIZE_RESULT = CELL_MUSIC_EVENT_INITIALIZE_RESULT,
|
||||||
|
CELL_MUSIC2_EVENT_FINALIZE_RESULT = CELL_MUSIC_EVENT_FINALIZE_RESULT,
|
||||||
|
CELL_MUSIC2_EVENT_SELECT_CONTENTS_RESULT = CELL_MUSIC_EVENT_SELECT_CONTENTS_RESULT,
|
||||||
|
CELL_MUSIC2_EVENT_SET_PLAYBACK_COMMAND_RESULT = CELL_MUSIC_EVENT_SET_PLAYBACK_COMMAND_RESULT,
|
||||||
|
CELL_MUSIC2_EVENT_SET_VOLUME_RESULT = CELL_MUSIC_EVENT_SET_VOLUME_RESULT,
|
||||||
|
CELL_MUSIC2_EVENT_SET_SELECTION_CONTEXT_RESULT = CELL_MUSIC_EVENT_SET_SELECTION_CONTEXT_RESULT,
|
||||||
|
CELL_MUSIC2_EVENT_UI_NOTIFICATION = CELL_MUSIC_EVENT_UI_NOTIFICATION,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_MUSIC_PB_CMD_STOP = 0,
|
||||||
|
CELL_MUSIC_PB_CMD_PLAY = 1,
|
||||||
|
CELL_MUSIC_PB_CMD_PAUSE = 2,
|
||||||
|
CELL_MUSIC_PB_CMD_NEXT = 3,
|
||||||
|
CELL_MUSIC_PB_CMD_PREV = 4,
|
||||||
|
CELL_MUSIC_PB_CMD_FASTFORWARD = 5,
|
||||||
|
CELL_MUSIC_PB_CMD_FASTREVERSE = 6,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_MUSIC2_PB_CMD_STOP = CELL_MUSIC_PB_CMD_STOP,
|
||||||
|
CELL_MUSIC2_PB_CMD_PLAY = CELL_MUSIC_PB_CMD_PLAY,
|
||||||
|
CELL_MUSIC2_PB_CMD_PAUSE = CELL_MUSIC_PB_CMD_PAUSE,
|
||||||
|
CELL_MUSIC2_PB_CMD_NEXT = CELL_MUSIC_PB_CMD_NEXT,
|
||||||
|
CELL_MUSIC2_PB_CMD_PREV = CELL_MUSIC_PB_CMD_PREV,
|
||||||
|
CELL_MUSIC2_PB_CMD_FASTFORWARD = CELL_MUSIC_PB_CMD_FASTFORWARD,
|
||||||
|
CELL_MUSIC2_PB_CMD_FASTREVERSE = CELL_MUSIC_PB_CMD_FASTREVERSE,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_MUSIC_PB_STATUS_STOP = 0,
|
||||||
|
CELL_MUSIC_PB_STATUS_PLAY = 1,
|
||||||
|
CELL_MUSIC_PB_STATUS_PAUSE = 2,
|
||||||
|
CELL_MUSIC_PB_STATUS_FASTFORWARD = 3,
|
||||||
|
CELL_MUSIC_PB_STATUS_FASTREVERSE = 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_MUSIC2_PB_STATUS_STOP = CELL_MUSIC_PB_STATUS_STOP,
|
||||||
|
CELL_MUSIC2_PB_STATUS_PLAY = CELL_MUSIC_PB_STATUS_PLAY,
|
||||||
|
CELL_MUSIC2_PB_STATUS_PAUSE = CELL_MUSIC_PB_STATUS_PAUSE,
|
||||||
|
CELL_MUSIC2_PB_STATUS_FASTFORWARD = CELL_MUSIC_PB_STATUS_FASTFORWARD,
|
||||||
|
CELL_MUSIC2_PB_STATUS_FASTREVERSE = CELL_MUSIC_PB_STATUS_FASTREVERSE,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_MUSIC_PLAYBACK_MEMORY_CONTAINER_SIZE = 11 * 1024 * 1024,
|
||||||
|
CELL_MUSIC_PLAYER_MODE_NORMAL = 0,
|
||||||
|
CELL_MUSIC2_PLAYER_MODE_NORMAL = CELL_MUSIC_PLAYER_MODE_NORMAL,
|
||||||
|
CELL_MUSIC_SELECTION_CONTEXT_SIZE = 2048,
|
||||||
|
};
|
||||||
|
|
||||||
|
using CellMusicCallback = void(u32 event, vm::ptr<void> param, vm::ptr<void> userData);
|
||||||
|
using CellMusic2Callback = void(u32 event, vm::ptr<u32> param, vm::ptr<void> userData);
|
||||||
|
|
||||||
|
struct CellMusicSelectionContext
|
||||||
|
{
|
||||||
|
char data[CELL_MUSIC_SELECTION_CONTEXT_SIZE];
|
||||||
|
};
|
|
@ -30,6 +30,17 @@
|
||||||
|
|
||||||
extern Module cellNetCtl;
|
extern Module cellNetCtl;
|
||||||
|
|
||||||
|
std::unique_ptr<SignInDialogInstance> g_sign_in_dialog;
|
||||||
|
|
||||||
|
SignInDialogInstance::SignInDialogInstance()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void SignInDialogInstance::Close()
|
||||||
|
{
|
||||||
|
//state = signInDialogClose;
|
||||||
|
}
|
||||||
|
|
||||||
s32 cellNetCtlInit()
|
s32 cellNetCtlInit()
|
||||||
{
|
{
|
||||||
cellNetCtl.Warning("cellNetCtlInit()");
|
cellNetCtl.Warning("cellNetCtlInit()");
|
||||||
|
@ -338,16 +349,21 @@ s32 cellNetCtlNetStartDialogLoadAsync(vm::ptr<CellNetCtlNetStartDialogParam> par
|
||||||
{
|
{
|
||||||
cellNetCtl.Warning("cellNetCtlNetStartDialogLoadAsync(param=*0x%x)", param);
|
cellNetCtl.Warning("cellNetCtlNetStartDialogLoadAsync(param=*0x%x)", param);
|
||||||
|
|
||||||
// TODO: Actually sign into PSN or an emulated network similar to PSN
|
// TODO: Actually sign into PSN or an emulated network similar to PSN (ESN)
|
||||||
|
// TODO: Properly open the dialog prompt for sign in
|
||||||
|
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_LOADED, 0);
|
||||||
|
g_sign_in_dialog->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
|
||||||
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
|
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_NET_CTL_ERROR_NOT_CONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellNetCtlNetStartDialogAbortAsync()
|
s32 cellNetCtlNetStartDialogAbortAsync()
|
||||||
{
|
{
|
||||||
cellNetCtl.Todo("cellNetCtlNetStartDialogAbortAsync()");
|
cellNetCtl.Todo("cellNetCtlNetStartDialogAbortAsync()");
|
||||||
|
|
||||||
|
g_sign_in_dialog->status = CELL_NET_CTL_ERROR_DIALOG_ABORTED;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,6 +371,7 @@ s32 cellNetCtlNetStartDialogUnloadAsync(vm::ptr<CellNetCtlNetStartDialogResult>
|
||||||
{
|
{
|
||||||
cellNetCtl.Warning("cellNetCtlNetStartDialogUnloadAsync(result=*0x%x)", result);
|
cellNetCtl.Warning("cellNetCtlNetStartDialogUnloadAsync(result=*0x%x)", result);
|
||||||
|
|
||||||
|
result->result = g_sign_in_dialog->status;
|
||||||
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_UNLOADED, 0);
|
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_UNLOADED, 0);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
|
|
@ -261,6 +261,21 @@ struct CellNetCtlNatInfo
|
||||||
|
|
||||||
typedef void(cellNetCtlHandler)(s32 prev_state, s32 new_state, s32 event, s32 error_code, vm::ptr<u32> arg);
|
typedef void(cellNetCtlHandler)(s32 prev_state, s32 new_state, s32 event, s32 error_code, vm::ptr<u32> arg);
|
||||||
|
|
||||||
|
struct SignInDialogInstance
|
||||||
|
{
|
||||||
|
//std::atomic<SignInDialogState> state;
|
||||||
|
|
||||||
|
s32 status;
|
||||||
|
|
||||||
|
SignInDialogInstance();
|
||||||
|
virtual ~SignInDialogInstance() = default;
|
||||||
|
|
||||||
|
virtual void Close();
|
||||||
|
|
||||||
|
virtual void Create() = 0;
|
||||||
|
virtual void Destroy() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
inline static const char* InfoCodeToName(s32 code)
|
inline static const char* InfoCodeToName(s32 code)
|
||||||
{
|
{
|
||||||
switch (code)
|
switch (code)
|
||||||
|
|
|
@ -72,12 +72,33 @@ s32 cellPadClearBuf(u32 port_no)
|
||||||
|
|
||||||
s32 cellPadPeriphGetInfo(vm::ptr<CellPadPeriphInfo> info)
|
s32 cellPadPeriphGetInfo(vm::ptr<CellPadPeriphInfo> info)
|
||||||
{
|
{
|
||||||
sys_io.Warning("cellPadPeriphGetInfo(info=*0x%x)", info);
|
sys_io.Todo("cellPadPeriphGetInfo(info=*0x%x)", info);
|
||||||
|
|
||||||
|
if (!Emu.GetPadManager().IsInited())
|
||||||
|
{
|
||||||
|
return CELL_PAD_ERROR_UNINITIALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PadInfo& rinfo = Emu.GetPadManager().GetInfo();
|
||||||
|
|
||||||
|
info->max_connect = rinfo.max_connect;
|
||||||
|
info->now_connect = rinfo.now_connect;
|
||||||
|
info->system_info = rinfo.system_info;
|
||||||
|
|
||||||
|
std::vector<Pad>& pads = Emu.GetPadManager().GetPads();
|
||||||
|
|
||||||
// TODO: Support other types of controllers
|
// TODO: Support other types of controllers
|
||||||
for (u32 i = 0; i < info->now_connect; i++)
|
for (u32 i = 0; i < CELL_PAD_MAX_PORT_NUM; ++i)
|
||||||
{
|
{
|
||||||
|
if (i >= pads.size())
|
||||||
|
break;
|
||||||
|
|
||||||
|
info->port_status[i] = pads[i].m_port_status;
|
||||||
|
info->port_setting[i] = pads[i].m_port_setting;
|
||||||
|
info->device_capability[i] = pads[i].m_device_capability;
|
||||||
|
info->device_type[i] = pads[i].m_device_type;
|
||||||
info->pclass_type[i] = CELL_PAD_PCLASS_TYPE_STANDARD;
|
info->pclass_type[i] = CELL_PAD_PCLASS_TYPE_STANDARD;
|
||||||
|
info->pclass_profile[i] = 0x0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
|
|
@ -725,11 +725,14 @@ s32 cellSailPlayerSetRendererVideo()
|
||||||
|
|
||||||
s32 cellSailPlayerSetParameter(vm::ptr<CellSailPlayer> pSelf, s32 parameterType, u64 param0, u64 param1)
|
s32 cellSailPlayerSetParameter(vm::ptr<CellSailPlayer> pSelf, s32 parameterType, u64 param0, u64 param1)
|
||||||
{
|
{
|
||||||
cellSail.Todo("cellSailPlayerSetParameter(pSelf=*0x%x, parameterType=0x%x, param0=0x%llx, param1=0x%llx)", pSelf, parameterType, param0, param1);
|
cellSail.Warning("cellSailPlayerSetParameter(pSelf=*0x%x, parameterType=0x%x, param0=0x%llx, param1=0x%llx)", pSelf, parameterType, param0, param1);
|
||||||
|
|
||||||
switch (parameterType)
|
switch (parameterType)
|
||||||
{
|
{
|
||||||
default: cellSail.Error("cellSailPlayerSetParameter(): unimplemented parameter %s", ParameterCodeToName(parameterType));
|
case CELL_SAIL_PARAMETER_GRAPHICS_ADAPTER_BUFFER_RELEASE_DELAY: pSelf->graphics_adapter_buffer_release_delay = param1; break; // TODO: Stream index
|
||||||
|
case CELL_SAIL_PARAMETER_CONTROL_PPU_THREAD_STACK_SIZE: pSelf->control_ppu_thread_stack_size = param0; break;
|
||||||
|
case CELL_SAIL_PARAMETER_ENABLE_APOST_SRC: pSelf->enable_apost_src = param1; break; // TODO: Stream index
|
||||||
|
default: cellSail.Todo("cellSailPlayerSetParameter(): unimplemented parameter %s", ParameterCodeToName(parameterType));
|
||||||
}
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "cellVpost.h"
|
||||||
|
|
||||||
namespace vm { using namespace ps3; }
|
namespace vm { using namespace ps3; }
|
||||||
|
|
||||||
// Error Codes
|
// Error Codes
|
||||||
|
@ -666,8 +668,7 @@ union CellSailEvent
|
||||||
{
|
{
|
||||||
be_t<u32> major;
|
be_t<u32> major;
|
||||||
be_t<u32> minor;
|
be_t<u32> minor;
|
||||||
}
|
} u32x2;
|
||||||
u32x2;
|
|
||||||
|
|
||||||
be_t<u64> value;
|
be_t<u64> value;
|
||||||
};
|
};
|
||||||
|
@ -1193,6 +1194,36 @@ struct CellSailPlayer
|
||||||
bool booted;
|
bool booted;
|
||||||
vm::ptr<CellSailSoundAdapter> sAdapter;
|
vm::ptr<CellSailSoundAdapter> sAdapter;
|
||||||
vm::ptr<CellSailGraphicsAdapter> gAdapter;
|
vm::ptr<CellSailGraphicsAdapter> gAdapter;
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
be_t<s32> control_ppu_thread_priority;
|
||||||
|
be_t<s32> control_ppu_thread_stack_size;
|
||||||
|
be_t<s32> spurs_num_of_spus;
|
||||||
|
be_t<s32> spurs_spu_thread_priority;
|
||||||
|
be_t<s32> spurs_ppu_thread_priority;
|
||||||
|
b8 spurs_exit_if_no_work;
|
||||||
|
be_t<s32> io_ppu_thread_priority;
|
||||||
|
be_t<s32> io_ppu_thread_stack_size;
|
||||||
|
be_t<s32> dmux_ppu_thread_priority;
|
||||||
|
be_t<s32> dmux_num_of_spus;
|
||||||
|
be_t<u64> dmux_spurs_task_priorities;
|
||||||
|
be_t<s32> adec_ppu_thread_priority;
|
||||||
|
be_t<s32> adec_num_of_spus;
|
||||||
|
be_t<u64> adec_spurs_task_priorities;
|
||||||
|
b8 enable_apost_src;
|
||||||
|
be_t<s32> vdec_ppu_thread_priority;
|
||||||
|
be_t<s32> vdec_m2v_num_of_spus;
|
||||||
|
be_t<s32> vdec_avc_num_of_spus;
|
||||||
|
be_t<u64> vdec_spurs_task_priorities;
|
||||||
|
vm::ptr<CellVpostCtrlParam> enable_vpost;
|
||||||
|
be_t<s32> vpost_ppu_thread_priority;
|
||||||
|
be_t<s32> vpost_num_of_spus;
|
||||||
|
be_t<u64> vpost_spurs_task_priorities;
|
||||||
|
be_t<s32> graphics_adapter_buffer_release_delay;
|
||||||
|
be_t<s32> video_performance_policy;
|
||||||
|
b8 av_sync_es_audio;
|
||||||
|
b8 av_sync_es_video;
|
||||||
|
CellSailFsRead fs;
|
||||||
};
|
};
|
||||||
|
|
||||||
CHECK_MAX_SIZE(CellSailPlayer, 0x100);
|
CHECK_MAX_SIZE(CellSailPlayer, 0x100);
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "Emu/Memory/Memory.h"
|
#include "Emu/Memory/Memory.h"
|
||||||
#include "Emu/SysCalls/Modules.h"
|
#include "Emu/SysCalls/Modules.h"
|
||||||
|
#include "rpcs3/Ini.h"
|
||||||
|
|
||||||
|
#include "sceNp.h"
|
||||||
|
#include "sceNp2.h"
|
||||||
|
#include "cellSysutilAvc2.h"
|
||||||
|
|
||||||
extern Module cellSysutilAvc2;
|
extern Module cellSysutilAvc2;
|
||||||
|
|
||||||
|
@ -124,9 +129,21 @@ s32 cellSysutilAvc2GetSpeakerVolumeLevel()
|
||||||
throw EXCEPTION("");
|
throw EXCEPTION("");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellSysutilAvc2IsCameraAttached()
|
s32 cellSysutilAvc2IsCameraAttached(vm::ptr<u8> status)
|
||||||
{
|
{
|
||||||
throw EXCEPTION("");
|
cellSysutilAvc2.Todo("cellSysutilAvc2IsCameraAttached()");
|
||||||
|
|
||||||
|
if (Ini.Camera.GetValue() == 0)
|
||||||
|
{
|
||||||
|
*status = CELL_AVC2_CAMERA_STATUS_DETACHED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: We need to check if the camera has been turned on, but this requires further implementation of cellGem/cellCamera.
|
||||||
|
*status = CELL_AVC2_CAMERA_STATUS_ATTACHED_OFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellSysutilAvc2MicRead()
|
s32 cellSysutilAvc2MicRead()
|
||||||
|
@ -159,9 +176,51 @@ s32 cellSysutilAvc2GetWindowShowStatus()
|
||||||
throw EXCEPTION("");
|
throw EXCEPTION("");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellSysutilAvc2InitParam()
|
s32 cellSysutilAvc2InitParam(u16 version, vm::ptr<CellSysutilAvc2InitParam> option)
|
||||||
{
|
{
|
||||||
throw EXCEPTION("");
|
cellSysutilAvc2.Warning("cellSysutilAvc2InitParam(version=%d, option=*0x%x)", version, option);
|
||||||
|
|
||||||
|
if (version >= 110)
|
||||||
|
{
|
||||||
|
// Notify the user that, a version different from the one, that we know the constants for, is used.
|
||||||
|
// Other versions shouldn't differ by too much, if at all - they most likely differ in other functions.
|
||||||
|
if (version != 140)
|
||||||
|
{
|
||||||
|
cellSysutilAvc2.Todo("cellSysutilAvc2InitParam(): Older/newer version %d used, might cause problems.", version);
|
||||||
|
}
|
||||||
|
|
||||||
|
option->avc_init_param_version = version;
|
||||||
|
|
||||||
|
if (option->media_type == CELL_SYSUTIL_AVC2_VOICE_CHAT)
|
||||||
|
{
|
||||||
|
option->max_players = 16;
|
||||||
|
}
|
||||||
|
else if (option->media_type == CELL_SYSUTIL_AVC2_VIDEO_CHAT)
|
||||||
|
{
|
||||||
|
if (option->video_param.frame_mode == CELL_SYSUTIL_AVC2_FRAME_MODE_NORMAL)
|
||||||
|
{
|
||||||
|
option->max_players = 6;
|
||||||
|
}
|
||||||
|
else if (option->video_param.frame_mode == CELL_SYSUTIL_AVC2_FRAME_MODE_INTRA_ONLY)
|
||||||
|
{
|
||||||
|
option->max_players = 16;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cellSysutilAvc2.Error("Unknown frame mode 0x%x", option->video_param.frame_mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cellSysutilAvc2.Error("Unknown media type 0x%x", option->media_type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cellSysutilAvc2.Error("cellSysutilAvc2InitParam(): Unknown version %d used, please report this to a developer.", version);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 cellSysutilAvc2GetWindowSize()
|
s32 cellSysutilAvc2GetWindowSize()
|
||||||
|
|
206
rpcs3/Emu/SysCalls/Modules/cellSysutilAvc2.h
Normal file
206
rpcs3/Emu/SysCalls/Modules/cellSysutilAvc2.h
Normal file
|
@ -0,0 +1,206 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace vm { using namespace ps3; }
|
||||||
|
|
||||||
|
// Error codes
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_AVC2_ERROR_UNKNOWN = 0x8002b701,
|
||||||
|
CELL_AVC2_ERROR_NOT_SUPPORTED = 0x8002b702,
|
||||||
|
CELL_AVC2_ERROR_NOT_INITIALIZED = 0x8002b703,
|
||||||
|
CELL_AVC2_ERROR_ALREADY_INITIALIZED = 0x8002b704,
|
||||||
|
CELL_AVC2_ERROR_INVALID_ARGUMENT = 0x8002b705,
|
||||||
|
CELL_AVC2_ERROR_OUT_OF_MEMORY = 0x8002b706,
|
||||||
|
CELL_AVC2_ERROR_ERROR_BAD_ID = 0x8002b707,
|
||||||
|
CELL_AVC2_ERROR_INVALID_STATUS = 0x8002b70a,
|
||||||
|
CELL_AVC2_ERROR_TIMEOUT = 0x8002b70b,
|
||||||
|
CELL_AVC2_ERROR_NO_SESSION = 0x8002b70d,
|
||||||
|
CELL_AVC2_ERROR_WINDOW_ALREADY_EXISTS = 0x8002b70f,
|
||||||
|
CELL_AVC2_ERROR_TOO_MANY_WINDOWS = 0x8002b710,
|
||||||
|
CELL_AVC2_ERROR_TOO_MANY_PEER_WINDOWS = 0x8002b711,
|
||||||
|
CELL_AVC2_ERROR_WINDOW_NOT_FOUND = 0x8002b712,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_VOICE_CHAT = 0x00000001,
|
||||||
|
CELL_SYSUTIL_AVC2_VIDEO_CHAT = 0x00000010,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_VOICE_QUALITY_NORMAL = 0x00000001,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_VIDEO_QUALITY_NORMAL = 0x00000001,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_FRAME_MODE_NORMAL = 0x00000001,
|
||||||
|
CELL_SYSUTIL_AVC2_FRAME_MODE_INTRA_ONLY = 0x00000002,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_VIRTUAL_COORDINATES = 0x00000001,
|
||||||
|
CELL_SYSUTIL_AVC2_ABSOLUTE_COORDINATES = 0x00000002,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_VIDEO_RESOLUTION_QQVGA = 0x00000001,
|
||||||
|
CELL_SYSUTIL_AVC2_VIDEO_RESOLUTION_QVGA = 0x00000002,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_CHAT_TARGET_MODE_ROOM = 0x00000100,
|
||||||
|
CELL_SYSUTIL_AVC2_CHAT_TARGET_MODE_TEAM = 0x00000200,
|
||||||
|
CELL_SYSUTIL_AVC2_CHAT_TARGET_MODE_PRIVATE = 0x00000300,
|
||||||
|
CELL_SYSUTIL_AVC2_CHAT_TARGET_MODE_DIRECT = 0x00001000,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_VOICE_DETECT_EVENT_TYPE = 0x00001001,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_VOICE_DETECT_INTERVAL_TIME = 0x00001002,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_VOICE_DETECT_SIGNAL_LEVEL = 0x00001003,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_VOICE_MAX_BITRATE = 0x00001004,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_VOICE_DATA_FEC = 0x00001005,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_VOICE_PACKET_CONTENTION = 0x00001006,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_VOICE_DTX_MODE = 0x00001007,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_MIC_STATUS_DETECTION = 0x00001008,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_MIC_SETTING_NOTIFICATION = 0x00001009,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_VOICE_MUTING_NOTIFICATION = 0x0000100A,
|
||||||
|
CELL_SYSUTIL_AVC2_ATTRIBUTE_CAMERA_STATUS_DETECTION = 0x0000100B,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_WINDOW_ATTRIBUTE_ALPHA = 0x00002001,
|
||||||
|
CELL_SYSUTIL_AVC2_WINDOW_ATTRIBUTE_TRANSITION_TYPE = 0x00002002,
|
||||||
|
CELL_SYSUTIL_AVC2_WINDOW_ATTRIBUTE_TRANSITION_DURATION = 0x00002003,
|
||||||
|
CELL_SYSUTIL_AVC2_WINDOW_ATTRIBUTE_STRING_VISIBLE = 0x00002004,
|
||||||
|
CELL_SYSUTIL_AVC2_WINDOW_ATTRIBUTE_ROTATION = 0x00002005,
|
||||||
|
CELL_SYSUTIL_AVC2_WINDOW_ATTRIBUTE_ZORDER = 0x00002006,
|
||||||
|
CELL_SYSUTIL_AVC2_WINDOW_ATTRIBUTE_SURFACE = 0x00002007,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_TRANSITION_NONE = 0xffffffff,
|
||||||
|
CELL_SYSUTIL_AVC2_TRANSITION_LINEAR = 0x00000000,
|
||||||
|
CELL_SYSUTIL_AVC2_TRANSITION_SLOWDOWN = 0x00000001,
|
||||||
|
CELL_SYSUTIL_AVC2_TRANSITION_FASTUP = 0x00000002,
|
||||||
|
CELL_SYSUTIL_AVC2_TRANSITION_ANGULAR = 0x00000003,
|
||||||
|
CELL_SYSUTIL_AVC2_TRANSITION_EXPONENT = 0x00000004,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_AVC2_ZORDER_FORWARD_MOST = 0x00000001,
|
||||||
|
CELL_SYSUTIL_AVC2_ZORDER_BEHIND_MOST = 0x00000002,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_AVC2_CAMERA_STATUS_DETACHED = 0,
|
||||||
|
CELL_AVC2_CAMERA_STATUS_ATTACHED_OFF = 1,
|
||||||
|
CELL_AVC2_CAMERA_STATUS_ATTACHED_ON = 2,
|
||||||
|
CELL_AVC2_CAMERA_STATUS_UNKNOWN = 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef u32 CellSysutilAvc2AttributeId;
|
||||||
|
typedef u32 CellSysutilAvc2WindowAttributeId;
|
||||||
|
|
||||||
|
typedef u32 CellSysutilAvc2EventId;
|
||||||
|
typedef u64 CellSysutilAvc2EventParam;
|
||||||
|
|
||||||
|
using CellSysutilAvc2Callback = void(CellSysutilAvc2EventId event_id, CellSysutilAvc2EventParam event_param, vm::ptr<void> userdata);
|
||||||
|
|
||||||
|
typedef u32 CellSysutilAvc2MediaType;
|
||||||
|
typedef u32 CellSysutilAvc2VoiceQuality;
|
||||||
|
typedef u32 CellSysutilAvc2VideoQuality;
|
||||||
|
typedef u32 CellSysutilAvc2FrameMode;
|
||||||
|
typedef u32 CellSysutilAvc2VideoResolution;
|
||||||
|
typedef u32 CellSysutilAvc2CoordinatesForm;
|
||||||
|
|
||||||
|
struct CellSysutilAvc2VoiceInitParam
|
||||||
|
{
|
||||||
|
be_t<CellSysutilAvc2VoiceQuality> voice_quality;
|
||||||
|
be_t<u16> max_speakers;
|
||||||
|
u8 mic_out_stream_sharing;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellSysutilAvc2VideoInitParam
|
||||||
|
{
|
||||||
|
be_t<CellSysutilAvc2VideoQuality> video_quality;
|
||||||
|
be_t<CellSysutilAvc2FrameMode> frame_mode;
|
||||||
|
be_t<CellSysutilAvc2VideoResolution> max_video_resolution;
|
||||||
|
be_t<u16> max_video_windows;
|
||||||
|
be_t<u16> max_video_framerate;
|
||||||
|
be_t<u32> max_video_bitrate;
|
||||||
|
CellSysutilAvc2CoordinatesForm coordinates_form;
|
||||||
|
u8 video_stream_sharing;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellSysutilAvc2StreamingModeParam
|
||||||
|
{
|
||||||
|
be_t<u16> mode;
|
||||||
|
be_t<u16> port;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellSysutilAvc2InitParam
|
||||||
|
{
|
||||||
|
be_t<u16> avc_init_param_version;
|
||||||
|
be_t<u16> max_players;
|
||||||
|
be_t<u16> spu_load_average;
|
||||||
|
CellSysutilAvc2StreamingModeParam streaming_mode;
|
||||||
|
be_t<CellSysutilAvc2MediaType> media_type;
|
||||||
|
CellSysutilAvc2VoiceInitParam voice_param;
|
||||||
|
CellSysutilAvc2VideoInitParam video_param;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellSysutilAvc2RoomMemberList
|
||||||
|
{
|
||||||
|
vm::ptr<SceNpMatching2RoomMemberId> member_id;
|
||||||
|
u8 member_num;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellSysutilAvc2MemberIpAndPortList
|
||||||
|
{
|
||||||
|
vm::ptr<SceNpMatching2RoomMemberId> member_id;
|
||||||
|
vm::ptr<u32> dst_addr; // in_addr
|
||||||
|
vm::ptr<u16> dst_port;
|
||||||
|
be_t<SceNpMatching2RoomMemberId> my_member_id;
|
||||||
|
u8 member_num;
|
||||||
|
};
|
||||||
|
|
||||||
|
union CellSysutilAvc2AttributeParam
|
||||||
|
{
|
||||||
|
be_t<u64> int_param;
|
||||||
|
be_t<f32> float_param;
|
||||||
|
vm::ptr<void> ptr_param;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellSysutilAvc2Attribute
|
||||||
|
{
|
||||||
|
be_t<CellSysutilAvc2AttributeId> attr_id;
|
||||||
|
CellSysutilAvc2AttributeParam attr_param;
|
||||||
|
};
|
||||||
|
|
||||||
|
union CellSysutilAvc2WindowAttributeParam
|
||||||
|
{
|
||||||
|
be_t<s32> int_vector[4];
|
||||||
|
be_t<f32> float_vector[4];
|
||||||
|
vm::ptr<void> ptr_vector[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellSysutilAvc2WindowAttribute
|
||||||
|
{
|
||||||
|
be_t<CellSysutilAvc2WindowAttributeId> attr_id;
|
||||||
|
CellSysutilAvc2WindowAttributeParam attr_param;
|
||||||
|
};
|
|
@ -1,12 +1,36 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "Emu/System.h"
|
||||||
#include "Emu/Memory/Memory.h"
|
#include "Emu/Memory/Memory.h"
|
||||||
#include "Emu/SysCalls/Modules.h"
|
#include "Emu/SysCalls/Modules.h"
|
||||||
|
|
||||||
extern Module cellSysutilMisc;
|
extern Module cellSysutilMisc;
|
||||||
|
|
||||||
|
// License areas
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_SYSUTIL_LICENSE_AREA_J = 0,
|
||||||
|
CELL_SYSUTIL_LICENSE_AREA_A = 1,
|
||||||
|
CELL_SYSUTIL_LICENSE_AREA_E = 2,
|
||||||
|
CELL_SYSUTIL_LICENSE_AREA_H = 3,
|
||||||
|
CELL_SYSUTIL_LICENSE_AREA_K = 4,
|
||||||
|
CELL_SYSUTIL_LICENSE_AREA_C = 5,
|
||||||
|
CELL_SYSUTIL_LICENSE_AREA_OTHER = 100,
|
||||||
|
};
|
||||||
|
|
||||||
s32 cellSysutilGetLicenseArea()
|
s32 cellSysutilGetLicenseArea()
|
||||||
{
|
{
|
||||||
throw EXCEPTION("");
|
cellSysutilMisc.Warning("cellSysutilGetLicenseArea()");
|
||||||
|
|
||||||
|
switch (const char region = Emu.GetTitleID().at(2))
|
||||||
|
{
|
||||||
|
case 'J': return CELL_SYSUTIL_LICENSE_AREA_J;
|
||||||
|
case 'U': return CELL_SYSUTIL_LICENSE_AREA_A;
|
||||||
|
case 'E': return CELL_SYSUTIL_LICENSE_AREA_E;
|
||||||
|
case 'H': return CELL_SYSUTIL_LICENSE_AREA_H;
|
||||||
|
case 'K': return CELL_SYSUTIL_LICENSE_AREA_K;
|
||||||
|
case 'A': return CELL_SYSUTIL_LICENSE_AREA_C;
|
||||||
|
default: cellSysutilMisc.Todo("Unknown license area: %s", Emu.GetTitleID().c_str()); return CELL_SYSUTIL_LICENSE_AREA_OTHER;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Module cellSysutilMisc("cellSysutilMisc", []()
|
Module cellSysutilMisc("cellSysutilMisc", []()
|
||||||
|
|
|
@ -51,7 +51,7 @@ s32 cellVideoOutGetResolution(u32 resolutionId, vm::ptr<CellVideoOutResolution>
|
||||||
|
|
||||||
s32 cellVideoOutConfigure(u32 videoOut, vm::ptr<CellVideoOutConfiguration> config, vm::ptr<CellVideoOutOption> option, u32 waitForEvent)
|
s32 cellVideoOutConfigure(u32 videoOut, vm::ptr<CellVideoOutConfiguration> config, vm::ptr<CellVideoOutOption> option, u32 waitForEvent)
|
||||||
{
|
{
|
||||||
cellSysutil.Warning("cellVideoOutConfigure(videoOut=%d, config=*0x%x, option=*0x%x, waitForEvent=0x%x)", videoOut, config, option, waitForEvent);
|
cellSysutil.Warning("cellVideoOutConfigure(videoOut=%d, config=*0x%x, option=*0x%x, waitForEvent=%d)", videoOut, config, option, waitForEvent);
|
||||||
|
|
||||||
switch (videoOut)
|
switch (videoOut)
|
||||||
{
|
{
|
||||||
|
|
|
@ -220,7 +220,7 @@ s32 sceNpTrophyRegisterContext(PPUThread& CPU, u32 context, u32 handle, vm::ptr<
|
||||||
|
|
||||||
s32 sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, vm::ptr<u64> reqspace, u64 options)
|
s32 sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, vm::ptr<u64> reqspace, u64 options)
|
||||||
{
|
{
|
||||||
sceNpTrophy.Todo("sceNpTrophyGetRequiredDiskSpace(context=0x%x, handle=0x%x, reqspace*=0x%x, options=0x%llx)", context, handle, reqspace, options);
|
sceNpTrophy.Todo("sceNpTrophyGetRequiredDiskSpace(context=0x%x, handle=0x%x, reqspace=*0x%x, options=0x%llx)", context, handle, reqspace, options);
|
||||||
|
|
||||||
const auto ctxt = idm::get<trophy_context_t>(context);
|
const auto ctxt = idm::get<trophy_context_t>(context);
|
||||||
|
|
||||||
|
|
|
@ -145,9 +145,13 @@ s32 console_putc()
|
||||||
throw EXCEPTION("");
|
throw EXCEPTION("");
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 console_write()
|
s32 console_write(vm::ptr<char> data, u32 len)
|
||||||
{
|
{
|
||||||
throw EXCEPTION("");
|
sysPrxForUser.Warning("console_write(data=*0x%x, len=%d)", data, len);
|
||||||
|
|
||||||
|
LOG_NOTICE(TTY, { data.get_ptr(), len });
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,8 @@ class WxDirDeleteTraverser : public wxDirTraverser
|
||||||
public:
|
public:
|
||||||
virtual wxDirTraverseResult OnFile(const wxString& filename) override
|
virtual wxDirTraverseResult OnFile(const wxString& filename) override
|
||||||
{
|
{
|
||||||
if (!wxRemoveFile(filename)){
|
if (!wxRemoveFile(filename))
|
||||||
|
{
|
||||||
LOG_ERROR(HLE, "Couldn't delete File: %s", fmt::ToUTF8(filename).c_str());
|
LOG_ERROR(HLE, "Couldn't delete File: %s", fmt::ToUTF8(filename).c_str());
|
||||||
}
|
}
|
||||||
return wxDIR_CONTINUE;
|
return wxDIR_CONTINUE;
|
||||||
|
@ -51,7 +52,8 @@ public:
|
||||||
{
|
{
|
||||||
wxDir dir(dirname);
|
wxDir dir(dirname);
|
||||||
dir.Traverse(*this);
|
dir.Traverse(*this);
|
||||||
if (!wxRmDir(dirname)){
|
if (!wxRmDir(dirname))
|
||||||
|
{
|
||||||
//this get triggered a few times while clearing folders
|
//this get triggered a few times while clearing folders
|
||||||
//but if this gets reimplented we should probably warn
|
//but if this gets reimplented we should probably warn
|
||||||
//if directories can't be removed
|
//if directories can't be removed
|
||||||
|
@ -120,7 +122,7 @@ void GameViewer::LoadGames()
|
||||||
void GameViewer::LoadPSF()
|
void GameViewer::LoadPSF()
|
||||||
{
|
{
|
||||||
m_game_data.clear();
|
m_game_data.clear();
|
||||||
for(uint i=0; i<m_games.size(); ++i)
|
for (u32 i = 0; i < m_games.size(); ++i)
|
||||||
{
|
{
|
||||||
const std::string sfb = m_path + m_games[i] + "/PS3_DISC.SFB";
|
const std::string sfb = m_path + m_games[i] + "/PS3_DISC.SFB";
|
||||||
const std::string sfo = m_path + m_games[i] + (Emu.GetVFS().ExistsFile(sfb) ? "/PS3_GAME/PARAM.SFO" : "/PARAM.SFO");
|
const std::string sfo = m_path + m_games[i] + (Emu.GetVFS().ExistsFile(sfb) ? "/PS3_GAME/PARAM.SFO" : "/PARAM.SFO");
|
||||||
|
@ -174,6 +176,21 @@ void GameViewer::LoadPSF()
|
||||||
game.category = "Disc Game";
|
game.category = "Disc Game";
|
||||||
game.icon_path = local_path + "/" + m_games[i] + "/PS3_GAME/ICON0.PNG";
|
game.icon_path = local_path + "/" + m_games[i] + "/PS3_GAME/ICON0.PNG";
|
||||||
}
|
}
|
||||||
|
else if (game.category.substr(0, 2) == "HM")
|
||||||
|
{
|
||||||
|
game.category = "Home";
|
||||||
|
game.icon_path = local_path + "/" + m_games[i] + "/ICON0.PNG";
|
||||||
|
}
|
||||||
|
else if (game.category.substr(0, 2) == "AV")
|
||||||
|
{
|
||||||
|
game.category = "Audio/Video";
|
||||||
|
game.icon_path = local_path + "/" + m_games[i] + "/ICON0.PNG";
|
||||||
|
}
|
||||||
|
else if (game.category.substr(0, 2) == "GD")
|
||||||
|
{
|
||||||
|
game.category = "Game Data";
|
||||||
|
game.icon_path = local_path + "/" + m_games[i] + "/PS3_GAME/ICON0.PNG";
|
||||||
|
}
|
||||||
|
|
||||||
m_game_data.push_back(game);
|
m_game_data.push_back(game);
|
||||||
}
|
}
|
||||||
|
@ -220,12 +237,14 @@ void GameViewer::DClick(wxListEvent& event)
|
||||||
|
|
||||||
Emu.GetVFS().Init("/");
|
Emu.GetVFS().Init("/");
|
||||||
std::string local_path;
|
std::string local_path;
|
||||||
if (Emu.GetVFS().GetDevice(path, local_path) && !Emu.BootGame(local_path)) {
|
if (Emu.GetVFS().GetDevice(path, local_path) && !Emu.BootGame(local_path))
|
||||||
|
{
|
||||||
LOG_ERROR(HLE, "Boot error: elf not found! [%s]", path.c_str());
|
LOG_ERROR(HLE, "Boot error: elf not found! [%s]", path.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ini.HLEAlwaysStart.GetValue() && Emu.IsReady()) {
|
if (Ini.HLEAlwaysStart.GetValue() && Emu.IsReady())
|
||||||
|
{
|
||||||
Emu.Run();
|
Emu.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,7 @@ SettingsDialog::SettingsDialog(wxWindow *parent)
|
||||||
wxCheckBox* chbox_dbg_ap_functioncall = new wxCheckBox(p_misc, wxID_ANY, "Auto Pause at Function Call");
|
wxCheckBox* chbox_dbg_ap_functioncall = new wxCheckBox(p_misc, wxID_ANY, "Auto Pause at Function Call");
|
||||||
|
|
||||||
//Custom EmulationDir
|
//Custom EmulationDir
|
||||||
wxCheckBox* chbox_emulationdir_enable = new wxCheckBox(p_system, wxID_ANY, "Use Path Below as EmulationDir ? (Need Restart)");
|
wxCheckBox* chbox_emulationdir_enable = new wxCheckBox(p_system, wxID_ANY, "Use path below as EmulationDir. (Restart required)");
|
||||||
wxTextCtrl* txt_emulationdir_path = new wxTextCtrl(p_system, wxID_ANY, Emu.GetEmulatorPath());
|
wxTextCtrl* txt_emulationdir_path = new wxTextCtrl(p_system, wxID_ANY, Emu.GetEmulatorPath());
|
||||||
|
|
||||||
|
|
||||||
|
@ -308,6 +308,7 @@ SettingsDialog::SettingsDialog(wxWindow *parent)
|
||||||
|
|
||||||
s_round_audio_out->Add(cbox_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_audio_out->Add(cbox_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
|
||||||
|
// Miscellaneous
|
||||||
s_round_hle_log_lvl->Add(cbox_hle_loglvl, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_hle_log_lvl->Add(cbox_hle_loglvl, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
|
||||||
// Networking
|
// Networking
|
||||||
|
|
79
rpcs3/Gui/SignInDialog.cpp
Normal file
79
rpcs3/Gui/SignInDialog.cpp
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
#include "stdafx_gui.h"
|
||||||
|
#include "Emu/SysCalls/Modules.h"
|
||||||
|
#include "Emu/Memory/Memory.h"
|
||||||
|
|
||||||
|
#include "Emu/SysCalls/Modules/cellSysutil.h"
|
||||||
|
#include "SignInDialog.h"
|
||||||
|
|
||||||
|
// TODO: Make this look and work more reasonably
|
||||||
|
void SignInDialogFrame::Create()
|
||||||
|
{
|
||||||
|
wxWindow* parent = nullptr; // TODO: align the window better
|
||||||
|
|
||||||
|
m_dialog = std::make_unique<wxDialog>(parent, wxID_ANY, "Sign in", wxDefaultPosition, wxDefaultSize);
|
||||||
|
static const u32 width = 300;
|
||||||
|
static const u32 height = 98;
|
||||||
|
|
||||||
|
wxNotebook* nb_config = new wxNotebook(m_dialog.get(), wxID_ANY, wxPoint(2, 2), wxSize(width, height));
|
||||||
|
wxPanel* p_esn = new wxPanel(nb_config, wxID_ANY);
|
||||||
|
wxPanel* p_psn = new wxPanel(nb_config, wxID_ANY);
|
||||||
|
|
||||||
|
wxButton* b_signin = new wxButton(p_esn, wxID_OK, "Fake sign in");
|
||||||
|
wxButton* b_cancel = new wxButton(p_esn, wxID_CANCEL, "Cancel");
|
||||||
|
|
||||||
|
nb_config->AddPage(p_esn, wxT("ESN"));
|
||||||
|
nb_config->AddPage(p_psn, wxT("PSN"));
|
||||||
|
|
||||||
|
wxBoxSizer* s_subpanel_esn = new wxBoxSizer(wxVERTICAL);
|
||||||
|
wxBoxSizer* s_subpanel_psn = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
|
wxStaticText* esn_unimplemented = new wxStaticText(p_esn, wxID_ANY, "ESN support is not ready yet.");
|
||||||
|
wxStaticText* psn_unimplemented = new wxStaticText(p_psn, wxID_ANY, "PSN support is not yet implemented.");
|
||||||
|
|
||||||
|
// ESN
|
||||||
|
s_subpanel_esn->Add(esn_unimplemented, wxSizerFlags().Centre());
|
||||||
|
s_subpanel_esn->Add(b_signin, wxSizerFlags().Left().Border(5).Expand());
|
||||||
|
s_subpanel_esn->Add(b_cancel, wxSizerFlags().Right().Border(5).Expand());
|
||||||
|
|
||||||
|
// PSN
|
||||||
|
s_subpanel_psn->Add(psn_unimplemented, wxSizerFlags().Centre());
|
||||||
|
|
||||||
|
m_dialog->SetSizerAndFit(s_subpanel_esn, false);
|
||||||
|
m_dialog->SetSizerAndFit(s_subpanel_psn, false);
|
||||||
|
|
||||||
|
m_dialog->SetSize(width + 18, height + 42);
|
||||||
|
|
||||||
|
m_dialog->Centre(wxBOTH);
|
||||||
|
m_dialog->Show();
|
||||||
|
m_dialog->Enable();
|
||||||
|
//m_dialog->ShowModal();
|
||||||
|
|
||||||
|
b_signin->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
this->status = CELL_OK;
|
||||||
|
this->m_dialog->Hide();
|
||||||
|
this->Close();
|
||||||
|
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
b_cancel->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
|
||||||
|
this->m_dialog->Hide();
|
||||||
|
this->Close();
|
||||||
|
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
m_dialog->Bind(wxEVT_CLOSE_WINDOW, [&](wxCloseEvent& event)
|
||||||
|
{
|
||||||
|
this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
|
||||||
|
this->m_dialog->Hide();
|
||||||
|
this->Close();
|
||||||
|
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void SignInDialogFrame::Destroy()
|
||||||
|
{
|
||||||
|
m_dialog.reset();
|
||||||
|
}
|
12
rpcs3/Gui/SignInDialog.h
Normal file
12
rpcs3/Gui/SignInDialog.h
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Emu/SysCalls/Modules/cellNetCtl.h"
|
||||||
|
|
||||||
|
class SignInDialogFrame : public SignInDialogInstance
|
||||||
|
{
|
||||||
|
std::unique_ptr<wxDialog> m_dialog;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void Create() override;
|
||||||
|
virtual void Destroy() override;
|
||||||
|
};
|
|
@ -613,6 +613,7 @@
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellL10n.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellL10n.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellMic.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellMic.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellMsgDialog.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellMsgDialog.h" />
|
||||||
|
<ClInclude Include="Emu\SysCalls\Modules\cellMusic.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellNetCtl.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellNetCtl.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellPad.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellPad.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellPamf.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellPamf.h" />
|
||||||
|
@ -631,6 +632,7 @@
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellSync2.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellSync2.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellSysutil.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellSysutil.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellSaveData.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellSaveData.h" />
|
||||||
|
<ClInclude Include="Emu\SysCalls\Modules\cellSysutilAvc2.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellUsbd.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellUsbd.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellUserInfo.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellUserInfo.h" />
|
||||||
<ClInclude Include="Emu\SysCalls\Modules\cellVdec.h" />
|
<ClInclude Include="Emu\SysCalls\Modules\cellVdec.h" />
|
||||||
|
|
|
@ -1876,5 +1876,11 @@
|
||||||
<ClInclude Include="Emu\Cell\SPUAnalyser.h">
|
<ClInclude Include="Emu\Cell\SPUAnalyser.h">
|
||||||
<Filter>Emu\CPU\Cell</Filter>
|
<Filter>Emu\CPU\Cell</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Emu\SysCalls\Modules\cellMusic.h">
|
||||||
|
<Filter>Emu\SysCalls\Modules</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Emu\SysCalls\Modules\cellSysutilAvc2.h">
|
||||||
|
<Filter>Emu\SysCalls\Modules</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -529,6 +529,7 @@
|
||||||
<ClCompile Include="Gui\SaveDataDialog.cpp" />
|
<ClCompile Include="Gui\SaveDataDialog.cpp" />
|
||||||
<ClCompile Include="Gui\SaveDataUtility.cpp" />
|
<ClCompile Include="Gui\SaveDataUtility.cpp" />
|
||||||
<ClCompile Include="Gui\SettingsDialog.cpp" />
|
<ClCompile Include="Gui\SettingsDialog.cpp" />
|
||||||
|
<ClCompile Include="Gui\SignInDialog.cpp" />
|
||||||
<ClCompile Include="Gui\TextInputDialog.cpp" />
|
<ClCompile Include="Gui\TextInputDialog.cpp" />
|
||||||
<ClCompile Include="Gui\VFSManager.cpp" />
|
<ClCompile Include="Gui\VFSManager.cpp" />
|
||||||
<ClCompile Include="Gui\VHDDManager.cpp" />
|
<ClCompile Include="Gui\VHDDManager.cpp" />
|
||||||
|
@ -579,6 +580,7 @@
|
||||||
<ClInclude Include="Gui\SaveDataDialog.h" />
|
<ClInclude Include="Gui\SaveDataDialog.h" />
|
||||||
<ClInclude Include="Gui\SaveDataUtility.h" />
|
<ClInclude Include="Gui\SaveDataUtility.h" />
|
||||||
<ClInclude Include="Gui\SettingsDialog.h" />
|
<ClInclude Include="Gui\SettingsDialog.h" />
|
||||||
|
<ClInclude Include="Gui\SignInDialog.h" />
|
||||||
<ClInclude Include="Gui\TextInputDialog.h" />
|
<ClInclude Include="Gui\TextInputDialog.h" />
|
||||||
<ClInclude Include="Gui\VFSManager.h" />
|
<ClInclude Include="Gui\VFSManager.h" />
|
||||||
<ClInclude Include="Gui\VHDDManager.h" />
|
<ClInclude Include="Gui\VHDDManager.h" />
|
||||||
|
|
|
@ -108,6 +108,9 @@
|
||||||
<ClCompile Include="Gui\SettingsDialog.cpp">
|
<ClCompile Include="Gui\SettingsDialog.cpp">
|
||||||
<Filter>Gui</Filter>
|
<Filter>Gui</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="Gui\SignInDialog.cpp">
|
||||||
|
<Filter>Gui</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="rpcs3.rc" />
|
<ResourceCompile Include="rpcs3.rc" />
|
||||||
|
@ -219,6 +222,9 @@
|
||||||
<ClInclude Include="Gui\SettingsDialog.h">
|
<ClInclude Include="Gui\SettingsDialog.h">
|
||||||
<Filter>Gui</Filter>
|
<Filter>Gui</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Gui\SignInDialog.h">
|
||||||
|
<Filter>Gui</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Image Include="rpcs3.ico" />
|
<Image Include="rpcs3.ico" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue