Prev: 70DF Up: Map Next: 7111
70EA: Collect the flag nibbles of an action table entry
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:
  • $B60D = (top nibble of byte 3) + (top nibble of byte 1) / 16. Bit 4 of this byte means 'do not report this action' (7122), bit 3 'mention the target', bit 2 'mention the instrument', bit 5 'leave out the article'.
  • B60E = (top nibble of byte 7) + (top nibble of byte 5) / 16. Bit 7 of this byte controls how the target and instrument are introduced.
The value of $B60D is also returned in A.
Input
IX Action table entry
Output
A Flags (also at $B60D)
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