Prev: 53120 Up: Map Next: 53199
53174: Find Character Script Entry
Searches through the character script entry list to find an entry matching the current character ID. Returns the entry pointer if found, otherwise returns 0.
Output
IX Character script entry pointer (if found)
A 0 if not found, bit 0 set if found
FindCharacterScriptEntry 53174 LD A,(41014) A=*CurrentCharacter_ID.
This entry point is used by the routine at 57723.
FindCharacterScriptEntry_StartSearch 53177 LD IX,40939 IX=*CharacterScriptEntryList.
FindCharacterScriptEntry_Loop 53181 PUSH AF Stash the current character ID on the stack.
53182 CALL FetchObjectPointerFromStack Call FetchObjectPointerFromStack.
53185 JR Z,FindCharacterScriptEntry_NotFound Jump to FindCharacterScriptEntry_NotFound if the end of the list has been reached.
53187 POP AF Restore the current character ID from the stack.
53188 CP (IX+0) Jump to FindCharacterScriptEntry_Loop if this entry doesn't match the character ID.
53191 JR NZ,FindCharacterScriptEntry_Loop
53193 OR %00000001 Mark that the entry was found.
53195 RET Return with the entry pointer.
No matching entry was found in the list.
FindCharacterScriptEntry_NotFound 53196 POP AF Restore the current character ID from the stack.
53197 XOR A Return 0 (entry not found).
53198 RET
Prev: 53120 Up: Map Next: 53199