22 Commits

Author SHA1 Message Date
Miro Kropacek 9bd91b4131 BACKENDS: ATARI: Remove atari_debug 2026-04-20 01:47:37 +02:00
Miro Kropacek eb64b14b81 BACKENDS: ATARI: Implement proper cursor clipping
Previous implementation had to create a new surface every time srcRect
has been changed and as a bonus, it would (harmlessly but still) do a
read-modify-write past the screen buffer.
2025-06-25 23:50:35 +02:00
Miro Kropacek 3f47c7a8ce BACKENDS: ATARI: Let Cursor access only AtariSurface instead of Screen 2025-06-25 23:50:35 +02:00
Miro Kropacek e575d1360e BACKENDS: ATARI: Make purpose of _xOffset more explicit
This also cleans up Screen::reset() a bit.

Get rid of the reset cursor flag, it's not that useful in the overlay.
2025-06-25 23:50:35 +02:00
Miro Kropacek f27f045aac BACKENDS: ATARI: Remove references to AtariGraphicsManager from Screen and Cursor 2025-06-25 23:50:35 +02:00
Miro Kropacek ee437e2a42 BACKENDS: ATARI: Move alignRect from AtariGraphicsManager to AtariSurface
And make it static.
2025-06-25 23:50:35 +02:00
Miro Kropacek 0520570a7b BACKENDS: ATARI: Move getBitsPerPixel from AtariGraphicsManager to AtariSurface 2025-06-25 23:50:35 +02:00
Miro Kropacek 3dd96ec7c5 BACKENDS: ATARI: Use hardware-accelerated cursor blitting 2025-06-25 23:50:34 +02:00
Miro Kropacek b3074272da BACKENDS: ATARI: Separate SuperVidel code
- Introduce AtariSurface: a surface which represents either a
  bitplane-based or pixel-based surface (on SuperVidel, as an inherited
  SuperVidelSurface). Screen::surf / Screen::offsettedSurf are its
  instances.

- Graphics::Surface::create / free now handle all Atari-related surfaces
  via dlmalloc: ST RAM (TT/Falcon), VRAM (SuperVidel - 0xA0xxxxxx) and
  VRAM for generic surfaces (SuperBlitter - 0xA1xxxxxx or ST/TT RAM).
  This allowed me to remove all the hacky stuff from atari-graphics and
  atari-superblitter.h.

- blit-atari.cpp now contains only blitting code
  (SuperBlitter/move16/fallback), SV code is in
  atari-supervidel.{cpp,h}.

- Take advantage of Common::ScopedPtr and Graphics::ManagedSurface's
  dispose flag for Screen::surf as well Graphics::ManagedSurface's
  ownership for Screen::offsettedSurf.

- Improve recoverability if an error/assert happens in
  AtariGraphicsManager's c-tor/d-tor.
2025-06-25 23:50:34 +02:00
Miro Kropacek d452beff82 BACKENDS: ATARI: Remove g_unalignedPitch workaround
It causes more harm than good and I don't think it helps with
performance that much either. Its only semi-valid use case was C2P
direct rendering for sprites (which nobody uses). However, direct
rendering in its current form is about to be removed in a near future,
so...
2025-06-25 23:50:34 +02:00
Miro Kropacek 232c85bce3 BACKENDS: ATARI: Small optimisation
Regression from 56805366. Now the cursor surface is not recalculated if
it is clipped vertically.
2025-05-07 17:53:54 +02:00
Miro Kropacek 5680536655 BACKENDS: ATARI: Additional fixes for cursor background
- leftovers after highlighted dirty rectangle

- not updating _surface if moving to fast left/right from screen borders
  (_width == _srcRect.width())

- not drawing cursor if repeatedly intersecting with a refreshing dirty
  rect

- leftover rectangle when leaving game overlay to the launcher

- massive simplification
2025-04-20 21:33:15 +02:00
Miro Kropacek 4afb49840e BACKENDS: ATARI: Initialize overlay cursor properly
showOverlay() and therefore _screen[kOverlayBuffer]->reset() isn't
called explicitly on init.
2025-04-20 21:33:15 +02:00
Miro Kropacek 3eb17e58e3 BACKENDS: ATARI: Don't attempt direct rendering with unsupported engines
If sprites with implicit pitch % 16 == 0 are corrupted in single/triple
buffering, it doesn't make sense to try them unaligned in direct
rendering.
2025-04-20 21:33:15 +02:00
Miro Kropacek 564c503c3d BACKENDS: ATARI: Allow width non-divisible by 16 if not direct rendering
This fixes Phantasmagoria demo which uses 630x450.
2025-04-20 21:33:15 +02:00
Miro Kropacek 3ab84a2cf9 BACKENDS: ATARI: Fix incorrectly restored cursor background 2025-04-20 21:33:15 +02:00
Miro Kropacek 6a919c04ab BACKENDS: ATARI: Cleanup usage of bitsPerPixel 2025-04-20 21:33:15 +02:00
Miro Kropacek 10665fb723 BACKENDS: ATARI: Use DISABLE_TEXT_CONSOLE for release builds
This shaves off a good 800 KB from all the engines. However, do keep
local atari debug messages for diagnostic purposes.

Also, use natfeats for debug output when possible else the classic
stdout/stderr (not both as before).
2024-11-21 11:31:25 +01:00
Miro Kropacek 8bbc31aa6d BACKENDS: ATARI: Bugfixes
- optimize fillScreen(): Eco Quest calls it way too often with 1x1 rects

- don't disable Cursor::isChanged() flags on !isVisible(), that leads to
  skipping of _surface creation in some cases

- handle properly any number of parameters between beginGFXTransaction
  and endGFXTransaction

- clear the work buffer when exiting a game to avoid showing it when
  next game shows an error upon startup
2024-11-13 21:41:01 +01:00
Miro Kropacek 16dcfb7a69 BACKENDS: ATARI: Fix _checkUnalignedPitch
It wasn't set / checked properly after the refactor.
2024-11-13 21:41:01 +01:00
Miro Kropacek 0c77d67845 BACKENDS: ATARI: Make Cursor Screen's property
Instead of having one globally in AtariGraphicsManager. This simplifies
code and cleans up a lot of dark corners in AtariGraphicsManager.

A slight disadvantage is that now the cursor surface has be to converted
for each buffer.
2024-07-15 19:42:51 +02:00
Miro Kropacek 957aa15e7e BACKENDS: ATARI: Move Cursor outside AtariGraphicsManager 2024-07-15 19:42:51 +02:00