CPC_set_HW_palette()
This commit is contained in:
parent
3ed119a6c2
commit
bc06fbae72
@ -3829,42 +3829,6 @@ void Load_CM5(T_IO_Context* context)
|
|||||||
int mod=0;
|
int mod=0;
|
||||||
short line = 0;
|
short line = 0;
|
||||||
int tx, ty;
|
int tx, ty;
|
||||||
static const T_Components CPC_Hw_Palette[] = {
|
|
||||||
{0x6E, 0x7D, 0x6B}, // 0x40
|
|
||||||
{0x6E, 0x7B, 0x6B}, // 0x41
|
|
||||||
{0, 0xF3, 0x6B},
|
|
||||||
{0xF3, 0xF3, 0x6D},
|
|
||||||
{0, 2, 0x6B},
|
|
||||||
{0xF0, 2, 0x68},
|
|
||||||
{0, 0x78, 0x68},
|
|
||||||
{0xF3, 0x7D, 0x6B},
|
|
||||||
|
|
||||||
{0xF3, 0x02, 0x68}, // 0x48
|
|
||||||
{0xF3, 0xF3, 0x6B},
|
|
||||||
{0xF3, 0xF3, 0xD},
|
|
||||||
{255, 0xF3, 0xF9},
|
|
||||||
{0xF3, 5, 6},
|
|
||||||
{0xF3, 2, 0xF4},
|
|
||||||
{0xF3, 0x7D, 0xD},
|
|
||||||
{0xFA, 0x80, 0xF9},
|
|
||||||
|
|
||||||
{0x00, 0x02, 0x68}, // 0x50
|
|
||||||
{0x02, 0xF3, 0x6B},
|
|
||||||
{2, 0xF0, 1},
|
|
||||||
{0xF, 0xF3, 0xF2},
|
|
||||||
{0, 2, 1},
|
|
||||||
{0x0C, 2, 0xF4},
|
|
||||||
{2, 0x78, 1},
|
|
||||||
{0xC, 0x7B, 0xF4},
|
|
||||||
{0x69, 2, 0x68}, // 0x58
|
|
||||||
{0x71, 0xF3, 0x6B},
|
|
||||||
{0x71, 0xF5, 4},
|
|
||||||
{0x71, 0xF3, 0xF4},
|
|
||||||
{0x6C, 2, 1},
|
|
||||||
{0x6C, 2, 0xF2},
|
|
||||||
{0x6E, 0x7B, 1},
|
|
||||||
{0x6E, 0x7B, 0xF6}
|
|
||||||
};
|
|
||||||
// for preview :
|
// for preview :
|
||||||
byte ink0;
|
byte ink0;
|
||||||
byte ink1[256];
|
byte ink1[256];
|
||||||
@ -3883,7 +3847,7 @@ void Load_CM5(T_IO_Context* context)
|
|||||||
memset(context->Palette,0,sizeof(T_Palette));
|
memset(context->Palette,0,sizeof(T_Palette));
|
||||||
|
|
||||||
// Setup the palette (amstrad hardware palette)
|
// Setup the palette (amstrad hardware palette)
|
||||||
memcpy(context->Palette + 0x40, CPC_Hw_Palette, sizeof(CPC_Hw_Palette));
|
CPC_set_HW_palette(context->Palette + 0x40);
|
||||||
|
|
||||||
if (!Read_byte(file, &ink0))
|
if (!Read_byte(file, &ink0))
|
||||||
File_error = 2;
|
File_error = 2;
|
||||||
|
|||||||
42
src/oldies.c
42
src/oldies.c
@ -462,6 +462,48 @@ void ZX_Spectrum_set_palette(T_Components * palette)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPC_set_HW_palette(T_Components * palette)
|
||||||
|
{
|
||||||
|
static const T_Components CPC_Hw_Palette[] = {
|
||||||
|
{0x6E, 0x7D, 0x6B}, // 0x40
|
||||||
|
{0x6E, 0x7B, 0x6B}, // 0x41
|
||||||
|
{0, 0xF3, 0x6B},
|
||||||
|
{0xF3, 0xF3, 0x6D},
|
||||||
|
{0, 2, 0x6B},
|
||||||
|
{0xF0, 2, 0x68},
|
||||||
|
{0, 0x78, 0x68},
|
||||||
|
{0xF3, 0x7D, 0x6B},
|
||||||
|
|
||||||
|
{0xF3, 0x02, 0x68}, // 0x48
|
||||||
|
{0xF3, 0xF3, 0x6B},
|
||||||
|
{0xF3, 0xF3, 0xD},
|
||||||
|
{255, 0xF3, 0xF9},
|
||||||
|
{0xF3, 5, 6},
|
||||||
|
{0xF3, 2, 0xF4},
|
||||||
|
{0xF3, 0x7D, 0xD},
|
||||||
|
{0xFA, 0x80, 0xF9},
|
||||||
|
|
||||||
|
{0x00, 0x02, 0x68}, // 0x50
|
||||||
|
{0x02, 0xF3, 0x6B},
|
||||||
|
{2, 0xF0, 1},
|
||||||
|
{0xF, 0xF3, 0xF2},
|
||||||
|
{0, 2, 1},
|
||||||
|
{0x0C, 2, 0xF4},
|
||||||
|
{2, 0x78, 1},
|
||||||
|
{0xC, 0x7B, 0xF4},
|
||||||
|
{0x69, 2, 0x68}, // 0x58
|
||||||
|
{0x71, 0xF3, 0x6B},
|
||||||
|
{0x71, 0xF5, 4},
|
||||||
|
{0x71, 0xF3, 0xF4},
|
||||||
|
{0x6C, 2, 1},
|
||||||
|
{0x6C, 2, 0xF2},
|
||||||
|
{0x6E, 0x7B, 1},
|
||||||
|
{0x6E, 0x7B, 0xF6}
|
||||||
|
};
|
||||||
|
|
||||||
|
memcpy(palette, CPC_Hw_Palette, sizeof(CPC_Hw_Palette));
|
||||||
|
}
|
||||||
|
|
||||||
int DECB_Check_binary_file(FILE * f)
|
int DECB_Check_binary_file(FILE * f)
|
||||||
{
|
{
|
||||||
byte code;
|
byte code;
|
||||||
|
|||||||
15
src/oldies.h
15
src/oldies.h
@ -60,6 +60,21 @@ void ZX_Spectrum_set_palette(T_Components * palette);
|
|||||||
|
|
||||||
/** @}*/
|
/** @}*/
|
||||||
|
|
||||||
|
/** @defgroup cpc Amstrad CPC
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set 32 color HW Amstrad CPC palette
|
||||||
|
*
|
||||||
|
* The palette is in fact 27 colors, with some duplicates.
|
||||||
|
* http://www.cpcwiki.eu/index.php/CPC_Palette
|
||||||
|
*/
|
||||||
|
void CPC_set_HW_palette(T_Components * palette);
|
||||||
|
|
||||||
|
/** @}*/
|
||||||
|
|
||||||
/** @defgroup decb DECB binary format
|
/** @defgroup decb DECB binary format
|
||||||
*
|
*
|
||||||
* The DECB binary format was used on 6809 based machines :
|
* The DECB binary format was used on 6809 based machines :
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user