summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp7
-rw-r--r--src/core/hle/service/gsp_gpu.cpp48
-rw-r--r--src/core/hle/svc.cpp2
3 files changed, 50 insertions, 7 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index e4b5486e0..b5d1b43cd 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -3564,17 +3564,13 @@ static int InterpreterTranslate(ARMul_State* cpu, int& bb_start, u32 addr) {
3564 unsigned int inst, inst_size = 4; 3564 unsigned int inst, inst_size = 4;
3565 int idx; 3565 int idx;
3566 int ret = NON_BRANCH; 3566 int ret = NON_BRANCH;
3567 int thumb = 0;
3568 int size = 0; // instruction size of basic block 3567 int size = 0; // instruction size of basic block
3569 bb_start = top; 3568 bb_start = top;
3570 3569
3571 if (cpu->TFlag)
3572 thumb = THUMB;
3573
3574 u32 phys_addr = addr; 3570 u32 phys_addr = addr;
3575 u32 pc_start = cpu->Reg[15]; 3571 u32 pc_start = cpu->Reg[15];
3576 3572
3577 while(ret == NON_BRANCH) { 3573 while (ret == NON_BRANCH) {
3578 inst = Memory::Read32(phys_addr & 0xFFFFFFFC); 3574 inst = Memory::Read32(phys_addr & 0xFFFFFFFC);
3579 3575
3580 size++; 3576 size++;
@@ -3890,7 +3886,6 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
3890 3886
3891 #define CurrentModeHasSPSR (cpu->Mode != SYSTEM32MODE) && (cpu->Mode != USER32MODE) 3887 #define CurrentModeHasSPSR (cpu->Mode != SYSTEM32MODE) && (cpu->Mode != USER32MODE)
3892 #define PC (cpu->Reg[15]) 3888 #define PC (cpu->Reg[15])
3893 #define CHECK_EXT_INT if (!cpu->NirqSig && !(cpu->Cpsr & 0x80)) goto END;
3894 3889
3895 // GCC and Clang have a C++ extension to support a lookup table of labels. Otherwise, fallback 3890 // GCC and Clang have a C++ extension to support a lookup table of labels. Otherwise, fallback
3896 // to a clunky switch statement. 3891 // to a clunky switch statement.
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index c56475ae4..4af168bfc 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -496,6 +496,52 @@ static void TriggerCmdReqQueue(Service::Interface* self) {
496 cmd_buff[1] = 0; // No error 496 cmd_buff[1] = 0; // No error
497} 497}
498 498
499/**
500 * GSP_GPU::ImportDisplayCaptureInfo service function
501 *
502 * Returns information about the current framebuffer state
503 *
504 * Inputs:
505 * 0: Header 0x00180000
506 * Outputs:
507 * 1: Result code
508 * 2: Left framebuffer virtual address for the main screen
509 * 3: Right framebuffer virtual address for the main screen
510 * 4: Main screen framebuffer format
511 * 5: Main screen framebuffer width
512 * 6: Left framebuffer virtual address for the bottom screen
513 * 7: Right framebuffer virtual address for the bottom screen
514 * 8: Bottom screen framebuffer format
515 * 9: Bottom screen framebuffer width
516 */
517static void ImportDisplayCaptureInfo(Service::Interface* self) {
518 u32* cmd_buff = Kernel::GetCommandBuffer();
519
520 // TODO(Subv): We're always returning the framebuffer structures for thread_id = 0,
521 // because we only support a single running application at a time.
522 // This should always return the framebuffer data that is currently displayed on the screen.
523
524 u32 thread_id = 0;
525
526 FrameBufferUpdate* top_screen = GetFrameBufferInfo(thread_id, 0);
527 FrameBufferUpdate* bottom_screen = GetFrameBufferInfo(thread_id, 1);
528
529 cmd_buff[2] = top_screen->framebuffer_info[top_screen->index].address_left;
530 cmd_buff[3] = top_screen->framebuffer_info[top_screen->index].address_right;
531 cmd_buff[4] = top_screen->framebuffer_info[top_screen->index].format;
532 cmd_buff[5] = top_screen->framebuffer_info[top_screen->index].stride;
533
534 cmd_buff[6] = bottom_screen->framebuffer_info[bottom_screen->index].address_left;
535 cmd_buff[7] = bottom_screen->framebuffer_info[bottom_screen->index].address_right;
536 cmd_buff[8] = bottom_screen->framebuffer_info[bottom_screen->index].format;
537 cmd_buff[9] = bottom_screen->framebuffer_info[bottom_screen->index].stride;
538
539 cmd_buff[1] = RESULT_SUCCESS.raw;
540
541 LOG_WARNING(Service_GSP, "called");
542}
543
544
499const Interface::FunctionInfo FunctionTable[] = { 545const Interface::FunctionInfo FunctionTable[] = {
500 {0x00010082, WriteHWRegs, "WriteHWRegs"}, 546 {0x00010082, WriteHWRegs, "WriteHWRegs"},
501 {0x00020084, WriteHWRegsWithMask, "WriteHWRegsWithMask"}, 547 {0x00020084, WriteHWRegsWithMask, "WriteHWRegsWithMask"},
@@ -520,7 +566,7 @@ const Interface::FunctionInfo FunctionTable[] = {
520 {0x00150002, nullptr, "TryAcquireRight"}, 566 {0x00150002, nullptr, "TryAcquireRight"},
521 {0x00160042, nullptr, "AcquireRight"}, 567 {0x00160042, nullptr, "AcquireRight"},
522 {0x00170000, nullptr, "ReleaseRight"}, 568 {0x00170000, nullptr, "ReleaseRight"},
523 {0x00180000, nullptr, "ImportDisplayCaptureInfo"}, 569 {0x00180000, ImportDisplayCaptureInfo, "ImportDisplayCaptureInfo"},
524 {0x00190000, nullptr, "SaveVramSysArea"}, 570 {0x00190000, nullptr, "SaveVramSysArea"},
525 {0x001A0000, nullptr, "RestoreVramSysArea"}, 571 {0x001A0000, nullptr, "RestoreVramSysArea"},
526 {0x001B0000, nullptr, "ResetGpuCore"}, 572 {0x001B0000, nullptr, "ResetGpuCore"},
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 347d241f9..ca3ff3328 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -654,6 +654,8 @@ static ResultCode CreateMemoryBlock(Handle* out_handle, u32 addr, u32 size, u32
654 using Kernel::MemoryPermission; 654 using Kernel::MemoryPermission;
655 SharedPtr<SharedMemory> shared_memory = SharedMemory::Create(size, 655 SharedPtr<SharedMemory> shared_memory = SharedMemory::Create(size,
656 (MemoryPermission)my_permission, (MemoryPermission)other_permission); 656 (MemoryPermission)my_permission, (MemoryPermission)other_permission);
657 // Map the SharedMemory to the specified address
658 shared_memory->base_address = addr;
657 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(shared_memory))); 659 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(shared_memory)));
658 660
659 LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%08X", addr); 661 LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%08X", addr);