Index | wersja polska |
Written by dr. Samir Ribić, Sarajevo, Bosnia and Herzegovina, 10. Aug 2014
Once upon a time, there lived a talented artist Daedalus who made buildings and temples. King Minos invited Daedalus to the island of Crete. The king wanted Daedalus to build a maze, a Labyrinth, as a home for the king's beloved pet, the Minotaur. The Minotaur was a horrible monster, with the head of a bull on a human body. Daedalus constructed the maze as a challenge, so complicated that anyone who entered it would be lost until rescued. That way, the king would be happy, the monster would be confined, and the people would be safe.King Minos often attacked Athens, across the sea, and Athenes did not have a fleet to defend. The king of Athens, Aegeus, offered to king Minos a deal. If he would not attack Athens for 9 years, Athens would send 7 boys and 7 girls to the island of Crete to be eaten by the awful monster. King Minos kept the word. And 9 years passed. Prince Theseus of Athens knew the importance of keeping your word. But, he was also quite sure that it was wrong to send small children to be eaten by a monster. Prince Theseus told his father (the king) that he was going to Crete as the seventh son of Athens. He was going to kill the Minotaur and end the terror. When 14 children arrived to Crete, princess Ariadne, the daughter of Minos, offered a sword to Theseus, ball of string and a secret code how to exit from Labyrinth. In exchange, Theseus will help her to escape from Crete, because she thought she was too beautiful to waste time here. Theseus killed Minotaur, but his love with Ariadne was short. He left Ariadne asleep on the first stop, island of Naxos, because he preferred Ariadne's sister Phaedra. However, Ariadne was found by the most desirable husband, god of wine and pleasure Dionysus, who made her immortal.
This ancient Greek story inspired me to write first person 3D game for Casio fx-8000G, something like tiny version of Wolfenstein 3D. What? FPS with about 35000 rooms in 1K RAM on resolution 96x64? I am not kidding. There is a screenshot of the game. The goal of the game is to wound the Minotaur 9 times and enter the room called μντρ (mu-nu-tau-rho), where Ariadne will please you by unlocking the exit door. But, Minotaur will do the same to you, too. He will attack you from east or west and if you are not facing him (two arrow signs are not parallel), he will wound you from the back side. So be ready to stroke him by sword at the right moment.
Use left and right arrow keys to change direction, up arrow to go forward, Range key to pull up the sword, and AC to exit the game. At the game end you can press Disp for restart.
To enter MINOT follow the procedure:
Xmin -10 max 10 scl 1 Ymin -10 max 10 scl 1
Xmin -10 max 10 scl 0 Ymin -10 max 10 scl 0
Ans→B S<2⇒Goto 0 0→M 0.3594→A[42] 1.00419048E41→A[43]~A[44] 1.00419848E41→A[45] 1.0007705E41→A[46] Lbl 0 S=0⇒Goto 1 Range 1,95,0,1,63,0 Cls 8→C Lbl 3 " " Dsz C Goto 3 11→A Lbl 1 53→C 32→D B<0⇒B+2xy32→B Lbl 2 Frac .5B=0⇒Plot A,C Frac .5B≠0⇒Isz M Int .5B→B Isz C C=57⇒49→C Frac ((D-1)÷8)=0⇒Dsz A Dsz D Goto 2 A+8→A 0→S Plot 0,0
(˗5÷9)×(1E˗44)→Z[356]~Z[358]
2→S Hex 42435E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 FF5FC6F0:Prog 0 5EB5195F:Prog 0 BB8356A1:Prog 0 05FBB2FB:Prog 0 C45F9A61:Prog 0 F3A5F025:Prog 0 70444E2B:Prog 0 C7397C43:Prog 0 951BBA61:Prog 0 7443C05E:Prog 0 B3036046:Prog 0 CF23A106:Prog 0 77444E70:Prog 0 43C02BB4:Prog 0 9B7443C0:Prog 0 2BB58D74:Prog 0 Dec M◿
2→S Hex 42439E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 43C04036:Prog 0 AF60A1BA:Prog 0 6043B677:Prog 0 43607043:Prog 0 A7408384:Prog 0 7043A451:Prog 0 90F61077:Prog 0 0000F610:Prog 0 586043B6:Prog 0 F6107743:Prog 0 F1F61077:Prog 0 43E8F610:Prog 0 7743E2F6:Prog 0 10774415:Prog 0 2B920174:Prog 0 448FFB92:Prog 0 Dec M◿
2→S Hex 4243DE40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 70444E0A:Prog 0 C4017043:Prog 0 EB0BC401:Prog 0 0CC40370:Prog 0 444E2B92:Prog 0 017C448F:Prog 0 5E920123:Prog 0 A1037444:Prog 0 4E549305:Prog 0 23440574:Prog 0 444E56A1:Prog 0 050F9302:Prog 0 0AC70170:Prog 0 444E6046:Prog 0 6C2CA301:Prog 0 74444E2B:Prog 0 Dec M◿
2→S Hex 42441E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 C4017744:Prog 0 337C443C:Prog 0 2BC40377:Prog 0 44427C44:Prog 0 4870444E:Prog 0 0BB40160:Prog 0 46C67044:Prog 0 4E0AB501:Prog 0 7044360A:Prog 0 B4017044:Prog 0 360BB501:Prog 0 70443660:Prog 0 466C6044:Prog 0 920CD23F:Prog 0 60062060:Prog 0 0B5354C6:Prog 0 Dec M◿
2→S Hex 42445E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 0054C740:Prog 0 414708A1:Prog 0 C480A193:Prog 0 609F3580:Prog 0 9F3580B3:Prog 0 14E0F507:Prog 0 C15F8CEF:Prog 0 1404E102:Prog 0 94900295:Prog 0 90029690:Prog 0 029790FB:Prog 0 E7600100:Prog 0 70437A40:Prog 0 5A80415D:Prog 0 80600F99:Prog 0 5E960441:Prog 0 Dec M◿
2→S Hex 42449E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 470CFB94:Prog 0 FE226045:Prog 0 645E9401:Prog 0 FE216045:Prog 0 64FE2377:Prog 0 44C04901:Prog 0 0B960174:Prog 0 44A17045:Prog 0 072B9604:Prog 0 7444D854:Prog 0 93052344:Prog 0 057444D8:Prog 0 23A1067F:Prog 0 44D856A1:Prog 0 05A9A501:Prog 0 54A50256:Prog 0 Dec M◿
2→S Hex 4244DE40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 A4600AA5:Prog 0 01032582:Prog 0 6045B75E:Prog 0 A7042CA5:Prog 0 037444F5:Prog 0 FBA76045:Prog 0 CA0AA501:Prog 0 2B258274:Prog 0 44E72B16:Prog 0 227F451F:Prog 0 54930523:Prog 0 44057445:Prog 0 1F23A104:Prog 0 7F451F40:Prog 0 5BCF5CB0:Prog 0 2260452F:Prog 0 Dec M◿
2→S Hex 42451E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 2B920174:Prog 0 452E405C:Prog 0 EE5EB004:Prog 0 60452F58:Prog 0 4147160A:Prog 0 B001A972:Prog 0 A1720BB0:Prog 0 01744535:Prog 0 BA302054:Prog 0 B1025C95:Prog 0 02A22080:Prog 0 95028495:Prog 0 020B9501:Prog 0 744548AA:Prog 0 15889500:Prog 0 48600BB0:Prog 0 Dec M◿
2→S Hex 42455E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 01744542:Prog 0 58EE14A9:Prog 0 95015495:Prog 0 02A99500:Prog 0 0B950156:Prog 0 A4115CA5:Prog 0 022C9402:Prog 0 7C45830B:Prog 0 A55FE825:Prog 0 5CA7020C:Prog 0 A7036045:Prog 0 B723A411:Prog 0 74459854:Prog 0 B0820A95:Prog 0 012C9401:Prog 0 7445AA5C:Prog 0 Dec M◿
2→S Hex 42459E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 B0822BA7:Prog 0 007C45AA:Prog 0 5EA70460:Prog 0 45CA03A0:Prog 0 01231502:Prog 0 74457558:Prog 0 5EA6015C:Prog 0 B002FE30:Prog 0 FE300CB0:Prog 0 3F0BB010:Prog 0 E8305854:Prog 0 B0620AB0:Prog 0 00FE300A:Prog 0 A6014047:Prog 0 11A0A742:Prog 0 405A2048:Prog 0 Dec M◿
2→S Hex 4245DE40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 600BA601:Prog 0 7445DE80:Prog 0 A5424860:Prog 0 0BB00174:Prog 0 45E624A3:Prog 0 017C45FD:Prog 0 06A2F080:Prog 0 A5425840:Prog 0 37004138:Prog 0 00F3C42C:Prog 0 C0017446:Prog 0 0F56C401:Prog 0 2CC1017C:Prog 0 463E54C0:Prog 0 A40341A4:Prog 0 5CC2A4A0:Prog 0 Dec M◿
2→S Hex 42461E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 C2A404C5:Prog 0 0F54C0C4:Prog 0 0741C45C:Prog 0 C2C4A1C2:Prog 0 C404C60F:Prog 0 5CC2C423:Prog 0 42A47446:Prog 0 3EF3C4A1:Prog 0 C1A4A0C0:Prog 0 C45CC2A4:Prog 0 0F42C40C:Prog 0 C21F7C46:Prog 0 682BC100:Prog 0 7C46682B:Prog 0 41A27C46:Prog 0 682BC000:Prog 0 Dec M◿
2→S Hex 42465E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 7C46682B:Prog 0 40A27446:Prog 0 6B56C401:Prog 0 585FA960:Prog 0 4246E054:Prog 0 C48402C4:Prog 0 014A0803:Prog 0 C4017446:Prog 0 785E9604:Prog 0 9F3580BB:Prog 0 40206046:Prog 0 B66045FE:Prog 0 ECA20A22:Prog 0 846046B6:Prog 0 6045FEEC:Prog 0 A30A2384:Prog 0 Dec M◿
2→S Hex 42469E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 6046B660:Prog 0 45FEECA1:Prog 0 0A218460:Prog 0 46B64E06:Prog 0 0B960174:Prog 0 468C58B2:Prog 0 502007D0:Prog 0 800A4105:Prog 0 07D1800A:Prog 0 40255854:Prog 0 93052344:Prog 0 057446E7:Prog 0 02A10123:Prog 0 A1047446:Prog 0 E756A105:Prog 0 0F93020A:Prog 0 Dec M◿
2→S Hex 4246DE40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 C6012BC6:Prog 0 3A7C43B0:Prog 0 587F7D81:Prog 0 7F81817E:Prog 0 81837F81:Prog 0 817F817F:Prog 0 7E81837F:Prog 0 817F7F82:Prog 0 7F7D817F:Prog 0 7F817F81:Prog 0 82080709:Prog 0 0600101C:Prog 0 242800CC:Prog 0 9933EE20:Prog 0 4724472A:Prog 0 4736474A:Prog 0 Dec M◿
2→S Hex 42471E40:Prog 0 5AF7415B:Prog 0 37600008:Prog 0 70000000:Prog 0 470101FA:Prog 0 F10103B7:Prog 0 09181A02:Prog 0 0473280C:Prog 0 094870E3:Prog 0 0070F003:Prog 0 05F3380E:Prog 0 0C39180C:Prog 0 08F80000:Prog 0 000C08E0:Prog 0 F1F3F702:Prog 0 03EF0CFB:Prog 0 0000EFEF:Prog 0 00007043:Prog 0 60475547:Prog 0 55475547:Prog 0 Dec M◿
2→S Hex 42475E40:Prog 0 5AF7415B:Prog 0 15600008:Prog 0 70000000:Prog 0 5547203A:Prog 0 30EC3A5D:Prog 0 3835335B:Prog 0 5A0E5D30:Prog 0 3334875B:Prog 0 5A01434D:Prog 0 00544F4E:Prog 0 494D0000:Prog 0 Dec M◿
0000: ORG &H435F 435F: FF db &HFF ; EOF marker 4360: ; R28 Player row 4360: ; R29 Player column 4360: ; R32 Generated room row 4360: ; R33 Generated room column 4360: ; R36 View direction 0 N, 1 E, 2 S, 3 W 4360: ; R81 Distance to Minotaur 0 far, 1 distant, 2 medium, 3 near 4 in battle 5+ invisible 4360: 4360: 4360: 4360: 4360: RESTART: 4360: 5FC6F0 ldm r38..r39,'0' ; Score Theseus-Minotaur 4363: 4363: 5EB519 LD R29,&H19 ; Initial position in the Labyrinth, column 4366: 5FBB83 LDM R27..R28,&H3 ; R28 = Initial position in the Labyrinth, row 4366: ; R29 = upper byte of Minotaur arrival counter 4369: 4369: 56A105 LD R81,5 436C: FBB2 byd r26 ; set byte of Minotaur arrival counter to zero 436E: FBC4 byd R36 4370: 4370: 5F9A61 LDM r10..r11,1 ; R10 = sword, R11 = first attack east 4373: F3A5 byd R85 4375: F025 inv R85 ; This register contains FF byte, which is not allowed to be in code because it is EOF marker 4377: 70444E JMP REF 437A: LP: 437A: 2BC739 TSB R39,'9' ; If the score of Theseus is '9' 437D: 7C4395 JMP Z,MINDEAD ; Minotaur is dead, no move 4380: 1BBA61 SBM R26..R27,1 ; Decrement counter 4383: 7443C0 JMP NZ,TESTKBD ; TIMED EVENTS 4386: 5EB303 LD R27,3 ; Reset timer 4389: 6046CF CAL APPROACH ; Make Minotaur closer 438C: 23A106 TSB R81,6 ; If Minotaur is visible refresh screen 438F: 77444E JMP C,REF 4392: 7043C0 JMP TESTKBD ; Else just read keyboard 4395: MINDEAD: 4395: 2BB49B TSB R28,&H9B ; minotaur room row 4398: 7443C0 JMP NZ,TESTKBD 439B: 2BB58D TSB R29,&H8D ; minotaur room column 439E: 7443C0 JMP NZ,TESTKBD 43A1: WIN: ; Minotaur is dead and Theseus is in Minotaur's room 43A1: 4036AF ldw ix,&H36AF ; ROM message "Please" used for victory 43A4: WINANDLOSE: 43A4: 60A1BA cal &HA1BA ; Display 16 letters message 43A7: GAMEEND: 43A7: 6043B6 CAL TESTKB1 ; Read keyboard byte and check keys for exit and restart the game 43AA: 774360 JMP C,RESTART 43AD: 7043A7 JMP GAMEEND 43B0: LOSE: 43B0: 408384 LDW IX, &H8384 ; ROM message "Did not pass" used for lose 43B3: 7043A4 JMP WINANDLOSE 43B6: 43B6: TESTKB1: 43B6: 5190 GST R72,KI ; READ KEYBOARD 43B8: F610 ROD R72 ; Disp/AC exit the game 43BA: 770000 JMP C,0 43BD: F610 ROD R72 43BF: 58 RTN 43C0: TESTKBD: 43C0: 6043B6 CAL TESTKB1 ; Read keyboard byte and shift it , then execute keyboard actions 43C3: F610 ROD R72 43C5: 7743F1 JMP C,RANGEFIRE 43C8: F610 ROD R72 43CA: 7743E8 JMP C,LEFTKEY 43CD: F610 ROD R72 43CF: 7743E2 JMP C,RIGHTKEY 43D2: F610 ROD R72 43D4: 774415 JMP C,FORWARDKEY 43D7: 43D7: 2B9201 TSB R10,1 ; No key pressed and sword is up 43DA: 74448F JMP NZ,REF1 43DD: FB92 byd R10 ; Then pull the sword flag 43DF: 70444E JMP REF 43E2: RIGHTKEY: ; Rotating updates lowest two bits of R36 43E2: 0AC401 AD R36,1 43E5: 7043EB JMP LF1 43E8: LEFTKEY: 43E8: 0BC401 SB R36,1 43EB: LF1: 43EB: 0CC403 AN R36,3 43EE: 70444E JMP REF 43F1: RANGEFIRE ; Range Key pulls the sword 43F1: 2B9201 TSB R10,1 ; But if it is already up just plot it, because we want to kill Minotaur if we pull the sword when he is at near position 43F4: 7C448F JMP Z,REF1 43F7: 5E9201 LD R10,1 ; Sword UP 43FA: 23A103 TSB R81,3 ; Minotaur at position near 43FD: 74444E JMP NZ,REF 4400: 549305 LD R104,R11 ; And the Minotaur direction is facing to us 4403: 234405 TSB R104,R36 4406: 74444E JMP NZ,REF 4409: 56A105 LD R81,&H5 ; Minotaur passed 440C: 0F9302 XR R11,2 ; Attack flips east-west 440F: 0AC701 AD R39,1 ; Theseus won the round 4412: 70444E JMP REF 4415: 4415: FORWARDKEY: 4415: 60466C CAL MAKEROOMBITMAP ; Generate in three registers bitmap structure of the forward landscape 4418: 2CA301 TAN R19,1 ; If the wall is in front us do not move 441B: 74444E JMP NZ,REF 441E: 2BC401 TSB R36,1 ; Else move in the correct direction 4421: 774433 JMP C,GONORTH 4424: 7C443C JMP Z,GOEAST 4427: 2BC403 TSB R36,3 442A: 774442 JMP C,GOSOUTH 442D: 7C4448 JMP Z,GOWEST 4430: 4430: 70444E JMP REF ; Plot the landscape 4433: 4433: GONORTH: 4433: 0BB401 SB R28,1 ; change location 4436: GN1: 4436: 6046C6 CAL APPROAC1 ; If we are facing to Minotaur, make him faster approach 4439: 70444E JMP REF 443C: GOEAST: 443C: 0AB501 AD R29,1 443F: 704436 JMP GN1 4442: GOSOUTH: 4442: 0AB401 AD R28,1 4445: 704436 JMP GN1 4448: GOWEST: 4448: 0BB501 SB R29,1 444B: 704436 JMP GN1 444E: 444E: 444E: REF: 444E: 60466C CAL MAKEROOMBITMAP ; Generate landscape codes 4451: 604492 CAL SCENE ; Display the scene 4454: 0CD23F AN R42,&H3F ; PARAMETER DO REFRESH 4457: 600620 CAL &H0620 ; SYSTEM CALL REFRESH 445A: 445A: 600B53 cal &H0B53 ; clear string 445D: 54C600 LD R64,r38 ; Score Minotaur 4460: 54C740 LD R66,R39 ; Score Theseus 4463: 414708 LDW IY,DIRECTIONCODES 4466: A1C480 LD R68,(IY+R36) ; Arrows in Casio character set for Theseus direction 4469: A19360 LD R67,(IY+R11) ; Arrows in Casio character set for Minotaur direction 446C: 446C: 9F3580 STM -(SP),R29..R28 ; player's row and column, split two bytes into four nibbles 446F: 9F3580 STM -(SP),R29..R28 4472: B314E0 LDM R76..R79,(SP)+ 4475: F507C1 DIDM R79..R78 4478: 5F8CEF LDM R4..R7,&H0F 447B: 1404E1 ANM R76..R79,R4..R7 447E: 447E: 029490 AD R76,&H90 ; Greek letter offset 4481: 029590 AD R77,&H90 4484: 029690 AD R78,&H90 4487: 029790 AD R79,&H90 448A: 448A: FBE7 byd r55 ; upper corner 448C: 600100 cal &H0100 ;display the string R79..R64 448F: REF1: 448F: 70437A JMP LP ; Return to main loop 4492: SCENE: 4492: 405A80 LDW IX,&H5A80 ; Start of video memory 4495: 415D80 LDW IY,&H5A80+768 4498: 600F99 cal &H0F99 ; This ROM routine with these parameters will clear the screen 449B: 449B: 5E9604 LD R14,4 ; Scene is drawn from four zones 449E: 41470C LDW IY,ZONES ; whose starting x coordinate is pointed to by IY 44A1: SCENELP: 44A1: FB94 byd R12 44A3: FE22 ROD R18 44A5: 604564 CAL MAZESHAPE ; Left wall 44A8: 5E9401 LD R12,1 44AB: FE21 ROD R17 44AD: 604564 CAL MAZESHAPE ; Right wall 44B0: FE23 ROD R19 ; Middle wall 44B2: 7744C0 JMP C,DEADEND 44B5: 4901 ADW IY,1 ; Pointer to the next starting row 44B7: 0B9601 SB R14,1 44BA: 7444A1 JMP NZ,SCENELP 44BD: 704507 JMP MINOTAUR1 44C0: DEADEND: ; Plot the wall in front of us 44C0: 2B9604 TSB R14,4 ; Test if we bump into wall 44C3: 7444D8 JMP NZ,PLOTDEADEND ; Skip if not 44C6: HIDE: 44C6: 549305 LD R104,R11 ; If we are just behind the wall, facing Minotaur 44C9: 234405 TSB R104,R36 44CC: 7444D8 JMP NZ,PLOTDEADEND 44CF: 23A106 TSB R81,6 44D2: 7F44D8 JMP NC,PLOTDEADEND 44D5: 56A105 LD R81,5 ; He will disappear 44D8: PLOTDEADEND: ; Wall in front us consists of lines of the same height 44D8: A9A501 LD R21,(IY+1) ;from x=pointed to by IY+1 44DB: 54A502 LD R80,R21 44DE: 56A460 LD R84,96 44E1: 0AA501 AD R21,1 44E4: 032582 SB R84,R21 ; to 95-x 44E7: DELOOP: 44E7: 6045B7 CAL CALCLINEHL ; Calculate line height 44EA: 5EA704 LD R23,4 ; brick pattern 44ED: 2CA503 TAN R21,3 ; every 4th pattern is vertical line 44F0: 7444F5 JMP NZ,DEBRICK 44F3: FBA7 byd R23 44F5: DEBRICK: 44F5: 6045CA CAL VLINE ; Draw vertical line for front wall 44F8: 0AA501 AD R21,1 44FB: 2B2582 TSB R21,R84 44FE: 7444E7 JMP NZ,DELOOP 4501: MINOTAUR: 4501: 2B1622 TSB R14,R81 4504: 7F451F JMP NC,SWORD 4507: 4507: MINOTAUR1: 4507: 549305 LD R104,R11 ; Check if Minotaur is facing Theseus 450A: 234405 TSB R104,R36 450D: 74451F JMP NZ,SWORD 4510: 23A104 TSB R81,4 4513: 7F451F JMP NC,SWORD ; Check if Minotaur is nearby 4516: 405BCF LDW IX,&H5B6F+96 ; Screen position of Minotaur 4519: 5CB022 LD R24,R81 ; Number of sprite is Minotaur distance code 451C: 60452F CAL SPRITE 451F: 451F: SWORD: 451F: 2B9201 TSB R10,1 4522: 74452E JMP NZ,ENDDRAW ; if sword is pulled skip painting 4525: 405CEE LDW IX,&H5CEE ; Screen position of the sword 4528: 5EB004 LD R24,4 ; Sword is sprite number 4 452B: 60452F CAL SPRITE 452E: ENDDRAW: 452E: 58 RTN 452F: 452F: SPRITE: ; Sprite draw routine 452F: 414716 LDW IY,SPROFFSET 4532: 0AB001 AD R24,1 4535: MST: ; Find sprite definition 4535: A972 LD R58,(IY)+ 4537: A172 LD R122,(IY)+ ; HERE IS LITTLE ENDIAN, assembler property. However upd1007 often uses big endian 4539: 0BB001 SB R24,1 ; IZ points to the sprite definition 453C: 744535 JMP NZ,MST 453F: BA3020 LDM R24..R25,(IZ)+ ; Take number of rows (8pixels) and columns (1 pixel) in sprite definition 4542: MST1: 4542: 54B102 LD R80,R25 4545: 5C9502 LD R13,R80 4548: MST2: 4548: A220 LD R80,(IZ)+ 454A: 809502 ST (IX+R13),R80 454D: 849502 ST (IX-R13),R80 ; All sprites are symetric to save RAM 4550: 0B9501 SB R13,1 4553: 744548 JMP NZ,MST2 4556: AA15 LD R13,(IZ)+ ; The middle is stored at end 4558: 889500 ST (IX+0),R13 455B: 4860 ADW IX,96 ; Next sprite row 455D: 0BB001 SB R24,1 4560: 744542 JMP NZ,MST1 4563: ENDSPRITE: 4563: 58 RTN 4564: 4564: MAZESHAPE: ; IY points to X position, R12 + carry type 4564: EE14 ROU R12 4566: A99501 LD R13,(IY+1) 4569: SETENDLINE: 4569: 549502 LD R80,R13 456C: A99500 LD R13,(IY+0) 456F: ; Input: R12 type, R80 endline R13 Startline 456F: MAZEPART: ; Plot left and right side of the maze. 456F: 0B9501 SB R13,1 4572: 56A411 LD R84,17 4575: MPLOOP: 4575: 5CA502 LD R21,R80 4578: 2C9402 TAN R12,2 ; left or right wall 457B: 7C4583 JMP Z,MPLOOP1 457E: 0BA55F SB R21,95 ; this is right side 4581: E825 CMP R21 4583: MPLOOP1: 4583: 5CA702 LD R23,R80 ; make pattern code from the current line 4586: 0CA703 AN R23,3 4589: 6045B7 CAL CALCLINEHL ; Calculate height from x (R80) 458C: 23A411 TSB R84,17 458F: 744598 JMP NZ,SKIPLENREM 4592: 54B082 LD R84,R24 ; Remember wall height 4595: 0A9501 AD R13,1 4598: SKIPLENREM: ; If there is side wall plot the lines in zone with different height. 4598: 2C9401 TAN R12,1 ; If there is side hole the lines in zone are with same height. 459B: 7445AA JMP NZ,DRAWLINE 459E: 5CB082 LD R24,R84 ; side walls are different, undo CALCLINEHL 45A1: 2BA700 TSB R23,0 45A4: 7C45AA JMP Z,DRAWLINE 45A7: 5EA704 LD R23,4 ; brick pattern 45AA: DRAWLINE: ; Now call vertical line 45AA: 6045CA CAL VLINE 45AD: 03A001 SB R80,1 ; next x coordinate 45B0: 231502 TSB R80,R13 45B3: 744575 JMP NZ,MPLOOP 45B6: 58 RTN 45B7: CALCLINEHL: ; Calculates vertical line height from x position 45B7: 5EA601 LD R22,1 45BA: 5CB002 LD R24,R80 45BD: FE30 ROD R24 45BF: FE30 ROD R24 45C1: 0CB03F AN R24,&H3F 45C4: 0BB010 SB R24,16 45C7: E830 CMP R24 45C9: 58 RTN 45CA: ; Draw vertical line. Parameters R21 - column, R22 - row/8, R23 - pattern, R24 - repeat 45CA: 45CA: VLINE: 45CA: 54B062 LD R83,R24 45CD: 0AB000 AD R24,0 ; Divide repeat by 2 45D0: FE30 ROD R24 45D2: 0AA601 AD R22,1 ; Initial skip 45D5: 404711 LDW IX,VMASKS 45D8: A0A742 LD R82,(IX+R23) ; get the pattern from pattern number 45DB: 405A20 LDW IX,&H5A80-96 45DE: VLINEST: 45DE: 4860 ADW IX,96 45E0: 0BA601 SB R22,1 45E3: 7445DE JMP NZ,VLINEST 45E6: VLINEF: 45E6: 80A542 ST (IX+R21),R82 45E9: 4860 ADW IX,96 45EB: 0BB001 SB R24,1 45EE: 7445E6 JMP NZ,VLINEF 45F1: 24A301 TAN R83,1 ; Due to vertical byte organization of video memory every second vertical line will have additional nibble 45F4: 7C45FD JMP Z,ENDVLINE 45F7: 06A2F0 OR R82,&HF0 ; Mask the nibble 45FA: 80A542 ST (IX+R21),R82 ; Put it to screen 45FD: ENDVLINE: 45FD: 58 RTN 45FE: 45FE: 45FE: ROOMCALC: 45FE: ; R32 row of generated room 45FE: ; R33 column of generated room 45FE: ; This routine uses calculation randomized by reading ROM from x and y room coordinate and returns 1 (wall) or 0 (room) 45FE: 403700 LDW IX,&H3700 ; partrom 4601: 413800 LDW IY,&H3800 ; partrom2 4604: F3C4 byd R100 ; mazepos1:=0; 4606: 2CC001 TAN R32,1 ; if y and 1 =0 then mazepos1:=1; 4609: 74460F JMP NZ,ROOMCALC1 460C: 56C401 LD R100,1 460F: ; if ((partrom[(y - x) mod 256] and 15) = (partrom2[(y xor x) mod 256] and 15)) and (x mod 2 =1)then mazepos1:=0; 460F: ROOMCALC1: 460F: 2CC101 TAN R33,1 4612: 7C463E JMP Z,ROOMCALC2 4615: 54C0A4 LD R101,R32 4618: 0341A4 SB R101,R33 461B: 5CC2A4 LD R34,R101 461E: A0C2A4 LD R101,(IX+R34) 4621: 04C50F AN R101,15 4624: 4624: 54C0C4 LD R102,R32 4627: 0741C4 XR R102,R33 462A: 5CC2C4 LD R34,R102 462D: A1C2C4 LD R102,(IY+R34) 4630: 04C60F AN R102,15 4633: 5CC2C4 LD R34,R102 4636: 2342A4 TSB R101,R34 4639: 74463E JMP NZ,ROOMCALC2 463C: F3C4 byd R100 463E: ; if (partrom2[x] xor partrom[y]) and 31 =0 then mazepos1:=1; 463E: ROOMCALC2: 463E: A1C1A4 LD R101,(IY+R33) 4641: A0C0C4 LD R102,(IX+R32) 4644: 5CC2A4 LD R34,R101 4647: 0F42C4 XR R34,R102 464A: 0CC21F AN R34,31 464D: 7C4668 JMP Z,MAZEBORDER 4650: ROOMCALC3: 4650: ; if x=0 or x=255 or y=0 or y=255 then mazepos1:=1; 4650: 2BC100 TSB R33,0 4653: 7C4668 JMP Z,MAZEBORDER 4656: 2B41A2 TSB R33,r85 4659: 7C4668 JMP Z,MAZEBORDER 465C: 2BC000 TSB R32,0 465F: 7C4668 JMP Z,MAZEBORDER 4662: 2B40A2 TSB R32,r85 4665: 74466B JMP NZ,ROOMCALCFIN 4668: MAZEBORDER: 4668: 56C401 LD R100,1 466B: ROOMCALCFIN: 466B: 58 RTN 466C: 466C: ; This is format returned by MAKEROOMBITMAP 466C: ; R18 R19 R17 466C: ; X 466C: ; X X X 466C: ; X X X 466C: ; X X X 466C: ; X Player X 466C: 466C: 466C: MAKEROOMBITMAP: ; This routine looks 12 rooms in front of player and stores their configuration in bits of registers R17,R18 and R19. 466C: 466C: 5FA960 LDM R17..R19,0 466F: 4246E0 LDW IZ,NORTH-8 ; IZ points to the table , depending of direction where we look on 4672: 54C484 LD R100,R36 4675: 02C401 AD R100,1 4678: SIDEDETERMINE: 4678: 4A08 ADW IZ,8 467A: 03C401 SB R100,1 467D: 744678 JMP NZ,SIDEDETERMINE ; After this loop IZ will point to the increment table for visiting neighbour rooms 4680: 5E9604 LD R14,4 4683: 4683: 9F3580 STM -(SP),R29..R28 4686: BB4020 LDM R32..R33,(SP)+ ; coordinates of examined rooms 4689: 4689: 6046B6 CAL NEXTIZ ; increment x and y to go to the neighbour room 468C: LOOKNORTHLP: 468C: 6045FE CAL ROOMCALC ; left 468F: ECA2 BIU R18 4691: 0A2284 AD R18,R100 4694: 6046B6 CAL NEXTIZ ; middle 4697: 6045FE CAL ROOMCALC 469A: ECA3 BIU R19 469C: 0A2384 AD R19,R100 469F: 6046B6 CAL NEXTIZ ; right 46A2: 6045FE CAL ROOMCALC 46A5: ECA1 BIU R17 46A7: 0A2184 AD R17,R100 46AA: 6046B6 CAL NEXTIZ 46AD: 4E06 SBW IZ,6 46AF: 0B9601 SB R14,1 46B2: 74468C JMP NZ,LOOKNORTHLP 46B5: 58 RTN 46B6: NEXTIZ: 46B6: B25020 LDM R104..R105,(IZ)+ 46B9: 07D080 XR R104,&H80 46BC: 0A4105 AD R33,R104 46BF: 07D180 XR R105,&H80 46C2: 0A4025 AD R32,R105 46C5: 46C5: 46C5: 58 RTN 46C6: APPROAC1: 46C6: 549305 LD R104,R11 46C9: 234405 TSB R104,R36 46CC: 7446E7 JMP NZ,ENDEVENT 46CF: APPROACH: 46CF: 02A101 AD R81,1 ; decrease the distance to Minotaur 46D2: 23A104 TSB R81,4 46D5: 7446E7 JMP NZ,ENDEVENT 46D8: 56A105 LD R81,&H5 ; If he arrived and sword was not pulled 46DB: 0F9302 XR R11,2 46DE: 0AC601 AD R38,1 ; Score Minotaur 46E1: 2BC63A TSB R38,58 46E4: 7C43B0 JMP Z,LOSE ; Theseus loses life 46E7: ENDEVENT: 46E7: 58 RTN 46E8: ; Table of directions is XOR-ed with 128 to avoid prohibited code FF in memory 46E8: NORTH: 46E8: ; DB -1,-3, 1,-1, 1,1, -2,1 46E8: 7F7D817F81817E81 DB 127,125, 129,127, 129,129, 126,129 46F0: ; dx,dy, dx,dy dx,dy dx,dy 46F0: EAST: 46F0: ; DB 3,-1, 1,1, -1,1, -1,-2 46F0: 837F81817F817F7E db 131,127,129,129,127,129,127,126 46F8: SOUTH: 46F8: ; DB 1,3, -1,1, -1,-1, 2,-1 46F8: 81837F817F7F827F db 129,131,127,129,127,127,130,127 4700: WEST: 4700: ; DB -3,1, -1,-1, 1,-1, 1,2 4700: 7D817F7F817F8182 db 125,129,127,127,129,127,129,130 4708: DIRECTIONCODES: 4708: 08070906 db 8,7,9,6 470C: 470C: ZONES: 470C: 00101C2428 DB 0,16,28,36,40 4711: VMASKS: 4711: 00CC9933EE DB &H00,&HCC,&H99,&H33,&HEE 4716: 4716: SPROFFSET: 4716: 204724472A4736474A47 DW VFARMINDATA,FARMINDATA,MEDMINDATAR1,NEARMINDATAR1,SWORDDATA 4720: ; Minotaur and sword definition 4720: VFARMINDATA: 4720: 0101FAF1 DB 1,1,&HFA,&HF1 4724: FARMINDATA: 4724: 0103B709181A DB 1,3,&HB7,&H09,&H18,&H1A 472A: MEDMINDATAR1: 472A: 020473280C0948 DB 2,4,&H73,&H28,&H0C,&H09,&H48 4731: MEDMINDATAR2: 4731: 70E30070F0 DB &H70,&HE3,&H00,&H70,&HF0 4736: NEARMINDATAR1: 4736: 0305F3380E0C3918 DB 3,5,&HF3,&H38,&H0E,&H0C,&H39,&H18 473E: NEARMINDATAR2: 473E: 0C08F8000000 DB &H0C,&H08,&HF8,&H00,&H00,&H00 4744: NEARMINDATAR3: 4744: 0C08E0F1F3F7 DB &H0C,&H08,&HE0,&HF1,&HF3,&HF7 474A: SWORDDATA: 474A: 0203EF0CFB00 DB 2,3, &HEF,&H0C,&HFB,&H00 4750: 00EFEF00 db &H00,&HEF,&HEF,&H00 4754: ORG &H4755 4755: 704360 JMP RESTART 4758: 4755475547554755 db 'GUGUGUGU' ; This sequence is also 4755475547554755 4760: 47203A30EC3A5D3835335B5A0E5D303334875B5A01 DB 'G :0',&HEC,':]853[Z',&H0E,']034',&H87,'[Z',01 4775: 434D00 DB 'CM',00 ; PASSWORD 2 LETTERS 4778: 544F4E494D DB 'TONIM' ; Name 5 letters
5AE8: 42435E LDW IZ,&H435E ; destination address-1 5AEB: 405AF7 LDW IX,&H5AF7 ; source address in video memory-1 5AEE: 415B37 LDW IY,&H5B37 ; end of source in video memory 5AF1: 600008 CAL 8 ; transfer block 5AF4: 700000 JMP 0 ; home screen 5AF7: 00 DB 0 ; address needs to be divisible by 4 5AF8: 57A820 db &h57,&hA8,&h20 ; LDM R80..R81,0 etc. ...
List of files in the archive: