Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

483 B
Raw Blame
/* The pictures and fonts in data.bin: "HCRD", their counts, then where each one starts. */
#include "res.h"

static uint32_t rd32(const uint8_t *p) { return p[0] | p[1] << 8 | p[2] << 16 | (uint32_t)p[3] << 24; }

const Img *img(int id) {
  return (const Img *)(const void *)(hc_data + rd32(hc_data + 16 + 4 * id));
}

const Font *font(int id) {
  uint32_t nimg = rd32(hc_data + 4);
  return (const Font *)(const void *)(hc_data + rd32(hc_data + 16 + 4 * (nimg + (uint32_t)id)));
}