diff options
Diffstat (limited to '3ds/3ds_utils.c')
-rw-r--r-- | 3ds/3ds_utils.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/3ds/3ds_utils.c b/3ds/3ds_utils.c index 4f8f9be..266eca0 100644 --- a/3ds/3ds_utils.c +++ b/3ds/3ds_utils.c @@ -7,6 +7,20 @@ typedef s32 (*ctr_callback_type)(void); +void check_rosalina() { + int64_t version; + uint32_t major; + + has_rosalina = false; + + if (!svcGetSystemInfo(&version, 0x10000, 0)) { + major = GET_VERSION_MAJOR(version); + + if (major >= 8) + has_rosalina = true; + } +} + static void ctr_invalidate_ICache_kernel(void) { __asm__ volatile( @@ -38,6 +52,10 @@ void ctr_flush_DCache(void) void ctr_flush_invalidate_cache(void) { - ctr_flush_DCache(); - ctr_invalidate_ICache(); + if (has_rosalina) { + ctr_clear_cache(); + } else { + ctr_flush_DCache(); + ctr_invalidate_ICache(); + } } |