Re: [hatari-devel] IDE IO register range access commit

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


Hi,

On 9/24/20 11:52 PM, Nicolas Pomarède wrote:
Le 24/09/2020 à 21:02, Eero Tamminen a écrit :
Nicolas, I think IDE would work correctly if
memory.c would just check for:
Config_IsMachineFalcon() || ConfigureParams.Ide[0].bUseDevice

And all ide.c changes were reverted, as they break the other expectations that code has.

(Or you could add separate check function to ide.c
instead of mangling the existing internal one.)


Hi

I'm not sure it would work if I do in memory.c :
Config_IsMachineFalcon() || ConfigureParams.Ide[0].bUseDevice

instead of calling Ide_MmioIsAvailable() which does the same, because then this code in ide.c looks wrong to me :

         if (addr >= 0xf00040 || !Ide_MmioIsAvailable())
         {
             M68000_BusError();
         }

As thomas noted in another mail, this means that if you're in falcon mode and access 0xf00005 for example and there's no disk in ide[0], then you trigger a bus error ; this is wrong, original HW doesn't do that.

So somebody has run Hatari bus error tester on
Falcon which doesn't have any IDE devices attached
and we know exactly what should happen for each
register?

(Thomas said TOS ignores those bus errors, but not where that info came from.)


So IMO Ide_MmioIsAvailable() should also check machine==falcon.

I see, it would fix IDE reg accesses it only for
other things than Falcon. :-/


I think that what is missing and I tried to fix is that there should be an init of IDE for falcon or when IDE is forced (malloc memory for ide[0] and ide[1], even if this memory is empty for now) ; this init should be done once for all on each boot or when machine type is changed if it implies that IDE registers get enabled/disabled.

And then there should be another function that only deals with "inserting" and ide image into ide[0] or ide[1], which is more or less what ide_init2() is doing if I understand it correctly.

Just reverting to previous ide.c code will leave some pending issues with falcon that will trigger a bug sooner or later ; better try to fix it now.

Ok.  Looking at what the current code expects,
it may require major surgery.  How soon you
were thinking of doing new Hatari release?

(I'm a bit worried of doing something like this
just before release.)


	- Eero



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