Prev: 31232 Up: Map Next: 31417
31369: DrawSpriteRow
Draws one 8-pixel-tall column of a sprite tile onto the screen. Reads a tile index byte from (DE), multiplies by 8 to get an offset into the 8-byte-per-row character bitmap table at $6935 ($26869 + index×8), then writes all 8 bytes vertically downward from the current draw pointer at 31241 (INC H steps through ZX Spectrum display rows within the same character cell column).
Input
(DE) = tile/character index; (31257) = screen destination address
Output
screen updated; DE advanced; H incremented 8 times
Used by the routines at 31634, 37018, 38379, 42581 and 44313.
31369 LD A,(DE) read tile index from source pointer
This entry point is used by the routines at 31634, 37018 and 38379.
31370 LD L,A L = tile index
31371 LD H,0
31373 ADD HL,HL HL = index × 2
31374 ADD HL,HL HL = index × 4
31375 ADD HL,HL HL = index × 8
31376 LD BC,26869 BC = $6935 (character bitmap base)
31379 ADD HL,BC HL = address of first row of tile bitmap
31380 EX DE,HL DE = bitmap source; HL = old DE (tile index ptr)
31381 LD HL,(31257) HL = screen destination (DrawScreenPtr)
31384 LD B,8 8 pixel rows per character
31386 LD A,(DE) read bitmap byte for this pixel row
31387 LD (HL),A write to display file
31388 INC H next display row (INC H steps within 8-row band)
31389 INC DE next bitmap byte
31390 DJNZ 31386 repeat for all 8 rows
31392 RET
This entry point is used by the routine at 35016.
31393 LD A,H
31394 AND 7
31396 CP 7
31398 JR Z,31402
31400 INC H
31401 RET
31402 LD A,L
31403 CP 224
31405 JR NC,31412
31407 LD DE,63776
31410 ADD HL,DE
31411 RET
31412 LD DE,32
31415 ADD HL,DE
31416 RET
Prev: 31232 Up: Map Next: 31417