Prev: 25877 Up: Map Next: 26005
25917: INVEN action
ACTION_INVEN 25917 LD HL,9 "You are carrying"
25920 CALL PRINT_SYSMSG_NEWLINE Print system message
25923 RES 5,(IY+8)
25927 LD DE,23333 DE=object location table
25930 LD HL,(27547) HL = address of Objects table
This entry point is used by the routine at NEWLINE_WORN.
ACTION_INVEN_0 25933 LD A,(DE) A=location of object
25934 CP 255 Have we reached end of table?
25936 JR Z,INVEN_NOTHING If so, end INVEN processing
25938 CP 253 Is it worn or carried?
25940 JR C,INVEN_NEXT_OBJ Move to next object
25942 SET 5,(IY+8) At least one object in inventory
25946 PUSH HL
25947 PUSH DE
25948 PUSH AF
25949 LD E,(HL) E=LSB of object text
25950 INC HL
25951 LD D,(HL) D=MSB of object text
25952 EX DE,HL HL=address of object text
25953 CALL PRINT_TO_SCREEN_2 Display object name
25956 POP AF
25957 JR NZ,NEWLINE_WORN_1 If not worn, print newline
25959 LD HL,(27553) HL = Address of system messages table
25962 LD DE,20 "(worn)"
25965 ADD HL,DE
25966 LD E,(HL) E=LSB of "worn" message
25967 INC HL
25968 LD D,(HL) D=MSB of "worn" message
25969 INC HL
25970 PUSH DE Save "worn" message on stack
25971 LD E,(HL) E=LSB of next system message
25972 INC HL
25973 LD D,(HL) D=MSB of next system message
25974 POP HL
25975 EX DE,HL
25976 SCF
25977 SBC HL,DE HL=length of worn message
25979 LD A,H
25980 OR A Is it > 256 chars?
25981 JR NZ,NEWLINE_WORN Write newline, then message
25983 LD A,L
25984 CP 32 Is it > 32 characters?
25986 JR NC,NEWLINE_WORN If so, write newline, then message
25988 LD A,(23688) Current column
25991 DEC A
25992 CP L Are there enough columns to display message?
25993 JR NC,NEWLINE_WORN_0 If not, write newline then message
25995 LD A,23 A=TAB
25997 RST 16 Print tab character
25998 LD A,32
26000 SUB L A=32-length of message
26001 RST 16 Tab to this position
26002 XOR A A=0
26003 JR WORN_MSG Display message
Prev: 25877 Up: Map Next: 26005