Routines |
Prev: E820 | Up: Map | Next: E9D9 |
Used by the routine at InitialiseGame.
|
||||
Only action lifts every other frame.
|
||||
Handler_Lifts | E821 | LD A,($F334) | A=*LiftsPiratesFrameSkip. | |
E824 | INC A | Increment A by one. | ||
E825 | AND %00000001 | Ensure A is either 00 or 01. | ||
E827 | LD ($F334),A | Write A back to *LiftsPiratesFrameSkip. | ||
E82A | CP $01 | Return if A is not equal to 01. | ||
E82C | RET NZ | |||
Set the UDG graphics pointer.
|
||||
E82D | LD HL,$F17B | Write F17B (Graphics_Lifts) to *CHARS. | ||
E830 | LD ($5C36),HL | |||
Find active lifts.
|
||||
E833 | LD IX,($5BE4) | IX=*ReferenceLifts. | ||
Are we done?
|
||||
Handler_Lifts_Loop | E837 | LD A,(IX+$00) | Return if the terminator character has been received instead of a co-ordinate (FF). | |
E83A | CP $FF | |||
E83C | RET Z | |||
E83D | LD A,(IX+$04) | Jump to Handler_Lifts_11 if *IX+04 is equal to 00. | ||
E840 | CP $00 | |||
E842 | JP Z,Handler_Lifts_11 | |||
E845 | LD A,($F240) | Jump to Handler_Lifts_Next if *F240 is not equal to 03. | ||
E848 | CP $03 | |||
E84A | JR NZ,Handler_Lifts_Next | |||
E84C | LD E,(IX+$07) | E=*IX+07. | ||
E84F | LD C,(IX+$00) | C=*IX+00. | ||
E852 | LD B,(IX+$01) | B=*IX+01. | ||
E855 | LD A,($F23F) | A=*F23F. | ||
E858 | SUB $03 | A-=03. | ||
E85A | CP B | Jump to Handler_Lifts_Next if A is not equal to B. | ||
E85B | JR NZ,Handler_Lifts_Next | |||
E85D | LD C,(IX+$00) | C=*IX+00. | ||
E860 | LD B,(IX+$01) | B=*IX+01. | ||
E863 | PUSH BC | Stash BC on the stack. | ||
E864 | CALL $0DD9 | Call CL_SET. | ||
E867 | LD HL,($5C84) | HL=*DF_CC. | ||
E86A | POP BC | Restore BC from the stack. | ||
E86B | INC B | Increment B by one. | ||
E86C | PUSH HL | Stash HL on the stack. | ||
E86D | CALL $0DD9 | Call CL_SET. | ||
E870 | POP HL | Restore HL from the stack. | ||
E871 | LD DE,($5C84) | DE=*DF_CC. | ||
E875 | LD A,D | D+=07. | ||
E876 | ADD A,$07 | |||
E878 | LD D,A | |||
E879 | LD B,(IX+$07) | B=*IX+07. | ||
E87C | LD A,(IX+$02) | Jump to Handler_Lifts_0 if *IX+02 is higher than 02. | ||
E87F | CP $02 | |||
E881 | JR NC,Handler_Lifts_0 | |||
E883 | INC B | Increment B by one. | ||
Handler_Lifts_0 | E884 | LD A,(DE) | A=*DE. | |
E885 | AND (HL) | Merge the bits from *HL. | ||
E886 | JR NZ,Handler_Lifts_1 | Jump to Handler_Lifts_1 if the result is not zero. | ||
E888 | INC HL | Increment HL by one. | ||
E889 | INC DE | Increment DE by one. | ||
E88A | DJNZ Handler_Lifts_0 | Decrease counter by one and loop back to Handler_Lifts_0 until counter is zero. | ||
E88C | JR Handler_Lifts_Next | Jump to Handler_Lifts_Next. | ||
Handler_Lifts_1 | E88E | LD A,$02 | Write 02 to *E820. | |
E890 | LD ($E820),A | |||
E893 | LD A,(IX+$04) | Jump to Handler_Lifts_2 if *IX+04 is equal to 00. | ||
E896 | CP $00 | |||
E898 | JR Z,Handler_Lifts_2 | |||
E89A | CP $FF | Compare A with FF. | ||
E89C | PUSH AF | Stash AF on the stack. | ||
E89D | CALL Z,Handler_Lifts_8 | Call Handler_Lifts_8 zero. | ||
E8A0 | POP AF | Restore AF from the stack. | ||
E8A1 | CALL NZ,Handler_Lifts_7 | Call Handler_Lifts_7 not zero. | ||
Handler_Lifts_2 | E8A4 | LD A,(IX+$05) | Jump to Handler_Lifts_Next if *IX+05 is equal to 00. | |
E8A7 | CP $00 | |||
E8A9 | JR Z,Handler_Lifts_Next | |||
E8AB | CP $FF | Compare A with FF. | ||
E8AD | PUSH AF | Stash AF on the stack. | ||
E8AE | CALL Z,Handler_Lifts_10 | Call Handler_Lifts_10 if A was equal to FF on line E8AB. | ||
E8B1 | POP AF | Restore AF from the stack. | ||
E8B2 | CALL NZ,Handler_Lifts_9 | Call Handler_Lifts_9 if A was not equal to FF on line E8AB. | ||
Handler_Lifts_Next | E8B5 | CALL $EEA6 | Call EEA6. | |
E8B8 | LD A,(IX+$04) | Compare *IX+04 with 00. | ||
E8BB | CP $00 | |||
E8BD | PUSH AF | Stash AF on the stack. | ||
E8BE | CALL Z,Handler_Lifts_5 | Call Handler_Lifts_5 if *IX+04 was equal to 00 on line E8BB. | ||
E8C1 | POP AF | Restore AF from the stack. | ||
E8C2 | CALL NZ,Handler_Lifts_3 | Call Handler_Lifts_3 if *IX+04 was not equal to 00 on line E8BB. | ||
E8C5 | LD (IX+$00),C | Write C to *IX+00. | ||
E8C8 | LD (IX+$01),B | Write B to *IX+01. | ||
E8CB | LD (IX+$02),E | Write E to *IX+02. | ||
E8CE | LD (IX+$03),D | Write D to *IX+03. | ||
E8D1 | CALL $EED7 | Call EED7. | ||
E8D4 | LD DE,$0010 | IX+=0010. | ||
E8D7 | ADD IX,DE | |||
E8D9 | JP Handler_Lifts_Loop | Jump to Handler_Lifts_Loop. | ||
Handler_Lifts_3 | E8DC | LD A,(IX+$04) | Jump to Handler_Lifts_4 if *IX+04 is equal to FF. | |
E8DF | CP $FF | |||
E8E1 | JR Z,Handler_Lifts_4 | |||
E8E3 | LD A,(IX+$0A) | Return if *IX+0A is not equal to C. | ||
E8E6 | CP C | |||
E8E7 | RET NZ | |||
E8E8 | LD A,(IX+$0B) | Return if *IX+0B is not equal to E. | ||
E8EB | CP E | |||
E8EC | RET NZ | |||
E8ED | LD (IX+$04),$FF | Write FF to *IX+04. | ||
E8F1 | RET | Return. | ||
Handler_Lifts_4 | E8F2 | LD A,(IX+$0C) | Return if *IX+0C is not equal to C. | |
E8F5 | CP C | |||
E8F6 | RET NZ | |||
E8F7 | LD A,(IX+$0D) | Return if *IX+0D is not equal to E. | ||
E8FA | CP E | |||
E8FB | RET NZ | |||
E8FC | LD (IX+$04),$01 | Write 01 to *IX+04. | ||
E900 | RET | Return. | ||
Handler_Lifts_5 | E901 | LD A,(IX+$05) | Jump to Handler_Lifts_6 if *IX+05 is equal to FF. | |
E904 | CP $FF | |||
E906 | JR Z,Handler_Lifts_6 | |||
E908 | LD A,(IX+$0A) | Return if *IX+0A is not equal to B. | ||
E90B | CP B | |||
E90C | RET NZ | |||
E90D | LD A,(IX+$0B) | Return if *IX+0B is not equal to D. | ||
E910 | CP D | |||
E911 | RET NZ | |||
E912 | LD (IX+$05),$FF | Write FF to *IX+05. | ||
E916 | RET | Return. | ||
Handler_Lifts_6 | E917 | LD A,(IX+$0C) | Return if *IX+0C is not equal to B. | |
E91A | CP B | |||
E91B | RET NZ | |||
E91C | LD A,(IX+$0D) | Return if *IX+0D is not equal to D. | ||
E91F | CP D | |||
E920 | RET NZ | |||
E921 | LD (IX+$05),$01 | Write 01 to *IX+05. | ||
E925 | RET | Return. | ||
Handler_Lifts_7 | E926 | LD A,($F235) | Increment *F235 by one. | |
E929 | INC A | |||
E92A | LD ($F235),A | |||
E92D | RET | Return. | ||
Handler_Lifts_8 | E92E | LD A,($F235) | Decrease *F235 by one. | |
E931 | DEC A | |||
E932 | LD ($F235),A | |||
E935 | RET | Return. | ||
Handler_Lifts_9 | E936 | LD A,($F236) | Increment *F236 by one. | |
E939 | INC A | |||
E93A | LD ($F236),A | |||
E93D | RET | Return. | ||
Handler_Lifts_10 | E93E | LD A,($F236) | Decrease *F236 by one. | |
E941 | DEC A | |||
E942 | LD ($F236),A | |||
E945 | RET | Return. | ||
Handler_Lifts_11 | E946 | LD A,($F240) | A=*F240. | |
E949 | INC A | Increment A by one. | ||
E94A | AND %00000011 | Keep only bits 0-1. | ||
E94C | CP (IX+$03) | Jump to Handler_Lifts_Next if A is not equal to *IX+03. | ||
E94F | JP NZ,Handler_Lifts_Next | |||
E952 | LD C,(IX+$00) | C=*IX+00. | ||
E955 | LD B,(IX+$01) | B=*IX+01. | ||
E958 | LD A,(IX+$03) | A=*IX+03. | ||
E95B | CP $00 | Compare A with 00. | ||
E95D | LD A,($F23F) | A=*F23F. | ||
E960 | JR Z,Handler_Lifts_12 | Jump to Handler_Lifts_12 if A was equal to 00 on line E95B. | ||
E962 | DEC A | Decrease A by one. | ||
Handler_Lifts_12 | E963 | SUB $02 | A-=02. | |
E965 | CP B | Jump to Handler_Lifts_Next if A is not equal to B. | ||
E966 | JP NZ,Handler_Lifts_Next | |||
E969 | LD A,(IX+$03) | A=*IX+03. | ||
E96C | LD C,(IX+$00) | C=*IX+00. | ||
E96F | LD B,(IX+$01) | B=*IX+01. | ||
E972 | PUSH AF | Stash AF on the stack. | ||
E973 | CP $03 | Call Handler_Lifts_16 if A is equal to 03. | ||
E975 | CALL Z,Handler_Lifts_16 | |||
E978 | POP AF | Restore AF from the stack. | ||
E979 | PUSH AF | Stash AF on the stack. | ||
E97A | CP $02 | Call Handler_Lifts_15 if A is equal to 02. | ||
E97C | CALL Z,Handler_Lifts_15 | |||
E97F | POP AF | Restore AF from the stack. | ||
E980 | PUSH AF | Stash AF on the stack. | ||
E981 | CP $01 | Call Handler_Lifts_14 if A is equal to 01. | ||
E983 | CALL Z,Handler_Lifts_14 | |||
E986 | POP AF | Restore AF from the stack. | ||
E987 | CP $00 | Call Handler_Lifts_17 if A is equal to 00. | ||
E989 | CALL Z,Handler_Lifts_17 | |||
E98C | LD B,(IX+$07) | B=*IX+07. | ||
Handler_Lifts_13 | E98F | LD A,(DE) | A=*DE. | |
E990 | AND (HL) | Merge the bits from *HL. | ||
E991 | JP NZ,Handler_Lifts_1 | Jump to Handler_Lifts_1 if the result is not zero. | ||
E994 | INC HL | Increment HL by one. | ||
E995 | INC DE | Increment DE by one. | ||
E996 | DJNZ Handler_Lifts_13 | Decrease counter by one and loop back to Handler_Lifts_13 until counter is zero. | ||
E998 | JP Handler_Lifts_Next | Jump to Handler_Lifts_Next. | ||
Handler_Lifts_14 | E99B | CALL $0DD9 | Call CL_SET. | |
E99E | LD HL,($5C84) | HL=*DF_CC. | ||
E9A1 | INC H | Increment H by five. | ||
E9A2 | INC H | |||
E9A3 | INC H | |||
E9A4 | INC H | |||
E9A5 | INC H | |||
E9A6 | PUSH HL | DE=HL (using the stack). | ||
E9A7 | POP DE | |||
E9A8 | INC H | Increment H by one. | ||
E9A9 | RET | Return. | ||
Handler_Lifts_15 | E9AA | CALL $0DD9 | Call CL_SET. | |
E9AD | LD HL,($5C84) | HL=*DF_CC. | ||
E9B0 | INC H | Increment H by three. | ||
E9B1 | INC H | |||
E9B2 | INC H | |||
E9B3 | PUSH HL | DE=HL (using the stack). | ||
E9B4 | POP DE | |||
E9B5 | INC H | Increment H by one. | ||
E9B6 | RET | Return. | ||
Handler_Lifts_16 | E9B7 | CALL $0DD9 | Call CL_SET. | |
E9BA | LD HL,($5C84) | HL=*DF_CC. | ||
E9BD | INC H | Increment H by one. | ||
E9BE | PUSH HL | DE=HL (using the stack). | ||
E9BF | POP DE | |||
E9C0 | INC H | Increment H by one. | ||
E9C1 | RET | Return. | ||
Handler_Lifts_17 | E9C2 | PUSH BC | Stash BC on the stack. | |
E9C3 | CALL $0DD9 | Call CL_SET. | ||
E9C6 | POP BC | Restore BC from the stack. | ||
E9C7 | LD DE,($5C84) | DE=*DF_CC. | ||
E9CB | LD A,D | D+=07. | ||
E9CC | ADD A,$07 | |||
E9CE | LD D,A | |||
E9CF | PUSH DE | Stash DE on the stack. | ||
E9D0 | DEC B | Decrease B by one. | ||
E9D1 | CALL $0DD9 | Call CL_SET. | ||
E9D4 | POP DE | Restore DE from the stack. | ||
E9D5 | LD HL,($5C84) | HL=*DF_CC. | ||
E9D8 | RET | Return. |
Prev: E820 | Up: Map | Next: E9D9 |