Re: [hatari-devel] IDE IO register range access commit |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Le 24/09/2020 à 21:02, Eero Tamminen a écrit :
Hi,
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
IMO Ide_MmioIsAvailable() should also check machine==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.
Nicolas