Prev: F1E5 Up: Map Next: F231
F1FC: Handler: Port Hole
Used by the routine at InitialiseGame.
Set the UDG graphics pointer.
Handler_PortHole F1FC LD HL,$914C Write 914C to *CHARS.
F1FF LD ($5C36),HL
Set the attributes.
F202 LD A,$10 Set INK: CYAN (05).
F204 RST $10
F205 LD A,$05
F207 RST $10
Only animate the port holes every 4th frame.
F208 LD A,($F259) A=*TimerPortHole_FrameSkip.
F20B INC A Increment A by one.
F20C AND %00000011 Keep *TimerPortHole_FrameSkip in the range 00-03.
F20E LD ($F259),A Write A to *TimerPortHole_FrameSkip.
F211 RET NZ Return if *TimerPortHole_FrameSkip is a skipped frame.
The data is stored as:
Byte Offset Data
+00 Horizontal Position
+01 Vertical Position
+02 Frame/ Sprite ID
Walk the port-hole table at *ReferencePortHole.
F212 LD HL,($5BDC) HL=*ReferencePortHole.
Keep looping until the terminator.
Handler_PortHole_Loop F215 LD C,(HL) Fetch this port hole's column and row.
F216 INC HL
F217 LD B,(HL)
F218 INC HL Advance to the frame ID.
Stop at the table terminator.
F219 LD A,$FF Return if this port-hole entry is the terminator (FF).
F21B CP C
F21C RET Z
Advance the four-tile port-hole animation.
F21D LD A,(HL) Fetch the current frame ID.
F21E ADD A,$04 Add one port-hole frame (04 tiles).
F220 CP $40 Jump to PrintPortHole if the frames have not wrapped.
F222 JR NZ,PrintPortHole
Reset to the first port-hole frame.
F224 LD A,$20 A=the first port-hole frame.
Store the frame and print the port hole.
PrintPortHole F226 LD (HL),A Write the frame ID back to the table.
F227 INC HL Advance to the next port-hole entry.
F228 LD D,$02 Set the port-hole width/ height to 02/ 02.
F22A LD E,$02
F22C CALL PrintSprite Print the port hole.
Keeping looping around, this only finishes when a terminator is received.
F22F JR Handler_PortHole_Loop Jump to Handler_PortHole_Loop.
Prev: F1E5 Up: Map Next: F231