/* * pop_geom.c — общая геометрия + PRNG оригинала. См. pop_geom.h. */ #include "pop_geom.h" /* data.h: шаг 14 (ширина тайла в координатах персонажа), [5] = col 0. */ const int16_t pop_x_bump[20] = { -12, 2, 16, 30, 44, 58, 72, 86, 100, 114, 128, 142, 156, 170, 184, 198, 212, 226, 240, 254 }; const int16_t pop_y_land[5] = {-8, 55, 118, 181, 244}; int8_t pop_y_to_row(int16_t y) { return (int8_t)((y + 60) / TILE_SIZEY % 4 - 1); } uint16_t pop_prandom(unsigned long *seed, uint16_t maxv) { unsigned long s = *seed * 214013UL + 2531011UL; *seed = s; return (uint16_t)((uint16_t)(s >> 16) % (uint16_t)(maxv + 1)); }