1
0
mirror of synced 2025-02-28 14:40:27 +01:00

Improved Lindy color settings.

- Celeron speed is correctly reported in model name.
- Added Silver, Blue and RedEX.
- Color setting is now case insensitive.
This commit is contained in:
Rolel 2024-12-31 13:52:14 +01:00
parent a08e113dc3
commit 84dcb34a06
3 changed files with 27 additions and 3 deletions

View File

@ -1,6 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include "config.h" #include "config.h"
#include "gpuvendor.h" #include "gpuvendor.h"
@ -799,8 +800,25 @@ int readConfig(FILE *configFile, EmulatorConfig *config)
{ {
char colour[256]; char colour[256];
strcpy(colour, getNextToken(NULL, " ", &saveptr)); strcpy(colour, getNextToken(NULL, " ", &saveptr));
// Convert colour to uppercase just to avoid case-sensitivity issues
for (char *p = colour; *p; ++p) *p = toupper(*p);
if (strcmp(colour, "RED") == 0) if (strcmp(colour, "RED") == 0)
config->lindberghColour = RED; config->lindberghColour = RED;
else if (strcmp(colour, "YELLOW") == 0)
config->lindberghColour = YELLOW;
else if (strcmp(colour, "BLUE") == 0)
config->lindberghColour = BLUE;
else if (strcmp(colour, "SILVER") == 0)
config->lindberghColour = SILVER;
else if (strcmp(colour, "REDEX") == 0)
config->lindberghColour = REDEX;
else
{
// Print a warning and keep the default colour
printf("Warning: Unknown Lindbergh colour '%s'. Keeping default value.\n", colour);
}
} }
else if (strcmp(command, "REGION") == 0) else if (strcmp(command, "REGION") == 0)

View File

@ -87,7 +87,10 @@
typedef enum typedef enum
{ {
YELLOW, YELLOW,
RED RED,
BLUE,
SILVER,
REDEX
} Colour; } Colour;
typedef enum typedef enum

View File

@ -609,13 +609,16 @@ char *fgets(char *str, int n, FILE *stream)
{ {
char contents[4][256]; char contents[4][256];
// Pentium 4 HT 3.0E : Prescott 3.0GHz L2 1Mo (SL8JZ, SL7L4, SL7E4, SL88J, SL79L, SL7KB, SL7PM)
strcpy(contents[0], "processor : 0"); strcpy(contents[0], "processor : 0");
strcpy(contents[1], "vendor_id : GenuineIntel"); strcpy(contents[1], "vendor_id : GenuineIntel");
strcpy(contents[2], "model : 142"); strcpy(contents[2], "model : 142");
strcpy(contents[3], "model name : Intel(R) Pentium(R) CPU 3.00GHz"); strcpy(contents[3], "model name : Intel(R) Pentium(R) CPU 3.00GHz");
if (getConfig()->lindberghColour == RED) // Celeron D 335 : 2.8GHz NetBurst Prescott-256 (SL8HM, SL7NW, SL7VZ, SL7TJ, SL7DM, SL7L2, SL7C7) si 478 ?
strcpy(contents[3], "model name : Intel(R) Celeron(R) CPU 3.00GHz"); if (getConfig()->lindberghColour == RED || getConfig()->lindberghColour == REDEX)
strcpy(contents[3], "model name : Intel(R) Celeron(R) CPU 2.80GHz");
if (fileRead[CPUINFO] == 4) if (fileRead[CPUINFO] == 4)
return NULL; return NULL;