Prev: E991 Up: Map Next: EA3C
E9EF: Blit Display Buffer Row
Used by the routine at Blit_DisplayBuffer.
Blit one display-buffer tile to the screen. The graphic-set index selects a base from Table_GraphicSetAddresses; the tile index × 08 is added to that base Attribute bit 07 selects the mirrored blit at Blit_DisplayBufferRowLoop (via BitmapMirrorLookup).
Write the attribute and resolve the graphic-set tile address.
Blit_DisplayBufferRow E9EF SET 6,A Force bright on the attribute in A and write it through IX.
E9F1 LD (IX+$00),A
E9F4 LD L,B Keep the tile index in HL (high byte cleared).
E9F5 XOR A
E9F6 LD B,A
E9F7 LD H,A
E9F8 ADD A,C Double the graphic-set index into BC as a word offset.
E9F9 ADD A,C
E9FA LD C,A
E9FB PUSH HL
E9FC LD HL,$730B Point HL at Table_GraphicSetAddresses, add the set offset, and fetch the set base into BC.
E9FF ADD HL,BC
EA00 LD C,(HL)
EA01 INC HL
EA02 LD B,(HL)
EA03 POP HL Restore the tile index, multiply it by 08, and add the set base to get the bitmap address.
EA04 ADD HL,HL
EA05 ADD HL,HL
EA06 ADD HL,HL
EA07 ADD HL,BC
EA08 EX DE,HL Keep the bitmap address in DE.
Convert the attribute address into a screen-bitmap address and blit.
EA09 PUSH IX Copy IX to HL (using the stack).
EA0B POP HL
EA0C LD A,H Multiply the attribute high byte by 08.
EA0D ADD A,A
EA0E ADD A,A
EA0F ADD A,A
EA10 AND %01011011 Keep only the screen-bitmap high bits (mask 5B).
EA12 LD H,A Write the result to H and move the address into DE.
EA13 EX DE,HL
EA14 BIT 7,(IX+$00) Is the mirror bit (bit 07) set on the attribute? If so, blit the mirrored tile at Blit_DisplayBufferRowLoop.
EA18 JR NZ,Blit_DisplayBufferRowLoop
EA1A LD B,$08 There are 08 pixel rows in a tile.
Copy 08 pixel rows of an unmirrored tile into the screen bitmap.
Blit_DisplayBufferRow_CopyRows EA1C LD A,(HL) Copy one bitmap row to the screen and step to the next pixel row.
EA1D LD (DE),A
EA1E INC D
EA1F INC HL
EA20 DJNZ Blit_DisplayBufferRow_CopyRows
EA22 RET Return.
Blit the tile with horizontal mirroring via BitmapMirrorLookup.
Blit_DisplayBufferRowLoop EA23 RES 7,(IX+$00) Clear the mirror bit on the attribute at IX.
EA27 LD B,$08 There are 08 pixel rows in a tile.
Copy 08 pixel rows with horizontal mirroring via BitmapMirrorLookup.
Blit_DisplayBufferRowLoopB EA29 PUSH BC Fetch a bitmap byte, reverse it through BitmapMirrorLookup, write it to the screen, and step to the next pixel row.
EA2A LD A,(HL)
EA2B PUSH HL
EA2C LD HL,$7319
EA2F LD C,A
EA30 LD B,$00
EA32 ADD HL,BC
EA33 LD A,(HL)
EA34 POP HL
EA35 LD (DE),A
EA36 INC D
EA37 INC HL
EA38 POP BC
EA39 DJNZ Blit_DisplayBufferRowLoopB
EA3B RET Return.
Prev: E991 Up: Map Next: EA3C