GrafX2 2.9.3227
The ultimate 256-color painting program
cpcformats.c File Reference

Formats for the Amstrad CPC / CPC Plus computers. More...

#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "engine.h"
#include "global.h"
#include "fileformats.h"
#include "input.h"
#include "io.h"
#include "loadsavefuncs.h"
#include "libraw2crtc.h"
#include "oldies.h"
#include "readline.h"
#include "windows.h"
#include "misc.h"
#include "gfx2mem.h"
#include "gfx2log.h"
#include "screen.h"
#include "impdraw_loader.h"
#include "cpc_scr_simple_loader.h"
+ Include dependency graph for cpcformats.c:

Data Structures

struct  sgx_data
 Structure for current information about loading SGX file. More...
 

Macros

#define MIN(a, b)   (((a)<(b)) ? (a) : (b))
 
#define MAX(a, b)   (((a)>(b)) ? (a) : (b))
 

Typedefs

typedef int(* Read_SGX_Callback) (struct sgx_data *, word, word, word, word, word, byte)
 Callback function for Read_SGX() More...
 

Functions

void Test_SGX (T_IO_Context *context, FILE *file)
 Test for SGX file (SymbOS) More...
 
static void Set_SGX_Palette (T_IO_Context *context)
 
static int Read_SGX (struct sgx_data *data, Read_SGX_Callback cb)
 Read a SGX file structure. More...
 
int SGX_Get_dimensions (struct sgx_data *data, word posx, word posy, word width, word height, word byte_width, byte ncolors)
 Only skip bytes. More...
 
int SGX_Load_Picture (struct sgx_data *data, word posx, word posy, word width, word height, word byte_width, byte ncolors)
 Set the pixels. More...
 
void Load_SGX (T_IO_Context *context)
 
static int Save_SGX_Sub (T_IO_Context *context, FILE *file, word n_colors)
 Write SGX file format as specified here : http://www.cpcwiki.eu/index.php/Format:SGX_(SymbOS_graphic_files) More...
 
void Save_SGX (T_IO_Context *context)
 
void Test_SCR (T_IO_Context *context, FILE *file)
 Test for SCR file (Amstrad CPC) More...
 
static int Depack_CPC_LZW (byte *dst, FILE *file)
 Unpack LZ streams from CPCconvImg v0.x (Demoniak/iMPACT!) More...
 
void Load_SCR (T_IO_Context *context)
 Load Advanced OCP Art Studio files (Amstrad CPC) More...
 
void Save_SCR (T_IO_Context *context)
 Save Amstrad SCR file. More...
 
void Test_GOS (T_IO_Context *context, FILE *file)
 Test for GO1/GO2/KIT - Amstrad Plus Graphos. More...
 
void Load_GOS (T_IO_Context *context)
 Load GO1/GO2/KIT - Amstrad CPC Plus Graphos. More...
 
void Save_GOS (T_IO_Context *context)
 
void Test_CM5 (T_IO_Context *context, FILE *file)
 Test for CM5 - Amstrad CPC "Mode 5" picture. More...
 
void Load_CM5 (T_IO_Context *context)
 Load Amstrad CPC "Mode 5" picture. More...
 
void Save_CM5 (T_IO_Context *context)
 Save a CPC Mode 5 picture. More...
 
void Test_PPH (T_IO_Context *context, FILE *file)
 Amstrad CPC 'PPH' for Perfect Pix. More...
 
static uint8_t pph_blend (uint8_t a, uint8_t b)
 
void Load_PPH (T_IO_Context *context)
 
void Save_PPH (T_IO_Context *context)
 Not yet implemented. More...
 

Detailed Description

Formats for the Amstrad CPC / CPC Plus computers.

Macro Definition Documentation

◆ MIN

#define MIN (   a,
 
)    (((a)<(b)) ? (a) : (b))

◆ MAX

#define MAX (   a,
 
)    (((a)>(b)) ? (a) : (b))