[hatari-devel] Wrong memory init
Nicolas Pomarède
npomarede at corp.free.fr
Sun Nov 27 22:33:32 CET 2011
On 27/11/2011 21:20, Thomas Huth wrote:
>
> Hi!
>
> Am Sun, 27 Nov 2011 14:23:33 +0100
> schrieb Nicolas Pomarède<npomarede at corp.free.fr>:
>
>> I spent some hard hours trying to fix the game Yolanda (on Pompey
>> Pirates 46).
>
> Welcome to the club ;-) I also already spent countless hours with that
> game to figure out what goes wrong there. But unlike you I always
> failed in the past (maybe just because we did not have that fast-boot
> option in Hatari yet)...
Yes, at one point I really suspected a TOS problem rather than hardware
emulation, and that's really the harder to fix, having to go through TOS
is really a pain and time consuming :)
That's often the problem with games compilation (compared to demos),
they sometimes uses "shortcuts" (ie ugly coding) that can conflict with
the way we patch tos.
> // As TOS checks hardware for memory size + connected devices on boot-up
> // we set these values ourselves and fill in the magic numbers so TOS
> // skips these tests which would crash the emulator as the reference the MMU
>
> So I guess in the early days of WinSTon there was a problem when TOS
> tried to detect the memory size, so that test got bypassed by patching
> the memvalid variables.
>
> I agree that this is not necessary anymore for normal TOS when using
> less than 4 MiB of memory...
Yes, Winston certainly put some code back then when the hardware was not
as correctly emulated as it is now.
> So I would suggest to change the if-statement like this:
>
> if ((ConfigureParams.System.bFastBoot&& bIsEmuTOS)
> || (ConfigureParams.Memory.nMemorySize> 4&& !bIsEmuTOS))
>
> That means patch it when fast boot has been enabled for EmuTOS or patch
> it when using> 4 MiB memory when using normal TOS.
>
> What do you think?
I'm OK with that, the code block should not be removed but slightly
changed to not apply in most common STF/STE case with < 4 MB.
>
>> Additionnaly, I think bFastBoot should be false by default, to ensure
>> the system always starts in the maximum compatibility level.
>
> You mean "ConfigureParams.System.bFastBoot = false" in configuration.c ?
> ... that's fine with me.
That's it.
>> The user can still change it later if he wants(this is used in tos.c, when
>> patch has TP_HDIMAGE_OFF ; is it still useful ?)
>
> It makes a big difference with TOS 2.05 and TOS 2.06. That TOS patch is
> used to skip the annoying memory test sequence there, so I'd say we
> should keep this.
OK ; I usually press 'esc' when this happens, but I agree it's useful.
Nicolas
More information about the hatari-devel
mailing list