GrafX2 2.9.3227
The ultimate 256-color painting program
|
Support for Atari ST picture formats. More...
Functions | |
static void | PI4_16b_to_16p (const byte *src, byte *dest) |
8bpp Planar to chunky conversion. More... | |
static void | PI1_8b_to_16p (const byte *src, byte *dest) |
4bpp Planar to chunky conversion. More... | |
static void | PI2_4b_to_16p (const byte *src, byte *dest) |
2bpp Planar to chunky conversion. More... | |
static void | PI1_16p_to_8b (const byte *src, byte *dest) |
Chunky to 4bpp planar conversion. More... | |
static void | PI1_decode_palette (const byte *src, T_Components *palette) |
Decode the 16 colors Atari ST(E) palette. More... | |
void | PI1_code_palette (const T_Components *palette, byte *dest) |
Code a 16 colors Atari ST(E) palette. More... | |
static void | PI1_load_ranges (T_IO_Context *context, const byte *buffer, int size) |
Load color cycling data from a PI1 or PC1 image (Degas Elite format) More... | |
void | PI1_save_ranges (T_IO_Context *context, byte *buffer, int size) |
Saves color ranges from a PI1 or PC1 image (Degas Elite format) More... | |
void | Test_PI1 (T_IO_Context *context, FILE *file) |
Test for Degas file format. More... | |
void | Load_PI1 (T_IO_Context *context) |
Load Degas file format. More... | |
void | Save_PI1 (T_IO_Context *context) |
Save a PI1 Degas uncompressed picture. More... | |
static void | PC1_4bp_to_1line (const byte *src0, const byte *src1, const byte *src2, const byte *src3, byte *dest) |
4bpp planar to chunky conversion. More... | |
static void | PC1_1line_to_4bp (const byte *src, byte *dst0, byte *dst1, byte *dst2, byte *dst3) |
Convert 1 line of 320 pixel from chunky to 4bpp planar. More... | |
void | Test_PC1 (T_IO_Context *context, FILE *file) |
Test for Degas Elite Compressed format. More... | |
void | Load_PC1 (T_IO_Context *context) |
Load Degas Elite compressed files. More... | |
void | Save_PC1 (T_IO_Context *context) |
Save a Degas Elite compressed picture. More... | |
void | Test_NEO (T_IO_Context *context, FILE *file) |
NeoChrome Format : More... | |
void | Load_NEO (T_IO_Context *context) |
Load Neochrome file format. More... | |
void | Save_NEO (T_IO_Context *context) |
Save in NeoChrome format. More... | |
void | Test_TNY (T_IO_Context *context, FILE *file) |
void | Load_TNY (T_IO_Context *context) |
void | Save_TNY (T_IO_Context *context) |
Save in Tiny compressed format. More... | |
void | Test_CA1 (T_IO_Context *context, FILE *file) |
test for CrackArt format. More... | |
void | Load_CA1 (T_IO_Context *context) |
void | Save_CA1 (T_IO_Context *context) |
Save a 320x200 16c picture in CrackArt format. More... | |
Support for Atari ST picture formats.
The Atari ST has 3 video modes :
Supported formats :
8bpp Planar to chunky conversion.
Reads 16 pixels from 8 words with TT low resolution layout.
src | 16 bytes Atari TT screen memory |
dest | 16 bytes buffer |
Referenced by Load_PI1().
4bpp Planar to chunky conversion.
Reads 16 pixels from 4 words with Atari ST low resolution layout.
src | 8 bytes Atari ST screen memory |
dest | 16 bytes buffer |
Referenced by Load_CA1(), Load_NEO(), Load_PI1(), and Load_TNY().
2bpp Planar to chunky conversion.
Reads 16 pixels from 2 words with Atari ST medium resolution layout.
src | 4 bytes Atari ST screen memory |
dest | 16 bytes buffer |
Referenced by Load_CA1(), Load_NEO(), Load_PI1(), and Load_TNY().
Chunky to 4bpp planar conversion.
For ST Low resolution.
src | 16 bytes buffer |
dest | 8 bytes (4 words in Atari ST memory screen layout) |
Referenced by Save_CA1(), Save_NEO(), Save_PI1(), and Save_TNY().
|
static |
Decode the 16 colors Atari ST(E) palette.
src | 32 bytes Atari ST(E) palette |
palette | GrafX2 palette structure |
References T_Components::B, T_Components::G, and T_Components::R.
Referenced by Load_CA1(), Load_NEO(), Load_PC1(), Load_PI1(), and Load_TNY().
void PI1_code_palette | ( | const T_Components * | palette, |
byte * | dest | ||
) |
Code a 16 colors Atari ST(E) palette.
palette | GrafX2 palette structure |
dest | 32 bytes buffer |
References Get_palette_RGB_scale(), GFX2_DEBUG, and GFX2_Log().
Referenced by Save_CA1(), Save_NEO(), Save_PC1(), Save_PI1(), and Save_TNY().
|
static |
Load color cycling data from a PI1 or PC1 image (Degas Elite format)
References T_IO_Context::Color_cycles, COLOR_CYCLING_SPEED_MAX, T_IO_Context::Cycle_range, T_Color_cycle::End, GFX2_DEBUG, GFX2_Log(), T_Color_cycle::Inverse, NULL, T_Color_cycle::Speed, T_Color_cycle::Start, and SWAP_WORDS.
Referenced by Load_PC1(), and Load_PI1().
void PI1_save_ranges | ( | T_IO_Context * | context, |
byte * | buffer, | ||
int | size | ||
) |
Saves color ranges from a PI1 or PC1 image (Degas Elite format)
References T_IO_Context::Color_cycles, T_IO_Context::Cycle_range, T_Color_cycle::End, T_Color_cycle::Inverse, T_Color_cycle::Speed, and T_Color_cycle::Start.
Referenced by Save_PC1(), and Save_PI1().
void Test_PI1 | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for Degas file format.
References File_error, File_length_file(), and Read_word_be().
void Load_PI1 | ( | T_IO_Context * | context | ) |
Load Degas file format.
References T_Config::Clear_palette, Config, File_error, File_length_file(), FORMAT_PI1, GFX2_DEBUG, GFX2_Log(), NULL, Open_file_read(), T_IO_Context::Palette, PI1_8b_to_16p(), PI1_decode_palette(), PI1_load_ranges(), PI2_4b_to_16p(), PI4_16b_to_16p(), PIXEL_SIMPLE, PIXEL_TALL, PIXEL_WIDE, Pre_load(), Read_bytes(), Read_word_be(), and Set_pixel().
void Save_PI1 | ( | T_IO_Context * | context | ) |
Save a PI1 Degas uncompressed picture.
References T_IO_Context::Color_cycles, File_error, Get_pixel(), GFX2_malloc, NULL, Open_file_write(), T_IO_Context::Palette, PI1_16p_to_8b(), PI1_code_palette(), PI1_save_ranges(), Remove_file(), and Write_bytes().
|
static |
4bpp planar to chunky conversion.
Converts 1 line (320 pixels) at a time.
src0 | 40 bytes for plane 0 |
src1 | 40 bytes for plane 1 |
src2 | 40 bytes for plane 2 |
src3 | 40 bytes for plane 3 |
dest | 320 bytes destination buffer |
Referenced by Load_PC1().
|
static |
Convert 1 line of 320 pixel from chunky to 4bpp planar.
src | 320 bytes buffer |
dst0 | 40 bytes buffer for plane 0 |
dst1 | 40 bytes buffer for plane 1 |
dst2 | 40 bytes buffer for plane 2 |
dst3 | 40 bytes buffer for plane 3 |
Referenced by Save_PC1().
void Test_PC1 | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for Degas Elite Compressed format.
References File_error, File_length_file(), and Read_word_be().
void Load_PC1 | ( | T_IO_Context * | context | ) |
Load Degas Elite compressed files.
References T_Config::Clear_palette, Config, File_error, File_length_file(), FORMAT_PC1, GFX2_DEBUG, GFX2_INFO, GFX2_Log(), GFX2_malloc, NULL, Open_file_read(), PackBits_unpack_from_file(), PACKBITS_UNPACK_OK, T_IO_Context::Palette, PC1_4bp_to_1line(), PI1_decode_palette(), PI1_load_ranges(), PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_bytes(), Read_word_be(), and Set_pixel().
void Save_PC1 | ( | T_IO_Context * | context | ) |
Save a Degas Elite compressed picture.
References File_error, Get_pixel(), GFX2_malloc, NULL, Open_file_write(), PackBits_pack_buffer(), T_IO_Context::Palette, PC1_1line_to_4bp(), PI1_code_palette(), PI1_save_ranges(), Remove_file(), Write_bytes(), and Write_word_be().
void Test_NEO | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
NeoChrome Format :
1 word flag word [always 0] 1 word resolution [0 = low res, 1 = medium res, 2 = high res] 16 words palette 12 bytes filename [usually " . "] 1 word color animation limits. High bit (bit 15) set if color animation data is valid. Low byte contains color animation limits (4 most significant bits are left/lower limit, 4 least significant bits are right/upper limit). 1 word color animation speed and direction. High bit (bit 15) set if animation is on. Low order byte is # vblanks per step. If negative, scroll is left (decreasing). Number of vblanks between cycles is |x| - 1 1 word # of color steps (as defined in previous word) to display picture before going to the next. (For use in slide shows) 1 word image X offset [unused, always 0] 1 word image Y offset [unused, always 0] 1 word image width [unused, always 320] 1 word image height [unused, always 200] 33 words reserved for future expansion 32000 bytes pixel data
Dali *.SD0 (ST low resolution) .SD1 (ST medium resolution) .SD2 (ST high resolution)
Files do not seem to have any resolution or bit plane info stored in them. The file extension seems to be the only way to determine the contents.
1 long file id? [always 0] 16 words palette 92 bytes reserved? [usually 0]
References File_error, File_length_file(), and Read_word_be().
void Load_NEO | ( | T_IO_Context * | context | ) |
Load Neochrome file format.
References T_Config::Clear_palette, T_IO_Context::Color_cycles, COLOR_CYCLING_SPEED_MAX, Config, T_IO_Context::Cycle_range, T_Color_cycle::End, File_error, File_length_file(), FORMAT_NEO, GFX2_DEBUG, GFX2_Log(), GFX2_LogHexDump(), T_Color_cycle::Inverse, NULL, Open_file_read(), T_IO_Context::Palette, PI1_8b_to_16p(), PI1_decode_palette(), PI2_4b_to_16p(), PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_bytes(), Read_word_be(), Set_pixel(), T_Color_cycle::Speed, and T_Color_cycle::Start.
void Save_NEO | ( | T_IO_Context * | context | ) |
Save in NeoChrome format.
References T_IO_Context::Color_cycles, T_IO_Context::Cycle_range, T_Color_cycle::End, File_error, T_IO_Context::File_name, Get_pixel(), T_Color_cycle::Inverse, NULL, Open_file_write(), T_IO_Context::Palette, PI1_16p_to_8b(), PI1_code_palette(), Remove_file(), T_Color_cycle::Speed, T_Color_cycle::Start, Write_byte(), Write_bytes(), and Write_word_be().
void Test_TNY | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References File_error, File_length_file(), GFX2_DEBUG, GFX2_Log(), Read_byte(), and Read_word_be().
void Load_TNY | ( | T_IO_Context * | context | ) |
Tiny stuff packs the ST RAM in 4 planes of 8000 bytes Data is organized by column in each plane Warning : this is the same organization for all 3 ST Video modes
References T_Config::Clear_palette, T_IO_Context::Color_cycles, Config, T_IO_Context::Cycle_range, T_Color_cycle::End, File_error, File_length_file(), FORMAT_TNY, GFX2_DEBUG, GFX2_Log(), GFX2_malloc, T_Color_cycle::Inverse, NULL, Open_file_read(), T_IO_Context::Palette, PI1_8b_to_16p(), PI1_decode_palette(), PI2_4b_to_16p(), PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_byte(), Read_bytes(), Read_word_be(), Set_pixel(), T_Color_cycle::Speed, and T_Color_cycle::Start.
void Save_TNY | ( | T_IO_Context * | context | ) |
Save in Tiny compressed format.
fill the buffer with the special Tiny Stuff organization
References File_error, NULL, Open_file_write(), T_IO_Context::Palette, PI1_16p_to_8b(), PI1_code_palette(), T_IO_Context::Pitch, Remove_file(), T_IO_Context::Target_address, WORDS_EQU, Write_byte(), Write_bytes(), and Write_word_be().
void Test_CA1 | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
test for CrackArt format.
Test that the files starts with the "CA" signature, then 1 byte for the compressed flag (0 or 1), then 1 byte for the resolution (0=low, 1=med, 2=high)
References File_error, and Read_bytes().
void Load_CA1 | ( | T_IO_Context * | context | ) |
References T_Config::Clear_palette, Config, File_error, File_length_file(), FORMAT_CA1, GFX2_DEBUG, GFX2_Log(), GFX2_malloc, NULL, Open_file_read(), T_IO_Context::Palette, PI1_8b_to_16p(), PI1_decode_palette(), PI2_4b_to_16p(), PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_byte(), Read_bytes(), Read_word_be(), and Set_pixel().
void Save_CA1 | ( | T_IO_Context * | context | ) |
Save a 320x200 16c picture in CrackArt format.
References File_error, Get_pixel(), GFX2_DEBUG, GFX2_Log(), GFX2_malloc, NULL, Open_file_write(), T_IO_Context::Palette, PI1_16p_to_8b(), PI1_code_palette(), Write_byte(), Write_bytes(), and Write_word_be().