Author Topic: ZX Spectrum emulation slow ?  (Read 720 times)

Offline ClessxAlghazanth

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +1/-0
ZX Spectrum emulation slow ?
« on: July 23, 2021, 06:39:42 PM »
Hi  :smilie:

I've just tried playing a few speccy games (both 48K and 128K) on FBNeo , and I wasn't able to get consistent framerate in any of them  :S

The games were Ms Pacman , Space Firebird , Silkworm and I tried a few others including homebews too

I get around 20~30 fps depending on game and situation  , and constant lags during gameplay  :confused:

By no means I have a high-end pc , but I can run all other consoles , and later arcade games on FBNeo with no performance issues

Any ideas on this ?

Best regards ,

Offline dink

  • Administrator
  • *****
  • Posts: 4315
  • Karma: +374/-1
  • pie? I nearly bought one!
Re: ZX Spectrum emulation slow ?
« Reply #1 on: July 23, 2021, 08:27:43 PM »
hmm that's strange, I get a solid 50fps.  Sometimes it drops to 49fps for a second, but never anything low like you've mentioned.
I just tested MS.Pacman, Jetpac and 180degrees.  I'm using the enhanced blitter, vsync (if you're using win8+ use dwm sync) and DirectSound for audio with 6 buffers. 

Can you check in process explorer or windows built-in task manager to see if anything besides fbneo is hogging cpu?
Also it might help to try misc -> options -> set appl. process priority to above normal and/or "enable high resolution timer".

Though, the first thing I'd do is check to see if you have some softfx filter enabled and disable it, or if you're using the "enhanced" blitter, try linear interpolation, or just try another blitter altogether.

best regards,
- dink

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 854
  • Karma: +36/-1
  • Helper
Re: ZX Spectrum emulation slow ?
« Reply #2 on: July 24, 2021, 02:37:27 AM »
FWIW, i also noticed zx spectrum emulation is quite heavy, but it didn't bother me too much since it still ran fullspeed on my setup.
As a reference, with framerate limiter removed, zx spectrum's mspacman is running around 110fps in gameplay for me, while a game like sega s32's ga2 is around 175fps in gameplay

Offline Gab75

  • FBNeo Contributor
  • *****
  • Posts: 962
  • Karma: +26/-0
  • All games deserve to be emulated, more or less! :P
Re: ZX Spectrum emulation slow ?
« Reply #3 on: July 24, 2021, 06:58:56 AM »
FWIW, i also noticed zx spectrum emulation is quite heavy, but it didn't bother me too much since it still ran fullspeed on my setup.
As a reference, with framerate limiter removed, zx spectrum's mspacman is running around 110fps in gameplay for me, while a game like sega s32's ga2 is around 175fps in gameplay

It's ironic thinking that the "simple" System-32 audio sub-system is clearly more powerful (computationally speaking) than  the entire ZX Spectrum system... maybe some "inefficient" routine in the ULA chip emulation?

Offline dink

  • Administrator
  • *****
  • Posts: 4315
  • Karma: +374/-1
  • pie? I nearly bought one!
Re: ZX Spectrum emulation slow ?
« Reply #4 on: July 24, 2021, 09:10:49 AM »
Gab75 not at all inefficient, to properly emulate the ula for multicolor mode it will have to be quite a bit more involved, just like the nes emulation - if you want a perfect ppu, you'll have to run single cycle at a time.  When writing the nes and spectrum emu's from scratch I went for the perfection rather than speed on ancient pc's.  On the other hand, I did test, and my nes and spectrum emulation runs at full speed on my old p4 2.9ghz (windows says 2.9, it's really a 3ghz cpu)

Here's why it's wrong to compare any game with 68k as main processor, with the nes and spectrum emulation:

For example, system32 runs a frame like this:
[top of frame]
run cpus
draw screen
[end of frame]

nes and spectrum are quite a bit more involved..

[top of frame]
(repeat this ~70,000 times for zx or ~20,000 times for nes)
  run 1 cycle cpu
  run ppu(nes) or ula(zx)
[end of frame]

best regards,
- dink

Offline Gab75

  • FBNeo Contributor
  • *****
  • Posts: 962
  • Karma: +26/-0
  • All games deserve to be emulated, more or less! :P
Re: ZX Spectrum emulation slow ?
« Reply #5 on: July 24, 2021, 11:09:21 AM »
Obviously I didn't really mean to underestimate the Devs work... just make some guesses.
Thanks for explanation and for your work! :)