--- uae/src/gfxlib.c 2018/04/24 16:40:02 1.1.1.3 +++ uae/src/gfxlib.c 2018/04/24 17:16:37 1.1.1.9 @@ -29,15 +29,14 @@ #include -#include "config.h" #include "options.h" -#include "threaddep/penguin.h" +#include "threaddep/thread.h" #include "memory.h" #include "custom.h" -#include "readcpu.h" #include "newcpu.h" #include "xwin.h" #include "autoconf.h" +#include "traps.h" #include "osemu.h" #include "osdep/exectasks.h" @@ -205,7 +204,7 @@ int GFX_WritePixel(uaecptr rp, int x, in int x2, y2; if (bitmap == 0) { - fprintf(stderr, "bogus RastPort in WritePixel\n"); + write_log ("bogus RastPort in WritePixel\n"); return -1; } @@ -237,7 +236,7 @@ int GFX_WritePixel(uaecptr rp, int x, in * suppose if we can't find a ClipRect, we aren't supposed to draw * the dot. */ - /*fprintf(stderr, "Weirdness in WritePixel\n");*/ + /*write_log ("Weirdness in WritePixel\n");*/ v = -1; } else if (get_long(cliprect + 8) == 0) { v = GFX_Bitmap_WritePixel(bitmap, x2, y2, rp); @@ -271,7 +270,7 @@ static uae_u32 gfxl_BltClear(void) } if ((mem & 1) != 0 || (count & 1) != 0) - fprintf(stderr, "gfx: BltClear called with odd parameters\n"); + write_log ("gfx: BltClear called with odd parameters\n"); /* Bit 2 set means use pattern (V36+ only, but we might as well emulate * it always) */ @@ -368,7 +367,7 @@ static void dup_bandlist(struct BandList memcpy(to->maxy, from->maxy, to->count*sizeof(int)); } -static __inline__ void add_band(struct BandList *bl, int miny, int maxy, int pos) +STATIC_INLINE void add_band(struct BandList *bl, int miny, int maxy, int pos) { if (bl->count == bl->space) { bl->space += 20; @@ -399,7 +398,7 @@ static void dup_rectlist(struct RectList memcpy(to->rects, from->rects, to->count*sizeof(struct Rectangle)); } -static __inline__ void add_rect(struct RectList *rl, struct Rectangle r) +STATIC_INLINE void add_rect(struct RectList *rl, struct Rectangle r) { if (rl->count == 0) rl->bounds = r; @@ -420,7 +419,7 @@ static __inline__ void add_rect(struct R rl->rects[rl->count++] = r; } -static __inline__ void rem_rect(struct RectList *rl, int num) +STATIC_INLINE void rem_rect(struct RectList *rl, int num) { rl->count--; if (num == rl->count) @@ -457,12 +456,12 @@ static int regionrect_cmpfn(const void * return 1; } -static __inline__ int min(int x, int y) +STATIC_INLINE int min(int x, int y) { return x < y ? x : y; } -static __inline__ int max(int x, int y) +STATIC_INLINE int max(int x, int y) { return x > y ? x : y; } @@ -569,7 +568,7 @@ static void region_splitrects_band(struc rl->rects[i].MaxY = bl->maxy[j]; break; } - fprintf(stderr, "Foo..\n"); + write_log ("Foo..\n"); } } qsort(rl->rects, rl->count, sizeof (struct Rectangle), regionrect_cmpfn); @@ -1073,7 +1072,7 @@ static uae_u32 gfxl_perform_regionop(reg rpp = rr; } if (get_long(rpp) != 0) - fprintf(stderr, "BUG\n"); + write_log ("BUG\n"); } put_word(reg2+0, rl3.bounds.MinX); put_word(reg2+2, rl3.bounds.MinY); @@ -1644,16 +1643,17 @@ void gfxlib_install(void) uae_u32 begin, end, resname, resid; int i; - if(!use_gfxlib) return; + if (! currprefs.use_gfxlib) + return; - fprintf(stderr, "Warning: you enabled the graphics.library replacement with -g\n" - "This may be buggy right now, and will not speed things up much.\n"); + write_log ("Warning: you enabled the graphics.library replacement with -g\n" + "This may be buggy right now, and will not speed things up much.\n"); - resname = ds("UAEgfxlib.resource"); - resid = ds("UAE gfxlib 0.1"); + resname = ds ("UAEgfxlib.resource"); + resid = ds ("UAE gfxlib 0.1"); - gfxlibname = ds("graphics.library"); - layerslibname = ds("layers.library"); + gfxlibname = ds ("graphics.library"); + layerslibname = ds ("layers.library"); begin = here(); dw(0x4AFC); /* RTC_MATCHuae_s16 */