Implemented fix from Main (#34)
This commit is contained in:
parent
03c6ffd4c2
commit
5deaae7bc2
3 changed files with 6161 additions and 6115 deletions
|
@ -2458,7 +2458,8 @@ static void init_hz (bool fullinit)
|
|||
sprite_vblank_endline = VBLANK_SPRITE_PAL;
|
||||
equ_vblank_endline = EQU_ENDLINE_PAL;
|
||||
equ_vblank_toggle = true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
maxvpos = MAXVPOS_NTSC;
|
||||
maxhpos = MAXHPOS_NTSC;
|
||||
minfirstline = VBLANK_ENDLINE_NTSC;
|
||||
|
@ -2468,7 +2469,7 @@ static void init_hz (bool fullinit)
|
|||
equ_vblank_toggle = false;
|
||||
}
|
||||
// long/short field refresh rate adjustment
|
||||
vblank_hz = vblank_hz * (maxvpos * 2 + 1) / ((maxvpos + lof_current) * 2);
|
||||
// vblank_hz = vblank_hz * (maxvpos * 2 + 1) / ((maxvpos + lof_current) * 2);
|
||||
|
||||
maxvpos_nom = maxvpos;
|
||||
maxvpos_display = maxvpos;
|
||||
|
@ -2477,18 +2478,20 @@ static void init_hz (bool fullinit)
|
|||
// (someone poked VPOSW)
|
||||
if (vpos_count < 10)
|
||||
vpos_count = 10;
|
||||
float new_hz = (isntsc ? 15734.0 : 15625.0) / (float)vpos_count;
|
||||
vblank_hz = (int)(new_hz + 0.5);
|
||||
vblank_hz = (isntsc ? 15734.0 : 15625.0) / vpos_count;
|
||||
maxvpos_nom = vpos_count - (lof_current ? 1 : 0);
|
||||
if ((maxvpos_nom >= 256 && maxvpos_nom <= 313) || (beamcon0 & 0x80)) {
|
||||
maxvpos_display = maxvpos_nom;
|
||||
} else if (maxvpos_nom < 256) {
|
||||
}
|
||||
else if (maxvpos_nom < 256) {
|
||||
maxvpos_display = 255;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
maxvpos_display = 313;
|
||||
}
|
||||
reset_drawing();
|
||||
} else if (vpos_count == 0) {
|
||||
}
|
||||
else if (vpos_count == 0) {
|
||||
// mode reset
|
||||
vpos_count = maxvpos;
|
||||
vpos_count_diff = maxvpos;
|
||||
|
@ -2502,15 +2505,29 @@ static void init_hz (bool fullinit)
|
|||
if (htotal >= MAXHPOS)
|
||||
htotal = MAXHPOS - 1;
|
||||
maxhpos = htotal + 1;
|
||||
float new_hz = 227.0 * 312.0 * 50.0 / (float)(maxvpos * maxhpos);
|
||||
vblank_hz = (int)(new_hz + 0.5);
|
||||
vblank_hz = 227.0 * 312.0 * 50.0 / (maxvpos * maxhpos);
|
||||
|
||||
if ((beamcon0 & 0x1000) && (beamcon0 & 0x0200)) { // VARVBEN + VARVSYEN
|
||||
minfirstline = vsstop > vbstop ? vsstop : vbstop;
|
||||
if (minfirstline > maxvpos / 2)
|
||||
minfirstline = vsstop > vbstop ? vbstop : vsstop;
|
||||
}
|
||||
else if (beamcon0 & 0x0200) {
|
||||
minfirstline = vsstop;
|
||||
if (minfirstline > maxvpos / 2)
|
||||
minfirstline = 0;
|
||||
}
|
||||
else if (beamcon0 & 0x1000) {
|
||||
minfirstline = vbstop;
|
||||
if (minfirstline > maxvpos / 2)
|
||||
minfirstline = 0;
|
||||
}
|
||||
|
||||
if (minfirstline < 2)
|
||||
minfirstline = 2;
|
||||
if (minfirstline >= maxvpos)
|
||||
minfirstline = maxvpos - 1;
|
||||
|
||||
sprite_vblank_endline = minfirstline - 2;
|
||||
maxvpos_nom = maxvpos;
|
||||
maxvpos_display = maxvpos;
|
||||
|
@ -2518,11 +2535,6 @@ static void init_hz (bool fullinit)
|
|||
vpos_count = maxvpos_nom;
|
||||
vpos_count_diff = maxvpos_nom;
|
||||
hzc = 1;
|
||||
#ifdef WITH_INGAME_WARNING
|
||||
char _info[64];
|
||||
sprintf(_info, "Programmend HZ: %d", vblank_hz);
|
||||
InGameMessage(_info);
|
||||
#endif
|
||||
}
|
||||
if (maxvpos_nom >= MAXVPOS)
|
||||
maxvpos_nom = MAXVPOS;
|
||||
|
@ -4557,7 +4569,8 @@ static void vsync_handler_post (void)
|
|||
lof_changed = 0;
|
||||
}
|
||||
lof_changing = 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
lof_changed_previous_field = 0;
|
||||
lof_lace = false;
|
||||
}
|
||||
|
@ -4573,11 +4586,20 @@ static void vsync_handler_post (void)
|
|||
vsyncmintime = last_synctime + vsynctimebase * (maxvpos_display - LAST_SPEEDUP_LINE) / maxvpos_display;
|
||||
}
|
||||
|
||||
#ifdef PICASSO96
|
||||
if (picasso_on)
|
||||
{
|
||||
vpos_count = (int) maxvpos * vblank_hz / 60;
|
||||
vtotal = vpos_count;
|
||||
}
|
||||
#endif
|
||||
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) {
|
||||
}
|
||||
else if (vpos_count > 0 && abs(vpos_count - vpos_count_diff) > 1 && vposw_change < 4) {
|
||||
init_hz();
|
||||
} else if (lof_changed) {
|
||||
}
|
||||
else if (lof_changed) {
|
||||
compute_framesync();
|
||||
}
|
||||
|
||||
|
|
|
@ -438,20 +438,41 @@ extern void gui_message (const TCHAR *,...);
|
|||
* 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
|
||||
|
||||
STATIC_INLINE uae_u32 do_byteswap_32(uae_u32 v) {__asm__ (
|
||||
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 <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_32(x) (((x) << 24) | (((x) << 8) & 0x00FF0000) | (((x) >> 8) & 0x0000FF00) | ((x) >> 24))
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -94,9 +94,9 @@ static struct PicassoResolution *newmodes = NULL;
|
|||
|
||||
static int picasso_convert, host_mode;
|
||||
|
||||
/* These are the maximum resolutions... They are filled in by GetSupportedResolutions() */
|
||||
/* have to fill this in, otherwise problems occur on the Amiga side P96 s/w which expects
|
||||
/* data here. */
|
||||
/* These are the maximum resolutions... They are filled in by GetSupportedResolutions()
|
||||
have to fill this in, otherwise problems occur on the Amiga side P96 s/w which expects
|
||||
data here. */
|
||||
static struct ScreenResolution planar = { 320, 240 };
|
||||
static struct ScreenResolution chunky = { 640, 480 };
|
||||
static struct ScreenResolution hicolour = { 640, 480 };
|
||||
|
@ -1973,6 +1973,7 @@ FillRect:
|
|||
* d5: UBYTE Mask
|
||||
* d7: uae_u32 RGBFormat
|
||||
***********************************************************/
|
||||
//__attribute__((optimize("O2"))) is needed otherwise this crashes with O3!
|
||||
__attribute__((optimize("O2"))) static uae_u32 REGPARAM2 picasso_FillRect(TrapContext *ctx)
|
||||
{
|
||||
uaecptr renderinfo = m68k_areg(regs, 1);
|
||||
|
@ -2005,12 +2006,14 @@ __attribute__((optimize("O2"))) static uae_u32 REGPARAM2 picasso_FillRect (TrapC
|
|||
do_fillrect_frame_buffer(&ri, X, Y, Width, Height, Pen, Bpp);
|
||||
result = 1;
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
|
||||
/* We get here only if Mask != 0xFF */
|
||||
if (Bpp != 1) {
|
||||
write_log(_T("WARNING - FillRect() has unhandled mask 0x%x with Bpp %d. Using fall-back routine.\n"), Mask, Bpp);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Pen &= Mask;
|
||||
Mask = ~Mask;
|
||||
oldstart = ri.Memory + Y * ri.BytesPerRow + X * Bpp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue