A Documenting of mine Enhanced Enchantment CHIP-8 Game This is my first game for the Octo Jam 7 event. I've improved mine Enchantment game from 2020-06-30 nicely, with great line variety. Follows is a view of the complete game, when loaded into mine MMC: 200-201 0512-0513 ▀▄▀ ▄ ▀▀ A348 41800  I ← from 202-203 0514-0515 ▀██▀▀█▀█ FF65 65381  Load V0→VF; I ← I + 16 204-205 0516-0517 ▀ █ ▄▄▀ A22C 41516  I ← ball 206-207 0518-0519 ▀█▄█ ▀▀▄ D671 54897  Draw 08×01 at V6,V7; VF ← XOR 208-209 0520-0521 ▀▀ ▄██▄ CC1E 52254  VC ← ??? AND 030 20A-20B 0522-0523 ▀▀ ▄██▄▀ CD1E 52510  VD ← ??? AND 030 20C-20D 0524-0525 ▀▀▀█ ▄ █ F115 61717 movement delay ← V1 20E-20F 0526-0527  ▀▀ ████ 6F0F 28431  VF ← 015 210-211 0528-0529 █▀█ ▀▀▀█ EFA1 61345  Skip next if VF <> key 212-213 0530-0531 ▀▀▀▀█▀█▀ FF0A 65290  VF ← key 214-215 0532-0533 ▀█▄█ ▀▀▄ D671 54897  Draw 08×01 at V6,V7; VF ← XOR 216-217 0534-0535 █▀█ ▄ E0A1 57505  Skip next if V0 <> key 218-219 0536-0537  ▀▀▀ ▀▀▄ 7601 30209  V6 ← V6 + 001 21A-21B 0538-0539 █▀█ █ E1A1 57761  Skip next if V1 <> key 21C-21D 0540-0541 ▄███▄██▄ 76FF 30463  V6 ← V6 + 255 21E-21F 0542-0543 █▀█ ▀▄ E2A1 58017  Skip next if V2 <> key 220-221 0544-0545  ▀▀▀ ▀▀█ 7701 30465  V7 ← V7 + 001 222-223 0546-0547 █▀█ ▀█ E3A1 58273  Skip next if V3 <> key 224-225 0548-0549 ▄███▄███ 77FF 30719  V7 ← V7 + 255 226-227 0550-0551 ▀▄ ▀█ 8642 34370  V6 ← V6 AND V4 228-229 0552-0553 ▀▄ ▄ ▀█▀ 8752 34642  V7 ← V7 AND V5 22A-22B 0554-0555 ▀█▄█ ▀▀▄ D671 54897  Draw 08×01 at V6,V7; VF ← XOR 22C-22D 0556-0557 █▄ 80C0 32960+ ball V0 ← VC 22E-22F 0558-0559  ▀▀ ▀ 6200 25088  V2 ← 000 230-231 0560-0561 █ ▀▀ 8380 33664  V3 ← V8 232-233 0562-0563 █ ▄ ▀ 8490 33936  V4 ← V9 234-235 0564-0565  ▀ ▀▀▀▀ 4F00 20224  Skip next if VF <> 000 236-237 0566-0567 ▀▄▀▀ ▄█ B246 45638  Jump to V0 + table 238-239 0568-0569 ▄▄▄ 00E0 00224  Clear the screen 23A-23B 0570-0571  ▀ ▀ 1200 04608  Jump to 0512 23C-23D 0572-0573 █▄ ▄ 80D0 32976 second V0 ← VD 23E-23F 0574-0575  ▀▀ ▀▄ 6201 25089  V2 ← 001 240-241 0576-0577 █ ▄ ▀▀ 83A0 33696  V3 ← VA 242-243 0578-0579 █ ▄▄ ▀ 84B0 33968  V4 ← VB 244-245 0580-0581 ▀▄▀▀ ▄█ B246 45638  Jump to V0 + table 246-247 0582-0583  ▄▄▀▄ █ 126A 04714 table Jump to up left 248-249 0584-0585  ▄▄█ ▀ 1270 04720  Jump to up right 24A-24B 0586-0587  ▄▄█ ▄█ 1276 04726  Jump to down left 24C-24D 0588-0589  ▄▄█▄▄▀ 127C 04732  Jump to down right 24E-24F 0590-0591 ▄ ▀ █ 1282 04738  Jump to left up 250-251 0592-0593 ▄ ▀▄ ▀ 1288 04744  Jump to left down 252-253 0594-0595 ▄ ▀▄▄█ 128E 04750  Jump to right up 254-255 0596-0597 ▄ █ ▄▀ 1294 04756  Jump to right down 256-257 0598-0599 ▄ █▄ █ 129A 04762  Jump to two up left 258-259 0600-0601 ▄ ▄▀ █ 12A2 04770  Jump to two up right 25A-25B 0602-0603 ▄ ▄▀▄ █ 12AA 04778  Jump to two down left 25C-25D 0604-0605 ▄ ▄█ █ 12B2 04786  Jump to two down right 25E-25F 0606-0607 ▄ ▄█▄ █ 12BA 04794  Jump to two left up 260-261 0608-0609 ▄▄ ▀ █ 12C2 04802  Jump to two right down 262-263 0610-0611 ▄▄ ▀▄ █ 12CA 04810  Jump to left targeting 264-265 0612-0613 ▄▄ ▀▄▄▀ 12CC 04812  Jump to right targeting 266-267 0614-0615 ▄▄ █▄▄█ 12DE 04830  Jump to up 268-269 0616-0617 ▄▄▄▀ ▀ 12E0 04832  Jump to down 26A-26B 0618-0619 ▄███▄▄██ 73FF 29695 up left V3 ← V3 + 255 26C-26D 0620-0621  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 26E-26F 0622-0623 ▄▄▄▀ █ 12E2 04834  Jump to integrate 270-271 0624-0625  ▀▀▀ ▀█ 7301 29441 up right V3 ← V3 + 001 272-273 0626-0627  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 274-275 0628-0629 ▄▄▄▀ █ 12E2 04834  Jump to integrate 276-277 0630-0631 ▄███▄▄██ 73FF 29695 down left V3 ← V3 + 255 278-279 0632-0633 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 27A-27B 0634-0635 ▄▄▄▀ █ 12E2 04834  Jump to integrate 27C-27D 0636-0637  ▀▀▀ ▀█ 7301 29441 down right V3 ← V3 + 001 27E-27F 0638-0639 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 280-281 0640-0641 ▄▄▄▀ █ 12E2 04834  Jump to integrate 282-283 0642-0643  ▀▀▀ ▀█ 7301 29441 left up V3 ← V3 + 001 284-285 0644-0645 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 286-287 0646-0647 ▄▄▄▀ █ 12E2 04834  Jump to integrate 288-289 0648-0649  ▀▀▀ ▀█ 7301 29441 left down V3 ← V3 + 001 28A-28B 0650-0651  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 28C-28D 0652-0653 ▄▄▄▀ █ 12E2 04834  Jump to integrate 28E-28F 0654-0655 ▄███▄▄██ 73FF 29695 right up V3 ← V3 + 255 290-291 0656-0657 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 292-293 0658-0659 ▄▄▄▀ █ 12E2 04834  Jump to integrate 294-295 0660-0661 ▄███▄▄██ 73FF 29695 right down V3 ← V3 + 255 296-297 0662-0663  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 298-299 0664-0665 ▄▄▄▀ █ 12E2 04834  Jump to integrate 29A-29B 0666-0667 ▄███▄▄█▀ 73FE 29694 two up left V3 ← V3 + 254 29C-29D 0668-0669  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 29E-29F 0670-0671 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2A0-2A1 0672-0673 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2A2-2A3 0674-0675  ▀▀▀ █▀ 7302 29442 two up right V3 ← V3 + 002 2A4-2A5 0676-0677  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 2A6-2A7 0678-0679 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2A8-2A9 0680-0681 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2AA-2AB 0682-0683 ▄███▄▄█▀ 73FE 29694 two down left V3 ← V3 + 254 2AC-2AD 0684-0685 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 2AE-2AF 0686-0687 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2B0-2B1 0688-0689 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2B2-2B3 0690-0691  ▀▀▀ █▀ 7302 29442 two down right V3 ← V3 + 002 2B4-2B5 0692-0693 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 2B6-2B7 0694-0695 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2B8-2B9 0696-0697 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2BA-2BB 0698-0699  ▀▀▀ █▀ 7302 29442 two left up V3 ← V3 + 002 2BC-2BD 0700-0701  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 2BE-2BF 0702-0703 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2C0-2C1 0704-0705 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2C2-2C3 0706-0707 ▄███▄▄█▀ 73FE 29694 two right down V3 ← V3 + 254 2C4-2C5 0708-0709 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 2C6-2C7 0710-0711 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2C8-2C9 0712-0713 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2CA-2CB 0714-0715 ▄███▄▄█▀ 73FE 29694 left targeting V3 ← V3 + 254 2CC-2CD 0716-0717  ▀▀▀ ▀█ 7301 29441 right targeting V3 ← V3 + 001 2CE-2CF 0718-0719  █▄▀ ▀▀ 5360 21344  Skip next if V3 = V6 2D0-2D1 0720-0721 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2D2-2D3 0722-0723 ▀▄ ▀ 8140 33088  V1 ← V4 2D4-2D5 0724-0725 ▀▄▄▄ ▄ █ 8175 33141  V1 ← V1 − V7; VF ← borrow 2D6-2D7 0726-0727  ▀█ 6020 24608  V0 ← 032 2D8-2D9 0728-0729  ▀ ▀▀▀▀ 4F00 20224  Skip next if VF <> 000 2DA-2DB 0730-0731  ▀█ ▄ 6022 24610  V0 ← 034 2DC-2DD 0732-0733 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2DE-2DF 0734-0735 ▄███▄█▄ 74FE 29950 up V4 ← V4 + 254 2E0-2E1 0736-0737  ▀▀▀ ▀ ▄ 7401 29697 down V4 ← V4 + 001 2E2-2E3 0738-0739 ▀▀▀▀ ▄▄█ F107 61703 integrate V1 ← delay 2E4-2E5 0740-0741  ▀▀ ▀ 3100 12544  Skip next if V1 = 000 2E6-2E7 0742-0743 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2E8-2E9 0744-0745 ▄█▄▄▄▄█▀ 43FE 17406  Skip next if V3 <> 254 2EA-2EB 0746-0747  ▄█ ▄█▀ 1336 04918  Jump to new line 2EC-2ED 0748-0749 ▄█▄▄▄█▄ 44FE 17662  Skip next if V4 <> 254 2EE-2EF 0750-0751  ▄█ ▄█▀ 1336 04918  Jump to new line 2F0-2F1 0752-0753 ▄█▄▄▄▄██ 43FF 17407  Skip next if V3 <> 255 2F2-2F3 0754-0755  ▄█ ▄█▀ 1336 04918  Jump to new line 2F4-2F5 0756-0757 ▄█▄▄▄█▄▄ 44FF 17663  Skip next if V4 <> 255 2F6-2F7 0758-0759  ▄█ ▄█▀ 1336 04918  Jump to new line 2F8-2F9 0760-0761  █ ▀█ 4341 17217  Skip next if V3 <> 065 2FA-2FB 0762-0763  ▄█ ▄█▀ 1336 04918  Jump to new line 2FC-2FD 0764-0765  ▀▄ ▀ ▄ 4421 17441  Skip next if V4 <> 033 2FE-2FF 0766-0767  ▄█ ▄█▀ 1336 04918  Jump to new line 300-301 0768-0769  █ ▀▀ 4340 17216  Skip next if V3 <> 064 302-303 0770-0771  ▄█ ▄█▀ 1336 04918  Jump to new line 304-305 0772-0773  ▀▄ ▀ 4420 17440  Skip next if V4 <> 032 306-307 0774-0775  ▄█ ▄█▀ 1336 04918  Jump to new line 308-309 0776-0777 ▀█ ▀ ▀█ D341 54081  Draw 08×01 at V3,V4; VF ← XOR 30A-30B 0778-0779  ▀ ▀▀ 4300 17152  Skip next if V3 <> 000 30C-30D 0780-0781  ▄█ ▄█▀ 1336 04918  Jump to new line 30E-30F 0782-0783  ▀▄▄▄▄██ 433F 17215  Skip next if V3 <> 063 310-311 0784-0785  ▄█ ▄█▀ 1336 04918  Jump to new line 312-313 0786-0787  ▀ ▀ 4400 17408  Skip next if V4 <> 000 314-315 0788-0789  ▄█ ▄█▀ 1336 04918  Jump to new line 316-317 0790-0791  ▀ ▄▄█▄▄ 441F 17439  Skip next if V4 <> 031 318-319 0792-0793  ▄█ ▄█▀ 1336 04918  Jump to new line 31A-31B 0794-0795 ▀ █ ▄▄▀ A22C 41516 dispatch I ← ball 31C-31D 0796-0797  ▀▀ ▀ 3200 12800  Skip next if V2 = 000 31E-31F 0798-0799  ▄▀▄ ▀▀ 1328 04904  Jump to next 320-321 0800-0801 ▀ ▀▀ 8C00 35840  VC ← V0 322-323 0802-0803 ▀ ▄▄▀ 8830 34864  V8 ← V3 324-325 0804-0805 ▀▄ ▀ ▀ 8940 35136  V9 ← V4 326-327 0806-0807  ▄█▄▄▀ 123C 04668  Jump to second 328-329 0808-0809 ▀ ▀▀ ▀ 8D00 36096 next VD ← V0 32A-32B 0810-0811 ▀ ▄▄▀ ▀ 8A30 35376  VA ← V3 32C-32D 0812-0813 ▀▄ ▀ ▀▀ 8B40 35648  VB ← V4 32E-32F 0814-0815 ▀▄▀ ▄ ▀▀ A348 41800  I ← from 330-331 0816-0817 ▀██▀ █ ▄ F465 62565  Load V0→V4; I ← I + 05 332-333 0818-0819 ▀ █ ▄▄▀ A22C 41516  I ← ball 334-335 0820-0821  ▀▄▄▀ 120C 04620  Jump to movement 336-337 0822-0823 ▀▀ ▄▄▄▄ C01E 49182 new line V0 ← ??? AND 030 338-339 0824-0825 ▀▀ █ C101 49409  V1 ← ??? AND 001 33A-33B 0826-0827 ▀▀▄▄▄▄██ C33F 49983  V3 ← ??? AND 063 33C-33D 0828-0829 ▀▀ ▄▄█▄▄ C41F 50207  V4 ← ??? AND 031 33E-33F 0830-0831  ▀▀ ▀ 3100 12544  Skip next if V1 = 000 340-341 0832-0833  ▀▀ ▀▀ 6300 25344  V3 ← 000 342-343 0834-0835  ▀ ▀ 4100 16640  Skip next if V1 <> 000 344-345 0836-0837  ▀▀ ▀ 6400 25600  V4 ← 000 346-347 0838-0839  █▄ █▀ 131A 04890  Jump to dispatch 348 0840  ██ 06 006 from 349 0841  █ 04 004 34A 0842  █ 02 002 34B 0843  █ 08 008 34C 0844  ██████ 3F 063 34D 0845  █████ 1F 031 34E 0846  █████ 1F 031 34F 0847  ████ 0F 015  The register usage is as follows: V0 Right movement button and holding the identifier code. V1 Left movement button, delay, and miscellaneous storage. V2 Down movement button and first or second line boolean. V3 Up movement button. V4 Horizontal mask. V5 Vertical mask. V6 Horizontal coordinate of player. V7 Vertical coordinate of player. V8 Horizontal coordinate of first line. V9 Vertical coordinate of first line. VA Horizontal coordinate of second line. VB Vertical coordinate of second line. VC Identifier code of first line. VD Identifier code of second line. VE Unused. VF Collision detection and holding a key code. The registers were chosen for the following reasons: V0 Ease of access. V1 Ease of access. V2 Ease of access. V3 Ease of access. V4 Ease of access. V5 It follows V4. V6 It's even. V7 It follows V6. V8 It follows the V6 and V7 pattern. V9 It follows the V6 and V7 pattern. VA It follows the V6 and V7 pattern. VB It follows the V6 and V7 pattern. VC It's even. VD It follows VC. VE Unused. VF Unimportance and necessity. The game begins by initializing the registers and setting I to its primary value. The player sprite is drawn and both line identifier registers are initialized to random values. Note that this chosen mask results in sixteen distinct values which will always be even, perfectly suitable for the table: 200-201 0512-0513 ▀▄▀ ▄ ▀▀ A348 41800  I ← from 202-203 0514-0515 ▀██▀▀█▀█ FF65 65381  Load V0→VF; I ← I + 16 204-205 0516-0517 ▀ █ ▄▄▀ A22C 41516  I ← ball 206-207 0518-0519 ▀█▄█ ▀▀▄ D671 54897  Draw 08×01 at V6,V7; VF ← XOR 208-209 0520-0521 ▀▀ ▄██▄ CC1E 52254  VC ← ??? AND 030 20A-20B 0522-0523 ▀▀ ▄██▄▀ CD1E 52510  VD ← ??? AND 030 The delay is set and then the player movement is calculated; the fifteenth key works as a pause key, with movement in the cardinal directions being the only other options. The new position is ANDed to maintain bounds. This code results in the player sprite flickering, but such is desirable for this: 20C-20D 0524-0525 ▀▀▀█ ▄ █ F115 61717 movement delay ← V1 20E-20F 0526-0527  ▀▀ ████ 6F0F 28431  VF ← 015 210-211 0528-0529 █▀█ ▀▀▀█ EFA1 61345  Skip next if VF <> key 212-213 0530-0531 ▀▀▀▀█▀█▀ FF0A 65290  VF ← key 214-215 0532-0533 ▀█▄█ ▀▀▄ D671 54897  Draw 08×01 at V6,V7; VF ← XOR 216-217 0534-0535 █▀█ ▄ E0A1 57505  Skip next if V0 <> key 218-219 0536-0537  ▀▀▀ ▀▀▄ 7601 30209  V6 ← V6 + 001 21A-21B 0538-0539 █▀█ █ E1A1 57761  Skip next if V1 <> key 21C-21D 0540-0541 ▄███▄██▄ 76FF 30463  V6 ← V6 + 255 21E-21F 0542-0543 █▀█ ▀▄ E2A1 58017  Skip next if V2 <> key 220-221 0544-0545  ▀▀▀ ▀▀█ 7701 30465  V7 ← V7 + 001 222-223 0546-0547 █▀█ ▀█ E3A1 58273  Skip next if V3 <> key 224-225 0548-0549 ▄███▄███ 77FF 30719  V7 ← V7 + 255 226-227 0550-0551 ▀▄ ▀█ 8642 34370  V6 ← V6 AND V4 228-229 0552-0553 ▀▄ ▄ ▀█▀ 8752 34642  V7 ← V7 AND V5 22A-22B 0554-0555 ▀█▄█ ▀▀▄ D671 54897  Draw 08×01 at V6,V7; VF ← XOR Conveniently, the 80C0 instruction functions as the ball and two balls sprites. The first line gets its parameters copied and the game enters the jump table by the line identifier, unless the previous player draw resulted in a collision, in which case the screen is cleared and the game is then reset: 22C-22D 0556-0557 █▄ 80C0 32960+ ball V0 ← VC 22E-22F 0558-0559  ▀▀ ▀ 6200 25088  V2 ← 000 230-231 0560-0561 █ ▀▀ 8380 33664  V3 ← V8 232-233 0562-0563 █ ▄ ▀ 8490 33936  V4 ← V9 234-235 0564-0565  ▀ ▀▀▀▀ 4F00 20224  Skip next if VF <> 000 236-237 0566-0567 ▀▄▀▀ ▄█ B246 45638  Jump to V0 + table 238-239 0568-0569 ▄▄▄ 00E0 00224  Clear the screen 23A-23B 0570-0571  ▀ ▀ 1200 04608  Jump to 0512 This fragment merely does the same for the second line: 23C-23D 0572-0573 █▄ ▄ 80D0 32976 second V0 ← VD 23E-23F 0574-0575  ▀▀ ▀▄ 6201 25089  V2 ← 001 240-241 0576-0577 █ ▄ ▀▀ 83A0 33696  V3 ← VA 242-243 0578-0579 █ ▄▄ ▀ 84B0 33968  V4 ← VB 244-245 0580-0581 ▀▄▀▀ ▄█ B246 45638  Jump to V0 + table This is the jump table; notice neither up or down won't be selected by the mask, being out of range: 246-247 0582-0583  ▄▄▀▄ █ 126A 04714 table Jump to up left 248-249 0584-0585  ▄▄█ ▀ 1270 04720  Jump to up right 24A-24B 0586-0587  ▄▄█ ▄█ 1276 04726  Jump to down left 24C-24D 0588-0589  ▄▄█▄▄▀ 127C 04732  Jump to down right 24E-24F 0590-0591 ▄ ▀ █ 1282 04738  Jump to left up 250-251 0592-0593 ▄ ▀▄ ▀ 1288 04744  Jump to left down 252-253 0594-0595 ▄ ▀▄▄█ 128E 04750  Jump to right up 254-255 0596-0597 ▄ █ ▄▀ 1294 04756  Jump to right down 256-257 0598-0599 ▄ █▄ █ 129A 04762  Jump to two up left 258-259 0600-0601 ▄ ▄▀ █ 12A2 04770  Jump to two up right 25A-25B 0602-0603 ▄ ▄▀▄ █ 12AA 04778  Jump to two down left 25C-25D 0604-0605 ▄ ▄█ █ 12B2 04786  Jump to two down right 25E-25F 0606-0607 ▄ ▄█▄ █ 12BA 04794  Jump to two left up 260-261 0608-0609 ▄▄ ▀ █ 12C2 04802  Jump to two right down 262-263 0610-0611 ▄▄ ▀▄ █ 12CA 04810  Jump to left targeting 264-265 0612-0613 ▄▄ ▀▄▄▀ 12CC 04812  Jump to right targeting 266-267 0614-0615 ▄▄ █▄▄█ 12DE 04830  Jump to up 268-269 0616-0617 ▄▄▄▀ ▀ 12E0 04832  Jump to down These line routines implement those which move one-by-one, beginning from the top or bottom: 26A-26B 0618-0619 ▄███▄▄██ 73FF 29695 up left V3 ← V3 + 255 26C-26D 0620-0621  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 26E-26F 0622-0623 ▄▄▄▀ █ 12E2 04834  Jump to integrate 270-271 0624-0625  ▀▀▀ ▀█ 7301 29441 up right V3 ← V3 + 001 272-273 0626-0627  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 274-275 0628-0629 ▄▄▄▀ █ 12E2 04834  Jump to integrate 276-277 0630-0631 ▄███▄▄██ 73FF 29695 down left V3 ← V3 + 255 278-279 0632-0633 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 27A-27B 0634-0635 ▄▄▄▀ █ 12E2 04834  Jump to integrate 27C-27D 0636-0637  ▀▀▀ ▀█ 7301 29441 down right V3 ← V3 + 001 27E-27F 0638-0639 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 280-281 0640-0641 ▄▄▄▀ █ 12E2 04834  Jump to integrate These implement those beginning from the left or right: 282-283 0642-0643  ▀▀▀ ▀█ 7301 29441 left up V3 ← V3 + 001 284-285 0644-0645 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 286-287 0646-0647 ▄▄▄▀ █ 12E2 04834  Jump to integrate 288-289 0648-0649  ▀▀▀ ▀█ 7301 29441 left down V3 ← V3 + 001 28A-28B 0650-0651  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 28C-28D 0652-0653 ▄▄▄▀ █ 12E2 04834  Jump to integrate 28E-28F 0654-0655 ▄███▄▄██ 73FF 29695 right up V3 ← V3 + 255 290-291 0656-0657 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 292-293 0658-0659 ▄▄▄▀ █ 12E2 04834  Jump to integrate 294-295 0660-0661 ▄███▄▄██ 73FF 29695 right down V3 ← V3 + 255 296-297 0662-0663  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 298-299 0664-0665 ▄▄▄▀ █ 12E2 04834  Jump to integrate These are kin to the first four, but move left or right two-at-a-time, changing the sprite for this: 29A-29B 0666-0667 ▄███▄▄█▀ 73FE 29694 two up left V3 ← V3 + 254 29C-29D 0668-0669  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 29E-29F 0670-0671 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2A0-2A1 0672-0673 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2A2-2A3 0674-0675  ▀▀▀ █▀ 7302 29442 two up right V3 ← V3 + 002 2A4-2A5 0676-0677  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 2A6-2A7 0678-0679 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2A8-2A9 0680-0681 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2AA-2AB 0682-0683 ▄███▄▄█▀ 73FE 29694 two down left V3 ← V3 + 254 2AC-2AD 0684-0685 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 2AE-2AF 0686-0687 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2B0-2B1 0688-0689 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2B2-2B3 0690-0691  ▀▀▀ █▀ 7302 29442 two down right V3 ← V3 + 002 2B4-2B5 0692-0693 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 2B6-2B7 0694-0695 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2B8-2B9 0696-0697 ▄▄▄▀ █ 12E2 04834  Jump to integrate To fit the targeting lines, the two-at-a-time left or right routines are uneven: 2BA-2BB 0698-0699  ▀▀▀ █▀ 7302 29442 two left up V3 ← V3 + 002 2BC-2BD 0700-0701  ▀▀▀ ▀ ▄ 7401 29697  V4 ← V4 + 001 2BE-2BF 0702-0703 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2C0-2C1 0704-0705 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2C2-2C3 0706-0707 ▄███▄▄█▀ 73FE 29694 two right down V3 ← V3 + 254 2C4-2C5 0708-0709 ▄███▄█▄▄ 74FF 29951  V4 ← V4 + 255 2C6-2C7 0710-0711 ▀ █ ▄▄▀▄ A22D 41517  I ← two balls 2C8-2C9 0712-0713 ▄▄▄▀ █ 12E2 04834  Jump to integrate The targeting lines progress from the left or right until they align with the player, which then has them switch their codes to up or down, based on the relative position of the player; originally, I'd duplicated these routines, then combined them with a 5CC0, and finally realized that was unnecessary and that simply offsetting the offset would work to combine them. I realized in testing that it was possible to evade the targeting entirely, but decided to allow it as the behaviour is also more fun: 2CA-2CB 0714-0715 ▄███▄▄█▀ 73FE 29694 left targeting V3 ← V3 + 254 2CC-2CD 0716-0717  ▀▀▀ ▀█ 7301 29441 right targeting V3 ← V3 + 001 2CE-2CF 0718-0719  █▄▀ ▀▀ 5360 21344  Skip next if V3 = V6 2D0-2D1 0720-0721 ▄▄▄▀ █ 12E2 04834  Jump to integrate 2D2-2D3 0722-0723 ▀▄ ▀ 8140 33088  V1 ← V4 2D4-2D5 0724-0725 ▀▄▄▄ ▄ █ 8175 33141  V1 ← V1 − V7; VF ← borrow 2D6-2D7 0726-0727  ▀█ 6020 24608  V0 ← 032 2D8-2D9 0728-0729  ▀ ▀▀▀▀ 4F00 20224  Skip next if VF <> 000 2DA-2DB 0730-0731  ▀█ ▄ 6022 24610  V0 ← 034 2DC-2DD 0732-0733 ▄▄▄▀ █ 12E2 04834  Jump to integrate The up and down routines combine similarly. The delay is exhausted here, as this was easiest: 2DE-2DF 0734-0735 ▄███▄█▄ 74FE 29950 up V4 ← V4 + 254 2E0-2E1 0736-0737  ▀▀▀ ▀ ▄ 7401 29697 down V4 ← V4 + 001 2E2-2E3 0738-0739 ▀▀▀▀ ▄▄█ F107 61703 integrate V1 ← delay 2E4-2E5 0740-0741  ▀▀ ▀ 3100 12544  Skip next if V1 = 000 2E6-2E7 0742-0743 ▄▄▄▀ █ 12E2 04834  Jump to integrate The out-of-screen bounds are checked before drawing. Having two-at-a-time lines doubled the checks: 2E8-2E9 0744-0745 ▄█▄▄▄▄█▀ 43FE 17406  Skip next if V3 <> 254 2EA-2EB 0746-0747  ▄█ ▄█▀ 1336 04918  Jump to new line 2EC-2ED 0748-0749 ▄█▄▄▄█▄ 44FE 17662  Skip next if V4 <> 254 2EE-2EF 0750-0751  ▄█ ▄█▀ 1336 04918  Jump to new line 2F0-2F1 0752-0753 ▄█▄▄▄▄██ 43FF 17407  Skip next if V3 <> 255 2F2-2F3 0754-0755  ▄█ ▄█▀ 1336 04918  Jump to new line 2F4-2F5 0756-0757 ▄█▄▄▄█▄▄ 44FF 17663  Skip next if V4 <> 255 2F6-2F7 0758-0759  ▄█ ▄█▀ 1336 04918  Jump to new line 2F8-2F9 0760-0761  █ ▀█ 4341 17217  Skip next if V3 <> 065 2FA-2FB 0762-0763  ▄█ ▄█▀ 1336 04918  Jump to new line 2FC-2FD 0764-0765  ▀▄ ▀ ▄ 4421 17441  Skip next if V4 <> 033 2FE-2FF 0766-0767  ▄█ ▄█▀ 1336 04918  Jump to new line 300-301 0768-0769  █ ▀▀ 4340 17216  Skip next if V3 <> 064 302-303 0770-0771  ▄█ ▄█▀ 1336 04918  Jump to new line 304-305 0772-0773  ▀▄ ▀ 4420 17440  Skip next if V4 <> 032 306-307 0774-0775  ▄█ ▄█▀ 1336 04918  Jump to new line That new line segment is drawn, and in-screen bounds are checked. I notice now this is unnecessary: 308-309 0776-0777 ▀█ ▀ ▀█ D341 54081  Draw 08×01 at V3,V4; VF ← XOR 30A-30B 0778-0779  ▀ ▀▀ 4300 17152  Skip next if V3 <> 000 30C-30D 0780-0781  ▄█ ▄█▀ 1336 04918  Jump to new line 30E-30F 0782-0783  ▀▄▄▄▄██ 433F 17215  Skip next if V3 <> 063 310-311 0784-0785  ▄█ ▄█▀ 1336 04918  Jump to new line 312-313 0786-0787  ▀ ▀ 4400 17408  Skip next if V4 <> 000 314-315 0788-0789  ▄█ ▄█▀ 1336 04918  Jump to new line 316-317 0790-0791  ▀ ▄▄█▄▄ 441F 17439  Skip next if V4 <> 031 318-319 0792-0793  ▄█ ▄█▀ 1336 04918  Jump to new line This dispatch assigns the ball sprite, perhaps wastefully, and perhaps the new first line values: 31A-31B 0794-0795 ▀ █ ▄▄▀ A22C 41516 dispatch I ← ball 31C-31D 0796-0797  ▀▀ ▀ 3200 12800  Skip next if V2 = 000 31E-31F 0798-0799  ▄▀▄ ▀▀ 1328 04904  Jump to next 320-321 0800-0801 ▀ ▀▀ 8C00 35840  VC ← V0 322-323 0802-0803 ▀ ▄▄▀ 8830 34864  V8 ← V3 324-325 0804-0805 ▀▄ ▀ ▀ 8940 35136  V9 ← V4 326-327 0806-0807  ▄█▄▄▀ 123C 04668  Jump to second Otherwise, the second line values are assigned, the earliest registers restored, and the game loops: 328-329 0808-0809 ▀ ▀▀ ▀ 8D00 36096 next VD ← V0 32A-32B 0810-0811 ▀ ▄▄▀ ▀ 8A30 35376  VA ← V3 32C-32D 0812-0813 ▀▄ ▀ ▀▀ 8B40 35648  VB ← V4 32E-32F 0814-0815 ▀▄▀ ▄ ▀▀ A348 41800  I ← from 330-331 0816-0817 ▀██▀ █ ▄ F465 62565  Load V0→V4; I ← I + 05 332-333 0818-0819 ▀ █ ▄▄▀ A22C 41516  I ← ball 334-335 0820-0821  ▀▄▄▀ 120C 04620  Jump to movement The new line routine assigns starting positions randomly at the edges of that screen, before jumping to dispatch; a line type may start in a position which immediately kills it, but this is a fine way: 336-337 0822-0823 ▀▀ ▄▄▄▄ C01E 49182 new line V0 ← ??? AND 030 338-339 0824-0825 ▀▀ █ C101 49409  V1 ← ??? AND 001 33A-33B 0826-0827 ▀▀▄▄▄▄██ C33F 49983  V3 ← ??? AND 063 33C-33D 0828-0829 ▀▀ ▄▄█▄▄ C41F 50207  V4 ← ??? AND 031 33E-33F 0830-0831  ▀▀ ▀ 3100 12544  Skip next if V1 = 000 340-341 0832-0833  ▀▀ ▀▀ 6300 25344  V3 ← 000 342-343 0834-0835  ▀ ▀ 4100 16640  Skip next if V1 <> 000 344-345 0836-0837  ▀▀ ▀ 6400 25600  V4 ← 000 346-347 0838-0839  █▄ █▀ 131A 04890  Jump to dispatch The game ends with those initial register values: 348 0840  ██ 06 006 from 349 0841  █ 04 004 34A 0842  █ 02 002 34B 0843  █ 08 008 34C 0844  ██████ 3F 063 34D 0845  █████ 1F 031 34E 0846  █████ 1F 031 34F 0847  ████ 0F 015  I'm glad to have enhanced mine Enchantment game so thoroughly. It's genuinely fun, in mine eyes. I notice minor flaws, but they're not damning; being able to occasionally evade the targeting lines is fun, and the lines occasionally stopping before drawing the final pixel allows for extra mobilility, when traversing the screen, which will become a chaotic mess anyway. My game could certainly become smaller, but it's more easily modified this way, and it's still small. Ultimately, I'm pleased now. .