src/video/riscos/SDL_riscostask.c
branchSDL-1.2
changeset 12502 2560bdcf3130
parent 6137 4720145f848b
equal deleted inserted replaced
12409:67aeabf947b2 12502:2560bdcf3130
    70     if (stored_mode < -1 || stored_mode >= 256)
    70     if (stored_mode < -1 || stored_mode >= 256)
    71     {
    71     {
    72         int blockSize = 0;
    72         int blockSize = 0;
    73 		int *storeBlock = (int *)stored_mode;
    73 		int *storeBlock = (int *)stored_mode;
    74 
    74 
    75         while(blockSize < 5 || storeBlock[blockSize] != -1)
    75         while(blockSize < 5)
    76         {
    76         {
    77            fprintf(stderr, "   %d\n", storeBlock[blockSize++]);
    77            fprintf(stderr, "   %d\n", storeBlock[blockSize++]);
       
    78         }
       
    79         while(storeBlock[blockSize] != -1)
       
    80         {
       
    81            fprintf(stderr, "   %d   %d\n", storeBlock[blockSize++], storeBlock[blockSize++]);
    78         }
    82         }
    79     }
    83     }
    80 }
    84 }
    81 #endif
    85 #endif
    82 
    86 
   283         int blockSize = 0;
   287         int blockSize = 0;
   284         int *retBlock = (int *)regs.r[1];
   288         int *retBlock = (int *)regs.r[1];
   285 		int *storeBlock;
   289 		int *storeBlock;
   286         int j;
   290         int j;
   287 
   291 
   288         while(blockSize < 5 || retBlock[blockSize] != -1) blockSize++;
   292         while(blockSize < 5) blockSize++;
       
   293         while(retBlock[blockSize] != -1) blockSize+=2;
   289         blockSize++;
   294         blockSize++;
   290         storeBlock = (int *)SDL_malloc(blockSize * sizeof(int));
   295         storeBlock = (int *)SDL_malloc(blockSize * sizeof(int));
   291         retBlock = (int *)regs.r[1];
   296         retBlock = (int *)regs.r[1];
   292         for ( j = 0; j < blockSize; j++)
   297         for ( j = 0; j < blockSize; j++)
   293            storeBlock[j] = retBlock[j];
   298            storeBlock[j] = retBlock[j];
   294 
   299 
   295 		stored_mode = (int)storeBlock;
   300 		stored_mode = (int)storeBlock;
   296      }
   301      }
   297 #if DUMP_MODE
   302 #ifdef DUMP_MODE
   298     fprintf(stderr, "Stored "); dump_mode();
   303     fprintf(stderr, "Stored "); dump_mode();
   299 #endif
   304 #endif
   300 }
   305 }
   301 
   306 
   302 /*****************************************************************
   307 /*****************************************************************
   310     _kernel_swi_regs regs;
   315     _kernel_swi_regs regs;
   311 
   316 
   312 	/* Only need to restore if we are in full screen mode */
   317 	/* Only need to restore if we are in full screen mode */
   313 	if (stored_mode == -1) return;
   318 	if (stored_mode == -1) return;
   314 
   319 
   315 #if DUMP_MODE
   320 #ifdef DUMP_MODE
   316    fprintf(stderr, "Restored"); dump_mode();
   321    fprintf(stderr, "Restored"); dump_mode();
   317 #endif
   322 #endif
   318 
   323 
   319     regs.r[0] = stored_mode;
   324     regs.r[0] = stored_mode;
   320     _kernel_swi(Wimp_SetMode, &regs, &regs);
   325     _kernel_swi(Wimp_SetMode, &regs, &regs);