reindent Save_C64_multi() and Save_C64_fli()

This commit is contained in:
Thomas Bernard 2018-11-06 22:14:15 +01:00
parent 2b22a7fe1d
commit cb5dd7ae69

View File

@ -2726,7 +2726,6 @@ int Save_C64_hires(T_IO_Context *context, byte saveWhat, byte loadAddr)
if (pixel==c2) bits|=1; if (pixel==c2) bits|=1;
} }
bitmap[pos++]=bits; bitmap[pos++]=bits;
//Write_byte(file,bits&255);
} }
} }
} }
@ -2879,24 +2878,17 @@ int Save_C64_multi(T_IO_Context *context, byte saveWhat, byte loadAddr)
for(i=0; i<16; i++) for(i=0; i<16; i++)
{ {
lut[i]=0; lut[i]=0;
if(cusage[i]) if(cusage[i] && (i!=background))
{
if(i!=background)
{ {
lut[i]=color; lut[i]=color;
c[color]=i; c[color]=i;
color++; color++;
} }
else
{
lut[i]=0;
}
}
} }
// add to screen_ram and color_ram // add to screen_ram and color_ram
screen_ram[cx+cy*40]=c[1]<<4|c[2]; screen_ram[cx+cy*40]=c[1]<<4|c[2];
color_ram[cx+cy*40]=c[3]; color_ram[cx+cy*40]=c[3];
//printf("%x%x%x ",c[1],c[2],c[3]);
for(y=0;y<8;y++) for(y=0;y<8;y++)
{ {
bits=0; bits=0;
@ -2904,7 +2896,6 @@ int Save_C64_multi(T_IO_Context *context, byte saveWhat, byte loadAddr)
{ {
pixel = Get_pixel(context, cx*4+x,cy*8+y); pixel = Get_pixel(context, cx*4+x,cy*8+y);
bits = (bits << 2) | lut[pixel]; bits = (bits << 2) | lut[pixel];
} }
bitmap[pos++]=bits; bitmap[pos++]=bits;
} }
@ -2946,7 +2937,6 @@ int Save_C64_multi(T_IO_Context *context, byte saveWhat, byte loadAddr)
int Save_C64_fli(T_IO_Context * context, byte saveWhat, byte loadAddr) int Save_C64_fli(T_IO_Context * context, byte saveWhat, byte loadAddr)
{ {
FILE *file; FILE *file;
byte file_buffer[17474]; byte file_buffer[17474];
@ -2967,8 +2957,6 @@ int Save_C64_fli(T_IO_Context * context, byte saveWhat, byte loadAddr)
return 1; return 1;
} }
setvbuf(file, NULL, _IOFBF, 64*1024);
if (loadAddr) if (loadAddr)
{ {
file_buffer[0]=0; file_buffer[0]=0;
@ -2977,21 +2965,18 @@ int Save_C64_fli(T_IO_Context * context, byte saveWhat, byte loadAddr)
} }
if (saveWhat==0) if (saveWhat==0)
Write_bytes(file,file_buffer+2,256); Write_bytes(file,file_buffer+2,256); // Background colors for lines 0-199 (+ 56bytes padding)
if (saveWhat==0 || saveWhat==3) if (saveWhat==0 || saveWhat==3)
Write_bytes(file,file_buffer+258,1024); Write_bytes(file,file_buffer+258,1024); // Color RAM (1000 bytes + padding 24)
if (saveWhat==0 || saveWhat==1) if (saveWhat==0 || saveWhat==1)
Write_bytes(file,file_buffer+1282,8192); Write_bytes(file,file_buffer+1282,8192); // Screen RAMs 8 x (1000 bytes + padding 24)
if (saveWhat==0 || saveWhat==2) if (saveWhat==0 || saveWhat==2)
Write_bytes(file,file_buffer+9474,8000); Write_bytes(file,file_buffer+9474,8000); // BitMap
fclose(file); fclose(file);
//printf("\nbg:%d\n",background);
return 0; return 0;
} }