Prev: E52B Up: Map Next: E581
E55B: Draw Mirrored One Byte Rows
Draws a piece of terrain that is one byte wide in the same way as DrawOneByteRows, but passes every byte through the table of reversed bytes at F900. The entry point at DrawMirroredOneByteRows moves one column to the left first.
Input
A Number of pairs of pixel rows to draw
HL Screen address of the bottom of the piece
SP Address of the picture
DrawMirroredOneByteRows E55B DEC L Step L back.
DrawMirroredOneByteRows_Start E55C LD B,$F9 B=F9.
E55E EXX Switch to the alternate registers.
E55F LD B,A B=A.
DrawMirroredOneByteRows_Loop E560 EXX Switch to the alternate registers.
E561 POP DE Bring DE back off the stack.
E562 LD C,E C=E.
E563 LD A,(BC) Read BC.
E564 LD (HL),A Write A where HL points.
E565 DEC H Step H back.
E566 LD C,D C=D.
E567 LD A,(BC) Read BC.
E568 LD (HL),A Write A where HL points.
E569 DEC H Step H back.
E56A LD A,H A=H.
E56B INC A Advance A.
E56C AND %00000111 Keep the bits of A that are set in 07.
E56E JR NZ,DrawMirroredOneByteRows_Next Jump to DrawMirroredOneByteRows_Next if the zero flag is clear.
E570 LD A,L A=L.
E571 SUB $20 Subtract 20 from A.
E573 LD L,A L=A.
E574 JR C,DrawMirroredOneByteRows_Next Jump to DrawMirroredOneByteRows_Next if the carry flag is set.
E576 LD A,H A=H.
E577 ADD A,$08 Add 08 to A.
E579 LD H,A H=A.
DrawMirroredOneByteRows_Next E57A EXX Switch to the alternate registers.
E57B DJNZ DrawMirroredOneByteRows_Loop Decrease B and jump to DrawMirroredOneByteRows_Loop until none remain.
E57D EXX Switch to the alternate registers.
E57E JP FinishStep Jump to FinishStep.
Prev: E52B Up: Map Next: E581