Einstein
Einstein copied to clipboard
Gestalt doesn't report the proper version
The subject says it all :-)
Seems that Paul has already implemented something like this. I just found the code snippet below in my NewtTest code, which I think I got from Paul a long time ago. It seems that Paul has extended the NewtonScript Gestalt call, which normally only allows queries for system info and backlight.
However, this code snippet still shows Einstein version 2007.7 although I'm running 2022 4.17.
constant kGestaltArg_EinsteinEmulatorInfo := '[0x03000002, [struct,long], 1];
constant kDR1Version := 0x00010000;
/**
* Determine if we're under Einstein Emulator, and if so, its version.
*
* @return nil if we're on a hardware unit, the Einstein Emulator version
* otherwise.
*/
DefConst('kDetermineEinsteinEmulatorVersionFn,
func() begin
local theResult := Gestalt(kGestaltArg_EinsteinEmulatorInfo);
if (theResult) then return theResult[0] else return nil;
end
);
This is a bug. The version is hardcoded here:
https://github.com/pguyot/Einstein/blob/master/Emulator/TNativePrimitives.cpp#L905