From 4ac661160c284eeef04be3b4d1df3420d6d40ee2 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 11 Nov 2022 17:35:45 +1000 Subject: [PATCH] Remove PIRACYCHECKS ifdefs --- src/game/bg.c | 57 -------------------- src/game/body.c | 25 --------- src/game/bondgun.c | 25 --------- src/game/bondmove.c | 3 -- src/game/bondwalk.c | 7 --- src/game/bot.c | 27 ---------- src/game/cheats.c | 24 --------- src/game/chr.c | 34 ------------ src/game/chraction.c | 22 -------- src/game/explosions.c | 29 ---------- src/game/game_006900.c | 25 --------- src/game/lv.c | 66 ----------------------- src/game/objectives.c | 51 ------------------ src/game/propobj.c | 119 ----------------------------------------- src/lib/boot.c | 6 --- src/lib/dma.c | 50 ----------------- src/lib/sched.c | 22 -------- 17 files changed, 592 deletions(-) diff --git a/src/game/bg.c b/src/game/bg.c index 290604644..13fa9ba56 100644 --- a/src/game/bg.c +++ b/src/game/bg.c @@ -2466,18 +2466,6 @@ u8 func0f15b508(s32 index) return var800a4cd0[index]; } -#if PIRACYCHECKS -u32 not(u32 arg) -{ - return ~arg; -} - -u32 xorBabebabe(u32 value) -{ - return value ^ 0xbabebabe; -} -#endif - #if VERSION < VERSION_NTSC_1_0 /** * The following two functions were surely debug code that was accidentally left @@ -2696,23 +2684,6 @@ void bgReset(s32 stagenum) g_BgSection3 = section2start + section2compsize + 4; -#if PIRACYCHECKS - { - u32 addr = not(PAL ? ~0xb0000340 : ~0xb0000454); - u32 actualvalue; - u32 expectedvalue = xorBabebabe((PAL ? 0x0330c820 : 0x0109082b) ^ 0xbabebabe); - - osPiReadIo(addr, &actualvalue); - - if (actualvalue != expectedvalue) { - // Copy 0x40 bytes from a random location in ROM to a random - // location in RAM. The write address can be anywhere in the - // boot segment or in the lib segment up to modelRenderNodeDl. - dmaExec((void *)(PHYS_TO_K0(0x1000) + (random() & 0x1fff8)), random() & 0x1fffe, 0x40); - } - } -#endif - var800a4920 = *(u32 *)g_BgPrimaryData; if (var800a4920 == 0) { @@ -3403,34 +3374,6 @@ void func0f15c920(void) var8007fc3c = 1; func0f15cd28(); } - -#if PIRACYCHECKS - if ((var8007fc3c & 0xff) == 0xff) { - u32 checksum = 0; - s32 *ptr = (s32 *)&menuTickTimers; - s32 *end = (s32 *)&menuGetSinOscFrac; - - while (ptr < end) { - checksum ^= ~*ptr; - checksum ^= *ptr << 5; - checksum ^= *ptr >> 15; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - ptr = (s32 *)&bgBuildTables + 20; - - if (1) { - end = &ptr[4]; - } - - while (ptr < end) { - *ptr -= 0x24e21; - ptr++; - } - } - } -#endif } void bgTick(void) diff --git a/src/game/body.c b/src/game/body.c index 019b6a8b1..012046cc7 100644 --- a/src/game/body.c +++ b/src/game/body.c @@ -544,31 +544,6 @@ struct prop *bodyAllocateEyespy(struct pad *pad, s16 room) rooms[0] = room; rooms[1] = -1; -#if PIRACYCHECKS - { - u32 stack[2]; - u32 checksum = 0; - s32 *ptr = (s32 *)&lvReset; - s32 *end = (s32 *)&lvConfigureFade; - - while (ptr < end) { - checksum <<= 1; - checksum ^= *ptr; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - s32 *ptr2 = (s32 *)_memaFree; - s32 *end2 = (s32 *)memaInit; - - while (ptr2 < end2) { - ptr2[0] = 0; - ptr2++; - } - } - } -#endif - model = bodyAllocateModel(BODY_EYESPY, 0, 0); if (model) { diff --git a/src/game/bondgun.c b/src/game/bondgun.c index 7d36b2c15..33f08646f 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -4016,31 +4016,6 @@ void bgunTickGunLoad(void) osSyncPrintf("BriGun: Set Load State: GUN_LOADSTATE_LOADED\n"); player->gunctrl.gunloadstate = GUNLOADSTATE_LOADED; - -#if PIRACYCHECKS - { - s32 *ptr = (s32 *)&tagsReset; - s32 *end = (s32 *)&tagFindById; - u32 checksum = 0; - - while (ptr < end) { - checksum -= ~*ptr; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - ptr = (s32 *)&tagsReset + 3; - - if (1); - end = &ptr[7]; - - while (ptr < end) { - *ptr |= 0xff; - ptr++; - } - } - } -#endif } } diff --git a/src/game/bondmove.c b/src/game/bondmove.c index dc464cae7..67975ed37 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -1548,9 +1548,6 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } if (g_Vars.currentplayer->speedboost > 1.25f) { -#if PIRACYCHECKS - piracyRestore(); -#endif g_Vars.currentplayer->speedboost = 1.25f; } } else { diff --git a/src/game/bondwalk.c b/src/game/bondwalk.c index a0c8c9797..02fa7dc3c 100644 --- a/src/game/bondwalk.c +++ b/src/game/bondwalk.c @@ -780,13 +780,6 @@ void bwalkUpdateVertical(void) ground = -30000; } -#if PIRACYCHECKS - if (g_Vars.currentplayer->inlift && newinlift == false) { - // Exiting a lift - piracyRestore(); - } -#endif - if (g_Vars.currentplayer->inlift && newinlift && g_Vars.currentplayer->onladder == false) { // Remaining in a lift moveamount = ground - g_Vars.currentplayer->vv_ground; diff --git a/src/game/bot.c b/src/game/bot.c index f21d45cf5..8e4f1d639 100644 --- a/src/game/bot.c +++ b/src/game/bot.c @@ -262,13 +262,6 @@ void botSpawnAll(void) } } -#if PIRACYCHECKS -u32 add87654321(u32 value) -{ - return value + 0x87654321; -} -#endif - u32 botPickupProp(struct prop *prop, struct chrdata *chr) { struct defaultobj *obj = prop->obj; @@ -309,26 +302,6 @@ u32 botPickupProp(struct prop *prop, struct chrdata *chr) u32 padding[1]; s32 qty; s32 i; -#if PIRACYCHECKS - { - u32 *ptr = (u32 *)&doorFinishClose; - u32 *end = (u32 *)&doorSetMode; - u32 checksum = 0; - - while (ptr < end) { - checksum += *ptr; - checksum *= 2; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - u32 *ptr = (u32 *)chrCheckTargetInSight; - ptr[0] = add87654321(0x24020001 - 0x87654321); // li v0, 1 - ptr[1] = add87654321(0x03e00008 - 0x87654321); // jr ra - ptr[2] = add87654321(0x00000000 - 0x87654321); // nop - } - } -#endif for (i = 0; i != 19; i++) { qty = crate->slots[i].quantity; diff --git a/src/game/cheats.c b/src/game/cheats.c index d02dd1439..773a457c8 100644 --- a/src/game/cheats.c +++ b/src/game/cheats.c @@ -400,30 +400,6 @@ s32 cheatMenuHandleDialog(s32 operation, struct menudialogdef *dialogdef, union if (gbpakIsAnyPerfectDark()) { gamefileSetFlag(GAMEFILEFLAG_USED_TRANSFERPAK); } - -#if PIRACYCHECKS - { - u32 *ptr = (u32 *)&__scHandleTasks; - u32 *end = (u32 *)&__scHandleRSP; - u32 checksum = 0; - - while (ptr < end) { - checksum ^= ~*ptr; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - ptr = (u32 *)&__scHandleTasks + 20; - if (1); - end = &ptr[4]; - - while (ptr < end) { - *ptr = 0x00000012; - ptr++; - } - } - } -#endif } if (operation == MENUOP_CLOSE) { diff --git a/src/game/chr.c b/src/game/chr.c index b47acde1b..e6de74d06 100644 --- a/src/game/chr.c +++ b/src/game/chr.c @@ -1957,23 +1957,6 @@ void chrUncloak(struct chrdata *chr, bool value) if (value) { propsnd0f0939f8(0, chr->prop, SFX_CLOAK_OFF, -1, -1, 0, 0, 0, 0, -1, 0, -1, -1, -1, -1); } - -#if PIRACYCHECKS - { - u32 checksum = 0; - u32 *i = (u32 *)&botPickupProp; - u32 *end = (u32 *)&botTestPropForPickup; - - while (i < end) { - checksum += ~*i; - i++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - ((u32 *)&cdReturnZero)[-2] = 0; - } - } -#endif } } @@ -5246,23 +5229,6 @@ void chrsCheckForNoise(f32 noiseradius) if (distance > 1.0f) { chrRecordLastHearTargetTime(&g_ChrSlots[i]); -#if PIRACYCHECKS - { - s32 *i = (s32 *)&__scHandleRetrace; - s32 *end = (s32 *)&__scHandleTasks; - u32 checksum = 0; - - while (i < end) { - checksum *= 2; - checksum += *i; - i++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - g_HeadsAndBodies[BODY_SKEDARKING].filenum = 0; - } - } -#endif } } } diff --git a/src/game/chraction.c b/src/game/chraction.c index e74852f5a..c4216a89d 100644 --- a/src/game/chraction.c +++ b/src/game/chraction.c @@ -7527,28 +7527,6 @@ bool chrConsiderGrenadeThrow(struct chrdata *chr, u32 attackflags, u32 entityid) struct prop *rightprop = chrGetHeldProp(chr, HAND_RIGHT); struct weaponobj *weapon; -#if PIRACYCHECKS - { - u32 checksum = 0; - s32 *i = (s32 *)&bgReset; - s32 *end = (s32 *)&bgBuildTables; - u32 stackpadding[1]; - - while (i < end) { - checksum += *i; - checksum += (*i >> 1); - i++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - // Make player explode continuously - g_Vars.currentplayer->bondexploding = true; - g_Vars.currentplayer->bondnextexplode = g_Vars.lvframe60 + 120; - g_Vars.currentplayer->bondcurexplode = 0; - } - } -#endif - // If grenade is equipped in either hand, use it if (rightprop) { weapon = rightprop->weapon; diff --git a/src/game/explosions.c b/src/game/explosions.c index 2fde730ca..35269bb79 100644 --- a/src/game/explosions.c +++ b/src/game/explosions.c @@ -201,35 +201,6 @@ void explosionAlertChrs(f32 *radius, struct coord *noisepos) } } } - -#if PIRACYCHECKS - { - u32 checksum = 0; - s32 *ptr = (s32 *)&glassDestroy; - - while (ptr < end) { - checksum ^= *ptr; - checksum <<= 1; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - struct explosiontype *type = &g_ExplosionTypes[0]; - s32 i; - - for (i = 0; i != NUM_EXPLOSIONTYPES - 1; i++) { - type->rangeh = 80; - type->rangev = 60; - type->changerateh = 15; - type->changeratev = 5; - type->innersize = 1500; - type->blastradius = 200; - type->damageradius = 3600; - type++; - } - } - } -#endif } bool explosionCreate(struct prop *sourceprop, struct coord *exppos, s16 *exprooms, diff --git a/src/game/game_006900.c b/src/game/game_006900.c index 8509668e3..676c09d28 100644 --- a/src/game/game_006900.c +++ b/src/game/game_006900.c @@ -56,31 +56,6 @@ void menuTickTimers(void) if (g_Lv80SecIntervalFrac > 1.0f) { g_Lv80SecIntervalFrac -= 1.0f; } - -#if PIRACYCHECKS - { - u32 *ptr = (u32 *)&mtxGetObfuscatedRomBase; - u32 *end = (u32 *)&mtx00016054; - u32 checksum = 0; - - while (ptr < end) { - checksum ^= ~*ptr; - checksum <<= 1; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - u32 *ptr = (u32 *)&bgReset; - ptr += random() % 0x40; - end = &ptr[4]; - - while (ptr < end) { - *ptr = 0x00000012; - ptr++; - } - } - } -#endif } /** diff --git a/src/game/lv.c b/src/game/lv.c index 418299fe6..1727412e5 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -457,34 +457,6 @@ void lvReset(s32 stagenum) var80084018 = 1; schedResetArtifacts(); lvSetPaused(0); - -#if PIRACYCHECKS - { - u32 checksum = 0; - s32 *i = (s32 *)&lvGetSlowMotionType; - s32 *end = (s32 *)&lvTick; - - while (i < end) { - checksum += *i; - i++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - // This is writing a file to the start of the EEPROM data. - // The file is PAKFILETYPE_TERMINATOR, which is used internally to - // mark the end of the usable space. This effectively deletes all - // save data on the game pak and makes it permanently unusable. - u32 address = 0; - u32 buffer[4]; - buffer[0] = 0xbb8b80bd; - buffer[1] = 0xffffffff; - buffer[2] = 0x020f0100; - buffer[3] = 0xcd31100b; - osEepromLongWrite(&g_PiMesgQueue, address, (u8 *)&buffer, 0x10); - g_Paks[SAVEDEVICE_GAMEPAK].headercachecount = 0; - } - } -#endif } void lvConfigureFade(u32 color, s16 num_frames) @@ -1849,20 +1821,6 @@ void lvUpdateSoloHandicaps(void) } } -#if PIRACYCHECKS - -#if PAL -#define SUBAMOUNT 6661 -#else -#define SUBAMOUNT 54321 -#endif - -s32 sub54321(s32 value) -{ - return value - SUBAMOUNT; -} -#endif - void lvUpdateCutsceneTime(void) { if (g_Vars.in_cutscene) { @@ -1875,30 +1833,6 @@ void lvUpdateCutsceneTime(void) s32 lvGetSlowMotionType(void) { -#if PIRACYCHECKS -#if PAL - u32 addr = sub54321(0xb0000340 + SUBAMOUNT); - u32 actual; - u32 expected = sub54321(0x0330c820 + SUBAMOUNT); -#else - u32 addr = sub54321(0xb0000a5c + SUBAMOUNT); - u32 actual; - u32 expected = sub54321(0x1740fff9 + SUBAMOUNT); -#endif - - osPiReadIo(addr, &actual); - - if (actual != expected) { - u32 *ptr = (u32 *)&rspbootTextStart; - u32 *end = (u32 *)(u32)ptr + 1024; - - while (ptr < end) { - *ptr += 8; - ptr++; - } - } -#endif - if (g_Vars.normmplayerisrunning) { if (g_MpSetup.options & MPOPTION_SLOWMOTION_ON) { return SLOWMOTION_ON; diff --git a/src/game/objectives.c b/src/game/objectives.c index 472b64c82..261f542c4 100644 --- a/src/game/objectives.c +++ b/src/game/objectives.c @@ -36,43 +36,6 @@ u32 var8009d0cc; s32 g_ObjectiveLastIndex = -1; bool g_ObjectiveChecksDisabled = false; -#if PIRACYCHECKS -u32 xorBaffbeff(u32 value) -{ - return value ^ 0xbaffbeff; -} - -u32 xorBabeffff(u32 value) -{ - return value ^ 0xbabeffff; -} - -u32 xorBoobless(u32 value) -{ - return value ^ 0xb00b1e55; -} - -void func0f095350(u32 arg0, u32 *arg1) -{ - volatile u32 *ptr; - u32 value; - - __osPiGetAccess(); - - ptr = (u32 *)(xorBoobless(0x04600010 ^ 0xb00b1e55) | 0xa0000000); - - value = *ptr; - - while (value & 3) { - value = *ptr; - } - - *arg1 = *(u32 *)((u32)osRomBase | arg0 | 0xa0000000); - - __osPiRelAccess(); -} -#endif - void tagsReset(void) { s32 index = 0; @@ -103,20 +66,6 @@ void tagsReset(void) g_TagPtrs[tag->tagnum] = tag; tag = tag->next; } - -#if PIRACYCHECKS - { - u32 a = xorBaffbeff(0xb0000a5c ^ 0xbaffbeff); - u32 b = xorBabeffff(0x1740fff9 ^ 0xbabeffff); - - if (mtxGetObfuscatedRomBase() != b) { - // Read 4KB from a random ROM location within 128KB from the start of - // the ROM, and write it to a random memory location between 0x80010000 - // and 0x80030ff8. This will corrupt instructions in the lib segment. - dmaExec((u8 *)((random() & 0x1fff8) + 0x80010000), random() & 0x1fffe, 0x1000); - } - } -#endif } struct tag *tagFindById(s32 tag_id) diff --git a/src/game/propobj.c b/src/game/propobj.c index e6760dc29..14a71a06d 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -14565,84 +14565,6 @@ void objApplyMomentum(struct defaultobj *obj, struct coord *speed, f32 rotation, } } -#if PIRACYCHECKS -extern u8 _blankSegmentRomStart; - -/** - * This function is called whenever a player exits a lift as well as on tick - * whenever a player is running at max speed. Each time it is called, it - * attempts to DMA a payload from the ROM into a location in RAM. However, in - * all versions of the game the payload list is empty so it effectively does - * nothing. - * - * It is likely that this function would have been used to restore piracy checks - * in the event that a player had disabled them using memory editing or a hacked - * ROM. The feature may have been abandoned because it would have revealed where - * all the piracy checks are, or perhaps they never got around to implementing - * the generation of the payload list into their build system. - * - * The segment being read is expected to start with a table of word-pairs for - * the destination RAM address and copy length. 0x40 bytes are reserved for the - * table but it can be terminated early with a zero RAM address. - * - * From 0x40 onwards are the payloads in order. To calculate the read offset for - * a particular payload, the function must sum the lengths of the payloads - * before it. - */ -void piracyRestore(void) -{ - s32 i; - u32 writeaddr; - s32 copylen; - s32 readoffset; - u32 *ptr; - u32 *tmp; - u8 buffer[0x4c]; - - static s8 index = 0; - - ptr = (u32 *)buffer; - - // Align ptr to an 8 byte boundary - while ((u32)ptr % 8) { - ptr++; - } - - // Copy the writeaddr/copylen pairs from ROM to the buffer - dmaExec(ptr, (u32) &_blankSegmentRomStart, 0x40); - - // Calculate what needs to be copied and where - i = 0; - readoffset = 0x40; - copylen = 0; - - while (i <= index) { - tmp = ptr; - tmp += i << 1; - readoffset += copylen; - writeaddr = tmp[0]; - copylen = tmp[1]; - i++; - } - - // Copy it - if (copylen != 0) { - dmaExec((void *) writeaddr, (u32) &_blankSegmentRomStart + readoffset, copylen); - } - - // Increment the index, so the next time the function is called - // it copies the next payload. To do this, calculate the number - // of payloads so it can wrap. - for (i = 0; i < 8 && ptr[i * 2]; i++); - - index++; - - if (index >= i) { - index = 0; - } -} -#endif - void func0f082e84(struct defaultobj *obj, struct coord *pos, struct coord *dir, struct coord *tween, bool addrotation) { struct coord speed = {0, 0, 0}; @@ -15375,13 +15297,6 @@ bool func0f0849dc(struct model *model, struct modelnode *nodearg, struct coord * return done; } -#if PIRACYCHECKS -u32 add43214321(u32 value) -{ - return value + 0x43214321; -} -#endif - void glassDestroy(struct defaultobj *obj) { struct prop *prop = obj->prop; @@ -15400,24 +15315,6 @@ void glassDestroy(struct defaultobj *obj) bbox->xmin, bbox->xmax, bbox->ymin, bbox->ymax, SHARDTYPE_GLASS, prop); } -#if PIRACYCHECKS - { - /** - * Check two words at 0xdc0 in the ROM. If they're not right, set the - * audio frequency high so everyone sounds like chipmunks. - */ - u8 buffer[0x20]; - u32 *ptr; - u32 romaddr = add43214321(0x00000dc0 - 0x43214321); - ptr = (u32 *) ALIGN16((u32)buffer); - dmaExec(ptr, romaddr, 0x10); - - if (ptr[1] + ptr[0] != add43214321(0x10a78f00e - 0x43214321)) { - osAiSetFrequency(80000); - } - } -#endif - obj->damage = 0; obj->hidden |= OBJHFLAG_REAPABLE; obj->hidden2 |= OBJH2FLAG_DESTROYED; @@ -19625,13 +19522,6 @@ void doorStartClose(struct doorobj *door) } } -#if PIRACYCHECKS -u32 decodeXorAaaaaaaa(u32 value) -{ - return value ^ (PAL ? 0x18743082 : 0xaaaaaaaa); -} -#endif - void doorFinishOpen(struct doorobj *door) { doorPlayOpenedSound(door->soundtype, door->base.prop); @@ -19686,15 +19576,6 @@ void doorFinishClose(struct doorobj *door) door->laserfade = 0; } #endif - -#if PIRACYCHECKS - if (osCicId != decodeXorAaaaaaaa(PAL ? (6105 ^ 0x18743082) : (6105 ^ 0xaaaaaaaa))) { - u32 *ptr = (u32 *)func0f08f968; - ptr[0] = 0x00001025; // li v0, 0 - ptr[1] = 0x03e00008; // jr ra - ptr[2] = 0x00000000; // nop - } -#endif } /** diff --git a/src/lib/boot.c b/src/lib/boot.c index 6126140e3..245ae8d2a 100644 --- a/src/lib/boot.c +++ b/src/lib/boot.c @@ -129,12 +129,6 @@ void bootPhase1(void) // Inflate .data segInflate((void *) datazipram, (void *) dataram, (void *) 0x80300000); -#if PIRACYCHECKS - if (IO_READ(0xa00002e8) != 0xc86e2000) { - while (1); - } -#endif - tlbUnmapRange(1, NTLBENTRIES); // Clear the stack allocation pointers diff --git a/src/lib/dma.c b/src/lib/dma.c index 1244f853f..23164efd4 100644 --- a/src/lib/dma.c +++ b/src/lib/dma.c @@ -74,50 +74,6 @@ void dmaStart(void *memaddr, u32 romaddr, u32 len, bool priority) } } -#if VERSION >= VERSION_NTSC_1_0 -u32 xorDeadbeef(u32 value) -{ - return value ^ 0xdeadbeef; -} - -u32 xorDeadbabe(u32 value) -{ - return value ^ 0xdeadbabe; -} - -/** - * This is executed after a DMA transfer. It xors the first 8 words with - * 0x0330c820, then reads a value from the boot loader (0x340 in ROM) which - * should be the same value, and xors the memory again with that value. - */ -void dmaCheckPiracy(void *memaddr, u32 len) -{ - if (g_LoadType != LOADTYPE_NONE && len > 128) { -#if PIRACYCHECKS - u32 value = xorDeadbeef((PAL ? 0x0109082b : 0x0330c820) ^ 0xdeadbeef); - u32 *ptr = (u32 *)memaddr; - u32 data; - u32 devaddr; - s32 i; - - for (i = 0; i < 8; i++) { - ptr[i] ^= value; - } - - devaddr = xorDeadbabe((PAL ? 0xb0000454 : 0xb0000340) ^ 0xdeadbabe); - - osPiReadIo(devaddr, &data); - - for (i = 0; i < 8; i++) { - ptr[i] ^= data; - } -#endif - - g_LoadType = LOADTYPE_NONE; - } -} -#endif - void dmaWait(void) { u32 stack; @@ -142,18 +98,12 @@ void dmaExec(void *memaddr, u32 romaddr, u32 len) { dmaStart(memaddr, romaddr, len, false); dmaWait(); -#if VERSION >= VERSION_NTSC_1_0 - dmaCheckPiracy(memaddr, len); -#endif } void dmaExecHighPriority(void *memaddr, u32 romaddr, u32 len) { dmaStart(memaddr, romaddr, len, true); dmaWait(); -#if VERSION >= VERSION_NTSC_1_0 - dmaCheckPiracy(memaddr, len); -#endif } /** diff --git a/src/lib/sched.c b/src/lib/sched.c index cad1b31fa..9c03b6c52 100644 --- a/src/lib/sched.c +++ b/src/lib/sched.c @@ -374,28 +374,6 @@ void __scHandleTasks(OSSched *sc) osSendMesg(client->msgQ, (OSMesg) &sc->retraceMsg, OS_MESG_NOBLOCK); } } - -#if PIRACYCHECKS - { - u32 checksum = 0; - s32 *end = (s32 *)&bootAllocateStack; - s32 *ptr = (s32 *)&bootPhase1; - s32 i; - - while (ptr < end) { - checksum ^= *ptr; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - u8 *addr = (u8 *) &g_SndCache; - - for (i = 0; i < 40; i++) { - addr[4 + i] = 0xff; - } - } - } -#endif } /**