Emulator Authors: ClearText style scaling 240x240 to 320x240 on iPaq's

Discussion in 'Other Device Manufacturers' started by imported_Mark Rejhon, Feb 12, 2001.

Thread Status:
Not open for further replies.
  1. imported_Mark Rejhon

    imported_Mark Rejhon Mobile Deity

    Messages:
    841
    Likes Received:
    0
    Trophy Points:
    66
    Hi,

    I've been unsuccessfully trying to contact Jacco Bikker, who writes "PDA Programming" articles on Flipcode, to to let him know about a new scaling algorithm very useful for emulators. (His email bounces; "relaying prohibited"; and then I even tried to use a couple of popular web email sites too; with no success!)

    Here's a reference to the article: http://www.flipcode.com/tutorials/tut_toofast02.shtml

    Here's the information I was trying to send to him. However, by posting here on Brighthand I am hoping that he reads this (this scaling algorithm is most useful mainly on iPaq's, and he is an iPaq owner, so I am posting here). Other people who has websites that helps PocketPC programmers, are welcome to write about the scaling algorithm, to make it more widely known! The email is as follows (enhanced with some UBB codes for readability):

    ____________________________________

    Subject: Blockiness free fullscreen scaling algorithm on iPaq for NES/SNES emulators
    Date: Mon, 12 Feb 2001 01:35:28 -0500 (EST)
    From: Mark Rejhon <marky@marky.com>
    To: Phantom@goright.to

    Hi,

    Maybe you'd like to help publicize a scaling algorithm that I
    developed; now currently used in PocketFC (NES emulator) and
    is already in PocketSNES in the update coming next Friday!

    You know how blocky graphics can become when a 240x240 NES or SNES
    image is scaled to full screen landscape 320x240, because every
    column of pixels are arbitrarily doubled.

    However, you also may have guessed how ClearType works - by taking
    advantage of each sub-pixel (red, green, blue). The iPaq has
    subpixels in a 960x240 arrangement, while the Casio devices
    have subpixels in a 320x720 arrangement.
    For more information about ClearType, see Microsoft's information:

    http://www.microsoft.com/reader/ppc/product/cleartype.htm
    Microsoft's ClearType


    On the iPaq, 240x240 scaling to 960x240 is a perfect natural;
    this is what my algorithm does. The original (inefficient)
    algorthm was written a while back, at the following web address:

    http://www.brighthand.com/ubb/Forum33/HTML/004965.html
    ClearType style scaling 240x240 to 320x240


    You should read this web address to see how my ClearType-style
    scaling algorithm works (which you can witness for yourself
    in PocketFC). More recently, I have streamlined the programming
    code into the following:

    Code:
    [font=size=2]  // OriginalPixel1 = First NES pixel horizontally in a scan line
      // OriginalPixel2 = Second NES pixel horizontally in a scan line
      // OriginalPixel3 = Third NES pixel horizontally in a scan line
      // 
      // Four output screen pixels, with three NES pixels blended
      // This assumes that the pixels are in RGB 565 format.
      //
      OutputPixel1 = OriginalPixel1;
      OutputPixel2 = (OriginalPixel1 & 0xF800) | (OriginalPixel2 & 0x07FF);
      OutputPixel3 = (OriginalPixel2 & 0xFFE0) | (OriginalPixel3 & 0x001F);
      OutputPixel4 = OriginalPixel3;[/font]


    This works great in making all pixels square during scaling
    240x240 into 320x240. This, of course, works best for black
    and white images, but still significantly reduce blockiness of
    color images. (The algorithm performs worst during vertical
    boundaries between primary colors and black, as seen in the
    green vertical pipes in Super Mario 3, where the mario-eating
    venus plants pop out intermittently)

    You may want to see some the public mention of my scaling algorithm:

    http://www.pocketgamer.org/
    "New PocketSNES release scheduled for Friday" - using the algorithm.


    http://www.pocketsnes.com/
    Author says that my algorithm is used in PocketSNES coming Friday.


    http://www.brighthand.com/ubb/Forum33/HTML/008485.html
    PocketFC is now out; author mentions it uses my algorithm.


    This algorithm should be used by all emulator authors for
    fullscreen landscape mode of NES and SNES emulators (and other
    gaming systems that produce a 240x240 framebuffer or very close)
    It will also work great for GameBoy emulators scaling 160 into 240
    along one screen axis, too!

    If you could publicize this scaling algorithm, so that it would
    be used more often by more emulator writers, it would be greatly
    appreciated!


    ------------------
    Thanks,
    Mark Rejhon
    www.marky.com
     
    Last edited by a moderator: May 19, 2015
  2. imported_Phantom

    imported_Phantom Member

    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    21
    Mark,

    We desperately need some kind of programming forum. As a coder, I have read about your algorithm, of course. [​IMG] I even posted some similar info myself, but it got mostly ignored - Apparently, you are afraid of just that. My post was about pre-processing an image on the PC to improve it's appearance on the pocketPC. Basically, it works like this: If you scale from 240x960 to 240x240, the normal way would be to take a simple average of three pixels for the final image. A better way, that takes into account the physical layout of the color components on the iPaq display, is to pick red from the (line modulo 3 == 0) lines, green from the (line modulo 3 == 1) lines and blue from the remaining lines. This results in much better scaled b/w images, but it doesn't help a lot for photo's.
    Anyway, the only reasons for mentioning that is to indicate the need for a programming forum (where posts like these don't get lost between the 'Shop XYZ has iPaqs!' posts (not unimportant, by the way).

    O and you can now reach me at
    JaccoBikker@hotmail.com . Apparently, my e-mail forwarding service at goright.to doesn't work anymore.

    - Phantom
     
  3. imported_Mark Rejhon

    imported_Mark Rejhon Mobile Deity

    Messages:
    841
    Likes Received:
    0
    Trophy Points:
    66
    I agree about the programming forum... I would have posted in that forum instead!

    (As long as it has reasonable traffic, or there isn't much point - I recall righthand used to have a Developer forum, but it wasn't popular. Perhaps there's enough demand now? Or the word needs to be spread...)

    ------------------
    Thanks,
    Mark Rejhon
    www.marky.com
     
  4. Inaki

    Inaki Guest

    Mark,
    this technique has been already being used in JS Landscape Plus for months. We have had a lot of feedback from beta testers about what is good and what is not so good about this technique. Of course we have tried it with emulators, games, spreadsheets, pdf readers,.etc.

    It is good for images but it is not good for text. Also it does not fit well to some color combinations.

    Landscape Plus however does not allow for 960 pixel mode because being a general video driver this mode results in a too much distorted screen for most purposes. It shares color among every two pixels to avoid excesive color shift. So it gives 480x240 and 240x480 modes.

    Curiously it looks much better on iPaq because of the 12bpp color depth. On Casios color shift is much more noticeable.

    An interesting technique nevertheless.

    Inaki.
    JimmySoftware


     
  5. mknight

    mknight Mobile Consultant

    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    11
    Can we hear more about this landscape plus appliaction. I recently purchased JS Landscape, but didn't know there was a plus version. Is it available now? Will there be an upgrade for the folks that already purchased Landscape (regular)?

     
  6. Kenny Goers

    Kenny Goers Senior Member

    Messages:
    140
    Likes Received:
    0
    Trophy Points:
    21
    There used to be a programmers forum and nobody but myself and a couple of others read it or posted to it. Instead go to pocketprojects.com, or my programmers email list below.


    ------------------
    _Kenny.
    List Administrator
    http://www.yahoogroups.com/list/windowsce-dev/
    800 Members and growing
     
  7. +

    + Guest

    mknight,

    Landscape+ effectively doubles the onscreen display, or to an extent while in Landscape mode. Landscape-a simply rotates the screen.

    I've only heard of a Casio version. This is all i know.

     
Thread Status:
Not open for further replies.

Share This Page