Prev: 60819 Up: Map Next: 60893
60842: Adjust Score Field Cursor
Used by the routine at Display_High_Score_Entry_Screen.
Adjusts the cursor within a score entry digit field. Searches for the current column position in the character table at IX via Search_Score_Entry_Table; if found and within range, updates E to the new column, calculates the attribute address via Calculate_Attr_Cell_Address, writes highlight attributes for both the old and new cursor positions via Highlight_Score_Entry_Row, then fills the column bytes for the updated field.
Input
B Entry count for table search
C Cursor colour byte
D Cursor upper bound
E Current cursor column
IX Score entry character table
Adjust_Score_Field_Cursor 60842 PUSH IX Copy the character table pointer from IX to HL.
60844 POP HL
60845 LD A,E Load the current cursor column from E.
60846 PUSH BC Stash the field count on the stack and search for the current column in the table via Search_Score_Entry_Table.
60847 CALL Search_Score_Entry_Table
60850 POP BC Restore the field count from the stack.
60851 RET NZ Return if the current position is not found in the table.
60852 INC HL Load the next cursor position from the table and check it against the upper bound in D.
60853 LD A,(HL)
60854 CP D
60855 RET Z Return if the cursor is already at its maximum.
60856 LD E,A Update the cursor column in E.
60857 INC HL Advance and load the screen position byte from the table entry.
60858 LD A,(HL)
60859 PUSH DE Stash the cursor state on the stack and calculate the new attribute cell address via Calculate_Attr_Cell_Address.
60860 CALL Calculate_Attr_Cell_Address
60863 POP DE Restore the cursor state from the stack.
60864 CALL Highlight_Score_Entry_Row Write the highlight attributes for the new cursor position via Highlight_Score_Entry_Row.
60867 PUSH IX Reload the character table pointer from IX to HL.
60869 POP HL
60870 INC HL Advance to the second table entry.
60871 LD A,D Load the upper bound from D and search for it in the table via Search_Score_Entry_Table.
60872 CALL Search_Score_Entry_Table
60875 INC HL Advance and load the screen position byte from the table entry.
60876 LD A,(HL)
60877 PUSH DE Stash the cursor state on the stack and calculate the previous attribute cell address via Calculate_Attr_Cell_Address.
60878 CALL Calculate_Attr_Cell_Address
60881 POP DE Restore the cursor state from the stack.
60882 INC HL Advance past the table position bytes.
60883 INC HL
60884 LD B,28 Set the attribute fill count to 28.
Score_Field_Fill_Loop 60886 LD (HL),C Write the cursor colour to each attribute cell and loop until 28 cells are filled.
60887 INC HL
60888 DJNZ Score_Field_Fill_Loop
60890 LD D,E Copy the updated cursor column from E to D.
60891 XOR A Clear A and return to signal the field was updated.
60892 RET
Prev: 60819 Up: Map Next: 60893