44 Commits

Author SHA1 Message Date
Miro Kropacek b5434d3922 BACKENDS: ATARI: Add MetaDOS audiocd support 2026-05-17 18:42:04 +10:00
Miro Kropacek 0d01736e29 BACKENDS: ATARI: Disable autosave by default 2026-05-01 22:02:29 +10:00
Miro Kropacek 83ebddc748 BACKENDS: ATARI: Implement plugins 2026-04-27 02:05:36 +10:00
Miro Kropacek 9bd91b4131 BACKENDS: ATARI: Remove atari_debug 2026-04-20 01:47:37 +02:00
Miro Kropacek ff0a7629c2 BACKENDS: ATARI: Use null OPL driver on lite builds
This reverts / extends commit 24a8a820.
2026-04-10 13:53:46 +10:00
Miro Kropacek 6819bf1ee0 BACKENDS: ATARI: quit() should actually quit the application 2026-04-01 22:31:52 +10:00
Miro Kropacek 87591749e3 BACKENDS: ATARI: Always store audio params in app domain
Otherwise when a game is started via command line, output_rate etc is
stored into that game's domain.

Also fix time printing in debug outputs so it doesn't restart after
backend init.
2026-03-25 14:04:58 +10:00
Miro Kropacek 24a8a820ea BACKENDS: ATARI: Use "null" instead of "stmidi" as Lite default
When a game uses OPL and ST MIDI is selected, it automatically switches
to an OPL driver (which is prohibitively expensive for the 68030).
"null" disables the OPL and the user is free to select ST MIDI for any
game which supports it.
2026-03-21 01:48:28 +10:00
Le Philousophe 5c73d55985 COMMON: Move file search in current working directory to backends
The current working directory doesnt always exist on the platforms.
Some platform are then exempted from searching in it.
2026-02-11 21:10:51 +02:00
Miro Kropacek ebfad4d8ec BACKENDS: ATARI: No need for #ifdef(ATARI)
Those files are explicitely listed in module.mk for the given platform.
2025-12-21 23:37:59 +10: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 Kropáček df6a43d233 BACKENDS: ATARI: Introduce AtariFilesystemNode
Currently it only uses available OS/2 code for presenting disk drives in a nicer (and unified) way.
2025-05-23 18:39:08 +03:00
Miro Kropacek 0136d2d2c9 BACKENDS: ATARI: Workaround for dgds engine 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 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 cca60feaca BACKENDS: ATARI: Fix isOverlayDirectRendering()
When leaving the overlay, ConfMan.getActiveDomain() is already set. Use
OSystem::engineInit and OSystem::engineDone in your favour.
2025-04-20 21:33:15 +02:00
Miro Kropacek e53fc61ceb BACKENDS: ATARI: Move g_unalignedPitch check into OSystem::engineInit() 2025-04-20 21:33:15 +02:00
Miro Kropacek a4ed12b04d BACKENDS: ATARI: Cleanup overlay code
Pretending that the manager starts in the overlay mode was really
confusing.

Also, the concept of _workScreen seemed great in theory but lead to
various subtle errors which were very hard to debug (related to cursor
handling, resolution changing etc).
2024-12-30 18:37:55 +01: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
Thorsten Otto 4c98561eec BACKENDS: ATARI: Move timer interrupt to ossystem_atari.cpp 2024-07-15 19:42:51 +02:00
Miro Kropacek dd49c9e3ce BACKENDS: ATARI: QoL improvements
- fixed aspect ratio correction (overlay destroyed
  its state, keyboard shortcut didn't always work),
  as well as significantly sped it up on VGA and
  SuperVidel

- smoother transitions between video modes

- reduce the number of video mode changes

- fixed a few extreme cases when triple buffering
  could lose an update

- lighter ST RAM usage in the lite build

- removed hardware accessing init/deinit routines
2024-07-15 19:42:51 +02:00
Miro Kropacek 08bd51f38a BACKENDS: ATARI: Fix a buffer overflow
Apparently 1024 characters is not enough for everyone.
2024-07-15 19:42:50 +02:00
Miro Kropacek 01a2d2edab BACKENDS: ATARI: Call original keyboard/mouse routines
This helps to solve the issue when one pushes 'Return' immediately after
Hatari's start. This issue appeared after introducing the
interrupt-driven audio mixer.

Not sure whether this was a real bug but it's much cleaner
implementation now anyway.
2024-02-24 03:54:54 +01:00
Miro Kropacek 4e285bdd0b BACKENDS: ATARI: Fix build 2024-01-01 17:26:22 +01:00
Le Philousophe 01ebece807 COMMON: Make getDefaultConfigFileName return a Path instead of a String 2023-12-24 13:19:25 +01:00
Miro Kropacek 969e82fce7 BACKENDS: ATARI: Last minute changes (cosmetic) 2023-12-19 14:56:04 +01:00
Miro Kropacek 43eb596d40 BACKENDS: ATARI: Set ST-MIDI driver for all audio
Also, MT-32 and MIDI are set to "auto" so no need to change those, too.
2023-11-09 18:20:06 +01:00
Miro Kropacek f7d78ec70a BACKENDS: ATARI: Implement internal downsampling to 8-bit
So we don't rely on STFA's questionable algorithms and we can use
X-SOUND, too.
2023-11-09 18:20:06 +01:00
Miro Kropacek fb8528ac77 BACKENDS: ATARI: Various fixes
- composer unaligned pitch fix
- error() doesn't work while in OSystem_Atari c-tor
- when a crash occurs, restore at least the cursor
- fix a crash when "data" doesn't exist
2023-09-24 17:48:54 +02:00
Miro Kropacek 2ab9ba353a BACKENDS: ATARI: Remove the SCI hack
It was wrong (other engines are allowed to do infinite recursions?) and
Future Wars still isn't working properly at all times. I've decided to
remove it (i.e. Future Wars and Operation Stealth are not supported
anymore).

Small updates in readme.txt.
2023-08-12 17:38:49 +02:00
Miro Kropacek 87f1cd25be BACKENDS: ATARI: Don't initialize GEM before initBackend()
This caused unnecessary desktop redraw, clearing text output from the
console.
2023-08-12 17:38:49 +02:00
Miro Kropacek f8f22c6e85 BACKENDS: ATARI: Fix a stuck key repeat
Sometimes the new IKBD handler would take over before TOS got a message
about key release event, leading to an infinite key stuck sound.
2023-08-12 17:38:49 +02:00
Miro Kropacek c1354b8589 BACKENDS: ATARI: Fix crash when exit() is called
exit() can be handled at user level via atexit(), there's no need to use
the critical handler routine.

Removed GEM restore from the critical handler as this uncovered its
instability while being in the critical handler.
2023-08-12 17:38:49 +02:00
Miro Kropacek d9a5de0fe6 BACKEND: ATARI: Screen shaking and some fixes
- surface setup for optimized 4-bit C2P routine wasn't properly detected

- STFA pretends to support Falcon sampling frequencies on TT leading to
  suboptimal sample mixing

- delayMillis() should check also for other events (fixes Future Wars)
  but avoid doing it for SCI as its MIDI timer would call itself in a
  recursive loop

- SuperVidel doesn't need to use VsetScreen() in VBL anymore

- Wetlands, Teen Agent, Shivers and Private Eye need non-aligned
  surface  widths

- However Wetlands and Private Eye use setCursorPalette, see
  https://bugs.scummvm.org/ticket/14524

- Added warning for Phantasmagoria's 630x450, nothing can be done there
  as the game also requires non-aligned surfaces and at the same time
  the buffer has to be aligned on 16 bytes.

- BDF scaling disabled by default
2023-07-19 22:22:11 +02:00
Miro Kropacek 2ce02658ec BACKENDS: ATARI: DMA playback is not always active
E.g. in the overlay there's no need to steal cycles for playing empty
sample buffer.

Also make STMIDI default audio driver for the slim version.
2023-06-15 22:57:55 +02:00
Miro Kropacek 5537759c53 BACKENDS: ATARI: Rework
- Atari TT support
- all video and audio is now handled via XBIOS
- reworked IKBD handling using Kbdvbase vectors, esp. Kbdvec()
- video uses proper triple buffer
- arbitrary game screen size support
- many fixes and optimizations
2023-06-15 22:57:55 +02:00
Miro Kropacek 76d3706492 BACKENDS: ATARI: Add build scripts
- consolidate public #define's (just ATARI)
- cpu compiler flags are specified in the script
- allow explicit move16, SV and SV Blitter features enabled/disabled

Provide two build scripts:

1. "Fat" one targeted at 040/060 machines (possibly with SuperVidel)

This one is optimized for 68020-60 (so it's still possible to try
highres engines on 68030 machines).

2. "Slim" one targeted at 030 machines (Falcon030+DFB/CT2 or TT030)

This one is optimized for 68030 and stripped from even more features:
"fancy" (highres) themes, move16 & SuperVidel routines and most
importantly the highres engines.
2023-05-10 22:58:26 +02:00
Miro Kropacek a4e85dab01 BACKENDS: ATARI: Remove double buffering & vsync
ScummVM engines are not built for synchronous screen locking (i.e.
updateScreen() can't be really used for any sort of blocking updates
otherwise performance suffers).

Single buffering now means deliberate tearing as a speed optimization
and triple buffering provides a tearingless picture with slight overhead.
2023-04-08 20:27:43 +02:00
Miro Kropacek 64c864b5d3 BACKENDS: ATARI: Add "data" folder to search set
"make dist-generic" doesn't automatically look for files in "data"
folder. Commit be98f2a8 is somewhat related to this problem but only
for debugging purposes.

As relative "data" clashes with game's relative "data" (e.g. Full
Throttle demo), do the right thing and add it as absolute path.
2023-04-03 20:19:46 +02:00
Miro Kropacek 4e4aea1463 BACKENDS: ATARI: Don't call clock() and usleep()
Avoiding overhead when accessing system functions / variables.
2023-04-03 20:19:04 +02:00
Miro Kropacek 6c5e3dbfd5 BACKENDS: ATARI: Refactor 2023-03-25 21:45:50 +01:00
Miro Kropacek 896d7cf309 BACKENDS: ATARI: Use "saves" directory for savegames 2023-03-04 23:38:42 +01:00
Miro Kropacek 276cf354bf BACKENDS: ATARI: Separate AtariEventSource from OSystem_Atari 2023-03-04 23:38:42 +01:00