Load GO1/GO2 who have a CPC Old palette
This commit is contained in:
parent
6353202623
commit
24c0bda8b4
@ -5093,8 +5093,10 @@ void Load_GOS(T_IO_Context* context)
|
||||
return;
|
||||
}
|
||||
|
||||
if (CPC_check_AMSDOS(file, NULL, NULL)) {
|
||||
if (CPC_check_AMSDOS(file, NULL, &file_size)) {
|
||||
fseek(file, 128, SEEK_SET); // right after AMSDOS header
|
||||
} else {
|
||||
file_size = File_length_file(file);
|
||||
}
|
||||
|
||||
if (Config.Clear_palette)
|
||||
@ -5102,6 +5104,8 @@ void Load_GOS(T_IO_Context* context)
|
||||
|
||||
File_error = 0;
|
||||
|
||||
if (file_size == 32)
|
||||
{
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
uint16_t word;
|
||||
@ -5115,6 +5119,22 @@ void Load_GOS(T_IO_Context* context)
|
||||
context->Palette[i].G = ((word >> 8) & 0xF) * 0x11;
|
||||
context->Palette[i].B = ((word >> 0) & 0xF) * 0x11;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Setup the palette (amstrad hardware palette)
|
||||
CPC_set_HW_palette(context->Palette + 0x40);
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
byte ink;
|
||||
if (!Read_byte(file, &ink))
|
||||
{
|
||||
File_error = 2;
|
||||
return;
|
||||
}
|
||||
context->Palette[i] = context->Palette[ink];
|
||||
}
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user