Swan
Swan
New emulator: https://github.com/zoran-vucenovic/swan
It's named Swan... I have had hard time with thinking of a cool name, so during development I named it SWAN (Still Without A Name), until I find a real name. So... it is the name.
For a start, I made Windows (64 and 32 bit) releases (https://github.com/zoran-vucenovic/swan/releases). I am going to release Linux builds soon. You can compile for Linux yourself, see the notes about compiling in the project page.
To have sound you need portaudio library (see the notes in project front page, or wiki
Swan emulates 48k model only.
As I owned 48k Speccy, I wanted to create my own emulator for this machine. The focus was on accuracy of emulation, not on supporting other models.
Swan supports mapping of any PC key to any Speccy key (as games often have very peculiar keys, so I thought of this as a very important feature).
Please try...
It's named Swan... I have had hard time with thinking of a cool name, so during development I named it SWAN (Still Without A Name), until I find a real name. So... it is the name.
For a start, I made Windows (64 and 32 bit) releases (https://github.com/zoran-vucenovic/swan/releases). I am going to release Linux builds soon. You can compile for Linux yourself, see the notes about compiling in the project page.
To have sound you need portaudio library (see the notes in project front page, or wiki
Swan emulates 48k model only.
As I owned 48k Speccy, I wanted to create my own emulator for this machine. The focus was on accuracy of emulation, not on supporting other models.
Swan supports mapping of any PC key to any Speccy key (as games often have very peculiar keys, so I thought of this as a very important feature).
Please try...
Re: Swan
I accuracy is your bag then you probably should join the discord: https://discord.gg/45W4bUB
Our emulation chat has probably the biggest set of tests for all models of Speccies on the net by now, and it's very active with emulator development chat.
Our emulation chat has probably the biggest set of tests for all models of Speccies on the net by now, and it's very active with emulator development chat.
Re: Swan
Thanks, I logged in there now and I am going to take a look around.ZXDunny wrote: ↑Sun Nov 06, 2022 10:10 am I accuracy is your bag then you probably should join the discord: https://discord.gg/45W4bUB
Our emulation chat has probably the biggest set of tests for all models of Speccies on the net by now, and it's very active with emulator development chat.
-
- Microbot
- Posts: 100
- Joined: Wed Feb 03, 2021 5:18 am
Re: Swan
Written in Pascal... There are retrogeeks and then there are heroes... Congratulations!Zoran wrote: ↑Sat Nov 05, 2022 11:19 pm New emulator: https://github.com/zoran-vucenovic/swan
It's named Swan... I have had hard time with thinking of a cool name, so during development I named it SWAN (Still Without A Name), until I find a real name. So... it is the name.
For a start, I made Windows (64 and 32 bit) releases (https://github.com/zoran-vucenovic/swan/releases). I am going to release Linux builds soon. You can compile for Linux yourself, see the notes about compiling in the project page.
To have sound you need portaudio library (see the notes in project front page, or wiki
Swan emulates 48k model only.
As I owned 48k Speccy, I wanted to create my own emulator for this machine. The focus was on accuracy of emulation, not on supporting other models.
Swan supports mapping of any PC key to any Speccy key (as games often have very peculiar keys, so I thought of this as a very important feature).
Please try...
-
- Microbot
- Posts: 100
- Joined: Wed Feb 03, 2021 5:18 am
Re: Swan
I'm trying it a bit and it looks *very* solid!
The CPU emulation is really accurate, ula48.tap and FPGA48all.tap pass with flying colours. Plus, all the recent discoveries regarding incomplete block instructions are implemented (z80full from z80tests-1.2 passes ok)
The sound sometimes seems to lag a bit after resetting the Spectrum. I've built it in my Ubuntu laptop. Looks like after muting the sound for a bit and then unmuting it syncs again.
The snow effect is not implemented, but you've got info for that in the forum.
Also, I think that the EAR/MIC feedback is not implemented. You've got the info here: https://worldofspectrum.net/faq/referen ... erence.htm
Regarding the UI, it looks simple and clean, I like it. Try running it with a dark theme, though; it looks like some text tags don't have much contrast.
Apart from these details, it's a really good emulator!
Great job!
The CPU emulation is really accurate, ula48.tap and FPGA48all.tap pass with flying colours. Plus, all the recent discoveries regarding incomplete block instructions are implemented (z80full from z80tests-1.2 passes ok)
The sound sometimes seems to lag a bit after resetting the Spectrum. I've built it in my Ubuntu laptop. Looks like after muting the sound for a bit and then unmuting it syncs again.
The snow effect is not implemented, but you've got info for that in the forum.
Also, I think that the EAR/MIC feedback is not implemented. You've got the info here: https://worldofspectrum.net/faq/referen ... erence.htm
This is so the first Abu Simbel Profanation releases work. Now the only way to enter the game is to press 3 while the tape is running.Bit 6 of IN-Port 0xfe is the EAR input bit. The value read from this port is not trivial, as can be seen from the following program:
10 OUT 254,BIN 11101111
20 PRINT IN 254
30 OUT 254,BIN 11111111
40 PRINT IN 254
50 GOTO 10
For a correct test do not press any key while running, and have no EAR input.
If the output is 191,255,191,255 etc, you are on real Spectrum Issue 3.
If output is always 191 or always 255, change the value in line 10 to BIN 11100111.
If output is then 191,255,191,255 etc, then you are on Spectrum Issue 2.
If output is still always 191 or always 255 you are on Spectrum emulator.
Regarding the UI, it looks simple and clean, I like it. Try running it with a dark theme, though; it looks like some text tags don't have much contrast.
Apart from these details, it's a really good emulator!
Great job!
-
- Microbot
- Posts: 100
- Joined: Wed Feb 03, 2021 5:18 am
Re: Swan
After trying the BASIC program:TheMartian wrote: ↑Sun Nov 06, 2022 7:08 pm Also, I think that the EAR/MIC feedback is not implemented.
10 OUT 254, BIN 11101111: PRINT IN 254
20 OUT 254, BIN 11111111: PRINT IN 254
30 GO TO 10
It behaves like a issue 3 machine, returning 191,255,191,255... However, I think the change in EAR following a MIC change happens instantaneously, instead of having a little delay caused by the RC charge of the EAR/MIC circuitry. I guess this is why Abu Simbel Profanation doesn't start.
Here: issue3.tap
On an issue3, running with 6 should return 255, but running with 7 should return 191. (I should run this test on a real 48K to be sure, though )
Re: Swan
Hello @Zoran ,
I played a bit with Swan. I like it . +1 for Pascal .
The sound lagging, mentioned by @TheMartian, reproduced during my testing too.
I had a similar issue at some point. In my case it was caused by an audio buffer being saturated too quickly. Maybe it helps.
Great work!
I played a bit with Swan. I like it . +1 for Pascal .
The sound lagging, mentioned by @TheMartian, reproduced during my testing too.
I had a similar issue at some point. In my case it was caused by an audio buffer being saturated too quickly. Maybe it helps.
Great work!
Re: Swan
Thank you, TheMartian and the.beginner.
I could reproduce sound problems in Linux on a slow virtual machine with low resources.
I just tried with enlarging the buffer used by portaudio callback function, but it didn't seem to get much.
I'm going to play more... I'll see if this article might help me more...
I could reproduce sound problems in Linux on a slow virtual machine with low resources.
I just tried with enlarging the buffer used by portaudio callback function, but it didn't seem to get much.
I'm going to play more... I'll see if this article might help me more...
-
- Microbot
- Posts: 100
- Joined: Wed Feb 03, 2021 5:18 am
Re: Swan
IMHO it is not "latency", but rather that something happens when you reset the Speccy, that increases the delay or something. Maybe you're stopping and restarting the sound playback or something? Or you start a new sound buffer on reset, instead of continuing the buffer in use until it's full?Zoran wrote: ↑Tue Nov 08, 2022 8:11 am I could reproduce sound problems in Linux on a slow virtual machine with low resources.
I just tried with enlarging the buffer used by portaudio callback function, but it didn't seem to get much.
I'm going to play more... I'll see if this article might help me more...
Re: Swan
Yes, that is so now -- the sound is stopped, then started again, with new buffer.TheMartian wrote: ↑Tue Nov 08, 2022 11:02 am Or you start a new sound buffer on reset, instead of continuing the buffer in use until it's full?
Hm... I thought it would not be wrong to do that... Normally, Spectrum would not continue with playing the old sound when restarted. And, the workaround you mentioned in previous post:
actually does just that -- stops the sound and then starts it again, with new buffer.TheMartian wrote: ↑Sun Nov 06, 2022 7:08 pmLooks like after muting the sound for a bit and then unmuting it syncs again.
As a first thing, I'm going to try with removing this sound restarting with each Spectrum resetting; I should make sure it does not have any unwanted impact on other code. And I just have no time now, probably this evening. I'll ask you to test then. Thanks a lot.
-
- Microbot
- Posts: 100
- Joined: Wed Feb 03, 2021 5:18 am
Re: Swan
The idea behind completing the sound buffer instead of using a new one is because in real life sound is not sent in blocks. The Z80 reset can happen at any time, and this makes it run the ROM from $0000, and in just 7 CPU instructions it's setting the ULA sound bit low (and the border white).Zoran wrote: ↑Tue Nov 08, 2022 2:19 pm Yes, that is so now -- the sound is stopped, then started again, with new buffer.
Hm... I thought it would not be wrong to do that... Normally, Spectrum would not continue with playing the old sound when restarted. And, the workaround you mentioned in previous post:
actually does just that -- stops the sound and then starts it again, with new buffer.
As a first thing, I'm going to try with removing this sound restarting with each Spectrum resetting; I should make sure it does not have any unwanted impact on other code. And I just have no time now, probably this evening. I'll ask you to test then. Thanks a lot.
I guess that when you mute/unmute the sound, you just start playing sound from scratch: Create a new buffer and then play it, and so on. This restores the normal delay because the sound card has already run out of samples to play. However, if you create a new buffer on reset, the sound card will play the entire old buffer, then start with the new one, adding a bit of delay.
I'll be happy to test the new version of the emulator when you have it. Glad to help. Getting the sound right is quite tricky...
Re: Swan
Hello!
New version of Swan 0.9.2-beta:
- Improved emulation accuracy (Tests collected by redcode (ZjoyKiLer) were really helpful!)
- Sound lagging on Linux seems to be solved (@TheMartian -- whenever portaudio gets stopped, now it is always terminated -- so terminating, not just stopping portaudio seems to have solved this ).
- added loading and saving szx snapshot format
- added drag and drop files support
- added autosaving snapshots, quick going back in time and browsing saved snapshots (see details).
Precompiled binaries are released for
- Linux 64 bit, choose gtk2 or qt5 widgetset library (please note that for qt5, libqt5pas library has to be installed)
- Windows 64 and 32 bit
New version of Swan 0.9.2-beta:
- Improved emulation accuracy (Tests collected by redcode (ZjoyKiLer) were really helpful!)
- Sound lagging on Linux seems to be solved (@TheMartian -- whenever portaudio gets stopped, now it is always terminated -- so terminating, not just stopping portaudio seems to have solved this ).
- added loading and saving szx snapshot format
- added drag and drop files support
- added autosaving snapshots, quick going back in time and browsing saved snapshots (see details).
Precompiled binaries are released for
- Linux 64 bit, choose gtk2 or qt5 widgetset library (please note that for qt5, libqt5pas library has to be installed)
- Windows 64 and 32 bit