Lines 275-280
Link Here
|
275 |
void Convert16To24 (int width, int height); |
275 |
void Convert16To24 (int width, int height); |
276 |
void Convert16To24Packed (int width, int height); |
276 |
void Convert16To24Packed (int width, int height); |
277 |
void SetupImage (); |
277 |
void SetupImage (); |
|
|
278 |
void TakedownImage (); |
278 |
int ErrorHandler (Display *, XErrorEvent *); |
279 |
int ErrorHandler (Display *, XErrorEvent *); |
279 |
void TVMode (int width, int height); |
280 |
void TVMode (int width, int height); |
280 |
|
281 |
|
Lines 314-349
Link Here
|
314 |
#endif |
315 |
#endif |
315 |
|
316 |
|
316 |
S9xTextMode (); |
317 |
S9xTextMode (); |
317 |
uint32 i; |
318 |
TakedownImage (); |
318 |
|
|
|
319 |
for (i = 0; i < sizeof (GUI.to_free) / sizeof (GUI.to_free [0]); i++) |
320 |
if (GUI.to_free [i]) |
321 |
{ |
322 |
free (GUI.to_free [i]); |
323 |
GUI.to_free [i] = NULL; |
324 |
} |
325 |
|
326 |
if (GUI.image) |
327 |
{ |
328 |
#ifdef MITSHM |
329 |
if (GUI.use_shared_memory) |
330 |
{ |
331 |
XShmDetach (GUI.display, &GUI.sm_info); |
332 |
GUI.image->data = NULL; |
333 |
XDestroyImage (GUI.image); |
334 |
if (GUI.sm_info.shmaddr) |
335 |
shmdt (GUI.sm_info.shmaddr); |
336 |
if (GUI.sm_info.shmid >= 0) |
337 |
shmctl (GUI.sm_info.shmid, IPC_RMID, 0); |
338 |
GUI.image = NULL; |
339 |
} |
340 |
else |
341 |
#endif |
342 |
{ |
343 |
XDestroyImage (GUI.image); |
344 |
GUI.image = NULL; |
345 |
} |
346 |
} |
347 |
XSync (GUI.display, False); |
319 |
XSync (GUI.display, False); |
348 |
XCloseDisplay (GUI.display); |
320 |
XCloseDisplay (GUI.display); |
349 |
} |
321 |
} |
Lines 715-750
Link Here
|
715 |
; |
687 |
; |
716 |
} |
688 |
} |
717 |
|
689 |
|
718 |
uint32 i; |
690 |
TakedownImage (); |
719 |
|
|
|
720 |
for (i = 0; i < sizeof (GUI.to_free) / sizeof (GUI.to_free [0]); i++) |
721 |
if (GUI.to_free [i]) |
722 |
{ |
723 |
free (GUI.to_free [i]); |
724 |
GUI.to_free [i] = NULL; |
725 |
} |
726 |
|
727 |
if (GUI.image) |
728 |
{ |
729 |
#ifdef MITSHM |
730 |
if (GUI.use_shared_memory) |
731 |
{ |
732 |
XShmDetach (GUI.display, &GUI.sm_info); |
733 |
GUI.image->data = NULL; |
734 |
XDestroyImage (GUI.image); |
735 |
if (GUI.sm_info.shmaddr) |
736 |
shmdt (GUI.sm_info.shmaddr); |
737 |
if (GUI.sm_info.shmid >= 0) |
738 |
shmctl (GUI.sm_info.shmid, IPC_RMID, 0); |
739 |
GUI.image = NULL; |
740 |
} |
741 |
else |
742 |
#endif |
743 |
{ |
744 |
XDestroyImage (GUI.image); |
745 |
GUI.image = NULL; |
746 |
} |
747 |
} |
748 |
|
691 |
|
749 |
#ifdef MITSHM |
692 |
#ifdef MITSHM |
750 |
GUI.use_shared_memory = 1; |
693 |
GUI.use_shared_memory = 1; |
Lines 884-891
Link Here
|
884 |
} |
827 |
} |
885 |
GUI.image_date = (uint8 *) GUI.image->data; |
828 |
GUI.image_date = (uint8 *) GUI.image->data; |
886 |
GUI.bytes_per_line = GUI.image->bytes_per_line; |
829 |
GUI.bytes_per_line = GUI.image->bytes_per_line; |
|
|
830 |
|
831 |
S9xGraphicsInit (); |
832 |
} |
833 |
|
834 |
void TakedownImage () |
835 |
{ |
836 |
uint32 i; |
837 |
|
838 |
for (i = 0; i < sizeof (GUI.to_free) / sizeof (GUI.to_free [0]); i++) |
839 |
if (GUI.to_free [i]) |
840 |
{ |
841 |
free (GUI.to_free [i]); |
842 |
GUI.to_free [i] = NULL; |
843 |
} |
844 |
|
845 |
if (GUI.image) |
846 |
{ |
847 |
#ifdef MITSHM |
848 |
if (GUI.use_shared_memory) |
849 |
{ |
850 |
XShmDetach (GUI.display, &GUI.sm_info); |
851 |
GUI.image->data = NULL; |
852 |
XDestroyImage (GUI.image); |
853 |
if (GUI.sm_info.shmaddr) |
854 |
shmdt (GUI.sm_info.shmaddr); |
855 |
if (GUI.sm_info.shmid >= 0) |
856 |
shmctl (GUI.sm_info.shmid, IPC_RMID, 0); |
857 |
GUI.image = NULL; |
858 |
} |
859 |
else |
860 |
#endif |
861 |
{ |
862 |
XDestroyImage (GUI.image); |
863 |
GUI.image = NULL; |
864 |
} |
865 |
} |
866 |
|
867 |
S9xGraphicsDeinit (); |
887 |
} |
868 |
} |
888 |
|
869 |
|
|
|
870 |
|
889 |
int ErrorHandler (Display *, XErrorEvent *) |
871 |
int ErrorHandler (Display *, XErrorEvent *) |
890 |
{ |
872 |
{ |
891 |
#ifdef MITSHM |
873 |
#ifdef MITSHM |
Lines 1002-1007
Link Here
|
1002 |
IPPU.RenderThisFrame = TRUE; |
984 |
IPPU.RenderThisFrame = TRUE; |
1003 |
IPPU.FrameSkip = Settings.SkipFrames; |
985 |
IPPU.FrameSkip = Settings.SkipFrames; |
1004 |
SetupImage (); |
986 |
SetupImage (); |
|
|
987 |
extern void S9xReRefresh(); |
988 |
S9xReRefresh (); |
1005 |
} |
989 |
} |
1006 |
#ifdef USE_DGA_EXTENSION |
990 |
#ifdef USE_DGA_EXTENSION |
1007 |
if (XF86.start_full_screen) |
991 |
if (XF86.start_full_screen) |