From bf34bd8f84ee3131941fda3f102dd3c13ca27ab6 Mon Sep 17 00:00:00 2001 From: Frode Solheim Date: Fri, 4 Sep 2015 23:57:56 +0200 Subject: [PATCH] minor updates to custom.cpp --- custom.cpp | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/custom.cpp b/custom.cpp index 96e34ef0..ad448259 100644 --- a/custom.cpp +++ b/custom.cpp @@ -67,7 +67,7 @@ STATIC_INLINE bool nocustom (void) return false; } -void uae_abort (const TCHAR *format,...) +static void uae_abort (const TCHAR *format,...) { static int nomore; va_list parms; @@ -1933,6 +1933,10 @@ STATIC_INLINE void long_fetch_32 (int plane, int nwords, int weird_number_of_bit outword[plane] = outval; } +#ifdef HAVE_UAE_U128 +/* uae_u128 is available, custom shift functions not necessary */ +#else + STATIC_INLINE void shift32plus (uae_u64 *p, int n) { uae_u64 t = p[1]; @@ -1963,12 +1967,18 @@ STATIC_INLINE void aga_shift_n (uae_u64 *p, int n) p[1] >>= n; } +#endif + STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bits, int dma) { uae_u32 *real_pt = (uae_u32 *)pfield_xlateptr (bplpt[plane], nwords * 2); int delay = toscr_delay_adjusted[plane & 1]; int tmp_nbits = out_nbits; +#ifdef HAVE_UAE_U128 + uae_u128 shiftbuffer; +#else uae_u64 shiftbuffer[2]; +#endif uae_u32 outval = outword[plane]; uae_u64 fetchval = fetched_aga[plane]; uae_u32 *dataptr = (uae_u32 *)(line_data[next_lineno] + 2 * plane * MAX_WORDS_PER_LINE + 4 * out_offs); @@ -1983,19 +1993,30 @@ STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bit /* @@@ Don't do this, fall back on chipmem_wget instead. */ return; +#ifdef HAVE_UAE_U128 + shiftbuffer = todisplay2_aga[plane] << delay; +#else shiftbuffer[1] = 0; shiftbuffer[0] = todisplay2_aga[plane]; aga_shift (shiftbuffer, delay); +#endif while (nwords > 0) { int i; +#ifdef HAVE_UAE_U128 + shiftbuffer |= fetchval; +#else shiftbuffer[0] |= fetchval; +#endif for (i = 0; i < 4; i++) { uae_u32 t; int bits_left = 32 - tmp_nbits; +#ifdef HAVE_UAE_U128 + t = (shiftbuffer >> shift) & 0xffff; +#else if (64 - shift > 0) { t = shiftbuffer[1] << (64 - shift); t |= shiftbuffer[0] >> shift; @@ -2003,6 +2024,7 @@ STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bit t = shiftbuffer[1] >> (shift - 64); } t &= 0xffff; +#endif if (weird_number_of_bits && bits_left < 16) { outval <<= bits_left; @@ -2022,7 +2044,11 @@ STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bit tmp_nbits = 0; } } +#ifdef HAVE_UAE_U128 + shiftbuffer <<= 16; +#else aga_shift (shiftbuffer, 16); +#endif } nwords -= 4; @@ -2038,8 +2064,12 @@ STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bit } } fetched_aga[plane] = fetchval; +#ifdef HAVE_UAE_U128 + todisplay2_aga[plane] = shiftbuffer >> delay; +#else aga_shift_n (shiftbuffer, delay); todisplay2_aga[plane] = shiftbuffer[0]; +#endif outword[plane] = outval; } #endif @@ -4258,6 +4288,7 @@ static void init_hz_vposw (void) { init_hz (true); } + void init_hz_normal (void) { init_hz (false); @@ -4976,7 +5007,7 @@ static void INTENA (uae_u16 v) #endif } -void INTREQ_nodelay (uae_u16 v) +static void INTREQ_nodelay (uae_u16 v) { setclr (&intreq, v); setclr (&intreq_internal, v); @@ -7073,7 +7104,7 @@ static bool framewait (void) int freetime; extern int extraframewait; - + if (!vblank_hz_state) return status != 0; @@ -8133,8 +8164,6 @@ static void hsync_handler_post (bool onvsync) } { - extern int volatile uaenet_int_requested; - extern int volatile uaenet_vsync_requested; if (uaenet_int_requested || (uaenet_vsync_requested && vpos == 10)) { INTREQ (0x8000 | 0x0008); } -- 2.47.3