VRAM access timing

From MSX Game Library

Revision as of 13:19, 24 April 2023 by Aoineko (talk | contribs)

As MSXGL intends to offer the best possible performance to MSX game creators, special attention has been paid to ensure the highest possible speed when accessing the VRAM. But, MSX hardware is so made that it is sometimes possible (depending on the context) to write or read too quickly in the VDP memory and thus to create data corruptions. To create the VDP module we based our VRAM access times on the information available on the net and in particular on the MSX Assembly Page (from MRC user Grauw) and its articles which are references in this field:

The last article gives a table of possible access times for each screen mode for each VDP generation. Thus, the VDP module of MSXgl automatically adjusts its access times to the screen modes chosen in the library configuration (msxgl_config.h) to allow the best possible access times while ensuring the proper functioning of the application.

The problem is that in some situations, we could observe data corruption in a context where the access times were respected. A tool was then created to verify these theoretical access times with concrete cases. This tool is called VATT (for VRAM Access Time Tester).

The results of these tests showed that the reference data had some limitations. Notably a wrong access time for Screen Mode 3 on MSX1 (TMS9918) or an unexpected effect with screen disabling for non-bitmap modes on MSX2 (V9938/58).