snapkitty
agents
haskell
prolog
python
SNAPKITTYWEST commited on
Commit
d23b91a
Β·
verified Β·
1 Parent(s): 4991736

Sync with GitHub, license metadata from LICENSE files, commercial license notice

Browse files

metadata license: None -> other (sovereign-source-license)
README: 1 Apache label(s) corrected to Sovereign Source License
README: License section appended
README: GitHub source link added

Files changed (1) hide show
  1. README.md +174 -158
README.md CHANGED
@@ -1,158 +1,174 @@
1
- ```
2
- ╔══════════════════════════════════════════════════════════════════════════════╗
3
- β•‘ β•‘
4
- β•‘ ⬑ B O B E N G I N E β•‘
5
- β•‘ β•‘
6
- β•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β•‘
7
- β•‘ β–ˆβ–ˆ β–ˆβ–ˆ β•‘
8
- β•‘ β–ˆβ–ˆ DOOM-STYLE AI WORLD ENGINE β–ˆβ–ˆ β•‘
9
- β•‘ β–ˆβ–ˆ x86 NASM Assembly Β· VGA Mode 13h Β· COM Format β–ˆβ–ˆ β•‘
10
- β•‘ β–ˆβ–ˆ BSP Β· DDA Raycast Β· AI State Machines Β· WORM β–ˆβ–ˆ β•‘
11
- β•‘ β–ˆβ–ˆ β–ˆβ–ˆ β•‘
12
- β•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β•‘
13
- β•‘ β•‘
14
- β•‘ ⬑ Ξ© β†Ί Ξ¨ Ξ” Ξ› Ξ£ Ξ¦ Ξ± β€” 961 lines Β· 320x200 Β· real mode β•‘
15
- β•‘ β•‘
16
- β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
17
- ```
18
-
19
- BOB ENGINE is a DOOM-style 3D virtual world engine for sovereign AI agents, written in 961 lines of x86 NASM assembly. It runs in VGA Mode 13h (320x200, 256 colors) as a DOS COM file (`ORG 0x100`). The engine models a philosophical truth: the sovereign agent (player) navigates a world inhabited by constrained agents (enemies), each locked in sector-bound state machines that cycle through `PATROL β†’ CHASE β†’ ATTACK β†’ DEAD`. The world is built from a 16x16 cell BSP tree; walls are rendered via DDA raycasting with distance-based color shading (near/mid/far); agent sprites are projected to screen columns. A SHA-256 WORM chain serializes world state β€” player position, angle, health, and all agent states β€” every 64 frames, beginning with a genesis block stamped with magic `"BOB"` (0x424F42). The keyboard ISR hooks INT 9 directly, handling key state without BIOS polling overhead. This is the virtual game engine of AI: every agent a soul in the machine.
20
-
21
- ## Architecture
22
-
23
- ```mermaid
24
- flowchart TD
25
- subgraph Init Sequence
26
- A0[math_init\nsin/cos lookup table] --> A1[vga_init\nMode 13h + palette]
27
- A1 --> A2[kb_install\nINT 9 ISR hook]
28
- A2 --> A3[bsp_build\n16x16 map β†’ BSP nodes]
29
- A3 --> A4[player_init\nSovereign Agent x=5.5 y=5.5]
30
- A4 --> A5[ai_init\n3 enemy agents spawned]
31
- A5 --> A6[worm_init\ngenesis block BOB magic]
32
- end
33
-
34
- subgraph Game Loop
35
- L0[input_update\nread g_keys] --> L1[player_update\nturn/move sovereign agent]
36
- L1 --> L2[ai_update_all\ntick 3 agent state machines]
37
- L2 --> L3[render_clear\nceiling + floor fill]
38
- L3 --> L4[render_walls\nDDA raycast 320 columns]
39
- L4 --> L5[render_agents\nsprite projection]
40
- L5 --> L6[render_hud\nhealth bar bottom row]
41
- L6 --> L7[vga_flip\nblockbuf β†’ A000:0000]
42
- L7 --> L8{frame % 64 == 0?}
43
- L8 -->|yes| WORM[worm_tick\nserialize world state]
44
- L8 -->|no| L0
45
- WORM --> L0
46
- end
47
-
48
- A6 --> L0
49
-
50
- subgraph AI State Machine
51
- ST0[PATROL\ntimer countdown\nflip angle on timeout]
52
- ST1[CHASE\nmove toward player\ntimer β†’ ATTACK]
53
- ST2[ATTACK\ntimer β†’ PATROL]
54
- ST3[DEAD\nno update]
55
- ST0 -->|proximity| ST1
56
- ST1 -->|timer=0| ST2
57
- ST2 -->|timer=0| ST0
58
- ST2 -->|health=0| ST3
59
- end
60
-
61
- subgraph WORM Chain
62
- W0[genesis\nmagic=BOB v1.0 seq=0] --> W1[frame 64\nplayer_x/y/angle/health\nagent states 0-7]
63
- W1 --> W2[frame 128\n...]
64
- W2 --> WN[worm_finalize\nterminal magic=0xDEAD]
65
- end
66
- ```
67
-
68
- ## File Tree
69
-
70
- ```
71
- bob-engine/
72
- └── src/
73
- └── bob_engine.asm # 961 lines β€” entire engine in one file
74
- ```
75
-
76
- **Internal structure of `bob_engine.asm`:**
77
-
78
- ```
79
- bob_engine.asm
80
- β”œβ”€β”€ CONSTANTS # Screen (320x200), fixed-point (16.16), map (16x16), BSP, agents, WORM
81
- β”œβ”€β”€ DATA SECTION
82
- β”‚ β”œβ”€β”€ g_backbuf # 64000-byte back buffer (320x200)
83
- β”‚ β”œβ”€β”€ g_px / g_py / g_pangle # Sovereign player (8.8 fixed-point)
84
- β”‚ β”œοΏ½οΏ½β”€ g_keys / g_frame # Keyboard bitmask, frame counter
85
- β”‚ β”œβ”€β”€ g_sin / g_cos # 1024-entry 16.16 fixed-point trig tables
86
- β”‚ β”œβ”€β”€ g_bsp_nodes # 64 Γ— 16-byte BSP node array
87
- β”‚ β”œβ”€β”€ g_agents # 8 Γ— 20-byte agent struct array
88
- β”‚ β”œβ”€β”€ g_map # 16Γ—16 map (0=open, 1=wall)
89
- β”‚ └── g_worm_buf / g_worm_hash # 64-byte snapshot block + 32-byte hash
90
- └── CODE SECTION
91
- β”œβ”€β”€ _start # Boot: init all subsystems β†’ game loop
92
- β”œβ”€β”€ math_init # Build sin/cos lookup tables
93
- β”œβ”€β”€ vga_init / vga_shutdown # Mode 13h set/restore + 8-color palette
94
- β”œβ”€β”€ vga_flip # rep movsw backbuf β†’ A000:0000
95
- β”œβ”€β”€ kb_install / kb_isr # INT 9 hook, scancode β†’ g_keys, ESC β†’ g_quit
96
- β”œβ”€β”€ bsp_build / bsp_add_node # Walk g_map β†’ BSP leaf nodes
97
- β”œβ”€β”€ player_init / player_update # Sovereign agent movement + turn
98
- β”œβ”€β”€ ai_init / ai_update_all # Spawn 3 agents, tick state machines
99
- β”œβ”€β”€ render_clear # rep stosb ceiling (CLR_CEILING) + floor (CLR_FLOOR)
100
- β”œβ”€β”€ render_walls # 320-column DDA raycast + draw_vslice
101
- β”œβ”€β”€ raycast_dda # DDA march: player pos β†’ wall distance β†’ g_ray_dist
102
- β”œβ”€β”€ draw_vslice # Vertical column: center on SCREEN_HALF_H, paint CL
103
- β”œβ”€β”€ render_agents # Project agent sector_id β†’ screen column, 4Γ—8 sprite
104
- β”œβ”€β”€ render_hud # Health bar on bottom row (CLR_SOVEREIGN green)
105
- └── worm_init / worm_tick / worm_finalize # WORM serialization every 64 frames
106
- ```
107
-
108
- ## Quick Start
109
-
110
- **Prerequisites:** NASM assembler, DOSBox (or real DOS)
111
-
112
- ```bash
113
- # Build the COM file
114
- nasm -f bin src/bob_engine.asm -o bob_engine.com
115
-
116
- # Run in DOSBox
117
- dosbox bob_engine.com
118
-
119
- # Or on real DOS hardware
120
- copy bob_engine.com C:\
121
- C:\bob_engine.com
122
- ```
123
-
124
- **Controls:**
125
-
126
- | Key | Action |
127
- |---|---|
128
- | Arrow Left | Turn sovereign agent left |
129
- | Arrow Right | Turn sovereign agent right |
130
- | Arrow Up | Move forward |
131
- | Arrow Down | Move back |
132
- | ESC | Exit (triggers WORM finalize) |
133
-
134
- **Build notes:**
135
-
136
- - Output is a raw COM binary (`ORG 0x100`) β€” no linker needed, runs direct
137
- - Entire engine fits in a single segment (CS=DS=ES=SS)
138
- - Stack placed at top of 64KB segment (SP=0xFFFE)
139
- - No external libraries β€” pure x86 real-mode BIOS and DOS INT calls
140
- - VGA palette: 0=black, 1=dark blue (ceiling), 2=dark gray (floor), 3=bright (near wall), 4=medium (mid wall), 5=dim (far wall), 6=red (enemy agents), 7=green (sovereign / HUD)
141
-
142
- ## Key Features
143
-
144
- - **961 lines of pure x86 NASM assembly** β€” no C runtime, no external libraries, one file, one COM binary
145
- - **VGA Mode 13h** β€” 320x200 256-color linear framebuffer at segment `0xA000`; double-buffered via `g_backbuf` and `rep movsw` flip
146
- - **DDA raycasting** β€” one ray per screen column (320 rays), distance computed by DDA grid march; wall slice height `= (CELL_SZ * SCREEN_H) / distance`; distance-shaded near/mid/far colors
147
- - **BSP tree** β€” map walk generates up to 64 axis-aligned BSP leaf nodes (16 bytes each: x1/y1/x2/y2, left/right child, sector_id, color)
148
- - **AI state machines** β€” up to 8 agents, each a 20-byte struct; three states active at boot (`PATROL Γ— 2`, `CHASE Γ— 1`); timer-driven transitions (`PATROL β†’ CHASE β†’ ATTACK β†’ PATROL`); `DEAD` state terminates updates
149
- - **Keyboard ISR** β€” hooks INT 9 directly via DOS `AH=25h`; reads scancode from port `0x60`; sets `g_quit` on ESC; restores original vector on exit
150
- - **16.16 fixed-point math** β€” player position in 8.8 fixed point, angles in `[0, 1024)` integer units (full circle), trig via `g_sin`/`g_cos` lookup tables
151
- - **WORM world serialization** β€” 64-byte snapshot block (magic `BOB`, version 1.0, seq, player x/y/angle/health, agent states); serialized every 64 frames; genesis block on boot, terminal block (`magic=0xDEAD`) on clean exit
152
- - **Sovereign / constrained duality** β€” player is the sovereign agent (full movement, Trust Deed); enemies are constrained agents (sector-bound, no free will); the world map is the law
153
- - **HUD** β€” green health bar (`CLR_SOVEREIGN`) drawn on the bottom row of the back buffer each frame
154
-
155
- ---
156
-
157
- *Apache 2.0 Β· Bel Esprit D'Accord Trust Β· SnapKitty Collective Β· 2026*
158
- *Evidence or Silence.*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: sovereign-source-license
4
+ license_link: https://huggingface.co/Snapkitty/bob-engine/blob/main/LICENSE
5
+ tags:
6
+ - snapkitty
7
+ ---
8
+
9
+ > Source: [github.com/SNAPKITTYWEST/bob-engine](https://github.com/SNAPKITTYWEST/bob-engine)
10
+
11
+ ```
12
+ ╔══════════════════════════════════════════════════════════════════════════════╗
13
+ β•‘ β•‘
14
+ β•‘ ⬑ B O B E N G I N E β•‘
15
+ β•‘ β•‘
16
+ β•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β•‘
17
+ β•‘ β–ˆβ–ˆ β–ˆβ–ˆ β•‘
18
+ β•‘ β–ˆβ–ˆ DOOM-STYLE AI WORLD ENGINE β–ˆβ–ˆ β•‘
19
+ β•‘ β–ˆβ–ˆ x86 NASM Assembly Β· VGA Mode 13h Β· COM Format β–ˆβ–ˆ β•‘
20
+ β•‘ β–ˆβ–ˆ BSP Β· DDA Raycast Β· AI State Machines Β· WORM β–ˆβ–ˆ β•‘
21
+ β•‘ β–ˆβ–ˆ β–ˆβ–ˆ β•‘
22
+ β•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β•‘
23
+ β•‘ β•‘
24
+ β•‘ ⬑ Ξ© β†Ί Ξ¨ Ξ” Ξ› Ξ£ Ξ¦ Ξ± β€” 961 lines Β· 320x200 Β· real mode β•‘
25
+ β•‘ β•‘
26
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
27
+ ```
28
+
29
+ BOB ENGINE is a DOOM-style 3D virtual world engine for sovereign AI agents, written in 961 lines of x86 NASM assembly. It runs in VGA Mode 13h (320x200, 256 colors) as a DOS COM file (`ORG 0x100`). The engine models a philosophical truth: the sovereign agent (player) navigates a world inhabited by constrained agents (enemies), each locked in sector-bound state machines that cycle through `PATROL β†’ CHASE β†’ ATTACK β†’ DEAD`. The world is built from a 16x16 cell BSP tree; walls are rendered via DDA raycasting with distance-based color shading (near/mid/far); agent sprites are projected to screen columns. A SHA-256 WORM chain serializes world state β€” player position, angle, health, and all agent states β€” every 64 frames, beginning with a genesis block stamped with magic `"BOB"` (0x424F42). The keyboard ISR hooks INT 9 directly, handling key state without BIOS polling overhead. This is the virtual game engine of AI: every agent a soul in the machine.
30
+
31
+ ## Architecture
32
+
33
+ ```mermaid
34
+ flowchart TD
35
+ subgraph Init Sequence
36
+ A0[math_init\nsin/cos lookup table] --> A1[vga_init\nMode 13h + palette]
37
+ A1 --> A2[kb_install\nINT 9 ISR hook]
38
+ A2 --> A3[bsp_build\n16x16 map β†’ BSP nodes]
39
+ A3 --> A4[player_init\nSovereign Agent x=5.5 y=5.5]
40
+ A4 --> A5[ai_init\n3 enemy agents spawned]
41
+ A5 --> A6[worm_init\ngenesis block BOB magic]
42
+ end
43
+
44
+ subgraph Game Loop
45
+ L0[input_update\nread g_keys] --> L1[player_update\nturn/move sovereign agent]
46
+ L1 --> L2[ai_update_all\ntick 3 agent state machines]
47
+ L2 --> L3[render_clear\nceiling + floor fill]
48
+ L3 --> L4[render_walls\nDDA raycast 320 columns]
49
+ L4 --> L5[render_agents\nsprite projection]
50
+ L5 --> L6[render_hud\nhealth bar bottom row]
51
+ L6 --> L7[vga_flip\nblockbuf β†’ A000:0000]
52
+ L7 --> L8{frame % 64 == 0?}
53
+ L8 -->|yes| WORM[worm_tick\nserialize world state]
54
+ L8 -->|no| L0
55
+ WORM --> L0
56
+ end
57
+
58
+ A6 --> L0
59
+
60
+ subgraph AI State Machine
61
+ ST0[PATROL\ntimer countdown\nflip angle on timeout]
62
+ ST1[CHASE\nmove toward player\ntimer β†’ ATTACK]
63
+ ST2[ATTACK\ntimer β†’ PATROL]
64
+ ST3[DEAD\nno update]
65
+ ST0 -->|proximity| ST1
66
+ ST1 -->|timer=0| ST2
67
+ ST2 -->|timer=0| ST0
68
+ ST2 -->|health=0| ST3
69
+ end
70
+
71
+ subgraph WORM Chain
72
+ W0[genesis\nmagic=BOB v1.0 seq=0] --> W1[frame 64\nplayer_x/y/angle/health\nagent states 0-7]
73
+ W1 --> W2[frame 128\n...]
74
+ W2 --> WN[worm_finalize\nterminal magic=0xDEAD]
75
+ end
76
+ ```
77
+
78
+ ## File Tree
79
+
80
+ ```
81
+ bob-engine/
82
+ └── src/
83
+ └── bob_engine.asm # 961 lines β€” entire engine in one file
84
+ ```
85
+
86
+ **Internal structure of `bob_engine.asm`:**
87
+
88
+ ```
89
+ bob_engine.asm
90
+ β”œβ”€β”€ CONSTANTS # Screen (320x200), fixed-point (16.16), map (16x16), BSP, agents, WORM
91
+ β”œβ”€β”€ DATA SECTION
92
+ β”‚ β”œβ”€β”€ g_backbuf # 64000-byte back buffer (320x200)
93
+ β”‚ β”œβ”€β”€ g_px / g_py / g_pangle # Sovereign player (8.8 fixed-point)
94
+ β”‚ β”œβ”€β”€ g_keys / g_frame # Keyboard bitmask, frame counter
95
+ β”‚ β”œβ”€β”€ g_sin / g_cos # 1024-entry 16.16 fixed-point trig tables
96
+ β”‚ β”œβ”€β”€ g_bsp_nodes # 64 Γ— 16-byte BSP node array
97
+ β”‚ β”œβ”€β”€ g_agents # 8 Γ— 20-byte agent struct array
98
+ β”‚ β”œβ”€β”€ g_map # 16Γ—16 map (0=open, 1=wall)
99
+ β”‚ └── g_worm_buf / g_worm_hash # 64-byte snapshot block + 32-byte hash
100
+ └── CODE SECTION
101
+ β”œβ”€β”€ _start # Boot: init all subsystems β†’ game loop
102
+ β”œβ”€β”€ math_init # Build sin/cos lookup tables
103
+ β”œβ”€β”€ vga_init / vga_shutdown # Mode 13h set/restore + 8-color palette
104
+ β”œβ”€β”€ vga_flip # rep movsw backbuf β†’ A000:0000
105
+ β”œβ”€β”€ kb_install / kb_isr # INT 9 hook, scancode β†’ g_keys, ESC β†’ g_quit
106
+ β”œβ”€β”€ bsp_build / bsp_add_node # Walk g_map β†’ BSP leaf nodes
107
+ β”œβ”€β”€ player_init / player_update # Sovereign agent movement + turn
108
+ β”œβ”€β”€ ai_init / ai_update_all # Spawn 3 agents, tick state machines
109
+ β”œβ”€β”€ render_clear # rep stosb ceiling (CLR_CEILING) + floor (CLR_FLOOR)
110
+ β”œβ”€β”€ render_walls # 320-column DDA raycast + draw_vslice
111
+ β”œβ”€β”€ raycast_dda # DDA march: player pos β†’ wall distance β†’ g_ray_dist
112
+ β”œβ”€β”€ draw_vslice # Vertical column: center on SCREEN_HALF_H, paint CL
113
+ β”œβ”€β”€ render_agents # Project agent sector_id β†’ screen column, 4Γ—8 sprite
114
+ β”œβ”€β”€ render_hud # Health bar on bottom row (CLR_SOVEREIGN green)
115
+ └── worm_init / worm_tick / worm_finalize # WORM serialization every 64 frames
116
+ ```
117
+
118
+ ## Quick Start
119
+
120
+ **Prerequisites:** NASM assembler, DOSBox (or real DOS)
121
+
122
+ ```bash
123
+ # Build the COM file
124
+ nasm -f bin src/bob_engine.asm -o bob_engine.com
125
+
126
+ # Run in DOSBox
127
+ dosbox bob_engine.com
128
+
129
+ # Or on real DOS hardware
130
+ copy bob_engine.com C:\
131
+ C:\bob_engine.com
132
+ ```
133
+
134
+ **Controls:**
135
+
136
+ | Key | Action |
137
+ |---|---|
138
+ | Arrow Left | Turn sovereign agent left |
139
+ | Arrow Right | Turn sovereign agent right |
140
+ | Arrow Up | Move forward |
141
+ | Arrow Down | Move back |
142
+ | ESC | Exit (triggers WORM finalize) |
143
+
144
+ **Build notes:**
145
+
146
+ - Output is a raw COM binary (`ORG 0x100`) β€” no linker needed, runs direct
147
+ - Entire engine fits in a single segment (CS=DS=ES=SS)
148
+ - Stack placed at top of 64KB segment (SP=0xFFFE)
149
+ - No external libraries β€” pure x86 real-mode BIOS and DOS INT calls
150
+ - VGA palette: 0=black, 1=dark blue (ceiling), 2=dark gray (floor), 3=bright (near wall), 4=medium (mid wall), 5=dim (far wall), 6=red (enemy agents), 7=green (sovereign / HUD)
151
+
152
+ ## Key Features
153
+
154
+ - **961 lines of pure x86 NASM assembly** β€” no C runtime, no external libraries, one file, one COM binary
155
+ - **VGA Mode 13h** β€” 320x200 256-color linear framebuffer at segment `0xA000`; double-buffered via `g_backbuf` and `rep movsw` flip
156
+ - **DDA raycasting** β€” one ray per screen column (320 rays), distance computed by DDA grid march; wall slice height `= (CELL_SZ * SCREEN_H) / distance`; distance-shaded near/mid/far colors
157
+ - **BSP tree** β€” map walk generates up to 64 axis-aligned BSP leaf nodes (16 bytes each: x1/y1/x2/y2, left/right child, sector_id, color)
158
+ - **AI state machines** β€” up to 8 agents, each a 20-byte struct; three states active at boot (`PATROL Γ— 2`, `CHASE Γ— 1`); timer-driven transitions (`PATROL β†’ CHASE β†’ ATTACK β†’ PATROL`); `DEAD` state terminates updates
159
+ - **Keyboard ISR** β€” hooks INT 9 directly via DOS `AH=25h`; reads scancode from port `0x60`; sets `g_quit` on ESC; restores original vector on exit
160
+ - **16.16 fixed-point math** β€” player position in 8.8 fixed point, angles in `[0, 1024)` integer units (full circle), trig via `g_sin`/`g_cos` lookup tables
161
+ - **WORM world serialization** β€” 64-byte snapshot block (magic `BOB`, version 1.0, seq, player x/y/angle/health, agent states); serialized every 64 frames; genesis block on boot, terminal block (`magic=0xDEAD`) on clean exit
162
+ - **Sovereign / constrained duality** β€” player is the sovereign agent (full movement, Trust Deed); enemies are constrained agents (sector-bound, no free will); the world map is the law
163
+ - **HUD** β€” green health bar (`CLR_SOVEREIGN`) drawn on the bottom row of the back buffer each frame
164
+
165
+ ---
166
+
167
+ *Sovereign Source License Β· Bel Esprit D'Accord Trust Β· SnapKitty Collective Β· 2026*
168
+ *Evidence or Silence.*
169
+
170
+ ---
171
+
172
+ ## License
173
+
174
+ Licensed under **Sovereign Source License**. Full text: [LICENSE](LICENSE).