comparison src/video/xbios/SDL_xbios.c @ 1104:bf145eaf76ef

Tell user how many bytes are needed
author Patrice Mandin <patmandin@gmail.com>
date Wed, 27 Jul 2005 19:46:59 +0000
parents 18e5babe266e
children 1901fea5edac
comparison
equal deleted inserted replaced
1103:18e5babe266e 1104:bf145eaf76ef
550 550
551 if (new_depth == 8) { 551 if (new_depth == 8) {
552 XBIOS_shadowscreen = Atari_SysMalloc(new_screen_size, MX_PREFTTRAM); 552 XBIOS_shadowscreen = Atari_SysMalloc(new_screen_size, MX_PREFTTRAM);
553 553
554 if (XBIOS_shadowscreen == NULL) { 554 if (XBIOS_shadowscreen == NULL) {
555 SDL_SetError("XBIOS_SetVideoMode: Not enough memory for shadow surface"); 555 SDL_SetError("Can not allocate %d KB for shadow buffer", new_screen_size>>10);
556 return (NULL); 556 return (NULL);
557 } 557 }
558 memset(XBIOS_shadowscreen, 0, new_screen_size); 558 memset(XBIOS_shadowscreen, 0, new_screen_size);
559 } 559 }
560 560
567 567
568 XBIOS_screensmem[0] = Atari_SysMalloc(new_screen_size, MX_STRAM); 568 XBIOS_screensmem[0] = Atari_SysMalloc(new_screen_size, MX_STRAM);
569 569
570 if (XBIOS_screensmem[0]==NULL) { 570 if (XBIOS_screensmem[0]==NULL) {
571 XBIOS_FreeBuffers(this); 571 XBIOS_FreeBuffers(this);
572 SDL_SetError("XBIOS_SetVideoMode: Not enough memory for video buffer"); 572 SDL_SetError("Can not allocate %d KB for frame buffer", new_screen_size>>10);
573 return (NULL); 573 return (NULL);
574 } 574 }
575 memset(XBIOS_screensmem[0], 0, new_screen_size); 575 memset(XBIOS_screensmem[0], 0, new_screen_size);
576 576
577 XBIOS_screens[0]=(void *) (( (long) XBIOS_screensmem[0]+256) & 0xFFFFFF00UL); 577 XBIOS_screens[0]=(void *) (( (long) XBIOS_screensmem[0]+256) & 0xFFFFFF00UL);
588 if (flags & SDL_DOUBLEBUF) { 588 if (flags & SDL_DOUBLEBUF) {
589 XBIOS_screensmem[1] = Atari_SysMalloc(new_screen_size, MX_STRAM); 589 XBIOS_screensmem[1] = Atari_SysMalloc(new_screen_size, MX_STRAM);
590 590
591 if (XBIOS_screensmem[1]==NULL) { 591 if (XBIOS_screensmem[1]==NULL) {
592 XBIOS_FreeBuffers(this); 592 XBIOS_FreeBuffers(this);
593 SDL_SetError("XBIOS_SetVideoMode: Not enough memory for double buffer"); 593 SDL_SetError("Can not allocate %d KB for double buffer", new_screen_size>>10);
594 return (NULL); 594 return (NULL);
595 } 595 }
596 memset(XBIOS_screensmem[1], 0, new_screen_size); 596 memset(XBIOS_screensmem[1], 0, new_screen_size);
597 597
598 XBIOS_screens[1]=(void *) (( (long) XBIOS_screensmem[1]+256) & 0xFFFFFF00UL); 598 XBIOS_screens[1]=(void *) (( (long) XBIOS_screensmem[1]+256) & 0xFFFFFF00UL);