Fix linux build

This commit is contained in:
drmortalwombat 2024-02-12 17:40:03 +01:00
parent 2ed3d8b445
commit ce5be92225
3 changed files with 66 additions and 41 deletions

View File

@ -143,7 +143,11 @@ void vspr_init(char * screen)
for(int i=0; i<VSPRITES_MAX - 8; i++) for(int i=0; i<VSPRITES_MAX - 8; i++)
{ {
#ifdef VSPRITE_REVERSE
int j = (i & 7) ^ 7;
#else
int j = i & 7; int j = i & 7;
#endif
rirq_build(spirq + i, 5); rirq_build(spirq + i, 5);
rirq_write(spirq + i, 0, &vic.spr_color[j], 0); rirq_write(spirq + i, 0, &vic.spr_color[j], 0);
@ -254,15 +258,26 @@ void vspr_update(void)
char sypos[VSPRITES_MAX]; char sypos[VSPRITES_MAX];
#pragma unroll(full) #pragma unroll(full)
for(char ui=0; ui<8; ui++) for(char ui=0; ui<8; ui++)
{ {
byte ri = spriteOrder[ui]; byte ri = spriteOrder[ui];
#ifdef VSPRITE_REVERSE
char uj = ui ^ 7;
#else
char uj = ui;
#endif
vic.spr_color[ui] = vspriteColor[ri]; vic.spr_color[uj] = vspriteColor[ri];
vsprs[ui] = vspriteImage[ri]; vsprs[uj] = vspriteImage[ri];
#ifdef VSPRITE_REVERSE
xymask = (xymask << 1) | (vspriteXHigh[ri] & 1);
#else
xymask = ((unsigned)xymask | (vspriteXHigh[ri] << 8)) >> 1; xymask = ((unsigned)xymask | (vspriteXHigh[ri] << 8)) >> 1;
vic.spr_pos[ui].x = vspriteXLow[ri]; #endif
vic.spr_pos[ui].y = vspriteYLow[ri]; vic.spr_pos[uj].x = vspriteXLow[ri];
vic.spr_pos[uj].y = vspriteYLow[ri];
sypos[ui] = vspriteYLow[ri]; sypos[ui] = vspriteYLow[ri];
} }
@ -276,7 +291,11 @@ void vspr_update(void)
byte ri = spriteOrder[ti + 8]; byte ri = spriteOrder[ti + 8];
if (!done && vspriteYLow[ri] < 250) if (!done && vspriteYLow[ri] < 250)
{ {
#ifdef VSPRITE_REVERSE
char m = 0x80 >> (ti & 7);
#else
char m = 1 << (ti & 7); char m = 1 << (ti & 7);
#endif
xymask |= m; xymask |= m;
if (!(vspriteXHigh[ri] & 1)) if (!(vspriteXHigh[ri] & 1))

View File

@ -471,7 +471,11 @@ int main2(int argc, const char** argv)
char dstring[100], tstring[100]; char dstring[100], tstring[100];
time_t now = time(NULL); time_t now = time(NULL);
struct tm t; struct tm t;
#ifdef _WIN32
localtime_s(&t, &now); localtime_s(&t, &now);
#else
localtime_r(&now, &t);
#endif
strftime(dstring, sizeof(tstring) - 1, "\"%b %d %Y\"", &t); strftime(dstring, sizeof(tstring) - 1, "\"%b %d %Y\"", &t);
strftime(tstring, sizeof(dstring) - 1, "\"%H:%M:%S\"", &t); strftime(tstring, sizeof(dstring) - 1, "\"%H:%M:%S\"", &t);

View File

@ -23,19 +23,20 @@ void scrollLeft0(void)
{ {
for(char x=0; x<39; x++) for(char x=0; x<39; x++)
{ {
#assign y 0 #pragma unroll(full)
#repeat for(char y=0; y<SPLIT1; y++)
sline(0, y)[x] = sline(1, y)[x]; {
cline(0, y)[x] = cline(1, y)[x]; sline(0, y)[x] = sline(1, y)[x];
#assign y y + 1 cline(0, y)[x] = cline(1, y)[x];
#until y == SPLIT1 }
}
#pragma unroll(full)
for(char y=0; y<SPLIT1; y++)
{
sline(0, y)[39] = rbuff[y];
cline(0, y)[39] = cbuff[y];
} }
#assign y 0
#repeat
sline(0, y)[39] = rbuff[y];
cline(0, y)[39] = cbuff[y];
#assign y y + 1
#until y == SPLIT1
} }
// Scroll bottom two sections // Scroll bottom two sections
@ -43,34 +44,35 @@ void scrollLeft1(void)
{ {
for(char x=0; x<39; x++) for(char x=0; x<39; x++)
{ {
#assign y SPLIT1 #pragma unroll(full)
#repeat for(char y=SPLIT1; y<SPLIT2; y++)
sline(0, y)[x] = sline(1, y)[x]; {
cline(0, y)[x] = cline(1, y)[x]; sline(0, y)[x] = sline(1, y)[x];
#assign y y + 1 cline(0, y)[x] = cline(1, y)[x];
#until y == SPLIT2 }
} }
#assign y SPLIT1 #pragma unroll(full)
#repeat for(char y=SPLIT1; y<SPLIT2; y++)
sline(0, y)[39] = rbuff[y]; {
cline(0, y)[39] = cbuff[y]; sline(0, y)[39] = rbuff[y];
#assign y y + 1 cline(0, y)[39] = cbuff[y];
#until y == SPLIT2 }
for(char x=0; x<39; x++) for(char x=0; x<39; x++)
{ {
#assign y SPLIT2 #pragma unroll(full)
#repeat for(char y=SPLIT2; y<25; y++)
sline(0, y)[x] = sline(1, y)[x]; {
cline(0, y)[x] = cline(1, y)[x]; sline(0, y)[x] = sline(1, y)[x];
#assign y y + 1 cline(0, y)[x] = cline(1, y)[x];
#until y == 25 }
}
#pragma unroll(full)
for(char y=SPLIT2; y<25; y++)
{
sline(0, y)[39] = rbuff[y];
cline(0, y)[39] = cbuff[y];
} }
#assign y SPLIT2
#repeat
sline(0, y)[39] = rbuff[y];
cline(0, y)[39] = cbuff[y];
#assign y y + 1
#until y == 25
} }