Prev: 42803 Up: Map Next: 42916
42844: Draw Shifted Row In Buffer
Draws one row of a sprite that is not aligned to a byte into the buffer used by DrawSprites, using the shift table that B points to. Each byte of the sprite makes two bytes in the buffer. The entry point depends on the width of the sprite in bytes, from five bytes at DrawShiftedRowInBuffer to one byte at 42892.
Input
B High byte of the shift table
DE Address of the data of the sprite
HL Address in the buffer
DrawShiftedRowInBuffer 42844 LD A,(DE) Fetch a byte of the sprite.
42845 LD C,A Use it to look up the left part in the shift table.
42846 LD A,(BC) Fetch the left part.
42847 OR (HL) Set the pixels of the buffer.
42848 LD (HL),A Store the byte.
42849 INC B Move to the table of right parts.
42850 INC L Move on to the next byte of the buffer.
42851 LD A,(BC) Fetch the right part.
42852 OR (HL) Set the pixels of the buffer.
42853 LD (HL),A Store the byte.
42854 DEC B Move back to the table of left parts.
42855 INC DE Move on to the next byte of the sprite.
42856 LD A,(DE) Fetch a byte of the sprite.
42857 LD C,A Use it to look up the left part in the shift table.
42858 LD A,(BC) Fetch the left part.
42859 OR (HL) Set the pixels of the buffer.
42860 LD (HL),A Store the byte.
42861 INC B Move to the table of right parts.
42862 INC L Move on to the next byte of the buffer.
42863 LD A,(BC) Fetch the right part.
42864 OR (HL) Set the pixels of the buffer.
42865 LD (HL),A Store the byte.
42866 DEC B Move back to the table of left parts.
42867 INC DE Move on to the next byte of the sprite.
42868 LD A,(DE) Fetch a byte of the sprite.
42869 LD C,A Use it to look up the left part in the shift table.
42870 LD A,(BC) Fetch the left part.
42871 OR (HL) Set the pixels of the buffer.
42872 LD (HL),A Store the byte.
42873 INC B Move to the table of right parts.
42874 INC L Move on to the next byte of the buffer.
42875 LD A,(BC) Fetch the right part.
42876 OR (HL) Set the pixels of the buffer.
42877 LD (HL),A Store the byte.
42878 DEC B Move back to the table of left parts.
42879 INC DE Move on to the next byte of the sprite.
42880 LD A,(DE) Fetch a byte of the sprite.
42881 LD C,A Use it to look up the left part in the shift table.
42882 LD A,(BC) Fetch the left part.
42883 OR (HL) Set the pixels of the buffer.
42884 LD (HL),A Store the byte.
42885 INC B Move to the table of right parts.
42886 INC L Move on to the next byte of the buffer.
42887 LD A,(BC) Fetch the right part.
42888 OR (HL) Set the pixels of the buffer.
42889 LD (HL),A Store the byte.
42890 DEC B Move back to the table of left parts.
42891 INC DE Move on to the next byte of the sprite.
42892 LD A,(DE) Fetch a byte of the sprite.
42893 LD C,A Use it to look up the left part in the shift table.
42894 LD A,(BC) Fetch the left part.
42895 OR (HL) Set the pixels of the buffer.
42896 LD (HL),A Store the byte.
42897 INC B Move to the table of right parts.
42898 INC L Move on to the next byte of the buffer.
42899 LD A,(BC) Fetch the right part.
42900 OR (HL) Set the pixels of the buffer.
42901 LD (HL),A Store the byte.
42902 DEC B Move back to the table of left parts.
42903 INC DE Move on to the next byte of the sprite.
42904 LD A,0 Fetch the amount to skip, which was set at 42120.
42906 ADD A,L Add it to the address in the buffer.
42907 LD L,A Store it in L.
42908 EX AF,AF' Switch to the count of rows.
42909 DEC A Take one off.
42910 JP Z,DrawSprites_Dissolve Jump to DrawSprites_Dissolve to finish when there are none left.
42913 EX AF,AF' Switch back.
42914 JP (IX) Draw the next row.
Prev: 42803 Up: Map Next: 42916