Prev: 9C44 Up: Map Next: 9D73
9C46: Updates the whole inventory text.
Input
Output
Inv_Update 9C46 LD HL,$0000 Clear any extra object string.
9C49 LD (ObjectStringPtr),HL
9C4C LD A,$01 Print #1
9C4E CALL $1601
9C51 LD C,$01
9C53 LD HL,Inv_Pocket1
9C56 LD E,L
9C57 LD D,H
9C58 LD B,$03
Inv_Update_0 9C5A LD A,(DE)
9C5B AND A
9C5C JR Z,Inv_Update_1
9C5E LD (HL),A
9C5F INC HL
9C60 INC C
Inv_Update_1 9C61 INC DE
9C62 DJNZ Inv_Update_0
9C64 LD A,$04
9C66 SUB C
9C67 JR Z,Inv_Update_3
9C69 LD B,A
Inv_Update_2 9C6A LD (HL),$00
9C6C INC HL
9C6D DJNZ Inv_Update_2
Inv_Update_3 9C6F LD A,(HL)
9C70 CP C
9C71 JR C,Inv_Update_4
9C73 LD (HL),$00
Inv_Update_4 9C75 LD DE,$5A60
9C78 LD A,$05
Inv_Update_5 9C7A LD HL,TempStore
9C7D LD BC,$0013
9C80 LDIR
9C82 EX DE,HL
9C83 LD BC,$000D
9C86 ADD HL,BC
9C87 EX DE,HL
9C88 DEC A
9C89 JR NZ,Inv_Update_5
Display bank account.
9C8B CALL Print_StrFromStack
9C8E DEFB $10 INK $06, PAPER $00, BRIGHT $01
9C8F DEFB $06
9C90 DEFB $11
9C91 DEFB $00
9C92 DEFB $13
9C93 DEFB $01
9C94 DEFB $5E
9C95 CALL Search_NonZero
9C98 DEFW BankAccountLow
9C9A DEFB $04
9C9B JR Z,Inv_Update_6
9C9D CALL Print_StrFromStack
9CA0 DEFB $16
9CA1 DEFB $03
9CA2 DEFB $00
9CA3 DEFM "bank: "
9CA9 DEFB $5E
9CAA LD HL,BankAccountLow
9CAD CALL Display_DecimalValue.
9CB0 CALL Print_StrFromStack
9CB3 DEFM " ir"
9CB6 DEFB $5E
Inv_Update_6 9CB7 LD A,(CurrentRoom_Type)
9CBA CP $05
9CBC JR Z,Inv_Update_7
9CBE CP $09
9CC0 JR NZ,Inv_Update_8
Inv_Update_7 9CC2 XOR A Select iridi.
9CC3 LD (Inv_Select),A
9CC6 CALL Print_StrFromStack
9CC9 DEFB $10 INK $03
9CCA DEFB $03
9CCB DEFB $5E
Display number of iridi tokens held.
Inv_Update_8 9CCC CALL Print_StrFromStack
9CCF DEFB $16 AT 4,1
9CD0 DEFB $04
9CD1 DEFB $01
9CD2 DEFB $5E
9CD3 LD B,$2A '*'
9CD5 LD A,(Inv_Select) Check to see if iridi token are selected.
9CD8 AND A
9CD9 JR Z,Inv_Update_9
9CDB LD B,$20 If not just display a space character.
Inv_Update_9 9CDD LD A,B
9CDE CALL Print_SelectChar
9CE1 LD HL,IridiValue
9CE4 CALL Display_DecimalValue.
9CE7 LD A,(CurrentRoom_Type)
9CEA CP $09 Check for Bank or Ludum (gambling house).
9CEC JR Z,Inv_Update_10
9CEE CP $05
9CF0 JR NZ,Inv_Update_11
Inv_Update_10 9CF2 CALL Print_StrFromStack Bank and Ludum display 'tokens' for the money...
9CF5 DEFM " tokens"
9CFC DEFB $5E
9CFD JR Inv_Update_12
Inv_Update_11 9CFF CALL Print_StrFromStack Other places display 'iridi'
9D02 DEFM " iridi"
9D08 DEFB $10
9D09 DEFB $03
9D0A DEFB $5E
Display objects in pockets.
Inv_Update_12 9D0B LD DE,(Inv_Pocket3)
9D0F LD E,$04
9D11 LD IX,_b14e Point to address just before pockets.
Inv_Update_13 9D15 INC IX Next pocket.
9D17 LD A,E
9D18 CP $07
9D1A JP NC,Inv_Update_18
9D1D LD A,(IX+$00) Get object held in pocket.
9D20 AND A Zero means nothing carried in pocket. Skip.
9D21 JP Z,Inv_Update_18
9D24 PUSH DE
9D25 CALL Object_GetNounAddr
9D28 POP DE
9D29 INC E
9D2A LD A,$16 PRINT AT e,0;
9D2C RST $10
9D2D LD A,E
9D2E RST $10
9D2F XOR A
9D30 RST $10
9D31 PUSH HL
9D32 PUSH DE
9D33 BIT 7,(IX+$00) MSB of pocket value, flags as a stolen object.
9D37 JR Z,Inv_Update_14
9D39 CALL Print_StrFromStack
9D3C DEFB $12 PRINT FLASH 1;"s"; FLASH 0;
9D3D DEFB $01
9D3E DEFM "s"
9D3F DEFB $12
9D40 DEFB $00
9D41 DEFB $5E
9D42 JR Inv_Update_15
Inv_Update_14 9D44 LD A,$20 If not stolen the just display a space.
9D46 CALL Print_SelectChar
Inv_Update_15 9D49 POP DE
9D4A POP HL
9D4B DEC D See if object is selected...
9D4C JR NZ,Inv_Update_16
9D4E LD A,$2A print '*' for selected.
9D50 CALL Print_SelectChar
9D53 JR Inv_Update_17
Inv_Update_16 9D55 LD A,$20 print ' ' if not.
9D57 CALL Print_SelectChar
Inv_Update_17 9D5A CALL Print_String Print object's noun.
9D5D CP $5E Make sure sting has terminated and not stopped at a '+' character which means second line of info.
9D5F JR Z,Inv_Update_13
9D61 LD A,D If the object is selected, store the address of the extra string.
9D62 AND A
9D63 JR NZ,Inv_Update_13
9D65 LD (ObjectStringPtr),HL
9D68 JR Inv_Update_13
Display object's extra string. (If any).
Inv_Update_18 9D6A LD HL,(ObjectStringPtr)
9D6D LD A,L
9D6E OR H
9D6F JP NZ,Object_StringExtraDisplay
9D72 RET
Prev: 9C44 Up: Map Next: 9D73