The NEW Build Your Own Arcade Controls

Software Support => GroovyMAME => Topic started by: flybynight on April 25, 2024, 07:49:42 pm

Title: switchres support for "VIDEOAMP" (CRT EDID alternative to ATI card & emudriver)
Post by: flybynight on April 25, 2024, 07:49:42 pm
Bandicoot and njz3 from the French gameoover forums have made this great little device called VIDEOAMP.

It sits between your CRT and graphics card. Any graphics card on any PC. Even a laptop. No test mode or ATI card or emudriver required.

It's compatible with the the custom modeline text file that's generated from vmmaker. The file imports into the VIDEOAMP software and flashes the EDID data.


The problem is, switchres in groovymame always picks the 2560x240 60hz value. There are 15 modelines generated and imported, I see them all listed in the windows settings display resolution drop down but swithcres always picks the same one.  I tried using the old "static" mode with the "Max number of modes" uncapped but I get the same 15x modelines regardless if I choose "dynamic" or "static" (with the mame exe and XML options" selected).

1. Could switchres be configured to dynamically set custom EDID to the VIDEOAMP like it does with emudriver and ATI cards?

2. Is there a bug in vmmaker that the old "static" mode table method no longer works?



With a few tweaks I think this VIDEOAMP device could be a really amazing solution to future proof the CRT, switchres and groovymame ecosystem since it doesn't rely on using a dedicated PC in test mode with older ATI card / older drivers. You plug in the USB/video cable to the VIDEOAMP, connect it up to the CRT as the second screen, add "screen \\.\DISPLAY2" to the mame.ini then run groovymame on your main PC still with your HDMI 4K monitor attached.
I know some people are using groovymister for this same purpose but this is a lot cheaper.

More info if you are interested:
French: https://www.gamoover.net/Forums/index.php?topic=44224.0
English: https://www.arcade-projects.com/threads/vga-video-amplifier-board-for-arcade-monitor-with-sync-filter.24936/








Title: Re: switchres support for "VIDEOAMP" (CRT EDID alternative to ATI card & emudriver)
Post by: njz3 on April 30, 2024, 03:14:35 pm
Yes I agree that would be nice to get a switchres support for the board.
The board's firmware uses a simple serial communication protocol to store an EDID: basically set the EDID size in 128bytes blocks (up to 30kbytes), then send a write command with a leading adress value in hexadecimal text and a chunk of 16 bytes encoded also in hexadecimal.
What could be tricky is to perform a re-read of the EDID without restarting the whole graphics stack.
Title: Re: switchres support for "VIDEOAMP" (CRT EDID alternative to ATI card & emudriver)
Post by: haynor666 on May 13, 2024, 02:50:16 am
Never heard of this project. Looks really interesing. Would it work with 2 CRTs? Assuming that I need two VideoAmps.

Is there any site where I can buy this VideoAmp ? I see people are taking straight from bandicoot.
Title: Re: switchres support for "VIDEOAMP" (CRT EDID alternative to ATI card & emudriver)
Post by: flybynight on May 14, 2024, 08:22:45 am
I sent a PM to njz3 and bought one through paypal. This was a while ago so there may be a web shop now.

It's actually a great little device because I can use my main gaming PC for both CRT emulation and as the main PC gaming.

Before I needed a separate PC for emudriver/CRT because I couldn't do regular gaming on it (once the epicgames loader detected TEST mode in Windows it wouldn't load the PC games, not to mention the R9 380 card was getting a bit old).

Title: Re: switchres support for "VIDEOAMP" (CRT EDID alternative to ATI card & emudriver)
Post by: bandicoot on May 16, 2024, 12:05:54 pm
yes you can contact me or NJZ3 ;)
Title: Re: switchres support for "VIDEOAMP" (CRT EDID alternative to ATI card & emudriver)
Post by: njz3 on May 17, 2024, 05:42:21 am
I added more verbose traces for the communication when using the videoampcmd.exe command line tool.
If Calamity reads this topic, maybe he can find this information helpful to add the support for the videoamp into switchres/groovymame.

Here are some outputs of examples commands, all in text format.

Get status from the board at COM4 baudrate 500000:
Code: [Select]
$ ./VideoampCmd.exe -status -verbose
[USBSerial] Opened port COM4 at 500000
[USBSerial] SEND>>U
[USBSerial] RECV<<Mhsy=0 frq=0.00 dip=0 min=0.00 max=0.00 edi=0
[USBSerial] SEND>>F
[USBSerial] RECV<<Mfmi0=14500.00 fma0=16000.00 fen0=0 fmi1=23500.00 fma1=25500.00 fen1=0 fmi2=29000.00 fma2=31500.00 fen2=0 fmi3=0.00 fma3=80000.00 fen3=0
[USBSerial] SEND>>$get edidmode
[USBSerial] RECV<<Medidmode=801
[USBSerial] SEND>>$get edidpid
[USBSerial] RECV<<Medidpid=5
[USBSerial] SEND>>$get edidseg
[USBSerial] RECV<<Medidseg=1
Status:
        Firmware ver.=  0.3.2.24
        Board type=     0x0
        Serial number=  0x0
        Sync active=    0
        Current Freq=   0.00
        DIP switches=   0000
        Min Frequency=  0.00
        Max Frequency=  0.00
        EDID Bus Read=  0
        EDID VideoMode= 0x0801
        EDID ProductID= 0x0005
        EDID Segments=  1
[USBSerial] Closing port COM4
Now more explanations on the text commands we can see:
- the board wait for a first character that is either a command by itself, or a "long" command starting with a special "$" character.
- the board replies with messages starting by letter "M" (for Message)
- "U" command returns : hsync (hsy) enable (1) or not (0), current measured hsync frequency (frq), Dip switch position (dip), current filter range (min)/(max), number of reads of the EDID performed by the computer (edi)
- "F" command returns the 4 filter banks parameters: min (fmi0), max (fma0), always enabled (fen0)
- "$get edidmode" long command to get EDID mode of the board (reserved for internal use).
- "$get edidpid" long command to get EDID product ID (reserved for internal use).
- "$get edidset" long command to get EDID buffer size expressed in 128-bytes segments.

Set a 128 bytes EDID from a file "generic_15.bin" (obtained from switchres) into the board's eprom, still at COM4 baudrate 500000:
Code: [Select]
$ ./VideoampCmd.exe -edid generic_15.bin -verbose
[USBSerial] Opened port COM4 at 500000
Set EDID mode to external
[USBSerial] SEND>>$set edidmode=0801
[USBSerial] RECV<<MSet uint16 edidmode to 0x801
EDID to write:
0x0000: 00 FF FF FF FF FF FF 00 4E F2 00 00 00 00 00 00
0x0010: 05 1F 01 03 6D 30 24 78 0A 5E C0 A4 59 4A 98 25
0x0020: 20 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
0x0030: 01 01 01 01 01 01 8B 02 40 60 10 F0 15 00 0D 1F
0x0040: 23 00 E5 6C 11 00 00 18 00 00 00 FF 00 53 77 69
0x0050: 74 63 68 72 65 73 32 30 30 0A 00 00 00 FD 00 31
0x0060: 41 0F 0F FF 00 0A 20 20 20 20 20 20 00 00 00 FC
0x0070: 00 67 65 6E 65 72 69 63 5F 31 35 00 00 0A 00 05
Number of 128-bytes segments: 1
[USBSerial] SEND>>$set edidseg=0001
[USBSerial] RECV<<MSet uint8 edidseg to 0x1
[USBSerial] SEND>>$setedid 0000 00 FF FF FF FF FF FF 00 4E F2 00 00 00 00 00 00
[USBSerial] RECV<<MEDID set at 0x0000: 00 FF FF FF FF FF FF 00 4E F2 00 00 00 00 00 00
[USBSerial] SEND>>$setedid 0010 05 1F 01 03 6D 30 24 78 0A 5E C0 A4 59 4A 98 25
[USBSerial] RECV<<MEDID set at 0x0010: 05 1F 01 03 6D 30 24 78 0A 5E C0 A4 59 4A 98 25
[USBSerial] SEND>>$setedid 0020 20 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
[USBSerial] RECV<<MEDID set at 0x0020: 20 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
[USBSerial] SEND>>$setedid 0030 01 01 01 01 01 01 8B 02 40 60 10 F0 15 00 0D 1F
[USBSerial] RECV<<MEDID set at 0x0030: 01 01 01 01 01 01 8B 02 40 60 10 F0 15 00 0D 1F
[USBSerial] SEND>>$setedid 0040 23 00 E5 6C 11 00 00 18 00 00 00 FF 00 53 77 69
[USBSerial] RECV<<MEDID set at 0x0040: 23 00 E5 6C 11 00 00 18 00 00 00 FF 00 53 77 69
[USBSerial] SEND>>$setedid 0050 74 63 68 72 65 73 32 30 30 0A 00 00 00 FD 00 31
[USBSerial] RECV<<MEDID set at 0x0050: 74 63 68 72 65 73 32 30 30 0A 00 00 00 FD 00 31
[USBSerial] SEND>>$setedid 0060 41 0F 0F FF 00 0A 20 20 20 20 20 20 00 00 00 FC
[USBSerial] RECV<<MEDID set at 0x0060: 41 0F 0F FF 00 0A 20 20 20 20 20 20 00 00 00 FC
[USBSerial] SEND>>$setedid 0070 00 67 65 6E 65 72 69 63 5F 31 35 00 00 0A 00 05
[USBSerial] RECV<<MEDID set at 0x0070: 00 67 65 6E 65 72 69 63 5F 31 35 00 00 0A 00 05
[USBSerial] SEND>>$savecfg
[USBSerial] Closing port COM4
Here are the explanations:
- the protocol always expects unsigned hex digits (2/4/8 depending on the integer) or float32 values.
- to set a value, a long command using "$" is needed.
- to set the EDID data, many chunks of 16 bytes in hex is used.
- "$set edidmode=0801" long command set the edidmode value to hex 0801 (external binary EDID).
- "$set edidseg=0001" long command set the number of 128bytes segments for the EDID to hex 0001 (1 segment of 128 bytes).
- "$setedid 0000 00 FF FF FF FF FF FF 00 4E F2 00 00 00 00 00 00" long command set 16 bytes of the EDID binary buffer at offset 0x0000 to the bytes 00 FF FF FF FF FF FF 00 4E F2 00 00 00 00 00 00.
- "$savecfg" save the current edid configuration (mode and segment number) to internal eprom.