Fix the Scale2x code not allocating enough memory for sms_bitmap.

This commit is contained in:
gameblabla 2020-12-06 13:30:47 +01:00
parent cd147dabcd
commit 52fee3dd9c
No known key found for this signature in database
GPG Key ID: 55F5ECF22285E516
5 changed files with 5 additions and 5 deletions

View File

@ -1042,7 +1042,7 @@ int main (int argc, char *argv[])
SDL_JoystickEventState(SDL_ENABLE);
#ifdef SCALE2X_UPSCALER
scale2x_buf = SDL_CreateRGBSurface(SDL_SWSURFACE, VIDEO_WIDTH_SMS*2, 480, 16, 0, 0, 0, 0);
scale2x_buf = SDL_CreateRGBSurface(SDL_SWSURFACE, VIDEO_WIDTH_SMS*2, 267*2, 16, 0, 0, 0, 0);
#endif
fprintf(stdout, "CRC : %08X\n", cart.crc);

View File

@ -975,7 +975,7 @@ int main (int argc, char *argv[])
SDL_ShowCursor(0);
#ifdef SCALE2X_UPSCALER
scale2x_buf = SDL_CreateRGBSurface(SDL_SWSURFACE, VIDEO_WIDTH_SMS*2, 480, 16, 0, 0, 0, 0);
scale2x_buf = SDL_CreateRGBSurface(SDL_SWSURFACE, VIDEO_WIDTH_SMS*2, 267*2, 16, 0, 0, 0, 0);
#endif
fprintf(stdout, "CRC : %08X\n", cart.crc);

View File

@ -689,7 +689,7 @@ int main (int argc, char *argv[])
ioctl(fbfd, FBIOPAN_DISPLAY, &vinfo);
#ifdef SCALE2X_UPSCALER
scale2x_buf = malloc(((VIDEO_WIDTH_SMS*2)*480)*sizeof(uint16_t));
scale2x_buf = malloc(((VIDEO_WIDTH_SMS*2)*(267*2))*sizeof(uint16_t));
#endif
fprintf(stdout, "CRC : %08X\n", cart.crc);

View File

@ -626,7 +626,7 @@ int main (int argc, char *argv[])
SDL_ShowCursor(0);
#ifdef SCALE2X_UPSCALER
scale2x_buf = SDL_CreateRGBSurface(SDL_SWSURFACE, VIDEO_WIDTH_SMS*2, 480, 16, 0, 0, 0, 0);
scale2x_buf = SDL_CreateRGBSurface(SDL_SWSURFACE, VIDEO_WIDTH_SMS*2, 267*2, 16, 0, 0, 0, 0);
#endif
fprintf(stdout, "CRC : %08X\n", cart.crc);

View File

@ -783,7 +783,7 @@ int main (int argc, char *argv[])
sms_bitmap = SDL_CreateRGBSurface(SDL_SWSURFACE, VIDEO_WIDTH_SMS, 267, 16, 0, 0, 0, 0);
#ifdef SCALE2X_UPSCALER
scale2x_buf = SDL_CreateRGBSurface(SDL_SWSURFACE, VIDEO_WIDTH_SMS*2, 480, 16, 0, 0, 0, 0);
scale2x_buf = SDL_CreateRGBSurface(SDL_SWSURFACE, VIDEO_WIDTH_SMS*2, 267*2, 16, 0, 0, 0, 0);
#endif
img_background = SDL_LoadBMP("background.bmp");