Retro Virtual Machine 2.0 beta 1 released

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

Re: Retro Virtual Machine 2.0 beta 1 released

Post by Ast A. Moore » Mon Dec 24, 2018 9:11 am

jcgamestoy wrote:
Sun Dec 23, 2018 10:56 pm
I'm surprised, because the rvm2 lag was supposed to be smaller than the rvm1 lag.
I find the test you did super interesting. Could you send me the program to do tests?
Sure. Here you go.

It’s very basic. You press a key and release it. As soon as the key is down, the square in the middle of the screen toggles its color between black and cyan and a short beep (more of a click) is played. If you keep holding the key down, the color toggle/click will happen continuously at a regular rate. The latter is useful for evaluating a lag between the video and audio.
jcgamestoy wrote:
Sun Dec 23, 2018 10:56 pm
As for the floating bus, yes, I have implemented it at the last minute and by request of a tester and still is not accurate at all, do you know any software with which to test it properly?
I do, of course. Since I was on the team who discovered, analyzed, and booked down the floating bus on the +2A/+3, I made quite a few tests. Mark Woodmass was the first to implement it in his SpecEmu, and I made a special version of my test for him to fine-tune his emulation. You can check out the link in my signature for the most detailed information about it you can ever find. Here are the links to my test programs:

1. Floating Bus Test (Universal) 2 There are two versions here—2.0 and 2.1. Version 2 is meant to test the best-case scenario. When you launch it, two yellow stripes in the border will appear at the same height as the “ground” level. They may jitter a little bit, but at no point should they appear below or above the yellow ground area. When you press a key, white vertical lines will appear in the “sky” area. Again, the two yellow stripes should remain in the border at the same position and nowhere else on the screen. Pressing and holding a key will cause a single yellow stripe to roll inside the ground area. You can now press and hold keys randomly and the yellow stripe should never appear anywhere else on the screen. Version 2.1 is a preliminary worse-case scenario test. Its only difference from 2.0 is that after pressing a key, the border should fill up with yellow stripes from top to bottom. Holding a key down, will cause a single flickering yellow stripe to roll down across the screen.

2. Woody’s Special. This is the ultimate emulator test. Upon loading, it behaves just like the above. However, after you press a key, it displays a very specific pattern, which is easier to understand by looking at it, rather than reading its description. I ran this test on a real Spectrum +2A and took a video of the screen at 50 fps. You can examine it frame by frame and then fine-tune your emulator to make sure that each frame matches real hardware exactly. The yellow stripes have distinct edges that contrast well with the black border and the white vertical lines should help you see at which exact T state it happens.

(I really should do a writeup on all so I can refer any emulator author to it. The one I did was aimed more at Spectrum software developers.)
Last edited by Ast A. Moore on Mon Dec 24, 2018 9:47 am, edited 1 time in total.
2 x
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
Woodster
Berk
Posts: 25
Joined: Mon Nov 13, 2017 12:17 pm

Re: Retro Virtual Machine 2.0 beta 1 released

Post by Woodster » Mon Dec 24, 2018 9:31 am

48K 128K +3 ULA bus
-----------------------------
14338 14364 14367 (0x4000)
14339 14365 14368 (0x5800)
14340 14366 14369 (0x4001)
14341 14367 14370 (0x5801)
14342 14368 14371 IDLE
14343 14369 14372 IDLE
14344 14370 14373 IDLE
14345 14371 14374 IDLE

During idle cycles the 48K and 128K ULAs will return #FF for port reads from unattached ports whereas the +2A and +3 ASIC, when memory paging is enabled, will return the most recently cached value from a display byte (see the above table) or a byte read from or written to contended memory by the Z80, but with bit 0 set in all cases. The +2A/+3 floating bytes will appear on all ports following the Centronics port decoding (0000 ---- ---- --0-). With paging disabled the +2A/+3 will always return #FF.

All timings are relative to the ULA/ASIC asserting the INTREQ line.
1 x

User avatar
Ast A. Moore
Dynamite Dan
Posts: 1134
Joined: Mon Nov 13, 2017 3:16 pm

Re: Retro Virtual Machine 2.0 beta 1 released

Post by Ast A. Moore » Mon Dec 24, 2018 9:46 am

Woodster wrote:
Mon Dec 24, 2018 9:31 am
48K 128K +3 ULA bus
I wish I could like this post a thousand times, Mark! Eloquent, no-nonsense, and dead accurate. Mind if I quote it in my future writeup for Spectrum emulator developers? Also, I need your full 3D scan for a thirty-foot-tall bronze monument. (You can choose the posture and installation location.)
1 x
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
Woodster
Berk
Posts: 25
Joined: Mon Nov 13, 2017 12:17 pm

Re: Retro Virtual Machine 2.0 beta 1 released

Post by Woodster » Mon Dec 24, 2018 9:57 am

Do what you want with it. It belongs to everybody so spread the word!

I tapped that up many months back after your initial work but then sat on it in case anything else turned up in how the bus works. Then it kinda got forgotten until now lol
1 x

User avatar
Ast A. Moore
Dynamite Dan
Posts: 1134
Joined: Mon Nov 13, 2017 3:16 pm

Re: Retro Virtual Machine 2.0 beta 1 released

Post by Ast A. Moore » Mon Dec 24, 2018 10:17 am

Woodster wrote:
Mon Dec 24, 2018 9:57 am
Do what you want with it. It belongs to everybody so spread the word!
Thanks, mate!
0 x
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
jcgamestoy
Berk
Posts: 10
Joined: Sun Dec 23, 2018 10:40 pm

Re: Retro Virtual Machine 2.0 beta 1 released

Post by jcgamestoy » Mon Dec 24, 2018 11:44 am

Ast A. Moore wrote:
Mon Dec 24, 2018 9:11 am
jcgamestoy wrote:
Sun Dec 23, 2018 10:56 pm
I'm surprised, because the rvm2 lag was supposed to be smaller than the rvm1 lag.
I find the test you did super interesting. Could you send me the program to do tests?
Sure. Here you go.

It’s very basic. You press a key and release it. As soon as the key is down, the square in the middle of the screen toggles its color between black and cyan and a short beep (more of a click) is played. If you keep holding the key down, the color toggle/click will happen continuously at a regular rate. The latter is useful for evaluating a lag between the video and audio.
jcgamestoy wrote:
Sun Dec 23, 2018 10:56 pm
As for the floating bus, yes, I have implemented it at the last minute and by request of a tester and still is not accurate at all, do you know any software with which to test it properly?
I do, of course. Since I was on the team who discovered, analyzed, and booked down the floating bus on the +2A/+3, I made quite a few tests. Mark Woodmass was the first to implement it in his SpecEmu, and I made a special version of my test for him to fine-tune his emulation. You can check out the link in my signature for the most detailed information about it you can ever find. Here are the links to my test programs:

1. Floating Bus Test (Universal) 2 There are two versions here—2.0 and 2.1. Version 2 is meant to test the best-case scenario. When you launch it, two yellow stripes in the border will appear at the same height as the “ground” level. They may jitter a little bit, but at no point should they appear below or above the yellow ground area. When you press a key, white vertical lines will appear in the “sky” area. Again, the two yellow stripes should remain in the border at the same position and nowhere else on the screen. Pressing and holding a key will cause a single yellow stripe to roll inside the ground area. You can now press and hold keys randomly and the yellow stripe should never appear anywhere else on the screen. Version 2.1 is a preliminary worse-case scenario test. Its only difference from 2.0 is that after pressing a key, the border should fill up with yellow stripes from top to bottom. Holding a key down, will cause a single flickering yellow stripe to roll down across the screen.

2. Woody’s Special. This is the ultimate emulator test. Upon loading, it behaves just like the above. However, after you press a key, it displays a very specific pattern, which is easier to understand by looking at it, rather than reading its description. I ran this test on a real Spectrum +2A and took a video of the screen at 50 fps. You can examine it frame by frame and then fine-tune your emulator to make sure that each frame matches real hardware exactly. The yellow stripes have distinct edges that contrast well with the black border and the white vertical lines should help you see at which exact T state it happens.

(I really should do a writeup on all so I can refer any emulator author to it. The one I did was aimed more at Spectrum software developers.)
Impressive work and many thanks, I do my best to implement this in the next beta.

About the lag, what osx version and what gpu your computer has? Can you press CMD+X and tell me if the video fps display something under 60. Maybe all the gpu postprocessing is the culpable of this. If you have another computer with linux or windows and a powerfull gpu test there. Nobody of my testers notice the lag, but i notice it a lot in my macbook white old computer.
0 x

User avatar
Ast A. Moore
Dynamite Dan
Posts: 1134
Joined: Mon Nov 13, 2017 3:16 pm

Re: Retro Virtual Machine 2.0 beta 1 released

Post by Ast A. Moore » Mon Dec 24, 2018 12:01 pm

jcgamestoy wrote:
Mon Dec 24, 2018 11:44 am
Impressive work and many thanks, I do my best to implement this in the next beta.
Excellent. And be sure to use Mark’s notes on ULA timings above, too.
jcgamestoy wrote:
Mon Dec 24, 2018 11:44 am
About the lag, what osx version and what gpu your computer has? Can you press CMD+X and tell me if the video fps display something under 60. Maybe all the gpu postprocessing is the culpable of this. If you have another computer with linux or windows and a powerfull gpu test there. Nobody of my testers notice the lag, but i notice it a lot in my macbook white old computer.
I’m running macOS 10.13.6 on a 2.4 GHz 15-inch mid-2010 MacBook Pro (model ID MacBookPro6,2) with two GPUs: an Intel HD Graphics and an NVIDIA GeForce GT 330M. I usually force the integrated Intel GPU to run all the time (with a special app). However, RVM2 exhibits the same delay with either GPU.

The FPS does indeed hover at just under 60; usually at around 55–58 fps. Sorry, I don’t have any other (well, more powerful) machines for testing at the moment.

Could it be that some people simply don’t notice the lag, rather than the lag not being there?

Could you perhaps make a special build of RVM with an option to turn all the video processing off? Or is it too much trouble at this point?
0 x
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
jcgamestoy
Berk
Posts: 10
Joined: Sun Dec 23, 2018 10:40 pm

Re: Retro Virtual Machine 2.0 beta 1 released

Post by jcgamestoy » Mon Dec 24, 2018 12:15 pm

djnzx48 wrote:
Mon Dec 24, 2018 2:23 am
Thanks, I got it working now. (I guess you meant to say to use the HOME key for an NMI?) The Pentagon timings are fine, but the samples are out of tune on a standard 128K, which doesn't happen on other emulators (e.g. Fuse). So it's just the 128 timings that are too fast.
:o You are completly right, i test rvmv1 vs rvmv2 in an spectrum analizer and the pitch in the zx128 is A LOT Higher, but i'm very surprised cause the ay code is the same, is a big bug i will fix it ASAP. Thanks!!!
1 x

User avatar
jcgamestoy
Berk
Posts: 10
Joined: Sun Dec 23, 2018 10:40 pm

Re: Retro Virtual Machine 2.0 beta 1 released

Post by jcgamestoy » Mon Dec 24, 2018 1:08 pm

djnzx48 wrote:
Mon Dec 24, 2018 2:23 am
Thanks, I got it working now. (I guess you meant to say to use the HOME key for an NMI?) The Pentagon timings are fine, but the samples are out of tune on a standard 128K, which doesn't happen on other emulators (e.g. Fuse). So it's just the 128 timings that are too fast.
I found the bug and i fixed it. I the next weeks i will release a new build with this bug and other fixed. MANY THANKS :D
2 x

User avatar
jcgamestoy
Berk
Posts: 10
Joined: Sun Dec 23, 2018 10:40 pm

Re: Retro Virtual Machine 2.0 beta 1 released

Post by jcgamestoy » Mon Dec 24, 2018 1:51 pm

djnzx48 wrote:
Mon Dec 24, 2018 2:23 am
Thanks, I got it working now. (I guess you meant to say to use the HOME key for an NMI?) The Pentagon timings are fine, but the samples are out of tune on a standard 128K, which doesn't happen on other emulators (e.g. Fuse). So it's just the 128 timings that are too fast.
While I release the new version there is a way to fix the bug, add a Turbo Sound to the machine, that deactivates the internal AY and the AYs of the Turbo Sound don't have the bug.
1 x

Post Reply