ScummVM/Falcon060 pre-release

Latest news in the Atari world

Moderators: Mug UK, Silver Surfer, Moderator Team

Gunnar68080
Captain Atari
Captain Atari
Posts: 151
Joined: Fri Mar 29, 2024 10:58 am

Re: ScummVM/Falcon060 pre-release

Post by Gunnar68080 »

Eero Tamminen wrote: Mon Feb 26, 2024 8:45 am Atari is not the only platform with limited CPU capabilities. In ScummVM git I see recent activity e.g. for Amiga and PSP backends. If you know their maintainers, maybe you could CC them on improvement ideas that would improve perf also with their backends?
I think on Amiga ScummVm runs reasonable good and some thousands of Amigians use it.

Regarding your question: How to make it faster
C compiler has a lot of influence on the performance of course.
And you can also go for ASM tuning of a some core functions.

As example for ASM tuning:
Do you guys know NeoGeo emulator?
We did the Amiga port of it ... and NeoGeo games first ran around 2-3 FPS ... = unplayable
after rewriting some core function in ASM it runs at 40-60 FPS.

Another example do you guys know the PC-game Diablo?
We did the Amiga port of it. The game ran very slow at first.
After rewrite of core functions in Assembly is plays super smooth.
The 68K version with ASM routines - even outruns in FPS 1000 MHz PowerPC systems using the C code.

What I try to say is that in my experience doing ASM tuning can be a game changer.
I assume fixing some GCC issues could also get you a lot more speed.

What do you think about this?
Any one like to work on this together?
Gunnar68080
Captain Atari
Captain Atari
Posts: 151
Joined: Fri Mar 29, 2024 10:58 am

Re: ScummVM/Falcon060 pre-release

Post by Gunnar68080 »

To the topic of ScummVm tuning:

The other day during the CoreMark discussion we could see that the GCC version used turned a 2 instruction loop into a 5 instruction loop.

In other words the Loop ran at less than halve speed - because of GCC stupidity.

And this problem does affect each and every Loop in whatever you compile with it.
This means all loops in ScummVm suffer, and all Loop in Emutos or any other OS you compile with such bad GCC.

Fixing stuff like this will give a boosts and maybe this already will give you a couple more FPS on ScummVM
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

Gunnar68080 wrote: Tue Apr 09, 2024 6:41 amC compiler has a lot of influence on the performance of course.
And you can also go for ASM tuning of a some core functions.
This thread having 37 pages should give you a hint that a lot of profiling and optimising went into the code base over the past year. :-) So I'm no stranger to inlined asm functions. We even went as far as avoiding OS syscall overhead for timers.

ScummVM is fine when it comes to code generation because majority of its slowdowns is caused by blitting. So that's usually handled either by (super-optimized) memcpy() or better, by SuperVidel's SuperBlitter. So currently ScummVM optimisations are possible mostly in the individual game engines doing something stupid rather than our backend doing something stupid.

Having said that, I plan to take a look at "your" gcc, i.e. how complicated would be to cherry-pick at least the super-annoying move.l (a0)+,(a1)+ bug.
Gunnar68080
Captain Atari
Captain Atari
Posts: 151
Joined: Fri Mar 29, 2024 10:58 am

Re: ScummVM/Falcon060 pre-release

Post by Gunnar68080 »

mikro wrote: Tue Apr 09, 2024 10:32 am
Gunnar68080 wrote: Tue Apr 09, 2024 6:41 amC compiler has a lot of influence on the performance of course.
And you can also go for ASM tuning of a some core functions.
This thread having 37 pages should give you a hint that a lot of profiling and optimising went into the code base over the past year. :-) So I'm no stranger to inlined asm functions. We even went as far as avoiding OS syscall overhead for timers.

ScummVM is fine when it comes to code generation because majority of its slowdowns is caused by blitting. So that's usually handled either by (super-optimized) memcpy()

This sounds cool!

How does this (super-optimized) memcpy() look like?


Cheers
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

I'd say not very different from Amiga ones. ;-) The most important thing is that it is in m68k asm, so it doesn't suffer from compiler quirks.
User avatar
Cyprian
10 GOTO 10
10 GOTO 10
Posts: 3117
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: ScummVM/Falcon060 pre-release

Post by Cyprian »

mikro wrote: Tue Apr 09, 2024 10:32 am Having said that, I plan to take a look at "your" gcc, i.e. how complicated would be to cherry-pick at least the super-annoying move.l (a0)+,(a1)+ bug.
Would it be possible to convince somehow GCC to use dbra for loops?
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

Sure, dbra is usually used for loops with unsigned counter, gcc knows about it.
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

Ok, so I took a look and I don't have good news. Even on SuperVidel (basically free blitting if using common routines) both Spider-Man and Sanitarium doesn't perform well (I didn't have that big partition for The Feeble Files but I assume the same).

The interesting case is Sanitarium. Try to download https://downloads.scummvm.org/frs/demos ... m-demo.zip ... this one's intro runs flawlessly on my Falcon (so I wasn't dreaming it). Compare to the full version. It seems they increased the resolution for the full version and it's just too much for our machine. But as I mentioned earlier, Sanitarium is also a lost cause when it comes to game play.

In the end, you were right -- offloading the mixer to the DSP could really help here. It's not (only) about I/O but also about audio/video decoding.

If you are patient enough, you can try do identify which files are audio and/or video, move them into u:/ram and symlink them back to the game folder. That will remove the I/O cost.
Teki
Atari User
Atari User
Posts: 30
Joined: Sat Oct 09, 2021 12:23 am

Re: ScummVM/Falcon060 pre-release

Post by Teki »

what is symlink ? :)
Teki
Atari User
Atari User
Posts: 30
Joined: Sat Oct 09, 2021 12:23 am

Re: ScummVM/Falcon060 pre-release

Post by Teki »

to gunnar68080 how is amiga aga computers handling vga games like broken sword or feeble files ? do the amiga 68060 can handle such resolutions without graphics cards, and how they make the sound with this 4 voice paula chip ?
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

Teki wrote: Wed Apr 10, 2024 2:46 am what is symlink ? :)
It's a way how to pretend some file is on one location while it is located on another one. In FreeMiNT you can do:

- move some (say wav) file into u:\ram (and remember where did you move it from!)
- open TosWin2
- "cd /<drive>/<path>" of the folder where did you move the file from
- "ln -s /ram/<filename.wav>"

If everything went fine, you should now observe much faster loading of the wav file. However don't really delete the file from the original location -- u:\ram is deleted after reboot! So it's best to just rename it to some other filename.

As for the 68080/V4, it's the whole package, not just CPU. So yes, you get hires graphics and great sound, too.
User avatar
AdamK
Captain Atari
Captain Atari
Posts: 441
Joined: Wed Aug 21, 2013 8:44 am

Re: ScummVM/Falcon060 pre-release

Post by AdamK »

mikro wrote: Tue Apr 09, 2024 8:20 pm If you are patient enough, you can try do identify which files are audio and/or video, move them into u:/ram and symlink them back to the game folder. That will remove the I/O cost.
Maybe this could be added to be automatic as a platform specific setting?
Atari: FireBee, Falcon030 + CT60e + SuperVidel + SvEthlana, TT, 520ST + 4MB ST RAM + 8MB TT RAM + CosmosEx + SC1435, 1040STFM + UltraSatan + SM124, 1040STE 4MB ST RAM + 8MB TT RAM + CosmosEx + NetUSBee + SM144 + SC1224, 65XE + U1MB + VBXE + SIDE2, Jaguar, Lynx II, 2 x Portfolio (HPC-006)

Adam Klobukowski [adamklobukowski@gmail.com]
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

If you are referring to some kind of automatic audio/video copy to ramdisk, I propose a better feature: just load the audio into RAM all at once. :)

But it's not so easy because if I preload some (which?) / all (easier) data, what if I occupy the precious RAM for something else? In the worst case, the game could refuse to start. So it would require some heuristics what to keep, how much memory to occupy etc. So heuristics on its own, perhaps some kind of LRU algorithm.
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3674
Joined: Sun Jul 31, 2011 1:11 pm

Re: ScummVM/Falcon060 pre-release

Post by Eero Tamminen »

Teki wrote: Tue Apr 09, 2024 4:53 am stuttering sound extremly is also at sanitarium intro and spiderman sinister six ...
also sherlock holmes rose of the tatoo is playable good but intro sound also stuttering
Question was not so much about whether sound stutters, but is game (e.g. its intro) clearly faster when audio is disabled?
Teki wrote: Tue Apr 09, 2024 4:53 am darbi the dragon btw. works fine ... are there more children games like this ?
There are few more Composer games supported by ScummVM:
https://wiki.scummvm.org/index.php?title=Composer

But I think all Humongous Entertainment games are also for children:
https://wiki.scummvm.org/index.php?titl ... ment/Games

Unfortunately Miro's ScummVM port disables HE v7+ engine support, so most of those games are not supported by it, but e.g. some Putt-Putt and Fatty Bear games are.
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

Eero Tamminen wrote: Thu Apr 11, 2024 11:02 pmUnfortunately Miro's ScummVM port disables HE v7+ engine support
Just to clarify, their hardware requirements disable themselves from the build. The only explicitly disabled engines are:
- https://wiki.scummvm.org/index.php?title=Cine
- https://wiki.scummvm.org/index.php?title=Director
- https://wiki.scummvm.org/index.php?title=Hugo
- https://wiki.scummvm.org/index.php?title=Ultima
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3674
Joined: Sun Jul 31, 2011 1:11 pm

Re: ScummVM/Falcon060 pre-release

Post by Eero Tamminen »

mikro wrote: Fri Apr 12, 2024 6:51 am
Eero Tamminen wrote: Thu Apr 11, 2024 11:02 pmUnfortunately Miro's ScummVM port disables HE v7+ engine support
Just to clarify, their hardware requirements disable themselves from the build.
Of the completed engines in ScummVM, that engine has largest number of games after SCI engine, and is a variant of the SCUMM engine (which I think is best(?) optimized in ScummVM):
https://wiki.scummvm.org/index.php?title=Engines

Could you provide some build that explicitly enables it?

I'd like to check whether some of its games (from mid/late 90's) would be playable in 32MHz Falcon emulation, and if not, profile whether there's something obvious that could be optimized...

(Children's games could interest kids from our own families to our retro hobbies, and provide willing play testers. :-))
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

Eero Tamminen wrote: Fri Apr 12, 2024 12:06 pmCould you provide some build that explicitly enables it?
I wanted to reply that dude, I have just written it, it's the 16-bit / Lua / whatever requirement which rules out the HE games.

... and then I've discovered that it's not true. ;-)

It's the "--disable-bink" flag which makes it skipping this engine. This doesn't have any external dependencies but it does increase executable size by another 400k (perhaps thanks to the new engine, too).

So by all means, please test it whether it's worth keeping: https://mikro.naprvyraz.sk/private/scum ... l-bink.zip.

While being at it, there are two more games which could be enabled:

Myst ME because the following dependencies are unmet: JPEG
The Journeyman Project 2: Buried in Time because the following dependencies are unmet: FreeType2

but I'm not sure whether it's worth the trouble.
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3674
Joined: Sun Jul 31, 2011 1:11 pm

Re: ScummVM/Falcon060 pre-release

Post by Eero Tamminen »

mikro wrote: Fri Apr 12, 2024 4:33 pm I wanted to reply that dude, I have just written it, it's the 16-bit / Lua / whatever requirement which rules out the HE games.

... and then I've discovered that it's not true. ;-)

It's the "--disable-bink" flag which makes it skipping this engine. This doesn't have any external dependencies but it does increase executable size by another 400k (perhaps thanks to the new engine, too).

So by all means, please test it whether it's worth keeping: https://mikro.naprvyraz.sk/private/scum ... l-bink.zip.
Thanks!

I tested few of the demos from each of the award-winning "Freddy Fish", Pajama Sam", "Putt-putt" and "Spy Fox" game series, and although quite sluggish on emulated 32Mhz Falcon, they all seemed playable. On something faster, even speech might be OK.

=> seems definitely a keeper for the full version!

Btw. If you'd like to check out yourself, I'd recommend demo for the 1st game in "Pajama Sam" series:
mikro wrote: Fri Apr 12, 2024 4:33 pm While being at it, there are two more games which could be enabled:

Myst ME because the following dependencies are unmet: JPEG
The Journeyman Project 2: Buried in Time because the following dependencies are unmet: FreeType2

but I'm not sure whether it's worth the trouble.
Myst ME is just a TrueColor version of original Myst with better (=slower) video quality, so it does not really bring anything new?

While Journeyman 2 engine is only for single game, it's from 1995 (= smaller resources?), had reasonable reviews, seems to support also 8-bit, and there's a demo for it: So that could be interesting. However, need for Freetype i.e. (grayscale) antialiased vector font rendering, indicates that its ScummVM engine would be rather slow...
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3674
Joined: Sun Jul 31, 2011 1:11 pm

Re: ScummVM/Falcon060 pre-release

Post by Eero Tamminen »

Profiled startup of one demo game in each of the listed game series...

(Startup meaning the loading the game, showing of its common "Junior Adventure" intro, and per-game intro, until demo is interactive.)

Pajama Sam 1 (PJS1)

Code: Select all

Time spent in profile = 38.49262s.
...
Used cycles:
  12.82%  12.99%  13.99%   158292606 160467475 172821315   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
   8.68%   8.82%   8.82%   107193625 108911149 108922981   Scumm::Gdi::drawStripHE(unsigned char*, int, unsigned char const*, int, int, bool) const
   7.89%   8.01%   9.03%    97414662  98934965 111497009   Scumm::ScummEngine::resetActorBgs()
   6.64%  11.11%  33.05%    81973397 137213180 408210602   OSystem_Atari::update()
   6.40%   6.51%   7.43%    79048041  80376435  91736496   Scumm::ScummEngine::drawStripToScreen(Scumm::VirtScreen*, int, int, int, int)
   5.84%   5.96%   7.20%    72144715  73583427  88970884   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
   3.98%   4.06%   4.06%    49116712  50155815  50161383   void Scumm::Wiz::decompressWizImage<2>(unsigned char*, int, int, unsigned char const*, Common::Rect const&, int, unsigned char const*, unsigned char const*, unsigned char)
   3.90%   3.98%   7.05%    48206660  49154957  87064081   DefaultTimerManager::checkTimers(unsigned int)
   3.87%                    47751537                       OSystem_Atari::delayMillis(unsigned int)
   3.03%   3.08%   3.08%    37389001  38002124  38006474   virtual thunk to OSystem_Atari::getMillis(bool)
   2.74%                    33833281                       c2p1x1_8_rect_start
   2.61%                    32253905                       AtariMixerManager::update() [clone .part.0]
   2.11%                    26002989                       c2p1x1_8_rect_pix16
   1.85%                    22896303                       ROM_TOS
   1.68%                    20738389                       AtariMixerManager::update()
   1.67%   1.70%   1.70%    20574406  21049327  21051647   tolower
   1.36%   1.39%   2.15%    16810745  17125072  26502671   fwrite_unlocked
   1.08%                    13368862                       copy256
   0.76%   0.77%   0.94%     9337597   9472015  11596000   Scumm::ScummFile::read(void*, unsigned int)
...
Instruction cache misses:
  18.78%  19.75%  20.25%     5899711   6201608   6359903   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
   9.38%                     2944622                       ROM_TOS
   8.29%  15.93%  47.54%     2604470   5002390  14932353   OSystem_Atari::update()
   6.63%                     2082066                       OSystem_Atari::delayMillis(unsigned int)
   6.61%   7.28%   9.44%     2076936   2286734   2964811   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
   5.01%   5.28%   5.28%     1572726   1658802   1659402   virtual thunk to OSystem_Atari::getMillis(bool)
   4.96%   5.40%  10.70%     1558540   1696386   3360235   DefaultTimerManager::checkTimers(unsigned int)
Freddi Fish 2

Code: Select all

Time spent in profile = 108.34899s.
...
Used cycles:
  41.65%  42.32%  44.13%  144776647214710734501534081292   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
   7.21%   7.33%   8.52%   250575380 254688382 296098382   Scumm::ScummEngine::drawStripToScreen(Scumm::VirtScreen*, int, int, int, int)
   6.89%   6.99%   7.54%   239623055 243070399 262045082   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
   4.53%   4.60%   4.60%   157386871 159848434 159866008   Scumm::Gdi::drawStripHE(unsigned char*, int, unsigned char const*, int, int, bool) const
   4.51%   4.58%  10.63%   156751340 159223503 369447495   Scumm::ScummEngine::resetActorBgs()
   3.17%                   110053373                       c2p1x1_8_rect_start
   2.42%                    84255390                       c2p1x1_8_rect_pix16
   1.71%                    59310756                       ROM_TOS
   1.60%   1.62%   1.62%    55619888  56483473  56489621   void Scumm::Wiz::decompressWizImage<2>(unsigned char*, int, int, unsigned char const*, Common::Rect const&, int, unsigned char const*, unsigned char const*, unsigned char)
...
Instruction cache misses:
  48.02%  51.86%  55.12%    41581010  44902038  47729351   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
  10.30%  10.85%  11.11%     8914028   9396432   9621040   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
   9.15%                     7925307                       ROM_TOS
Spy Fox 2

Code: Select all

Time spent in profile = 106.00046s.
...
Used cycles:
  26.91%  27.32%  30.08%   915241245 9292207791023020047   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
  19.38%  19.70%  21.23%   659222689 669960280 722144994   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
   6.82%   6.93%   8.35%   232095323 235707798 283905825   Scumm::ScummEngine::drawStripToScreen(Scumm::VirtScreen*, int, int, int, int)
   4.31%   4.37%   9.31%   146659131 148672685 316612797   Scumm::ScummEngine::resetActorBgs()
   3.09%   3.13%   3.13%   105112228 106569208 106580518   void Scumm::Wiz::decompressWizImage<1>(unsigned char*, int, int, unsigned char const*, Common::Rect const&, int, unsigned char const*, unsigned char const*, unsigned char)
   3.09%                   104951694                       c2p1x1_8_rect_start
   2.78%   2.83%   2.83%    94609759  96176653  96187093   Scumm::Gdi::drawStripHE(unsigned char*, int, unsigned char const*, int, int, bool) const
   2.35%                    79942648                       c2p1x1_8_rect_pix16
   1.66%                    56397984                       ROM_TOS
...
Instruction cache misses:
  28.33%  30.54%  35.31%    25352829  27326557  31591313   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
  27.28%  28.99%  29.67%    24413323  25940925  26547255   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
   8.61%                     7706578                       ROM_TOS
Putt-Putt travels through time

Startup (i.e. reproducible):

Code: Select all

Time spent in profile = 173.05857s.
...
Used cycles:
  42.61%  43.30%  45.83%  236616060824041788912544910692   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
   9.94%  10.10%  10.88%   552093435 560657603 604155423   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
   5.91%   5.99%   9.82%   328255092 332734501 545344569   Scumm::ScummEngine::resetActorBgs()
   5.50%   5.58%   6.41%   305167525 309830093 356065219   Scumm::ScummEngine::drawStripToScreen(Scumm::VirtScreen*, int, int, int, int)
   3.59%   3.65%   3.65%   199572652 202647372 202669354   Scumm::Gdi::drawStripHE(unsigned char*, int, unsigned char const*, int, int, bool) const
   2.53%   4.22%  17.95%   140490072 234405366 996858653   OSystem_Atari::update()
   2.41%                   134081206                       c2p1x1_8_rect_start
   1.85%                   102831145                       c2p1x1_8_rect_pix16
   1.74%   1.77%   1.77%    96883914  98320585  98331373   void Scumm::Wiz::decompressWizImage<2>(unsigned char*, int, int, unsigned char const*, Common::Rect const&, int, unsigned char const*, unsigned char const*, unsigned char)
   1.63%                    90458288                       ROM_TOS
   1.38%   1.40%   2.48%    76371879  77511836 137588669   DefaultTimerManager::checkTimers(unsigned int)
   1.27%                    70720378                       OSystem_Atari::delayMillis(unsigned int)
   1.07%   1.09%   1.09%    59515856  60435411  60442255   virtual thunk to OSystem_Atari::getMillis(bool)
...
Instruction cache misses:
  41.49%  45.65%  50.64%    53997301  59412288  65910018   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
  15.69%  16.63%  17.04%    20425939  21638888  22177950   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
   9.59%                    12481161                       ROM_TOS
   3.17%   6.16%  27.49%     4125600   8012122  35786324   OSystem_Atari::update()
A bit of interaction + quit (i.e. not reproducible):

Code: Select all

Time spent in profile = 54.74914s.
...
Used cycles:
  38.04%  38.68%  41.15%   668184918 679503067 722908350   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
  11.88%  12.11%  13.05%   208737976 212763488 229176970   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
   7.11%                   124941194                       AtariGraphicsManager::clearOverlay()
   4.91%   4.98%   9.47%    86256809  87552035 166387060   Scumm::ScummEngine::resetActorBgs()
   4.05%   4.11%   5.08%    71122271  72120269  89310499   Scumm::ScummEngine::drawStripToScreen(Scumm::VirtScreen*, int, int, int, int)
   3.36%                    59109402                       set256
   2.49%                    43797060                       c2p1x1_8_rect_start
   2.22%                    39077909                       ROM_TOS
   1.90%                    33366461                       c2p1x1_8_rect_pix16
   1.00%                    17553595                       common2
...
Instruction cache misses:
  39.38%  43.41%  48.23%    16396156  18072783  20078520   Scumm::AkosRenderer::byleRLEDecode(Scumm::BaseCostumeRenderer::ByleRLEData&)
  18.53%  19.91%  20.39%     7715815   8288629   8487335   Audio::RateConverter_Impl<false, true, false>::convert(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short)
  10.60%                     4412089                       ROM_TOS
Summary

Similarly to earlier profiled SCUMM engine games: https://www.atari-forum.com/viewtopic.p ... 97#p458397

RLE decoding and audio rate conversions are most noticeable performance issues (not the actual blitting).
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3674
Joined: Sun Jul 31, 2011 1:11 pm

Re: ScummVM/Falcon060 pre-release

Post by Eero Tamminen »

When looking PJS1 startup callgraph, I noticed an odd thing...

There's some config updating that takes ~5% of the CPU cycles in it:
pjs1-detail.png
Grepping ScummVM code seems to indicate these engine opcodes as potentially triggering it:

Code: Select all

engines/scumm/he/script_v100he.cpp:     OPCODE(0x91, o72_writeINI);
engines/scumm/he/script_v72he.cpp:      OPCODE(0xf4, o72_writeINI);
Only thing google found on it was this: https://forums.scummvm.org/viewtopic.php?t=15073

Game VM opcode for saving INI files, which gets called more often than e.g. byleRLEDecode() during startup / intro, WTF?
You do not have the required permissions to view the files attached to this post.
Last edited by Eero Tamminen on Sun Apr 14, 2024 10:44 pm, edited 1 time in total.
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3674
Joined: Sun Jul 31, 2011 1:11 pm

Re: ScummVM/Falcon060 pre-release

Post by Eero Tamminen »

Untested potential optimization for RLEdecode:
rledecode-opt-untested.patch.txt
You do not have the required permissions to view the files attached to this post.
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

Thanks! The last couple of weeks I was messing with my TT but it seems to be all sorted out so I can give the HE games a proper test (also on real Falcon030: here we could see some help from the external clock for the audio converter).

As for the o72_writeINI, I'm afraid this is hardcoded into the game's code however maybe we can get away with some flag saying whether something has been changed and if not, just early exit.
Teki
Atari User
Atari User
Posts: 30
Joined: Sat Oct 09, 2021 12:23 am

Re: ScummVM/Falcon060 pre-release

Post by Teki »

i tested the 2cd version of feeble files (instead the 4cd version) and its already a lot faster, seems the same what mikro told with sanitarium ...
to eero: yes once i get feeble files without any sound and speech even the 4cd version intro seems running with 20 to 25 fps ...
now i will test the bink version of scumm ... :)
Teki
Atari User
Atari User
Posts: 30
Joined: Sat Oct 09, 2021 12:23 am

Re: ScummVM/Falcon060 pre-release

Post by Teki »

- alice not working says no scumm game found
- buzz explore the jungle is working good
- dragonsphere says not fully supported then stays black at loading
- spyfox 1 working good
- spyfox 2working but intro sound stuttering
- torins passage workking but in intro scenes background sometimes slears (all with single buffering)

more tests follow soon ...
mikro
Hardware Guru
Hardware Guru
Posts: 4185
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: ScummVM/Falcon060 pre-release

Post by mikro »

I have given it a short test:

Indeed, Pajama Sam demo is greatly playable on CT60, barely anything moves there. Too bad those games are 640x480 so I can't really say how well they run on an accelerated TT (unfortunately my CT2 Falcon is far away now)

Spy Fox 2 on the other hand, that's quite interesting. Its demo is perfectly playable as well (incl. the intro). However the full version's intro seems to be doing something terrible. Even 060 + SuperVidel + direct rendering + native 11025 Hz sample rate + Eero's patch can't make the playback not stutter. If you have some time Eero, try to run the full version of Spy Fox, whether it differs in the profiler somehow (I certainly hope so!)
Post Reply

Return to “News & Announcements”