From b7d4597db73401bc174c2ed4d8dda57ce1aa09c1 Mon Sep 17 00:00:00 2001 From: theoddone33 <> Date: Thu, 19 Apr 2001 19:48:15 +0000 Subject: [PATCH] add a bit depth selection switch --- zsnes/src/linux/sdllink.c | 12 ++++++++---- zsnes/src/linux/zloaderw.c | 15 +++++++++++++-- zsnes/src/ui.asm | 3 ++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/zsnes/src/linux/sdllink.c b/zsnes/src/linux/sdllink.c index 3bf70831..7283be48 100644 --- a/zsnes/src/linux/sdllink.c +++ b/zsnes/src/linux/sdllink.c @@ -107,7 +107,7 @@ DWORD CurrentJoy=0; SDL_Joystick *JoystickInput[4]; #endif //__LINUX__ -DWORD BitDepth; +DWORD BitDepth=0; BYTE BackColor=0; DEVMODE mode; @@ -1265,10 +1265,14 @@ int startgame(void) flags |= ( FullScreen ? SDL_FULLSCREEN : 0); - surface = SDL_SetVideoMode(WindowWidth, WindowHeight, 0, flags); + surface = SDL_SetVideoMode(WindowWidth, WindowHeight, BitDepth, flags); if (surface == NULL) { - fprintf (stderr, "Could not set %dx%d video mode.\n",SurfaceX, - SurfaceY); + 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, + SurfaceY); return FALSE; } diff --git a/zsnes/src/linux/zloaderw.c b/zsnes/src/linux/zloaderw.c index 12848c14..243c13e1 100644 --- a/zsnes/src/linux/zloaderw.c +++ b/zsnes/src/linux/zloaderw.c @@ -52,6 +52,7 @@ extern unsigned char Palette0, SPC700sh, OffBy1Line, DSPDisable, int getopt(int argc, char *const argv[], const char *optstring); extern char *optarg; extern int optind, opterr, optopt; +extern int BitDepth; void ccmdline(void); @@ -81,7 +82,7 @@ int main (int argc, char *argv[]) { char *fvar; 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) { /* Palette 0 disable */ case '0': { @@ -127,7 +128,17 @@ int main (int argc, char *argv[]) { } 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; } diff --git a/zsnes/src/ui.asm b/zsnes/src/ui.asm index 9862aa60..7ef7c434 100644 --- a/zsnes/src/ui.asm +++ b/zsnes/src/ui.asm @@ -138,7 +138,7 @@ NEWSYM welcome %else %ifdef __LINUX__ 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 %else 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 ' -a Turn on auto frame skip',13,10 %ifdef __LINUX__ + db ' -b # Select bit depth',13,10 db ' -cs Scale to fit screen (320x240 VESA2/640x480 VESA2)',13,10 %else db ' -c Scale to fit screen (320x240 VESA2/640x480 VESA2)',13,10