Prev: 52769 Up: Map Next: 53366
52920: Character Initialisations
Used by the routines at Character_Chooser and Customer_Frame_01.
Writes a "bandit opening the door" to the door flags/ cache.
Init_Bandit_Open 52920 LD DE,53650 Writes Prep_Bandit_Open to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
52923 LD L,(IX+0)
52926 LD H,(IX+1)
52929 LD (HL),E
52930 INC HL
52931 LD (HL),D
52932 LD HL,53366 Handles copying 0007 bytes of data from the address contained at (depending on which door is currently being actioned);
Address Door
Door_Source_01 Door 1
Door_Source_02 Door 2
Door_Source_03 Door 3
to 53366.
52935 LD E,(IX+2)
52938 LD D,(IX+3)
52941 LD BC,7
52944 LDIR
52946 LD A,1 Writes 1 to 53647 and return.
52948 LD (53647),A
52951 RET
Writes a "bandit closing the door" to the door flags/ cache.
Init_Bandit_Close 52952 LD DE,53687 Writes Prep_Bandit_Close to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
52955 LD L,(IX+0)
52958 LD H,(IX+1)
52961 LD (HL),E
52962 INC HL
52963 LD (HL),D
52964 LD HL,53373 Handles copying 0007 bytes of data from the address contained at (depending on which door is currently being actioned);
Address Door
Door_Source_01 Door 1
Door_Source_02 Door 2
Door_Source_03 Door 3
to 53373.
52967 LD E,(IX+2)
52970 LD D,(IX+3)
52973 LD BC,7
52976 LDIR
52978 LD A,1 Writes 1 to 53647.
52980 LD (53647),A
52983 LD (IX+7),1
52987 RET
Writes "Bowie" to the door flags/ cache.
Init_Bowie 52988 LD DE,53724 Writes Prep_Bowie to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
52991 LD L,(IX+0)
52994 LD H,(IX+1)
52997 LD (HL),E
52998 INC HL
52999 LD (HL),D
53000 CALL Random_Number Generate a random number. If bit 3 is set, Bowie will have a bomb instead of money. Set the "money / bomb" flag for Bowie in 53380.
53003 AND 8
53005 LD HL,53380
53008 LD (HL),0
53010 JR Z,Init_Bowie_Set_Flag
53012 LD (HL),1
Init_Bowie_Set_Flag 53014 LD E,(IX+2) Copy to the values for this door.
53017 LD D,(IX+3)
53020 LD BC,9 3 values.
53023 LDIR Do the copy.
53025 LD DE,55395 Copy the routine at Bowie_Shot_Action (shot Bowie) to the door's "gun action" routine.
53028 LD (IX+4),E
53031 LD (IX+5),D
53034 RET
Writes "Green Jordan opening the door" to the door flags/ cache.
Init_Customer_Open 53035 LD L,(IX+0) Writes Prep_Customer to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
53038 LD H,(IX+1)
53041 LD DE,53761
53044 LD (HL),E
53045 INC HL
53046 LD (HL),D
53047 CALL Random_Number Generate a random number. If bits 2 and 7 are not set, then Jack Vicious will turn up. Set the "surprised" flag for Green Jordan in 53409.
53050 AND 130
53052 LD HL,53409
53055 LD (HL),0
53057 JR NZ,Init_Customer_Open_Set_Flag
53059 LD (HL),1
Init_Customer_Open_Set_Flag 53061 LD HL,53404 Character defaults for Green Jordan.
53064 LD E,(IX+2) Copy to the values for this door.
53067 LD D,(IX+3)
53070 LD BC,15 15 values.
53073 LD A,(53647) If the "don't copy values" flag is set, return early.
53076 AND A
53077 LD A,0
53079 LD (53647),A
53082 RET NZ
53083 LDIR Do the copy and return.
53085 RET
Writes "Daisy opening the door" to the door flags/ cache.
Init_Customer_Close 53086 LD L,(IX+0) Writes Prep_Customer to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
53089 LD H,(IX+1)
53092 LD DE,53761
53095 LD (HL),E
53096 INC HL
53097 LD (HL),D
53098 CALL Random_Number Generate a random number. If bits 1 and 6 are not set, then Jack Vicious will turn up. Set the "surprised" flag for Daisy in 53394.
53101 AND 65
53103 LD HL,53394
53106 LD (HL),0
53108 JR NZ,Init_Customer_Close_Set_Flag
53110 LD (HL),1
Init_Customer_Close_Set_Flag 53112 LD HL,53389 Character defaults for Daisy.
53115 LD E,(IX+2) Copy to the values for this door.
53118 LD D,(IX+3)
53121 LD BC,15 15 values.
53124 LD A,(53647) If the "don't copy values" flag is set, return early.
53127 AND A
53128 LD A,0
53130 LD (53647),A
53133 RET NZ
53134 LDIR Do the copy and return.
53136 RET
Writes a "customer being shot" to the door flags/ cache.
Init_Customer_Shot 53137 LD DE,53798 Writes Prep_Customer_Shot to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
53140 LD L,(IX+0)
53143 LD H,(IX+1)
53146 LD (HL),E
53147 INC HL
53148 LD (HL),D
53149 LD E,(IX+2) Loads e.g. Door_Source_01 (depending on which door is currently being actioned) into DE.
53152 LD D,(IX+3)
53155 LD HL,53419 HL=53419.
53158 INC DE Increase DE by 6.
53159 INC DE
53160 INC DE
53161 INC DE
53162 INC DE
53163 INC DE
53164 LD BC,3 Copies three sequential bytes of data from HL to DE.
53167 LDIR
53169 LD HL,53647 Writes 1 to 53647 and return.
53172 LD (HL),1
53174 RET
Writes "Julius opening the door" to the door flags/ cache.
Init_Julius_Open 53175 LD DE,53825 Writes Prep_Julius_Open to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
53178 LD L,(IX+0)
53181 LD H,(IX+1)
53184 LD (HL),E
53185 INC HL
53186 LD (HL),D
53187 LD HL,53422 Defaults for Julius.
53190 LD (HL),0 Generate a random number. If bit 5 is set, Julius will be "bad" and draw a gun.
53192 CALL Random_Number
53195 AND 32
53197 JR NZ,Init_Julius_Open_Set_Flag
53199 LD (HL),1
Init_Julius_Open_Set_Flag 53201 LD E,(IX+2) Copy to the values for this door.
53204 LD D,(IX+3)
53207 LD BC,10 10 values.
53210 LDIR Do the copy.
53212 RET
Writes "Julius closing the door" to the door flags/ cache.
Init_Julius_Close 53213 LD A,1 Writes 1 to 53432.
53215 LD (53432),A
53218 LD DE,53861 Writes Prep_Julius_Close to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
53221 LD L,(IX+0)
53224 LD H,(IX+1)
53227 LD (HL),E
53228 INC HL
53229 LD (HL),D
53230 LD HL,53432 Handles copying 0009 bytes of data from the address (plus 1) contained at (depending on which door is currently being actioned);
Address Door
Door_Source_01 Door 1
Door_Source_02 Door 2
Door_Source_03 Door 3
to 53432.
53233 LD E,(IX+2)
53236 LD D,(IX+3)
53239 INC DE
53240 LD BC,9
53243 LDIR
53245 LD A,1 A=1.
53247 LD (53647),A
53250 LD HL,53432 HL=53432.
53253 LD A,(HL)
53254 LD (IX+7),2
53258 LD (IX+6),5
53262 AND A
53263 RET Z
53264 XOR A
53265 LD (IX+7),A
53268 LD (IX+6),A
53271 LD (HL),A
53272 RET Return.
Writes a "drawing bandit opening the door" to the door flags/ cache. This entry point is used by the routine at 51943.
Init_Bandit_Draw_Open 53273 LD DE,53897 Writes Prep_Bandit_Draw_Open to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
53276 LD L,(IX+0)
53279 LD H,(IX+1)
53282 LD (HL),E
53283 INC HL
53284 LD (HL),D
53285 LD L,(IX+12) Copies 0011 bytes of data from (depending on which door is currently being actioned);
Source Destination Door
Door_Char_Source_01 Door_Source_01 Door 1
Door_Char_Source_02 Door_Source_02 Door 2
Door_Char_Source_03 Door_Source_03 Door 3
53288 LD H,(IX+13)
53291 LD E,(IX+2)
53294 LD D,(IX+3)
53297 LD BC,11
53300 LDIR
53302 RET Return.
Writes "Bandit closing the door" to the door flags/ cache;
Todo_Door_Reset 53303 LD A,1 Writes 1 to the address contained at (depending on which door is currently being actioned);
Address Door
Door_Char_Buffer_01 Door 1
Door_Char_Buffer_02 Door 2
Door_Char_Buffer_03 Door 3
This is the first byte of character state data.
53305 LD L,(IX+10)
53308 LD H,(IX+11)
53311 LD (HL),A
53312 LD DE,53933 Writes Prep_Bandit_Draw_Close to the address contained at (depending on which door is currently being actioned);
Address Door Target
Door_Flags_01 Door 1 Door_Routine_01
Door_Flags_02 Door 2 Door_Routine_02
Door_Flags_03 Door 3 Door_Routine_03
This is copying the actual source data into the cache where it can be manipulated by the game events.
53315 LD L,(IX+0)
53318 LD H,(IX+1)
53321 LD (HL),E
53322 INC HL
53323 LD (HL),D
53324 LD L,(IX+10) Copies 0011 bytes of data from (depending on which door is currently being actioned);
Source Destination Door
Door_Char_Buffer_01 Door_Source_01 Door 1
Door_Char_Buffer_02 Door_Source_02 Door 2
Door_Char_Buffer_03 Door_Source_03 Door 3
53327 LD H,(IX+11)
53330 LD E,(IX+2)
53333 LD D,(IX+3)
53336 LD BC,11
53339 LDIR
53341 LD A,1 Initialise 53647 (writes 1 to it).
53343 LD (53647),A
53346 LD L,(IX+10) Loads A with the flag from the address contained at (depending on which door is currently being actioned);
Address Door
Door_Char_Buffer_01 Door 1
Door_Char_Buffer_02 Door 2
Door_Char_Buffer_03 Door 3
As per Todo_Door_Reset, this should be 1.
53349 LD H,(IX+11)
53352 LD A,(HL)
53353 LD (IX+7),2
53357 AND A
53358 RET Z
53359 LD (IX+7),0
53363 LD (HL),0
53365 RET Return.
Prev: 52769 Up: Map Next: 53366