• Jeffrey Lee's avatar
    Fix OS_SpriteOp 41 (read pixel) for 4K colour sprites. Update ECF patterns to... · 7b6ae685
    Jeffrey Lee authored
    Fix OS_SpriteOp 41 (read pixel) for 4K colour sprites. Update ECF patterns to work sensibly in true colour modes.
    
    Detail:
      s/vdu/vdugrafg - Change SetupSprModeData to calculate SprReadNColour from log2bpp instead of the NColour mode variable - fixes the alpha component being lost when using OS_SpriteOp 41 to read from 4K colour sprites with alpha channels
      s/vdu/vdudriver - Change SetCol30 to generate more sensible ECF colour blocks when in true colour modes. Previously it would treat each byte of the 8 byte ECF pattern as a separate row, and replicate the byte 4 times to produce one colour word per row. However this isn't so great for true colour modes, especially if you have an alpha channel which needs specific values. So to fix the issue, take inspiration from how Paint assumed the ECF patterns worked, and treat 16bpp modes as being a 1x4 pattern and 32bpp modes as being a 1x2 pattern
    Admin:
      Tested on BB-xM
      OS_SpriteOp 41 fix fixes Paint colour picker always returning 0 alpha when picking from 4K ARGB sprites
      ECF change fixes Paint's masked sprite background ECF pattern to display properly in true colour modes
    
    
    Version 5.35, 4.79.2.213. Tagged as 'Kernel-5_35-4_79_2_213'
    7b6ae685
vdudriver 94.9 KB