AY emulation testing

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: AY emulation testing

Post by Ast A. Moore »

djnzx48 wrote: Thu Oct 11, 2018 9:23 am Also, I reran the Fuse test making sure the filter was disabled, but still got the same result.
So much for that, then: ;)
Fred wrote: Thu Oct 11, 2018 6:27 am There are no platform specific behaviours in this part of Fuse so you don’t need to worry about that :)
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
djnzx48
Manic Miner
Posts: 729
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: AY emulation testing

Post by djnzx48 »

It looks like I'm still on version 1.5.0, so that could have something to do with it? I haven't try messing with any of the other sound settings either.
User avatar
druellan
Dynamite Dan
Posts: 1466
Joined: Tue Apr 03, 2018 7:19 pm

Re: AY emulation testing

Post by druellan »

Awesome work. Just yesterday I was on a discussion about AY sound emulation, and I was thinking on doing some tests, but this is just way beyond my humble skills. Very interesting stuff!
User avatar
druellan
Dynamite Dan
Posts: 1466
Joined: Tue Apr 03, 2018 7:19 pm

Re: AY emulation testing

Post by druellan »

djnzx48 wrote: Thu Oct 11, 2018 9:23 am I was going to test Spectramine as well but the only link I found for it was a password protected zip.
I have the ZIP for version 1.01b (09/26/2017) https://send.firefox.com/download/ac766 ... DYGRfycSrQ
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: AY emulation testing

Post by Ast A. Moore »

djnzx48 wrote: Thu Oct 11, 2018 9:37 am It looks like I'm still on version 1.5.0, so that could have something to do with it?
I doubt it. Although I’m not following the Fuse development process very closely, I don’t think the sound engine has undergone any major (or even minor) rewrites in the past few releases. For the record, I did run the test in v1.5.5, though. I also used Audio Hijack to capture the audio, thus taking any potential artifacts created by the DAC/ADC/cable out of the equation. (Not that they would have had any appreciable or measurable effect in this instance, anyway.)
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: AY emulation testing

Post by hikoki »

druellan wrote: Thu Oct 11, 2018 12:02 pm
djnzx48 wrote: Thu Oct 11, 2018 9:23 am I was going to test Spectramine as well but the only link I found for it was a password protected zip.
I have the ZIP for version 1.01b (09/26/2017) https://send.firefox.com/download/ac766 ... DYGRfycSrQ
There you have Spectramine version 1.03b https://yadi.sk/d/Mz2J8P3vMuz3vw
User avatar
Fred
Drutt
Posts: 38
Joined: Tue Feb 27, 2018 3:15 am

Re: AY emulation testing

Post by Fred »

Ast A. Moore wrote: Thu Oct 11, 2018 9:29 am
djnzx48 wrote: Thu Oct 11, 2018 9:23 am Also, I reran the Fuse test making sure the filter was disabled, but still got the same result.
So much for that, then: ;)
I don't know - it's very much what I would expect from Fuse's stronger filters being enabled.
User avatar
Fred
Drutt
Posts: 38
Joined: Tue Feb 27, 2018 3:15 am

Re: AY emulation testing

Post by Fred »

Ast A. Moore wrote: Thu Oct 11, 2018 12:17 pm
djnzx48 wrote: Thu Oct 11, 2018 9:37 am It looks like I'm still on version 1.5.0, so that could have something to do with it?
I doubt it. Although I’m not following the Fuse development process very closely, I don’t think the sound engine has undergone any major (or even minor) rewrites in the past few releases. For the record, I did run the test in v1.5.5, though. I also used Audio Hijack to capture the audio, thus taking any potential artifacts created by the DAC/ADC/cable out of the equation. (Not that they would have had any appreciable or measurable effect in this instance, anyway.)
The most direct way is to use the movie recording feature and extract the sound with fmfconv.

Fuse did change the noise handling in 2012 for version 1.1.0 based on the investigation from this WoS thread: https://www.worldofspectrum.org/forums/ ... ion/39644/
User avatar
Pegaz
Dynamite Dan
Posts: 1209
Joined: Mon Nov 13, 2017 1:44 pm

Re: AY emulation testing

Post by Pegaz »

For most emulators I have tried with noise.tap file, the noise goes from silent to louder in several visible steps.
Only SpecEmu and Spin have a smooth noise transition but it looks like the sound level is the same from the beginning to the end.
Which of these two cases is closer to the real hardware?
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: AY emulation testing

Post by Ast A. Moore »

Fred wrote: Thu Oct 11, 2018 2:39 pm Fuse did change the noise handling in 2012 for version 1.1.0 based on the investigation from this WoS thread: https://www.worldofspectrum.org/forums/ ... ion/39644/
Oh, this is interesting!
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: AY emulation testing

Post by Ast A. Moore »

Pegaz wrote: Thu Oct 11, 2018 5:13 pm For most emulators I have tried with noise.tap file, the noise goes from silent to louder in several visible steps.
Only SpecEmu and Spin have a smooth noise transition but it looks like the sound level is the same from the beginning to the end.
Which of these two cases is closer to the real hardware?
The amplitude should remain more or less the same. This is from my Toast Rack:

Image
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
djnzx48
Manic Miner
Posts: 729
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: AY emulation testing

Post by djnzx48 »

Thanks for the Spectramine links [mention]druellan[/mention] and [mention]hikoki[/mention].

Dunno why Fuse was different when I tested it but it still sounded fine IMO. Turning the filter on still affects the sound quite a lot.

I wonder what the best solution to this is for new releases, as the difference between the two noise generators can be very noticeable in some cases. Of course it would be really nice if the emulators could be fixed, but the workaround for doubling noise periods doesn't actually sound too bad. The clunky part would be having to stick in a menu option for it and getting the user to pick the right one.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: AY emulation testing

Post by Ast A. Moore »

djnzx48 wrote: Thu Oct 11, 2018 9:58 pm The clunky part would be having to stick in a menu option for it and getting the user to pick the right one.
Yeah, that would be a bad thing to do.

Unfortunately, in this day and age of a gazillion of emulators, developers are faced with a choice—to code for the Spectrum or to code for a particular emulator. I chose the former, and, frankly, couldn’t give a rat’s behind about how emulators handle my code. That’s why I feel completely justified in calling myself a Spectrum developer.

Now, I’m way past the age of coming down hard on people who decide to tailor their code to a specific emulator—software or hardware (e.g. the various clones of the Spectrum, both old and new)—it’s their choice. I may curmudgeonly mutter something along the lines of “And they dare call themselves Spectrum developers?” but only under my breath, and mostly in jest. At the same time, if I’m in the right mood, I’ll happily point out that something in their code doesn’t work quite right on a real Spectrum. :D

The purist in me would suggest refining your code so that it behaves the way you want it to on real hardware and forget about tweaking it to work the same way in an emulator.

That said, Fuse with the “TV speaker” filter on sounds pretty darned close to the real thing to my ear (and by “the real thing” I mean an actual Spectrum hooked up to an actual TV—a CRT one, to boot). So, I’d say—stick with that setting. ;)
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
djnzx48
Manic Miner
Posts: 729
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: AY emulation testing

Post by djnzx48 »

Yeah, I agree that targeting the actual machine is preferable. The reality is though that not everyone owns real Spectrums, and many people are forced to use emulators as their only option. Personally I'd like to write programs for platforms that people will run them on, and I'd say Spin, SpecEmu and Spectaculator together probably make up the majority of emulators in use, without considering clones.

Even if you ignore emulators you still have to deal with compatibility issues, such as the contended memory banks being different on the +2A/+3. I know emulators aren't official Spectrum models, but they're in wide use so it's reasonable to want to support them.

And it's not just a binary decision. You can develop for the Spectrum primarily but still have emulation/additional hardware in mind, for example with ULAplus.
User avatar
Fred
Drutt
Posts: 38
Joined: Tue Feb 27, 2018 3:15 am

Re: AY emulation testing

Post by Fred »

Ast A. Moore wrote: Thu Oct 11, 2018 6:10 pm
Pegaz wrote: Thu Oct 11, 2018 5:13 pm For most emulators I have tried with noise.tap file, the noise goes from silent to louder in several visible steps.
Only SpecEmu and Spin have a smooth noise transition but it looks like the sound level is the same from the beginning to the end.
Which of these two cases is closer to the real hardware?
The amplitude should remain more or less the same. This is from my Toast Rack:
This would be caused by filtering on those frequencies - you can see the difference in Fuse when you turn filtering on and off.
Fuse manual wrote: This option allows the emulation of the sound output system to be modified. Different choices of speaker limit the bass and treble response that can be produced from the machine. Choose between a “TV” type speaker and a small beeper type speaker that significantly limits bass and treble response or Unfiltered for the full frequency range like from the MIC output.
User avatar
Pegaz
Dynamite Dan
Posts: 1209
Joined: Mon Nov 13, 2017 1:44 pm

Re: AY emulation testing

Post by Pegaz »

djnzx48 wrote: Fri Oct 12, 2018 3:04 am Yeah, I agree that targeting the actual machine is preferable. The reality is though that not everyone owns real Spectrums, and many people are forced to use emulators as their only option. Personally I'd like to write programs for platforms that people will run them on, and I'd say Spin, SpecEmu and Spectaculator together probably make up the majority of emulators in use, without considering clones.

Even if you ignore emulators you still have to deal with compatibility issues, such as the contended memory banks being different on the +2A/+3. I know emulators aren't official Spectrum models, but they're in wide use so it's reasonable to want to support them.

And it's not just a binary decision. You can develop for the Spectrum primarily but still have emulation/additional hardware in mind, for example with ULAplus.
I completely agree.
Emulators are very important and the best of them already behave practically as real Spectrum.
Their benefits will be even greater in the future, as there will be less and less working Spectrum around.
For me, every Spectrum is equally important , whether its based on emulator, fpga or some other non-original hardware.
Otherwise, even Amstrad models might not be considered as original hardware too.
With the emulators, Spectrum will drastically extend its life span and user base, without them it will only become just a piece of hardware in the museum.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: AY emulation testing

Post by Ast A. Moore »

djnzx48 wrote: Fri Oct 12, 2018 3:04 am Yeah, I agree that targeting the actual machine is preferable. The reality is though that not everyone owns real Spectrums, and many people are forced to use emulators as their only option. Personally I'd like to write programs for platforms that people will run them on, and I'd say Spin, SpecEmu and Spectaculator together probably make up the majority of emulators in use, without considering clones.

Even if you ignore emulators you still have to deal with compatibility issues, such as the contended memory banks being different on the +2A/+3. I know emulators aren't official Spectrum models, but they're in wide use so it's reasonable to want to support them.

And it's not just a binary decision. You can develop for the Spectrum primarily but still have emulation/additional hardware in mind, for example with ULAplus.
Sure. Perhaps, I didn’t express myself clearly. I didn’t mean to say you should go out of your way to write software that will only work properly on real hardware. Quite the opposite, in my book, it would be a mistake to go out of your way to write software that will only work properly on a particular emulator, even if it happens to be the most popular emulator.

Yes, it’s difficult enough to create workarounds for all the models of the real Spectrum. Aside from RAM contention differences, here are a few other quirks of the real hardware:

1. 48/16K Spectrums display colors differently from all the subsequent iterations. Darker colors exhibit smaller differences between their bright and non-bright variations (e.g. bright blue and non-bright blue look virtually identical). I’m not aware of any emulator that ever attempted to implement this behavior.

Image

2. The 48K/128K/+2 Spectrums are affected by something commonly referred to as the ULA snow effect, if the I registered is pointed to a particular range of values and the CPU is accessing contended memory. Some emulators can reproduce this effect to a certain degree of accuracy. None (that I know of), reproduce it 100 percent correctly. Many, simply ignore this quirk altogether. Note: At least one Spectrum game—Vectron (1985)—used it deliberately as a special effect.

3. Timing differences between all three Spectrum architectures—48K/128K/+2A. These have been mostly accurately implemented in many emulators, especially those that are being actively maintained.

4. Reading from certain ports (e.g. any port with Bits 1 and 15 reset) will cause the 128K/+2 machines to reset/hang. Some emulators don’t implement this behavior, or implement it incorrectly.

5. The floating bus behaves differently on the +2A/+3 than it does on other models. Since we’ve extensively studied and fully described its behavior in late 2017, only SpecEmu and Spectramine have correctly implemented it.

6. Issues 1 and 2 of the Spectrum 48K return different values when port $FE is read from. This causes some games that use simplified (and incorrect) keyboard polling routines to not work on later Spectrum models. Some emulators do offer an option to enable this behavior, but not all.

7. The Z80 has its own set of quirks, and not all emulators implement its behavior accurately.

8. No emulator is, of course, capable of displaying the Spectrum output at its native 50 fps. This isn’t the fault of any particular emulator, naturally, but rather the systems they runs on: most modern computers are locked to a 60 Hz refresh rate.

The above is by no means an exhaustive list, by the way.

So, given than no emulator implements all the quirks of the real hardware 100 percent correctly, how do you find the lowest common denominator? Do you just drop features or implement workarounds so that your game runs okay on the oldest and buggiest emulator? Do you think emulator authors will be incentivized to implement any of the missing features or fix the existing bugs if developers try to go out of their way to work around the emulators’ shortcomings?

I don’t know exactly when the first Spectrum emulator was written, but I think it’s a safe bet to say it was some time in the 1990s. People have had over a quarter of a century to figure out how to accurately emulate a very inexpensive and fairly simple 8-bit computer form the 1980s. How come no-one has done it yet? I don’t know the exact answer to that question (but am aware of the technical hurdles), yet I’m pretty sure it’s partly due to the complacency of Spectrum developers. Because regular gamers are rarely very demanding. The colors are slightly off? Who cares . . . The sound isn’t quite right? Who cares . . . The timing is not super accurate? Who cares . . . As long as I can run Manic Miner or Jet Pac . . .

Now, by no means do I dismiss the efforts of emulator authors. I fully understand that it’s a tremendous task in and of itself, especially if you don’t have access to real hardware or the knowhow of reverse engineering it. I myself primarily use emulators for development and most of the testing, and only use real hardware for final testing and fine tuning. But I don’t cut features or abandon techniques or otherwise compromise my code to cater to the shortcomings of a particular emulator. Nor do I add features that will only work in a particular emulator, unless they also work on real hardware.

That’s my philosophy in a nutshell.
Pegaz wrote: Fri Oct 12, 2018 11:10 am Emulators are very important and the best of them already behave practically as real Spectrum.
Their benefits will be even greater in the future, as there will be less and less working Spectrum around.
For me, every Spectrum is equally important , whether its based on emulator, fpga or some other non-original hardware.
Otherwise, even Amstrad models might not be considered as original hardware too.
With the emulators, Spectrum will drastically extend its life span and user base, without them it will only become just a piece of hardware in the museum.
Yes, but what do those emulators actually emulate? The Spectrum or the emulator author’s idea of what the Spectrum should have been like? I’m all for the preservation of the Spectrum. (I doubt many people will share our passion to the same degree it after our generation finally kicks the bucket, though.) But let’s preserve the actual Spectrum, to the best of our abilities. While the actual machines still run and while the people who understand, or can figure out, how they work are still around.

I’m not an activist at heart, but I do feel like we need to form a lobby to persuade emulator authors to try to make an effort and work on improving the emulation, rather than adding features to their oeuvres. However, I know what most of them will say (and I completely understand them): “We’re just doing this for fun. We’re not working for you. We don’t get paid for this, anyway, and simply spend our free time to do the things we love. If you want your bloody ‘super-accurate emulation,’ do it yourself.”

A man can dream, though. A man can dream . . .
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
Ersh
Manic Miner
Posts: 480
Joined: Mon Nov 13, 2017 1:06 pm

Re: AY emulation testing

Post by Ersh »

Ast A. Moore wrote: Fri Oct 12, 2018 2:25 pm 8. No emulator is, of course, capable of displaying the Spectrum output at its native 50 fps. This isn’t the fault of any particular emulator, naturally, but rather the systems they runs on: most modern computers are locked to a 60 Hz refresh rate.
Most, if not all, PC emulators support 50hz, and I'd say most screens support that refresh-rate as well. I have a cheap ASUS a couple of years old and it handles 50hz just fine.

Though handhelds (maybe laptops as well?) with a dedicated screen tend to use 60hz, so for an example, on Android you're out of luck. That's what I really like about ZXDS for the Nintendo DS, it's a portable with a solid 50fps thanks to some clever code and use of the hardware.
User avatar
ZXDunny
Manic Miner
Posts: 498
Joined: Tue Nov 14, 2017 3:45 pm

Re: AY emulation testing

Post by ZXDunny »

Emulator authors (or at least Woody and I, when we were developing SpecEMU and ZXSpin) worked to the best available information at the time. That is to say, we implemented and tested what was known about the Speccy, but only what we could actually get. I'm sure we all remember RamSoft and their utter refusal to release any usable information about the ULA.

That they largely got it wrong was not discovered for many years after, but even so...

We had access to a +2a and a 48k model, which we would run tests on to make sure we matched it. We updated the emulators whenever we learned something new. But until Chris Smith released his ULA book, we were really working in the dark. Coming up with test programs to see what happened when certain conditions were met, that sort of thing.

One of those was the ULA Snow. Did you know that you can use that particular quirk of the hardware to do hardware-based attribute scrolling? We found that by accident. We determined roughly what it did, and how, and implemented that. But to implement it correctly would have required CPU usage in a Windows machine that was pretty much at the limit of hardware available at the time, if not more - this was back in the days well before 1GHz was commonly in use. We'd need to emulate the CPU and ULA/Display at 1 T-State accuracy which massively blew out the time spent emulating - for a feature that one or two games used.

We ended up with a "good enough" solution that allowed us to continue with 4Ts accuracy. hey, we didn't emulate memory refresh fading either, so that's on us too.

Because we were trying to emulate a Spectrum. Not some "idea of what a Spectrum was" but the actual hardware. I'm sorry if that wasn't good enough, but we did our best at the time.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: AY emulation testing

Post by Ast A. Moore »

ZXDunny wrote: Fri Oct 12, 2018 5:10 pm Emulator authors (or at least Woody and I, when we were developing SpecEMU and ZXSpin) worked to the best available information at the time.
Thank you! That was a very enlightening post.

I do want to emphasize (again) that in no way do I try to take a jab at emulator authors. Moreover, and I’ve stated it on several occasions, I’m immensely grateful to Mark for implementing the floating bus on the +2A/+3. I was very excited when he came on board during our investigation of the issue and was able to come up with a new build of SpecEmu pretty soon after we’d figured out the last details. I was only too happy to create a special version of my main test program (and called it Woody’s Special) to help him fine tune his emulator, and—sure enough—his very next build replicated the behavior of the +2A dead on!

The point I’m making is that no matter how you slice it, we Spectrum software developers and you Spectrum emulator authors are in many ways co-dependent. If, as was suggested in this thread, we decide to implement workarounds—or worse, drop features—in order to fit the bill of the existing emulators, progress will never happen.

What other incentive could their be for an emulator author? Sure, some people need no external motivation (to a degree). Mark implemented the floating bus not because I'd written a game that used it, but because he just found it interesting or even exciting (I think).

Strangely enough, even Cesar, the person who actually discovered the existence of the floating bus on the +2A was not interested in pursuing it further. And he’s a bloody emulator author. :) When I started my own investigation, I tagged him a couple of times in my thread, he wasn’t all that interest and said he was busy with other things (in ZEsarUX, mind!). I get that: when he first brought it up in early 2016, the response was underwhelming, to put it mildly. My only regret is that I hadn’t returned to the scene at that time, and only discovered his post a year or more later. If I approached other emulator authors about it, they too would probably say, “Great story, bro. Ping me when there are a couple dozen more games that use it. Then I’ll think about it.”

It is, thus, a vicious circle: Spectrum developers try to avoid using certain features and quirks of the original hardware because emulators don’t support them, and emulator authors don’t implement them because there isn’t enough software that uses them. The question is: how do we get out of this rut?
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
Pegaz
Dynamite Dan
Posts: 1209
Joined: Mon Nov 13, 2017 1:44 pm

Re: AY emulation testing

Post by Pegaz »

Woody did a lot more than that.
When Ramsoft people revealed new ULA feature (four bright shades), ten years ago, Woody managed to implement this feature in SpecEmu in just a few days.
https://www.worldofspectrum.org/forums/ ... rlace-demo
https://www.worldofspectrum.org/forums/ ... edirect/p1

And this is not his only contribution to a better Spectrum emulation...
User avatar
djnzx48
Manic Miner
Posts: 729
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: AY emulation testing

Post by djnzx48 »

I'm sorry, I hope I didn't come across as ungrateful towards emulator developers. It's just hard to get motivation for using these features and quirks when the most popular emulators don't support them and they haven't been updated in years.
zx81
Microbot
Posts: 138
Joined: Sat Feb 17, 2018 9:33 pm

Re: AY emulation testing

Post by zx81 »

Ast A. Moore wrote: 8. No emulator is, of course, capable of displaying the Spectrum output at its native 50 fps. This isn’t the fault of any particular emulator, naturally, but rather the systems they runs on: most modern computers are locked to a 60 Hz refresh rate.
That's not exactly true, my friend... :)

The frame frequency on a 48k model is 50.0801 Hz and on a 128k model is 50.0211 Hz. These frequencies are basically impossible to reach on a TV or monitor where you can't control such frequencies (50 or 59.94 Hz, not 60 Hz). To get a precise 50 Hz refresh, the emulator needs to run slowly than real thing.

FPGA-based emulators, like the ZX-Uno, are capable to control the TV frame generation, so the "recreated" 48k runs at real speed. But, because the internal clocks have various limitations, the 128k model runs 8000 Hz away from real machine.

In ZXBaremulator the 48k model runs at the correct speed. So, when you configures the HDMI mode to 576i@50 Hz, you can see the interlaced effects without any trick in code, but with a small defect caused by the slightly different frequencies between TV and emulated Spectrum (50 vs 50.0801). For 128k models, the Raspberry only have a 1-Mhz timer, and I can't get the needed precision (a 128k frame lasts 19.99156356 ms), so it emulates frames of 19.991 ms long.

In theory, you can configure a HDMI mode with exact frequencies, but isn't easy to generate the needed numbers and can depend a bit of every TV-set, so I don't want to try this way. After all, the interlaced modes are "emulated" by modern TV-sets, and every model handles this with his own method.

I'm curious about the AY quality in ZXBaremulator, if somebody can try... ;)
User avatar
Pegaz
Dynamite Dan
Posts: 1209
Joined: Mon Nov 13, 2017 1:44 pm

Re: AY emulation testing

Post by Pegaz »

zx81 wrote: Sat Oct 13, 2018 11:15 am
In theory, you can configure a HDMI mode with exact frequencies, but isn't easy to generate the needed numbers and can depend a bit of every TV-set, so I don't want to try this way. After all, the interlaced modes are "emulated" by modern TV-sets, and every model handles this with his own method.

I'm curious about the AY quality in ZXBaremulator, if somebody can try... ;)
Yes, I also came to a similar conclusion.
Actually, there are two ways, which allow me a perfectly smooth scroll on raspberry pi, at least on my TV set.
The first mthod is using the Unreal Speccy Portable emulator, as well as the latest beta version of your Baremulator for Pi 1 / Zero.
We've already talked about that and what you've said, in such a case Spectrum works slightly slower, for that difference between 50Hz vs 50.0801 Hz.
I recently discovered another method, which also gives an excellent result with Fuse version for Retroarch frontend on Raspberry Pi.
In this case, its possible to set the exact frequency at 50.0801 Hz in options and the result is also a perfectly smooth scroll without any interruptions.
I dont know if this particular settings is really precise or not, but in reality it works great.

btw, you previously wrote that the exact frequency for 48k Spectrum is 50.0802 Hz, so I'm interested in what is the correct number?
zx81
Microbot
Posts: 138
Joined: Sat Feb 17, 2018 9:33 pm

Re: AY emulation testing

Post by zx81 »

Pegaz wrote: Sat Oct 13, 2018 12:00 pm btw, you previously wrote that the exact frequency for 48k Spectrum is 50.0802 Hz, so I'm interested in what is the correct number?
3500000 / 69888 = 50.08012821
Post Reply