Prev: 36968 Up: Map Next: 37011
36979: Mark Cards: Update Cursor Position
The cursor has been requested to move away from a slot, so this routine will replace the cursor with the selected/ unselected colour that the slot should be.
Used by the routines at MarkCards_CursorLeft and MarkCards_CursorRight.
MarkCards_UpdateCursorPosition 36979 LD (36948),A Write the updated cursor position to *SelectedMarkedCard.
36982 POP AF Restore the previous cursor position from the stack.
36983 INC A Increment the previous cursor position by one for the loop below and also store it as a counter in B.
36984 LD B,A
Locate the previous position in MarkedCards.
36985 LD HL,36948 HL=SelectedMarkedCard (e.g. MarkedCards-1).
FindOldMarkedCard_Loop 36988 INC HL Increment HL by one.
36989 DEC A Decrease A by one.
36990 JR NZ,FindOldMarkedCard_Loop Jump to FindOldMarkedCard_Loop until A is zero.
Fetch the old marked card position data.
36992 LD A,(HL) A=*HL.
Now find the position in the attribute buffer for the old cursor position (using B which was stored earlier).
36993 LD HL,23067 HL=23067 (attribute buffer location).
36996 LD DE,6 DE=0006.
FindOldMarkedCardAttribute_Loop 36999 ADD HL,DE HL+=DE.
37000 DJNZ FindOldMarkedCardAttribute_Loop Decrease counter by one and loop back to FindOldMarkedCardAttribute_Loop until counter is zero.
Write the selected/ unselected attribute data back to the slot.
37002 LD B,6 Set a counter of 6 which is the width of a card.
ClearOldMarkedCardAttribute_Loop 37004 LD (HL),A Write A to *HL.
37005 INC HL Increment HL by one.
37006 DJNZ ClearOldMarkedCardAttribute_Loop Decrease counter by one and loop back to ClearOldMarkedCardAttribute_Loop until counter is zero.
This entry point is used by the routine at MarkCards_SelectCard.
Alias_FindSelectedCardAttribute 37008 JP FindSelectedCardAttribute Jump to FindSelectedCardAttribute.
Prev: 36968 Up: Map Next: 37011