Skip to content

Commit

Permalink
fx
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuoya committed Aug 6, 2021
1 parent 02c4254 commit a7f5ee1
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ dependencies {
implementation "androidx.recyclerview:recyclerview:1.1.+"
implementation "androidx.cardview:cardview:1.0.+"
implementation "androidx.preference:preference:1.1.+"
implementation "androidx.core:core-google-shortcuts:+"
implementation "androidx.core:core-google-shortcuts:1.0.+"
}

def getVersion() {
Expand Down
11 changes: 11 additions & 0 deletions src/android/app/src/main/assets/3dstdb-zh_CN.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
000400000F700000 = 异度之刃
0004000000187500 = 极度恐惧
0004000000115400 = 第七龙神3 代号VFD
000400000018F800 = 第七龙神3 代号VFD
00040000001A6C00 = 第七龙神3 代号VFD
0004000000053700 = 终极兵团
0004000000148900 = 初音未来 未来计划DX
0004000000148C00 = 初音未来 未来计划DX
Expand Down Expand Up @@ -107,6 +109,8 @@
000400000016AD00 = 勇者斗恶龙怪兽篇 joker3
00040000001ACB00 = 勇者斗恶龙怪兽篇 joker3 专家版
00040000001AA900 = 龙珠 融合计划
00040000001AAA00 = 龙珠 融合计划
0004000000196D00 = 龙珠 融合计划
0004000000074600 = 勇者斗恶龙 怪兽仙境 泰瑞的仙境
000400000018EF00 = 勇者斗恶龙7 伊甸的战士们
000400000018F000 = 勇者斗恶龙7 伊甸的战士们
Expand Down Expand Up @@ -264,8 +268,12 @@
0004000000157C00 = 蒸汽世界 大劫掠
000400000012D900 = 蒸汽世界 大劫掠
000400000004A700 = 深渊传说
0004000000061300 = 深渊传说
000400000005D700 = 深渊传说
000400000012F500 = 世界传说 Reve Unitia
000400000016A900 = 泰拉瑞亚
000400000016A600 = 泰拉瑞亚
0004000000193500 = 泰拉瑞亚
00040000001CCD00 = 生存者同盟
00040000001B4500 = 生存者同盟
00040000000B3500 = 索尼克全明星赛车 变形
Expand Down Expand Up @@ -298,7 +306,10 @@
000400000010BE00 = 星之卡比 三重彩
000400000016DB00 = 遗产传奇
000400000017C800 = 遗产传奇
0004000000131C00 = 遗产传奇
00040000000EC200 = 塞尔达传说 众神的三角力量2
00040000000EC300 = 塞尔达传说 众神的三角力量2
00040000000EC400 = 塞尔达传说 众神的三角力量2
0004000000140800 = 魔女与勇者 2
0004000000172000 = Xeodrifter
000400000F707F00 = 超越光速 EX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ private static List<String> getSdCardPaths(final Context context) {
}
}

// TODO: On older devices, try System.getenv(¡°EXTERNAL_SDCARD_STORAGE¡±)
// TODO: On older devices, try System.getenv("EXTERNAL_SDCARD_STORAGE")

return list;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ System::ResultStatus System::SingleStep() {

static void LoadOverrides(u64 title_id) {
if (title_id == 0x0004000000068B00 || title_id == 0x0004000000061300 ||
title_id == 0x000400000004A700) {
title_id == 0x000400000004A700 || title_id == 0x000400000005D700) {
// hack for Tales of the Abyss / Pac Man Party 3D
Settings::values.display_transfer_hack = true;
// crash on `g_state.geometry_pipeline.Reconfigure();`
Expand Down
13 changes: 8 additions & 5 deletions src/core/hle/service/am/am.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,16 @@ void Module::ScanForTitles(Service::FS::MediaType media_type) {
for (const FileUtil::FSTEntry& tid_high : entries.children) {
for (const FileUtil::FSTEntry& tid_low : tid_high.children) {
std::string tid_string = tid_high.virtualName + tid_low.virtualName;

if (tid_string.length() == TITLE_ID_VALID_LENGTH) {
u64 tid = std::stoull(tid_string.c_str(), nullptr, 16);

const u64 tid = std::stoull(tid_string, nullptr, 16);
FileSys::NCCHContainer container(GetTitleContentPath(media_type, tid));
if (container.Load() == Loader::ResultStatus::Success)
am_title_list[static_cast<u32>(media_type)].push_back(tid);
if (container.Load() == Loader::ResultStatus::Success) {
std::string content_path = GetTitlePath(media_type, tid);
if (FileUtil::Exists(content_path + "data/00000001/")) {
am_title_list[static_cast<u32>(media_type)].push_back(tid);
LOG_DEBUG(Service_FS, "(STUBBED) AM ScanForTitles, media_type: {}, path: {}", media_type, content_path);
}
}
}
}
}
Expand Down
55 changes: 53 additions & 2 deletions src/core/hle/service/fs/fs_user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ void FS_USER::CardSlotIsInserted(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
rb.Push(RESULT_SUCCESS);
rb.Push(false);
LOG_WARNING(Service_FS, "(STUBBED) FS_USER CardSlotIsInserted called");
LOG_DEBUG(Service_FS, "(STUBBED) FS_USER CardSlotIsInserted called");
}

void FS_USER::GetCardType(Kernel::HLERequestContext& ctx) {
Expand All @@ -590,6 +590,57 @@ void FS_USER::DeleteSystemSaveData(Kernel::HLERequestContext& ctx) {

IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(archives.DeleteSystemSaveData(savedata_high, savedata_low));

LOG_DEBUG(Service_FS, "(STUBBED) FS_USER DeleteSystemSaveData called");
}

void FS_USER::EnumerateExtSaveData(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x855, 4, 2);
u32 buff_size = rp.Pop<u32>();
MediaType media_type = static_cast<MediaType>(rp.Pop<u8>());
u32 unknown = rp.Pop<u32>();
u32 shared = rp.Pop<u32>();
auto& extdata_list = rp.PopMappedBuffer();

IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);

std::string title_path;
if (media_type == Service::FS::MediaType::NAND) {
title_path = fmt::format("{}{}/extdata/",
FileUtil::GetUserPath(FileUtil::UserPath::NANDDir), SYSTEM_ID);
} else if (media_type == Service::FS::MediaType::SDMC) {
title_path = fmt::format("{}Nintendo 3DS/{}/{}/extdata/",
FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir), SYSTEM_ID, SDCARD_ID);
} else {
rb.Push(RESULT_SUCCESS);
rb.Push(0);
return;
}

std::vector<u64_le> title_list;
FileUtil::FSTEntry entries;
constexpr std::size_t TITLE_ID_VALID_LENGTH = 16;
FileUtil::ScanDirectoryTree(title_path, entries, 1);
for (const FileUtil::FSTEntry& tid_high : entries.children) {
for (const FileUtil::FSTEntry& tid_low : tid_high.children) {
std::string tid_string = tid_high.virtualName + tid_low.virtualName;
if (tid_string.length() == TITLE_ID_VALID_LENGTH) {
std::string user_path = fmt::format("{}{}/{}/user/", title_path, tid_high.virtualName, tid_low.virtualName);
if (FileUtil::Exists(user_path)) {
const u64 tid = std::stoull(tid_string, nullptr, 16);
title_list.push_back(tid);
}
}
}
}

u32 count = std::min(title_list.size(), buff_size / sizeof(u64));
extdata_list.Write(title_list.data(), 0, count * sizeof(u64));
rb.Push(RESULT_SUCCESS);
rb.Push(count);

LOG_DEBUG(Service_FS, "FS_USER EnumerateExtSaveData buff_size={} media_type={:08X}, unk: {}, shared: {:08X}",
buff_size, static_cast<u32>(media_type), unknown, shared);
}

void FS_USER::CreateSystemSaveData(Kernel::HLERequestContext& ctx) {
Expand Down Expand Up @@ -1024,7 +1075,7 @@ FS_USER::FS_USER(Core::System& system)
{0x08520100, &FS_USER::DeleteExtSaveData, "DeleteExtSaveData"},
{0x08530142, nullptr, "ReadExtSaveDataIcon"},
{0x085400C0, nullptr, "GetExtDataBlockSize"},
{0x08550102, nullptr, "EnumerateExtSaveData"},
{0x08550102, &FS_USER::EnumerateExtSaveData, "EnumerateExtSaveData"},
{0x08560240, &FS_USER::CreateSystemSaveData, "CreateSystemSaveData"},
{0x08570080, &FS_USER::DeleteSystemSaveData, "DeleteSystemSaveData"},
{0x08580000, nullptr, "StartDeviceMoveAsSource"},
Expand Down
1 change: 1 addition & 0 deletions src/core/hle/service/fs/fs_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ class FS_USER final : public ServiceFramework<FS_USER, ClientSlot> {
void GetSaveDataSecureValue(Kernel::HLERequestContext& ctx);

void GetCardType(Kernel::HLERequestContext& ctx);
void EnumerateExtSaveData(Kernel::HLERequestContext& ctx);

static ResultVal<u16> GetSpecialContentIndexFromGameCard(u64 title_id, SpecialContentType type);
static ResultVal<u16> GetSpecialContentIndexFromTMD(MediaType media_type, u64 title_id,
Expand Down
20 changes: 14 additions & 6 deletions src/video_core/renderer_opengl/gl_rasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1321,14 +1321,22 @@ bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransfe

// hack for Tales of the Abyss / Pac Man Party 3D
if (Settings::values.display_transfer_hack) {
src_params.addr += 0x6000;
src_params.end += 0x6000;
if (dst_params.height == 400) {
dst_params.addr += 0x1B0;
dst_params.end += 0x1B0;
if (dst_params.addr == 0x183CE430) {
dst_params.addr -= 0xCE430;
dst_params.end -= 0xCE430;
} else if (dst_params.addr == 0x18387F30) {
dst_params.addr -= 0x41A30;
dst_params.end -= 0x41A30;
}
} else {
dst_params.addr += 0xC0;
dst_params.end += 0xC0;
if (dst_params.addr == 0x180B4830) {
dst_params.addr -= 0x34830;
dst_params.end -= 0x34830;
} else if (dst_params.addr == 0x1807C430) {
dst_params.addr += 0x3BFD0;
dst_params.end += 0x3BFD0;
}
}
}

Expand Down

0 comments on commit a7f5ee1

Please sign in to comment.