Re: [hatari-devel] Blitter bug in STe mode |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Blitter bug in STe mode
- From: Christian Zietz <czietz@xxxxxxx>
- Date: Tue, 9 Jun 2020 08:48:26 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1591685310; bh=gXjKAjmvVSBMrlxYyGyTI0a8tMXAaUcVWR1ZWSwB3Zs=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=eCxsq8x300AHzSW2LuFAtYPzVWVxL6folqpKAkJ450LcKIOCe95IZ1a0exKm/MftN MwvfgG7YajvsuOgSDNk+4pwzIZtnbc99lwqE6/f/LCkiu7b31mVraKhSSO+yWDb1EG Qp9SfJ/vcnA59Zv6ZWwI3phxTI+NjAqrjweP3BfI=
Christian Zietz schrieb:
> It is. The TAS instruction is there to *prevent* what currently is
> happening on Hatari. With BSET #7,... the Blitter can take the bus
> in-between the read and the write cycle. With TAS it shouldn't be able
> to. Therefore, imho it's the right choice to use TAS (as recommended by
> Atari) to restart the Blitter.
A brief follow-up to my investigation: The read cycle in TAS eventually
ends up in mem_access_delay_byte_read(), where the following happens:
v = get_byte (addr);
x_do_cycles_post (4 * cpucycleunit, v);
x_do_cycles_post() can restart the Blitter if it is the "right time".
This is why the Blitter control registers changes *during* a TAS
instruction and the wrong value is written back in the write cycle.
If I move x_do_cycles_post() to before get_byte() the screen artifacts
vanish. (And I break cycle accuracy, so this is not a real solution.)
This can happen with other instructions on real HW, too; the main reason
why TAS exists is so that this does not happen. I.e., Hatari would have
to block the Blitter restart if the CPU was executing a TAS instruction.
This, BTW, is why Atari changed their recommendation to use TAS (instead
of BSET) in later revisions of the Blitter user manual.
Regards
Christian
--
Christian Zietz - CHZ-Soft - czietz@xxxxxxx
WWW: https://www.chzsoft.de/
PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA