riscos: Fix returning from full-screen to 16M colour modes SDL-1.2
authorCameron Cawley <ccawley2011@gmail.com>
Fri, 17 Aug 2018 22:37:16 +0100
branchSDL-1.2
changeset 125022560bdcf3130
parent 12409 67aeabf947b2
child 12535 edb58d951656
riscos: Fix returning from full-screen to 16M colour modes
src/video/riscos/SDL_riscostask.c
     1.1 --- a/src/video/riscos/SDL_riscostask.c	Wed Nov 14 20:00:03 2018 +0300
     1.2 +++ b/src/video/riscos/SDL_riscostask.c	Fri Aug 17 22:37:16 2018 +0100
     1.3 @@ -72,10 +72,14 @@
     1.4          int blockSize = 0;
     1.5  		int *storeBlock = (int *)stored_mode;
     1.6  
     1.7 -        while(blockSize < 5 || storeBlock[blockSize] != -1)
     1.8 +        while(blockSize < 5)
     1.9          {
    1.10             fprintf(stderr, "   %d\n", storeBlock[blockSize++]);
    1.11          }
    1.12 +        while(storeBlock[blockSize] != -1)
    1.13 +        {
    1.14 +           fprintf(stderr, "   %d   %d\n", storeBlock[blockSize++], storeBlock[blockSize++]);
    1.15 +        }
    1.16      }
    1.17  }
    1.18  #endif
    1.19 @@ -285,7 +289,8 @@
    1.20  		int *storeBlock;
    1.21          int j;
    1.22  
    1.23 -        while(blockSize < 5 || retBlock[blockSize] != -1) blockSize++;
    1.24 +        while(blockSize < 5) blockSize++;
    1.25 +        while(retBlock[blockSize] != -1) blockSize+=2;
    1.26          blockSize++;
    1.27          storeBlock = (int *)SDL_malloc(blockSize * sizeof(int));
    1.28          retBlock = (int *)regs.r[1];
    1.29 @@ -294,7 +299,7 @@
    1.30  
    1.31  		stored_mode = (int)storeBlock;
    1.32       }
    1.33 -#if DUMP_MODE
    1.34 +#ifdef DUMP_MODE
    1.35      fprintf(stderr, "Stored "); dump_mode();
    1.36  #endif
    1.37  }
    1.38 @@ -312,7 +317,7 @@
    1.39  	/* Only need to restore if we are in full screen mode */
    1.40  	if (stored_mode == -1) return;
    1.41  
    1.42 -#if DUMP_MODE
    1.43 +#ifdef DUMP_MODE
    1.44     fprintf(stderr, "Restored"); dump_mode();
    1.45  #endif
    1.46