code wiki / _hdl_build / nx_wasm_craft_journal_index_t21.nx
nx_wasm_craft_journal_index_t21.nx
buildroot/runtime/_hdl_build/nx_wasm_craft_journal_index_t21.nx
about
nx_wasm_craft.nx -- NISHI CRAFT: a GENERATED 3D VOXEL WORLD, playable first-person. The operator's
2026-05-19 vision ("build minecraft equivalent on the lowest possible hardware") finally EMITTING:
procedural terrain (integer value-noise heightmap, biome banding, water, trees) in a 64x32x64 block
grid, rendered by a per-pixel integer DDA raycast (true 3D: block faces, face shading, distance fog,
sky), walked in first person (collision, auto-step-up, water float), and EDITED live (break/place at
the crosshair). Every pixel and every world byte is NishiLang; base-relative so the identical code
runs natively (gate, PNG proof) and as wasm (browser page); input arrives through nx_input_abstract
(keyboard/gamepad/touch all work on day one).
Controls (via the input layer's semantic actions): W/S or Up/Down = walk, A/D or Left/Right = turn,
R/F = look up/down (bound to the MENU/PAUSE bits -- the 8-action mask is fully spent; widening it
to 16 actions is the filed follow-up), E = break block, B = place stone. Touch d-pad works: center
tap = break.
license_tier: ORIGINAL
dependencies 19 imports · 6 importers
diagram shows first 10 each side; +9 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_itrig.nxnx_input_abstract.nxnx_atmosphere.nxnx_weather_lib.nxnx_softbind.nxnx_skeleton.nxnx_skin_ita.nxnx_nxa_anim_lib.nxnx_morf_draw_core.nxnx_nxa_morf_draw_admit.nxnx_entity_store.nxnx_gamesave_core.nxnx_indoorgen_data.nxnx_worldpipe_core.nxnx_genp_allow_lib.nxnx_perf_lib.nxnx_beach_release_recipe.nxnx_beach_contact_sweep.nx
imported by: nx_beach_npc_origin_contact_gate_t43.nxnx_beach_npc_residency_canonical_gate_t44.nxnx_beach_wasm_residency_gate_t45.nxnx_craft_journal_index_gate_t21.nxnx_craft_save_input_gate_t21.nxnx_craft_save_recovery_gate_t21.nx
structs
| none |
consts
| 44 | const WATER_MAGIC_16777216: i64 = 16777216 |
| 45 | const EJRN_HASH_MUL: i64 = 40503 |
| 46 | const WATER_MAGIC_33554431: i64 = 33554431 |
| 47 | const TERRAIN_HASH_X: i64 = 374761393 |
| 48 | const TERRAIN_HASH_Z: i64 = 668265263 |
| 49 | const TERRAIN_HASH_SEED: i64 = 1442695041 |
| 50 | const SAVE_CK_MASK: i64 = 4611686018427387903 |
| 51 | const TERRAIN_HASH_MIX: i64 = 1274126177 |
| 52 | const RAY_HUGE: i64 = 1099511627776 |
| 53 | const WATER_MAGIC_65536: i64 = 65536 |
| 54 | const WATER_MAGIC_4096: i64 = 4096 |
| 55 | const WATER_MAGIC_1048576: i64 = 1048576 |
| 56 | const WATER_MAGIC_1536: i64 = 1536 |
| 57 | const WATER_MAGIC_6144: i64 = 6144 |
| 58 | const GENE_MASK_TEMPERAMENT: i64 = 57344 |
| 59 | const SAVE_CK_SEED: i64 = 1469598103 |
| 60 | const SAVE_CK_PRIME: i64 = 1099511 |
| 61 | const WATER_MAGIC_2400: i64 = 2400 |
| 62 | const WATER_MAGIC_2500: i64 = 2500 |
| 63 | const WATER_MAGIC_1400: i64 = 1400 |
| 64 | const CRAFT_DEFAULT_SEED: i64 = 20260728 |
| 105 | const W: i64 = 1920 |
| 106 | const H: i64 = 1200 |
| 107 | const WASM_PAGE_BYTES: i64 = 65536 |
| 113 | const WASM_PAGES: i64 = 364 |
| 114 | const WASM_MEM_BYTES: i64 = WASM_PAGES * WASM_PAGE_BYTES |
| 126 | const RES: i64 = 2 // ray per RESxRES pixel block (240x150 rays) |
| 127 | const RW: i64 = 240 |
| 128 | const RH: i64 = 150 |
| 129 | const FOC: i64 = 120 // ~90 degree fov at RW=240 |
| 134 | const Q_MAX: i64 = 24 |
| 135 | const Q_START: i64 = 5 |
| 152 | const FB_COLOR_MASK: i64 = 16777215 |
| 153 | const FB_DEPTH_SHIFT: i64 = 32 |
| 154 | const FB_DEPTH_MAX: i64 = 16777215 |
| 160 | const HUD_DESIGN_W: i64 = 480 |
| 161 | const HUD_PIP_MAX: i64 = 24 |
| 162 | const HUD_HOTBAR_N: i64 = 7 |
| 164 | const WX: i64 = 128 // world blocks (v2: 4x the area, taller) |
| 165 | const WY: i64 = 48 |
| 166 | const WZ: i64 = 128 |
| 167 | const WATER_H: i64 = 9 |
| 171 | const B_FARM: i64 = 12 // tilled farmland, dry |
| 172 | const B_CROP0: i64 = 13 // crop sprout (placed by SEEDS onto farmland) |
| 173 | const B_CROP1: i64 = 14 // crop growing |
| 174 | const B_CROP2: i64 = 15 // crop MATURE -- breaking it is the HARVEST |
| 175 | const B_FARMW: i64 = 16 // farmland, wet (rain or water within the 5x5 ring) |
| 181 | const O_FB: i64 = 3592832 // W*H i64 packed R|G<<8|B<<16 (at the arena tail; see CRAFT_TOTAL) |
| 182 | const O_ST: i64 = 1152000 // 64 state slots |
| 183 | const O_INPUT: i64 = 1152512 // nx_input_abstract arena (64 words) |
| 184 | const O_VOX: i64 = 1153024 // WX*WY*WZ u8 blocks |
| 185 | const O_MOBS: i64 = 1939456 // nx_entity_store arena (certified part): en_bytes(16,7)=1632 |
| 186 | const MOB_CAP: i64 = 16 |
| 187 | const MOB_NCOMP: i64 = 7 |
| 188 | const MOB_BYTES: i64 = 1632 |
| 189 | const O_SPEC: i64 = 1941120 // GAME SPEC block (64 words) -- AFTER the arena's 1632B end |
| 190 | const O_EJRN: i64 = 1941760 // EDIT JOURNAL: 8192 packed i64 hash slots at ABSOLUTE world |
| 192 | const EJRN_SLOTS: i64 = 8192 |
| 193 | const EJRN_BYTES: i64 = 65536 |
| 194 | const O_SAVE: i64 = 2730336 // v6 save image (relocated past MOBAUX): 128B header + voxels |
| 197 | const SAVE_HDR: i64 = 128 |
| 198 | const SAVE_BODY: i64 = 853600 // WX*WY*WZ + MOB_BYTES + EJRN_BYTES |
| 199 | const SAVE_BODY_V5: i64 = 788064 // pre-streaming body (load-compat: v5 saves still open) |
| 200 | const SAVE_LEN: i64 = 853728 // SAVE_HDR + SAVE_BODY |
| 201 | const CRAFT_BYTES: i64 = 3584064 // O_SAVE + SAVE_LEN |
| 202 | const O_MOBAUX: i64 = 2729952 // 16 mobs x (dx,dz,dy) last-applied step, i64 triples |
| 220 | const O_MOBHDG: i64 = 2729696 |
| 221 | const O_MOBVY: i64 = 2729824 // GE12: 16 mobs x 1 word VERTICAL VELOCITY Q8/tick (128B, the slack |
| 226 | const O_SOFT: i64 = 3584064 // A4 soft-body springs: 16 mobs x SB_PTS(6, R7 regions) x SD_STRIDE words. |
| 229 | const O_NEED: i64 = 3588672 // C1 needs: 16 mobs x 4 words (hunger, energy, social, spare). |
| 231 | const O_MIND: i64 = 3589184 // C3/C5 THE INNER LIFE: 16 girls x 24 words -- 8 THOUGHT |
| 236 | const O_PASS: i64 = 3592256 // THE TRAVELER'S PASSPORT (the isekai carry): the |
| 242 | const PASS_MAGIC: i64 = 20260802001 |
| 243 | const PASS_LEN: i64 = 192 // 24 wire words: [0]magic [1]ver [2]charseed [3]broken |
| 248 | const O_GENP: i64 = 3592640 // W1c GEN-TIME RECIPE OVERRIDES (192B): [0] magic, [1] n, |
| 254 | const GENP_MAGIC: i64 = 20260813001 |
| 255 | const GENP_MAXP: i64 = 11 |
| 265 | const O_RIG: i64 = O_FB + W*H*8 |
| 269 | const RIG_BYTES: i64 = 188736 |
| 270 | const O_PROJ: i64 = O_RIG + RIG_BYTES |
| 271 | const PROJ_MAXV: i64 = 211 // projected-vertex slots == RIG_VERT_TOTAL (declared beside the |
| 278 | const PROJ_BYTES: i64 = PROJ_MAXV * 24 |
| 279 | const O_SKIN3: i64 = O_PROJ + PROJ_BYTES // 3-word sRGB scratch for nx_skin_ita's out3 (wasm has no |
| 302 | const WC_CAST_N: i64 = 12 // the cast genmobs places (placed < WC_CAST_N); hair state is sized to it |
| 303 | const HG_MOBS: i64 = WC_CAST_N |
| 304 | const HG_NP: i64 = 8 // points per HSTR strand: the section contract (GR_PTS in nx_nxa_groom) |
| 305 | const HG_W: i64 = HG_NP*3 // words per strand (GR_WORDS) |
| 306 | const HG_NSEG: i64 = HG_NP - 1 |
| 307 | const HG_REND_MAX: i64 = 1200 // render strands: the page's shipped NXH_GUIDES budget, PRESERVED and moved here |
| 308 | const HG_SIM: i64 = 128 // simulated guides per girl. PICKED, named as picked: 1200/128 = 9.4 render |
| 312 | const HG_TEX_SR: i64 = 4 // strands per guide-texture row: rows = strands/4 keep every hair texture under |
| 314 | const HG_TAB_W: i64 = 8 // render-strand table row: [rest-idx nb1 nb2 w1 w2 lockw spanz 0] |
| 315 | const HG_CAP_MAX: i64 = 32 // collider slots (mask bits): head neck 2 shoulders 2 arms torso + DYNA anchors |
| 316 | const HG_CAP_W: i64 = 10 // ax ay az bx by bz r kind sx sy |
| 317 | const HG_KIND_CAP: i64 = 0 |
| 318 | const HG_KIND_ELL: i64 = 1 |
| 319 | const HG_Q12: i64 = WATER_MAGIC_4096 // ellipse-scale / segment-parameter fixed point: the engine's fx4096 |
| 320 | const HG_SKEL_W: i64 = 8 // words per SKEL joint: parent x y z + 4 (the 64-byte joint record the page reads) |
| 321 | const HG_DYNA_MINW: i64 = 8 // a DYNA row carries side x y z k c max infl before an anchor is readable |
| 322 | const HG_DYNA_MAXW: i64 = 64 // a row wider than this is not this format (nx_nxa_dyna writes 12); bounds the count check |
| 323 | const HG_DYNA_INFL: i64 = 7 // DYNA word: influence radius (nx_nxa_dyna payload layout) |
| 324 | const HG_HDR_BYTES: i64 = 512 |
| 325 | const HG_H_LOADED: i64 = 0 |
| 326 | const HG_H_NSTR: i64 = 1 |
| 327 | const HG_H_NREND: i64 = 2 |
| 328 | const HG_H_NSIM: i64 = 3 |
| 329 | const HG_H_SKIN: i64 = 4 |
| 330 | const HG_H_LOCKW: i64 = 5 |
| 331 | const HG_H_NCAP: i64 = 6 |
| 332 | const HG_H_SEGLEN: i64 = 7 |
| 333 | const HG_H_SPAN: i64 = 8 |
| 334 | const HG_H_TICKS: i64 = 9 |
| 335 | const HG_H_PUSHES: i64 = 10 |
| 336 | const HG_H_INSIDE: i64 = 11 |
| 337 | const HG_H_MAXDISP: i64 = 12 |
| 338 | const HG_H_H: i64 = 13 |
| 339 | const HG_H_ZMN: i64 = 14 |
| 340 | const HG_H_HJ: i64 = 15 |
| 341 | const HG_H_RC: i64 = 16 |
| 342 | const HG_H_NOCOLL: i64 = 17 // gate lever: 1 skips the push-out (the neg-control that proves it fires) |
| 343 | const HG_H_RESTIN: i64 = 18 // rest nodes inside a collider BODY at load: the clipping the operator sees at rest |
| 344 | const HG_H_WINDOFF: i64 = 19 // gate lever: 1 ignores the wind field |
| 345 | const HG_H_GUST: i64 = 20 |
| 346 | const HG_H_TICKED: i64 = 21 // girls ticked on the last hairtick |
| 347 | const HG_RC_NOSTR: i64 = 0 - 1 // load refusals, each naming its conjunct |
| 348 | const HG_RC_HSTRCAP: i64 = 0 - 2 |
| 349 | const HG_RC_NOVERT: i64 = 0 - 3 |
| 350 | const HG_RC_VERTCAP: i64 = 0 - 4 |
| 351 | const HG_RC_NOSKEL: i64 = 0 - 5 |
| 352 | const HG_RC_SKELCAP: i64 = 0 - 6 |
| 354 | const O_HGHDR: i64 = O_SKIN3 + 24 |
| 355 | const O_HGREST: i64 = O_HGHDR + HG_HDR_BYTES |
| 356 | const O_HGRL: i64 = O_HGREST + HG_REND_MAX*HG_W*8 |
| 357 | const O_HGCAP: i64 = O_HGRL + HG_SIM*HG_NSEG*8 |
| 358 | const O_HGMASK: i64 = O_HGCAP + HG_CAP_MAX*HG_CAP_W*8 |
| 359 | const O_HGSIMIDX: i64 = O_HGMASK + HG_SIM*8 |
| 360 | const O_HGTAB: i64 = O_HGSIMIDX + HG_SIM*8 |
| 361 | const HG_BLK_BYTES: i64 = HG_MOBS*HG_SIM*HG_W*8 |
| 362 | const O_HGX: i64 = O_HGTAB + HG_REND_MAX*HG_TAB_W*8 // positions |
| 363 | const O_HGP: i64 = O_HGX + HG_BLK_BYTES // previous positions (velocity = X - P) |
| 364 | const O_HGD: i64 = O_HGP + HG_BLK_BYTES // THE EXPORT: displacement from rest, the buffer the page copies per frame |
| 365 | const O_HGSCR: i64 = O_HGD + HG_BLK_BYTES // solver scratch: correction (HG_W) + collider probe (6) + point (3) |
| 366 | const HG_SCR_WORDS: i64 = HG_W + 9 |
| 369 | const O_PERF: i64 = O_HGSCR + HG_SCR_WORDS*8 |
| 376 | const O_TILE: i64 = O_PERF + PF_WORDS*8 |
| 377 | const TILE_W: i64 = 32 // i64 words per worker slot |
| 378 | const TILE_HOUT: i64 = 8 // word offset of the 5 wray outs inside a slot |
| 379 | const TILE_MAX: i64 = 32 // the most workers a band pass may be cut into; the thread ladder |
| 396 | const O_HQ: i64 = O_TILE + TILE_MAX*TILE_W*8 |
| 397 | const HQ_BYTES: i64 = WX*WZ*8 |
| 398 | const O_URAW: i64 = O_HQ + HQ_BYTES |
| 399 | const URAW_WORDS: i64 = 44 // GE53: 41 words (r_surf at 40) padded to the vec4u boundary |
| 400 | const URAW_BYTES: i64 = 176 // URAW_WORDS*4: a vec4u-aligned struct, so the 3-word tail pad is real (was 160 beside WORDS=44 -- pack_uniforms zeroed 176 B into a 160 B block; corrected 2026-09-06 when the GE53 shader shipped its 41-word struct) |
| 401 | const UR_CAMX: i64 = 0 // Q8 world units (the page used camx()/256) |
| 402 | const UR_CAMY: i64 = 1 |
| 403 | const UR_CAMZ: i64 = 2 |
| 404 | const UR_TNOW: i64 = 3 |
| 405 | const UR_YAW: i64 = 4 // Q12 radians (the page used yaw()/4096) |
| 406 | const UR_PITCH: i64 = 5 |
| 407 | const UR_SUNEL: i64 = 6 // Q12 sine of the sun elevation (cal_sunel) |
| 408 | const UR_DAYT: i64 = 7 |
| 409 | const UR_DLEN: i64 = 8 |
| 410 | const UR_RAIN: i64 = 9 |
| 411 | const UR_SKT: i64 = 10 // packed RGB (spec word 7) |
| 412 | const UR_SKH: i64 = 11 // packed RGB (spec word 8) |
| 413 | const UR_SUN: i64 = 12 // spec word 9 (the GPU applies the df>.04 daylight guard) |
| 414 | const UR_CLD: i64 = 13 // spec word 10 |
| 415 | const UR_WMAX: i64 = 14 |
| 416 | const UR_SELB: i64 = 15 // sel_block(S_SEL) |
| 417 | const UR_HOK: i64 = 16 |
| 418 | const UR_NPCT: i64 = 17 // npc target t, or -1 |
| 419 | const UR_BROKEN: i64 = 18 // edit counters (broken + placed): the bridge refreshes the voxel texture when their sum moves |
| 420 | const UR_PLACED: i64 = 19 |
| 421 | const UR_PAL: i64 = 20 // 12 packed RGB words (spec 16..27), vec4u-aligned at byte 80 |
| 422 | const UR_PALF: i64 = 32 // 5 packed RGB words (spec 34..38) at byte 128 |
| 423 | const UR_RESW: i64 = 37 // canvas width in px -- the door tells the sim through set_res (the sim has no window) |
| 424 | const UR_RESH: i64 = 38 |
| 425 | const UR_SURF: i64 = 40 // Continuous terrain representation. |
| 426 | const UR_WATER_Q8: i64 = 41 // Water surface from P_WATER, Q8 world units; words42..43 remain padding. |
| 427 | const UR_YFLIP: i64 = 39 // 1 on the WebGPU door (top-left fragment origin), 0 on WebGL2 -- set_yflip |
| 430 | const CONTACT_BOX_WORDS: i64 = 6 |
| 431 | const CONTACT_RESULT_WORDS: i64 = 3 |
| 432 | const CONTACT_STATE_WORDS: i64 = 3 |
| 433 | const O_CONTACT: i64 = O_URAW + URAW_BYTES |
| 435 | const EJ_INDEX_BUCKETS: i64 = EJRN_SLOTS*2 |
| 436 | const O_EJ_INDEX: i64 = O_CONTACT + (2*CONTACT_BOX_WORDS+CONTACT_RESULT_WORDS+CONTACT_STATE_WORDS)*8 |
| 437 | const O_EJ_NEXT: i64 = O_EJ_INDEX + EJ_INDEX_BUCKETS*8 |
| 438 | const CRAFT_TOTAL: i64 = O_EJ_NEXT + EJRN_SLOTS*8 |
| 453 | const NXA_NJ_CAP: i64 = 128 // ref9e 104 joints; the corpus tops out at 370 (nx_nxa_play) = the next rung |
| 454 | const NXA_ANIM_CAP_W: i64 = 131072 // 1 MiB of key words; ref9e ANIM measured 113,465 words |
| 455 | const NXA_POSE_CAP_W: i64 = 2048 // ref9e POSE measured 835 words (one frozen stand pose) |
| 456 | const NXA_HDR_W: i64 = 16 |
| 457 | const NXA_H_LOADED: i64 = 0 |
| 458 | const NXA_H_NJ: i64 = 1 |
| 459 | const NXA_H_DUR: i64 = 2 |
| 460 | const NXA_H_MPB: i64 = 3 |
| 461 | const NXA_H_RJ: i64 = 4 |
| 462 | const NXA_H_POSE: i64 = 5 |
| 463 | const NXA_H_RV: i64 = 6 // six words: x0 y0 vx16 vy16 t0 span (nx_nxa_anim_lib NA_RV_W) |
| 464 | const NXA_H_RC: i64 = 12 |
| 465 | const NXA_H_NAW: i64 = 13 |
| 467 | const NXA_H_NPW: i64 = 14 |
| 468 | const NXA_H_MORF_TOKEN: i64 = 15 |
| 469 | const NXA_MOB_W: i64 = 4 // per girl: idle weight q12, clip-time adjustment ms, two spare |
| 470 | const NXA_M_IW: i64 = 0 |
| 471 | const NXA_M_CTADJ: i64 = 1 |
| 475 | const NXA_IW_IN_TENTHS_PER_S: i64 = 50 |
| 476 | const NXA_IW_OUT_TENTHS_PER_S: i64 = 25 |
| 477 | const NXA_SNAP_TENTHS_PER_S: i64 = 60 |
| 478 | const NXA_SNAP_IW_MAX_Q12: i64 = 3891 |
| 479 | const NXA_IW_FLOOR_Q12: i64 = 16 |
| 480 | const NXA_DT_MS_MAX: i64 = 1000 // a tab that slept a minute eases one second, it does not slam |
| 481 | const NXA_RC_NOT_LOADED: i64 = 0 - 1 |
| 482 | const NXA_RC_NO_MOB: i64 = 0 - 2 |
| 483 | const NXA_RC_SLOT: i64 = 0 - 3 |
| 484 | const NXA_RC_NJ_ZERO: i64 = 0 - 11 |
| 485 | const NXA_RC_NJ_CAP: i64 = 0 - 12 |
| 486 | const NXA_RC_NAW_ZERO: i64 = 0 - 13 |
| 487 | const NXA_RC_NAW_CAP: i64 = 0 - 14 |
| 488 | const NXA_RC_NPW_CAP: i64 = 0 - 15 |
| 489 | const NXA_RC_POSE_OVERRUN: i64 = 0 - 16 |
| 490 | const NXA_RC_TRACKS: i64 = 0 - 20 // plus nx_nxa_anim_lib's own rc: -21 bad tracks, -22 overrun |
| 495 | const CRAFT_STATIC_RESERVE_PAGES: i64 = 1 |
| 496 | const CRAFT_STATIC_BASE_PAGES: i64 = WASM_PAGES |
| 497 | const CRAFT_STATIC_LIMIT_PAGES: i64 = CRAFT_STATIC_BASE_PAGES+CRAFT_STATIC_RESERVE_PAGES |
| 498 | const CRAFT_STATIC_BASE: i64 = CRAFT_STATIC_BASE_PAGES*WASM_PAGE_BYTES |
| 499 | const CRAFT_STATIC_LIMIT: i64 = CRAFT_STATIC_LIMIT_PAGES*WASM_PAGE_BYTES |
| 500 | const O_NXA: i64 = CRAFT_STATIC_LIMIT |
| 501 | const O_NXA_SKEL: i64 = O_NXA + NXA_HDR_W*8 |
| 502 | const O_NXA_TIDX: i64 = O_NXA_SKEL + NXA_NJ_CAP*NA_SKEL_W*8 |
| 503 | const O_NXA_PQ: i64 = O_NXA_TIDX + NXA_NJ_CAP*NA_IDX_W*8 |
| 504 | const O_NXA_PD: i64 = O_NXA_PQ + NXA_NJ_CAP*4*8 |
| 505 | const O_NXA_MOB: i64 = O_NXA_PD + NXA_NJ_CAP*3*8 |
| 506 | const O_NXA_SCR: i64 = O_NXA_MOB + WC_CAST_N*NXA_MOB_W*8 |
| 507 | const O_NXA_OUT: i64 = O_NXA_SCR + NA_SCR_W*8 |
| 508 | const O_NXA_POSE: i64 = O_NXA_OUT + WC_CAST_N*NXA_NJ_CAP*NA_ROW_W*8 |
| 509 | const O_NXA_ANIM: i64 = O_NXA_POSE + NXA_POSE_CAP_W*8 |
| 511 | const O_NXA_ORDER: i64 = O_NXA_ANIM + NXA_ANIM_CAP_W*8 |
| 512 | const CRAFT_EXT_TOTAL: i64 = O_NXA_ORDER + NXA_NJ_CAP*8 |
| 514 | const WASM_PAGES_REQ: i64 = (CRAFT_EXT_TOTAL + WASM_PAGE_BYTES - 1)/WASM_PAGE_BYTES |
| 520 | const HG_MIB: i64 = 1048576 |
| 521 | const HG_SCR_HSTR: i64 = O_FB |
| 522 | const HG_SCR_HSTR_CAP: i64 = 4*HG_MIB |
| 523 | const HG_SCR_VERT: i64 = O_FB + 4*HG_MIB |
| 524 | const HG_SCR_VERT_CAP: i64 = 8*HG_MIB |
| 525 | const HG_SCR_SKEL: i64 = O_FB + 12*HG_MIB |
| 526 | const HG_SCR_SKEL_CAP: i64 = 2*HG_MIB |
| 527 | const HG_SCR_DYNA: i64 = O_FB + 14*HG_MIB |
| 528 | const HG_SCR_DYNA_CAP: i64 = HG_MIB |
| 530 | const HG_TPS: i64 = 60 // see the header: the page accumulator's 16.6667 ms, hd_ticks_per_s() |
| 531 | const HG_UNITS_PER_178CM: i64 = 171530 // the page's pairing (GPE_UNITS_PER_178CM), named as the same number |
| 532 | const HG_CM_178: i64 = 178 |
| 533 | const HG_CM_PER_M: i64 = 100 |
| 534 | const HG_UPB: i64 = HG_UNITS_PER_178CM*HG_CM_PER_M/HG_CM_178 // bind units per world block (1 block = 1 m): 96365 |
| 535 | const HG_G_CMS2: i64 = 981 // standard gravity, cm/s^2 |
| 536 | const HG_G: i64 = HG_G_CMS2*HG_UNITS_PER_178CM/(HG_CM_178*HG_TPS*HG_TPS) // 262 units/tick^2 -- the dress lane's NXGD_G derivation |
| 537 | const HG_FTL_S_PERMIL: i64 = 1000 - SB_C_HAIR*1000/SD_G // DFTL s_damping (Mueller 2012 "Fast Simulation of Inextensible Hair |
| 539 | const HG_FENCE_DIV: i64 = 4 // the chain's small-angle validity fence: seglen/4 (SD_Q8/4 in the retired page solver) |
| 540 | const HG_PROJ_ITERS: i64 = 3 // length/collision alternations per point; the LAST op is always the length projection |
| 541 | const HG_LOCK_W_MIN: i64 = 900 // the ribbon builder's lock half-width floor (w09 = max(900, span*.045)), PRESERVED |
| 542 | const HG_LOCK_W_PERMIL: i64 = 45 |
| 543 | const HG_SKIN_NUM: i64 = 16 // skin = lockw x 1.6: half-width + the .6 child scatter -- the farthest a render vertex sits off its guide |
| 544 | const HG_SKIN_DEN: i64 = 10 |
| 545 | const HG_REACH_DIV: i64 = 2 // collider mask reach = strand length / 2: twice the static fence (L/4), for overshoot |
| 546 | const HG_GUST_TICKS: i64 = 2*HG_TPS // gust envelope cadence 0.5 Hz: the incumbent shader sway (3.1 rad/s), PRESERVED |
| 547 | const HG_GUST_SALT: i64 = 3400 // whash seed offset (the weather lib salts with seed + 3300) |
| 548 | const HG_TORSO_GATE_X: i64 = 15000 // the MFS torso gate (axb < 15000.), the same half-width the paint bands use |
| 550 | const HG_R_HEADBAND: i64 = 885 |
| 551 | const HG_R_HEAD_J: i64 = 955 |
| 552 | const HG_R_ACROMION: i64 = 818 |
| 553 | const HG_R_CHEST: i64 = 720 |
| 554 | const HG_R_HIP: i64 = 520 |
| 555 | const HG_R_ELBOW: i64 = 630 |
| 556 | const HG_R_NECK_LO: i64 = 840 |
| 557 | const HG_R_SH_LO: i64 = 770 |
| 558 | const HG_R_SH_HI: i64 = 860 |
| 559 | const HG_R_ARM_LO: i64 = 600 |
| 560 | const HG_R_ARM_HI: i64 = 800 |
| 561 | const HG_R_ARM_XMIN: i64 = 60 |
| 562 | const HG_R_ELBOW_XMIN: i64 = 50 |
| 565 | const TH_RAIN: i64 = 1 |
| 566 | const TH_FEAR: i64 = 2 |
| 567 | const TH_MET: i64 = 3 |
| 568 | const TH_SLEPT: i64 = 4 |
| 569 | const TH_HUNGRY: i64 = 5 |
| 570 | const TH_SAWTAKEN: i64 = 6 |
| 571 | const TH_HEARD_TAKEN: i64 = 7 |
| 572 | const TH_HEARD_FRIEND: i64 = 8 |
| 573 | const TH_COMPANY: i64 = 9 |
| 575 | const GO_FRIEND: i64 = 1 |
| 576 | const GO_TAKEN: i64 = 2 |
| 577 | const SAVE_MAGIC: i64 = 20260728001 |
| 578 | const SAVE_VER: i64 = 6 // v6 = STREAMING WORLD (origin + edit journal in the image); |
| 580 | const SAVE_VER5: i64 = 5 |
| 582 | const MC_X: i64 = 0 |
| 583 | const MC_Y: i64 = 1 |
| 584 | const MC_Z: i64 = 2 |
| 585 | const MC_KIND: i64 = 3 |
| 586 | const MC_PH: i64 = 4 |
| 587 | const MC_DISG: i64 = 5 // 1 = a HUMAN girl disguised as a monster girl (the lore: |
| 590 | const MC_GENE: i64 = 6 // 20-bit APPEARANCE GENOME rolled at spawn -- every girl is |
| 596 | const S_SEED: i64 = 0 |
| 597 | const S_CX: i64 = 1 // camera pos Q8 (256 = one block) |
| 598 | const S_CY: i64 = 2 |
| 599 | const S_CZ: i64 = 3 |
| 600 | const S_YAW: i64 = 4 // it-units (IT_PI = half turn) |
| 601 | const S_PITCH: i64 = 5 |
| 602 | const S_T: i64 = 6 |
| 603 | const S_BROKEN: i64 = 7 |
| 604 | const S_PLACED: i64 = 8 |
| 605 | const S_HX: i64 = 9 // crosshair DDA hit cache |
| 606 | const S_HY: i64 = 10 |
| 607 | const S_HZ: i64 = 11 |
| 608 | const S_HFACE: i64 = 12 // 0 none, 1 +x, 2 -x, 3 +y, 4 -y, 5 +z, 6 -z |
| 609 | const S_HOK: i64 = 13 // 1 = in reach |
| 610 | const S_VY: i64 = 14 // vertical velocity Q8/tick (jump + gravity) |
| 611 | const S_GROUNDED: i64 = 15 // 1 = standing on a surface (jump allowed) |
| 612 | const S_SEL: i64 = 16 // hotbar slot 0..4 (Q cycles; sel_block maps to a block type) |
| 613 | const S_LBX: i64 = 17 // last-broken cell (probes/particles; the hit cache retargets |
| 614 | const S_LBY: i64 = 18 // every frame, so "what did I just break" needs its own slots) |
| 615 | const S_LBZ: i64 = 19 |
| 616 | const S_Q: i64 = 20 // ray pixel size 2..5 -- ADAPTIVE: the organ tunes itself from |
| 617 | const S_FMA: i64 = 21 // the surface's reported frame ms (EMA x16); shim only reports |
| 618 | const S_WMAX: i64 = 22 // highest solid y in the world -- rays above it heading up/flat |
| 620 | const S_SPX: i64 = 23 // spawn point (H key + void-fall auto-respawn return here) |
| 621 | const S_SPY: i64 = 24 |
| 622 | const S_SPZ: i64 = 25 |
| 623 | const S_NPCT: i64 = 26 // crosshair NPC target: dense index of the girl under the |
| 625 | const S_FOUND: i64 = 27 // disguised humans FOUND (met + identified = under protection) |
| 626 | const S_LOST: i64 = 28 // found humans TAKEN by wardens (the cost of not protecting) |
| 627 | const S_BCD: i64 = 29 // birth cooldown ticks (community pacing) |
| 628 | const S_WOX: i64 = 30 // WORLD ORIGIN of the window, in blocks (v6 streaming): the |
| 629 | const S_WOZ: i64 = 31 // arena is a 128x48x128 CACHE over unbounded absolute terrain |
| 630 | const S_EJDROP: i64 = 32 // edits REFUSED because the journal was full (loud, never silent) |
| 631 | const S_HARV: i64 = 33 // MATURE crops harvested (the farming loop's payoff counter) |
| 632 | const S_PLANT: i64 = 34 // seeds planted |
| 633 | const S_GROWN: i64 = 35 // crops that reached maturity (world truth, gate-readable) |
| 634 | const S_VAR: i64 = 36 // which world identity this arena runs (the passport's |
| 636 | const S_GENP: i64 = 37 |
| 637 | const S_TGT: i64 = 38 // DISPLAY-DERIVED frame budget, EMA-x16 units (0 = shipped |
| 642 | const S_BLDG: i64 = 39 // W3 settlements: buildings stamped into this arena (a |
| 647 | const S_BLDGX: i64 = 40 // last-stamped building anchor, arena-local (gate probe) |
| 648 | const S_BLDGY: i64 = 41 // its floor height |
| 649 | const S_BLDGZ: i64 = 42 |
| 650 | const S_RESW: i64 = 44 // GE55: canvas size and origin, written by the door (set_res / set_yflip) |
| 651 | const S_RESH: i64 = 45 |
| 652 | const S_YFLIP: i64 = 46 |
| 653 | const S_AGEN: i64 = 47 |
| 654 | const S_DPAPPLIED: i64 = 48 // GE59: the P_DAYPHASE value last applied to S_T (0 = never) -- one re-base per distinct poke, never per tick // GE57: arena GENERATION -- +1 per wc_shift that moves. The GPU tiers key every voxel-texture upload on it: a 16-block re-base drawn against the previous texture is the transport/fall-through the operator sees (2026-09-05). |
| 655 | const S_GT_KEEP: i64 = 43 // ground-truth capture: when 1, render_impl leaves the depth plane in |
| 659 | const SHIFT_STRIDE: i64 = 16 // one window slide, in blocks |
| 660 | const SHIFT_MARGIN: i64 = 32 // player this close to a window edge -> the world slides under them |
| 663 | const P_TBASE: i64 = 0 // terrain base height |
| 664 | const P_TAMP1: i64 = 1 // large-noise amplitude |
| 665 | const P_TAMP2: i64 = 2 // detail-noise amplitude |
| 666 | const P_WATER: i64 = 3 // flood level |
| 667 | const P_SNOW: i64 = 4 // snow line (99 = never) |
| 668 | const P_TREE: i64 = 5 // tree sparsity modulus (0 = no trees) |
| 669 | const P_CAVETH: i64 = 6 // cave carve threshold (lower = more cavern) |
| 670 | const P_SKYTOP: i64 = 7 // packed zenith colour |
| 671 | const P_SKYHOR: i64 = 8 // packed horizon colour |
| 672 | const P_SUN: i64 = 9 // 1 = sun disc |
| 673 | const P_CLOUD: i64 = 10 // 1 = cloud deck |
| 677 | const P_WXCOV: i64 = 11 // cloud coverage Q12 (drives the cloud density band) |
| 678 | const P_WXWINDX: i64 = 12 // wind x component, Q12-scaled speed*cos(dir) |
| 679 | const P_WXWINDZ: i64 = 13 // wind z component |
| 680 | const P_WXTYPE: i64 = 14 // precip type this eighth: 0 none, 1 rain, 2 snow |
| 681 | const P_WXTEMP: i64 = 15 // temperature Q12 (relative scale, freezing=1024) |
| 682 | const P_PAL: i64 = 16 // +blocktype = packed base colour (0..11) |
| 683 | const P_MOBC: i64 = 28 // +kind*2+half = packed mob colours (3 kinds x 2 tones) |
| 684 | const P_PAL2: i64 = 34 // +b-12 = packed colour for farm blocks 12..16 (5 rows, 34-38) |
| 685 | const P_DAYLEN: i64 = 40 // A1 calendar: ticks per day (ALL timing is spec DATA) |
| 686 | const P_SEASD: i64 = 41 // days per season (4 seasons cycle) |
| 687 | const P_GROWE: i64 = 42 // farm-tick cadence: one grow/hydrate pass every N ticks |
| 688 | const P_GROWW: i64 = 43 // crop speed on WET farmland (Minecraft stencil speed) |
| 689 | const P_GROWD: i64 = 44 // crop speed on DRY farmland |
| 690 | const P_RAINS: i64 = 45 // +season = rain permil per day-eighth (4 rows, 45-48) |
| 713 | const P_STYLE: i64 = 49 |
| 714 | const P_DAYPHASE: i64 = 39 // GE59 (2026-09-05): the boot clock as DATA -- the OTHER dead hole (world_recipes.conf names 39 and 49). Post-boot band, so it cannot be read at init: apply2_impl re-bases S_T to it on the next tick, once per distinct value; 0 (the zeroing loop) leaves the DAYLEN/4 boot phase, so every existing world is byte-identical by construction. If P_PAL2 ever widens, this slot moves with the ONE named const. |
| 715 | const WC_STYLE_REAL: i64 = 0 // textured, smooth light -- the shipped look, unchanged |
| 716 | const WC_STYLE_TOON: i64 = 1 // banded light (anime/cel) |
| 717 | const WC_STYLE_FLAT: i64 = 2 // untextured facets (artsy low-poly) |
| 718 | const WC_STYLE_SOFT: i64 = 3 // SMOOTH TERRAIN: ground lit by a heightfield normal interpolated across the block (no grid bevel, no per-block facet) |
| 722 | const WC_SOFT_SCAN: i64 = 3 |
| 723 | const WC_STYLE_MAX: i64 = 3 // the highest id this engine owns; set_style REFUSES above it |
| 727 | const WC_TOON_CUT: i64 = 588 |
| 728 | const WC_TOON_LO: i64 = 412 |
| 729 | const WC_TOON_HI: i64 = 922 |
| 736 | const WC_TEX_NEUTRAL: i64 = 128 |
| 737 | const P_ADV: i64 = 50 // +i = smart-object ADVERTISEMENTS (C1): packed |
| 741 | const P_HISTAGE: i64 = 60 // DECLARED geomorphic stage (Strahler bands): 0 = mature/ |
| 748 | const P_TREEMAX: i64 = 59 // tree altitude ceiling (0 = the historic hardcoded 19) |
| 749 | const P_TREESPEC: i64 = 61 // W2 SPECIES GENOME (packed, 0 = legacy 4-block stamp): |
| 759 | const P_WARD: i64 = 58 // warden daytime hunt radius in BLOCKS (0 = the 12-block |
| 763 | const P_OUTFIT: i64 = 57 // outfit mode: 0 = identity keeps everyone clothed; |
| 768 | const P_CURI: i64 = 56 // curiosity threshold: a girl approaches the player only |
| 777 | const P_BLDG: i64 = 62 // W3 settlement density: site-cell modulus (0 = none; the |
| 779 | const P_BLDGSPEC: i64 = 63 // low 4 bits = archetype row in nx_indoorgen_data |
| 780 | const P_ERODE: i64 = 64 // E1 TALUS EROSION BUDGET in relaxation ticks (0 = OFF). |
| 786 | const P_ERTAL: i64 = 65 // DERIVED talus threshold, WC_ER_Q units. NEVER authored: |
| 814 | const P_GARM: i64 = 70 |
| 815 | const GAR_N: i64 = 9 |
| 816 | const GAR_BIKINI_TOP: i64 = 1 |
| 817 | const GAR_BIKINI_BOT: i64 = 2 |
| 818 | const GAR_ONEPIECE: i64 = 3 |
| 819 | const GAR_SARONG: i64 = 4 |
| 820 | const GAR_SUNDRESS: i64 = 5 |
| 821 | const GAR_TEE: i64 = 6 |
| 822 | const GAR_SHORTS: i64 = 7 |
| 823 | const GAR_SKIRT: i64 = 8 |
| 824 | const GAR_DRESS: i64 = 9 |
| 825 | const GAR_COV_TOP: i64 = 1 |
| 826 | const GAR_COV_BOT: i64 = 2 |
| 827 | const GAR_COV_FULL: i64 = 3 |
| 828 | const GAR_CAT_SWIM: i64 = 0 |
| 829 | const GAR_CAT_COVER: i64 = 1 |
| 830 | const GAR_CAT_CASUAL: i64 = 2 |
| 831 | const GAR_CAT_EVENING: i64 = 3 |
| 832 | const GAR_CAT_NONE: i64 = 4 // what mobgarc reports for a girl wearing nothing |
| 833 | const GAR_CAT_SH: i64 = 2 |
| 834 | const GAR_CAT_MASK: i64 = 7 |
| 835 | const GAR_HUE_SH: i64 = 8 |
| 836 | const GAR_HUE_MASK: i64 = 511 |
| 837 | const GAR_SPAN_SH: i64 = 17 |
| 838 | const GAR_SPAN_MASK: i64 = 63 |
| 839 | const GAR_SPAN_UNIT_DEG: i64 = 4 |
| 840 | const GAR_SAT_SH: i64 = 23 |
| 841 | const GAR_LIT_SH: i64 = 27 |
| 842 | const GAR_NIB_MASK: i64 = 15 |
| 843 | const GAR_TINT_STOPS: i64 = 4 // MG_OUTFIT_MASK + 1: two genome bits, four stops |
| 844 | const GAR_SLOT_SH: i64 = 8 // outfit word = upper id << GAR_SLOT_SH | lower id |
| 845 | const GAR_ID_MASK: i64 = 255 |
| 846 | const HSL_DEG_FULL: i64 = 360 |
| 847 | const HSL_SECTOR_DEG: i64 = 60 |
| 848 | const MG_BEACH_SH: i64 = 18 // the beachwear genome bits the MIXED beach breeds (P_OUTFIT) |
| 849 | const MG_BEACH_MASK: i64 = 3 |
| 850 | const MOB_POSE_SLEEP: i64 = 2 // mob_pose's published sleep id (the pose door's contract) |
| 851 | const B_WATER: i64 = 4 // the water block (wshade2's shimmer branch, the shore ramp) |
| 852 | const WC_SPECN: i64 = 79 // spec words the engine owns: 69 -> 79 for the GE13b wardrobe |
| 863 | const P_OCEAN: i64 = 66 |
| 874 | const P_WPIPE: i64 = 67 |
| 885 | const P_WPSCALE: i64 = 68 |
| 886 | const P_SURF: i64 = 69 // GE53 SURFACE SOURCE: 0 = the cell grid (all voxel, byte-identical to |
| 893 | const WC_SURF_STEP_Q8: i64 = 64 |
| 894 | const WC_GAIT_BOB_Q8: i64 = 7 // thorax oscillation AMPLITUDE (~2.7cm, 5.5cm p2p -- |
| 903 | const WC_BREATH_TICKS: i64 = 257 |
| 914 | const WC_BREATH_Q8: i64 = 1 |
| 919 | const WC_BREATH_CUT_Q8: i64 = 24 |
| 920 | const WC_STEP_EASE_UP: i64 = 48 // mob Y climb rate Q8/tick (a 1-block rise ~ 5 ticks) |
| 921 | const WC_NIGHT_X8: i64 = 5 // night begins at this eighth of the day (5/8) |
| 923 | const EYE: i64 = 435 // eye height Q8 (~1.7 blocks) |
| 924 | const SPEED: i64 = 40 // walk Q8 per tick |
| 929 | const WC_PH_PER_TICK: i64 = 5 // the free-running advance MC_PH still uses for WANDER |
| 930 | const WC_PH_ANG: i64 = 214 // angle-units per phase unit (the incumbent's drive scaling) |
| 931 | const WC_NEED_GAIT: i64 = 3 // the needs row's spare slot, named now that it carries a value |
| 940 | const WC_DDEG_HALFTURN: i64 = 1800 // decidegrees in IT_PI (a half turn): the ddeg -> it-unit scale |
| 947 | const WC_STRIDE_Q8: i64 = 374 |
| 953 | const WC_PELVIS_ROT_DDEG: i64 = 52 |
| 962 | const WC_THORAX_ROT_DDEG: i64 = 146 |
| 966 | const WC_ELBOW_ROM_DDEG: i64 = 297 |
| 977 | const WC_TURN_PER_STRIDE: i64 = IT_PI/2 |
| 978 | const TURN: i64 = 140 // yaw it-units per tick (keyboard turn / legacy dir path) |
| 979 | const PITCHV: i64 = 90 // pitch it-units per tick (R/F keyboard look) |
| 980 | const PITCH_MAX: i64 = 5000 |
| 981 | const LOOKS: i64 = 6 // mouselook: it-units per accumulated look count |
| 982 | const JUMPV: i64 = 66 // jump takeoff velocity Q8/tick |
| 983 | const GRAV: i64 = 9 // gravity Q8/tick^2 |
| 984 | const VTERM: i64 = 120 // terminal fall velocity Q8/tick -- ONE ruler for the player AND every mob |
| 992 | const WC_IMP_SCALE: i64 = SD_Q8/4 |
| 993 | const MAXSTEPS: i64 = 110 // DDA cells per ray (view distance) |
| 994 | const REACH_STEPS: i64 = 20 // crosshair edit reach in DDA cells |
| 1035 | const EJRN_KEY_MAX: i64 = 72057594037927935 |
| 1036 | const EJRN_TAG_MASK: i64 = 0-256 |
| 1249 | const WC_ER_Q: i64 = 256 // fixed point the pass runs in. World heights are |
| 1253 | const WC_ER_STABLE_Q: i64 = WC_ER_Q / 4 // DERIVED, not tasted: an explicit 4-neighbour |
| 1257 | const WC_ER_RATE_Q: i64 = WC_ER_STABLE_Q / 2 // WRITTEN AS THE ARITHMETIC: half the stability |
| 1262 | const WC_ER_MAXK: i64 = 3 // STRUCTURAL, not a clamp: three unrolled levels |
| 1267 | const WC_ER_FLAT: i64 = 0 - 1 // P_ERTAL sentinel: measured, and there is no relief |
| 1532 | const WC_REVIEW_ARC: i64 = IT_PI/2 |
| 1910 | const BLDG_SITE: i64 = 40 // site-cell stride, blocks |
| 1911 | const IG_SCAN0: i64 = 10 // W3 solve: first candidate anchor offset inside the site cell |
| 1912 | const IG_SCANSTEP: i64 = 10 // candidate grid step: 3x3 covers offsets 10/20/30; footprint |
| 1916 | const IG_MAXSLOPE: i64 = 2 // pre-declared accept rule: corners may deviate <=2 blocks from |
| 1920 | const IG_FOUND: i64 = 3 // foundation skirt courses below the floor (IG_MAXSLOPE + 1) |
| 3221 | const MOB_R_Q8: i64 = 90 |
functions
| 996 | func wst(base: i64) -> *i64 { return (base + O_ST) as *i64 } |
| 997 | func wsp(base: i64) -> *i64 { return (base + O_SPEC) as *i64 } |
| 998 | func wgp(base: i64) -> *i64 { return (base + O_GENP) as *i64 } |
| 999 | func mobp(base: i64) -> *i64 { return (base + O_MOBS) as *i64 } |
| 1000 | func wfb(base: i64) -> *i64 { return (base + O_FB) as *i64 } |
| 1001 | func wvx(base: i64) -> *u8 { return (base + O_VOX) as *u8 } |
| 1002 | func winp(base: i64) -> *i64 { return (base + O_INPUT) as *i64 } |
| 1003 | func wpack(r: i64, g: i64, b: i64) -> i64 { return r | (g << 8) | (b << 16) } |
| 1004 | func wclamp(v: i64, lo: i64, hi: i64) -> i64 { if v < lo { return lo } if v > hi { return hi } return v } |
| 1006 | func vin(x: i64, y: i64, z: i64) -> i64 |
| 1012 | func vget(base: i64, x: i64, y: i64, z: i64) -> i64 |
| 1017 | func vset(base: i64, x: i64, y: i64, z: i64, b: i64) -> i64 |
| 1030 | func ejp(base: i64) -> *i64 { return (base + O_EJRN) as *i64 } |
| 1031 | func ej_key(ax: i64, ay: i64, az: i64) -> i64 |
| 1037 | func ej_key_representable(ax: i64, ay: i64, az: i64) -> i64 |
| 1044 | func ej_tag_matches(cur: i64, key: i64) -> i64 |
| 1048 | func ej_index_bucket(tag: i64) -> i64 |
| 1056 | func ej_batch_begin(base: i64, available_bytes: i64) -> *i64 |
| 1076 | func ej_index_get(base: i64, heads: *i64, ax: i64, ay: i64, az: i64) -> i64 |
| 1093 | func ej_index_put(base: i64, heads: *i64, ax: i64, ay: i64, az: i64, b: i64) -> i64 |
| 1123 | func ej_put(base: i64, ax: i64, ay: i64, az: i64, b: i64) -> i64 |
| 1130 | func ej_get(base: i64, ax: i64, ay: i64, az: i64) -> i64 |
| 1137 | func ej_overlay(base: i64, lx0: i64, lx1: i64, lz0: i64, lz1: i64) -> i64 |
| 1160 | func wc_edit(base: i64, x: i64, y: i64, z: i64, b: i64) -> i64 |
| 1170 | func vsolid(base: i64, x: i64, y: i64, z: i64) -> i64 |
| 1179 | func whash(x: i64, z: i64, sd: i64) -> i64 |
| 1187 | func wnoise(x: i64, z: i64, sc: i64, sd: i64) -> i64 |
| 1203 | func wheight_raw(base: i64, x: i64, z: i64, sd: i64) -> i64 |
| 1278 | func wheight_q(base: i64, x: i64, z: i64, sd: i64) -> i64 |
| 1289 | func wc_er_flux(d: i64, t: i64) -> i64 |
| 1299 | func wc_er_talus(base: i64, sd: i64) -> i64 |
| 1329 | func wc_er_arm(base: i64, sd: i64) -> i64 |
| 1339 | func wc_er1(base: i64, x: i64, z: i64, sd: i64, t: i64) -> i64 |
| 1348 | func wc_er2(base: i64, x: i64, z: i64, sd: i64, t: i64) -> i64 |
| 1357 | func wc_er3(base: i64, x: i64, z: i64, sd: i64, t: i64) -> i64 |
| 1370 | func wheight(base: i64, x: i64, z: i64, sd: i64) -> i64 |
| 1385 | func wheight_qe(base: i64, x: i64, z: i64, sd: i64) -> i64 |
| 1400 | func wsp_beach_ocean_q(sp: *i64, ax: i64, az: i64, hq: i64) -> i64 |
| 1413 | func hq_get(base: i64, x: i64, z: i64) -> i64 |
| 1421 | func hq_set(base: i64, x: i64, z: i64, v: i64) -> i64 |
| 1426 | func hq_off() -> i64 { return O_HQ } |
| 1430 | func wc_surface_source(base: i64, pxq: i64, pzq: i64) -> i64 |
| 1447 | func wterrain(b: i64) -> i64 |
| 1459 | func wnoise3(x: i64, y: i64, z: i64, sc: i64, sd: i64) -> i64 |
| 1483 | func wc_wmax(base: i64) -> i64 |
| 1505 | func wsp_ocean_d(sp: *i64, ax: i64, az: i64) -> i64 |
| 1520 | func wsp_sea_yaw(sp: *i64) -> i64 |
| 1539 | func wsp_beach_ocean(sp: *i64, ax: i64, az: i64, h: i64) -> i64 |
| 1555 | func wc_player_position_clear(base: i64, x: i64, y: i64, z: i64) -> i64 |
| 1569 | func wc_player_recover(base: i64) -> i64 |
| 1595 | func player_position_clear() -> i64 |
| 1599 | func player_recover() -> i64 { return wc_player_recover(0) } |
| 1602 | func wc_hq_column(base: i64, x: i64, z: i64, ax: i64, az: i64, sd: i64) -> i64 |
| 1607 | func wc_hq_restore(base: i64) -> i64 |
| 1622 | func gencol(base: i64, x: i64, z: i64, ax: i64, az: i64, sd: i64) -> i64 |
| 1659 | func vset_box(base: i64, x: i64, y: i64, z: i64, b: i64, lx0: i64, lx1: i64, lz0: i64, lz1: i64) -> i64 |
| 1681 | func wsp_palm_shape(base: i64, sp: *i64, tx: i64, tz: i64, h2: i64, th9: i64, cr9: i64, |
| 1738 | func gentrees(base: i64, lx0: i64, lx1: i64, lz0: i64, lz1: i64, sd: i64) -> i64 |
| 1924 | func igfloor(a: i64, b: i64) -> i64 |
| 1929 | func ig_rotx(r: i64, x: i64, z: i64) -> i64 |
| 1935 | func ig_rotz(r: i64, x: i64, z: i64) -> i64 |
| 1941 | func genbuildings(base: i64, lx0: i64, lx1: i64, lz0: i64, lz1: i64, sd: i64) -> i64 |
| 2080 | func genworld(base: i64, sd: i64) -> i64 |
| 2103 | func wc_hq_shift(base: i64, dx: i64, dz: i64) -> i64 |
| 2126 | func wc_shift(base: i64, dx: i64, dz: i64) -> i64 |
| 2234 | func wray_surf(base: i64, dx: i64, dy: i64, dz: i64, maxsteps: i64, out: *i64) -> i64 |
| 2309 | func wray2(base: i64, dx: i64, dy: i64, dz: i64, maxsteps: i64, out: *i64, skipw: i64) -> i64 |
| 2336 | func wray3(base: i64, dx: i64, dy: i64, dz: i64, maxsteps: i64, out: *i64, skipw: i64, skipt: i64) -> i64 |
| 2422 | func wray(base: i64, dx: i64, dy: i64, dz: i64, maxsteps: i64, out: *i64) -> i64 |
| 2427 | func wcol(base: i64, b: i64) -> i64 |
| 2435 | func sel_block(sel: i64) -> i64 |
| 2445 | func wface_l(face: i64) -> i64 |
| 2453 | func wsky(base: i64, syy: i64) -> i64 |
| 2477 | func wcloud(camx: i64, camy: i64, camz: i64, dx: i64, dy: i64, dz: i64, t: i64) -> i64 |
| 2491 | func wsky2(base: i64, syy: i64, px: i64, py: i64, sunx: i64, suny: i64, sunon: i64) -> i64 |
| 2516 | func wao(base: i64, cx2: i64, cy2b: i64, cz2: i64, face: i64, u: i64, v: i64) -> i64 |
| 2572 | func wshade2(base: i64, b0: i64, face: i64, steps: i64, syy: i64, hpx: i64, hpy: i64, hpz: i64, t2: i64, clx: i64, cly: i64, clz: i64) -> i64 |
| 2667 | func wc_spec(base: i64, v: i64) -> i64 |
| 2920 | func genmobs(base: i64, sd: i64) -> i64 |
| 2962 | func wc_spawn_bush(base: i64, forward: i64, lateral: i64, radius: i64, height: i64, material: i64) -> i64 |
| 3013 | func init_impl_v(base: i64, v: i64, seed: i64) -> i64 |
| 3122 | func init_impl(base: i64, seed: i64) -> i64 { return init_impl_v(base, 0, seed) } |
| 3125 | func wc_respawn(base: i64) -> i64 |
| 3136 | func wground(base: i64, x: i64, z: i64) -> i64 |
| 3146 | func wc_contact_floor_below_q(base: i64, xq: i64, zq: i64, top: i64, ceiling: i64) -> i64 |
| 3173 | func wc_contact_floor_q(base: i64, xq: i64, zq: i64, top: i64) -> i64 |
| 3178 | func wstand(base: i64, nxq: i64, nzq: i64, cyq: i64) -> i64 |
| 3196 | func wstand_here(base: i64, xq: i64, zq: i64) -> i64 |
| 3222 | func mob_solid2(base: i64, x: i64, g: i64, z: i64) -> i64 |
| 3227 | func mob_clear_x(base: i64, nx: i64, nz: i64, g: i64) -> i64 |
| 3236 | func mob_clear_z(base: i64, nx: i64, nz: i64, g: i64) -> i64 |
| 3245 | func mob_fits(base: i64, x: i64, g: i64, z: i64) -> i64 |
| 3251 | func mob_ground(base: i64, x: i64, ytop: i64, z: i64) -> i64 |
| 3271 | func mob_step_gait(vyp: *i64, k: i64, cy0: i64, ng: i64) -> i64 |
| 3294 | func npc_pick(base: i64, fx: i64, fy: i64, fz: i64) -> i64 |
| 3325 | func cal_dayt(base: i64) -> i64 |
| 3331 | func cal_day(base: i64) -> i64 |
| 3337 | func cal_season(base: i64) -> i64 |
| 3343 | func cal_night(base: i64) -> i64 |
| 3349 | func cal_sunel(base: i64) -> i64 |
| 3358 | func cal_rain(base: i64) -> i64 |
| 3373 | func wc_weather_tick(base: i64) -> i64 |
| 3393 | func dg_bst(dg: i64, b: i64) -> i64 { return dg - ((dg >> 3) & 7)*8 + b*8 } |
| 3400 | func wc_grow_set_indexed(base: i64, index: *i64, lx: i64, ly: i64, lz: i64, b: i64) -> i64 |
| 3408 | func wc_grow_set(base: i64, lx: i64, ly: i64, lz: i64, b: i64) -> i64 |
| 3414 | func wc_wet_near(base: i64, lx: i64, ly: i64, lz: i64) -> i64 |
| 3427 | func wc_farm_tick(base: i64) -> i64 |
| 3488 | func wc_soft_seat_all(base: i64) -> i64 |
| 3500 | func passp(base: i64) -> *i64 { return (base + O_PASS) as *i64 } |
| 3501 | func wc_pass_ck(p: *i64) -> i64 |
| 3504 | func wc_party_count(base: i64) -> i64 |
| 3517 | func wc_pass_sync(base: i64) -> i64 |
| 3573 | func wc_pass_apply(base: i64) -> i64 |
| 3616 | func pass_level_of(base: i64) -> i64 |
| 3624 | func party_of(base: i64) -> i64 |
| 3653 | func mob_pose(base: i64, k: i64) -> i64 |
| 3661 | func mobpose(k: i64) -> i64 { return mob_pose(0, k) } |
| 3678 | func wc_mob_in_water(base: i64, k: i64) -> i64 |
| 3684 | func wc_outfit(base: i64, k: i64) -> i64 |
| 3718 | func mob_outfit(base: i64, k: i64) -> i64 |
| 3724 | func mob_outfit_v1(base: i64, k: i64) -> i64 |
| 3738 | func wc_need_seed(base: i64) -> i64 |
| 3754 | func mindp(base: i64) -> *i64 { return (base + O_MIND) as *i64 } |
| 3755 | func wc_mind_zero(base: i64) -> i64 |
| 3762 | func th_add(base: i64, k: i64, id: i64, mag: i64, ttl: i64) -> i64 |
| 3785 | func th_mood(base: i64, k: i64) -> i64 |
| 3800 | func go_add(base: i64, k: i64, subj: i64, pred: i64, conf: i64) -> i64 |
| 3823 | func go_newest(base: i64, k: i64) -> i64 |
| 3841 | func wc_ddeg(d: i64) -> i64 { return d*IT_PI/WC_DDEG_HALFTURN } |
| 3844 | func wc_amp_ddeg(range_ddeg: i64) -> i64 { return wc_ddeg(range_ddeg)/2 } |
| 3863 | func wc_stride_ang(g_q8: i64) -> i64 { return g_q8*2*IT_PI/WC_STRIDE_Q8 } |
| 3865 | func wc_angwrap(d: i64) -> i64 |
| 3888 | func wc_hdg_step(hdg: i64, dx: i64, dz: i64) -> i64 |
| 3944 | func wc_hdg_of(base: i64, k: i64) -> i64 { let hp: *i64 = (base + O_MOBHDG) as *i64; return hp[k] } |
| 3946 | func wc_mob_sph(base: i64, k: i64) -> i64 |
| 3958 | func wc_gp_pelvis(sph: i64) -> i64 { return wc_amp_ddeg(WC_PELVIS_ROT_DDEG)*it_sin4096(sph % (2*IT_PI))/WATER_MAGIC_4096 } |
| 3959 | func wc_gp_thorax(sph: i64) -> i64 { return wc_amp_ddeg(WC_THORAX_ROT_DDEG)*it_sin4096(sph % (2*IT_PI))/WATER_MAGIC_4096 } |
| 3960 | func wc_gp_leg(sph: i64) -> i64 { return it_sin4096(sph % (2*IT_PI))*(IT_PI/6)/WATER_MAGIC_4096 } |
| 3961 | func wc_gp_arm(sph: i64) -> i64 { return it_sin4096(sph % (2*IT_PI))*(IT_PI/12)/WATER_MAGIC_4096 } |
| 3964 | func wc_gp_elbow(sph: i64) -> i64 { return wc_ddeg(WC_ELBOW_ROM_DDEG)*(WATER_MAGIC_4096 - it_cos4096(sph % (2*IT_PI)))/(2*WATER_MAGIC_4096) } |
| 3970 | func wc_mob_resident(base: i64, h: i64) -> i64 |
| 3978 | func mob_resident(k: i64) -> i64 |
| 3982 | func mob_tick(base: i64) -> i64 |
| 4547 | func beach_contact_cell_solid(base: i64, x: i64, y: i64, z: i64) -> i64 |
| 4553 | func beach_contact_union_cell(base: i64, body: *BeachContactBox, obstacle: *BeachContactBox, x: i64, y: i64, z: i64) -> i64 |
| 4573 | func beach_contact_world_sweep(base: i64, body: *BeachContactBox, obstacle: *BeachContactBox, result: *BeachContactResult, axis: i64, delta_q8: i64) -> i64 |
| 4619 | func wc_contact_body(base: i64) -> *BeachContactBox { return (base+O_CONTACT) as *BeachContactBox } |
| 4620 | func wc_contact_obstacle(base: i64) -> *BeachContactBox { return (base+O_CONTACT+CONTACT_BOX_WORDS*8) as *BeachContactBox } |
| 4621 | func wc_contact_result(base: i64) -> *BeachContactResult { return (base+O_CONTACT+2*CONTACT_BOX_WORDS*8) as *BeachContactResult } |
| 4622 | func wc_contact_state(base: i64) -> *i64 { return (base+O_CONTACT+(2*CONTACT_BOX_WORDS+CONTACT_RESULT_WORDS)*8) as *i64 } |
| 4624 | func contact_initial_overlap_impl(base: i64) -> i64 { return wc_contact_state(base)[0] } |
| 4625 | func contact_clipped_axes_impl(base: i64) -> i64 { return wc_contact_state(base)[1] } |
| 4626 | func contact_material_impl(base: i64) -> i64 { return wc_contact_state(base)[2] } |
| 4627 | func wc_player_body(base: i64, x: i64, y: i64, z: i64) -> i64 |
| 4635 | func wc_player_sweep(base: i64, x: i64, y: i64, z: i64, axis: i64, delta: i64) -> i64 |
| 4646 | func wc_player_field_path_max(base: i64, x: i64, z: i64, axis: i64, delta: i64) -> i64 |
| 4670 | func wc_player_field_clip(base: i64, x: i64, y: i64, z: i64, axis: i64, delta: i64) -> i64 |
| 4687 | func wc_player_support(base: i64, x: i64, z: i64, ceiling: i64) -> i64 |
| 4696 | func wc_player_axis_apply(base: i64, axis: i64, requested: i64, can_step: i64) -> i64 |