Prev: B19E Up: Map Next: B29A
B278: Copy a rectangle of the buffer to the screen
Used by the routines at RENDER_DYNAMIC_OBJECTS and SHOW_CARRIED.
Works up the screen a row at a time, as SHOW_BUFFER does, for the areas RENDER_DYNAMIC_OBJECTS wiped and for the carried things on the panel (SHOW_CARRIED). The same as Knight Lore's.
Input
HL the buffer address of its bottom-left byte
DE the display address of the same byte
B the height in rows
C the width in bytes
BLIT_TO_SCREEN B278 PUSH BC One row: B is cleared so that LDIR copies C bytes
B279 PUSH DE
B27A PUSH HL
B27B LD B,$00
B27D LDIR
B27F POP HL The buffer row above is 32 bytes on
B280 LD DE,$0020
B283 ADD HL,DE
B284 POP DE Up a display line, unless that crossed a character row
B285 DEC D
B286 LD A,D
B287 CPL
B288 AND $07
B28A JR NZ,BLIT_TO_SCREEN_0
B28C LD A,E Crossing a character row: back 32 in E, and back into this third unless that borrowed
B28D SUB $20
B28F LD E,A
B290 JR C,BLIT_TO_SCREEN_0
B292 LD A,D
B293 ADD A,$08
B295 LD D,A
BLIT_TO_SCREEN_0 B296 POP BC The next row
B297 DJNZ BLIT_TO_SCREEN
B299 RET
Prev: B19E Up: Map Next: B29A