Prev: CE21 Up: Map Next: D019
CEB8: 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 CEB8 LD DE,$D192 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
CEBB LD L,(IX+$00)
CEBE LD H,(IX+$01)
CEC1 LD (HL),E
CEC2 INC HL
CEC3 LD (HL),D
CEC4 LD HL,$D076 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 D076.
CEC7 LD E,(IX+$02)
CECA LD D,(IX+$03)
CECD LD BC,$0007
CED0 LDIR
CED2 LD A,$01 Writes $01 to D18F and return.
CED4 LD ($D18F),A
CED7 RET
Writes a "bandit closing the door" to the door flags/ cache.
Init_Bandit_Close CED8 LD DE,$D1B7 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
CEDB LD L,(IX+$00)
CEDE LD H,(IX+$01)
CEE1 LD (HL),E
CEE2 INC HL
CEE3 LD (HL),D
CEE4 LD HL,$D07D 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 D07D.
CEE7 LD E,(IX+$02)
CEEA LD D,(IX+$03)
CEED LD BC,$0007
CEF0 LDIR
CEF2 LD A,$01 Writes $01 to D18F.
CEF4 LD ($D18F),A
CEF7 LD (IX+$07),$01
CEFB RET
Writes "Bowie" to the door flags/ cache.
Init_Bowie CEFC LD DE,$D1DC 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
CEFF LD L,(IX+$00)
CF02 LD H,(IX+$01)
CF05 LD (HL),E
CF06 INC HL
CF07 LD (HL),D
CF08 CALL Random_Number
CF0B AND $08
CF0D LD HL,$D084
CF10 LD (HL),$00
CF12 JR Z,Init_Bowie_Set_Flag
CF14 LD (HL),$01
Init_Bowie_Set_Flag CF16 LD E,(IX+$02)
CF19 LD D,(IX+$03)
CF1C LD BC,$0009
CF1F LDIR
CF21 LD DE,$D863
CF24 LD (IX+$04),E
CF27 LD (IX+$05),D
CF2A RET
Writes a "customer opening the door" to the door flags/ cache.
Init_Customer_Open CF2B LD L,(IX+$00) 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
CF2E LD H,(IX+$01)
CF31 LD DE,$D201
CF34 LD (HL),E
CF35 INC HL
CF36 LD (HL),D
CF37 CALL Random_Number
CF3A AND $82
CF3C LD HL,$D0A1
CF3F LD (HL),$00
CF41 JR NZ,Init_Customer_Open_Set_Flag
CF43 LD (HL),$01
Init_Customer_Open_Set_Flag CF45 LD HL,$D09C
CF48 LD E,(IX+$02)
CF4B LD D,(IX+$03)
CF4E LD BC,$000F
CF51 LD A,($D18F)
CF54 AND A
CF55 LD A,$00
CF57 LD ($D18F),A
CF5A RET NZ
CF5B LDIR
CF5D RET
Writes a "customer closing the door" to the door flags/ cache.
Init_Customer_Close CF5E LD L,(IX+$00) 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
CF61 LD H,(IX+$01)
CF64 LD DE,$D201
CF67 LD (HL),E
CF68 INC HL
CF69 LD (HL),D
CF6A CALL Random_Number
CF6D AND $41
CF6F LD HL,$D092
CF72 LD (HL),$00
CF74 JR NZ,Init_Customer_Close_Set_Flag
CF76 LD (HL),$01
Init_Customer_Close_Set_Flag CF78 LD HL,$D08D
CF7B LD E,(IX+$02)
CF7E LD D,(IX+$03)
CF81 LD BC,$000F
CF84 LD A,($D18F)
CF87 AND A
CF88 LD A,$00
CF8A LD ($D18F),A
CF8D RET NZ
CF8E LDIR
CF90 RET
Writes a "customer being shot" to the door flags/ cache.
Init_Customer_Shot CF91 LD DE,$D226 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
CF94 LD L,(IX+$00)
CF97 LD H,(IX+$01)
CF9A LD (HL),E
CF9B INC HL
CF9C LD (HL),D
CF9D LD E,(IX+$02) Loads e.g. Door_Source_01 (depending on which door is currently being actioned) into DE.
CFA0 LD D,(IX+$03)
CFA3 LD HL,$D0AB HL=D0AB.
CFA6 INC DE Increase DE by $06.
CFA7 INC DE
CFA8 INC DE
CFA9 INC DE
CFAA INC DE
CFAB INC DE
CFAC LD BC,$0003 Copies three sequential bytes of data from HL to DE.
CFAF LDIR
CFB1 LD HL,$D18F Writes $01 to D18F and return.
CFB4 LD (HL),$01
CFB6 RET
Writes "Julius opening the door" to the door flags/ cache.
Init_Julius_Open CFB7 LD DE,$D241 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
CFBA LD L,(IX+$00)
CFBD LD H,(IX+$01)
CFC0 LD (HL),E
CFC1 INC HL
CFC2 LD (HL),D
CFC3 LD HL,$D0AE
CFC6 LD (HL),$00
CFC8 CALL Random_Number
CFCB AND $20
CFCD JR NZ,Init_Julius_Open_Set_Flag
CFCF LD (HL),$01
Init_Julius_Open_Set_Flag CFD1 LD E,(IX+$02)
CFD4 LD D,(IX+$03)
CFD7 LD BC,$000A
CFDA LDIR
CFDC RET
Writes "Julius closing the door" to the door flags/ cache.
Init_Julius_Close CFDD LD A,$01 Writes $01 to D0B8.
CFDF LD ($D0B8),A
CFE2 LD DE,$D265 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
CFE5 LD L,(IX+$00)
CFE8 LD H,(IX+$01)
CFEB LD (HL),E
CFEC INC HL
CFED LD (HL),D
CFEE LD HL,$D0B8 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 D0B8.
CFF1 LD E,(IX+$02)
CFF4 LD D,(IX+$03)
CFF7 INC DE
CFF8 LD BC,$0009
CFFB LDIR
CFFD LD A,$01 A=01.
CFFF LD ($D18F),A
D002 LD HL,$D0B8 HL=D0B8.
D005 LD A,(HL)
D006 LD (IX+$07),$02
D00A LD (IX+$06),$05
D00E AND A
D00F RET Z
D010 XOR A
D011 LD (IX+$07),A
D014 LD (IX+$06),A
D017 LD (HL),A
D018 RET Return.
Prev: CE21 Up: Map Next: D019