TirNaNog | Routines |
Prev: 8A8D | Up: Map | Next: 8CFE |
Used by the routine at 891F.
|
||||
Exit_NewRoom | 8A93 | DEFB $CD,$8B,$DF | Clear action links. | |
8A96 | DEFB $DD,$2A,$DE,$89 | Get exit data man has walked through. | ||
8A9A | DEFB $DD,$7E,$04,$E6,$0F,$A7,$20,$7D | Holds room type. >0 means a cave within an area. | ||
New Area.
|
||||
8AA2 | DEFB $DD,$6E,$08,$26,$00,$29,$22,$C3 | Get new position for man to appear at. | ||
8AAA | DEFB $DF,$DD,$6E,$09,$26,$00,$29,$22 | |||
8AB2 | DEFB $C5,$DF | |||
8AB4 | DEFB $DD,$7E,$07 | Get index of new area. | ||
8AB7 | DEFB $2A,$DD,$DF,$E5 | Get and store old area index. | ||
8ABB | DEFB $CD,$3C,$5E,$CD,$3F,$5E | Update everything for new area. | ||
8AC1 | DEFB $C1 | Get previous area index for comparison. | ||
8AC2 | DEFB $DD,$7E,$07,$FE,$11,$20,$39 | Is new area Glasmarsh? | ||
8AC9 | DEFB $79,$FE,$32,$28,$34,$FE,$33,$28 | Yes, so see which cave type we have come from. | ||
8AD1 | DEFB $30,$FE,$11,$28,$2C,$2A,$E1,$DF | |||
8AD9 | DEFB $11,$04,$00,$19,$5E,$16,$00,$23 | |||
8AE1 | DEFB $19,$23,$11,$05,$00,$19,$DD,$7E | |||
8AE9 | DEFB $05,$77,$23,$23,$71,$23,$EB,$2A | |||
8AF1 | DEFB $DE,$89,$01,$02,$00,$ED,$B0,$DD | |||
8AF9 | DEFB $7E,$03,$1F,$1F,$1F,$1F,$E6,$0F | |||
8B01 | DEFB $12 | |||
Enter room as normal.
|
||||
8B02 | LD A,(IX+$0A) | |||
8B05 | DEC A | |||
8B06 | AND $03 | |||
8B08 | LD (CamDirection_DFD2),A | |||
8B0B | LD A,(ManWalkDirection_DFD4) | |||
8B0E | CP $02 | |||
8B10 | JP Z,Vector_ScreenUpdate | |||
8B13 | LD A,(IX+$0A) | |||
8B16 | INC A | |||
8B17 | AND $03 | |||
8B19 | LD (CamDirection_DFD2),A | |||
8B1C | JP Vector_ScreenUpdate | |||
Entered cave / passageway.
|
||||
8B1F | CP $01 | |||
8B21 | JP NZ,Exit_NewRoom_6 | |||
8B24 | LD A,(IX+$0A) | |||
8B27 | AND A | |||
8B28 | JR Z,Exit_NewRoom_0 | |||
8B2A | DEC A | |||
8B2B | ADD A,A | |||
8B2C | LD L,A | |||
8B2D | LD H,$00 | |||
8B2F | LD DE,CaveActionPtrs | |||
8B32 | ADD HL,DE | |||
8B33 | PUSH HL | |||
8B34 | CALL Vector_ActionsNewLink | |||
8B37 | POP HL | |||
8B38 | LD A,(HL) | |||
8B39 | LD (IX+$03),A | |||
8B3C | INC HL | |||
8B3D | LD A,(HL) | |||
8B3E | LD (IX+$04),A | |||
8B41 | LD (IX+$0B),$BF | |||
8B45 | LD HL,$0064 | |||
8B48 | LD (IX+$05),L | |||
8B4B | LD (IX+$06),H | |||
8B4E | LD HL,$00A7 | |||
8B51 | LD (IX+$07),L | |||
8B54 | LD (IX+$08),H | |||
Exit_NewRoom_0 | 8B57 | LD IX,(Routine_Data2) | ||
8B5B | LD A,(IX+$05) | |||
8B5E | LD ($896D),A | |||
8B61 | LD A,(AreaDataCurrent_Index) | |||
8B64 | LD ($896F),A | |||
8B67 | LD A,$32 | |||
8B69 | LD (AreaDataCurrent_Index),A | |||
8B6C | LD A,(IX+$02) | |||
8B6F | CP $4A | |||
8B71 | JR Z,Exit_NewRoom_1 | |||
8B73 | LD A,$40 | |||
Exit_NewRoom_1 | 8B75 | LD ($896A),A | ||
8B78 | LD A,(IX+$00) | |||
8B7B | LD ($8970),A | |||
8B7E | LD A,(IX+$01) | |||
8B81 | LD ($8971),A | |||
8B84 | LD A,(IX+$03) | |||
8B87 | RRA | |||
8B88 | RRA | |||
8B89 | RRA | |||
8B8A | RRA | |||
8B8B | AND $03 | |||
8B8D | LD ($8972),A | |||
8B90 | LD L,(IX+$09) | |||
8B93 | ADD HL,HL | |||
8B94 | LD H,$00 | |||
8B96 | LD DE,($DFFF) | |||
8B9A | LD A,(IX+$06) | |||
8B9D | AND A | |||
8B9E | JR NZ,Exit_NewRoom_2 | |||
8BA0 | LD DE,(AreaDataCurrent_ObjectsPtr) | |||
Exit_NewRoom_2 | 8BA4 | ADD HL,DE | ||
8BA5 | LD ($8945),HL | |||
8BA8 | LD HL,$893D | |||
8BAB | LD DE,AreaDataCurrent_SceneryPrimary | |||
8BAE | LD BC,$0010 | |||
8BB1 | LDIR | |||
8BB3 | LD HL,Zeros | |||
8BB6 | LD BC,$000A | |||
8BB9 | LDIR | |||
8BBB | LD A,(IX+$07) | |||
8BBE | LD (BgColour),A | |||
8BC1 | LD A,(IX+$08) | |||
8BC4 | LD ($DFEE),A | |||
8BC7 | LD A,(IX+$0A) | |||
8BCA | CP $02 | |||
8BCC | JR C,Exit_NewRoom_3 | |||
8BCE | LD A,$02 | |||
8BD0 | LD (BgType),A | |||
Exit_NewRoom_3 | 8BD3 | LD HL,$0060 | ||
8BD6 | LD D,$00 | |||
8BD8 | LD E,$02 | |||
Exit_NewRoom_4 | 8BDA | LD (ManData_PosSecondary_dfc5),HL | ||
8BDD | LD HL,$0064 | |||
8BE0 | LD (ManData_PosPrimary_dfc3),HL | |||
8BE3 | LD L,E | |||
8BE4 | LD A,(Routine_DataDirection) | |||
8BE7 | CP $02 | |||
8BE9 | JR Z,Exit_NewRoom_5 | |||
8BEB | LD L,D | |||
Exit_NewRoom_5 | 8BEC | LD A,L | ||
8BED | LD (CamDirection_DFD2),A | |||
8BF0 | LD A,(Routine_DataCompass) | |||
8BF3 | SUB L | |||
8BF4 | AND $03 | |||
8BF6 | LD (AreaDataCurrent_CompassOffset),A | |||
8BF9 | JP Vector_ScreenUpdate | |||
Exit_NewRoom_6 | 8BFC | LD HL,$00C4 | ||
8BFF | CP $02 | |||
8C01 | JR Z,Exit_NewRoom_7 | |||
8C03 | LD HL,$008C | |||
8C06 | CP $03 | |||
8C08 | JR Z,Exit_NewRoom_7 | |||
8C0A | LD HL,$00DE | |||
8C0D | CP $04 | |||
8C0F | RET NZ | |||
Exit_NewRoom_7 | 8C10 | LD A,L | ||
8C11 | SRL A | |||
8C13 | LD ($89AB),A | |||
8C16 | ADD A,$02 | |||
8C18 | LD ($8995),A | |||
8C1B | ADD A,$03 | |||
8C1D | LD ($898C),A | |||
8C20 | LD A,(IX+$05) | |||
8C23 | LD ($8984),A | |||
8C26 | LD A,(AreaDataCurrent_Index) | |||
8C29 | LD (CaveDataSceneryString),A | |||
8C2C | LD A,(IX+$02) | |||
8C2F | CP $4A | |||
8C31 | JR Z,Exit_NewRoom_8 | |||
8C33 | LD A,$40 | |||
Exit_NewRoom_8 | 8C35 | LD ($8981),A | ||
8C38 | LD A,(IX+$00) | |||
8C3B | LD ($8987),A | |||
8C3E | LD A,(IX+$01) | |||
8C41 | LD ($8988),A | |||
8C44 | LD A,(IX+$03) | |||
8C47 | RRA | |||
8C48 | RRA | |||
8C49 | RRA | |||
8C4A | RRA | |||
8C4B | AND $03 | |||
8C4D | LD ($8989),A | |||
8C50 | LD L,(IX+$09) | |||
8C53 | ADD HL,HL | |||
8C54 | LD H,$00 | |||
8C56 | LD DE,($DFFF) | |||
8C5A | LD A,(IX+$06) | |||
8C5D | AND A | |||
8C5E | JR NZ,Exit_NewRoom_9 | |||
8C60 | LD DE,(AreaDataCurrent_ObjectsPtr) | |||
Exit_NewRoom_9 | 8C64 | ADD HL,DE | ||
8C65 | LD ($8955),HL | |||
8C68 | LD HL,CaveData | |||
8C6B | LD DE,AreaDataCurrent_SceneryPrimary | |||
8C6E | LD BC,$0010 | |||
8C71 | LDIR | |||
8C73 | LD HL,Zeros | |||
8C76 | LD BC,$000A | |||
8C79 | LDIR | |||
8C7B | LD A,(IX+$07) | |||
8C7E | LD (BgColour),A | |||
8C81 | LD A,(IX+$08) | |||
8C84 | LD ($DFEE),A | |||
8C87 | LD L,(IX+$0A) | |||
8C8A | LD H,(IX+$0B) | |||
8C8D | PUSH HL | |||
8C8E | POP IX | |||
8C90 | LD A,(IX+$05) | |||
8C93 | LD ($8999),A | |||
8C96 | LD A,(IX+$06) | |||
8C99 | AND A | |||
8C9A | JR NZ,Exit_NewRoom_10 | |||
8C9C | LD A,(AreaDataCurrent_Index) | |||
Exit_NewRoom_10 | 8C9F | LD ($899B),A | ||
8CA2 | LD A,$33 | |||
8CA4 | LD (AreaDataCurrent_Index),A | |||
8CA7 | LD A,(IX+$02) | |||
8CAA | CP $4A | |||
8CAC | JR Z,Exit_NewRoom_11 | |||
8CAE | LD A,$40 | |||
Exit_NewRoom_11 | 8CB0 | LD ($8996),A | ||
8CB3 | LD A,(IX+$00) | |||
8CB6 | LD ($899C),A | |||
8CB9 | LD A,(IX+$01) | |||
8CBC | LD ($899D),A | |||
8CBF | LD A,(IX+$03) | |||
8CC2 | RRA | |||
8CC3 | RRA | |||
8CC4 | RRA | |||
8CC5 | RRA | |||
8CC6 | AND $03 | |||
8CC8 | LD ($899E),A | |||
8CCB | LD HL,$0060 | |||
8CCE | LD D,$00 | |||
8CD0 | LD E,$02 | |||
8CD2 | BIT 7,(IX+$09) | |||
8CD6 | JP Z,Exit_NewRoom_4 | |||
8CD9 | LD HL,$8981 | |||
8CDC | LD DE,$8996 | |||
8CDF | LD A,(DE) | |||
8CE0 | LD C,(HL) | |||
8CE1 | LD (HL),A | |||
8CE2 | LD A,C | |||
8CE3 | LD (DE),A | |||
8CE4 | INC DE | |||
8CE5 | INC HL | |||
8CE6 | LD B,$08 | |||
Exit_NewRoom_12 | 8CE8 | INC HL | ||
8CE9 | INC DE | |||
8CEA | LD A,(DE) | |||
8CEB | LD C,(HL) | |||
8CEC | LD (HL),A | |||
8CED | LD A,C | |||
8CEE | LD (DE),A | |||
8CEF | DJNZ Exit_NewRoom_12 | |||
8CF1 | LD HL,($8995) | |||
8CF4 | LD H,$00 | |||
8CF6 | ADD HL,HL | |||
8CF7 | LD D,$02 | |||
8CF9 | LD E,$00 | |||
8CFB | JP Exit_NewRoom_4 |
Prev: 8A8D | Up: Map | Next: 8CFE |