Prev: 42844 Up: Map Next: 42966
42916: Erase Mirrored Row Directly
Erases one row of a sprite that is flipped from left to right from 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 EraseMirroredRowDirectly to one byte at EraseMirroredRowDirectly_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
EraseMirroredRowDirectly 42916 LD A,(DE) Fetch a byte of the sprite.
42917 LD C,A Use it to look up the byte with the bits reversed.
42918 LD A,(BC) Fetch it.
42919 CPL Invert it.
42920 AND (HL) Clear the pixels of the screen.
42921 LD (HL),A Store the byte.
42922 DEC L Move on to the next byte of the screen to the left.
42923 INC DE Move on to the next byte of the sprite.
EraseMirroredRowDirectly_Second 42924 LD A,(DE) Fetch a byte of the sprite.
42925 LD C,A Use it to look up the byte with the bits reversed.
42926 LD A,(BC) Fetch it.
42927 CPL Invert it.
42928 AND (HL) Clear the pixels of the screen.
42929 LD (HL),A Store the byte.
42930 DEC L Move on to the next byte of the screen to the left.
42931 INC DE Move on to the next byte of the sprite.
EraseMirroredRowDirectly_Third 42932 LD A,(DE) Fetch a byte of the sprite.
42933 LD C,A Use it to look up the byte with the bits reversed.
42934 LD A,(BC) Fetch it.
42935 CPL Invert it.
42936 AND (HL) Clear the pixels of the screen.
42937 LD (HL),A Store the byte.
42938 DEC L Move on to the next byte of the screen to the left.
42939 INC DE Move on to the next byte of the sprite.
EraseMirroredRowDirectly_Fourth 42940 LD A,(DE) Fetch a byte of the sprite.
42941 LD C,A Use it to look up the byte with the bits reversed.
42942 LD A,(BC) Fetch it.
42943 CPL Invert it.
42944 AND (HL) Clear the pixels of the screen.
42945 LD (HL),A Store the byte.
42946 DEC L Move on to the next byte of the screen to the left.
42947 INC DE Move on to the next byte of the sprite.
EraseMirroredRowDirectly_Fifth 42948 LD A,(DE) Fetch a byte of the sprite.
42949 LD C,A Use it to look up the byte with the bits reversed.
42950 LD A,(BC) Fetch it.
42951 CPL Invert it.
42952 AND (HL) Clear the pixels of the screen.
42953 LD (HL),A Store the byte.
42954 DEC L Move on to the next byte of the screen to the left.
42955 INC DE Move on to the next byte of the sprite.
EraseMirroredRowDirectly_Sixth 42956 LD A,(DE) Fetch a byte of the sprite.
42957 LD C,A Use it to look up the byte with the bits reversed.
42958 LD A,(BC) Fetch it.
42959 CPL Invert it.
42960 AND (HL) Clear the pixels of the screen.
42961 LD (HL),A Store the byte.
42962 INC DE Move on to the next byte of the sprite.
42963 JP EraseAlignedRowDirectly_Next Jump to EraseAlignedRowDirectly_Next.
Prev: 42844 Up: Map Next: 42966