1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-24 18:25:23 +01:00

Separated kPRMachineStern into ...SternSAM and ...SternWhitestar and added SternWhitestar decodes.

This commit is contained in:
Gerry Stellenberg
2009-09-28 23:35:42 -05:00
parent 5471a0f48c
commit 12e81a4510

View File

@@ -278,7 +278,7 @@ PR_EXPORT uint16_t PRDecode(PRMachineType machineType, const char *str)
}
}
}
else if (machineType == kPRMachineStern)
else if (machineType == kPRMachineSternSAM)
{
switch (str[0])
{
@@ -307,6 +307,32 @@ PR_EXPORT uint16_t PRDecode(PRMachineType machineType, const char *str)
}
}
}
else if (machineType == kPRMachineSternWhitestar)
{
switch (str[0])
{
case 'L':
case 'l':
return 80 + 16 * (7 - ((x - 1) % 8)) + (x - 1) / 8;
case 'C':
case 'c':
return x + 31;
case 'S':
case 's':
{
switch (str[1])
{
case 'D':
case 'd':
if (strlen(str) == 3)
return (str[2]-'0') + 7;
else return x + 7;
default:
return 32 + 16 * (((x-1) / 8)) + (7-((x-1) % 8));
}
}
}
}
return atoi(str);
}