src/core1: renamed files
umbenannt: src/core1/code_1E6E0.c -> src/core1/crccalc.c umbenannt: src/core1/code_15770.c -> src/core1/depthbuffer.c
This commit is contained in:
@@ -1,45 +1,30 @@
|
||||
#include <ultra64.h>
|
||||
#include "core1/core1.h"
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
// transform seed (in mips3 file)
|
||||
u32 func_8025C29C(u32 *seed);
|
||||
u32 func_8025C29C(u32 *seed); // TODO: This function does not exist in source code, why does it work?
|
||||
|
||||
void glcrc_calc_checksum(void *start, void *end, u32 checksum[2])
|
||||
{
|
||||
void glcrc_calc_checksum(void *start, void *end, u32 checksum[2]) {
|
||||
u8 *p;
|
||||
|
||||
u32 shift = 0;
|
||||
|
||||
u64 seed = 0x8F809F473108B3C1;
|
||||
|
||||
u32 crc1 = 0;
|
||||
u32 crc2 = 0;
|
||||
|
||||
u32 tmp;
|
||||
|
||||
// CRC1: Iterate forwards over bytes
|
||||
for (p = start; (void *)p < end; p++)
|
||||
{
|
||||
for (p = start; (void *)p < end; p++) {
|
||||
seed += *p << (shift & 15);
|
||||
|
||||
tmp = func_8025C29C(&seed);
|
||||
|
||||
shift += 7;
|
||||
|
||||
crc1 ^= tmp;
|
||||
}
|
||||
|
||||
// CRC2: Iterate backwards over bytes
|
||||
for (p = (u8 *)end - 1; (void *)p >= start; p--)
|
||||
{
|
||||
for (p = (u8 *)end - 1; (void *)p >= start; p--) {
|
||||
seed += *p << (shift & 15);
|
||||
|
||||
tmp = func_8025C29C(&seed);
|
||||
|
||||
shift += 3;
|
||||
|
||||
crc2 ^= tmp;
|
||||
}
|
||||
|
Reference in New Issue
Block a user