Ticket #8177: dotmatrix-20030222.diff

File dotmatrix-20030222.diff, 6.2 KB (added by cyxx, 17 years ago)

Patch again a February 21 CVS snapshot

  • scummvm/backends/sdl/sdl-common.cpp

    diff -ur scummvm-20030221/scummvm/backends/sdl/sdl-common.cpp scummvm-20030221_dot/scummvm/backends/sdl/sdl-common.cpp
    old new  
    503503                                        quit();
    504504                                        break;
    505505                                }
    506                                 // Ctr-Alt-1 till Ctrl-Alt-8 will change the GFX mode
     506                                // Ctr-Alt-1 till Ctrl-Alt-9 will change the GFX mode
    507507                                if (b == (KBD_CTRL|KBD_ALT) &&
    508                                     (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='8')) {
     508                                    (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='9')) {
    509509                                        Property prop;
    510510                                        prop.gfx_mode = ev.key.keysym.sym - '1';
    511511                                        property(PROP_SET_GFX_MODE, &prop);
  • scummvm/backends/sdl/sdl.cpp

    diff -ur scummvm-20030221/scummvm/backends/sdl/sdl.cpp scummvm-20030221_dot/scummvm/backends/sdl/sdl.cpp
    old new  
    103103                _scaleFactor = 2;
    104104                _scaler_proc = TV2x;
    105105                break;
     106        case GFX_DOTMATRIX:
     107                _scaleFactor = 2;
     108                _scaler_proc = DotMatrix;
     109                break;
    106110
    107111        case GFX_DOUBLESIZE:
    108112                _scaleFactor = 2;
     
    345349#endif
    346350                return 1;
    347351        } else if (param == PROP_SET_GFX_MODE) {
    348                 if (value->gfx_mode >= 8)
     352                if (value->gfx_mode >= 9)
    349353                        return 0;
    350354
    351355                _mode = value->gfx_mode;
  • scummvm/common/gameDetector.cpp

    diff -ur scummvm-20030221/scummvm/common/gameDetector.cpp scummvm-20030221_dot/scummvm/common/gameDetector.cpp
    old new  
    4747        "\t-p<path>   - look for game in <path>\n"
    4848        "\t-x[<num>]  - load this savegame (default: 0 - autosave)\n"
    4949        "\t-f         - fullscreen mode\n"
    50         "\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x)\n"
     50        "\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x,dotmatrix)\n"
    5151        "\t-e<mode>   - set music engine (see README for details)\n"
    5252        "\t-a         - specify game is amiga version\n"
    5353        "\t-q<lang>   - specify language (en,de,fr,it,pt,es,ja,zh,ko,hb)\n"
     
    194194        {"supereagle", "SuperEagle", GFX_SUPEREAGLE},
    195195        {"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
    196196        {"tv2x", "TV2x", GFX_TV2X},
     197        {"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
    197198        {0, 0}
    198199};
    199200
  • scummvm/common/scaler.cpp

    diff -ur scummvm-20030221/scummvm/common/scaler.cpp scummvm-20030221_dot/scummvm/common/scaler.cpp
    old new  
    3232static uint32 redblueMask = 0xF81F;
    3333static uint32 greenMask = 0x7E0;
    3434
     35static const uint16 dotmatrix_565[16] = {
     36  0x01E0, 0x0007, 0x3800, 0x0000,
     37  0x39E7, 0x0000, 0x39E7, 0x0000,
     38  0x3800, 0x0000, 0x01E0, 0x0007,
     39  0x39E7, 0x0000, 0x39E7, 0x0000
     40};
     41static const uint16 dotmatrix_555[16] = {
     42  0x00E0, 0x0007, 0x1C00, 0x0000,
     43  0x1CE7, 0x0000, 0x1CE7, 0x0000,
     44  0x1C00, 0x0000, 0x00E0, 0x0007,
     45  0x1CE7, 0x0000, 0x1CE7, 0x0000
     46};
     47static const uint16 *dotmatrix;
     48
    3549int Init_2xSaI(uint32 BitFormat)
    3650{
    3751        if (BitFormat == 565) {
     
    4155                qlowpixelMask = 0x18631863;
    4256                redblueMask = 0xF81F;
    4357                greenMask = 0x7E0;
     58                dotmatrix = dotmatrix_565;
    4459        } else if (BitFormat == 555) {
    4560                colorMask = 0x7BDE7BDE;
    4661                lowPixelMask = 0x04210421;
     
    4863                qlowpixelMask = 0x0C630C63;
    4964                redblueMask = 0x7C1F;
    5065                greenMask = 0x3E0;
     66                dotmatrix = dotmatrix_555;
    5167        } else {
    5268                return 0;
    5369        }
     
    825841                        *(q + j + 1) = p1;
    826842                        *(q + j + nextlineDst) = (uint16)pi;
    827843                        *(q + j + nextlineDst + 1) = (uint16)pi;
     844                }
     845                p += nextlineSrc;
     846                q += nextlineDst << 1;
     847        }
     848}
     849
     850static inline uint16 DOT_16(uint16 c, int j, int i) {
     851  return c - ((c >> 2) & *(dotmatrix + ((j & 3) << 2) + (i & 3)));
     852}
     853
     854void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
     855                                        int width, int height)
     856{
     857        unsigned int nextlineSrc = srcPitch / sizeof(uint16);
     858        uint16 *p = (uint16 *)srcPtr;
     859
     860        unsigned int nextlineDst = dstPitch / sizeof(uint16);
     861        uint16 *q = (uint16 *)dstPtr;
     862
     863        for (int j = 0, jj = 0; j < height; ++j, jj += 2) {
     864                for (int i = 0, ii = 0; i < width; ++i, ii += 2) {
     865                        uint16 c = *(p + i);
     866                        *(q + ii) = DOT_16(c, jj, ii);
     867                        *(q + ii + 1) = DOT_16(c, jj, ii + 1);
     868                        *(q + ii + nextlineDst) = DOT_16(c, jj + 1, ii);
     869                        *(q + ii + nextlineDst + 1) = DOT_16(c, jj + 1, ii + 1);
    828870                }
    829871                p += nextlineSrc;
    830872                q += nextlineDst << 1;
  • scummvm/common/scaler.h

    diff -ur scummvm-20030221/scummvm/common/scaler.h scummvm-20030221_dot/scummvm/common/scaler.h
    old new  
    3838                                                                uint8 *dstPtr, uint32 dstPitch, int width, int height);
    3939extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
    4040                                                                uint8 *dstPtr, uint32 dstPitch, int width, int height);
     41extern void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
     42                                                                uint8 *dstPtr, uint32 dstPitch, int width, int height);
    4143
    4244#endif
  • scummvm/common/system.h

    diff -ur scummvm-20030221/scummvm/common/system.h scummvm-20030221_dot/scummvm/common/system.h
    old new  
    223223        GFX_SUPER2XSAI = 4,
    224224        GFX_SUPEREAGLE = 5,
    225225        GFX_ADVMAME2X = 6,
    226         GFX_TV2X = 7
     226        GFX_TV2X = 7,
     227        GFX_DOTMATRIX = 8
    227228};
    228229
    229230
  • scummvm/gui/options.cpp

    diff -ur scummvm-20030221/scummvm/gui/options.cpp scummvm-20030221_dot/scummvm/gui/options.cpp
    old new  
    7070        gfxPopUp->appendEntry("SuperEagle");
    7171        gfxPopUp->appendEntry("AdvMAME2x");
    7272        gfxPopUp->appendEntry("TV2x");
     73        gfxPopUp->appendEntry("DotMatrix");
    7374        gfxPopUp->setSelected(0);
    7475
    7576        // The MIDI mode popup & a label