• Jeffrey Lee's avatar
    Fix bad pointer dereference and other issues with *ScreenLoad · 0617a359
    Jeffrey Lee authored
    Detail:
      s/vdu/vdugrafj - Rewrite WritePaletteFromSprite to fix some issues with the logic which decides whether to change screen mode:
      - ModeNo was always being treated as if it was a mode selector block, causing bad pointer dereferences if it was actually a numbered mode. Prior to zero page protection the code would have eventually stumbled its way through to the mode change code.
      - For checking the pixel format, only the Log2BPP was being compared, resulting in code deciding that (e.g.) modes with differing RGB order were the same
      - However the eigen value checking was also broken (checking wrong part of generated mode selector block), causing the mode change logic to always be taken
      s/vdu/vdugrafdec - Increase size of SloadModeSel so it's actually large enough to hold the generated mode selector - old code would have run off the end a bit (thankfully, it was the last thing in that particular workspace block)
    Admin:
      Tested on BB-xM, *ScreenLoad'ing sprites from various modes
      Fixes issue reported on forums:
      https://www.riscosopen.org/forum/forums/4/topics/3649
    
    
    Version 5.35, 4.79.2.294. Tagged as 'Kernel-5_35-4_79_2_294'
    0617a359
VersionASM 1.02 KB