Plot sprite
Chris Hall (132) 3558 posts |
I have some 64×32 sprites, some defined in C16 (‘1’ and ‘2’) and some in C256 (‘3’ and ‘4’). If I plot them in C16 (mode 27), then the C256 sprites are plotted double width whereas if I plot them in C256 then the C16 sprites are plotted half width. See image
Is this expected behaviour please (I know the colours look odd but that is a longer story and they are actually what I am expecting)? |
Jeffrey Lee (213) 6048 posts |
Yes, that’s expected behaviour. PLOT/OS_Plot uses OS_SpriteOp 28 (or 48 for mask plotting). These are “dumb” plot routines which don’t do any colour translation or pixel format conversion – they basically just copy bytes from the sprite/mask directly to the screen (while applying the GCOL action). So a 64 pixel wide 8bpp sprite will appear 64*8/4 = 128 pixels wide in a 4bpp mode, and a 64 pixel wide 4bpp sprite will appear 64*4/8 = 32 pixels wide in an 8bpp mode. If you want to plot sprites where the palette is important, or where the colour depth/pixel format differs, you’ll have to switch to using OS_SpriteOp 52, with whatever translation table ColourTrans generates for you. |
Chris Hall (132) 3558 posts |
Many thanks. |