volatile unsigned long timer; INT_HANDLER(old); DEFINE_INT_HANDLER(new) { timer++; ExecuteHandler(old); } // Main Function void _main(void) { unsigned char *mem; short x, y; unsigned short i; ClrScr(); FontSetSys(F_4x6); mem = malloc(51620); if (!mem) { printf("Not enough Mem!\n"); ngetchx(); return; } old = GetIntVec(AUTO_INT_5); SetIntVec(AUTO_INT_5, new); // -25 to 265 // -25 t0 153 // 23890 is size of side timer = 0; for(y=-25; y<153; y++) { for(x=-25; x<265; x++) { memset(mem, 0, 51620); ClipSprite8_OR(x, y, 8, SpriteData, mem+23890); for(i=0; i<23890; i++) { if (*(mem + i) > 0) { printf("Error at (%d,%d)!\n", x, y); ngetchx(); goto no_loop; } } for(i=27730; i<51620; i++) { if (*(mem + i) > 0) { printf("Error at (%d,%d)!\n", x, y); ngetchx(); goto no_loop; } } } printf("y = %d passed!\n", y); } printf("\n\nPassed Test!\n"); ngetchx(); no_loop: printf("Time: %lu\n", timer); ngetchx(); SetIntVec(AUTO_INT_5, old); free(mem); }