158 |
|
|
159 |
|
|
160 |
|
/* |
161 |
+ |
* SDL surface locking glue |
162 |
+ |
*/ |
163 |
+ |
|
164 |
+ |
#ifdef ENABLE_VOSF |
165 |
+ |
#define SDL_VIDEO_LOCK_VOSF_SURFACE(SURFACE) do { \ |
166 |
+ |
if ((SURFACE)->flags & (SDL_HWSURFACE | SDL_FULLSCREEN)) \ |
167 |
+ |
the_host_buffer = (uint8 *)(SURFACE)->pixels; \ |
168 |
+ |
} while (0) |
169 |
+ |
#else |
170 |
+ |
#define SDL_VIDEO_LOCK_VOSF_SURFACE(SURFACE) |
171 |
+ |
#endif |
172 |
+ |
|
173 |
+ |
#define SDL_VIDEO_LOCK_SURFACE(SURFACE) do { \ |
174 |
+ |
if (SDL_MUSTLOCK(SURFACE)) { \ |
175 |
+ |
SDL_LockSurface(SURFACE); \ |
176 |
+ |
SDL_VIDEO_LOCK_VOSF_SURFACE(SURFACE); \ |
177 |
+ |
} \ |
178 |
+ |
} while (0) |
179 |
+ |
|
180 |
+ |
#define SDL_VIDEO_UNLOCK_SURFACE(SURFACE) do { \ |
181 |
+ |
if (SDL_MUSTLOCK(SURFACE)) \ |
182 |
+ |
SDL_UnlockSurface(SURFACE); \ |
183 |
+ |
} while (0) |
184 |
+ |
|
185 |
+ |
|
186 |
+ |
/* |
187 |
|
* Framebuffer allocation routines |
188 |
|
*/ |
189 |
|
|
190 |
|
static void *vm_acquire_framebuffer(uint32 size) |
191 |
|
{ |
166 |
– |
#ifdef SHEEPSHAVER |
167 |
– |
#ifdef DIRECT_ADDRESSING_HACK |
168 |
– |
const uint32 FRAME_BUFFER_BASE = 0x61000000; |
169 |
– |
uint8 *fb = Mac2HostAddr(FRAME_BUFFER_BASE); |
170 |
– |
if (vm_acquire_fixed(fb, size) < 0) |
171 |
– |
fb = VM_MAP_FAILED; |
172 |
– |
return fb; |
173 |
– |
#endif |
174 |
– |
#endif |
192 |
|
return vm_acquire(size); |
193 |
|
} |
194 |
|
|