Exact emulation of the Snow effect.

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

Re: Exact emulation of the Snow effect.

Post by Weiv »

TheMartian wrote: Thu Apr 06, 2023 2:51 pm @Weiv, I don't think your test damaged anything.

My Toastrack was a little bit unstable at the moment, the ULA had had a miraculous recovery so maybe it has some intermittent failure that I've got to look into.

(If something, I hope that my faulty-ish Toastrack hasn't invalidated the test results!)

I'll look into it and it'll be fine in no time. :smile:
I hope for it)

Richard Chandler, author of Spud emulator, confirmed your results:
TheMartian
Microbot
Posts: 107
Joined: Wed Feb 03, 2021 5:18 am

Re: Exact emulation of the Snow effect.

Post by TheMartian »

This is very nice. :smile: With @Weiv's test sources and with now two videos confirming the effect, I think we can solve the equation.
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

Re: Exact emulation of the Snow effect.

Post by Weiv »

TheMartian wrote: Thu Apr 06, 2023 5:46 pm This is very nice. :smile: With @Weiv's test sources and with now two videos confirming the effect, I think we can solve the equation.
I hope we solved it already)
TheMartian
Microbot
Posts: 107
Joined: Wed Feb 03, 2021 5:18 am

Re: Exact emulation of the Snow effect.

Post by TheMartian »

Now I want to see the same video of your emulators (SpecEmu, Spectramine, ZX Miracle, etc.) running this very test seamlessly!
TheMartian
Microbot
Posts: 107
Joined: Wed Feb 03, 2021 5:18 am

Re: Exact emulation of the Snow effect.

Post by TheMartian »

LOL, vLA128 ULA replacements give the same snow pattern than original ULAs...
Image
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

Re: Exact emulation of the Snow effect.

Post by Weiv »

TheMartian wrote: Thu Apr 06, 2023 6:30 pm LOL, vLA128 ULA replacements give the same snow pattern than original ULAs...
Image
So it's a very good replacement, that can't fail to be gratifying)
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

Re: Exact emulation of the Snow effect.

Post by Weiv »

TheMartian wrote: Thu Apr 06, 2023 6:07 pm Now I want to see the same video of your emulators (SpecEmu, Spectramine, ZX Miracle, etc.) running this very test seamlessly!
Ok I will make it. Video from the newest SpecEmu:
(I hope @Woodster don't mind I share it).
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

Re: Exact emulation of the Snow effect.

Post by Weiv »

Here is the video from ZX Miracle :
TheMartian
Microbot
Posts: 107
Joined: Wed Feb 03, 2021 5:18 am

Re: Exact emulation of the Snow effect.

Post by TheMartian »

SpecIde has also joined the select club of emulators with 100% perfect snow. :smile:
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Exact emulation of the Snow effect.

Post by Pegaz »

TheMartian wrote: Sat Apr 08, 2023 12:20 am SpecIde has also joined the select club of emulators with 100% perfect snow. :smile:
Great, can't wait for the windows binary. :)
btw, as a file selector, I can recommend advmenu from advance mame package.
I associated it with SpecIde and it works like a charm!
TheMartian
Microbot
Posts: 107
Joined: Wed Feb 03, 2021 5:18 am

Re: Exact emulation of the Snow effect.

Post by TheMartian »

So, maybe a technical summary of this thing?

- Snow effect happens when the IR register is placed on the Z80 address bus during the refresh phase of a instruction, and the IR pair falls in a contended memory area ($4000-$7FFF, or $C000-$FFFF with RAM 1,3,5,7 paged in).
- Usually, the ULA detects that the Z80 is placing a contended memory address because MREQ is high in the first half of the memory cycle. However, during refresh, MREQ goes high in the second half of the refresh cycle, and the ULA contention manager does not detect the contended address.
- When this happens, two possibilities may happen.
- 1. If this happens four pixels before the ULA reads, the Z80 asserts RAS# as the bits 6..0 of register R are placed on the address bus. In this case, the snow address will be ULA.A[13..7] | R[6..0], and SNOW effect happens.
- 2. If this happens during the first ULA read, the Z80 asserts RAS# after the ULA.A[6..0] have been latched, so it just keeps those bits latched for the second pixel-attribute pair. This effect duplicates the data in an odd numbered column into an even numbered column.
- This effect also happens when a contended RAM is placed in the $C000-$FFFF page. In this case, the RAS# address is VA15,R[6..0] and the CAS# address is VA14,ULA.A[13..7]. In this case:
- 1. The SNOW data is retrieved from:
SCREEN RAM ($C000-$FFFF) SNOW RAM
5 1 1
5 3 1
5 5 5
5 7 5
7 1 3
7 3 3
7 5 7
7 7 7
- 2. The DUPLICATION data is retrieved, however, always from the video page (5 or 7), because DUPLICATION implies that the correct #RAS video address has been latched.

And I think that's all, summarized in a single place.
Nienn Heskil
Microbot
Posts: 134
Joined: Tue Jun 09, 2020 6:14 am
Contact:

Re: Exact emulation of the Snow effect.

Post by Nienn Heskil »

I guess there's still one remaining question. Is it possible to 'scroll' the whole screen at once using the snow effect? )

(You know, like that tv test card program does but both odd/even columns at once. I don't think it's possible, but there was a claim like that IIRC?)
User avatar
Weiv
Microbot
Posts: 177
Joined: Fri Apr 06, 2018 5:28 pm
Location: Ukraine

Re: Exact emulation of the Snow effect.

Post by Weiv »

Nienn Heskil wrote: Sat Apr 08, 2023 7:25 pm I guess there's still one remaining question. Is it possible to 'scroll' the whole screen at once using the snow effect? )

(You know, like that tv test card program does but both odd/even columns at once. I don't think it's possible, but there was a claim like that IIRC?)
No, it's not possible. The snow can scroll only odd columns (and it can be only in odd columns).
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Exact emulation of the Snow effect.

Post by Pegaz »

Today I tried to compile SpecIde for windows, but apparently it takes more knowledge and effort to get a working environment for compiling, than I thought.
I installed Cmake and MinGW as well as boost_1_74_0, SFML and zlib and added to the PATH.
In RunCmake.bat I added:
set BOOST_ROOT=C:\libs\boost_1_74_0
set SFML_ROOT=C:\SFML-2.5.1

... but, when I ran it I got the following output with several errors.
Spoiler
C:\build\source>RunCMake GNU RELEASE
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/MinGW/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Setting PROJECT_INSTALL_DIR to C:/build/source/bin
SpecIde uses SFML
CMake Warning (dev) at src/CMakeLists.txt:27 (find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Environment variable SFML_ROOT is set to:

C:\SFML-2.5.1

For compatibility, CMake is ignoring the variable.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found SFML 2.5.1 in C:/SFML-2.5.1/lib/cmake/SFML
Media libraries found: sfml-audiosfml-graphicssfml-windowsfml-system
Media include dirs found:
CMake Warning (dev) at src/CMakeLists.txt:36 (find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Environment variable Boost_ROOT is set to:

C:\libs\boost_1_74_0

For compatibility, CMake is ignoring the variable.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - no
-- Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandle
StandardArgs.cmake:230 (message):
Could NOT find Boost (missing: chrono system thread unit_test_framework)
(found version "1.74.0")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.
cmake:600 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.26/Modules/FindBoost.cmake:2377 (find_pac
kage_handle_standard_args)
src/CMakeLists.txt:36 (find_package)


-- Configuring incomplete, errors occurred!

C:\build\source>
Any thoughts ?
I also tried to compile on Raspberry Pi Linux and everything went fine there, but SpecIde runs very slowly, due the slow cpu.
TheMartian
Microbot
Posts: 107
Joined: Wed Feb 03, 2021 5:18 am

Re: Exact emulation of the Snow effect.

Post by TheMartian »

@Pegaz! I had a busy weekend! I'm on it right now! :smile:
TheMartian
Microbot
Posts: 107
Joined: Wed Feb 03, 2021 5:18 am

Re: Exact emulation of the Snow effect.

Post by TheMartian »

@Pegaz, I've updated the "SpecIde for Windows 8/10" versions, both 32 and 64 bit. Give them a try! These are compiled with Visual C++.

I'll update later the MinGW ones, I'm running into a bit of trouble with those.

Update: The MinGW binaries are also up.
Post Reply