From c4ca34db4ce8a939766ba52bea7445022deb7dff Mon Sep 17 00:00:00 2001 From: ichfly Date: Fri, 11 Dec 2015 18:34:30 +0100 Subject: [PATCH] fixed thumb *xtb instr + some am stuff --- source/Main.cpp | 2 +- source/arm/dyncom/arm_dyncom_thumb.cpp | 7 +-- source/process9/am.cpp | 63 +++++++++++++++++++++++++- 3 files changed, 67 insertions(+), 5 deletions(-) diff --git a/source/Main.cpp b/source/Main.cpp index c12dee5..6689694 100644 --- a/source/Main.cpp +++ b/source/Main.cpp @@ -48,4 +48,4 @@ extern "C" void citraFireInterrupt(int id) } bool novideo = true; extern "C" int citraPressedkey = 0; -extern "C" bool citraSettingSkipGSP = false; \ No newline at end of file +extern "C" bool citraSettingSkipGSP = true; \ No newline at end of file diff --git a/source/arm/dyncom/arm_dyncom_thumb.cpp b/source/arm/dyncom/arm_dyncom_thumb.cpp index 7cf3858..c8298fd 100644 --- a/source/arm/dyncom/arm_dyncom_thumb.cpp +++ b/source/arm/dyncom/arm_dyncom_thumb.cpp @@ -351,10 +351,11 @@ tdstate thumb_translate(addr_t addr, uint32_t instr, uint32_t* ainstr, uint32_t* //e6ef1078 uxtb r1, r8 u32 subset[4] = { //Bit 12 - 15 dest Bit 0 - 3 src - 0xe6ff0070, /* uxth */ - 0xe6ef0070, /* uxtb */ 0xe6bf0070, /* sxth */ - 0xe6af0070 /* sxtb */ + 0xe6af0070, /* sxtb */ + 0xe6ff0070, /* uxth */ + 0xe6ef0070 /* uxtb */ + }; if ((tinstr & 0xF00) == 0x200) //Bit(7) unsigned (set = sxt. cleared = uxt) Bit(6) byte (set = .xtb cleared = .xth) Bit 5-3 Rb src Bit 2-0 Rd dest diff --git a/source/process9/am.cpp b/source/process9/am.cpp index 40b48a4..b8eb48e 100644 --- a/source/process9/am.cpp +++ b/source/process9/am.cpp @@ -25,8 +25,69 @@ void P9AM::Command(u32 data[], u32 numb) LOG("GetTitleCount %02x", data[1] & 0xFF); resdata[0] = 0x00010080; resdata[1] = 0; - resdata[2] = 0; + resdata[2] = 0; //only the old one are used (that is not correct but it works) break; + case 0x3: + { + u8 medid = data[1] & 0xFF; + u32 count = data[2]; + u32 desc_read = data[3]; + u32 ptr_read = data[4]; + u32 desc_write = data[5]; + u32 ptr_write = data[6]; + LOG("GetTitleInfo %02x %08x", medid, count); + for (int j = 0; j < count; j++) + { + u8 temp = 0; + for (u32 i = 0; i < 8; i++) // copy id + { + m_owner->m_kernel->m_IPCFIFOAdresses[(desc_read >> 4) & 0xF]->Read8(i + ptr_read, temp); + printf("%02x", temp); + m_owner->m_kernel->m_IPCFIFOAdresses[(desc_write >> 4) & 0xF]->Write8(i + ptr_write, temp); + } + for (u32 i = 8; i < 24; i++) + { + m_owner->m_kernel->m_IPCFIFOAdresses[(desc_write >> 4) & 0xF]->Write8(i + ptr_write, 0); + } + LOG(""); + ptr_write += 24; + } + + resdata[0] = 0x00030040; + resdata[1] = 0; + break; + } + case 0x1F: + { + u8 count = data[1]; + u32 unk = data[2]; //(always 0?) + u32 desc_read = data[3]; + u32 ptr_read = data[4]; + u32 desc_write = data[5]; + u32 ptr_write = data[6]; + LOG("GetTitleTemporaryInfo %08x %08x", unk, count); + for (int j = 0; j < count; j++) + { + u8 temp = 0; + for (u32 i = 0; i < 8; i++) // copy id + { + m_owner->m_kernel->m_IPCFIFOAdresses[(desc_read >> 4) & 0xF]->Read8(i + ptr_read, temp); + printf("%02x", temp); + m_owner->m_kernel->m_IPCFIFOAdresses[(desc_write >> 4) & 0xF]->Write8(i + ptr_write, temp); + } + for (u32 i = 8; i < 24; i++) + { + m_owner->m_kernel->m_IPCFIFOAdresses[(desc_write >> 4) & 0xF]->Write8(i + ptr_write, 0); + } + LOG(""); + ptr_write += 24; + } + + resdata[0] = 0x00030040; + resdata[1] = 0; + break; + } + case 0x3F: LOG("unk3F %02x", data[1]&0xFF); resdata[0] = 0x003F0080; -- 2.39.5