Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Invert colors in GroovyMame/Switchres  (Read 357 times)

0 Members and 3 Guests are viewing this topic.

mrchrister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:Today at 03:44:09 am
Invert colors in GroovyMame/Switchres
« on: November 10, 2019, 11:59:15 am »
Hey guys,
I'm looking for a way to invert colors in GroovyMame. Reason is I have a Nintendo Sanyo 20EZ Monitor (Original Donkey Kong cabinet) where all colors are inverted. I used to run a Jamma to Nintendo Edge adapter that inverts the color but it degraded the image quite a bit.

I'm now running an adapter that doesn't do the color inversion and I'm looking for a way to do that on the software side.



I tried:
1. Windows Magnifier tool for color inversion -> works for Desktop 480i but not for GroovyMame

2. Powerstrip color inversion (invert gamma ramp option under configure colors)
It works for Desktop and GroovyMame but displays white bars on either side (2560x224) or top (2560x256) depending on resolution. I talked to Powerstrip's customer support and this is what they said:

Quote
That's not from the color inversion. It looks to be just the unused area of the physical screen leftover by your display driver and resolution, and it would likely be there whether PowerStrip was running or not.



The cleanest way would be to just have Mame invert colors for all games or figure out why Powerstrip shows the white lines...I know that is a very specific case of interaction between the display driver and super resolutions but I was hoping that someone might have an idea how to achieve fullscreen color inversion through software?
« Last Edit: November 10, 2019, 12:07:22 pm by mrchrister »

MaximRecoil

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1720
  • Last login:Today at 02:01:56 pm
Re: Invert colors in GroovyMame/Switchres
« Reply #1 on: November 10, 2019, 08:34:46 pm »
Why don't you just use your Sanyo monitor's built-in color inverter board? I've used the stock color inverter boards on my Nintendo/Sanyo monitors when testing JAMMA boardsets and they work great; no noticeable image degradation. Is your monitor missing the color inverter board?

mrchrister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:Today at 03:44:09 am
Re: Invert colors in GroovyMame/Switchres
« Reply #2 on: November 10, 2019, 09:35:06 pm »
Not sure what you mean? I thought if I want to invert the colors I would have to cap the monitor differently?
I'm switching between the original DK pcb and Jamma regularly so I'm just looking for a straight forward way to do this.

mrchrister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:Today at 03:44:09 am
Re: Invert colors in GroovyMame/Switchres
« Reply #3 on: November 11, 2019, 06:29:44 am »
@MaximRecoil Thanks for pointing me into the direction of the inverter board. It's hard to find any visual guidance of where the inverter board sits but I think I found it in this screenshot from a yt video



If this is where it would be I definitely don't have it. I'm somewhat resistant to doing any hardware mods to my DK cab since I want to preserve it in its original state but if it is an original part from Sanyo I'm ok with it.
Could I still easily switch between inverted and non inverted this way? What's needed to get this installed?

mrchrister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:Today at 03:44:09 am
Re: Invert colors in GroovyMame/Switchres
« Reply #4 on: November 12, 2019, 03:02:09 pm »
Quick update: Installing the inverter board means soldering the 16v wire to the chassis. For that I would need to disassemble the machine which I donít want to do at this point. Down the road I might have to but I donít want to stop a running system. It also seems to not be straight forward switching between inverted and non inverted this way.

I found a GLSL shader for retroarch that inverts the screen: (thanks to monroe88)
https://gist.github.com/Monroe88/515c970aa51e93e98f3ce6e0a1ffda78

It works great but being GL based, I rather have a directx compatible shader to use with groovy. It seems with bgfx i would take a 2ms latency hit but I think this will be fine.
I can read code and patch together my own scripts but writing a shader from scratch is a bit above my level of comprehension at this point. Iíll keep reading the documentation and look for examples and hopefully I can figure it out :)
I also wonder if the shader will be a performance throttle when running cave games for example? Iíll run some tests in the next couple of days..

I mainly keep you guys informed in case this will benefit someone who might attempt something similar.
« Last Edit: November 12, 2019, 03:08:58 pm by mrchrister »

MaximRecoil

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1720
  • Last login:Today at 02:01:56 pm
Re: Invert colors in GroovyMame/Switchres
« Reply #5 on: November 16, 2019, 05:12:26 pm »
Quick update: Installing the inverter board means soldering the 16v wire to the chassis. For that I would need to disassemble the machine which I donít want to do at this point. Down the road I might have to but I donít want to stop a running system. It also seems to not be straight forward switching between inverted and non inverted this way.

It is very easy/straightforward to switch between inverted and non-inverted with the original Sanyo inverter board. You just unplug a connector and plug it into a different header. It has a header labeled "invert out" and another header right beside it labeled "non invert out". Here's a picture of one of the Sanyos in my Super Punch-Out cabinet:



The RGB cable from your boardset or MAME PC plugs into the RGB header on the right-hand side (labeled "input"), then there's a short RGB cable (not shown in the picture) that goes from one of the two output headers ("invert out" or "non invert out") to the RGB header on your monitor's chassis.

In my case I have it completely bypassed (using the "non invert out" header is electrically the same as bypassing it, because it's just a pass-through connection), because I'm using an actual Super Punch-Out boardset which doesn't need that inverter board, but I've used it before when connecting a JAMMA boardset in order to display a test pattern (neither Punch-Out nor Super Punch-Out boardsets have test patterns). I have 5 Nintendo/Sanyo monitors and they all came with that inverter board from the factory. That inverter board is the main reason that arcade operators loved the Nintendo/Sanyo monitors, because the inverter board allowed them to easily be used in both Nintendo and non-Nintendo games, which makes them more versatile than other classic arcade monitors.

Also, are you sure your chassis doesn't already have the power wire for the inverter board? It's a single red wire with a white 3-position connector on it which plugs into the 3-pin header on the inverter board (located on the left-hand side of the inverter board in my picture).
« Last Edit: November 16, 2019, 05:17:18 pm by MaximRecoil »

mrchrister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:Today at 03:44:09 am
Re: Invert colors in GroovyMame/Switchres
« Reply #6 on: November 19, 2019, 12:37:00 pm »
Thanks for your thorough reply. Iíll have time next weekend to check for the wire and report back. the Inverter board would be the way to go, I agree. The shader trick works for now but Iím planning to upgrade to FPGA MISTEr down the road once the Jamma Adapter gets released. And for that I will most likely need the inverter board..

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6773
  • Last login:Today at 07:55:01 am
  • Quote me with care
Re: Invert colors in GroovyMame/Switchres
« Reply #7 on: November 19, 2019, 12:49:02 pm »
You could surely hack MAME to do what you want. It'd be faster than a shader. I can't help you but I'd try to check in src/emu/screen.cpp, screen_device::update_quads(), maybe you can modify the rgb data before it's sent to screen.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead or pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi