Prev: AF6B Up: Map Next: AFC2
AFAE: Flip pattern vertically
Take a pattern pointed to by pattern_address and flip it vertically (upside down). Returns address of result in pattern_address. Used by the routine at upload_sprite_patterns.
flip_vertical AFAE LD DE,(pattern_address) DE = source address
AFB2 LD HL,$0010 HL = right after end of destination buffer
AFB5 ADD HL,DE ...
AFB6 LD B,$08 8 bytes in pattern
flip_vertical_0 AFB8 LD A,(DE) Get source byte
AFB9 DEC HL Destination address moves backwards
AFBA LD (HL),A Store result
AFBB INC DE Next source
AFBC DJNZ flip_vertical_0 Repeat 8 times
AFBE LD (pattern_address),HL Store destination
AFC1 RET
Prev: AF6B Up: Map Next: AFC2