23 s32 (*readFunc)(OSPiHandle*, u32, u32*);
24 s32 (*readFunc2)(OSPiHandle*, u32, u32*);
35 readFunc = osEPiReadIo;
38 readFunc(nuPiCartHandle, 0xB0000D10, &thisInsn);
42 for (it = battle_heap_create_obfuscated_ROM_START; it < battle_heap_create_obfuscated_ROM_END; it += 4) {
43 readFunc(nuPiCartHandle, (u32)it, &thisInsn);
48 hash -=
LOWER(thisInsn);
49 hash -=
LOWER(prevInsn);
54 hash -=
LOWER(thisInsn) + (
UPPER(thisInsn) & 0xFC00);
59 vramDest += seed + 0x2A4EB6 - hash;
62 readFunc2 = osEPiReadIo;
65 readFunc2(nuPiCartHandle, 0xB0000E38, &thisInsn2);
69 for (it = obfuscation_shims_ROM_START; it < obfuscation_shims_ROM_END; it += 4) {
70 readFunc2(nuPiCartHandle, (u32)it, &thisInsn2);
75 hash -=
LOWER(thisInsn2);
76 hash -=
LOWER(prevInsn);
81 hash -=
LOWER(thisInsn2) + (
UPPER(thisInsn2) & 0xFC00);
85 romStart += seed + 0xED41C - hash;
87 dma_copy(romStart, obfuscation_shims_ROM_END, vramDest);