Prev: 8F7E Up: Map Next: 9054
9003: Mark Cards
Used by the routine at PlayGame.
Messaging options:
ID Message
01 message-15-00
MarkCards 9003 LD A,$0F Call Messaging_Girl using message block 0F.
9005 CALL Messaging_Girl
9008 LD HL,$9054 HL=SelectedMarkedCard.
900B LD B,$06 Set a counter in B for 06 bytes.
ResetMarkedCardFlags_Loop 900D LD (HL),$00 Write 00 to *HL.
900F INC HL Increment HL by one.
9010 DJNZ ResetMarkedCardFlags_Loop Decrease the counter by one and loop back to ResetMarkedCardFlags_Loop until the counter is zero.
This entry point is used by the routine at MarkCards_UpdateCursorPosition.
FindSelectedCardAttribute 9012 LD HL,$5A1B HL=5A1B (attribute buffer location).
9015 LD A,($9054) A=*SelectedMarkedCard.
9018 LD DE,$0006 DE=0006.
901B INC A Increment A by one for the calculation (as position 00-01 won't work).
Keep adding 0006 to HL while decreasing the selected card position by one. When the card position reaches zero, this is where the selected card attribute block is for this card position.
FindSelectedCardAttribute_Loop 901C ADD HL,DE HL+=DE.
901D DEC A Decrease A by one.
901E JR NZ,FindSelectedCardAttribute_Loop Jump to FindSelectedCardAttribute_Loop until A is zero.
The attribute block under the selected card has been located.
9020 LD ($905A),HL Write HL to *PointerMarkedCardAttributeBuffer.
Flash the attributes under the selected card.
SelectedCardAttributeFlash 9023 LD C,$00 Initialise the flash count to 00 in C.
SelectedCardAttributeFlash_Loop 9025 LD A,C Copy the count into A for conversion into a usable attribute value.
9026 SLA A Convert the INK value into a PAPER value.
9028 SLA A
902A SLA A
902C OR %01000000 Set the BRIGHT bit.
902E LD HL,($905A) HL=*PointerMarkedCardAttributeBuffer.
9031 LD B,$06 Set a counter to the width of a card to B (06 bytes).
SelectedCardWriteAttributeLine 9033 LD (HL),A Write A to *HL.
9034 INC HL Increment HL by one.
9035 DJNZ SelectedCardWriteAttributeLine Decrease the width counter by one and loop back to SelectedCardWriteAttributeLine until all the attribute bytes have been written.
Introduce a tiny delay for the sake of the colour change effect.
9037 LD D,$19 D=19.
TinyPause_Loop 9039 DEC D Decrease D by one.
903A JR NZ,TinyPause_Loop Jump to TinyPause_Loop until D is zero.
Update the flash count, and keep jumping back until the count is equal to 08... As there are only 07 colours.
903C INC C Increment C by one.
903D LD A,C Jump to SelectedCardAttributeFlash_Loop if C is not equal to 08.
903E CP $08
9040 JR NZ,SelectedCardAttributeFlash_Loop
The count is 08 so continue here and collect the user input.
9042 CALL Controls Call Controls.
9045 OR A Jump to MarkCards_SelectCard if "select" has been pressed.
9046 JR Z,MarkCards_SelectCard
9048 CP $03 Jump to MarkCards_CursorLeft if "left" has been pressed.
904A JR Z,MarkCards_CursorLeft
904C CP $04 Jump to MarkCards_CursorRight if "right" has been pressed.
904E JR Z,MarkCards_CursorRight
9050 JR C,HandlerMarkCards Jump to HandlerMarkCards if "up" or "down" have been pressed.
9052 JR SelectedCardAttributeFlash Jump to SelectedCardAttributeFlash.
Prev: 8F7E Up: Map Next: 9054