Prev: 6A17 Up: Map Next: 6AA6
6A27: Routine at 6A27
Used by the routines at 6A00 and 6AAC.
6A27 LD A,(HL) A=*HL.
6A28 RLCA RLCA.
6A29 RLCA
6A2A RLCA
6A2B RLCA
6A2C LD L,A L=A.
6A2D AND %00001111 Keep only bits 0-3.
6A2F ADD A,$C0 H=C0+A.
6A31 LD H,A
6A32 LD A,L A=L.
6A33 AND %11110000 Keep only bits 4-7.
6A35 ADD A,C A+=C.
6A36 LD L,A L=A.
6A37 LD A,(HL) A=*HL.
6A38 INC L Increment L by one.
6A39 LD ($7834),A Write A to *7834.
6A3C LD A,(HL) A=*HL.
6A3D LD HL,$7826 HL=7826.
6A40 LD (HL),$00 Write 00 to *HL.
6A42 RRCA RRCA.
6A43 JR NC,$6A46 Jump to 6A46 if {} is higher.
6A45 INC (HL) Increment *HL by one.
6A46 RRCA RRCA.
6A47 LD C,A C=A.
6A48 JR NC,$6A6D Jump to 6A6D if {} is higher.
6A4A AND %00000011 Keep only bits 0-1.
6A4C LD L,$33 L=33.
6A4E JR NZ,$6A51 Jump to 6A51 if {} is not zero.
6A50 DEC (HL) Decrease *HL by one.
6A51 DEC A Decrease A by one.
6A52 JR NZ,$6A55 Jump to 6A55 if A is not zero.
6A54 INC (HL) Increment *HL by one.
6A55 LD L,$26 L=26.
6A57 LD B,A B=A.
6A58 LD A,$23 A=23.
6A5A SUB (HL) A-=*HL.
6A5B LD L,A L=A.
6A5C LD A,(HL) A=*HL.
6A5D DEC B Decrease B by one.
6A5E JR NZ,$6A65 Jump to 6A65 if B is not zero.
6A60 CP $69 Jump to 6A65 if A is equal to 69.
6A62 JR Z,$6A65
6A64 DEC (HL) Decrease *HL by one.
6A65 DEC B Decrease B by one.
6A66 JR NZ,$6A6D Jump to 6A6D if B is not zero.
6A68 CP $96 Jump to 6A6D if A is equal to 96.
6A6A JR Z,$6A6D
6A6C INC (HL) Increment *HL by one.
6A6D LD L,$26 L=26.
6A6F LD A,(HL) Jump to 6A94 if *HL is not zero.
6A70 AND A
6A71 JR NZ,$6A94
6A73 LD L,$22 L=22.
6A75 LD A,(HL) Jump to 6A7B if bit 7 of *HL is set.
6A76 BIT 7,A
6A78 JR NZ,$6A7B
6A7A CPL Invert the bits in A.
6A7B LD B,A B=A.
6A7C DEC L Decrease L by one.
6A7D LD A,(HL) Jump to 6A83 if bit 7 of *HL is set.
6A7E BIT 7,A
6A80 JR NZ,$6A83
6A82 CPL A=00.
6A83 SUB B A-=B.
6A84 JR NC,$6A94 Jump to 6A94 if {} is higher.
6A86 CPL Invert the bits in A.
6A87 SRL A Shift A right twice.
6A89 SRL A
6A8B LD L,$34 L=34.
6A8D ADD A,(HL) A+=*HL.
6A8E BIT 4,A Jump to 6A93 if bit 4 of A is not set.
6A90 JR Z,$6A93
6A92 DEC A Decrease A by one.
6A93 LD (HL),A Write A to *HL.
6A94 LD A,C A=C.
6A95 RRCA RRCA.
6A96 RRCA
6A97 RRCA
6A98 RET NC Return if {} is higher.
There are 07 actions. They are contained in a jump table at: JumpTable_Actions onwards.
6A99 AND %00000111 Keep only bits 0-2.
6A9B ADD A,A L=DC+(A*02).
6A9C ADD A,$DC
6A9E LD L,A
6A9F LD H,$B4 H=B4.
Fetch the related action from the jump table and jump to it.
6AA1 LD A,(HL) A=*HL.
6AA2 INC L Increment L by one.
6AA3 LD H,(HL) H=*HL.
6AA4 LD L,A L=A.
6AA5 JP (HL) Jump to *HL.
Prev: 6A17 Up: Map Next: 6AA6