forked from suyu/suyu
GPU: Fixed bug in command list size decoding.
This commit is contained in:
parent
a1f9cde806
commit
170123982d
4 changed files with 5 additions and 5 deletions
|
@ -219,7 +219,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
|
|||
{
|
||||
auto& params = command.set_command_list_last;
|
||||
WriteGPURegister(GPU_REG_INDEX(command_processor_config.address), Memory::VirtualToPhysicalAddress(params.address) >> 3);
|
||||
WriteGPURegister(GPU_REG_INDEX(command_processor_config.size), params.size >> 3);
|
||||
WriteGPURegister(GPU_REG_INDEX(command_processor_config.size), params.size);
|
||||
|
||||
// TODO: Not sure if we are supposed to always write this .. seems to trigger processing though
|
||||
WriteGPURegister(GPU_REG_INDEX(command_processor_config.trigger), 1);
|
||||
|
|
|
@ -154,8 +154,7 @@ inline void Write(u32 addr, const T data) {
|
|||
if (config.trigger & 1)
|
||||
{
|
||||
u32* buffer = (u32*)Memory::GetPointer(Memory::PhysicalToVirtualAddress(config.GetPhysicalAddress()));
|
||||
u32 size = config.size << 3;
|
||||
Pica::CommandProcessor::ProcessCommandList(buffer, size);
|
||||
Pica::CommandProcessor::ProcessCommandList(buffer, config.size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ struct Regs {
|
|||
INSERT_PADDING_WORDS(0x331);
|
||||
|
||||
struct {
|
||||
// command list size
|
||||
// command list size (in bytes)
|
||||
u32 size;
|
||||
|
||||
INSERT_PADDING_WORDS(0x1);
|
||||
|
|
|
@ -272,8 +272,9 @@ static std::ptrdiff_t ExecuteCommandBlock(const u32* first_command_word) {
|
|||
|
||||
void ProcessCommandList(const u32* list, u32 size) {
|
||||
u32* read_pointer = (u32*)list;
|
||||
u32 list_length = size / sizeof(u32);
|
||||
|
||||
while (read_pointer < list + size) {
|
||||
while (read_pointer < list + list_length) {
|
||||
read_pointer += ExecuteCommandBlock(read_pointer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue