Prev: 42916 Up: Map Next: 43010
42966: Draw Mirrored Row Directly
Draws one row of a sprite that is flipped from left to right on the screen. Each byte of the sprite has its bits reversed by the table that B points to, and the screen is filled from right to left. The entry point depends on the width of the sprite in bytes, from six bytes at DrawMirroredRowDirectly to one byte at DrawMirroredRowDirectly_Sixth.
Input
B High byte of the table that reverses bits
DE Address of the data of the sprite
HL Screen address of the right of the row
DrawMirroredRowDirectly 42966 LD A,(DE) Fetch a byte of the sprite.
42967 LD C,A Use it to look up the byte with the bits reversed.
42968 LD A,(BC) Fetch it.
42969 OR (HL) Set the pixels of the screen.
42970 LD (HL),A Store the byte.
42971 DEC L Move on to the next byte of the screen to the left.
42972 INC DE Move on to the next byte of the sprite.
DrawMirroredRowDirectly_Second 42973 LD A,(DE) Fetch a byte of the sprite.
42974 LD C,A Use it to look up the byte with the bits reversed.
42975 LD A,(BC) Fetch it.
42976 OR (HL) Set the pixels of the screen.
42977 LD (HL),A Store the byte.
42978 DEC L Move on to the next byte of the screen to the left.
42979 INC DE Move on to the next byte of the sprite.
DrawMirroredRowDirectly_Third 42980 LD A,(DE) Fetch a byte of the sprite.
42981 LD C,A Use it to look up the byte with the bits reversed.
42982 LD A,(BC) Fetch it.
42983 OR (HL) Set the pixels of the screen.
42984 LD (HL),A Store the byte.
42985 DEC L Move on to the next byte of the screen to the left.
42986 INC DE Move on to the next byte of the sprite.
DrawMirroredRowDirectly_Fourth 42987 LD A,(DE) Fetch a byte of the sprite.
42988 LD C,A Use it to look up the byte with the bits reversed.
42989 LD A,(BC) Fetch it.
42990 OR (HL) Set the pixels of the screen.
42991 LD (HL),A Store the byte.
42992 DEC L Move on to the next byte of the screen to the left.
42993 INC DE Move on to the next byte of the sprite.
DrawMirroredRowDirectly_Fifth 42994 LD A,(DE) Fetch a byte of the sprite.
42995 LD C,A Use it to look up the byte with the bits reversed.
42996 LD A,(BC) Fetch it.
42997 OR (HL) Set the pixels of the screen.
42998 LD (HL),A Store the byte.
42999 DEC L Move on to the next byte of the screen to the left.
43000 INC DE Move on to the next byte of the sprite.
DrawMirroredRowDirectly_Sixth 43001 LD A,(DE) Fetch a byte of the sprite.
43002 LD C,A Use it to look up the byte with the bits reversed.
43003 LD A,(BC) Fetch it.
43004 OR (HL) Set the pixels of the screen.
43005 LD (HL),A Store the byte.
43006 INC DE Move on to the next byte of the sprite.
43007 JP DrawAlignedRowDirectly_Next Jump to DrawAlignedRowDirectly_Next.
Prev: 42916 Up: Map Next: 43010