Skip to content

Commit

Permalink
fx
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuoya committed Jan 27, 2022
1 parent 927863b commit a431c4b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 36 deletions.
3 changes: 3 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 @@ -176,6 +176,9 @@
0004000000132600 = 马里奥与路易RPG 纸片马里奥MIX
0004000000132700 = 马里奥与路易RPG 纸片马里奥MIX
0004000000132800 = 马里奥与路易RPG 纸片马里奥MIX
00040000001CA900 = 马里奥与路易RPG3
00040000001D1400 = 马里奥与路易RPG3
00040000001D1500 = 马里奥与路易RPG3
0004000000060600 = 马里奥与路易RPG4 梦之队
00040000000D5A00 = 马里奥与路易RPG4 梦之队
00040000000D9000 = 马里奥与路易RPG4 梦之队
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ protected void refreshDirectoryLegacy(List<File> dirs) {
}
} else if (NativeLibrary.isValidFile(path)) {
GameFile game = new GameFile(path, isInstalled);
if (isInstalled && NativeLibrary.IsAppVisible(path)) {
if (game.isInstalledDLC()) {
if (isInstalled) {
if (game.isInstalledDLC() && NativeLibrary.IsAppVisible(path)) {
game.init();
contents.add(game);
} else if (NativeLibrary.IsAppExecutable(path)) {
Expand Down Expand Up @@ -463,9 +463,7 @@ public void onPageSelected(int position) {
mSwipeRefresh = findViewById(R.id.swipe_refresh);
mSwipeRefresh.setColorSchemeResources(R.color.citra_accent);
mSwipeRefresh.post(() -> {
float scale = getResources().getDisplayMetrics().scaledDensity;
int height = mSwipeRefresh.getHeight();
mSwipeRefresh.setDistanceToTriggerSync((int)(height / scale / 3));
mSwipeRefresh.setDistanceToTriggerSync(mSwipeRefresh.getHeight() / 3);
});
mSwipeRefresh.setOnRefreshListener(this::refreshLibrary);

Expand Down
3 changes: 2 additions & 1 deletion src/core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void LoadOverrides(u64 title_id) {
}
}

const std::array<u64, 49> accurate_mul_ids = {
const std::array<u64, 50> accurate_mul_ids = {
0x0004000000134500, // Attack on Titan
0x00040000000DF800, // Attack on Titan
0x0004000000152000, // Attack on Titan
Expand All @@ -237,6 +237,7 @@ static void LoadOverrides(u64 title_id) {
0x0004000000132800, // Mario & Luigi: Paper Jam
0x00040000001D1400, // Mario & Luigi: Bowsers Inside Story + Bowser Jrs Journey
0x00040000001D1500, // Mario & Luigi: Bowsers Inside Story + Bowser Jrs Journey
0x00040000001CA900, // Mario & Luigi: Bowsers Inside Story + Bowser Jrs Journey
0x00040000001B8F00, // Mario & Luigi: Superstar Saga + Bowsers Minions
0x00040000001B9000, // Mario & Luigi: Superstar Saga + Bowsers Minions
0x0004000000194B00, // Mario & Luigi: Superstar Saga + Bowsers Minions
Expand Down
18 changes: 7 additions & 11 deletions src/core/hle/service/fs/fs_user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,7 @@ void FS_USER::GetNandArchiveResource(Kernel::HLERequestContext& ctx) {
void FS_USER::CreateExtSaveData(Kernel::HLERequestContext& ctx) {
// TODO(Subv): Figure out the other parameters.
IPC::RequestParser rp(ctx, 0x0851, 9, 2);
auto media_type = rp.PopEnum<MediaType>();
u8 unk0 = rp.Pop<u8>();
u16 reserved = rp.Pop<u16>();
auto media_type = static_cast<MediaType>(rp.Pop<u32>()); // the other bytes are unknown
u32 save_low = rp.Pop<u32>();
u32 save_high = rp.Pop<u32>();
u32 unknown = rp.Pop<u32>();
Expand All @@ -549,16 +547,14 @@ void FS_USER::CreateExtSaveData(Kernel::HLERequestContext& ctx) {
rb.PushMappedBuffer(icon_buffer);

LOG_DEBUG(Service_FS,
"called, savedata_high={:08X} savedata_low={:08X} unknown={:08X} "
"files={:08X} directories={:08X} size_limit={:016x} icon_size={:08X}",
save_high, save_low, unknown, directories, files, size_limit, icon_size);
"CreateExtSaveData called, savedata_high={:08X} savedata_low={:08X} unknown={:08X} "
"files={:08X} directories={:08X} size_limit={:016x} icon_size={:08X}, media_type: {}",
save_high, save_low, unknown, directories, files, size_limit, icon_size, (u32)media_type);
}

void FS_USER::DeleteExtSaveData(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x852, 4, 0);
auto media_type = rp.PopEnum<MediaType>();
u8 unk0 = rp.Pop<u8>();
u16 reserved = rp.Pop<u16>();
auto media_type = static_cast<MediaType>(rp.Pop<u32>()); // the other bytes are unknown
u32 save_low = rp.Pop<u32>();
u32 save_high = rp.Pop<u32>();
u32 unknown = rp.Pop<u32>(); // TODO(Subv): Figure out what this is
Expand All @@ -567,8 +563,8 @@ void FS_USER::DeleteExtSaveData(Kernel::HLERequestContext& ctx) {
rb.Push(archives.DeleteExtSaveData(media_type, save_high, save_low));

LOG_DEBUG(Service_FS,
"called, save_low={:08X} save_high={:08X} media_type={:08X} unknown={:08X}", save_low,
save_high, static_cast<u32>(media_type), unknown);
"DeleteExtSaveData called, save_low={:08X} save_high={:08X} media_type={:08X} unknown={:08X}",
save_low, save_high, static_cast<u32>(media_type), unknown);
}

void FS_USER::CardSlotIsInserted(Kernel::HLERequestContext& ctx) {
Expand Down
25 changes: 7 additions & 18 deletions src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ bool CachedSurface::CanCopy(const SurfaceParams& dest_surface,
return false;
}

MICROPROFILE_DEFINE(OpenGL_CopySurface, "OpenGL", "CopySurface", MP_RGB(128, 192, 64));
void RasterizerCacheOpenGL::CopySurface(const Surface& src_surface, const Surface& dst_surface,
SurfaceInterval copy_interval) {
MICROPROFILE_SCOPE(OpenGL_CopySurface);
Expand Down Expand Up @@ -499,7 +498,6 @@ void RasterizerCacheOpenGL::CopySurface(const Surface& src_surface, const Surfac
UNREACHABLE();
}

MICROPROFILE_DEFINE(OpenGL_SurfaceLoad, "OpenGL", "Surface Load", MP_RGB(128, 192, 64));
void CachedSurface::LoadGLBuffer(PAddr load_start, PAddr load_end) {
ASSERT(type != SurfaceType::Fill);

Expand Down Expand Up @@ -569,7 +567,6 @@ void CachedSurface::LoadGLBuffer(PAddr load_start, PAddr load_end) {
}
}

MICROPROFILE_DEFINE(OpenGL_SurfaceFlush, "OpenGL", "Surface Flush", MP_RGB(128, 192, 64));
void CachedSurface::FlushGLBuffer(PAddr flush_start, PAddr flush_end) {
u8* const dst_buffer = VideoCore::Memory()->GetPhysicalPointer(addr);
if (dst_buffer == nullptr)
Expand Down Expand Up @@ -625,34 +622,28 @@ void CachedSurface::FlushGLBuffer(PAddr flush_start, PAddr flush_end) {
}
}

const Core::CustomTexInfo* CachedSurface::LoadCustomTexture(u64 tex_hash,
Common::Rectangle<u32>& custom_rect) {
const Core::CustomTexInfo* CachedSurface::LoadCustomTexture(u64 tex_hash) {
auto& custom_tex_cache = Core::System::GetInstance().CustomTexCache();
auto* tex_info = custom_tex_cache.LoadTexture(tex_hash);
if (tex_info) {
custom_rect.left = (custom_rect.left * tex_info->width) / width;
custom_rect.top = (custom_rect.top * tex_info->height) / height;
custom_rect.right = (custom_rect.right * tex_info->width) / width;
custom_rect.bottom = (custom_rect.bottom * tex_info->height) / height;
}
return tex_info;
return custom_tex_cache.LoadTexture(tex_hash);
}

MICROPROFILE_DEFINE(OpenGL_TextureUL, "OpenGL", "Texture Upload", MP_RGB(128, 192, 64));
void CachedSurface::UploadGLTexture(const Common::Rectangle<u32>& rect) {
MICROPROFILE_SCOPE(OpenGL_TextureUL);
// Required for rect to function properly with custom textures
Common::Rectangle custom_rect = rect;
PixelFormat custom_format = pixel_format;

if (Settings::values.custom_textures) {
u64 tex_hash = Common::TextureHash64(gl_buffer.data(), gl_buffer.size());
if (!custom_tex_info || custom_tex_info->hash != tex_hash) {
custom_tex_info = LoadCustomTexture(tex_hash, custom_rect);
custom_tex_info = LoadCustomTexture(tex_hash);
}
if (custom_tex_info) {
// always going to be using rgba8
custom_format = PixelFormat::RGBA8;
custom_rect.left = (custom_rect.left * custom_tex_info->width) / width;
custom_rect.top = (custom_rect.top * custom_tex_info->height) / height;
custom_rect.right = (custom_rect.right * custom_tex_info->width) / width;
custom_rect.bottom = (custom_rect.bottom * custom_tex_info->height) / height;
}
}

Expand Down Expand Up @@ -709,9 +700,7 @@ void CachedSurface::UploadGLTexture(const Common::Rectangle<u32>& rect) {
InvalidateAllWatcher();
}

MICROPROFILE_DEFINE(OpenGL_TextureDL, "OpenGL", "Texture Download", MP_RGB(128, 192, 64));
void CachedSurface::DownloadGLTexture(const Common::Rectangle<u32>& rect) {
MICROPROFILE_SCOPE(OpenGL_TextureDL);
u32 bytes_per_pixel = GetGLBytesPerPixel(pixel_format);
const FormatTuple& tuple = GetFormatTuple(pixel_format);
if (gl_buffer.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/video_core/renderer_opengl/gl_rasterizer_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct CachedSurface : SurfaceParams, std::enable_shared_from_this<CachedSurface
void FlushGLBuffer(PAddr flush_start, PAddr flush_end);

// Custom texture loading and dumping
const Core::CustomTexInfo* LoadCustomTexture(u64 tex_hash, Common::Rectangle<u32>& custom_rect);
const Core::CustomTexInfo* LoadCustomTexture(u64 tex_hash);

// Upload/Download data in gl_buffer in/to this surface's texture
void UploadGLTexture(const Common::Rectangle<u32>& rect);
Expand Down

0 comments on commit a431c4b

Please sign in to comment.