#16410·SDL

RISC OS: mouse position wrong in modes that aren't 2 OS units per pixel, and off by one at the bottom

Author: adyoullCreated Sep 29, 2026Updated Sep 29, 2026

In modes with EX0 EY0 (one OS unit per pixel), the position SDL reports is half what it should be. These "180 dpi" modes are quite common on the Pi at 1920x1080. It looks as though the position is always converted as if the mode were EX1 EY1. The effect is that SDL only sees the pointer in the top left quarter of the screen.

The Y value also seems to be one out. At the very bottom of the screen, y comes back as the screen height rather than height-1.

To reproduce

  1. Switch to a mode with EX0 EY0, e.g. *WimpMode X1920 Y1080 C16M EX0 EY0.
  2. Run a full screen SDL program that prints the x/y of SDL_MOUSEMOTION events.
  3. Move the pointer to the bottom right corner. I get roughly 960,540 instead of 1919,1079.
  4. In a normal EX1 EY1 mode, move the pointer to the bottom edge. y is reported as the screen height (e.g. 1080).