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

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


Le 08/06/2017 à 08:36, Thorsten Otto a écrit :
Am Donnerstag, 8. Juni 2017, 08:14:56 schrieb Christian Zietz:
Is there any particular reason you don't trust Hatari's implementation
here?

No, sry if you got offended by that question ;) It was just not very obvious
to me. But your explanation made it more clear.

Why do you think Hatari's
implementation currently depends on the supervisor state?

Because of:

     if(addr < 0x8 || (addr < 0x800 && !regs.s))
     {
       if ( BusMode == BUS_MODE_CPU )
       {
	M68000_BusError(addr_in, 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;
     }

There regs.s is queried. And if i'm not wrong, !regs.s can never be the case
when blitter is actiive, since you won't be able to initiatite it from user
mode.




Hi

the case (addr < 0x800 && !reg.s) is specific to the cpu, not to the blitter. The code could have been rewritten differently, more like :

 if ( busmode == cpu )
  {
    if ( adr < 0x8 || (addr < 0x800 && !regs.s))
     BusError ()
  }

 else if ( ( busmode == blitte ) & ( addr < 0x8 ) )
  {
    return; /* ignore write */
  }

 write_data ();


Current code was was a quick hack to ignore bus error when blitter operates, without changing the whole structure of the memory access function. In practice, it's very rare that supervisor mode is not set, because you need it to write to blitter control register and to start the blitter. So when blitter starts, supervisor bit remains set.

So the condition (addr < 0x800 && !regs.s)) will "never" be met when blitter runs.

One could image that in the case where blitter runs in non hog mode, cpu could set supervisor to false durnig the time where it gets cpu control, but I never saw such a case.

Consider this part of the code like an act of lazyness from me, it will be improved some days :)

Nicolas




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