Ticket #8177: dotmatrix-20030222.diff
File dotmatrix-20030222.diff, 6.2 KB (added by , 21 years ago) |
---|
-
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 503 503 quit(); 504 504 break; 505 505 } 506 // Ctr-Alt-1 till Ctrl-Alt- 8will change the GFX mode506 // Ctr-Alt-1 till Ctrl-Alt-9 will change the GFX mode 507 507 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')) { 509 509 Property prop; 510 510 prop.gfx_mode = ev.key.keysym.sym - '1'; 511 511 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 103 103 _scaleFactor = 2; 104 104 _scaler_proc = TV2x; 105 105 break; 106 case GFX_DOTMATRIX: 107 _scaleFactor = 2; 108 _scaler_proc = DotMatrix; 109 break; 106 110 107 111 case GFX_DOUBLESIZE: 108 112 _scaleFactor = 2; … … 345 349 #endif 346 350 return 1; 347 351 } else if (param == PROP_SET_GFX_MODE) { 348 if (value->gfx_mode >= 8)352 if (value->gfx_mode >= 9) 349 353 return 0; 350 354 351 355 _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 47 47 "\t-p<path> - look for game in <path>\n" 48 48 "\t-x[<num>] - load this savegame (default: 0 - autosave)\n" 49 49 "\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" 51 51 "\t-e<mode> - set music engine (see README for details)\n" 52 52 "\t-a - specify game is amiga version\n" 53 53 "\t-q<lang> - specify language (en,de,fr,it,pt,es,ja,zh,ko,hb)\n" … … 194 194 {"supereagle", "SuperEagle", GFX_SUPEREAGLE}, 195 195 {"advmame2x", "AdvMAME2x", GFX_ADVMAME2X}, 196 196 {"tv2x", "TV2x", GFX_TV2X}, 197 {"dotmatrix", "DotMatrix", GFX_DOTMATRIX}, 197 198 {0, 0} 198 199 }; 199 200 -
scummvm/common/scaler.cpp
diff -ur scummvm-20030221/scummvm/common/scaler.cpp scummvm-20030221_dot/scummvm/common/scaler.cpp
old new 32 32 static uint32 redblueMask = 0xF81F; 33 33 static uint32 greenMask = 0x7E0; 34 34 35 static 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 }; 41 static 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 }; 47 static const uint16 *dotmatrix; 48 35 49 int Init_2xSaI(uint32 BitFormat) 36 50 { 37 51 if (BitFormat == 565) { … … 41 55 qlowpixelMask = 0x18631863; 42 56 redblueMask = 0xF81F; 43 57 greenMask = 0x7E0; 58 dotmatrix = dotmatrix_565; 44 59 } else if (BitFormat == 555) { 45 60 colorMask = 0x7BDE7BDE; 46 61 lowPixelMask = 0x04210421; … … 48 63 qlowpixelMask = 0x0C630C63; 49 64 redblueMask = 0x7C1F; 50 65 greenMask = 0x3E0; 66 dotmatrix = dotmatrix_555; 51 67 } else { 52 68 return 0; 53 69 } … … 825 841 *(q + j + 1) = p1; 826 842 *(q + j + nextlineDst) = (uint16)pi; 827 843 *(q + j + nextlineDst + 1) = (uint16)pi; 844 } 845 p += nextlineSrc; 846 q += nextlineDst << 1; 847 } 848 } 849 850 static inline uint16 DOT_16(uint16 c, int j, int i) { 851 return c - ((c >> 2) & *(dotmatrix + ((j & 3) << 2) + (i & 3))); 852 } 853 854 void 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); 828 870 } 829 871 p += nextlineSrc; 830 872 q += nextlineDst << 1; -
scummvm/common/scaler.h
diff -ur scummvm-20030221/scummvm/common/scaler.h scummvm-20030221_dot/scummvm/common/scaler.h
old new 38 38 uint8 *dstPtr, uint32 dstPitch, int width, int height); 39 39 extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, 40 40 uint8 *dstPtr, uint32 dstPitch, int width, int height); 41 extern void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null, 42 uint8 *dstPtr, uint32 dstPitch, int width, int height); 41 43 42 44 #endif -
scummvm/common/system.h
diff -ur scummvm-20030221/scummvm/common/system.h scummvm-20030221_dot/scummvm/common/system.h
old new 223 223 GFX_SUPER2XSAI = 4, 224 224 GFX_SUPEREAGLE = 5, 225 225 GFX_ADVMAME2X = 6, 226 GFX_TV2X = 7 226 GFX_TV2X = 7, 227 GFX_DOTMATRIX = 8 227 228 }; 228 229 229 230 -
scummvm/gui/options.cpp
diff -ur scummvm-20030221/scummvm/gui/options.cpp scummvm-20030221_dot/scummvm/gui/options.cpp
old new 70 70 gfxPopUp->appendEntry("SuperEagle"); 71 71 gfxPopUp->appendEntry("AdvMAME2x"); 72 72 gfxPopUp->appendEntry("TV2x"); 73 gfxPopUp->appendEntry("DotMatrix"); 73 74 gfxPopUp->setSelected(0); 74 75 75 76 // The MIDI mode popup & a label