Commit graph

39 commits

Author SHA1 Message Date
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
b779b2038f JANITORIAL: ATARI: Unify enum names 2024-12-30 18:37:54 +01:00
Miro Kropacek
feef4e1bf1 BACKENDS: ATARI: Final screen resolution changes
- seamless resolution/palette switching (at least in theory, it still
  isn't artifact-free, no clue why)

- bugfixes (shake offset, some s_screenSurf corner cases)

- simplification the triple-buffering code
2024-11-21 11:31:25 +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
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
b39fa830e9 BACKENDS: ATARI: Optimize 4bpp C2P routine
The AND'ing is not needed, as the pixels are guaranteed to be in range
0 - 15.
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
Thorsten Otto
30670e0a46 BACKENDS: ATARI: Add support for -mfastcall 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
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
c7bc03d4f4 BACKENDS: ATARI: Move Screen outside AtariGraphicsManager 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
Miro Kropacek
e9c7c8e03c JANITORIAL: atari_c2p-asm -> atari-c2p-asm 2024-07-15 19:42:50 +02:00
Miro Kropacek
f41a678ba1 GRAPHICS: ATARI: Utilize dlmalloc
- every malloc is now aligned on 16 bytes

- no need for the hidden pointers

- ct60_vmalloc() is called only once, the rest is handled
  by dlmalloc (SV XBIOS' vmalloc is pretty fragile)
2024-02-24 03:54:54 +01:00
Miro Kropacek
276103b0aa BACKENDS: ATARI: Fix a crash
_offsettedSurf must have the original screen dimensions, similar as done in
AtariGraphicsManager::Screen::reset().

Strangely, this bug was reproducible only in MagiC and not in FreeMiNT+MP.
2024-01-28 21:59:13 +01:00
Le Philousophe
bfc61439fb COMMON: Make themepath a Path object 2023-12-24 13:19:25 +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
dcab5d3369 CONFIGURE: Add support for m68k-atari-mintelf
This is basically the same as m68k-atari-mint host os but with a
different compiler/file format.
2023-09-24 17:48:54 +02:00
Miro Kropacek
b510eff336 BACKENDS: ATARI: Implement aspect ratio correction 2023-09-24 17:48:54 +02:00
Miro Kropacek
46939cca9b BACKENDS: ATARI: Fix regression in unlockScreen() 2023-08-12 17:38:49 +02:00
Miro Kropacek
7e3b9cceec BACKENDS: ATARI: Direct rendering support
Similar to SuperVidel's but requires an additional C2P pass.

Also, a few optimizations added like cursor is being assumed to be in
a persistent memory so we don't copy it over. And it's using a mask
instead of key.

This graphics mode is not perfect though and works reliably only with
source surfaces allocated via Surface::init() otherwise wrong memory
location is being read.

Still, can gain quite a few CPU cycles, especially on 640x480 screens.
2023-08-12 17:38:49 +02:00
Cameron Cawley
d8cca29783 BACKENDS: Allow filling part of the screen with OSystem::fillScreen 2023-08-06 23:03:46 +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
d9eee7906a BACKENDS: ATARI: Use unordered_set for dirty rects
This allows efficient redraw of surfaces which don't change their
position too much.
2023-06-15 22:58:13 +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
62d3a3c16e BACKENDS: ATARI: work around engines with unaligned pitch
Too complex to investigate so don't align every 8-bit surface on a
16-byte boundary there.
2023-06-10 23:27:57 +02:00
Miro Kropacek
a6a5b8ab42 BACKENDS: ATARI: Handle themes in installation script
- "fat" version uses repacked (zip -0) archives; also separate "data"
  and "themes" folders
- "slim" version doesn't use any external themes (for speed reasons)
2023-05-11 00:03:44 +02:00
Miro Kropacek
aa8935e447 BACKENDS: ATARI: grabOverlay() uses accelerated blitting 2023-05-10 22:59:56 +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
1870433daf BACKENDS: ATARI: Refactor & optimize dirty rects
This was long overdue. From my observation dirty rects don't need much
care, usually game engines already prepare them in a good shape (no
overlapping).

Also the overhead of calling the rect version of C2P isn't as big as I
was fearing, 256 64x64 rectangles are blitted roughly as quickly
as blitting one 1 MB block.

Removal of the rects traversal significantly speeds up Eco Quest for
instance.
2023-04-08 20:27:44 +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
b2103898a7 GRAPHICS: ATARI: Optionally avoid surface pitch align
Some engines are too bound to linear surfaces in 8bpp that it is very
hard to repair them. So instead of polluting the engine with
Surface::init() & delete[] Surface::getPixels() just use this
workaround.

It is also useful as an early fix for newly found engines which may be
fixable later.
2023-04-07 15:54:28 +02:00
Miro Kropacek
611752e55f BACKENDS: ATARI: Update mouse even if not visible
Toonstruck, Discworld and others manage their own cursor and are
interested only in *mouse* position, not in *cursor* drawing. And
indeed, atari backend doesn't go further than rectangle drawing.
2023-04-03 20:19:46 +02:00
Miro Kropacek
cef14a7c6a BACKENDS: ATARI: Small fixes
- fix restoration of dirty rects from overlay
- fix vsync handling (don't try to be too smart; we can't store "vsync"
  from anywhere because that wouldn't play nicely if a game has its own
  "vsync" set) ... so keep the checkbox as is
- overlay restore for 640x400
- never wait for vbl in overlay
- readme.txt
2023-03-29 20:17:43 +02:00
Miro Kropacek
a98ce2c211 BACKENDS: ATARI: Double/triple buffering doesn't enforce fullscreen redraws
Also, massively refactored, single/double/triple/overlay rendering is
finally united.
2023-03-25 21:45:50 +01:00
Miro Kropacek
52f8bd45e2 BACKENDS: ATARI: Use RGB332 for the overlay 2023-03-25 21:45:50 +01:00
Miro Kropacek
6c5e3dbfd5 BACKENDS: ATARI: Refactor 2023-03-25 21:45:50 +01:00
Miro Kropacek
06af761337 GRAPHICS: ATARI: Align surface on a 16-byte boundary
Also implement a CPU-based optimization for the 68040 / 68060.
2023-03-20 22:17:25 +01:00
Miro Kropacek
4d21a496d2 BACKENDS: ATARI: Add new backend (graphics, mixer, platform)
Compile as:

./configure --backend=atari --host=m68k-atari-mint --enable-release --disable-mt32emu --disable-lua --disable-nuked-opl --disable-16bit --disable-scalers --disable-translation --disable-eventrecorder --disable-tts --disable-bink --opengl-mode=none --enable-verbose-build --prefix=/usr --bindir=/ --datarootdir=share --datadir=data && make -j 16 && m68k-atari-mint-flags -S -r ./scummvm && make install DESTDIR=$PWD/_release/ && mv $PWD/_release/scummvm $PWD/_release/scummvm.ttp
2023-03-04 23:38:42 +01:00