19 Replies Latest reply on Jul 23, 2017 3:48 AM by Jan Cumps

    Neo Geo Pocket Color Video Out (DAC/FPGA)

    kragit

      Hi everyone!

       

      Looking to achieve RGB analog video out on a Neo Geo Pocket Color. No known mods currently exist for this. There are single digit K2_VIDEOs out in the wild that achieve this, but I believe these were made by SNK themselves for internal use only. Other people have apparently gotten video out with FPGAs, but no one has publicly documented it.

       

      Here are the LCD signals as printed on the board & additional information from someone who's apparently achieved this:

       

      I've done it with a small FPGA. The LCD signals can't be simpler: R0~3 is 4bit red, G0~3 is 4bit green, B0~3 is 4bit blue, DOTCLK is the pixel clock, SPL is horizontal sync, SPS is frame sync.
      [...]
      It can't be done by just wiring a scart cable to the board, you have to buffer and convert the color data from the NGPC, then do digital to analog conversion if you want analog RGB output.

       

      I'm venturing into the FPGA scene for this with no past experience with FPGAs and a rudimentary understanding of digital electronics (I can follow guides, solder, etc. I built a CMVS this way).

       

      Any help would be appreciated. Thanks!

        • Re: Neo Geo Pocket Color Video Out (DAC/FPGA)
          jc2048

          You might consider applying for this roadtest

           

          https://www.element14.com/community/roadTests/1796/l/Terasic-P0082-DE0-Nano-FPGA-Development-Kit

           

          That would get you some kit to use and an opportunity to learn about FPGA design.

          2 of 2 people found this helpful
          • Re: Neo Geo Pocket Color Video Out (DAC/FPGA)
            jc2048

            As to the design itself, this would be my first go at a system block diagram based on what you've said so far

             

             

            block-diagram.JPG

             

            Here the LCD data gets latched into the FPGA and stored in row/column sequence in an internal memory. Unless you know the two sides won't run past each other, you'd use a pair of buffers, writing to one and reading from the other. You'd then pick it out of the memory at the appropriate times to fit with the output syncs that you'd generate. The colour outputs would then go to video rate DACs [Digital to Analogue Converters]. Sometimes converters can drive cables, but if not you'd need video buffers to do it. The syncs might manage with a logic line-driver (depends what the display is - that would work with VGA, but not necessarily with other analogue monitors). You have to work out how you would get the appropriate output syncs from the LCD clock. You'll find everything simpler if you can lock the output to the LCD signals so that input and output sides are timing related to each other [perhaps by multiplying the LCD clock, since it sounds like the output will have to run on a higher clock rate].

             

            The DACs and cable drivers would be best on a pcb [they'll need careful layout]. Since it's only 4-bits for each of the colours, it's possible that you might get away with something quick-and-dirty like using resistors followed by a buffer to make your own DAC. Might be worth a try, though don't pin your hopes on it.

             

            First step, if you're serious about this, is to determine the timing of the LCD drive. You need to sketch out the sync timing, orientation, blanking periods and number of pixels. Then you need to decide what output display you'd use and its capabilities [as in what mode you'd use it in and whether it could work in a way that related well to the LCD]. Then you'd need to consider how you'd piece together a prototype and then start work on the design of the FPGA.

             

            There's no reason why you couldn't do all that, but it's quite an involved project to do from a standing start if you haven't done any of that before. Do you have any experience with designing with logic chips? If you could do a design for this with CMOS logic and an SRAM, then you could certainly manage the FPGA design [since 'coding' an FPGA is really a disguised way of doing logic design], but if you come from a coding background you would find it more difficult since you'd be learning to do logic design. Unlike processor coding, FPGAs are best programmed with the underlying hardware very much in mind [perhaps think of it like doing very low level assembly programming, with timing so critical that you're counting processor cycles, and with multiple threads all executing simultaneously and having to interact with each other]. It's not as difficult as I make it sound, but you do need a somewhat different mindset from processor coding.

             

            If you're unsure, I'd encourage you to go for the roadtest and (if you were successful) work through the Altera teaching material. That way you'd find out if you were suited to FPGA design and you'd have a nice development board to work with that could easily cope with what you want to do here.

            1 of 1 people found this helpful
              • Re: Neo Geo Pocket Color Video Out (DAC/FPGA)
                kragit

                A lot to digest!

                Do you have any experience with designing with logic chips?

                Nope! Very green to pretty much every aspect of this. My experience consists of being a web dev and knowing how to solder smaller electronics (working on a Consolized MVS system and installing (soldering) a 3DS capture board for the same person I'm trying to figure out the NGPC capture for).

                 

                I have tried to read/watch some FPGA documentation in the past, though I still didn't quite understand things.

                 

                Hoping there might be something out there that would be easy enough to setup/program that I could muddle through it. Essentially 'baby's first FPGA' :-P

              • Re: Neo Geo Pocket Color Video Out (DAC/FPGA)
                John Beetem

                These are general comments about FPGAs and VGA output and probably not all that helpful for the NPGC, but here goes anyway.

                 

                There are a number of FPGA boards out there that support VGA graphics, and some have tutorials available.  Gadget Factory's Papilio boards are very nice and have a VGA "wing".  It's not clear whether it's 8 or 64 colors.  The older through-hole version has 8 colors, but the photo of the SMT version at the link has enough resistors to do 64.  They both use resistors to make a "poor man's" DAC, which can probably get you up to 4 bits per color.  There's sample code around to generate VGA output -- I think it's VHDL.  (I like Verilog better.)

                 

                The LOGI-PI and LOGI-Bone boards have a pretty powerful FPGA and you can get a LOGI-Edu adapter with VGA output (512 colors, I think).  The boards can be used stand-alone but you need an external programmer.

                 

                Another nifty board is the Nandland Go Board, which has built-in VGA.  The FPGA on that board is pretty small, but it has the advantage that you can use open-source tools instead of the far more complex vendor tools.  The Go Board doesn't have much RAM -- just the small amount in the FPGA itself -- so it's probably no good for your NPGC project.

                 

                I don't know what availability is these days for these boards.  I haven't done VGA output myself.  I plan to one of these days, since I have all those boards.  Just need more time!

                 

                Hope this helps and/or inspires.

                3 of 3 people found this helpful