RichardBrown384 / Eichhoernchen

Acorn Archimedes A3000 Emulator in C++23
https://github.com/RichardBrown384/archimedes
MIT License
14 stars 0 forks source link

[BUG] VIDC doesn't render image correctly when display area is partially outside the border area #33

Open RichardBrown384 opened 1 month ago

RichardBrown384 commented 1 month ago

Checklist

Describe the bug One of the core assumptions we made about the VIDC is that the display area is wholly contained with the border area.

It appears that some titles don't respect this assumption and have the some of the display area lying outside of the border area.

This causes visual issues with the affected titles. Primarily a skewed picture since we're not fetching enough pixels per line since we're ignoring those display pixels outside the border area.

To Reproduce N/A

Expected behaviour The picture should be drawn correctly with no skew.

Please complete the following information

Additional context As far as I know the VTI manuals don't describe what should happen when the display area is partially outside the border area. We should probably reconsult the manual and find more documentation for the VIDC.

Sarah Walker's reply here sheds light on the matter.

  1. Inside the display region the VIDC will fetch and shift data (even outside the border area).
  2. However, blanking is active unless the display and border are active.
  3. When blanking is active, black is sent to the display.

Example VIDC state:

horizontalCyclePixels= {uint32_t} 512 [0x200]
horizontalSyncWidthPixels = {uint32_t} 38 [0x26]
horizontalBorderStartPixels = {uint32_t} 135 [0x87]
horizontalDisplayStartPixels = {uint32_t} 133 [0x85]
horizontalDisplayStart = {uint32_t} 2349842432 [0x8C0FC000]
horizontalDisplayEndPixels = {uint32_t} 453 [0x1c5]
horizontalDisplayEnd = {uint32_t} 2419572736 [0x9037C000]
horizontalBorderEndPixels = {uint32_t} 503 [0x187]
horizontalCursorStartPixels = {uint32_t} 294 [0x126]
horizontalInterlace = {uint32_t} 128 [0x80]