Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cdram_magic_value_3 = 0x2251;
- cdram_magic_value_2 = 0x8c;
- cdram_magic_value_1 = 0x69462300;
- cdram_magic_value_4 = 0x23;
- cdram_magic_value_5 = 0x18100800;
- int smc_0x117_cdram_enable(void)
- {
- uint uVar1;
- undefined4 uVar2;
- undefined4 uVar3;
- uint tmp;
- uint uVar4;
- uint emctop_regs;
- if (cdram_enabled == 0) {
- cdram_enabled = 1;
- tmp = sceKernelSysrootGetErnieWakeupFactor();
- emctop_regs = SceEmcTop_vaddr;
- if ((tmp & 0x80) == 0) {
- sceKernelDisableIntr(0x22);
- uVar3 = cdram_magic_value_1;
- uVar2 = cdram_magic_value_2;
- uVar4 = cdram_magic_value_3 & 0xfffffdff;
- *(uint *)emctop_regs = uVar4;
- *(undefined4 *)(emctop_regs + 4) = 0x72233;
- *(undefined4 *)(emctop_regs + 8) = 0x7725245;
- *(undefined4 *)(emctop_regs + 0xc) = 0x1414;
- *(undefined4 *)(emctop_regs + 0x10) = 0x1f0704;
- *(undefined4 *)(emctop_regs + 0x14) = 0x1f0c0f;
- *(undefined4 *)(emctop_regs + 0x18) = 0x20b;
- *(undefined4 *)(emctop_regs + 0x1c) = 6;
- *(undefined4 *)(emctop_regs + 0x38) = uVar2;
- *(undefined4 *)(emctop_regs + 0x3c) = uVar3;
- *(undefined4 *)(emctop_regs + 0x2c) = 0x15fff;
- tmp = SceEmcTop_vaddr;
- DataMemoryBarrier(0x1f);
- if (SceEmcTop_vaddr != 0) {
- *(undefined4 *)(SceEmcTop_vaddr + 0x28) = 0xe0000;
- *(uint *)(tmp + 0x24) = *(uint *)(tmp + 0x24) & 0x30 | 1;
- DataMemoryBarrier(0x1f);
- do {
- } while (*(int *)(tmp + 0x24) << 0x1f < 0);
- }
- sceKernelUsleep(200000);
- *(undefined4 *)(emctop_regs + 0x24) = 0x30;
- *(undefined4 *)(emctop_regs + 0x24) = 0;
- tmp = SceEmcTop_vaddr;
- DataSynchronizationBarrier(0xf);
- if (SceEmcTop_vaddr != 0) {
- *(undefined4 *)(SceEmcTop_vaddr + 0x28) = 0x40400;
- *(uint *)(tmp + 0x24) = *(uint *)(tmp + 0x24) & 0x30 | 1;
- uVar1 = SceEmcTop_vaddr;
- DataMemoryBarrier(0x1f);
- do {
- } while (*(int *)(tmp + 0x24) << 0x1f < 0);
- if (SceEmcTop_vaddr != 0) {
- *(undefined4 *)(SceEmcTop_vaddr + 0x28) = 0x20000;
- *(uint *)(uVar1 + 0x24) = *(uint *)(uVar1 + 0x24) & 0x30 | 1;
- tmp = SceEmcTop_vaddr;
- DataMemoryBarrier(0x1f);
- do {
- } while (*(int *)(uVar1 + 0x24) << 0x1f < 0);
- if (SceEmcTop_vaddr != 0) {
- *(undefined4 *)(SceEmcTop_vaddr + 0x28) = 0x20000;
- *(uint *)(tmp + 0x24) = *(uint *)(tmp + 0x24) & 0x30 | 1;
- uVar1 = SceEmcTop_vaddr;
- DataMemoryBarrier(0x1f);
- do {
- } while (*(int *)(tmp + 0x24) << 0x1f < 0);
- if (SceEmcTop_vaddr != 0) {
- *(undefined4 *)(SceEmcTop_vaddr + 0x28) = 0x31;
- *(uint *)(uVar1 + 0x24) = *(uint *)(uVar1 + 0x24) & 0x30 | 1;
- tmp = SceEmcTop_vaddr;
- DataMemoryBarrier(0x1f);
- do {
- } while (*(int *)(uVar1 + 0x24) << 0x1f < 0);
- if (SceEmcTop_vaddr != 0) {
- *(undefined4 *)(SceEmcTop_vaddr + 0x28) = 0x200000;
- *(uint *)(tmp + 0x24) = *(uint *)(tmp + 0x24) & 0x30 | 3;
- DataMemoryBarrier(0x1f);
- do {
- } while (*(int *)(tmp + 0x24) << 0x1f < 0);
- }
- }
- }
- }
- }
- }
- else {
- sceKernelDisableIntr(0x22);
- uVar3 = cdram_magic_value_1;
- uVar2 = cdram_magic_value_2;
- uVar4 = cdram_magic_value_3 & 0xfffffdff;
- *(uint *)emctop_regs = uVar4;
- *(undefined4 *)(emctop_regs + 4) = 0x72233;
- *(undefined4 *)(emctop_regs + 8) = 0x7725245;
- *(undefined4 *)(emctop_regs + 0xc) = 0x1414;
- *(undefined4 *)(emctop_regs + 0x10) = 0x1f0704;
- *(undefined4 *)(emctop_regs + 0x14) = 0x1f0c0f;
- *(undefined4 *)(emctop_regs + 0x18) = 0x20b;
- *(undefined4 *)(emctop_regs + 0x1c) = 6;
- *(undefined4 *)(emctop_regs + 0x38) = uVar2;
- *(undefined4 *)(emctop_regs + 0x3c) = uVar3;
- *(undefined4 *)(emctop_regs + 0x2c) = 0x15fff;
- DataMemoryBarrier(0x1f);
- *(undefined4 *)(emctop_regs + 0x24) = 0;
- tmp = SceEmcTop_vaddr;
- DataSynchronizationBarrier(0xf);
- if (SceEmcTop_vaddr != 0) {
- *(undefined4 *)(SceEmcTop_vaddr + 0x28) = 0xe0000;
- *(uint *)(tmp + 0x24) = *(uint *)(tmp + 0x24) & 0x30 | 1;
- DataMemoryBarrier(0x1f);
- do {
- } while (*(int *)(tmp + 0x24) << 0x1f < 0);
- }
- sceKernelUsleep(200000);
- }
- *(uint *)emctop_regs = uVar4 | 0x600;
- DataMemoryBarrier(0x1f);
- *(undefined4 *)(emctop_regs + 0x230) = 0;
- *(undefined4 *)(emctop_regs + 0x244) = 1;
- DataMemoryBarrier(0x1f);
- *(undefined4 *)(emctop_regs + 0x234) = 0;
- *(undefined4 *)(emctop_regs + 0x230) = 1;
- DataMemoryBarrier(0x1f);
- sceKernelEnableIntr(0x22);
- return 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement