Prev: 62700 Up: Map Next: 62797
62749: Advance Colour Cycle
Used by the routine at Attract_Mode_Loop.
Advances the colour cycling animation by one step. Scans all 768 screen attribute cells and replaces cells matching 71 with the next colour from the sequence at Colour_Cycle_Table, then immediately replaces all cells matching the following entry with 71 to prime the next cycle step.
Advance_Colour_Cycle 62749 LD HL,(62804) Load the colour cycle table pointer.
62752 LD E,(HL) Read the replacement colour from the current table entry.
62753 LD A,71 Set the attribute value to be replaced.
62755 LD D,A
62756 CALL Advance_Colour_Cycle_Scan Scan the attribute area and apply the colour replacement.
62759 LD HL,(62804) Re-read and advance the colour cycle pointer.
62762 INC HL
Advance_Colour_Cycle_Next 62763 LD (62804),HL Save the updated colour cycle pointer.
62766 LD A,(HL) Read the next table entry and check for the end sentinel.
62767 CP 255
62769 LD D,A
62770 LD E,71 Set up to restore the marker colour and scan again.
62772 JR NZ,Advance_Colour_Cycle_Scan
62774 LD HL,62797 Reset the colour cycle pointer to the table start.
62777 JR Advance_Colour_Cycle_Next
This entry point is used by the routine at Advance_Intro_Colour_Cycle.
Scan all 768 screen attribute cells and replace any cell colour matching the target with the replacement colour.
Advance_Colour_Cycle_Scan 62779 LD HL,22528 Set up to scan all 768 screen attribute cells.
62782 LD BC,768
Advance_Colour_Cycle_Scan_Loop 62785 CP (HL) Skip the cell if it does not match the target colour.
62786 JR NZ,Advance_Colour_Cycle_Loop_Next
62788 LD (HL),E Write the replacement colour to this attribute cell.
Advance_Colour_Cycle_Loop_Next 62789 DEC BC Advance to the next cell and reload the target colour.
62790 LD A,B
62791 OR C
62792 INC HL
62793 LD A,D
62794 JR NZ,Advance_Colour_Cycle_Scan_Loop Loop back until all attribute cells are scanned.
62796 RET Return.
Prev: 62700 Up: Map Next: 62797