|Re: [hatari-devel] vsync & video base address setting|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] vsync & video base address setting
- From: Miro Kropáček <miro.kropacek@xxxxxxxxx>
- Date: Sun, 23 Apr 2023 17:40:55 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682264403; x=1684856403; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=uCGL+rFPKkYEN5NM767gRUTqyuPJ2ZI8O8C1Utv1tkg=; b=L7WE1i3HpgU2++1mwsTNar3f9OGFQOPC4vBYbO3OupiV0QhjoHntmr2i0v0XEKI4Do 5oUIWxdD0v+uWoPjV3nwamIFnZyMO/7dUSwTdfrVHYuimHmLB+O/pM/V/lNxDxqenPRR RC+ehTymzInVxBj4rHcQx2irV+pVdmdsLcurl29LmpCMgeVdriTR4DW1FqW5Y27m8na0 niBXJ8xOwUVo+8ve8KJyUw1RaTdPOGPHc/UzObYgLym+mnRJtIiIqIwfOdT0wXSIBSjm vQUtk9EFlo/ep2icDN/hiYsLSMWsolgVxXbX0Tgd32cwm/6m3fLQ4U7F44qtdQ8CrGrt eC0Q==
- on STE it's easy to solve as on Falcon : during your VBL int, just
write the new video address to ff8205/07/09 ; you need to do this before
the end of top border (ie line 63 on 50 Hz screen). These 3 bytes are
not writable on STF but they are on STE.
Oh, right. Nice trick!
- on STF, you must write the new screen address for vbl 'n' during vbl
'n-1', else if you write the new address during vbl int 'n' it will only
be applied when vbl 'n+1' starts.
- the write happens before end of current VBL, then it's ok, it will
be taken immediately when next VBL starts.
What about the other problem I've mentioned - i.e. the frame will be rendered *exactly* at the line 309.9, I set $ffff8201 but then the reload happens and $ffff8203/0d will be ignored? Is it possible to happen on the ST? (it's not rhetorical question, Jo Even could observe the very same thing when developing his game "L'Abbaye des Morts" on Falcon before he started waiting for vbl - the screen would render 99 times okay and then suddenly jump on the 100th time).
this can be a problem because you can't write to the 2nd buffer as it
will be displayed next. but you can't write to the 1st buffer either as
it's possibly being displayed for 1 extra VBL.
Easiest solution : use triple buffering to ensure you always have 3
Funny you mention it, I'm testing my triple buffer solution in Hatari in ST/E mode to make sure I got it right (Falcon mode is not precise so I can't rely on it) but wanted to make sure that I get double buffering right first.
I'm really surprised how difficult this is on the ST, I thought that it's just me being dumb. I wonder how it is solved in games which were typically not 1VBL... maybe they got a constant time per frame?