A Documenting of mine Advanced Asphyxiation CHIP-8 Game This is documentation for the Advanced Asphyxiation CHIP-8 game, a rewriting and improvement of what I wrote earlier. This is more faithful to the original game, truly being a game, but lacks enemies. Follows is the program as displayed in mine MMC, how I see it as I wrote it: [32m200-201 [31m0512-0513 [34m________ 00[m[34mFF[m[34m 00255 [39m Enable extended mode [32m202-203 [31m0514-0515 [34m#_#_ ^^^ A7[m[34mF0[m[34m 42992 [39m I <- 2032 [32m204-205 [31m0516-0517 [34m^##^^#^# FF[m[34m65[m[34m 65381 [39m Load V0->VF; I <- I + 16 [32m206-207 [31m0518-0519 [34m ^^ _^#^ 67[m[34m0A[m[34m 26378 [39m V7 <- 010 [32m208-209 [31m0520-0521 [34m_##_#__# 69[m[34mFF[m[34m 27135 [39m V9 <- 255 [32m20A-20B [31m0522-0523 [34m^ ^__ ^ A[4m2[m[34m[4m18[m[34m 41496 [39m I <- player [32m20C-20D [31m0524-0525 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR [32m20E-20F [31m0526-0527 [34m^^ ^^^_ CE[m[34m01[m[34m 52737[33m maze[39m VE <- ??? AND 001 [32m210-211 [31m0528-0529 [34m ^^ ^^ ^ 6D[m[34m00[m[34m 27904 [39m VD <- 000 [32m212-213 [31m0530-0531 [34m^_^ __#^ A[4m3[m[34m[4m4E[m[34m 41806[33m maze step[39m I <- backstage [32m214-215 [31m0532-0533 [34m^^^###_^ FD[m[34m1E[m[34m 64798 [39m I <- I + VD [32m216-217 [31m0534-0535 [34m^##^ _^# F3[m[34m65[m[34m 62309 [39m Load V0->V3; I <- I + 04 [32m218-219 [31m0536-0537 [34m^ ___ 80[m[34m0E[m[34m 32782[33m player[39m V0 <- V0 x 2; VF <- MSB [32m21A-21B [31m0538-0539 [34m#____#_ 84[m[34mFE[m[34m 34046 [39m V4 <- VF x 2; VF <- MSB [32m21C-21D [31m0540-0541 [34m^ ____^ 81[m[34m1E[m[34m 33054 [39m V1 <- V1 x 2; VF <- MSB [32m21E-21F [31m0542-0543 [34m#___ ^ _ 84[m[34mF1[m[34m 34033 [39m V4 <- V4 OR VF [32m220-221 [31m0544-0545 [34m#__ _#_^ 85[m[34mEE[m[34m 34286 [39m V5 <- VE x 2; VF <- MSB [32m222-223 [31m0546-0547 [34m^ _ __# 82[m[34m2E[m[34m 33326 [39m V2 <- V2 x 2; VF <- MSB [32m224-225 [31m0548-0549 [34m#___^^^ 8E[m[34mF0[m[34m 36592 [39m VE <- VF [32m226-227 [31m0550-0551 [34m#___ ^ # 85[m[34mF1[m[34m 34289 [39m V5 <- V5 OR VF [32m228-229 [31m0552-0553 [34m^_ __#_^ 85[m[34m5E[m[34m 34142 [39m V5 <- V5 x 2; VF <- MSB [32m22A-22B [31m0554-0555 [34m^ ____#^ 83[m[34m3E[m[34m 33598 [39m V3 <- V3 x 2; VF <- MSB [32m22C-22D [31m0556-0557 [34m#___ ^ # 85[m[34mF1[m[34m 34289 [39m V5 <- V5 OR VF [32m22E-22F [31m0558-0559 [34m^ #___#^ A[4m3[m[34m[4m3E[m[34m 41790 [39m I <- random [32m230-231 [31m0560-0561 [34m^^^#_#_ F4[m[34m1E[m[34m 62494 [39m I <- I + V4 [32m232-233 [31m0562-0563 [34m^##^ _ _ F0[m[34m65[m[34m 61541 [39m Load V0->V0; I <- I + 01 [32m234-235 [31m0564-0565 [34m # #^ 2[4m3[m[34m[4m22[m[34m 08994 [39m Call shift [32m236-237 [31m0566-0567 [34m#___ ^ 82[m[34mF0[m[34m 33520 [39m V2 <- VF [32m238-239 [31m0568-0569 [34m^_^ #^ A[4m3[m[34m[4m42[m[34m 41794 [39m I <- drunk [32m23A-23B [31m0570-0571 [34m^^^#_#_ F4[m[34m1E[m[34m 62494 [39m I <- I + V4 [32m23C-23D [31m0572-0573 [34m^##^ _ _ F0[m[34m65[m[34m 61541 [39m Load V0->V0; I <- I + 01 [32m23E-23F [31m0574-0575 [34m # #^ 2[4m3[m[34m[4m22[m[34m 08994 [39m Call shift [32m240-241 [31m0576-0577 [34m ^^ ^ 32[m[34m00[m[34m 12800 [39m Skip next if V2 = 000 [32m242-243 [31m0578-0579 [34m^^ ^^^# CF[m[34m01[m[34m 52993 [39m VF <- ??? AND 001 [32m244-245 [31m0580-0581 [34m ^^ 60[m[34m00[m[34m 24576 [39m V0 <- 000 [32m246-247 [31m0582-0583 [34m ^^^^^^ 3F[m[34m00[m[34m 16128 [39m Skip next if VF = 000 [32m248-249 [31m0584-0585 [34m_##_ 60[m[34mF0[m[34m 24816 [39m V0 <- 240 [32m24A-24B [31m0586-0587 [34m^_^_ ^^ A[4m3[m[34m[4m50[m[34m 41808 [39m I <- stage [32m24C-24D [31m0588-0589 [34m^^^###_^ FD[m[34m1E[m[34m 64798 [39m I <- I + VD [32m24E-24F [31m0590-0591 [34m^#^# _ _ F0[m[34m55[m[34m 61525 [39m Save V0->V0; I <- I + 01 [32m250-251 [31m0592-0593 [34m ^^^^^ # 7D[m[34m01[m[34m 32001 [39m VD <- VD + 001 [32m252-253 [31m0594-0595 [34m ^#^^ ^ 3D[m[34m10[m[34m 15632 [39m Skip next if VD = 016 [32m254-255 [31m0596-0597 [34m __^ _^ 1[4m2[m[34m[4m64[m[34m 04708 [39m Jump to draw curtains [32m256-257 [31m0598-0599 [34m^_#_ ^^ A[4m3[m[34m[4m70[m[34m 41840 [39m I <- wardrobe [32m258-259 [31m0600-0601 [34m^#^#^#^# FF[m[34m55[m[34m 65365 [39m Save V0->VF; I <- I + 16 [32m25A-25B [31m0602-0603 [34m^_^_ ^^ A[4m3[m[34m[4m50[m[34m 41808 [39m I <- stage [32m25C-25D [31m0604-0605 [34m^##^^#^# FF[m[34m65[m[34m 65381 [39m Load V0->VF; I <- I + 16 [32m25E-25F [31m0606-0607 [34m^#^#^#^# FF[m[34m55[m[34m 65365 [39m Save V0->VF; I <- I + 16 [32m260-261 [31m0608-0609 [34m^_#_ ^^ A[4m3[m[34m[4m70[m[34m 41840 [39m I <- wardrobe [32m262-263 [31m0610-0611 [34m^##^^#^# FF[m[34m65[m[34m 65381 [39m Load V0->VF; I <- I + 16 [32m264-265 [31m0612-0613 [34m ^^^^^ _ 7C[m[34m01[m[34m 31745[33m draw curtains[39m VC <- VC + 001 [32m266-267 [31m0614-0615 [34m ^ ^# 4C[m[34m04[m[34m 19460 [39m Skip next if VC <> 004 [32m268-269 [31m0616-0617 [34m ^^ ^^ 6C[m[34m00[m[34m 27648 [39m VC <- 000 [32m26A-26B [31m0618-0619 [34m ^^^^ 3C[m[34m00[m[34m 15360 [39m Skip next if VC = 000 [32m26C-26D [31m0620-0621 [34m_ ^__# 1[4m2[m[34m[4m8E[m[34m 04750 [39m Jump to move [32m26E-26F [31m0622-0623 [34m^_# ^^ A[4m3[m[34m[4m60[m[34m 41824 [39m I <- fourth wall [32m270-271 [31m0624-0625 [34m__ _ 00[m[34mC1[m[34m 00193 [39m Scroll down by 01 [32m272-273 [31m0626-0627 [34m ^^ ^ 61[m[34m00[m[34m 24832 [39m V1 <- 000 [32m274-275 [31m0628-0629 [34m ##___^ 62[m[34m7C[m[34m 25212 [39m V2 <- 124 [32m276-277 [31m0630-0631 [34m ^^^^ ^# 7B[m[34m01[m[34m 31489 [39m VB <- VB + 001 [32m278-279 [31m0632-0633 [34m__###__# 39[m[34mFF[m[34m 14847 [39m Skip next if V9 = 255 [32m27A-27B [31m0634-0635 [34m ^^^^ # 79[m[34m01[m[34m 30977 [39m V9 <- V9 + 001 [32m27C-27D [31m0636-0637 [34m # ^ ^ 49[m[34m40[m[34m 18752 [39m Skip next if V9 <> 064 [32m27E-27F [31m0638-0639 [34m_##_#__# 69[m[34mFF[m[34m 27135 [39m V9 <- 255 [32m280-281 [31m0640-0641 [34m## ^ # D1[m[34mC1[m[34m 53697[33m show time[39m Draw 08x01 at V1,VC; VF <- XOR [32m282-283 [31m0642-0643 [34m## ^ ^_ D2[m[34mC1[m[34m 53953 [39m Draw 08x01 at V2,VC; VF <- XOR [32m284-285 [31m0644-0645 [34m^##^ _ _ F0[m[34m65[m[34m 61541 [39m Load V0->V0; I <- I + 01 [32m286-287 [31m0646-0647 [34m ^^^ _ ^ 71[m[34m04[m[34m 28932 [39m V1 <- V1 + 004 [32m288-289 [31m0648-0649 [34m_###__^ 72[m[34mFC[m[34m 29436 [39m V2 <- V2 + 252 [32m28A-28B [31m0650-0651 [34m _^^ ^ 31[m[34m40[m[34m 12608 [39m Skip next if V1 = 064 [32m28C-28D [31m0652-0653 [34m_ ^ ^ 1[4m2[m[34m[4m80[m[34m 04736 [39m Jump to show time [32m28E-28F [31m0654-0655 [34m__###__# 39[m[34mFF[m[34m 14847[33m move[39m Skip next if V9 = 255 [32m290-291 [31m0656-0657 [34m_ _^ _# 1[4m2[m[34m[4mA6[m[34m 04774 [39m Jump to continue [32m292-293 [31m0658-0659 [34m ^^^^ 3C[m[34m00[m[34m 15360 [39m Skip next if VC = 000 [32m294-295 [31m0660-0661 [34m_ _^ _# 1[4m2[m[34m[4mA6[m[34m 04774 [39m Jump to continue [32m296-297 [31m0662-0663 [34m^ ^__ ^ A[4m2[m[34m[4m18[m[34m 41496 [39m I <- player [32m298-299 [31m0664-0665 [34m^#__#___ C8[m[34m7F[m[34m 51327 [39m V8 <- ??? AND 127 [32m29A-29B [31m0666-0667 [34m ^^ ^ # 69[m[34m01[m[34m 26881 [39m V9 <- 001 [32m29C-29D [31m0668-0669 [34m#^ #^ _ D8[m[34m91[m[34m 55441 [39m Draw 08x01 at V8,V9; VF <- XOR [32m29E-29F [31m0670-0671 [34m ^ ^^^^ 4F[m[34m00[m[34m 20224 [39m Skip next if VF <> 000 [32m2A0-2A1 [31m0672-0673 [34m_ _^ _# 1[4m2[m[34m[4mA6[m[34m 04774 [39m Jump to continue [32m2A2-2A3 [31m0674-0675 [34m#^ #^ _ D8[m[34m91[m[34m 55441 [39m Draw 08x01 at V8,V9; VF <- XOR [32m2A4-2A5 [31m0676-0677 [34m_##_#__# 69[m[34mFF[m[34m 27135 [39m V9 <- 255 [32m2A6-2A7 [31m0678-0679 [34m^_^ _#^ A[4m3[m[34m[4m46[m[34m 41798[33m continue[39m I <- from [32m2A8-2A9 [31m0680-0681 [34m^##^ #^_ F6[m[34m65[m[34m 63077 [39m Load V0->V6; I <- I + 07 [32m2AA-2AB [31m0682-0683 [34m # ^ ^^ 4B[m[34m40[m[34m 19264 [39m Skip next if VB <> 064 [32m2AC-2AD [31m0684-0685 [34m ^ ^ 12[m[34m00[m[34m 04608 [39m Jump to 0512 [32m2AE-2AF [31m0686-0687 [34m#^^____ E0[m[34m9E[m[34m 57502[33m down[39m Skip next if V0 = key [32m2B0-2B1 [31m0688-0689 [34m_ _#_ ^ 1[4m2[m[34m[4mB8[m[34m 04792 [39m Jump to left [32m2B2-2B3 [31m0690-0691 [34m ^__#_## 4B[m[34m3F[m[34m 19263 [39m Skip next if VB <> 063 [32m2B4-2B5 [31m0692-0693 [34m_ _#_ ^ 1[4m2[m[34m[4mB8[m[34m 04792 [39m Jump to left [32m2B6-2B7 [31m0694-0695 [34m ^^ ^^_ 66[m[34m01[m[34m 26113 [39m V6 <- 001 [32m2B8-2B9 [31m0696-0697 [34m#^^____^ E1[m[34m9E[m[34m 57758[33m left[39m Skip next if V1 = key [32m2BA-2BB [31m0698-0699 [34m__ ^ # 1[4m2[m[34m[4mC2[m[34m 04802 [39m Jump to right [32m2BC-2BD [31m0700-0701 [34m ^ ^ ^ 4A[m[34m00[m[34m 18944 [39m Skip next if VA <> 000 [32m2BE-2BF [31m0702-0703 [34m__ ^ # 1[4m2[m[34m[4mC2[m[34m 04802 [39m Jump to right [32m2C0-2C1 [31m0704-0705 [34m_##__#_# 65[m[34mFF[m[34m 26111 [39m V5 <- 255 [32m2C2-2C3 [31m0706-0707 [34m#^^___# E2[m[34m9E[m[34m 58014[33m right[39m Skip next if V2 = key [32m2C4-2C5 [31m0708-0709 [34m__ ^__^ 1[4m2[m[34m[4mCC[m[34m 04812 [39m Jump to up [32m2C6-2C7 [31m0710-0711 [34m #__#_#_ 4A[m[34m7F[m[34m 19071 [39m Skip next if VA <> 127 [32m2C8-2C9 [31m0712-0713 [34m__ ^__^ 1[4m2[m[34m[4mCC[m[34m 04812 [39m Jump to up [32m2CA-2CB [31m0714-0715 [34m ^^ ^ # 65[m[34m01[m[34m 25857 [39m V5 <- 001 [32m2CC-2CD [31m0716-0717 [34m#^^___#^ E3[m[34m9E[m[34m 58270[33m up[39m Skip next if V3 = key [32m2CE-2CF [31m0718-0719 [34m__ # _# 1[4m2[m[34m[4mD6[m[34m 04822 [39m Jump to resolve [32m2D0-2D1 [31m0720-0721 [34m ^ ^ ^^ 4B[m[34m00[m[34m 19200 [39m Skip next if VB <> 000 [32m2D2-2D3 [31m0722-0723 [34m__ # _# 1[4m2[m[34m[4mD6[m[34m 04822 [39m Jump to resolve [32m2D4-2D5 [31m0724-0725 [34m_##__##_ 66[m[34mFF[m[34m 26367 [39m V6 <- 255 [32m2D6-2D7 [31m0726-0727 [34m^ ^__ ^ A[4m2[m[34m[4m18[m[34m 41496[33m resolve[39m I <- player [32m2D8-2D9 [31m0728-0729 [34m#^ #^ _ D8[m[34m91[m[34m 55441 [39m Draw 08x01 at V8,V9; VF <- XOR [32m2DA-2DB [31m0730-0731 [34m ^ ^^^^ 4F[m[34m00[m[34m 20224 [39m Skip next if VF <> 000 [32m2DC-2DD [31m0732-0733 [34m#^ #^ _ D8[m[34m91[m[34m 55441 [39m Draw 08x01 at V8,V9; VF <- XOR [32m2DE-2DF [31m0734-0735 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR [32m2E0-2E1 [31m0736-0737 [34m^_ _^_^ 8A[m[34m54[m[34m 35412 [39m VA <- VA + V5; VF <- overflow [32m2E2-2E3 [31m0738-0739 [34m^__ ^_^^ 8B[m[34m64[m[34m 35684 [39m VB <- VB + V6; VF <- overflow [32m2E4-2E5 [31m0740-0741 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR [32m2E6-2E7 [31m0742-0743 [34m_^_^^ 58[m[34mA0[m[34m 22688 [39m Skip next if V8 = VA [32m2E8-2E9 [31m0744-0745 [34m___# # 1[4m2[m[34m[4mF2[m[34m 04850 [39m Jump to next [32m2EA-2EB [31m0746-0747 [34m_^_#^ ^ 59[m[34mB0[m[34m 22960 [39m Skip next if V9 = VB [32m2EC-2ED [31m0748-0749 [34m___# # 1[4m2[m[34m[4mF2[m[34m 04850 [39m Jump to next [32m2EE-2EF [31m0750-0751 [34m_##_#__# 69[m[34mFF[m[34m 27135 [39m V9 <- 255 [32m2F0-2F1 [31m0752-0753 [34m ^^^ ^^# 77[m[34m01[m[34m 30465 [39m V7 <- V7 + 001 [32m2F2-2F3 [31m0754-0755 [34m ^ ^^^^ 4F[m[34m00[m[34m 20224[33m next[39m Skip next if VF <> 000 [32m2F4-2F5 [31m0756-0757 [34m___#__# 1[4m2[m[34m[4mFE[m[34m 04862 [39m Jump to break? [32m2F6-2F7 [31m0758-0759 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR [32m2F8-2F9 [31m0760-0761 [34m^_ _^_^_ 8A[m[34m55[m[34m 35413 [39m VA <- VA - V5; VF <- borrow [32m2FA-2FB [31m0762-0763 [34m^__ ^_^# 8B[m[34m65[m[34m 35685 [39m VB <- VB - V6; VF <- borrow [32m2FC-2FD [31m0764-0765 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR [32m2FE-2FF [31m0766-0767 [34m#^^__#_ E4[m[34m9E[m[34m 58526[33m break?[39m Skip next if V4 = key [32m300-301 [31m0768-0769 [34m # _^^ 1[4m3[m[34m[4m14[m[34m 04884 [39m Jump to exhaust delay [32m302-303 [31m0770-0771 [34m ^ ^^^ 47[m[34m00[m[34m 18176 [39m Skip next if V7 <> 000 [32m304-305 [31m0772-0773 [34m # _^^ 1[4m3[m[34m[4m14[m[34m 04884 [39m Jump to exhaust delay [32m306-307 [31m0774-0775 [34m^ #__ #^ A[4m3[m[34m[4m3A[m[34m 41786 [39m I <- make break [32m308-309 [31m0776-0777 [34m# _ 80[m[34mA0[m[34m 32928 [39m V0 <- VA [32m30A-30B [31m0778-0779 [34m# __ ^ 81[m[34mB0[m[34m 33200 [39m V1 <- VB [32m30C-30D [31m0780-0781 [34m_###____ 70[m[34mFF[m[34m 28927 [39m V0 <- V0 + 255 [32m30E-30F [31m0782-0783 [34m_###__ ^ 71[m[34mFC[m[34m 29180 [39m V1 <- V1 + 252 [32m310-311 [31m0784-0785 [34m_###_### 77[m[34mFF[m[34m 30719 [39m V7 <- V7 + 255 [32m312-313 [31m0786-0787 [34m^^ # _ D0[m[34m14[m[34m 53268 [39m Draw 08x04 at V0,V1; VF <- XOR [32m314-315 [31m0788-0789 [34m^^^^^### FF[m[34m07[m[34m 65287[33m exhaust delay[39m VF <- delay [32m316-317 [31m0790-0791 [34m ^^^^^^ 3F[m[34m00[m[34m 16128 [39m Skip next if VF = 000 [32m318-319 [31m0792-0793 [34m # _^^ 1[4m3[m[34m[4m14[m[34m 04884 [39m Jump to exhaust delay [32m31A-31B [31m0794-0795 [34m^^^# _^_ F2[m[34m15[m[34m 61973 [39m delay <- V2 [32m31C-31D [31m0796-0797 [34m ^#^^ ^ 3D[m[34m10[m[34m 15632 [39m Skip next if VD = 016 [32m31E-31F [31m0798-0799 [34m # # 1[4m2[m[34m[4m12[m[34m 04626 [39m Jump to maze step [32m320-321 [31m0800-0801 [34m ^__# 1[4m2[m[34m[4m0E[m[34m 04622 [39m Jump to maze [32m322-323 [31m0802-0803 [34m^ ^ 81[m[34m00[m[34m 33024[33m shift[39m V1 <- V0 [32m324-325 [31m0804-0805 [34m^_ ____ 80[m[34m5E[m[34m 32862 [39m V0 <- V5 x 2; VF <- MSB [32m326-327 [31m0806-0807 [34m^ #^_ ^^ B[4m3[m[34m[4m28[m[34m 45864 [39m Jump to V0 + table [32m328-329 [31m0808-0809 [34m^ _ __^ 81[m[34m16[m[34m 33046[33m table[39m V1 <- V1 % 2; VF <- LSB [32m32A-32B [31m0810-0811 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m32C-32D [31m0812-0813 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m32E-32F [31m0814-0815 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m330-331 [31m0816-0817 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m332-333 [31m0818-0819 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m334-335 [31m0820-0821 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m336-337 [31m0822-0823 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m338-339 [31m0824-0825 [34m___ ___ 00[m[34mEE[m[34m 00238 [39m Return [32m33A-33B [31m0826-0827 [34m#### F0[m[34mF0[m[34m 61680[33m make break[39m [32m33C-33D [31m0828-0829 [34m#### F0[m[34mF0[m[34m 61680 [39m [32m33E-33F [31m0830-0831 [34m ^_ ^^ 13[m[34m08[m[34m 04872[33m random[39m [32m340-341 [31m0832-0833 [34m_ #_ 10[m[34m98[m[34m 04248 [39m [32m342-343 [31m0834-0835 [34m###_ E0[m[34mF0[m[34m 57584[33m drunk[39m [32m344-345 [31m0836-0837 [34m^^# E0[m[34m20[m[34m 57376 [39m [32m346 [31m0838 [34m # 02[m[34m 002[33m from[39m [32m347 [31m0839 [34m # 04[m[34m 004 [39m [32m348 [31m0840 [34m ## 06[m[34m 006 [39m [32m349 [31m0841 [34m # 08[m[34m 008 [39m [32m34A-34B [31m0842-0843 [34m 00[m[34m00[m[34m 00000 [39m [32m34C-34D [31m0844-0845 [34m 00[m[34m00[m[34m 00000 [39m [32m34E-34F [31m0846-0847 [34m^^^^ F0[m[34m00[m[34m 61440[33m backstage[39m [32m350-351 [31m0848-0849 [34m 00[m[34m00[m[34m 00000[33m stage[39m [32m352-353 [31m0850-0851 [34m 00[m[34m00[m[34m 00000 [39m [32m354-355 [31m0852-0853 [34m 00[m[34m00[m[34m 00000 [39m [32m356-357 [31m0854-0855 [34m 00[m[34m00[m[34m 00000 [39m [32m358-359 [31m0856-0857 [34m 00[m[34m00[m[34m 00000 [39m [32m35A-35B [31m0858-0859 [34m 00[m[34m00[m[34m 00000 [39m [32m35C-35D [31m0860-0861 [34m 00[m[34m00[m[34m 00000 [39m [32m35E-35F [31m0862-0863 [34m 00[m[34m00[m[34m 00000 [39m [32m360-361 [31m0864-0865 [34m 00[m[34m00[m[34m 00000[33m fourth wall[39m [32m362-363 [31m0866-0867 [34m 00[m[34m00[m[34m 00000 [39m [32m364-365 [31m0868-0869 [34m 00[m[34m00[m[34m 00000 [39m [32m366-367 [31m0870-0871 [34m 00[m[34m00[m[34m 00000 [39m [32m368-369 [31m0872-0873 [34m 00[m[34m00[m[34m 00000 [39m [32m36A-36B [31m0874-0875 [34m 00[m[34m00[m[34m 00000 [39m [32m36C-36D [31m0876-0877 [34m 00[m[34m00[m[34m 00000 [39m [32m36E-36F [31m0878-0879 [34m 00[m[34m00[m[34m 00000 [39m [32m370-371 [31m0880-0881 [34m 00[m[34m00[m[34m 00000[33m wardrobe[39m The register usage is as follows: V0 Hold cells for the automaton; hold a key code; and hold the argument to a subroutine. V1 Hold a cell for the automaton; hold the horizontal coordinate of part of the maze drawing; hold a key code; and operate as a temporary register. V2 Hold a cell for the automaton; hold the horizontal coordinate of part of the maze drawing; hold a key code; operate as a temporary register; and manipulate the delay register. V3 Hold a cell for the automaton; and hold a key code. V4 Hold a generated index for the maze generation; and hold a key code. V5 Hold a generated index for the maze generation; and hold a movement delta. V6 Hold a movement delta. V7 Store the make break count. V8 Hold the horizontal coordinate of the make break. V9 Hold the vertical coordinate and presence sigil of the make break. VA Hold the horizontal coordinate of the player. VB Hold the vertical coordinate of the player. VC Hold a rotating counter and the vertical coordinate of part of the maze drawing. VD Hold the current cell index of the maze generation. VE Hold a prior cell state for the automaton. VF Hold the result of a subroutine; manipulate the delay register; indicate collisions, and whatnot. More care was taken in register selection with this iteration; in particular, it was recognized that the first many registers had no persistent state after the automaton stepping, and so could be used, without issue. Unfortunately, I resisted using entirely disparate register banks in this; it caused issues with register exhaustion that could've been avoided. The register manipulation of the latter half of the game is sloppy, in mine eyes, and this game would benefit from heavier rewriting, later. The game begins by entering Super CHIP-8 mode, clearing all registers to zero, initializing the make break count, configuring the make break sigil to indicate no presence, and then drawing that player: [32m200-201 [31m0512-0513 [34m________ 00[m[34mFF[m[34m 00255 [39m Enable extended mode [32m202-203 [31m0514-0515 [34m#_#_ ^^^ A7[m[34mF0[m[34m 42992 [39m I <- 2032 [32m204-205 [31m0516-0517 [34m^##^^#^# FF[m[34m65[m[34m 65381 [39m Load V0->VF; I <- I + 16 [32m206-207 [31m0518-0519 [34m ^^ _^#^ 67[m[34m0A[m[34m 26378 [39m V7 <- 010 [32m208-209 [31m0520-0521 [34m_##_#__# 69[m[34mFF[m[34m 27135 [39m V9 <- 255 [32m20A-20B [31m0522-0523 [34m^ ^__ ^ A[4m2[m[34m[4m18[m[34m 41496 [39m I <- player [32m20C-20D [31m0524-0525 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR Unlike that prior implementation, a more consistent framerate is achieved by generating each cell of the automaton in step with the rest of the game, rather than all at once; the paper I read indicated a random initial value for part of the algorithm, which corresponds to the CE01. Rather than move I by FX65, I use labels offset appropriately; this implementation avoids a mask by using 8XYE instead. Each value is either zero or two hundred and forty, as but two symbols are needed, and these exactly match the sprites used in drawing. Indices into the bit tables drunk and random are built as shown: [32m20E-20F [31m0526-0527 [34m^^ ^^^_ CE[m[34m01[m[34m 52737[33m maze[39m VE <- ??? AND 001 [32m210-211 [31m0528-0529 [34m ^^ ^^ ^ 6D[m[34m00[m[34m 27904 [39m VD <- 000 [32m212-213 [31m0530-0531 [34m^_^ __#^ A[4m3[m[34m[4m4E[m[34m 41806[33m maze step[39m I <- backstage [32m214-215 [31m0532-0533 [34m^^^###_^ FD[m[34m1E[m[34m 64798 [39m I <- I + VD [32m216-217 [31m0534-0535 [34m^##^ _^# F3[m[34m65[m[34m 62309 [39m Load V0->V3; I <- I + 04 [32m218-219 [31m0536-0537 [34m^ ___ 80[m[34m0E[m[34m 32782[33m player[39m V0 <- V0 x 2; VF <- MSB [32m21A-21B [31m0538-0539 [34m#____#_ 84[m[34mFE[m[34m 34046 [39m V4 <- VF x 2; VF <- MSB [32m21C-21D [31m0540-0541 [34m^ ____^ 81[m[34m1E[m[34m 33054 [39m V1 <- V1 x 2; VF <- MSB [32m21E-21F [31m0542-0543 [34m#___ ^ _ 84[m[34mF1[m[34m 34033 [39m V4 <- V4 OR VF [32m220-221 [31m0544-0545 [34m#__ _#_^ 85[m[34mEE[m[34m 34286 [39m V5 <- VE x 2; VF <- MSB [32m222-223 [31m0546-0547 [34m^ _ __# 82[m[34m2E[m[34m 33326 [39m V2 <- V2 x 2; VF <- MSB [32m224-225 [31m0548-0549 [34m#___^^^ 8E[m[34mF0[m[34m 36592 [39m VE <- VF [32m226-227 [31m0550-0551 [34m#___ ^ # 85[m[34mF1[m[34m 34289 [39m V5 <- V5 OR VF [32m228-229 [31m0552-0553 [34m^_ __#_^ 85[m[34m5E[m[34m 34142 [39m V5 <- V5 x 2; VF <- MSB [32m22A-22B [31m0554-0555 [34m^ ____#^ 83[m[34m3E[m[34m 33598 [39m V3 <- V3 x 2; VF <- MSB [32m22C-22D [31m0556-0557 [34m#___ ^ # 85[m[34mF1[m[34m 34289 [39m V5 <- V5 OR VF Again for a more consistent framerate, both random and drunk are indexed, regardless of the value in random. The shift routine is used to extract the particular bit. I was unable to avoid conditional code in setting the new cell value, but did nicely avoid unnecessary register movement in how random values are set, by conditionally manipulating the apparent value of that drunk bit. I would've been able to unconditionally map one to two hundred and forty, but lacked a multiplication sled I needed: [32m22E-22F [31m0558-0559 [34m^ #___#^ A[4m3[m[34m[4m3E[m[34m 41790 [39m I <- random [32m230-231 [31m0560-0561 [34m^^^#_#_ F4[m[34m1E[m[34m 62494 [39m I <- I + V4 [32m232-233 [31m0562-0563 [34m^##^ _ _ F0[m[34m65[m[34m 61541 [39m Load V0->V0; I <- I + 01 [32m234-235 [31m0564-0565 [34m # #^ 2[4m3[m[34m[4m22[m[34m 08994 [39m Call shift [32m236-237 [31m0566-0567 [34m#___ ^ 82[m[34mF0[m[34m 33520 [39m V2 <- VF [32m238-239 [31m0568-0569 [34m^_^ #^ A[4m3[m[34m[4m42[m[34m 41794 [39m I <- drunk [32m23A-23B [31m0570-0571 [34m^^^#_#_ F4[m[34m1E[m[34m 62494 [39m I <- I + V4 [32m23C-23D [31m0572-0573 [34m^##^ _ _ F0[m[34m65[m[34m 61541 [39m Load V0->V0; I <- I + 01 [32m23E-23F [31m0574-0575 [34m # #^ 2[4m3[m[34m[4m22[m[34m 08994 [39m Call shift [32m240-241 [31m0576-0577 [34m ^^ ^ 32[m[34m00[m[34m 12800 [39m Skip next if V2 = 000 [32m242-243 [31m0578-0579 [34m^^ ^^^# CF[m[34m01[m[34m 52993 [39m VF <- ??? AND 001 [32m244-245 [31m0580-0581 [34m ^^ 60[m[34m00[m[34m 24576 [39m V0 <- 000 [32m246-247 [31m0582-0583 [34m ^^^^^^ 3F[m[34m00[m[34m 16128 [39m Skip next if VF = 000 [32m248-249 [31m0584-0585 [34m_##_ 60[m[34mF0[m[34m 24816 [39m V0 <- 240 The stage is set and, once that automaton is finished with the next generation, those new values are nicely set by using all sixteen registers; the fourth wall indicating the actual maze is immediately following stage, enabling this nice trick. The wardrobe is but temporary storage for all registers: [32m24A-24B [31m0586-0587 [34m^_^_ ^^ A[4m3[m[34m[4m50[m[34m 41808 [39m I <- stage [32m24C-24D [31m0588-0589 [34m^^^###_^ FD[m[34m1E[m[34m 64798 [39m I <- I + VD [32m24E-24F [31m0590-0591 [34m^#^# _ _ F0[m[34m55[m[34m 61525 [39m Save V0->V0; I <- I + 01 [32m250-251 [31m0592-0593 [34m ^^^^^ # 7D[m[34m01[m[34m 32001 [39m VD <- VD + 001 [32m252-253 [31m0594-0595 [34m ^#^^ ^ 3D[m[34m10[m[34m 15632 [39m Skip next if VD = 016 [32m254-255 [31m0596-0597 [34m __^ _^ 1[4m2[m[34m[4m64[m[34m 04708 [39m Jump to draw curtains [32m256-257 [31m0598-0599 [34m^_#_ ^^ A[4m3[m[34m[4m70[m[34m 41840 [39m I <- wardrobe [32m258-259 [31m0600-0601 [34m^#^#^#^# FF[m[34m55[m[34m 65365 [39m Save V0->VF; I <- I + 16 [32m25A-25B [31m0602-0603 [34m^_^_ ^^ A[4m3[m[34m[4m50[m[34m 41808 [39m I <- stage [32m25C-25D [31m0604-0605 [34m^##^^#^# FF[m[34m65[m[34m 65381 [39m Load V0->VF; I <- I + 16 [32m25E-25F [31m0606-0607 [34m^#^#^#^# FF[m[34m55[m[34m 65365 [39m Save V0->VF; I <- I + 16 [32m260-261 [31m0608-0609 [34m^_#_ ^^ A[4m3[m[34m[4m70[m[34m 41840 [39m I <- wardrobe [32m262-263 [31m0610-0611 [34m^##^^#^# FF[m[34m65[m[34m 65381 [39m Load V0->VF; I <- I + 16 Rows of the maze are drawn once every four cycles, which matches perfectly with the sixteen cells of the automaton. The screen is scrolled, coordinates for the player and make break are incremented if necessary, and the make break is reset if past the end. If not that, the move segment is jumped to: [32m264-265 [31m0612-0613 [34m ^^^^^ _ 7C[m[34m01[m[34m 31745[33m draw curtains[39m VC <- VC + 001 [32m266-267 [31m0614-0615 [34m ^ ^# 4C[m[34m04[m[34m 19460 [39m Skip next if VC <> 004 [32m268-269 [31m0616-0617 [34m ^^ ^^ 6C[m[34m00[m[34m 27648 [39m VC <- 000 [32m26A-26B [31m0618-0619 [34m ^^^^ 3C[m[34m00[m[34m 15360 [39m Skip next if VC = 000 [32m26C-26D [31m0620-0621 [34m_ ^__# 1[4m2[m[34m[4m8E[m[34m 04750 [39m Jump to move [32m26E-26F [31m0622-0623 [34m^_# ^^ A[4m3[m[34m[4m60[m[34m 41824 [39m I <- fourth wall [32m270-271 [31m0624-0625 [34m__ _ 00[m[34mC1[m[34m 00193 [39m Scroll down by 01 [32m272-273 [31m0626-0627 [34m ^^ ^ 61[m[34m00[m[34m 24832 [39m V1 <- 000 [32m274-275 [31m0628-0629 [34m ##___^ 62[m[34m7C[m[34m 25212 [39m V2 <- 124 [32m276-277 [31m0630-0631 [34m ^^^^ ^# 7B[m[34m01[m[34m 31489 [39m VB <- VB + 001 [32m278-279 [31m0632-0633 [34m__###__# 39[m[34mFF[m[34m 14847 [39m Skip next if V9 = 255 [32m27A-27B [31m0634-0635 [34m ^^^^ # 79[m[34m01[m[34m 30977 [39m V9 <- V9 + 001 [32m27C-27D [31m0636-0637 [34m # ^ ^ 49[m[34m40[m[34m 18752 [39m Skip next if V9 <> 064 [32m27E-27F [31m0638-0639 [34m_##_#__# 69[m[34mFF[m[34m 27135 [39m V9 <- 255 The show time routine draws one row of the maze. As VC is zero to enter this routine, it can safely be used for the vertical coordinate. As I only progresses one way, the row is drawn towards center: [32m280-281 [31m0640-0641 [34m## ^ # D1[m[34mC1[m[34m 53697[33m show time[39m Draw 08x01 at V1,VC; VF <- XOR [32m282-283 [31m0642-0643 [34m## ^ ^_ D2[m[34mC1[m[34m 53953 [39m Draw 08x01 at V2,VC; VF <- XOR [32m284-285 [31m0644-0645 [34m^##^ _ _ F0[m[34m65[m[34m 61541 [39m Load V0->V0; I <- I + 01 [32m286-287 [31m0646-0647 [34m ^^^ _ ^ 71[m[34m04[m[34m 28932 [39m V1 <- V1 + 004 [32m288-289 [31m0648-0649 [34m_###__^ 72[m[34mFC[m[34m 29436 [39m V2 <- V2 + 252 [32m28A-28B [31m0650-0651 [34m _^^ ^ 31[m[34m40[m[34m 12608 [39m Skip next if V1 = 064 [32m28C-28D [31m0652-0653 [34m_ ^ ^ 1[4m2[m[34m[4m80[m[34m 04736 [39m Jump to show time The move routine begins by calculating the make break, if necessary. The make break is only changed if not already active and only then once every four cycles. It's opportunistically drawn at the top of the screen, bailing out and correcting the maze if it collides with a wall to try the next cycle: [32m28E-28F [31m0654-0655 [34m__###__# 39[m[34mFF[m[34m 14847[33m move[39m Skip next if V9 = 255 [32m290-291 [31m0656-0657 [34m_ _^ _# 1[4m2[m[34m[4mA6[m[34m 04774 [39m Jump to continue [32m292-293 [31m0658-0659 [34m ^^^^ 3C[m[34m00[m[34m 15360 [39m Skip next if VC = 000 [32m294-295 [31m0660-0661 [34m_ _^ _# 1[4m2[m[34m[4mA6[m[34m 04774 [39m Jump to continue [32m296-297 [31m0662-0663 [34m^ ^__ ^ A[4m2[m[34m[4m18[m[34m 41496 [39m I <- player [32m298-299 [31m0664-0665 [34m^#__#___ C8[m[34m7F[m[34m 51327 [39m V8 <- ??? AND 127 [32m29A-29B [31m0666-0667 [34m ^^ ^ # 69[m[34m01[m[34m 26881 [39m V9 <- 001 [32m29C-29D [31m0668-0669 [34m#^ #^ _ D8[m[34m91[m[34m 55441 [39m Draw 08x01 at V8,V9; VF <- XOR [32m29E-29F [31m0670-0671 [34m ^ ^^^^ 4F[m[34m00[m[34m 20224 [39m Skip next if VF <> 000 [32m2A0-2A1 [31m0672-0673 [34m_ _^ _# 1[4m2[m[34m[4mA6[m[34m 04774 [39m Jump to continue [32m2A2-2A3 [31m0674-0675 [34m#^ #^ _ D8[m[34m91[m[34m 55441 [39m Draw 08x01 at V8,V9; VF <- XOR [32m2A4-2A5 [31m0676-0677 [34m_##_#__# 69[m[34mFF[m[34m 27135 [39m V9 <- 255 The continue routine initializes the key and delta registers, also checking for failure, to restart: [32m2A6-2A7 [31m0678-0679 [34m^_^ _#^ A[4m3[m[34m[4m46[m[34m 41798[33m continue[39m I <- from [32m2A8-2A9 [31m0680-0681 [34m^##^ #^_ F6[m[34m65[m[34m 63077 [39m Load V0->V6; I <- I + 07 [32m2AA-2AB [31m0682-0683 [34m # ^ ^^ 4B[m[34m40[m[34m 19264 [39m Skip next if VB <> 064 [32m2AC-2AD [31m0684-0685 [34m ^ ^ 12[m[34m00[m[34m 04608 [39m Jump to 0512 This segment merely calculates the movement deltas, also enforcing bounds: [32m2AE-2AF [31m0686-0687 [34m#^^____ E0[m[34m9E[m[34m 57502[33m down[39m Skip next if V0 = key [32m2B0-2B1 [31m0688-0689 [34m_ _#_ ^ 1[4m2[m[34m[4mB8[m[34m 04792 [39m Jump to left [32m2B2-2B3 [31m0690-0691 [34m ^__#_## 4B[m[34m3F[m[34m 19263 [39m Skip next if VB <> 063 [32m2B4-2B5 [31m0692-0693 [34m_ _#_ ^ 1[4m2[m[34m[4mB8[m[34m 04792 [39m Jump to left [32m2B6-2B7 [31m0694-0695 [34m ^^ ^^_ 66[m[34m01[m[34m 26113 [39m V6 <- 001 [32m2B8-2B9 [31m0696-0697 [34m#^^____^ E1[m[34m9E[m[34m 57758[33m left[39m Skip next if V1 = key [32m2BA-2BB [31m0698-0699 [34m__ ^ # 1[4m2[m[34m[4mC2[m[34m 04802 [39m Jump to right [32m2BC-2BD [31m0700-0701 [34m ^ ^ ^ 4A[m[34m00[m[34m 18944 [39m Skip next if VA <> 000 [32m2BE-2BF [31m0702-0703 [34m__ ^ # 1[4m2[m[34m[4mC2[m[34m 04802 [39m Jump to right [32m2C0-2C1 [31m0704-0705 [34m_##__#_# 65[m[34mFF[m[34m 26111 [39m V5 <- 255 [32m2C2-2C3 [31m0706-0707 [34m#^^___# E2[m[34m9E[m[34m 58014[33m right[39m Skip next if V2 = key [32m2C4-2C5 [31m0708-0709 [34m__ ^__^ 1[4m2[m[34m[4mCC[m[34m 04812 [39m Jump to up [32m2C6-2C7 [31m0710-0711 [34m #__#_#_ 4A[m[34m7F[m[34m 19071 [39m Skip next if VA <> 127 [32m2C8-2C9 [31m0712-0713 [34m__ ^__^ 1[4m2[m[34m[4mCC[m[34m 04812 [39m Jump to up [32m2CA-2CB [31m0714-0715 [34m ^^ ^ # 65[m[34m01[m[34m 25857 [39m V5 <- 001 [32m2CC-2CD [31m0716-0717 [34m#^^___#^ E3[m[34m9E[m[34m 58270[33m up[39m Skip next if V3 = key [32m2CE-2CF [31m0718-0719 [34m__ # _# 1[4m2[m[34m[4mD6[m[34m 04822 [39m Jump to resolve [32m2D0-2D1 [31m0720-0721 [34m ^ ^ ^^ 4B[m[34m00[m[34m 19200 [39m Skip next if VB <> 000 [32m2D2-2D3 [31m0722-0723 [34m__ # _# 1[4m2[m[34m[4mD6[m[34m 04822 [39m Jump to resolve [32m2D4-2D5 [31m0724-0725 [34m_##__##_ 66[m[34mFF[m[34m 26367 [39m V6 <- 255 The resolve routine erases the make break so it can't collide with the player, and then redraws him: [32m2D6-2D7 [31m0726-0727 [34m^ ^__ ^ A[4m2[m[34m[4m18[m[34m 41496[33m resolve[39m I <- player [32m2D8-2D9 [31m0728-0729 [34m#^ #^ _ D8[m[34m91[m[34m 55441 [39m Draw 08x01 at V8,V9; VF <- XOR [32m2DA-2DB [31m0730-0731 [34m ^ ^^^^ 4F[m[34m00[m[34m 20224 [39m Skip next if VF <> 000 [32m2DC-2DD [31m0732-0733 [34m#^ #^ _ D8[m[34m91[m[34m 55441 [39m Draw 08x01 at V8,V9; VF <- XOR [32m2DE-2DF [31m0734-0735 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR [32m2E0-2E1 [31m0736-0737 [34m^_ _^_^ 8A[m[34m54[m[34m 35412 [39m VA <- VA + V5; VF <- overflow [32m2E2-2E3 [31m0738-0739 [34m^__ ^_^^ 8B[m[34m64[m[34m 35684 [39m VB <- VB + V6; VF <- overflow [32m2E4-2E5 [31m0740-0741 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR The following code determines if the make break is collected by comparing coordinates and resetting: [32m2E6-2E7 [31m0742-0743 [34m_^_^^ 58[m[34mA0[m[34m 22688 [39m Skip next if V8 = VA [32m2E8-2E9 [31m0744-0745 [34m___# # 1[4m2[m[34m[4mF2[m[34m 04850 [39m Jump to next [32m2EA-2EB [31m0746-0747 [34m_^_#^ ^ 59[m[34mB0[m[34m 22960 [39m Skip next if V9 = VB [32m2EC-2ED [31m0748-0749 [34m___# # 1[4m2[m[34m[4mF2[m[34m 04850 [39m Jump to next [32m2EE-2EF [31m0750-0751 [34m_##_#__# 69[m[34mFF[m[34m 27135 [39m V9 <- 255 [32m2F0-2F1 [31m0752-0753 [34m ^^^ ^^# 77[m[34m01[m[34m 30465 [39m V7 <- V7 + 001 The next routine moves the player back to his previous location if a collision occurred, then seeing if a make break is used; if so, and the count is positive, the make break's coordinate is calculated and it's drawn. I'd wanted to adjust this based on the last movement direction, but faced pressure: [32m2F2-2F3 [31m0754-0755 [34m ^ ^^^^ 4F[m[34m00[m[34m 20224[33m next[39m Skip next if VF <> 000 [32m2F4-2F5 [31m0756-0757 [34m___#__# 1[4m2[m[34m[4mFE[m[34m 04862 [39m Jump to break? [32m2F6-2F7 [31m0758-0759 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR [32m2F8-2F9 [31m0760-0761 [34m^_ _^_^_ 8A[m[34m55[m[34m 35413 [39m VA <- VA - V5; VF <- borrow [32m2FA-2FB [31m0762-0763 [34m^__ ^_^# 8B[m[34m65[m[34m 35685 [39m VB <- VB - V6; VF <- borrow [32m2FC-2FD [31m0764-0765 [34m#^_#^ ^_ DA[m[34mB1[m[34m 55985 [39m Draw 08x01 at VA,VB; VF <- XOR [32m2FE-2FF [31m0766-0767 [34m#^^__#_ E4[m[34m9E[m[34m 58526[33m break?[39m Skip next if V4 = key [32m300-301 [31m0768-0769 [34m # _^^ 1[4m3[m[34m[4m14[m[34m 04884 [39m Jump to exhaust delay [32m302-303 [31m0770-0771 [34m ^ ^^^ 47[m[34m00[m[34m 18176 [39m Skip next if V7 <> 000 [32m304-305 [31m0772-0773 [34m # _^^ 1[4m3[m[34m[4m14[m[34m 04884 [39m Jump to exhaust delay [32m306-307 [31m0774-0775 [34m^ #__ #^ A[4m3[m[34m[4m3A[m[34m 41786 [39m I <- make break [32m308-309 [31m0776-0777 [34m# _ 80[m[34mA0[m[34m 32928 [39m V0 <- VA [32m30A-30B [31m0778-0779 [34m# __ ^ 81[m[34mB0[m[34m 33200 [39m V1 <- VB [32m30C-30D [31m0780-0781 [34m_###____ 70[m[34mFF[m[34m 28927 [39m V0 <- V0 + 255 [32m30E-30F [31m0782-0783 [34m_###__ ^ 71[m[34mFC[m[34m 29180 [39m V1 <- V1 + 252 [32m310-311 [31m0784-0785 [34m_###_### 77[m[34mFF[m[34m 30719 [39m V7 <- V7 + 255 [32m312-313 [31m0786-0787 [34m^^ # _ D0[m[34m14[m[34m 53268 [39m Draw 08x04 at V0,V1; VF <- XOR That remaining delay is exhausted, before being reinstated, and one of the maze routines is entered: [32m314-315 [31m0788-0789 [34m^^^^^### FF[m[34m07[m[34m 65287[33m exhaust delay[39m VF <- delay [32m316-317 [31m0790-0791 [34m ^^^^^^ 3F[m[34m00[m[34m 16128 [39m Skip next if VF = 000 [32m318-319 [31m0792-0793 [34m # _^^ 1[4m3[m[34m[4m14[m[34m 04884 [39m Jump to exhaust delay [32m31A-31B [31m0794-0795 [34m^^^# _^_ F2[m[34m15[m[34m 61973 [39m delay <- V2 [32m31C-31D [31m0796-0797 [34m ^#^^ ^ 3D[m[34m10[m[34m 15632 [39m Skip next if VD = 016 [32m31E-31F [31m0798-0799 [34m # # 1[4m2[m[34m[4m12[m[34m 04626 [39m Jump to maze step [32m320-321 [31m0800-0801 [34m ^__# 1[4m2[m[34m[4m0E[m[34m 04622 [39m Jump to maze This shift routine is better than that preceding it, as it adjusts registers as needed, itself. Had I used a multiplication sled instead, I'd have been able to use this for the maze symbol generation: [32m322-323 [31m0802-0803 [34m^ ^ 81[m[34m00[m[34m 33024[33m shift[39m V1 <- V0 [32m324-325 [31m0804-0805 [34m^_ ____ 80[m[34m5E[m[34m 32862 [39m V0 <- V5 x 2; VF <- MSB [32m326-327 [31m0806-0807 [34m^ #^_ ^^ B[4m3[m[34m[4m28[m[34m 45864 [39m Jump to V0 + table [32m328-329 [31m0808-0809 [34m^ _ __^ 81[m[34m16[m[34m 33046[33m table[39m V1 <- V1 % 2; VF <- LSB [32m32A-32B [31m0810-0811 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m32C-32D [31m0812-0813 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m32E-32F [31m0814-0815 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m330-331 [31m0816-0817 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m332-333 [31m0818-0819 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m334-335 [31m0820-0821 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m336-337 [31m0822-0823 [34m^ _ __^ 81[m[34m16[m[34m 33046 [39m V1 <- V1 % 2; VF <- LSB [32m338-339 [31m0824-0825 [34m___ ___ 00[m[34mEE[m[34m 00238 [39m Return The game ends with the various sprites, tables, register banks, and I'll also show the final labels. The backstage begins with a constant symbol, again as that paper I read described this aspect of it: [32m33A-33B [31m0826-0827 [34m#### F0[m[34mF0[m[34m 61680[33m make break[39m [32m33C-33D [31m0828-0829 [34m#### F0[m[34mF0[m[34m 61680 [39m [32m33E-33F [31m0830-0831 [34m ^_ ^^ 13[m[34m08[m[34m 04872[33m random[39m [32m340-341 [31m0832-0833 [34m_ #_ 10[m[34m98[m[34m 04248 [39m [32m342-343 [31m0834-0835 [34m###_ E0[m[34mF0[m[34m 57584[33m drunk[39m [32m344-345 [31m0836-0837 [34m^^# E0[m[34m20[m[34m 57376 [39m [32m346 [31m0838 [34m # 02[m[34m 002[33m from[39m [32m347 [31m0839 [34m # 04[m[34m 004 [39m [32m348 [31m0840 [34m ## 06[m[34m 006 [39m [32m349 [31m0841 [34m # 08[m[34m 008 [39m [32m34A-34B [31m0842-0843 [34m 00[m[34m00[m[34m 00000 [39m [32m34C-34D [31m0844-0845 [34m 00[m[34m00[m[34m 00000 [39m [32m34E-34F [31m0846-0847 [34m^^^^ F0[m[34m00[m[34m 61440[33m backstage[39m [32m350-351 [31m0848-0849 [34m 00[m[34m00[m[34m 00000[33m stage[39m [32m352-353 [31m0850-0851 [34m 00[m[34m00[m[34m 00000 [39m [32m354-355 [31m0852-0853 [34m 00[m[34m00[m[34m 00000 [39m [32m356-357 [31m0854-0855 [34m 00[m[34m00[m[34m 00000 [39m [32m358-359 [31m0856-0857 [34m 00[m[34m00[m[34m 00000 [39m [32m35A-35B [31m0858-0859 [34m 00[m[34m00[m[34m 00000 [39m [32m35C-35D [31m0860-0861 [34m 00[m[34m00[m[34m 00000 [39m [32m35E-35F [31m0862-0863 [34m 00[m[34m00[m[34m 00000 [39m [32m360-361 [31m0864-0865 [34m 00[m[34m00[m[34m 00000[33m fourth wall[39m [32m362-363 [31m0866-0867 [34m 00[m[34m00[m[34m 00000 [39m [32m364-365 [31m0868-0869 [34m 00[m[34m00[m[34m 00000 [39m [32m366-367 [31m0870-0871 [34m 00[m[34m00[m[34m 00000 [39m [32m368-369 [31m0872-0873 [34m 00[m[34m00[m[34m 00000 [39m [32m36A-36B [31m0874-0875 [34m 00[m[34m00[m[34m 00000 [39m [32m36C-36D [31m0876-0877 [34m 00[m[34m00[m[34m 00000 [39m [32m36E-36F [31m0878-0879 [34m 00[m[34m00[m[34m 00000 [39m [32m370-371 [31m0880-0881 [34m 00[m[34m00[m[34m 00000[33m wardrobe[39m This game is much better than that which preceded it, and it was fun to finish it in the final hours of the Octo Jam, as I'd added the make break code haphazardly. I was unable to incorporate an enemy which would opportunistically spawn as the make break does, and also to have better placement of the make break; these are improvements to be made in a later version. The maze is twice the size it was in that prior and the original, and how nice; I'm not finished with this game, sans for the present.