Prev: B9AC Up: Map Next: B9FB
B9D6: Draw Characters In The Current Room
Used by the routines at 813B, 81AE and B3BE.
Write the current room ID for referring back to.
Draw_Characters_CurrentRoom B9D6 LD A,(IY+$0F) Write the current room (IY+0F) to TempStore_Room.
B9D9 LD ($B951),A
There are five characters, cycle through each of them in reverse.
B9DC LD B,$05 B=05 (counter).
Store the current character reference so it isn't corrupted.
B9DE PUSH IY Stash IY on the stack.
Starting at the end with Harry.
B9E0 LD IY,$BC6B IY=FrameId_Harry.
Draw_Characters_CurrentRoom_Loop B9E4 PUSH BC Stash the counter in BC on the stack.
Don't draw the character if they're not in the current room.
B9E5 LD A,($B951) A=*TempStore_Room.
B9E8 CP (IY+$0F) If A is not equal to the current room (*IY+0F) jump to Draw_Characters_CurrentRoom_Skip.
B9EB JR NZ,Draw_Characters_CurrentRoom_Skip
Draw the character in the shadow buffer as they are in the room with our current character.
B9ED CALL WriteSprite_ShadowBuffer Call WriteSprite_ShadowBuffer.
Move onto the next character.
Draw_Characters_CurrentRoom_Skip B9F0 DEC IY Decrease IY by one.
B9F2 POP BC Restore the counter (BC) from the stack.
B9F3 DJNZ Draw_Characters_CurrentRoom_Loop Decrease counter by one and loop back to Draw_Characters_CurrentRoom_Loop until counter is zero.
Restores the current character pointer to IY.
B9F5 POP IY Restore IY from the stack.
Update the screen buffer and return.
B9F7 CALL ShadowBufferToScreen Call ShadowBufferToScreen.
B9FA RET Return.
Prev: B9AC Up: Map Next: B9FB