Prev: A83D Up: Map Next: A921
A8A0: Routine at A8A0
Used by the routines at ED2A, EFC7, F10E, F177, F5F1 and F8B9.
A8A0 EXX Switch to the shadow registers.
A8A1 PUSH AF Stash AF on the stack.
A8A2 LD ($A83B),SP Write SP to Temp_StackPointer_Storage.
A8A6 LD SP,$8378 SP=Graphics_Items.
A8A9 LD L,A Create an offset in HL.
A8AA LD H,$00
A8AC ADD HL,HL SP=(HL*20)+SP.
A8AD ADD HL,HL
A8AE ADD HL,HL
A8AF ADD HL,HL
A8B0 ADD HL,HL
A8B1 ADD HL,SP
A8B2 LD SP,HL
A8B3 LD A,($A838) B=A838.
A8B6 LD B,A
A8B7 AND %00000111 Keep only bits 0-2.
A8B9 INC A Increment A by one.
A8BA LD ($A8E0),A Write A to
A8BD LD ($A8FC),A
A8C0 LD A,B
A8C1 AND %11111000 Keep only bits 3-7.
A8C3 RRCA
A8C4 RRCA
A8C5 RRCA
A8C6 LD ($EFAF),A Write A to EFAF.
A8C9 ADD A,$02 E=A+02.
A8CB LD E,A
A8CC LD C,$10 C=10.
A8CE LD A,($A839) A=*A839.
A8D1 SUB $40
A8D3 LD L,A
A8D4 LD H,$00
A8D6 ADD HL,HL
A8D7 ADD HL,HL
A8D8 ADD HL,HL
A8D9 ADD HL,HL
A8DA ADD HL,HL
A8DB LD D,$6B
A8DD ADD HL,DE
A8DE POP DE
A8DF LD B,$00
A8E1 DEC B
A8E2 JR Z,$A8F0
A8E4 SCF
A8E5 LD A,$FF
A8E7 RR E
A8E9 RR D
A8EB RRA
A8EC DJNZ $A8E7
A8EE AND (HL)
A8EF LD (HL),A
A8F0 DEC HL
A8F1 LD A,(HL)
A8F2 AND D
A8F3 LD (HL),A
A8F4 DEC HL
A8F5 LD A,(HL)
A8F6 AND E
A8F7 LD (HL),A
A8F8 INC HL
A8F9 INC HL
A8FA POP DE
A8FB LD B,$00
A8FD DEC B
A8FE JR Z,$A90A
A900 XOR A
A901 SRL E
A903 RR D
A905 RRA
A906 DJNZ $A901
A908 OR (HL)
A909 LD (HL),A
A90A DEC HL
A90B LD A,(HL)
A90C OR D
A90D LD (HL),A
A90E DEC HL
A90F LD A,(HL)
A910 OR E
A911 LD (HL),A
A912 LD DE,$0022 HL+=0022.
A915 ADD HL,DE
A916 DEC C Decrease C by one.
A917 JP NZ,$A8DE If C is not zero, jump to A8DE.
A91A EXX Switch to the normal registers.
A91B LD SP,($A83B) Restore SP from Temp_StackPointer_Storage.
A91F POP AF Restore AF from the stack.
A920 RET Return.
Prev: A83D Up: Map Next: A921