FPGA screen upscaling

Discussion in 'Modding and Hacking - Consoles and Electronics' started by ASSEMbler, Jul 26, 2010.

  1. ASSEMbler

    ASSEMbler Administrator Staff Member

    Joined:
    Mar 13, 2004
    Messages:
    19,394
    Likes Received:
    995
    I've been talking to the person who made the giant
    DS, and while he won't share his code, he did go into
    how he did it.

    I was thinking of scaling up wonderswan and other consoles
    and was wondering is anyone have ideas or input on this.
     
  2. marshallh

    marshallh N64 Coder

    Joined:
    Mar 16, 2006
    Messages:
    661
    Likes Received:
    26
    Use internal fpga block RAM to store the scanline to be doubled, redraw it on the next h-retrace

    If scaling bigger in the X direction, hold data for 2 pixels instead of just one
     
  3. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    The hardware part of this is really easy on handhelds since they have pixel buses for their LCDs. On full consoles it's much rarer to have the pixel bus exposed. (It does happen though; Neo Geo, 3DO and N64 all do. Probably PCE too.)

    Something you have to think about with handhelds though is that they don't have proper horizontal timing or blanking for a TV.

    Taking WS (224x144) as an example, you'd probably want to scale to 720p since 144 x 5 = 720. Assuming the WS has square pixels, 224 x 5 = 1120. On a 16:9, square pixels @ 720p = 1280, so you'll need to blank 80 pixels on either side of the line. You'll also have to reconstruct your own H-sync information since the WS' won't be correct for a TV.

    Most importantly, you probably can't get the desired output pixel frequency of 5x (input + added blanking pixels) from the pixel clock so you'll have to synthesize it yourself with your own oscillator. This means you'll need to buffer MULTIPLE lines since your frequency will not be in phase with the pixel clock. Even though the output pixel clock (and width) will be slightly off, you can resynchronize to the input video each frame and burn up any excess cycles. The output should lag behind the input only enough so that by the time the output catches up to the input, the frame is finished being drawn. (I think that'd only require buffering 2-3 lines if you synthesize a pretty close frequency.)
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page