========================================================================
 Jedi Knight Level

 P22.GOB

 A corridor with ten panels. Each is wired to its own COG, and the ten
 COGs are identical except for how much dead padding they carry -- 100
 `if` blocks behind the first, 1000 behind the last. Press each one and
 read what it prints. This is a MEASUREMENT, not a game.

 [cogfactory / p22-coglimit]

 BUILD 1  --  2026-09-05
 sha256 2bc1e8c6421c380ffb14dc89b4671881

 This level is not made or distributed by LucasArts
 Entertainment Co.
========================================================================

THIS PACKAGE
------------------------------------------------------------------------
  P22.GOB          the level
  readme.txt       this file
  screenshot.jpg   what it looks like

INSTALLATION
------------------------------------------------------------------------
Drop P22.GOB into the `episode` folder of a Jedi Knight install (the one
that already has JK1.GOB in it) and pick it from the episode list.
Nothing else needs to change: the GOB carries its own level, cogs,
materials and sounds, and reads the stock resource/ for everything else.

On a libretro frontend, point the core at the GOB itself. It needs a
folder beside it holding `resource/` from a real install -- that is
where the retail data lives and none of it is in here.

CONTROLS
------------------------------------------------------------------------
  You start facing a wall of ten lit panels, left to right: A0 .. A9.

  Walk into a panel until you are TOUCHING it and press USE.
  Two lines appear:

      P22 A0 GO                <- you pressed this one
      P22 A0 [123456] END      <- CORRECT

  ANYTHING ELSE IS THE FINDING: a different string, a short one, an
  X / Y / Z in it, or no second line at all. Write down which panel
  and exactly what it said. Nothing here can crash the level.

  Work left to right. A0 has the least padding, A9 the most.

NOTES
------------------------------------------------------------------------
  WHY: a generated COG in openjkdf2 was observed running the WRONG
  CODE with no error at all -- a Return came back inside a different
  subroutine, and the script parsed, loaded and played fine. The
  obvious explanation was cog size. This probe was built to confirm
  that and instead RULED IT OUT: openjkdf2 answers all ten of these
  correctly, and two padding styles not shipped here go to 5025 labels
  and 41093 code words still correct.

  SO WHAT THIS ASKS THE REAL GAME IS SIMPLER: does retail Jedi Knight
  have a ceiling here that openjkdf2 does not? Retail's COG symbol
  table and jump-target table are both 512 entries where openjkdf2 has
  2048. The padding steps are chosen so 512 falls between A3 and A4.

  THE MOST USEFUL RESULT would be A0-A3 right and A4-A9 wrong. The
  next most useful is all ten right. 'The level would not load' is
  also a result.

  The chain each COG walks is a1 -> a2 -> a3, appending 1,2,3 on the
  way down and 4,5,6 on the way back up, so the printed string is a
  transcript of the call stack. z1, z2 and z3 exist only so that a
  wrong jump lands somewhere that says so.

  There is deliberately no generated art in this level: two stock
  materials, no 3DOs, no sounds, no extended verbs. If it misbehaves,
  the COGs are the only thing it can be.

WHAT IS IN THE GOB
------------------------------------------------------------------------
        92  episode.jk
     10795  jkl\probe.jkl
      5568  cog\p22a00.cog
      9368  cog\p22a01.cog
     13168  cog\p22a02.cog
     16968  cog\p22a03.cog
     20768  cog\p22a04.cog
     24568  cog\p22a05.cog
     28368  cog\p22a06.cog
     32168  cog\p22a07.cog
     35968  cog\p22a08.cog
     39769  cog\p22a09.cog
      3112  cog\p22b00.cog
      4463  cog\p22b01.cog
      5813  cog\p22b02.cog
      7163  cog\p22b03.cog
      8513  cog\p22b04.cog
      9863  cog\p22b05.cog
     11213  cog\p22b06.cog
     12563  cog\p22b07.cog
     13913  cog\p22b08.cog
     15263  cog\p22b09.cog

    329447  bytes in 22 entries

CREDITS
------------------------------------------------------------------------
  Generated end to end by tools/cogfactory in the openjkdf2_libretro
  tree.
  Built as a follow-up to p21-classtetris, which hit the behaviour
  this is trying to pin down.

  The readme format is styled after SM Sith Lord's cog headers,
  because his are the ones everybody read.

========================================================================
