add a bit depth selection switch

This commit is contained in:
theoddone33
2001-04-19 19:48:15 +00:00
parent b72a81120e
commit b7d4597db7
3 changed files with 23 additions and 7 deletions

View File

@@ -107,7 +107,7 @@ DWORD CurrentJoy=0;
SDL_Joystick *JoystickInput[4]; SDL_Joystick *JoystickInput[4];
#endif //__LINUX__ #endif //__LINUX__
DWORD BitDepth; DWORD BitDepth=0;
BYTE BackColor=0; BYTE BackColor=0;
DEVMODE mode; DEVMODE mode;
@@ -1265,8 +1265,12 @@ int startgame(void)
flags |= ( FullScreen ? SDL_FULLSCREEN : 0); flags |= ( FullScreen ? SDL_FULLSCREEN : 0);
surface = SDL_SetVideoMode(WindowWidth, WindowHeight, 0, flags); surface = SDL_SetVideoMode(WindowWidth, WindowHeight, BitDepth, flags);
if (surface == NULL) { if (surface == NULL) {
if (BitDepth)
fprintf (stderr, "Could not set %dx%dx%d video mode.\n",
SurfaceX,SurfaceY,BitDepth);
else
fprintf (stderr, "Could not set %dx%d video mode.\n",SurfaceX, fprintf (stderr, "Could not set %dx%d video mode.\n",SurfaceX,
SurfaceY); SurfaceY);
return FALSE; return FALSE;

View File

@@ -52,6 +52,7 @@ extern unsigned char Palette0, SPC700sh, OffBy1Line, DSPDisable,
int getopt(int argc, char *const argv[], const char *optstring); int getopt(int argc, char *const argv[], const char *optstring);
extern char *optarg; extern char *optarg;
extern int optind, opterr, optopt; extern int optind, opterr, optopt;
extern int BitDepth;
void ccmdline(void); void ccmdline(void);
@@ -81,7 +82,7 @@ int main (int argc, char *argv[]) {
char *fvar; char *fvar;
UnProtectMemory(); UnProtectMemory();
while((opt = getopt(argc, argv, "01:2:789ac:d:ef:g:hijk:lmno:p:r:s:tuv:wyz?")) != -1) { while((opt = getopt(argc, argv, "01:2:789ab:c:d:ef:g:hijk:lmno:p:r:s:tuv:wyz?")) != -1) {
switch(opt) { switch(opt) {
/* Palette 0 disable */ /* Palette 0 disable */
case '0': { case '0': {
@@ -127,7 +128,17 @@ int main (int argc, char *argv[]) {
} }
case 'b': { case 'b': {
SoundCompD = 1; // What was this? - DDOI
//SoundCompD = 1;
if(optarg != NULL)
BitDepth = atoi(optarg);
if (BitDepth != 8 && BitDepth != 16 &&
BitDepth != 24 && BitDepth != 32)
{
printf ("%d is not a valid bit depth.\n", BitDepth);
exit(1);
}
break; break;
} }

View File

@@ -138,7 +138,7 @@ NEWSYM welcome
%else %else
%ifdef __LINUX__ %ifdef __LINUX__
db 'ZSNES v1.',ZVERSION,' beta (c)1997-2001 ZSNES Team (zsKnight - _Demo_)',13,10 db 'ZSNES v1.',ZVERSION,' beta (c)1997-2001 ZSNES Team (zsKnight - _Demo_)',13,10
db 'LINUX BETA VERSION!!! EXPECT CRASHES!!! Thank you!',13,10 db 'Linux beta version, please report crashes to zsnes-devel@lists.sourceforge.net.',13,10
db 'Compiled under NASM, GCC',13,10,13,10 db 'Compiled under NASM, GCC',13,10,13,10
%else %else
db 'ZSNES v1.',ZVERSION,' beta (c)1997-2001 ZSNES Team (zsKnight - _Demo_)',13,10 db 'ZSNES v1.',ZVERSION,' beta (c)1997-2001 ZSNES Team (zsKnight - _Demo_)',13,10
@@ -1303,6 +1303,7 @@ SECTION .data
db ' -9 Off by 1 line fix',13,10 db ' -9 Off by 1 line fix',13,10
db ' -a Turn on auto frame skip',13,10 db ' -a Turn on auto frame skip',13,10
%ifdef __LINUX__ %ifdef __LINUX__
db ' -b # Select bit depth',13,10
db ' -cs Scale to fit screen (320x240 VESA2/640x480 VESA2)',13,10 db ' -cs Scale to fit screen (320x240 VESA2/640x480 VESA2)',13,10
%else %else
db ' -c Scale to fit screen (320x240 VESA2/640x480 VESA2)',13,10 db ' -c Scale to fit screen (320x240 VESA2/640x480 VESA2)',13,10