Prev: 52279 Up: Map Next: 52958
52344: Script Interpreter
Used by the routine at GameEntryPoint.
ScriptInterpreter 52344 CALL 52314 Call 52314.
52347 LD IY,(40923) IY=40923.
52351 CALL 53256 Call 53256.
ScriptInterpreter_0 52354 LD L,(IY+1) L=*IY+1.
52357 LD H,(IY+2) H=*IY+2.
52360 XOR A Write 0 to *47412.
52361 LD (47412),A
52364 LD A,(52235) Jump to ScriptInterpreter_12 if *52235 is equal to 10.
52367 CP 10
52369 JP Z,ScriptInterpreter_12
ScriptInterpreter_1 52372 LD A,(HL) Jump to ScriptInterpreter_2 if *HL is not equal to A.
52373 AND A
52374 JR NZ,ScriptInterpreter_2
52376 INC HL Increment HL by one.
52377 JR ScriptInterpreter_1 Jump to ScriptInterpreter_1.
ScriptInterpreter_2 52379 PUSH HL IX=HL (using the stack).
52380 POP IX
52382 LD (40921),HL Write HL to *40921.
52385 AND %00001111 Keep only bits 0-3.
52387 CP 10 Jump to ScriptInterpreter_4 if A is greater than or equal to 10.
52389 JR NC,ScriptInterpreter_4
52391 LD A,(52237) Jump to ScriptInterpreter_3 if *52237 is not equal to 1.
52394 CP 1
52396 JR NZ,ScriptInterpreter_3
52398 SUB A A-=A.
52399 LD (52237),A Write A to *52237.
52402 LD A,(HL) A=*HL.
52403 CALL 47414 Call 47414.
52406 JP C,ScriptInterpreter_13 Jump to ScriptInterpreter_13 if A is less than 1.
52409 JR Z,ScriptInterpreter_3 Jump to ScriptInterpreter_3 if A is equal to 1.
52411 CALL 50385 Call 50385.
52414 RET NC Return if A is greater than 1.
52415 CALL 53174 Call 53174.
52418 LD (IX+5),2 Write 2 to *IX+5.
52422 RET Return.
ScriptInterpreter_3 52423 LD A,(HL) A=*HL.
52424 AND %00001111 Keep only bits 0-3.
52426 CP 7 Jump to ScriptInterpreter_18 if A is equal to 7.
52428 JP Z,ScriptInterpreter_18
52431 CP 6 Jump to ScriptInterpreter_14 if A is equal to 6.
52433 JP Z,ScriptInterpreter_14
52436 CP 5 Jump to ScriptInterpreter_15 if A is equal to 5.
52438 JP Z,ScriptInterpreter_15
52441 CP 4 Jump to ScriptInterpreter_16 if A is equal to 4.
52443 JP Z,ScriptInterpreter_16
52446 CP 1 Jump to ScriptInterpreter_20 if A is equal to 1.
52448 JP Z,ScriptInterpreter_20
52451 CP 3 Jump to ScriptInterpreter_19 if A is equal to 3.
52453 JP Z,ScriptInterpreter_19
52456 CP 8 Jump to ScriptInterpreter_8 if A is equal to 8.
52458 JR Z,ScriptInterpreter_8
52460 CP 9 Jump to ScriptInterpreter_9 if A is equal to 9.
52462 JR Z,ScriptInterpreter_9
52464 JP ScriptInterpreter_17 Jump to ScriptInterpreter_17.
ScriptInterpreter_4 52467 CP 14 Jump to ScriptInterpreter_5 if A is not equal to 14.
52469 JR NZ,ScriptInterpreter_5
52471 LD A,(IX+1) Write *IX+1 to *IY+1.
52474 LD (IY+1),A
52477 LD A,(IX+2) Write *IX+2 to *IY+2.
52480 LD (IY+2),A
52483 JP ScriptInterpreter_0 Jump to ScriptInterpreter_0.
ScriptInterpreter_5 52486 CP 12 Jump to ScriptInterpreter_6 if A is equal to 12.
ScriptInterpreter_6 52488 JR Z,ScriptInterpreter_6
52490 CP 11 Jump to ScriptInterpreter_7 if A is not equal to 11.
52492 JR NZ,ScriptInterpreter_7
52494 CALL 53199 Call 53199.
52497 CP 2 Return if A is equal to 2.
52499 RET Z
52500 JP ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_7 52503 CP 10 Jump to ScriptInterpreter_11 if A is not equal to 10.
52505 JR NZ,ScriptInterpreter_11
52507 CALL 53199 Call 53199.
52510 CP 2 Return if A is equal to 2.
52512 RET Z
52513 JP ScriptInterpreter_25 Jump to ScriptInterpreter_25.
ScriptInterpreter_8 52516 LD A,(IX+1) A=*IX+1.
52519 PUSH AF Stash AF on the stack.
52520 LD A,2 A=2.
52522 CALL 41244 Call 41244.
52525 LD HL,(40935) HL=*40935.
52528 LD (40935),IX Write IX to *40935.
52532 LD (IX-2),L Write L to *IX-2.
52535 LD (IX-1),H Write H to *IX-1.
52538 LD A,(41014) Write *41014 to *IX+0.
52541 LD (IX+0),A
52544 POP AF Restore AF from the stack.
52545 LD (IX+1),A Write A to *IX+1.
52548 JP ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_9 52551 LD B,(IX+1) B=*IX+1.
52554 LD IX,40937 IX=40937.
ScriptInterpreter_10 52558 CALL 41207 Call 41207.
52561 JP Z,ScriptInterpreter_25 Jump to ScriptInterpreter_25 if A is equal to 2.
52564 LD A,(41014) Jump to ScriptInterpreter_10 if *41014 is not equal to *IX+1.
52567 CP (IX+1)
52570 JR NZ,ScriptInterpreter_10
52572 LD A,B Jump to ScriptInterpreter_10 if B is not equal to *IX+0.
52573 CP (IX+0)
52576 JR NZ,ScriptInterpreter_10
52578 PUSH IY Stash IY on the stack.
52580 PUSH IX DE=IX (using the stack).
52582 POP DE
52583 LD IY,40935 IY=40935.
52587 CALL 41220 Call 41220.
52590 LD L,(IX-2) L=*IX-2.
52593 LD H,(IX-1) H=*IX-1.
52596 LD (IY-2),L Write L to *IY-2.
52599 LD (IY-1),H Write H to *IY-1.
52602 CALL 41415 Call 41415.
52605 POP IY Restore IY from the stack.
52607 JP ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_11 52610 LD HL,1 Write 0001 to *40991.
52613 LD (40991),HL
52616 JP ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_12 52619 LD HL,1 Write 0001 to *40991.
52622 LD (40991),HL
ScriptInterpreter_13 52625 CALL 53286 Call 53286.
52628 RET Return.
ScriptInterpreter_14 52629 LD L,(IX+1) L=*IX+1.
52632 LD H,(IX+2) H=*IX+2.
52635 CALL 42399 Call 42399.
52638 JP ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_15 52641 LD L,(IX+2) L=*IX+2.
52644 LD H,(IX+3) H=*IX+3.
52647 PUSH HL Stash HL on the stack.
52648 LD A,(IX+1) A=*IX+1.
52651 CALL 52958 Call 52958.
52654 LD (41012),A Write A to *41012.
52657 LD A,7 Write 7 to *40975.
52659 LD (40975),A
52662 LD HL,26672 HL=26672.
52665 CALL 42399 Call 42399.
52668 JP ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_16 52671 LD A,46 Write 46 to *41011.
52673 LD (41011),A
52676 LD A,(IX+1) A=*IX+1.
52679 CALL 52958 Call 52958.
52682 LD (41012),A Write A to *41012.
52685 LD A,(IX+2) A=*IX+2.
52688 LD (41821),A Write A to *41821.
52691 LD A,(IX+3) A=*IX+3.
52694 CALL 52958 Call 52958.
52697 LD (41822),A Write A to *41822.
52700 LD A,(IX+4) A=*IX+4.
52703 CALL 52958 Call 52958.
52706 LD (41823),A Write A to *41823.
52709 LD A,8 A=8.
52711 CALL 41244 Call 41244.
52714 LD A,(41012) A=*41012.
52717 LD (IX+0),A Write A to *IX+0.
52720 LD (IX+1),255 Write 255 to *IX+1.
52724 LD A,(41821) A=*41821.
52727 LD (IX+2),A Write A to *IX+2.
52730 LD HL,(41822) HL=*41822.
52733 LD (IX+3),L Write L to *IX+3.
52736 LD (IX+4),H Write H to *IX+4.
52739 LD HL,(40942) HL=*40942.
52742 LD (40942),IX Write IX to *40942.
52746 LD (IX-2),L Write L to *IX+254.
52749 LD (IX-1),H Write H to *IX+255.
52752 LD HL,26666 HL=26666.
52755 CALL 42399 Call 42399.
52758 JR ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_17 52760 LD A,(IX+1) A=*IX+1.
52763 CALL 52958 Call 52958.
52766 LD (41011),A Write A to *41011.
52769 LD A,(IX+2) A=*IX+2.
52772 CALL 52958 Call 52958.
52775 LD (41012),A Write A to *41012.
52778 LD A,(IX+3) A=*IX+3.
52781 CALL 52958 Call 52958.
52784 LD (41013),A Write A to *41013.
52787 CALL 50385 Call 50385.
52790 RET C Return if A is less than 8.
52791 JR Z,ScriptInterpreter_25 Jump to ScriptInterpreter_25 if A is equal to 8.
52793 JR ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_18 52795 LD A,(IX+3) A=*IX+3.
52798 CALL 52958 Call 52958.
52801 LD (41012),A Write A to *41012.
52804 LD A,(IX+4) A=*IX+4.
52807 CALL 52958 Call 52958.
52810 LD (41013),A Write A to *41013.
52813 JR ShowRoomDescription Jump to ShowRoomDescription.
ScriptInterpreter_19 52815 LD A,255 Write 255 to;
52817 LD (41012),A
52820 LD (41013),A
Set the room description marker.
ShowRoomDescription 52823 LD A,255 Write 255 to *41011.
52825 LD (41011),A
52828 LD L,(IX+1) Fetch the room address from *IX+1/ *IX+2 and store it in HL.
52831 LD H,(IX+2)
52834 CALL 50577 Call 50577.
52837 RET C Return if the room description can't be displayed.
52838 JR Z,ScriptInterpreter_25 Jump to ScriptInterpreter_25 if A is equal to 255.
52840 JR ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_20 52842 LD A,(IX+1) A=*IX+1.
52845 CALL 52958 Call 52958.
52848 LD (41011),A Write A to *41011.
52851 LD A,255 Write 255 to;
52853 LD (41012),A
52856 LD (41013),A
52859 CALL 50385 Call 50385.
52862 RET C Return if A is less than 255.
52863 JR Z,ScriptInterpreter_25 Jump to ScriptInterpreter_25 if A is equal to 255.
52865 JR ScriptInterpreter_22 Jump to ScriptInterpreter_22.
ScriptInterpreter_21 52867 LD IY,(40923) IY=*40923.
52871 LD HL,(40921) HL=*40921.
52874 PUSH HL IX=HL (using the stack).
52875 POP IX
52877 LD A,(HL) A=*HL.
52878 RET Return.
ScriptInterpreter_22 52879 CALL ScriptInterpreter_21 Call ScriptInterpreter_21.
52882 CALL 52995 Call 52995.
52885 BIT 7,(IX+0) Jump to ScriptInterpreter_23 if bit 7 of *IX+0 is not set.
52889 JR Z,ScriptInterpreter_23
52891 LD E,(HL) E=*HL.
52892 INC HL Increment HL by one.
52893 LD D,(HL) D=*HL.
52894 EX DE,HL Exchange the DE and HL registers.
52895 JR ScriptInterpreter_24 Jump to ScriptInterpreter_24.
ScriptInterpreter_23 52897 BIT 4,(IX+0) Call 53056 if bit 4 of *IX+0 is set.
52901 CALL NZ,53056
ScriptInterpreter_24 52904 BIT 5,(IX+0) Call 53059 if bit 5 of *IX+0 is set.
52908 CALL NZ,53059
52911 LD (IY+1),L Write L to *IY+1.
52914 LD (IY+2),H Write H to *IY+2.
52917 JP ScriptInterpreter_13 Jump to ScriptInterpreter_13.
ScriptInterpreter_25 52920 LD HL,52235 Increment *52235 by one.
52923 INC (HL)
52924 CALL ScriptInterpreter_21 Call ScriptInterpreter_21.
52927 CALL 52990 Call 52990.
52930 BIT 4,(IX+0) Jump to ScriptInterpreter_26 if bit 4 of *IX+0 is not set.
52934 JR Z,ScriptInterpreter_26
52936 LD E,(HL) E=*HL.
52937 INC HL Increment HL by one.
52938 LD D,(HL) D=*HL.
52939 EX DE,HL Exchange the DE and HL registers.
ScriptInterpreter_26 52940 LD (IY+1),L Write L to *IY+1.
52943 LD (IY+2),H Write H to *IY+2.
52946 PUSH IX DE=IX (using the stack).
52948 POP DE
52949 AND A HL-=DE (with carry).
52950 SBC HL,DE
52952 JP Z,ScriptInterpreter_12 Jump to ScriptInterpreter_12 if HL is equal to A.
52955 JP ScriptInterpreter_0 Jump to ScriptInterpreter_0.
Prev: 52279 Up: Map Next: 52958