mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-03 07:11:49 +00:00
parent
f6bac973f8
commit
086a89f365
@ -503,9 +503,9 @@ bool OSystem_SDL_Common::poll_event(Event *event) {
|
||||
quit();
|
||||
break;
|
||||
}
|
||||
// Ctr-Alt-1 till Ctrl-Alt-8 will change the GFX mode
|
||||
// Ctr-Alt-1 till Ctrl-Alt-9 will change the GFX mode
|
||||
if (b == (KBD_CTRL|KBD_ALT) &&
|
||||
(ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='8')) {
|
||||
(ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='9')) {
|
||||
Property prop;
|
||||
prop.gfx_mode = ev.key.keysym.sym - '1';
|
||||
property(PROP_SET_GFX_MODE, &prop);
|
||||
|
@ -103,6 +103,10 @@ void OSystem_SDL::load_gfx_mode() {
|
||||
_scaleFactor = 2;
|
||||
_scaler_proc = TV2x;
|
||||
break;
|
||||
case GFX_DOTMATRIX:
|
||||
_scaleFactor = 2;
|
||||
_scaler_proc = DotMatrix;
|
||||
break;
|
||||
|
||||
case GFX_DOUBLESIZE:
|
||||
_scaleFactor = 2;
|
||||
@ -345,7 +349,7 @@ uint32 OSystem_SDL::property(int param, Property *value) {
|
||||
#endif
|
||||
return 1;
|
||||
} else if (param == PROP_SET_GFX_MODE) {
|
||||
if (value->gfx_mode >= 8)
|
||||
if (value->gfx_mode >= 9)
|
||||
return 0;
|
||||
|
||||
_mode = value->gfx_mode;
|
||||
|
@ -47,7 +47,7 @@ static const char USAGE_STRING[] =
|
||||
"\t-p<path> - look for game in <path>\n"
|
||||
"\t-x[<num>] - load this savegame (default: 0 - autosave)\n"
|
||||
"\t-f - fullscreen mode\n"
|
||||
"\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x)\n"
|
||||
"\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x,dotmatrix)\n"
|
||||
"\t-e<mode> - set music engine (see README for details)\n"
|
||||
"\t-a - specify game is amiga version\n"
|
||||
"\t-q<lang> - specify language (en,de,fr,it,pt,es,ja,zh,ko,hb)\n"
|
||||
@ -91,6 +91,7 @@ static const struct GraphicsModes gfx_modes[] = {
|
||||
{"supereagle", "SuperEagle", GFX_SUPEREAGLE},
|
||||
{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
|
||||
{"tv2x", "TV2x", GFX_TV2X},
|
||||
{"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
|
@ -32,6 +32,20 @@ static uint32 qlowpixelMask = 0x18631863;
|
||||
static uint32 redblueMask = 0xF81F;
|
||||
static uint32 greenMask = 0x7E0;
|
||||
|
||||
static const uint16 dotmatrix_565[16] = {
|
||||
0x01E0, 0x0007, 0x3800, 0x0000,
|
||||
0x39E7, 0x0000, 0x39E7, 0x0000,
|
||||
0x3800, 0x0000, 0x01E0, 0x0007,
|
||||
0x39E7, 0x0000, 0x39E7, 0x0000
|
||||
};
|
||||
static const uint16 dotmatrix_555[16] = {
|
||||
0x00E0, 0x0007, 0x1C00, 0x0000,
|
||||
0x1CE7, 0x0000, 0x1CE7, 0x0000,
|
||||
0x1C00, 0x0000, 0x00E0, 0x0007,
|
||||
0x1CE7, 0x0000, 0x1CE7, 0x0000
|
||||
};
|
||||
static const uint16 *dotmatrix;
|
||||
|
||||
int Init_2xSaI(uint32 BitFormat)
|
||||
{
|
||||
if (BitFormat == 565) {
|
||||
@ -41,6 +55,7 @@ int Init_2xSaI(uint32 BitFormat)
|
||||
qlowpixelMask = 0x18631863;
|
||||
redblueMask = 0xF81F;
|
||||
greenMask = 0x7E0;
|
||||
dotmatrix = dotmatrix_565;
|
||||
} else if (BitFormat == 555) {
|
||||
colorMask = 0x7BDE7BDE;
|
||||
lowPixelMask = 0x04210421;
|
||||
@ -48,6 +63,7 @@ int Init_2xSaI(uint32 BitFormat)
|
||||
qlowpixelMask = 0x0C630C63;
|
||||
redblueMask = 0x7C1F;
|
||||
greenMask = 0x3E0;
|
||||
dotmatrix = dotmatrix_555;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@ -830,3 +846,29 @@ void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dst
|
||||
q += nextlineDst << 1;
|
||||
}
|
||||
}
|
||||
|
||||
static inline uint16 DOT_16(uint16 c, int j, int i) {
|
||||
return c - ((c >> 2) & *(dotmatrix + ((j & 3) << 2) + (i & 3)));
|
||||
}
|
||||
|
||||
void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
|
||||
int width, int height)
|
||||
{
|
||||
unsigned int nextlineSrc = srcPitch / sizeof(uint16);
|
||||
uint16 *p = (uint16 *)srcPtr;
|
||||
|
||||
unsigned int nextlineDst = dstPitch / sizeof(uint16);
|
||||
uint16 *q = (uint16 *)dstPtr;
|
||||
|
||||
for (int j = 0, jj = 0; j < height; ++j, jj += 2) {
|
||||
for (int i = 0, ii = 0; i < width; ++i, ii += 2) {
|
||||
uint16 c = *(p + i);
|
||||
*(q + ii) = DOT_16(c, jj, ii);
|
||||
*(q + ii + 1) = DOT_16(c, jj, ii + 1);
|
||||
*(q + ii + nextlineDst) = DOT_16(c, jj + 1, ii);
|
||||
*(q + ii + nextlineDst + 1) = DOT_16(c, jj + 1, ii + 1);
|
||||
}
|
||||
p += nextlineSrc;
|
||||
q += nextlineDst << 1;
|
||||
}
|
||||
}
|
||||
|
@ -38,5 +38,7 @@ extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
|
||||
uint8 *dstPtr, uint32 dstPitch, int width, int height);
|
||||
extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
|
||||
uint8 *dstPtr, uint32 dstPitch, int width, int height);
|
||||
extern void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
|
||||
uint8 *dstPtr, uint32 dstPitch, int width, int height);
|
||||
|
||||
#endif
|
||||
|
@ -223,7 +223,8 @@ enum {
|
||||
GFX_SUPER2XSAI = 4,
|
||||
GFX_SUPEREAGLE = 5,
|
||||
GFX_ADVMAME2X = 6,
|
||||
GFX_TV2X = 7
|
||||
GFX_TV2X = 7,
|
||||
GFX_DOTMATRIX = 8
|
||||
};
|
||||
|
||||
|
||||
|
@ -70,6 +70,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(NewGui *gui)
|
||||
gfxPopUp->appendEntry("SuperEagle");
|
||||
gfxPopUp->appendEntry("AdvMAME2x");
|
||||
gfxPopUp->appendEntry("TV2x");
|
||||
gfxPopUp->appendEntry("DotMatrix");
|
||||
gfxPopUp->setSelected(0);
|
||||
|
||||
// The MIDI mode popup & a label
|
||||
|
Loading…
x
Reference in New Issue
Block a user