HV-Integer and crop for AtariST. Debug output for used status bits.

This commit is contained in:
sorgelig
2021-02-24 02:07:16 +08:00
parent bb95e53abc
commit 61a965eacc
5 changed files with 106 additions and 19 deletions

View File

@@ -411,6 +411,9 @@ static const char mlink_speed_labels[12][32] = { "110", "300", "600", "1200", "2
static void parse_config()
{
uint64_t mask = 0;
uint64_t overlap = 0;
int i = 0;
char *p;
@@ -537,6 +540,36 @@ static void parse_config()
while((p[0] == 'H' || p[0] == 'D' || p[0] == 'h' || p[0] == 'd') && strlen(p)>=2) p += 2;
if (p[0] == 'P') p += 2;
if (p[0] == 'R' || p[0] == 'T')
{
uint64_t x = 1 << getOptIdx(p);
overlap |= mask & x;
mask |= x;
}
if (p[0] == 'r' || p[0] == 't')
{
uint64_t x = 1 << getOptIdx(p);
x <<= 32;
overlap |= mask & x;
mask |= x;
}
if (p[0] == 'O')
{
char *opt = (p[1] == 'X') ? p + 1 : p;
uint64_t x = getStatusMask(opt);
x <<= getOptIdx(opt);
overlap |= mask & x;
mask |= x;
}
if (p[0] == 'o')
{
char *opt = (p[1] == 'X') ? p + 1 : p;
uint64_t x = getStatusMask(opt);
x <<= 32 + getOptIdx(opt);
overlap |= mask & x;
mask |= x;
}
if (p[0] == 'J')
{
int n = 1;
@@ -587,6 +620,32 @@ static void parse_config()
i++;
} while (p || i<3);
mask |= 1; // reset is always on bit 0
printf("\n// Status Bit Map:\n");
printf("// Upper Lower\n");
printf("// 0 1 2 3 4 5 6 \n");
printf("// 01234567890123456789012345678901 23456789012345678901234567890123\n");
printf("// 0123456789ABCDEFGHIJKLMNOPQRSTUV 0123456789ABCDEFGHIJKLMNOPQRSTUV\n");
char str[128];
strcpy(str, "// ");
for (int i = 0; i < 32; i++) strcat(str, (mask & (1ULL << i)) ? "X" : " ");
strcat(str, " ");
for (int i = 32; i < 64; i++) strcat(str, (mask & (1ULL << i)) ? "X" : " ");
strcat(str, "\n");
printf(str);
if (overlap)
{
strcpy(str, "// ");
for (int i = 0; i < 32; i++) strcat(str, (overlap & (1ULL << i)) ? "^" : " ");
strcat(str, " ");
for (int i = 32; i < 64; i++) strcat(str, (overlap & (1ULL << i)) ? "^" : " ");
strcat(str, "\n");
printf(str);
printf("// *Overlapped bits!* (can be intentional):\n");
}
printf("\n");
// legacy GBA versions
if (is_gba() && !ss_base)
{