Prev: 9068 Up: Map Next: 9093
9073: 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 9073 LD ($9054),A Write the updated cursor position to *SelectedMarkedCard.
9076 POP AF Restore the previous cursor position from the stack.
9077 INC A Increment the previous cursor position by one for the loop below and also store it as a counter in B.
9078 LD B,A
Locate the previous position in MarkedCards.
9079 LD HL,$9054 HL=SelectedMarkedCard (e.g. MarkedCards-01).
FindOldMarkedCard_Loop 907C INC HL Increment HL by one.
907D DEC A Decrease A by one.
907E JR NZ,FindOldMarkedCard_Loop Jump to FindOldMarkedCard_Loop until A is zero.
Fetch the old marked card position data.
9080 LD A,(HL) A=*HL.
Now find the position in the attribute buffer for the old cursor position (using B which was stored earlier).
9081 LD HL,$5A1B HL=5A1B (attribute buffer location).
9084 LD DE,$0006 DE=0006.
FindOldMarkedCardAttribute_Loop 9087 ADD HL,DE HL+=DE.
9088 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.
908A LD B,$06 Set a counter of 06 which is the width of a card.
ClearOldMarkedCardAttribute_Loop 908C LD (HL),A Write A to *HL.
908D INC HL Increment HL by one.
908E 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 9090 JP FindSelectedCardAttribute Jump to FindSelectedCardAttribute.
Prev: 9068 Up: Map Next: 9093