GrafX2 2.9.3227
The ultimate 256-color painting program
Commodore 64

Some C64 video mode related functions. More...

Functions

int C64_FLI (T_IO_Context *context, byte *bitmap, byte *screen_ram, byte *color_ram, byte *background)
 Save a 3 layer picture to C64 FLI format. More...
 
int C64_pixels_to_FLI (byte *bitmap, byte *screen_ram, byte *color_ram, byte *background, const byte *pixels, long pitch, int errmode)
 Convert a (1 layer) picture to C64 FLI format. More...
 
void C64_set_palette (T_Components *palette)
 Set the 16 colors Commodore 64 palette. More...
 

Detailed Description

Some C64 video mode related functions.

Function Documentation

◆ C64_FLI()

int C64_FLI ( T_IO_Context context,
byte bitmap,
byte screen_ram,
byte color_ram,
byte background 
)

Save a 3 layer picture to C64 FLI format.

Parameters
contextthe Save context
bitmapa 8000 byte buffer to store bitmap data
screen_rama 8192 byte buffer to store the 8 screen RAMs
color_rama 1000 byte buffer to store the color RAM
backgrounda 200 byte buffer to store the background colors
Returns
0 for success, 1 if the picture is less than 3 layers, 2 if the picture dimensions are not 160x200

References count_set_bits(), Get_pixel(), T_IO_Context::Height, T_IO_Context::Nb_layers, NULL, Set_saving_layer(), and T_IO_Context::Width.

Referenced by Save_C64_fli().

◆ C64_pixels_to_FLI()

int C64_pixels_to_FLI ( byte bitmap,
byte screen_ram,
byte color_ram,
byte background,
const byte pixels,
long  pitch,
int  errmode 
)

Convert a (1 layer) picture to C64 FLI format.

Some "hints" can be put in background and color_ram. (a color value >= 16 means no hint).

Errors can be either outputed to the user with Warning messages, or put in layer 4. The layer 4 has to be created before.

Parameters
bitmapa 8000 byte buffer to store bitmap data
screen_rama 8192 byte buffer to store the 8 screen RAMs
color_rama 1000 byte buffer to store the color RAM
backgrounda 200 byte buffer to store the background colors
pixelssource pixel buffer (at least 160x200)
pitchbytes per line of the pixel buffer
errmodeerror reporting mode 0 = report, 1 = mark in layer 4
Returns
0 the number of constraint errors

References T_Document::backups, count_set_bits(), count_trailing_zeros(), GFX2_DEBUG, GFX2_INFO, GFX2_Log(), Main, T_Page::Nb_layers, T_List_of_pages::Pages, Pixel_in_layer(), and Warning_with_format().

Referenced by Button_Constraint_mode(), and Save_C64_fli_monolayer().

◆ C64_set_palette()

void C64_set_palette ( T_Components palette)

Set the 16 colors Commodore 64 palette.

Set C64 Palette from http://www.pepto.de/projects/colorvic/

Also set transparent color "16" as a dark grey that is distinguishable from black, but darker than normal colors.

set color "17" as RED to see color clashes

References T_Components::B, T_Components::G, and T_Components::R.

Referenced by Button_Constraint_menu(), Load_C64(), Load_GPX(), and Load_PRG().