ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/SDL/video_sdl.cpp
(Generate patch)

Comparing BasiliskII/src/SDL/video_sdl.cpp (file contents):
Revision 1.31 by asvitkine, 2007-01-22T00:32:25Z vs.
Revision 1.33 by gbeauche, 2007-06-14T14:45:54Z

# Line 197 | Line 197 | extern void SysMountFirstFloppy(void);
197  
198   static void *vm_acquire_framebuffer(uint32 size)
199   {
200 <        return vm_acquire(size);
200 >        // always try to reallocate framebuffer at the same address
201 >        static void *fb = VM_MAP_FAILED;
202 >        if (fb != VM_MAP_FAILED) {
203 >                if (vm_acquire_fixed(fb, size) < 0) {
204 > #ifndef SHEEPSHAVER
205 >                        printf("FATAL: Could not reallocate framebuffer at previous address\n");
206 > #endif
207 >                        fb = VM_MAP_FAILED;
208 >                }
209 >        }
210 >        if (fb == VM_MAP_FAILED)
211 >                fb = vm_acquire(size, VM_MAP_DEFAULT | VM_MAP_32BIT);
212 >        return fb;
213   }
214  
215   static inline void vm_release_framebuffer(void *fb, uint32 size)
# Line 719 | Line 731 | void driver_base::restore_mouse_accel(vo
731   *  Windowed display driver
732   */
733  
734 < static int SDL_display_opened = FALSE;
734 > static bool SDL_display_opened = false;
735  
736   // Open display
737   driver_window::driver_window(SDL_monitor_desc &m)
# Line 735 | Line 747 | driver_window::driver_window(SDL_monitor
747          // This is ugly:
748          // If we're switching resolutions (ie, not setting it for the first time),
749          // there's a bug in SDL where the SDL_Surface created will not be properly
750 <        // setup. The solution is to SDL_Quit() before calling SDL_SetVideoMode for
751 <        // the second time (SDL_SetVideoMode will call SDL_Init() and all will be
752 <        // well). Without this, the video becomes corrupted (at least on Mac OS X),
753 <        // after the resolution switch (for the second and subsequent times).
754 < // EDIT: Ack, this breaks audio!
755 < //      if (SDL_display_opened)
744 < //              SDL_Quit();
750 >        // setup. The solution is to SDL_QuitSubSystem(SDL_INIT_VIDEO) before calling
751 >        // SDL_SetVideoMode for the second time (SDL_SetVideoMode will call SDL_Init()
752 >        // and all will be well). Without this, the video becomes corrupted (at least
753 >        // on Mac OS X), after the resolution switch.
754 >        if (SDL_display_opened)
755 >                SDL_QuitSubSystem(SDL_INIT_VIDEO);
756  
757          // Create surface
758          int depth = sdl_depth_of_video_depth(VIDEO_MODE_DEPTH);
759          if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE)) == NULL)
760                  return;
761  
762 <        SDL_display_opened = TRUE;
762 >        SDL_display_opened = true;
763  
764   #ifdef ENABLE_VOSF
765          use_vosf = true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines