Skip to content

Commit

Permalink
Raspberry PI 4 support, detection and specific tunning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackvoxel committed Aug 5, 2021
1 parent a5b6db9 commit daf0eed
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/ACompileSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
# define COMPILEOPTION_SPECIAL 0
#endif

#define COMPILEOPTION_VERSIONNUM 242
#define COMPILEOPTION_VERSIONNUM 250

// Options du jeu

Expand All @@ -66,13 +66,13 @@
#define COMPILEOPTION_ALLOWSAVE 1
#define COMPILEOPTION_ALLOWSAVEPLAYERSTATE 1
#define COMPILEOPTION_ALLOWVEHICLE 1
#define COMPILEOPTION_VERSIONSTRING "VERSION 2.41 (c) 2017 LAURENT THIEBAUT & OLIVIA MERLE"
#define COMPILEOPTION_VERSIONSTRING "VERSION 2.50 (c) 2021 LAURENT THIEBAUT & OLIVIA MERLE"
#else
#define COMPILEOPTION_INVENTORY_DEMOCONTENT 0
#define COMPILEOPTION_ALLOWSAVE 1
#define COMPILEOPTION_ALLOWSAVEPLAYERSTATE 1
#define COMPILEOPTION_ALLOWVEHICLE 1
#define COMPILEOPTION_VERSIONSTRING "VERSION 2.41 : CONFIDENTIAL TESTING (c) LAURENT THIEBAUT & OLIVIA MERLE"
#define COMPILEOPTION_VERSIONSTRING "VERSION 2.50 : CONFIDENTIAL TESTING (c) LAURENT THIEBAUT & OLIVIA MERLE"
#endif

// Options de debogage
Expand All @@ -84,7 +84,7 @@
# define COMPILEOPTION_FALLAREFATALS 0
# define COMPILEOPTION_FINETIMINGTRACKING 0
# define COMPILEOPTION_DEBUGFACILITY 1
# define COMPILEOPTION_NOMOUSECAPTURE 0
# define COMPILEOPTION_NOMOUSECAPTURE 1
# define COMPILEOPTION_VOXELPROCESSOR 1
# define COMPILEOPTION_DONTEMPTYINVENTORYONDEATH 1
# define COMPILEOPTION_ALPHA_SOUNDS_1 1
Expand Down Expand Up @@ -173,7 +173,7 @@

#endif

// *************** RASPBERRY PI 2/3 SPECIAL SUPPORT *************************
// *************** RASPBERRY PI 2/3/4 SPECIAL SUPPORT *************************

// At this time, Raspberry PI setting will be enforced automatically for any ARM CPU device.
// This is a shortcut, but at this time, most of these platforms have very limited horsepower and
Expand Down
4 changes: 3 additions & 1 deletion src/ZOs_Specific_HardwareDependent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ char const * ZHardwareInfo::String_Profile[] =
"ARM_GENERAL_PROFILE",
"ARM_RASPBERRY_PI_1",
"ARM_RASPBERRY_PI_2",
"ARM_RASPBERRY_PI_3"
"ARM_RASPBERRY_PI_3",
"ARM_RASPBERRY_PI_4"
};


Expand Down Expand Up @@ -81,6 +82,7 @@ void ZHardwareInfo::Detect_CPU_Linux()
if (Value == "0xb76") HardwareProfile = ARM_RASPBERRY_PI_1;
if (Value == "0xc07") HardwareProfile = ARM_RASPBERRY_PI_2;
if (Value == "0xd03") HardwareProfile = ARM_RASPBERRY_PI_3;
if (Value == "0xd08") HardwareProfile = ARM_RASPBERRY_PI_4;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ZOs_Specific_HardwareDependent.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ZHardwareInfo

public:
enum {CPUTYPE_X86, CPUTYPE_ARM} CpuType;
enum {X86_GENERAL_PROFILE, X86_NETBOOK_PROFILE, ARM_GENERAL_PROFILE, ARM_RASPBERRY_PI_1, ARM_RASPBERRY_PI_2, ARM_RASPBERRY_PI_3} HardwareProfile;
enum {X86_GENERAL_PROFILE, X86_NETBOOK_PROFILE, ARM_GENERAL_PROFILE, ARM_RASPBERRY_PI_1, ARM_RASPBERRY_PI_2, ARM_RASPBERRY_PI_3, ARM_RASPBERRY_PI_4} HardwareProfile;

char * GetProfileText() { return ((char *)String_Profile[HardwareProfile]);}

Expand Down
5 changes: 4 additions & 1 deletion src/ZSettings_Hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void ZSettings_Hardware:: AdjustForRealHardware(ZHardwareInfo * HardwareInfo)
case ZHardwareInfo::ARM_GENERAL_PROFILE: RenderingDistance_Horizontal = 3;
RenderingDistance_Vertical = 1;
break;
case ZHardwareInfo::ARM_RASPBERRY_PI_1: RenderingDistance_Horizontal = 1;
case ZHardwareInfo::ARM_RASPBERRY_PI_1: RenderingDistance_Horizontal = 1; // Not supposed to work on PI 1
RenderingDistance_Vertical = 1;
break;
case ZHardwareInfo::ARM_RASPBERRY_PI_2: RenderingDistance_Horizontal = 1;
Expand All @@ -272,6 +272,9 @@ void ZSettings_Hardware:: AdjustForRealHardware(ZHardwareInfo * HardwareInfo)
case ZHardwareInfo::ARM_RASPBERRY_PI_3: RenderingDistance_Horizontal = 2;
RenderingDistance_Vertical = 1;
break;
case ZHardwareInfo::ARM_RASPBERRY_PI_4: RenderingDistance_Horizontal = 5;
RenderingDistance_Vertical = 3;
break;
}

// If settings are manually fixed, use these settings instead.
Expand Down

0 comments on commit daf0eed

Please sign in to comment.