remove "done" folders, label "bs/droneenter, bs/dronelook, and bs/dronevanish files and functions"

This commit is contained in:
Banjo Kazooie
2023-01-21 20:13:03 -06:00
parent 0ecaa54b4a
commit c004632915
190 changed files with 645 additions and 644 deletions

47
src/core1/io/crc.c Normal file
View File

@@ -0,0 +1,47 @@
#include <os_internal.h>
u8 __osContAddressCrc(u16 addr)
{
u8 temp;
u8 temp2;
int i;
temp = 0;
for (i = 0; i < 16; i++)
{
if (temp & 0x10)
temp2 = 21;
else
temp2 = 0;
temp <<= 1;
temp |= (u8)((addr & 0x400) ? 1 : 0);
addr <<= 1;
temp ^= temp2;
}
return temp & 0x1f;
}
u8 __osContDataCrc(u8 *data)
{
u8 temp;
u8 temp2;
int i;
int j;
temp = 0;
for (i = 0; i <= 32; i++, data++)
{
for (j = 7; j >= 0; j--)
{
if (temp & 0x80)
temp2 = 133;
else
temp2 = 0;
temp <<= 1;
if (i == 32)
temp &= -1;
else
temp |= ((*data & (1 << j)) ? 1 : 0);
temp ^= temp2;
}
}
return temp;
}