code wiki / (root) / nx_kkfacts_lib.nx

nx_kkfacts_lib.nx

buildroot/runtime/nx_kkfacts_lib.nx

8653 B169 linesdepth 3pulls 3 transitivereach 14 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_kkfacts_lib.nx -- KOIKATSU CARD FACT EXTRACTION CORE (the Honey Select / Koikatsu card study's first organ; benchmark card KK_396262 measured 2026-08-04). A Koikatsu card is a PNG portrait with the CHARACTER DEFINITION appended after IEND: the KoiKatuChara marker, then MessagePack block structures (Custom = face/body/hair, Coordinate = outfits, Parameter, Status, KKEx = modded extended data). This core reads STRUCTURE ONLY: portrait bounds + dims, payload size, marker, block-name census. Slider values and names stay unread in v1 -- the deep (msgpack) rung comes with the k>=8 card study, and per-card creative content never enters the published plane (one card = one creator; the k-wall exists for this). ★THE CARD FORMAT CARRIES NO MOTION: coordinates are OUTFITS, not animations -- motion lives in the game engine, not the artifact. A fact this lane's compare page states outright. Slots: [0] is_card [1] portrait_bytes [2] portrait_w [3] portrait_h [4] payload_bytes [5] custom [6] coordinate [7] parameter [8] status [9] kkex (-1 = not measured) license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 7 importers

nx_syscalls.nx nx_img_dims.nx nx_kkfacts_lib.nx nx_bspfacts_lib.nx nx_ingest_audit.nx nx_kkfacts.nx nx_kkfacts_gate.nx nx_kkslider_stats.nx nx_mhtarget_lib.nx nx_nif_lib.nx

imports: nx_syscalls.nxnx_img_dims.nx

imported by: nx_bspfacts_lib.nxnx_ingest_audit.nxnx_kkfacts.nxnx_kkfacts_gate.nxnx_kkslider_stats.nxnx_mhtarget_lib.nxnx_nif_lib.nx

structs

none

consts

18const KK_MAGIC_4096: i64 = 4096
20const KK_N_SLOTS: i64 = 10
111const KK_MP_FIXARRAY_BASE: i64 = 0x90 // msgpack fixarray tag; low nibble carries the count
112const KK_MP_TAG_HI_MASK: i64 = 0xf0
113const KK_MP_TAG_LO_MASK: i64 = 0x0f
114const KK_MP_ARRAY16: i64 = 0xdc // BE16 count follows
115const KK_MP_F32: i64 = 0xca // 4 BE bytes follow
116const KK_MP_F32_SPAN: i64 = 5 // tag + 4 payload bytes
117const KK_F32_EXP_BIAS: i64 = 127
118const KK_F32_EXP_MASK: i64 = 255
119const KK_F32_MANT_BITS: i64 = 23
120const KK_F32_MANT_MASK: i64 = 8388607
121const KK_F32_MANT_ONE: i64 = 8388608
122const KK_PERMIL: i64 = 1000
123const KK_SHIFT_SAFE_HI: i64 = 30 // beyond this a left-shift of mant*1000 overflows i64 headroom
124const KK_SHIFT_SAFE_LO: i64 = 62 // beyond this a right-shift underflows to 0 anyway

functions

22func kk_b(buf: *u8, o: i64) -> i64 { return buf[o] as i64 & 0xff }
23func kk_find(buf: *u8, start: i64, end: i64, needle: *u8) -> i64
35func kk_count(buf: *u8, start: i64, end: i64, needle: *u8) -> i64
52func kk_probe_marker(buf: *u8, n: i64, file_size: i64, facts: *i64, marker: *u8) -> i64
85func kk_probe(buf: *u8, n: i64, file_size: i64, facts: *i64) -> i64
called by 4: mainmainmainmain calls 1: kk_probe_marker
96func kk_probe_aishoujo(buf: *u8, n: i64, file_size: i64, facts: *i64) -> i64
called by 2: mainmain calls 1: kk_probe_marker
126func kk_f32_permil(w: i64) -> i64
143func kk_decode_sliders(buf: *u8, start: i64, end: i64, key: *u8, out: *i64, outcap: i64, meta: *i64) -> i64