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.32 by asvitkine, 2007-01-22T00:36:32Z vs.
Revision 1.35 by asvitkine, 2008-06-20T00:45:27Z

# Line 1 | Line 1
1   /*
2   *  video_sdl.cpp - Video/graphics emulation, SDL specific stuff
3   *
4 < *  Basilisk II (C) 1997-2005 Christian Bauer
4 > *  Basilisk II (C) 1997-2008 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 136 | Line 136 | static SDL_Cursor *sdl_cursor;                                         // C
136   static volatile bool cursor_changed = false;            // Flag: cursor changed, redraw_func must update the cursor
137   static SDL_Color sdl_palette[256];                                      // Color palette to be used as CLUT and gamma table
138   static bool sdl_palette_changed = false;                        // Flag: Palette changed, redraw thread must set new colors
139 < static const int sdl_eventmask = SDL_MOUSEBUTTONDOWNMASK | SDL_MOUSEBUTTONUPMASK | SDL_MOUSEMOTIONMASK | SDL_KEYUPMASK | SDL_KEYDOWNMASK | SDL_VIDEOEXPOSEMASK | SDL_QUITMASK;
139 > static const int sdl_eventmask = SDL_MOUSEEVENTMASK | SDL_KEYEVENTMASK | SDL_VIDEOEXPOSEMASK | SDL_QUITMASK | SDL_ACTIVEEVENTMASK;
140  
141   // Mutex to protect SDL events
142   static SDL_mutex *sdl_events_lock = NULL;
# 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 747 | Line 759 | driver_window::driver_window(SDL_monitor
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;
# Line 1846 | Line 1858 | static void handle_events(void)
1858                                  ADBKeyDown(0x7f);       // Power key
1859                                  ADBKeyUp(0x7f);
1860                                  break;
1861 +
1862 +                        // Application activate/deactivate; consume the event but otherwise ignore it
1863 +                        case SDL_ACTIVEEVENT:
1864 +                                break;
1865                          }
1866                  }
1867          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines