Supergun with horizontal/vertical FPGA switch

Discussion in 'Arcade and Supergun' started by Missyrelm, Jan 12, 2008.

  1. Missyrelm

    Missyrelm Active Member

    Joined:
    Nov 20, 2007
    Messages:
    27
    Likes Received:
    0
    I am trying to figure out what would go into building a supergun that had a horizontal/vertical FPGA switch that would rotate the output 90 degrees for vertical arcade games such as Pac-Man, Ms. Pacman and others.

    This started out just being about Ms. Pacman, but its evolved into a topic about a supergun with a horizontal/vertical FPGA switch, so I am starting a new thread here.

    So in the original post,
    http://www.assemblergames.com/forums/showthread.php?t=16856
    the last thing that was said was by Stone:

    Heh, about a week ago, I didn’t know what superguns and JAMMA are, now in addition to learning about those, I’ve been reading up in Wikipedia about FPGA’s, DPRAM, FIFO, etc!

    There’s no way I could do this, but if I can figure out exactly what needs to be done, and maybe even find other people who would like this done, my chances of getting someone to do this vastly improves…

    I’ve been poking around to see if anyone has done anything similar and found this:
    http://www.cs.umu.se/~dva95rng/twister/index.html
    It’s Robert Norberg’s master thesis on Real-Time Video Rotation.

    Can this be used as a starting place?
     
  2. Stone

    Stone Enthusiastic Member

    Joined:
    Sep 27, 2005
    Messages:
    504
    Likes Received:
    1
    OK, it was a bit of a throwaway comment but I'll explain what I meant in a bit more detail...

    My uni dissertation was on a VGA video wall - the idea was that you could plug a VGA input in one end and get 9xVGA outputs, in a 3x3 grid, each showing a small part of the output signal. The input video was digitised by a fast ADC (with a sample clock that was semi-locked to the input - I assumed 640x480 and then started a frame a set number of clocks after a horizontal sync pulse, resetting whenever I got a new sync pulse - worked OK but not as good as using a PLL). I digitised each one of R/G/B channels at 8 bits, then threw away some data so I had RGB565 (6 bits of green, 5 of red and blue, for a 16-bit dataword per pixel). The data went onto a big common databus with 9 output modules hanging off it - each one had a bunch of multiplexers, a VGA DAC/output driver (THS8134B, http://focus.ti.com/docs/prod/folders/print/ths8134b.html) and a big asynchronous SRAM, each capable of storing one frame. The idea was to store the first ninth of the screen in the first sram, then the next ninth in the next sram, then work around until a full frame had been captured, with the output modules spitting out the same pixel three times until the end of the line, then repeating the line three more times so each input pixel became 9 output pixels. An FPGA card coordinated switching data around and doing the read/write signals for the SRAM.

    It never quite worked, mainly because I cheaped out and tried to do everything with one SRAM per output - I was double-buffering it by splitting the RAM into two banks, but the chips weren't really fast enough to take the abuse. Also wasn't helped because my board was massive and the short signal rise times turned my main bus into a transmission line which killed a bunch of my chips with overvoltage...

    I wish I had the time for a nice side project like this but I have a fulltime job now ;-) Doing a rotation is in principle much simpler than what I did - for the simplest method you'd only need two SRAMs (one in, one out, swapping each frame) and you'd continuously fill one with input pixels while spraying them out the other end in a different order. You'd need to have a good hard think about how you were going to get the aspect ratio right - just swapping the rows and columns would work but the picture would be stretched horizontally. Might be more worthwhile sampling input at TV-res and outputting at VGA so you don't lose any pixels.

    Hope that gave you some ideas :icon_bigg

    Stone
     
  3. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    That would be absolute crap since at best you'll loose 66% of the horizontal resolution and you'll be wasting 1/3 of the screen; rotate the monitor!

    If I were to do it, I'd do it a field at a time instead of a frame, since DP memory is really expensive and doing it a frame at a time would mess up progressive games which is practically all of them. The idea is to lock onto the horizontal sync and sample the active video 240 times over each of the 240 lines in the field. To get the best results you'd have to sample each line 720 times and interpolate it down to 240 lines, but no matter what it'll look like crap. To rotate the picture and retain the aspect ratio, you'd need to create a 320x240 display, blank the first and last 40 horizontal pixels, and render a vertical row of pixels instead of horizontal. This may sound easy but you'll have to compensate for interlaced games which means keeping track of fields and shifting the picture a pixel based on whether the last field had an even or odd number of lines, this will give you the full 480 lines of vertical resolution but the screen will shimmer in an annoying way. The correct way would be to switch interlaced games to 640x240 and add a blank pixel for an even frame's pixel to interleave into, but this will also look like crap since the blanked lines will be really noticeable since in emulator terminology that's "50% scanlines". To do it nicely, you'd want around "20% scanlines", just so that when the field shifts, there's no shimmer and you can't see the blanked lines. That display is a little more complicated to design, but would be worth it. Anyways, the logic is the least of your problems. Expect this to cost $200+ for the parts, $100+ for the PCB, $200+ to get it built by a pro, and $XXXX for your time or someone else's to design and debug it. All for a horrible picture.
     
    Last edited: Jan 13, 2008
  4. MottZilla

    MottZilla Champion of the Forum

    Joined:
    Feb 1, 2006
    Messages:
    5,066
    Likes Received:
    102
    Maybe you should just give in and rotate a monitor. As Calpis pointed out there are technical reasons that pose a problem.

    I can think of a few issues. I think Pac-Man is running a resolution of 256x240. Well you want to rotate that so you don't have to rotate your monitor. Well your picture isn't square. And you aren't going to get more than 240 vertical lines. So you're going to have to figure out how to process the image, altering it and reoutputting it. That's going to be complicated if you don't already know what you are doing. And Calpis suggests it'll be expensive.

    But you have other options that are easier. #1 Emulation. #2 Console ports. #3 Buy a RGB monitor intended for vertical games.

    Even if you don't have a monitor intended for the vertical games you can rotate it and if you do something you can prevent distortion. The money you'd spend on a project like this could easily buy you a monitor. I just think you are biting off more than you can chew. Remember, if it were easy someone else would have done it already.
     
  5. Missyrelm

    Missyrelm Active Member

    Joined:
    Nov 20, 2007
    Messages:
    27
    Likes Received:
    0
    Agreed. Thanks to Calpis, Stone, and everyone for explaining this so clearly. Its just not worth it from what y'all have said.

    I have no idea how we would rotate our television. It's a 40" widescreen LCD. There's no way to turn it on its side that I know of.

    Although if it could be done it would actually be cool since it would be closer to the aspect ratio of a vertical game than an old square monitor.

    We REALLY don't want to bring in another TV into our apartment, if we had room for that, we'd probably just buy a real Ms. Pacman arcade cabinet.

    So I think we are stuck trying to find the very closest port of the game to the original arcade for my wife.

    If it captured the aspect ratio of the original (i.e., a small vertical rectangle in the middle of our widescreen), it would look so much more like the real thing.

    Having a 4-way joystick made custom would definately make it feel more like the arcade too.

    EDIT: It looks like I was saying that vertical games used an aspect ratio other than 4:3... That's what I get typing late at night...
     
    Last edited: Jan 16, 2008
  6. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    ??? Vertical games use "square" (4:3) monitors as do horizontal games.

    The closest port you'll find is emulation. Perhaps it's on an Xbox retro collection or something.
     
  7. Missyrelm

    Missyrelm Active Member

    Joined:
    Nov 20, 2007
    Messages:
    27
    Likes Received:
    0
    Sorry if I wasn't clear. I just meant rotating a 40" widescreen would look really cool, nice to show off to friends, and if I could use a supergun with it even more cool...

    Also, asthetically wouldn't a 4:3 Ms. Pacman would look loads more cool on a vertically oriented widescreen with black on the top and bottom than in the middle of a horizontal widescreen?

    Hard to say without doing it...

    I may check on AVS forum about building a stand like that....
     
  8. MottZilla

    MottZilla Champion of the Forum

    Joined:
    Feb 1, 2006
    Messages:
    5,066
    Likes Received:
    102
    Widescreen monitors rotated vertical look rather weird. I'd rather have black bars and horizontal monitor for something like Pacman. Now for a shooter like Raiden, that'd be different.
     
  9. Missyrelm

    Missyrelm Active Member

    Joined:
    Nov 20, 2007
    Messages:
    27
    Likes Received:
    0
    I'll have to try and find a picture of a big widescreen TV rotated vertically. Sometimes beauty is in the eye of the beholder, or perhaps we will think its ugly too.

    I have no idea if building a stand that would raise it and allow it to rotate without damaging it is even possible yet.

    We haven't totally ruled out emulation, but we see that is a last resort after we've ruled out every other possibilty.

    Anyway... I'm still researching all my options... and I appreciate people taking the time to help explain the problems with this project.
     
  10. retro

    retro Resigned from mod duty 15 March 2018

    Joined:
    Mar 13, 2004
    Messages:
    10,354
    Likes Received:
    822
  11. smokingjawa

    smokingjawa Spirited Member

    Joined:
    Apr 27, 2006
    Messages:
    101
    Likes Received:
    0
  12. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    I think it's done via the display adapter, which could care less about how it shifts out the pixels. Windows has to reconfigure the layout so that it's usable however.
     
  13. retro

    retro Resigned from mod duty 15 March 2018

    Joined:
    Mar 13, 2004
    Messages:
    10,354
    Likes Received:
    822
    WATCH THE WHOLE VIDEO, PEOPLE!!!

    Yes, he rotates it by software. But why? It is so, at the end of the vid, he can ROTATE THE MONITOR WITH HIS HAND!!

    If you can find one of them with a TV input (OK, more likely to be S-Video or composhite than RGB), then you're onto a winner ;-)
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page