set either TO7/70 or MO5 palette
This commit is contained in:
parent
a66d23a5e0
commit
e13ab6e442
@ -4941,14 +4941,6 @@ void Load_MOTO(T_IO_Context * context)
|
||||
enum MOTO_mode { F_40col, F_80col, F_bm4, F_bm16 } mode = F_40col;
|
||||
enum PIXEL_RATIO ratio = PIXEL_SIMPLE;
|
||||
int width = 320, height = 200, columns = 40;
|
||||
static const unsigned char mo5palette[48] = {
|
||||
// Taken from https://16couleurs.wordpress.com/2013/03/31/archeologie-infographique-le-pixel-art-pour-thomson/
|
||||
// http://pulkomandy.tk/wiki/doku.php?id=documentations:devices:gate.arrays#video_generation
|
||||
0, 0, 0, 255, 85, 85, 0, 255, 0, 255, 255, 0,
|
||||
85, 85, 255, 255, 0, 255, 0, 255, 255, 255, 255, 255,
|
||||
170, 170, 170, 255, 170, 255, 170, 255, 170, 255, 255, 170,
|
||||
85, 170, 255, 255, 170, 170, 170, 255, 255, 255, 170, 85
|
||||
};
|
||||
|
||||
File_error = 1;
|
||||
file = Open_file_read(context);
|
||||
@ -4958,7 +4950,7 @@ void Load_MOTO(T_IO_Context * context)
|
||||
// Load default palette
|
||||
if (Config.Clear_palette)
|
||||
memset(context->Palette,0,sizeof(T_Palette));
|
||||
memcpy(context->Palette, mo5palette, sizeof(mo5palette));
|
||||
MOTO_set_TO7_palette(context->Palette);
|
||||
|
||||
file_type = MOTO_Check_binary_file(file);
|
||||
if (fseek(file, 0, SEEK_SET) < 0)
|
||||
@ -5139,7 +5131,10 @@ void Load_MOTO(T_IO_Context * context)
|
||||
else if(file_type == 3 || file_type == 4)
|
||||
{
|
||||
if (file_type == 4) // MO file
|
||||
{
|
||||
transpose = 0;
|
||||
MOTO_set_MO5_palette(context->Palette);
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
27
src/oldies.c
27
src/oldies.c
@ -545,3 +545,30 @@ void MOTO_gamma_correct_MOTO_to_RGB(T_Components * color, word bgr)
|
||||
color->G = (byte)round(pow(((bgr >> 4)& 0x0F)/15.0, inv_gamma) * 255.0);
|
||||
color->R = (byte)round(pow((bgr & 0x0F)/15.0, inv_gamma) * 255.0);
|
||||
}
|
||||
|
||||
void MOTO_set_MO5_palette(T_Components * palette)
|
||||
{
|
||||
static const unsigned char mo5palette[48] = {
|
||||
// Taken from https://16couleurs.wordpress.com/2013/03/31/archeologie-infographique-le-pixel-art-pour-thomson/
|
||||
// http://pulkomandy.tk/wiki/doku.php?id=documentations:devices:gate.arrays#video_generation
|
||||
0, 0, 0, 255, 85, 85, 0, 255, 0, 255, 255, 0,
|
||||
85, 85, 255, 255, 0, 255, 0, 255, 255, 255, 255, 255,
|
||||
170, 170, 170, 255, 170, 255, 170, 255, 170, 255, 255, 170,
|
||||
85, 170, 255, 255, 170, 170, 170, 255, 255, 255, 170, 85
|
||||
};
|
||||
memcpy(palette, mo5palette, 48);
|
||||
}
|
||||
|
||||
void MOTO_set_TO7_palette(T_Components * palette)
|
||||
{
|
||||
int i;
|
||||
static const word to8default_pal[16] = {
|
||||
// BGR values Dumped from a TO8D with a BASIC 512 program :
|
||||
// FOR I=0TO15:PRINT PALETTE(I):NEXT I
|
||||
0x000, 0x00F, 0x0F0, 0x0FF, 0xF00, 0xF0F, 0xFF0, 0xFFF,
|
||||
0x777, 0x33A, 0x3A3, 0x3AA, 0xA33, 0xA3A, 0xEE7, 0x07B
|
||||
};
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
MOTO_gamma_correct_MOTO_to_RGB(palette + i, to8default_pal[i]);
|
||||
}
|
||||
|
||||
16
src/oldies.h
16
src/oldies.h
@ -141,4 +141,20 @@ word MOTO_gamma_correct_RGB_to_MOTO(const T_Components * color);
|
||||
* Convert a Thomson BGR value to RGB values with gamma correction.
|
||||
*/
|
||||
void MOTO_gamma_correct_MOTO_to_RGB(T_Components * color, word bgr);
|
||||
|
||||
/**
|
||||
* Set MO5 Palette
|
||||
*
|
||||
* http://pulkomandy.tk/wiki/doku.php?id=documentations:devices:gate.arrays#video_generation
|
||||
* https://16couleurs.wordpress.com/2013/03/31/archeologie-infographique-le-pixel-art-pour-thomson/
|
||||
*/
|
||||
void MOTO_set_MO5_palette(T_Components * palette);
|
||||
|
||||
/**
|
||||
* Set TO7/70 Palette.
|
||||
*
|
||||
* The 8 first colors are the TO7 palette
|
||||
*/
|
||||
void MOTO_set_TO7_palette(T_Components * palette);
|
||||
|
||||
/** @}*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user