Routines
| Prev: A51B | Up: Map | Next: A55D |
A536: Wait for a key, but not for ever
|
||||||||||
| A536 | PUSH HL | Save HL on the stack | ||||||||
| A537 | LD HL,($A03B) | How many polls before giving up | ||||||||
| A53A | CALL $C41F | A key? | ||||||||
| A53D | BIT 7,A | Test bit 7 of A - Yes | ||||||||
| A53F | JR NZ,$A553 | If bit 7 of A is set, skip ahead to A553 | ||||||||
| A541 | LD A,$00 | Load A with $00 - No: a short delay... | ||||||||
| A543 | DEC A | Subtract one from A | ||||||||
| A544 | PUSH HL | Save HL on the stack | ||||||||
| A545 | POP HL | Restore HL from the stack | ||||||||
| A546 | JR NZ,$A543 | If the zero flag is clear, go back to A543 | ||||||||
| A548 | DEC HL | Step HL back one byte - ...and count a poll | ||||||||
| A549 | LD A,H | Copy H into A | ||||||||
| A54A | OR L | Set in A the bits that are set in L | ||||||||
| A54B | JR NZ,$A53A | If the result is not zero, go back to A53A - Try again | ||||||||
| A54D | POP HL | Restore HL from the stack | ||||||||
| A54E | PUSH HL | Save HL on the stack | ||||||||
| A54F | CALL $D9B7 | Time is up: rub out the line | ||||||||
| A552 | XOR A | Z: nothing typed | ||||||||
| A553 | AND $7F | The key | ||||||||
| A555 | LD HL,$0BB8 | Load HL with $0BB8 - Reset the limit for next time | ||||||||
| A558 | LD ($A03B),HL | Store HL in $A03B in "Game variables" | ||||||||
| A55B | POP HL | Restore HL from the stack | ||||||||
| A55C | RET | Return to the caller | ||||||||
| Prev: A51B | Up: Map | Next: A55D |