Prev: 58667 Up: Map Next: 58753
58715: 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 63744. 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 58715 DEC L Step L back.
DrawMirroredOneByteRows_Start 58716 LD B,249 B=249.
58718 EXX Switch to the alternate registers.
58719 LD B,A B=A.
DrawMirroredOneByteRows_Loop 58720 EXX Switch to the alternate registers.
58721 POP DE Bring DE back off the stack.
58722 LD C,E C=E.
58723 LD A,(BC) Read BC.
58724 LD (HL),A Write A where HL points.
58725 DEC H Step H back.
58726 LD C,D C=D.
58727 LD A,(BC) Read BC.
58728 LD (HL),A Write A where HL points.
58729 DEC H Step H back.
58730 LD A,H A=H.
58731 INC A Advance A.
58732 AND %00000111 Keep the bits of A that are set in 7.
58734 JR NZ,DrawMirroredOneByteRows_Next Jump to DrawMirroredOneByteRows_Next if the zero flag is clear.
58736 LD A,L A=L.
58737 SUB 32 Subtract 32 from A.
58739 LD L,A L=A.
58740 JR C,DrawMirroredOneByteRows_Next Jump to DrawMirroredOneByteRows_Next if the carry flag is set.
58742 LD A,H A=H.
58743 ADD A,8 Add 8 to A.
58745 LD H,A H=A.
DrawMirroredOneByteRows_Next 58746 EXX Switch to the alternate registers.
58747 DJNZ DrawMirroredOneByteRows_Loop Decrease B and jump to DrawMirroredOneByteRows_Loop until none remain.
58749 EXX Switch to the alternate registers.
58750 JP FinishStep Jump to FinishStep.
Prev: 58667 Up: Map Next: 58753