Prev: 61925 Up: Map Next: 62001
61948: Handler: Port Hole
Used by the routine at InitialiseGame.
Set the UDG graphics pointer.
Handler_PortHole 61948 LD HL,37196 Write 37196 to *CHARS.
61951 LD (23606),HL
Set the attributes.
61954 LD A,16 Set INK: CYAN (5).
61956 RST 16
61957 LD A,5
61959 RST 16
Only animate the port holes every 4th frame.
61960 LD A,(62041) A=*TimerPortHole_FrameSkip.
61963 INC A Increment A by one.
61964 AND %00000011 Keep *TimerPortHole_FrameSkip in the range 0-3.
61966 LD (62041),A Write A to *TimerPortHole_FrameSkip.
61969 RET NZ Return if *TimerPortHole_FrameSkip is a skipped frame.
The data is stored as:
Byte Offset Data
+0 Horizontal Position
+1 Vertical Position
+2 Frame/ Sprite ID
Walk the port-hole table at *ReferencePortHole.
61970 LD HL,(23516) HL=*ReferencePortHole.
Keep looping until the terminator.
Handler_PortHole_Loop 61973 LD C,(HL) Fetch this port hole's column and row.
61974 INC HL
61975 LD B,(HL)
61976 INC HL Advance to the frame ID.
Stop at the table terminator.
61977 LD A,255 Return if this port-hole entry is the terminator (255).
61979 CP C
61980 RET Z
Advance the four-tile port-hole animation.
61981 LD A,(HL) Fetch the current frame ID.
61982 ADD A,4 Add one port-hole frame (4 tiles).
61984 CP 64 Jump to PrintPortHole if the frames have not wrapped.
61986 JR NZ,PrintPortHole
Reset to the first port-hole frame.
61988 LD A,32 A=the first port-hole frame.
Store the frame and print the port hole.
PrintPortHole 61990 LD (HL),A Write the frame ID back to the table.
61991 INC HL Advance to the next port-hole entry.
61992 LD D,2 Set the port-hole width/ height to 2/ 2.
61994 LD E,2
61996 CALL PrintSprite Print the port hole.
Keeping looping around, this only finishes when a terminator is received.
61999 JR Handler_PortHole_Loop Jump to Handler_PortHole_Loop.
Prev: 61925 Up: Map Next: 62001