Prev: C452 Up: Map Next: C8E3
C8BE: Builds a pre-shifted version of the backdrop horizon bitmap
80x24 pixels = 240 bytes
The stage's backdrop bitmap is copied, then rotated right in place by one nibble per row using RRD, which passes the low nibble of each byte on to the next. The result is the variant used when the horizontal scroll offset falls half a byte between two whole byte positions.
Used by the routine at set_up_stage.
pre_shift_backdrop C8BE LD HL,$5C00 Point at source bitmap
C8C1 LD DE,$5B00 Point at destination bitmap (to be shifted)
C8C4 PUSH DE Preserve addresses
C8C5 PUSH HL
C8C6 LD BC,$00F0 Copy whole source bitmap to destination
C8C9 LDIR
C8CB POP HL Restore source address
C8CC LD DE,$0009 DE = Source address + 9 (final byte on line)
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
psb_row_loop C8D5 PUSH BC Preserve counters
C8D6 LD A,(DE) A = *DE
psb_loop C8D7 RRD Rotate nibbles from A to *HL
C8D9 INC L Advance destination address
C8DA INC E Advance source address
C8DB DJNZ psb_loop Loop while rowbytes remain
C8DD POP BC Restore counters
C8DE DEC C Decrement row counter
C8DF JP NZ,psb_row_loop Loop while rows remain
C8E2 RET Return
Prev: C452 Up: Map Next: C8E3