Re: [hatari-devel] error reading video counter on TT since commit 5316b4081e9d3

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Fri, 22 Jul 2022 18:20:01 +0200
schrieb Nicolas Pomarède <npomarede@xxxxxxxxxxxx>:
[...]
> the problem is that in TT mode pVideoRaster is not updated anymore when 
> entering Video_CalculateAddress. It's always the same value.
>
> This is due to this change that don't call Video_EndHBL() and 
> Video_CopyScreenLineColor() on each HBL (as it was the case in Hatari 
> 2.3.1).
> 
> commit	5316b4081e9d3fa177ed14419369bc13892af4e8
> 
> --- a/src/video.c
> +++ b/src/video.c
> @@ -2990,7 +2990,7 @@ void Video_InterruptHandler_HBL ( void )
>   	M68000_Exception(EXCEPTION_NR_HBLANK , M68000_EXC_SRC_AUTOVEC);	/* 
> Horizontal blank interrupt, level 2 */
> 
> 
> -	if (!Config_IsMachineFalcon())
> +	if (!Config_IsMachineTT() && !Config_IsMachineFalcon())
>   	{
>   		Video_EndHBL();				/* Check some borders removal and copy line to 
> display buffer */
>   	}
> 
> Thomas, is there any reason why you excluded TT from the Video_EndHBL() 
> case ? Or is it a bad copy/paste ?

Yes, there is a reason: Video_EndHBL() is very specific to the ST/STE
screen renderning functions from screen.c and thus should not be called in
TT mode (which uses the rendering functions from screenConvert.c instead).

> I think it should be restored like previously, unless it has impact on 
> some other part of TT video ?

Instead of reverting, I'd suggest that we just add a special "else" case
here to fake a video counter update in TT and Falcon mode, e.g.:

	if (!Config_IsMachineTT() && !Config_IsMachineFalcon())
	{
		Video_EndHBL();
	}
	else
	{
		/* Fake video counter update in TT and Falcon mode...
		 * should be replaced once we have more precise video
		 * emulation there: */
		pVideoRaster = ((pVideoRaster - STRam + SCREENBYTES_MIDDLE)
		                & 0xffffff) + STRam;
	}

SCREENBYTES_MIDDLE should maybe be adjusted depending on the video mode...
Does that sound acceptable?

Alternatively, we could also introduce TT-specific versions of
Video_ScreenCounter_ReadByte(), just like we did with
VIDEL_ScreenCounter_ReadByte() already.

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/