diff --git a/.gitignore b/.gitignore index af21c6ca..94d52561 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ Amiberry/VisualGDB/Release-rpi2/Amiberry *.ipch *.db-shm *.db-wal +*.TMP diff --git a/src/custom.cpp b/src/custom.cpp index c889115b..86b4a223 100644 --- a/src/custom.cpp +++ b/src/custom.cpp @@ -4592,12 +4592,12 @@ static void vsync_handler_post (void) // } if (picasso_on) { - init_hz(); + vpos_count = (int) maxvpos * vblank_hz / 60; vtotal = vpos_count; } #endif - if ((beamcon0 & (0x10 | 0x20 | 0x80 | 0x100 | 0x200)) != (new_beamcon0 & (0x10 | 0x20 | 0x80 | 0x100 | 0x200))) { + if ((beamcon0 & (0x20 | 0x80)) != (new_beamcon0 & (0x20 | 0x80))) { init_hz(); } else if (vpos_count > 0 && abs(vpos_count - vpos_count_diff) > 1 && vposw_change < 4) { diff --git a/src/include/sysdeps.h b/src/include/sysdeps.h index ff1671b2..dfe78fb7 100644 --- a/src/include/sysdeps.h +++ b/src/include/sysdeps.h @@ -14,7 +14,7 @@ * * Copyright 1996, 1997 Bernd Schmidt */ - +#include using namespace std; #include #include @@ -438,20 +438,41 @@ extern void gui_message (const TCHAR *,...); * Byte-swapping functions */ -#ifdef ARMV6_ASSEMBLY - -STATIC_INLINE uae_u32 do_byteswap_32(uae_u32 v) {__asm__ ( +/* Try to use system bswap_16/bswap_32 functions. */ +#if defined HAVE_BSWAP_16 && defined HAVE_BSWAP_32 +# include +# ifdef HAVE_BYTESWAP_H +# include +# endif +#else +# ifdef ARMV6_ASSEMBLY +STATIC_INLINE uae_u32 do_byteswap_32(uae_u32 v) { + __asm__( "rev %0, %0" - : "=r" (v) : "0" (v) ); return v;} + : "=r" (v) : "0" (v)); return v; +} -STATIC_INLINE uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ( +STATIC_INLINE uae_u32 do_byteswap_16(uae_u32 v) { + __asm__( "revsh %0, %0\n\t" "uxth %0, %0" - : "=r" (v) : "0" (v) ); return v;} - -#endif - + : "=r" (v) : "0" (v)); return v; +} +#define bswap_16(x) do_byteswap_16(x) +#define bswap_32(x) do_byteswap_32(x) +# else +/* Else, if using SDL, try SDL's endian functions. */ +# ifdef USE_SDL +# include +# define bswap_16(x) SDL_Swap16(x) +# define bswap_32(x) SDL_Swap32(x) +# else +/* Otherwise, we'll roll our own. */ #define bswap_16(x) (((x) >> 8) | (((x) & 0xFF) << 8)) +#define bswap_32(x) (((x) << 24) | (((x) << 8) & 0x00FF0000) | (((x) >> 8) & 0x0000FF00) | ((x) >> 24)) +# endif +#endif +#endif #endif @@ -476,3 +497,5 @@ extern void xfree (const void*); #define xfree(T) free(T) #endif + +#define DBLEQU(f, i) (abs ((f) - (i)) < 0.000001) \ No newline at end of file diff --git a/src/osdep/rasp_gfx.cpp b/src/osdep/rasp_gfx.cpp index f7c5b226..f3d31d26 100644 --- a/src/osdep/rasp_gfx.cpp +++ b/src/osdep/rasp_gfx.cpp @@ -123,13 +123,13 @@ void InitAmigaVidMode(struct uae_prefs *p) gfxvidinfo.outwidth = p->gfx_size.width; gfxvidinfo.outheight = p->gfx_size.height; gfxvidinfo.rowbytes = prSDLScreen->pitch; -//#ifdef PICASSO96 +#ifdef PICASSO96 if (screen_is_picasso) { gfxvidinfo.outwidth = picasso_vidinfo.width; gfxvidinfo.outheight = picasso_vidinfo.height; } -//#endif +#endif } void graphics_dispmanshutdown(void) @@ -161,18 +161,28 @@ static void open_screen(struct uae_prefs *p) int width; int height; +#ifdef PICASSO96 if (screen_is_picasso) { width = picasso_vidinfo.width; height = picasso_vidinfo.height; } else +#endif { p->gfx_resolution = p->gfx_size.width > 600 ? 1 : 0; width = p->gfx_size.width; height = p->gfx_size.height; } + if (Dummy_prSDLScreen) + { // y.f. 2016-10-13 : free the previous screen surface every time, + // so we can have fullscreen while running and windowed while in config window. + // Apparently, something somewhere is resetting the screen. + SDL_FreeSurface(Dummy_prSDLScreen); + Dummy_prSDLScreen = NULL; + } + if (Dummy_prSDLScreen == NULL) { // Dummy_prSDLScreen = SDL_SetVideoMode(videoInfo->current_w, videoInfo->current_h, videoInfo->vfmt->BitsPerPixel, SDL_SWSURFACE | SDL_FULLSCREEN); @@ -406,7 +416,7 @@ void black_screen_now(void) { SDL_FillRect(prSDLScreen, NULL, 0); SDL_Flip(prSDLScreen); -// flush_screen(); + flush_screen(); } @@ -419,7 +429,6 @@ static void graphics_subinit(void) } else { - SDL_Flip(prSDLScreen); SDL_ShowCursor(SDL_DISABLE); InitAmigaVidMode(&currprefs); }