Prev: C598 Up: Map Next: C8E3
C8BE: Builds a pre-shifted version of the backdrop horizon image
80x24 pixels = 240 bytes
Input
Used by the routine at setup_game.
pre_shift_backdrop C8BE LD HL,$5C00 Point at source image
C8C1 LD DE,$5B00 Point at destination image (to be shifted)
C8C4 PUSH DE Preserve addresses
C8C5 PUSH HL
C8C6 LD BC,$00F0 Copy whole source image to destination
C8C9 LDIR
C8CB POP HL Restore source address
C8CC LD DE,$0009 DE = Source address + 9
C8CF ADD HL,DE
C8D0 EX DE,HL
C8D1 POP HL Pop destination address
C8D2 LD BC,$0A18 Load counters for 10 bytes per row, 24 rows
pre_shift_backdrop_0 C8D5 PUSH BC Preserve counters
C8D6 LD A,(DE) A = *DE
pre_shift_backdrop_1 C8D7 RRD Rotate nibbles from A to *HL
C8D9 INC L Advance destination address
C8DA INC E Advance source address
C8DB DJNZ pre_shift_backdrop_1 Loop while rowbytes remain
C8DD POP BC Restore counters
C8DE DEC C Decrement row counter
C8DF JP NZ,pre_shift_backdrop_0 Loop while rows remain
C8E2 RET Return
Prev: C598 Up: Map Next: C8E3