Support for Asus Tinkerboard, other timing tweaks
This commit is contained in:
parent
48a1cb93d0
commit
7fbfe92c20
5 changed files with 65 additions and 12 deletions
7
Makefile
7
Makefile
|
@ -133,6 +133,13 @@ USE_SDL2 = 1
|
|||
MORE_CFLAGS += -fomit-frame-pointer
|
||||
endif
|
||||
NAME = amiberry-xu4-sdl2-dev
|
||||
else ifeq ($(PLATFORM),tinker)
|
||||
USE_SDL2 = 1
|
||||
CPU_FLAGS += -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
|
||||
CFLAGS += -DARMV6T2 -DUSE_ARMNEON -DUSE_SDL2 -DTINKER -I/usr/local/include
|
||||
LDFLAGS += -L/usr/local/lib -lmali
|
||||
HAVE_NEON = 1
|
||||
NAME = amiberry-tinker-dev
|
||||
endif
|
||||
|
||||
RM = rm -f
|
||||
|
|
|
@ -66,10 +66,10 @@ static void uae_abort (const TCHAR *format,...)
|
|||
nomore = 1;
|
||||
}
|
||||
|
||||
#define SPEEDUP_CYCLES_JIT_PAL 5000
|
||||
#define SPEEDUP_CYCLES_JIT_NTSC 4000
|
||||
#define SPEEDUP_CYCLES_NONJIT 256
|
||||
#define SPEEDUP_TIMELIMIT_JIT -750
|
||||
#define SPEEDUP_CYCLES_JIT_PAL 10000
|
||||
#define SPEEDUP_CYCLES_JIT_NTSC 8000
|
||||
#define SPEEDUP_CYCLES_NONJIT 1024
|
||||
#define SPEEDUP_TIMELIMIT_JIT -6000
|
||||
#define SPEEDUP_TIMELIMIT_NONJIT -750
|
||||
int pissoff_value = SPEEDUP_CYCLES_JIT_PAL * CYCLE_UNIT;
|
||||
int speedup_timelimit = SPEEDUP_TIMELIMIT_JIT;
|
||||
|
|
|
@ -320,7 +320,7 @@ int graphics_setup(void)
|
|||
|
||||
if (renderer == nullptr)
|
||||
{
|
||||
renderer = SDL_CreateRenderer(sdlWindow, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
|
||||
renderer = SDL_CreateRenderer(sdlWindow, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE);
|
||||
check_error_sdl(renderer == nullptr, "Unable to create a renderer");
|
||||
}
|
||||
|
||||
|
@ -537,8 +537,10 @@ static void open_screen(struct uae_prefs* p)
|
|||
|
||||
if (screen != nullptr)
|
||||
{
|
||||
|
||||
InitAmigaVidMode(p);
|
||||
init_row_map();
|
||||
vsync_switchmode(p->ntscmode ? 60 : 50);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -691,7 +693,6 @@ void show_screen(int mode)
|
|||
current_vsync_frame += currprefs.gfx_framerate;
|
||||
#endif
|
||||
|
||||
last_synctime = read_processor_time();
|
||||
#ifdef USE_DISPMANX
|
||||
wait_for_display_thread();
|
||||
write_comm_pipe_u32(display_pipe, DISPLAY_SIGNAL_SHOW, 1);
|
||||
|
@ -701,7 +702,7 @@ void show_screen(int mode)
|
|||
SDL_RenderCopy(renderer, texture, nullptr, nullptr);
|
||||
SDL_RenderPresent(renderer);
|
||||
#endif
|
||||
|
||||
last_synctime = read_processor_time();
|
||||
idletime += last_synctime - start;
|
||||
|
||||
#ifdef USE_DISPMANX
|
||||
|
|
|
@ -293,8 +293,12 @@ namespace sdl
|
|||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
#elif USE_SDL2
|
||||
|
||||
#ifndef TINKER
|
||||
setup_cursor();
|
||||
#else
|
||||
cursor = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
|
||||
SDL_SetCursor(cursor);
|
||||
#endif
|
||||
|
||||
// make the scaled rendering look smoother (linear scaling).
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
|
||||
|
|
|
@ -3103,23 +3103,64 @@ static void picasso_statusline(uae_u8 *dst)
|
|||
// TODO: Change this to use SDL2 native conversions
|
||||
static void copyall(uae_u8 *src, uae_u8 *dst)
|
||||
{
|
||||
if (picasso96_state.RGBFormat == RGBFB_R5G6B5)
|
||||
int bytes;
|
||||
if (picasso96_state.RGBFormat == RGBFB_R5G6B5) {
|
||||
#ifdef TINKER
|
||||
bytes = picasso96_state.Width * picasso96_state.Height * 2;
|
||||
for (int i=0; i < bytes; i+=4) {
|
||||
*((uae_u32 *)(dst + i)) =(
|
||||
__builtin_bswap16(*((uae_u16 *)(src + i + 2))) << 16 |
|
||||
__builtin_bswap16(*((uae_u16 *)(src + i)))
|
||||
);
|
||||
}
|
||||
#else
|
||||
#ifdef USE_ARMNEON
|
||||
copy_screen_16bit_swap(dst, src, picasso96_state.Width * picasso96_state.Height * 2);
|
||||
#else
|
||||
copy_screen_16bit_swap_arm(dst, src, picasso96_state.Width * picasso96_state.Height * 2);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else if (picasso96_state.RGBFormat == RGBFB_CLUT)
|
||||
{
|
||||
int pixels = picasso96_state.Width * picasso96_state.Height;
|
||||
copy_screen_8bit(dst, src, pixels, picasso_vidinfo.clut);
|
||||
#ifdef TINKER
|
||||
bytes = picasso96_state.Width * picasso96_state.Height;
|
||||
for (int i=0; i < bytes; ++i) {
|
||||
*((uae_u16 *)(dst + (i << 1))) = (
|
||||
(picasso96_state_uaegfx.CLUT[(*(uae_u8 *)(src+i))].Red >> 3) << 11 |
|
||||
(picasso96_state_uaegfx.CLUT[(*(uae_u8 *)(src+i))].Green >> 2) << 5 |
|
||||
(picasso96_state_uaegfx.CLUT[(*(uae_u8 *)(src+i))].Blue >> 3)
|
||||
);
|
||||
}
|
||||
#else
|
||||
bytes = picasso96_state.Width * picasso96_state.Height;
|
||||
copy_screen_8bit(dst, src, bytes, picasso_vidinfo.clut);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
else {
|
||||
#ifdef TINKER
|
||||
bytes = picasso96_state.Width * picasso96_state.Height * 2;
|
||||
for (int i=0; i < bytes; i+=4) {
|
||||
*((uae_u32 *)(dst + i)) = (
|
||||
(
|
||||
(*(uae_u8 *)(src + (i << 1) + 4)) >> 3 << 11 |
|
||||
(*(uae_u8 *)(src + (i << 1) + 5)) >> 2 << 5 |
|
||||
(*(uae_u8 *)(src + (i << 1) + 6)) >> 3
|
||||
) << 16 | (
|
||||
(*(uae_u8 *)(src + (i << 1) + 0)) >> 3 << 11 |
|
||||
(*(uae_u8 *)(src + (i << 1) + 1)) >> 2 << 5 |
|
||||
(*(uae_u8 *)(src + (i << 1) + 2)) >> 3
|
||||
)
|
||||
);
|
||||
}
|
||||
#else
|
||||
#ifdef USE_ARMNEON
|
||||
copy_screen_32bit_to_16bit_neon(dst, src, picasso96_state.Width * picasso96_state.Height * 4);
|
||||
#else
|
||||
copy_screen_32bit_to_16bit_arm(dst, src, picasso96_state.Width * picasso96_state.Height * 4);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
bool picasso_flushpixels(uae_u8 *src, int off)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue