Routines |
Prev: 36734 | Up: Map | Next: 36948 |
Used by the routine at PlayGame.
|
||||||||
Messaging options:
|
||||||||
MarkCards | 36867 | LD A,15 | Call Messaging_Girl using message block 15. | |||||
36869 | CALL Messaging_Girl | |||||||
Reset SelectedMarkedCard and MarkedCards.
|
||||||||
36872 | LD HL,36948 | HL=SelectedMarkedCard. | ||||||
36875 | LD B,6 | Set a counter in B for 6 bytes. | ||||||
ResetMarkedCardFlags_Loop | 36877 | LD (HL),0 | Write 0 to *HL. | |||||
36879 | INC HL | Increment HL by one. | ||||||
36880 | 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 | 36882 | LD HL,23067 | HL=23067 (attribute buffer location). | |||||
36885 | LD A,(36948) | A=*SelectedMarkedCard. | ||||||
36888 | LD DE,6 | DE=0006. | ||||||
36891 | INC A | Increment A by one for the calculation (as position 0-1 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 | 36892 | ADD HL,DE | HL+=DE. | |||||
36893 | DEC A | Decrease A by one. | ||||||
36894 | JR NZ,FindSelectedCardAttribute_Loop | Jump to FindSelectedCardAttribute_Loop until A is zero. | ||||||
The attribute block under the selected card has been located.
|
||||||||
36896 | LD (36954),HL | Write HL to *PointerMarkedCardAttributeBuffer. | ||||||
Flash the attributes under the selected card.
|
||||||||
SelectedCardAttributeFlash | 36899 | LD C,0 | Initialise the flash count to 0 in C. | |||||
SelectedCardAttributeFlash_Loop | 36901 | LD A,C | Copy the count into A for conversion into a usable attribute value. | |||||
36902 | SLA A | Convert the INK value into a PAPER value. | ||||||
36904 | SLA A | |||||||
36906 | SLA A | |||||||
36908 | OR %01000000 | Set the BRIGHT bit. | ||||||
36910 | LD HL,(36954) | HL=*PointerMarkedCardAttributeBuffer. | ||||||
36913 | LD B,6 | Set a counter to the width of a card to B (6 bytes). | ||||||
SelectedCardWriteAttributeLine | 36915 | LD (HL),A | Write A to *HL. | |||||
36916 | INC HL | Increment HL by one. | ||||||
36917 | 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.
|
||||||||
36919 | LD D,25 | D=25. | ||||||
TinyPause_Loop | 36921 | DEC D | Decrease D by one. | |||||
36922 | 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 8... As there are only 7 colours.
|
||||||||
36924 | INC C | Increment C by one. | ||||||
36925 | LD A,C | Jump to SelectedCardAttributeFlash_Loop if C is not equal to 8. | ||||||
36926 | CP 8 | |||||||
36928 | JR NZ,SelectedCardAttributeFlash_Loop | |||||||
The count is 8 so continue here and collect the user input.
|
||||||||
36930 | CALL Controls | Call Controls. | ||||||
36933 | OR A | Jump to MarkCards_SelectCard if "select" has been pressed. | ||||||
36934 | JR Z,MarkCards_SelectCard | |||||||
36936 | CP 3 | Jump to MarkCards_CursorLeft if "left" has been pressed. | ||||||
36938 | JR Z,MarkCards_CursorLeft | |||||||
36940 | CP 4 | Jump to MarkCards_CursorRight if "right" has been pressed. | ||||||
36942 | JR Z,MarkCards_CursorRight | |||||||
36944 | JR C,HandlerMarkCards | Jump to HandlerMarkCards if "up" or "down" have been pressed. | ||||||
36946 | JR SelectedCardAttributeFlash | Jump to SelectedCardAttributeFlash. |
Prev: 36734 | Up: Map | Next: 36948 |