Start replay loading

This commit is contained in:
Miloslav Ciz 2025-01-19 22:19:44 +01:00
parent 71aa8156e9
commit 17a371fdca
4 changed files with 169 additions and 16 deletions

View file

@ -42,4 +42,26 @@ int _LCR_hexDigitVal(char c)
return -1;
}
/**
Computes simple hash of a string represented by a function returning next
string character, ending at 0 or endChar. This is intended for simple (but
not 100% reliable) string comparison.
*/
uint16_t _LCR_simpleStrHash(char (*nextChar)(void), char endChar)
{
uint16_t r = 0;
while (1)
{
char c = nextChar();
if (c == 0 || c == endChar)
break;
r = ((r << 5) | (r >> 11)) + c;
}
return r;
}
#endif // guard