Fix slowdown after #31 was fixed

This commit is contained in:
Dimitris Panokostas 2017-01-16 00:32:31 +01:00
parent dce2268a46
commit 5e95fc3951
4 changed files with 49 additions and 16 deletions

1
.gitignore vendored
View file

@ -27,3 +27,4 @@ Amiberry/VisualGDB/Release-rpi2/Amiberry
*.ipch *.ipch
*.db-shm *.db-shm
*.db-wal *.db-wal
*.TMP

View file

@ -4592,12 +4592,12 @@ static void vsync_handler_post (void)
// } // }
if (picasso_on) if (picasso_on)
{ {
init_hz(); vpos_count = (int) maxvpos * vblank_hz / 60;
vtotal = vpos_count; vtotal = vpos_count;
} }
#endif #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(); init_hz();
} }
else if (vpos_count > 0 && abs(vpos_count - vpos_count_diff) > 1 && vposw_change < 4) { else if (vpos_count > 0 && abs(vpos_count - vpos_count_diff) > 1 && vposw_change < 4) {

View file

@ -14,7 +14,7 @@
* *
* Copyright 1996, 1997 Bernd Schmidt * Copyright 1996, 1997 Bernd Schmidt
*/ */
#include <string>
using namespace std; using namespace std;
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -438,20 +438,41 @@ extern void gui_message (const TCHAR *,...);
* Byte-swapping functions * Byte-swapping functions
*/ */
/* Try to use system bswap_16/bswap_32 functions. */
#if defined HAVE_BSWAP_16 && defined HAVE_BSWAP_32
# include <byteswap.h>
# ifdef HAVE_BYTESWAP_H
# include <byteswap.h>
# endif
#else
# ifdef ARMV6_ASSEMBLY # ifdef ARMV6_ASSEMBLY
STATIC_INLINE uae_u32 do_byteswap_32(uae_u32 v) {
STATIC_INLINE uae_u32 do_byteswap_32(uae_u32 v) {__asm__ ( __asm__(
"rev %0, %0" "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" "revsh %0, %0\n\t"
"uxth %0, %0" "uxth %0, %0"
: "=r" (v) : "0" (v) ); return v;} : "=r" (v) : "0" (v)); return v;
}
#endif #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 <SDL_endian.h>
# 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_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 #endif
@ -476,3 +497,5 @@ extern void xfree (const void*);
#define xfree(T) free(T) #define xfree(T) free(T)
#endif #endif
#define DBLEQU(f, i) (abs ((f) - (i)) < 0.000001)

View file

@ -123,13 +123,13 @@ void InitAmigaVidMode(struct uae_prefs *p)
gfxvidinfo.outwidth = p->gfx_size.width; gfxvidinfo.outwidth = p->gfx_size.width;
gfxvidinfo.outheight = p->gfx_size.height; gfxvidinfo.outheight = p->gfx_size.height;
gfxvidinfo.rowbytes = prSDLScreen->pitch; gfxvidinfo.rowbytes = prSDLScreen->pitch;
//#ifdef PICASSO96 #ifdef PICASSO96
if (screen_is_picasso) if (screen_is_picasso)
{ {
gfxvidinfo.outwidth = picasso_vidinfo.width; gfxvidinfo.outwidth = picasso_vidinfo.width;
gfxvidinfo.outheight = picasso_vidinfo.height; gfxvidinfo.outheight = picasso_vidinfo.height;
} }
//#endif #endif
} }
void graphics_dispmanshutdown(void) void graphics_dispmanshutdown(void)
@ -161,18 +161,28 @@ static void open_screen(struct uae_prefs *p)
int width; int width;
int height; int height;
#ifdef PICASSO96
if (screen_is_picasso) if (screen_is_picasso)
{ {
width = picasso_vidinfo.width; width = picasso_vidinfo.width;
height = picasso_vidinfo.height; height = picasso_vidinfo.height;
} }
else else
#endif
{ {
p->gfx_resolution = p->gfx_size.width > 600 ? 1 : 0; p->gfx_resolution = p->gfx_size.width > 600 ? 1 : 0;
width = p->gfx_size.width; width = p->gfx_size.width;
height = p->gfx_size.height; 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) if (Dummy_prSDLScreen == NULL)
{ {
// Dummy_prSDLScreen = SDL_SetVideoMode(videoInfo->current_w, videoInfo->current_h, videoInfo->vfmt->BitsPerPixel, SDL_SWSURFACE | SDL_FULLSCREEN); // 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_FillRect(prSDLScreen, NULL, 0);
SDL_Flip(prSDLScreen); SDL_Flip(prSDLScreen);
// flush_screen(); flush_screen();
} }
@ -419,7 +429,6 @@ static void graphics_subinit(void)
} }
else else
{ {
SDL_Flip(prSDLScreen);
SDL_ShowCursor(SDL_DISABLE); SDL_ShowCursor(SDL_DISABLE);
InitAmigaVidMode(&currprefs); InitAmigaVidMode(&currprefs);
} }