Prev: AC69 Up: Map Next: AC7F
AC6C: Search for FF a number of times and return a pointer to the next entry after it
Used by the routines at AA8C, BA6E and EABF.
Input
HL The base address of item data. On return, points to the correct place for the room data.
A The current room number
B On return, holds the number of entries for this room
AC6C OR A Is the current room 0?
AC6D RET Z Return if it is, something's gone wrong.
Looks like a valid room, so work out the address to return by counting the number of END (FF) characters.
AC6E PUSH BC Remember BC and DE.
AC6F PUSH DE
AC70 LD E,A Put the room number in E as the number of matches to find.
AC71 LD A,$FF Search for FF.
AC73 LD BC,$0000 Search the entire memory.
AC76 CPIR Look for it.
AC78 DEC E Reduce the number of matches to find.
AC79 JP NZ,$AC76 Jump back if there are more entries to look for.
AC7C POP DE Restore DE and BC and return.
AC7D POP BC
AC7E RET
Prev: AC69 Up: Map Next: AC7F