[hatari-devel] Re: [Emutos-devel] Aranym blitter

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


Hi,

On 06/07/2017 10:33 PM, Thorsten Otto wrote:
....
Another thing that might explain why you had some success with Hatari:

static Uint16 Blitter_ReadWord(Uint32 addr)
{
	Uint16 value;

	/* When reading from a bus error region, just return a constant */
	if ( STMemory_CheckRegionBusError ( addr ) )
		value = BLITTER_READ_WORD_BUS_ERR;
	else
		value = (Uint16)get_word ( addr );
...

static void Blitter_WriteWord(Uint32 addr, Uint16 value)
{
	/* Call put_word only if the address doesn't point to a bus error region
*/
	/* (also see SysMem_wput for addr < 0x8) */
	if ( STMemory_CheckRegionBusError ( addr ) == false )
		put_word ( addr , (Uint32)(value) );
...

So Hatari simply ignore access to invalid memory addresse in all cases. I
don't think that this is the right to do.

Looking at Hatari change history:
$ hg blame src/blitter.c | egrep -A8 'static.*Blitter_(Read|Write)Word'
$ hg log | grep -A4 5806:
$ hg diff 5806

You can see that it's a deliberate fix from 2015 by Nicolas.
It's even documented in start of blitter.c:
---------------------------
#define BLITTER_READ_WORD_BUS_ERR 0x0000 /* This value is returned when the blitter try to read a word */ /* in a region that would cause a bus error */ /* [NP] FIXME : for now we return a constant, but it should depend on the bus activity */
---------------------------

And later in mid 2016, in commit 6278:
---------------------------
+    /* Only CPU will trigger bus error if bit S=0, not the blitter */
     if(addr < 0x8 || (addr < 0x800 && !regs.s))
     {
-      M68000_BusError(addr, 0, BUS_ERROR_SIZE_WORD, BUS_ERROR_ACCESS_DATA);
-      return;
+      if ( BusMode == BUS_MODE_CPU )
+      {
+ M68000_BusError(addr, 0, BUS_ERROR_SIZE_WORD, BUS_ERROR_ACCESS_DATA);
+       return;
+      }
+ /* If blitter writes < 0x8 then it should be ignored, else the write should be made */
+      else if ( ( BusMode == BUS_MODE_BLITTER ) && ( addr < 0x8 ) )
+       return;
---------------------------


What's a bit unclear to me is:
- what happens on real hardware when accessing the word registers with byte
moves? That is not handled yet by aranym.
- what happens to the source address, when no data is read? is it stll
incremented/decremented?


	- Eero



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