Prev: 58575 Up: Map Next: 58667
58609: Draw Mirrored Three Byte Rows
Draws a piece of terrain that is three bytes wide in the same way as DrawThreeByteRows, but passes every byte through the table of reversed bytes at 63744 so that the piece is drawn back to front. The entry points at DrawMirroredThreeByteRows and DrawMirroredThreeByteRows_Two first move to the left by three columns and two columns.
Input
A Number of pairs of pixel rows to draw
HL Screen address of the bottom left of the piece
SP Address of the picture
DrawMirroredThreeByteRows 58609 DEC L Step L back.
DrawMirroredThreeByteRows_Two 58610 DEC L Step L back.
58611 DEC L Step L back.
DrawMirroredThreeByteRows_Start 58612 LD B,249 B=249.
58614 EXX Switch to the alternate registers.
58615 LD B,A B=A.
DrawMirroredThreeByteRows_Loop 58616 EXX Switch to the alternate registers.
58617 POP DE Bring DE back off the stack.
58618 LD C,E C=E.
58619 LD A,(BC) Read BC.
58620 LD (HL),A Write A where HL points.
58621 INC L Advance L.
58622 LD C,D C=D.
58623 LD A,(BC) Read BC.
58624 LD (HL),A Write A where HL points.
58625 INC L Advance L.
58626 POP DE Bring DE back off the stack.
58627 LD C,E C=E.
58628 LD A,(BC) Read BC.
58629 LD (HL),A Write A where HL points.
58630 DEC H Step H back.
58631 LD C,D C=D.
58632 LD A,(BC) Read BC.
58633 LD (HL),A Write A where HL points.
58634 DEC L Step L back.
58635 POP DE Bring DE back off the stack.
58636 LD C,E C=E.
58637 LD A,(BC) Read BC.
58638 LD (HL),A Write A where HL points.
58639 DEC L Step L back.
58640 LD C,D C=D.
58641 LD A,(BC) Read BC.
58642 LD (HL),A Write A where HL points.
58643 DEC H Step H back.
58644 LD A,H A=H.
58645 INC A Advance A.
58646 AND %00000111 Keep the bits of A that are set in 7.
58648 JR NZ,DrawMirroredThreeByteRows_Next Jump to DrawMirroredThreeByteRows_Next if the zero flag is clear.
58650 LD A,L A=L.
58651 SUB 32 Subtract 32 from A.
58653 LD L,A L=A.
58654 JR C,DrawMirroredThreeByteRows_Next Jump to DrawMirroredThreeByteRows_Next if the carry flag is set.
58656 LD A,H A=H.
58657 ADD A,8 Add 8 to A.
58659 LD H,A H=A.
DrawMirroredThreeByteRows_Next 58660 EXX Switch to the alternate registers.
58661 DJNZ DrawMirroredThreeByteRows_Loop Decrease B and jump to DrawMirroredThreeByteRows_Loop until none remain.
58663 EXX Switch to the alternate registers.
58664 JP FinishStep Jump to FinishStep.
Prev: 58575 Up: Map Next: 58667