void Screen::SetScreenSize(unsigned int width, unsigned int height) { this->width = width; this->height = height; SDL_SetWindowSize(this->MainWnd, width, height); this->buffer = SDL_GetWindowSurface(this->MainWnd); this->ScreenSurface = SDL2Function::CreateRGBSurface(0, (int)width, (int)height); CleanScreen(); }
void DumpFlash(tDevice dev, tDumpMode mode) { int totalBlocks= WII_FLASH_SIZE/FLASH_BLOCKSIZE; // Number of pages in NAND int totalSteps= totalBlocks/WII_MAX_BUFFER; FILE *pFile; int blocks_read=0; int steps= 0; // To test //totalSteps= 2; buffer = (u8*) memalign(0x40, WII_MAX_BUFFER*getDumpBlockSize(mode)); if(buffer==NULL) { printf("ERROR: Unable to allocate enough memory for buffer. Unable to continue. Exiting...\n"); pressAnyButton(); exit(0); } initialise_fat(dev); pFile = fopen(getDeviceFile(dev, mode), "wb+"); if (pFile==NULL) { printf("ERROR: fopen(\"%s\") failed. No FAT filesystem on the %s?\n", getDeviceFile(dev, mode), getDeviceName(dev)); pressAnyButton(); exit(0); } else { fclose(pFile); CleanScreen(); for(steps=0; steps<totalSteps; steps++) { // Block set to read in this step starts on... blocks_read= steps*WII_MAX_BUFFER; if((steps % WII_SCREEN_LINES)==0) {CleanScreen(); printf("\nDumping NAND. Pass %d of %d.", (steps/WII_SCREEN_LINES)+1, WII_SCREEN_STEPS);} ReadFlash(blocks_read, mode); AppendToFile(dev, mode); } } printf("\n\nEnd of Flash Dump."); pressAnyButton(); if(buffer!=NULL) free(buffer); }
void Screen::CheckPosition() { if (this->OutputPosition.x >= this->ScreenSurface->w) { NewLine(); } if (this->OutputPosition.y >= this->ScreenSurface->h) { this->OutputPosition.x = 0; this->OutputPosition.y = 0; CleanScreen(); } }