cpu_model(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– cpu_model(3) πŸ’–

ok so bestie, welcome to the Allegro manual, cpu_model edition β€” she's a global int, she's a whole personality, and she's here to tell you exactly which CPU you're running on. 🌸


✨ NAME ✨

cpu_model β€” contains the Intel CPU submodel. It's part of the Allegro game programming library. πŸŽ€


🌈 SYNOPSIS 🌈

#include <allegro.h>

extern int cpu_model;

like… that's it. one include, one extern int. she's lowkey humble. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so cpu_model holds the CPU submodel, where applicable. (the "where applicable" is doing a lot of heavy lifting there ngl β€” some chips just don't have a submodel and that's their business.)

Allegro defines at least these CPU family types β€” and if you want the full list, go peek at include/allegro/system.h, she has the receipts: πŸ‘‘

  • CPU_FAMILY_I586:
    • CPU_MODEL_PENTIUM, CPU_MODEL_K5, CPU_MODEL_K6
  • CPU_FAMILY_I686:
    • CPU_MODEL_PENTIUMPRO, CPU_MODEL_PENTIUMII, CPU_MODEL_PENTIUMIIIKATMAI, CPU_MODEL_PENTIUMIIICOPPERMINE, CPU_MODEL_ATHLON, CPU_MODEL_DURON
  • CPU_FAMILY_EXTENDED:
    • CPU_MODEL_PENTIUMIV, CPU_MODEL_XEON, CPU_MODEL_ATHLON64, CPU_MODEL_OPTERON
  • CPU_FAMILY_POWERPC:
    • CPU_MODEL_POWERPC_x, for x=601-604, 620, 750, 7400, 7450
🫢 bestie listen: you can only read this variable after you've called check_cpu() β€” which, good news, allegro_init() calls for you automatically, so she's basically already handled it. no extra work, periodt.

and please please PLEASE make sure you check cpu_family and cpu_vendor too, because otherwise you're out here checking models that literally make zero sense for your chip. it's giving "asked the wrong question." 😭 match the family first, then check the model. that's the vibe check. βœ…


πŸ’œ SEE ALSO πŸ’œ


aaaand that's the whole page, bestie!! πŸ₯³ this was Allegro version 4.4.3, and yes she's still serving cpu_model(3) energy in the year of our lord. go forth and interrogate your silicon. πŸ’–βœ¨πŸ§š

πŸ“¦ where this page comes from