| The Hobbit (v1.0) | Routines |
| Prev: 70DF | Up: Map | Next: 7111 |
|
Each action table entry (AA47) is four word references, and the top nibble of each high byte is a set of flags rather than part of the word. This routine gathers the four flag nibbles of the entry at IX into two bytes:
The value of $B60D is also returned in A.
|
||||||||||||
| 70EA | LD A,(IX+$05) | A = the third word of this action, whose top nibble carries flag bits rather than a word class | ||||||||||
| 70ED | RRCA | Shift those flag bits down into the bottom four... | ||||||||||
| 70EE | RRCA | |||||||||||
| 70EF | RRCA | |||||||||||
| 70F0 | RRCA | |||||||||||
| 70F1 | AND $0F | ...keeping just them | ||||||||||
| 70F3 | LD C,A | C = them | ||||||||||
| 70F4 | LD A,(IX+$07) | A = the fourth word's own flags, already conveniently in the top nibble | ||||||||||
| 70F7 | AND $F0 | |||||||||||
| 70F9 | ADD A,C | Combine the two nibbles into a single byte | ||||||||||
| 70FA | LD ($B60E),A | This becomes the action's second set of flags | ||||||||||
| 70FD | LD A,(IX+$01) | Now do exactly the same with the first and second words instead... | ||||||||||
| 7100 | RRCA | |||||||||||
| 7101 | RRCA | |||||||||||
| 7102 | RRCA | |||||||||||
| 7103 | RRCA | |||||||||||
| 7104 | AND $0F | |||||||||||
| 7106 | LD C,A | |||||||||||
| 7107 | LD A,(IX+$03) | |||||||||||
| 710A | AND $F0 | |||||||||||
| 710C | ADD A,C | |||||||||||
| 710D | LD ($B60D),A | ...giving the action's main set of flags | ||||||||||
| 7110 | RET | |||||||||||
| Prev: 70DF | Up: Map | Next: 7111 |