Trying to compile on amiga with vbcc.
Removed some useless unixisms. Still not working. Hope I did not break too much things. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1035 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
7a19586b2d
commit
b12423d03b
45
Makefile
45
Makefile
@ -175,6 +175,21 @@ else
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
OBJDIR = obj/skyos
|
OBJDIR = obj/skyos
|
||||||
ZIP = zip
|
ZIP = zip
|
||||||
|
|
||||||
|
else ifeq ($(findstring Kickstart,$(shell version)),Kickstart)
|
||||||
|
# Classic amiga without gcc. Use vbcc.
|
||||||
|
PLATFORM = amiga-vbcc
|
||||||
|
DELCOMMAND = delete
|
||||||
|
MKDIR = makedir
|
||||||
|
RMDIR= delete
|
||||||
|
CP = copy
|
||||||
|
BIN = grafx2
|
||||||
|
COPT = -c99 -Ivbcc:PosixLib/include -D__amigaos__
|
||||||
|
CC = vc
|
||||||
|
OBJDIR = obj/amiga-vbcc
|
||||||
|
ZIP = lha
|
||||||
|
ZIPOPT= a
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
# Finally, the default rules that work fine for most unix/gcc systems, linux and freebsd are tested.
|
# Finally, the default rules that work fine for most unix/gcc systems, linux and freebsd are tested.
|
||||||
@ -245,12 +260,14 @@ else
|
|||||||
JOYCOPT =
|
JOYCOPT =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
COPT += -DSVN_revision="$(shell svnversion .)" -DProgram_Revision="$(Label)"
|
||||||
|
|
||||||
### And now for the real build rules ###
|
### And now for the real build rules ###
|
||||||
|
|
||||||
.PHONY : all debug release clean depend zip version force install uninstall
|
.PHONY : all debug release clean depend zip force install uninstall
|
||||||
|
|
||||||
# This is the list of the objects we want to build. Dependancies are built by "make depend" automatically.
|
# This is the list of the objects we want to build. Dependancies are built by "make depend" automatically.
|
||||||
OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/misc.o $(OBJDIR)/special.o $(OBJDIR)/buttons.o $(OBJDIR)/palette.o $(OBJDIR)/help.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/engine.o $(OBJDIR)/filesel.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/keyboard.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/text.o $(OBJDIR)/SFont.o $(OBJDIR)/setup.o $(OBJDIR)/pxsimple.o $(OBJDIR)/pxtall.o $(OBJDIR)/pxwide.o $(OBJDIR)/pxdouble.o $(OBJDIR)/pxtriple.o $(OBJDIR)/pxtall2.o $(OBJDIR)/pxwide2.o $(OBJDIR)/pxquad.o $(OBJDIR)/windows.o $(OBJDIR)/brush.o $(OBJDIR)/realpath.o $(OBJDIR)/mountlist.o $(OBJDIR)/input.o $(OBJDIR)/hotkeys.o $(OBJDIR)/transform.o $(OBJDIR)/pversion.o $(PLATFORMOBJ)
|
OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/misc.o $(OBJDIR)/special.o $(OBJDIR)/buttons.o $(OBJDIR)/palette.o $(OBJDIR)/help.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/engine.o $(OBJDIR)/filesel.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/keyboard.o $(OBJDIR)/io.o $(OBJDIR)/text.o $(OBJDIR)/SFont.o $(OBJDIR)/setup.o $(OBJDIR)/pxsimple.o $(OBJDIR)/pxtall.o $(OBJDIR)/pxwide.o $(OBJDIR)/pxdouble.o $(OBJDIR)/pxtriple.o $(OBJDIR)/pxtall2.o $(OBJDIR)/pxwide2.o $(OBJDIR)/pxquad.o $(OBJDIR)/windows.o $(OBJDIR)/brush.o $(OBJDIR)/realpath.o $(OBJDIR)/mountlist.o $(OBJDIR)/input.o $(OBJDIR)/hotkeys.o $(OBJDIR)/transform.o $(OBJDIR)/pversion.o $(PLATFORMOBJ)
|
||||||
|
|
||||||
SKIN_FILES = skins/skin_classic.png skins/skin_modern.png skins/font_Classic.png skins/font_Fun.png
|
SKIN_FILES = skins/skin_classic.png skins/skin_modern.png skins/font_Classic.png skins/font_Fun.png
|
||||||
|
|
||||||
@ -295,27 +312,6 @@ testsed :
|
|||||||
|
|
||||||
$(BIN) : $(OBJ)
|
$(BIN) : $(OBJ)
|
||||||
$(CC) $(OBJ) -o $(BIN) $(LOPT)
|
$(CC) $(OBJ) -o $(BIN) $(LOPT)
|
||||||
|
|
||||||
# SVN revision number
|
|
||||||
version.c :
|
|
||||||
echo "char SVN_revision[]=\"`svnversion .`\";" > version.c
|
|
||||||
ifeq ($(LABEL),)
|
|
||||||
else
|
|
||||||
echo "char Program_version[]=\"$(LABEL)\";" > pversion.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
version : delversion delpversion version.c pversion.c $(OBJDIR)/version.o $(OBJDIR)/pversion.o all
|
|
||||||
|
|
||||||
|
|
||||||
delversion :
|
|
||||||
$(DELCOMMAND) version.c
|
|
||||||
|
|
||||||
delpversion :
|
|
||||||
ifeq ($(LABEL),)
|
|
||||||
else
|
|
||||||
$(DELCOMMAND) pversion.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o : %.c
|
$(OBJDIR)/%.o : %.c
|
||||||
$(if $(wildcard $(OBJDIR)),,$(MKDIR) $(OBJDIR))
|
$(if $(wildcard $(OBJDIR)),,$(MKDIR) $(OBJDIR))
|
||||||
$(CC) $(COPT) -c $*.c -o $(OBJDIR)/$*.o
|
$(CC) $(COPT) -c $*.c -o $(OBJDIR)/$*.o
|
||||||
@ -335,6 +331,7 @@ clean :
|
|||||||
$(DELCOMMAND) $(OBJ)
|
$(DELCOMMAND) $(OBJ)
|
||||||
$(DELCOMMAND) $(BIN)
|
$(DELCOMMAND) $(BIN)
|
||||||
|
|
||||||
|
ifneq ($(PLATFORM),amiga-vbcc)
|
||||||
# Linux installation of the program
|
# Linux installation of the program
|
||||||
install : $(BIN)
|
install : $(BIN)
|
||||||
# Create dirs
|
# Create dirs
|
||||||
@ -376,5 +373,7 @@ uninstall :
|
|||||||
$(DELCOMMAND) $(DESTDIR)$(datadir)/icons/grafx2.xpm
|
$(DELCOMMAND) $(DESTDIR)$(datadir)/icons/grafx2.xpm
|
||||||
@echo Uninstall complete
|
@echo Uninstall complete
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
-include Makefile.dep
|
-include Makefile.dep
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,6 @@ $(OBJDIR)/pages.o: pages.c global.h struct.h const.h pages.h errors.h misc.h \
|
|||||||
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \
|
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \
|
||||||
buttons.h pages.h help.h sdlscreen.h errors.h op_c.h windows.h input.h \
|
buttons.h pages.h help.h sdlscreen.h errors.h op_c.h windows.h input.h \
|
||||||
palette.h shade.h
|
palette.h shade.h
|
||||||
$(OBJDIR)/pversion.o: pversion.c
|
|
||||||
$(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h misc.h \
|
$(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h misc.h \
|
||||||
pxdouble.h pxwide.h
|
pxdouble.h pxwide.h
|
||||||
$(OBJDIR)/pxquad.o: pxquad.c global.h struct.h const.h sdlscreen.h misc.h pxquad.h
|
$(OBJDIR)/pxquad.o: pxquad.c global.h struct.h const.h sdlscreen.h misc.h pxquad.h
|
||||||
@ -74,6 +73,5 @@ $(OBJDIR)/text.o: text.c SFont.h struct.h const.h global.h sdlscreen.h io.h \
|
|||||||
$(OBJDIR)/transform.o: transform.c global.h struct.h const.h transform.h engine.h \
|
$(OBJDIR)/transform.o: transform.c global.h struct.h const.h transform.h engine.h \
|
||||||
sdlscreen.h windows.h input.h help.h misc.h readline.h buttons.h \
|
sdlscreen.h windows.h input.h help.h misc.h readline.h buttons.h \
|
||||||
pages.h
|
pages.h
|
||||||
$(OBJDIR)/version.o: version.c
|
|
||||||
$(OBJDIR)/windows.o: windows.c windows.h struct.h const.h global.h graph.h engine.h \
|
$(OBJDIR)/windows.o: windows.c windows.h struct.h const.h global.h graph.h engine.h \
|
||||||
misc.h sdlscreen.h errors.h
|
misc.h sdlscreen.h errors.h
|
||||||
|
|||||||
@ -53,6 +53,10 @@
|
|||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "special.h"
|
#include "special.h"
|
||||||
|
|
||||||
|
#ifdef __VBCC__
|
||||||
|
#define __attribute__(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
||||||
#include <proto/dos.h>
|
#include <proto/dos.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|||||||
4
errors.h
4
errors.h
@ -21,6 +21,10 @@
|
|||||||
/// Functions and macros for tracing and error reporting.
|
/// Functions and macros for tracing and error reporting.
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef __func__
|
||||||
|
#define __func__ "stupid compiler !"
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Prints the source filename, line number, function name, a string and an integer.
|
/// Prints the source filename, line number, function name, a string and an integer.
|
||||||
#define DEBUG(y,z) printf("%s %d %s | %s : %d###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
|
#define DEBUG(y,z) printf("%s %d %s | %s : %d###\n",__FILE__,__LINE__,__func__,y,(unsigned int)z)
|
||||||
|
|
||||||
|
|||||||
8
graph.c
8
graph.c
@ -47,6 +47,11 @@
|
|||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
|
||||||
|
#ifdef __VBCC__
|
||||||
|
#define __attribute__(x)
|
||||||
|
#define M_PI 3.141592653589793238462643
|
||||||
|
#endif
|
||||||
|
|
||||||
// Generic pixel-drawing function.
|
// Generic pixel-drawing function.
|
||||||
Func_pixel Pixel_figure;
|
Func_pixel Pixel_figure;
|
||||||
|
|
||||||
@ -109,8 +114,7 @@ void Update_part_of_screen(short x, short y, short width, short height)
|
|||||||
effective_h = Menu_Y - effective_Y;
|
effective_h = Menu_Y - effective_Y;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SDL_Rect r;
|
SDL_Rect r; r.x=effective_X;
|
||||||
r.x=effective_X;
|
|
||||||
r.y=effective_Y;
|
r.y=effective_Y;
|
||||||
r.h=effective_h;
|
r.h=effective_h;
|
||||||
r.w=effective_w;
|
r.w=effective_w;
|
||||||
|
|||||||
@ -24,7 +24,11 @@
|
|||||||
/// The actual data is in hotkeys.c
|
/// The actual data is in hotkeys.c
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdbool.h>
|
#ifndef __VBCC__
|
||||||
|
#include <stdbool.h>
|
||||||
|
#else
|
||||||
|
#define bool char
|
||||||
|
#endif
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
/*** Types definitions and structs ***/
|
/*** Types definitions and structs ***/
|
||||||
|
|||||||
9
init.c
9
init.c
@ -25,11 +25,14 @@
|
|||||||
#if defined(__WIN32__) || defined(__linux__)
|
#if defined(__WIN32__) || defined(__linux__)
|
||||||
#define GRAFX2_CATCHES_SIGNALS
|
#define GRAFX2_CATCHES_SIGNALS
|
||||||
#endif
|
#endif
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
//#include <fcntl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
#ifndef __VBCC__
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <SDL_byteorder.h>
|
#include <SDL_byteorder.h>
|
||||||
|
|||||||
41
loadsave.c
41
loadsave.c
@ -868,6 +868,7 @@ void Save_PAL(void)
|
|||||||
//////////////////////////////////// IMG ////////////////////////////////////
|
//////////////////////////////////// IMG ////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
byte Filler1[6];
|
byte Filler1[6];
|
||||||
@ -875,7 +876,8 @@ typedef struct
|
|||||||
word Height;
|
word Height;
|
||||||
byte Filler2[118];
|
byte Filler2[118];
|
||||||
T_Palette Palette;
|
T_Palette Palette;
|
||||||
} __attribute__((__packed__)) T_IMG_Header;
|
} T_IMG_Header;
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
// -- Tester si un fichier est au format IMG --------------------------------
|
// -- Tester si un fichier est au format IMG --------------------------------
|
||||||
void Test_IMG(void)
|
void Test_IMG(void)
|
||||||
@ -1037,6 +1039,7 @@ void Save_IMG(void)
|
|||||||
//////////////////////////////////// PKM ////////////////////////////////////
|
//////////////////////////////////// PKM ////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char Ident[3]; // Chaîne "PKM" }
|
char Ident[3]; // Chaîne "PKM" }
|
||||||
@ -1050,7 +1053,8 @@ typedef struct
|
|||||||
T_Palette Palette; // Palette RVB 256*3
|
T_Palette Palette; // Palette RVB 256*3
|
||||||
word Jump; // Taille du saut entre le header et l'image:
|
word Jump; // Taille du saut entre le header et l'image:
|
||||||
// On va s'en servir pour rajouter un commentaire
|
// On va s'en servir pour rajouter un commentaire
|
||||||
} __attribute__((__packed__)) T_PKM_Header;
|
} T_PKM_Header;
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
// -- Tester si un fichier est au format PKM --------------------------------
|
// -- Tester si un fichier est au format PKM --------------------------------
|
||||||
void Test_PKM(void)
|
void Test_PKM(void)
|
||||||
@ -1495,6 +1499,7 @@ void Save_PKM(void)
|
|||||||
//////////////////////////////////// LBM ////////////////////////////////////
|
//////////////////////////////////// LBM ////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
word Width;
|
word Width;
|
||||||
@ -1510,7 +1515,8 @@ typedef struct
|
|||||||
byte Y_aspect; // Inutile
|
byte Y_aspect; // Inutile
|
||||||
word X_screen;
|
word X_screen;
|
||||||
word Y_screen;
|
word Y_screen;
|
||||||
} __attribute__((__packed__)) T_LBM_Header;
|
} T_LBM_Header;
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
byte * LBM_buffer;
|
byte * LBM_buffer;
|
||||||
FILE *LBM_file;
|
FILE *LBM_file;
|
||||||
@ -2279,7 +2285,7 @@ void Save_LBM(void)
|
|||||||
//////////////////////////////////// BMP ////////////////////////////////////
|
//////////////////////////////////// BMP ////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
word Signature; // ='BM' = 0x4D42
|
word Signature; // ='BM' = 0x4D42
|
||||||
@ -2299,7 +2305,8 @@ typedef struct
|
|||||||
dword YPM;
|
dword YPM;
|
||||||
dword Nb_Clr;
|
dword Nb_Clr;
|
||||||
dword Clr_Imprt;
|
dword Clr_Imprt;
|
||||||
} __attribute__((__packed__)) T_BMP_Header;
|
} T_BMP_Header;
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
// -- Tester si un fichier est au format BMP --------------------------------
|
// -- Tester si un fichier est au format BMP --------------------------------
|
||||||
void Test_BMP(void)
|
void Test_BMP(void)
|
||||||
@ -2849,6 +2856,7 @@ void Save_BMP(void)
|
|||||||
//////////////////////////////////// GIF ////////////////////////////////////
|
//////////////////////////////////// GIF ////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
word Width; // width de l'écran virtuel
|
word Width; // width de l'écran virtuel
|
||||||
@ -2856,7 +2864,7 @@ typedef struct
|
|||||||
byte Resol; // Informations sur la résolution (et autres)
|
byte Resol; // Informations sur la résolution (et autres)
|
||||||
byte Backcol; // color de fond
|
byte Backcol; // color de fond
|
||||||
byte Aspect; // Informations sur l'aspect ratio (et autres)
|
byte Aspect; // Informations sur l'aspect ratio (et autres)
|
||||||
} __attribute__((__packed__)) T_GIF_LSDB; // Logical Screen Descriptor Block
|
} T_GIF_LSDB; // Logical Screen Descriptor Block
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -2866,7 +2874,8 @@ typedef struct
|
|||||||
word Image_height; // height de l'image
|
word Image_height; // height de l'image
|
||||||
byte Indicator; // Informations diverses sur l'image
|
byte Indicator; // Informations diverses sur l'image
|
||||||
byte Nb_bits_pixel; // Nb de bits par pixel
|
byte Nb_bits_pixel; // Nb de bits par pixel
|
||||||
} __attribute__((__packed__)) T_GIF_IDB; // Image Descriptor Block
|
} T_GIF_IDB; // Image Descriptor Block
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
// -- Tester si un fichier est au format GIF --------------------------------
|
// -- Tester si un fichier est au format GIF --------------------------------
|
||||||
|
|
||||||
@ -3685,6 +3694,7 @@ void Save_GIF(void)
|
|||||||
//////////////////////////////////// PCX ////////////////////////////////////
|
//////////////////////////////////// PCX ////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
byte Manufacturer; // |_ Il font chier ces cons! Ils auraient pu
|
byte Manufacturer; // |_ Il font chier ces cons! Ils auraient pu
|
||||||
@ -3705,7 +3715,8 @@ typedef struct
|
|||||||
word Screen_X; // |_ Dimensions de
|
word Screen_X; // |_ Dimensions de
|
||||||
word Screen_Y; // | l'écran d'origine
|
word Screen_Y; // | l'écran d'origine
|
||||||
byte Filler[54]; // Ca... J'adore!
|
byte Filler[54]; // Ca... J'adore!
|
||||||
} __attribute__((__packed__)) T_PCX_Header;
|
} T_PCX_Header;
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
T_PCX_Header PCX_header;
|
T_PCX_Header PCX_header;
|
||||||
|
|
||||||
@ -4224,11 +4235,12 @@ void Save_PCX(void)
|
|||||||
//////////////////////////////////// CEL ////////////////////////////////////
|
//////////////////////////////////// CEL ////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
word Width; // width de l'image
|
word Width; // width de l'image
|
||||||
word Height; // height de l'image
|
word Height; // height de l'image
|
||||||
} __attribute__((__packed__)) T_CEL_Header1;
|
} T_CEL_Header1;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -4241,7 +4253,8 @@ typedef struct
|
|||||||
word X_offset; // Offset en X de l'image
|
word X_offset; // Offset en X de l'image
|
||||||
word Y_offset; // Offset en Y de l'image
|
word Y_offset; // Offset en Y de l'image
|
||||||
byte Filler2[16]; // ???
|
byte Filler2[16]; // ???
|
||||||
} __attribute__((__packed__)) T_CEL_Header2;
|
} T_CEL_Header2;
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
// -- Tester si un fichier est au format CEL --------------------------------
|
// -- Tester si un fichier est au format CEL --------------------------------
|
||||||
|
|
||||||
@ -4541,6 +4554,7 @@ void Save_CEL(void)
|
|||||||
//////////////////////////////////// KCF ////////////////////////////////////
|
//////////////////////////////////// KCF ////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
@ -4551,7 +4565,8 @@ typedef struct
|
|||||||
byte Byte2;
|
byte Byte2;
|
||||||
} color[16];
|
} color[16];
|
||||||
} Palette[10];
|
} Palette[10];
|
||||||
} __attribute__((__packed__)) T_KCF_Header;
|
} T_KCF_Header;
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
// -- Tester si un fichier est au format KCF --------------------------------
|
// -- Tester si un fichier est au format KCF --------------------------------
|
||||||
|
|
||||||
@ -4800,6 +4815,7 @@ void Save_KCF(void)
|
|||||||
//////////////////////////////////// SCx ////////////////////////////////////
|
//////////////////////////////////// SCx ////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
byte Filler1[4];
|
byte Filler1[4];
|
||||||
@ -4807,7 +4823,8 @@ typedef struct
|
|||||||
word Height;
|
word Height;
|
||||||
byte Filler2;
|
byte Filler2;
|
||||||
byte Planes;
|
byte Planes;
|
||||||
} __attribute__((__packed__)) T_SCx_Header;
|
} T_SCx_Header;
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
// -- Tester si un fichier est au format SCx --------------------------------
|
// -- Tester si un fichier est au format SCx --------------------------------
|
||||||
void Test_SCx(void)
|
void Test_SCx(void)
|
||||||
|
|||||||
2
main.c
2
main.c
@ -25,7 +25,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
//#include <unistd.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_image.h>
|
#include <SDL_image.h>
|
||||||
|
|
||||||
|
|||||||
12
misc.c
12
misc.c
@ -717,15 +717,15 @@ void Zoom_a_line(byte* original_line, byte* zoomed_line,
|
|||||||
#define _WIN32_WINNT 0x0500
|
#define _WIN32_WINNT 0x0500
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#elif defined(__macosx__) || defined(__FreeBSD__)
|
#elif defined(__macosx__) || defined(__FreeBSD__)
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#elif defined(__BEOS__) || defined(__HAIKU__)
|
#elif defined(__BEOS__) || defined(__HAIKU__)
|
||||||
// sysinfo not implemented
|
// sysinfo not implemented
|
||||||
#elif defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__) || defined(__amigaos__)
|
#elif defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__) || defined(__amigaos__)
|
||||||
#include <proto/exec.h>
|
#include <proto/exec.h>
|
||||||
#elif defined(__SKYOS__)
|
#elif defined(__SKYOS__)
|
||||||
#include <skyos/sysinfo.h>
|
#include <skyos/sysinfo.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/sysinfo.h> // sysinfo() for free RAM
|
#include <sys/sysinfo.h> // sysinfo() for free RAM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Indique quelle est la mémoire disponible
|
// Indique quelle est la mémoire disponible
|
||||||
@ -846,4 +846,6 @@ int Convert_videomode_arg(const char *argument)
|
|||||||
return mode_index;
|
return mode_index;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,13 @@
|
|||||||
#ifndef MOUNTLIST_H_
|
#ifndef MOUNTLIST_H_
|
||||||
# define MOUNTLIST_H_
|
# define MOUNTLIST_H_
|
||||||
|
|
||||||
# include <stdbool.h>
|
#ifndef __VBCC__
|
||||||
# include <sys/types.h>
|
# include <stdbool.h>
|
||||||
|
#else
|
||||||
|
#define bool char
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
/* A mount table entry. */
|
/* A mount table entry. */
|
||||||
struct mount_entry
|
struct mount_entry
|
||||||
|
|||||||
@ -35,7 +35,8 @@
|
|||||||
#include "brush.h"
|
#include "brush.h"
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
|
|
||||||
#if defined(__GP2X__)
|
// PI is NOT part of math.h according to C standards...
|
||||||
|
#if defined(__GP2X__) || defined(__VBCC__)
|
||||||
#define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "struct.h"
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
///@file special.h
|
///@file special.h
|
||||||
/// Editor functions that can be hooked to a keyboard shortcut, but don't have
|
/// Editor functions that can be hooked to a keyboard shortcut, but don't have
|
||||||
|
|||||||
16
struct.h
16
struct.h
@ -70,12 +70,14 @@ typedef void (* Func_draw_brush) (byte *,word,word,word,word,word,word,byte,word
|
|||||||
typedef void (* Func_draw_list_item) (word,word,word,byte);
|
typedef void (* Func_draw_list_item) (word,word,word,byte);
|
||||||
|
|
||||||
/// A set of RGB values.
|
/// A set of RGB values.
|
||||||
|
#pragma pack(1)
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
byte R; ///< Red
|
byte R; ///< Red
|
||||||
byte G; ///< Green
|
byte G; ///< Green
|
||||||
byte B; ///< Blue
|
byte B; ///< Blue
|
||||||
}__attribute__ ((__packed__)) T_Components, T_Palette[256]; ///< A complete 256-entry RGB palette (768 bytes).
|
} T_Components, T_Palette[256]; ///< A complete 256-entry RGB palette (768 bytes).
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
/// A normal rectangular button in windows and menus.
|
/// A normal rectangular button in windows and menus.
|
||||||
typedef struct T_Normal_button
|
typedef struct T_Normal_button
|
||||||
@ -225,13 +227,15 @@ typedef struct
|
|||||||
byte Mode; ///< Shade mode: Normal, Loop, or No-saturation see ::SHADE_MODES
|
byte Mode; ///< Shade mode: Normal, Loop, or No-saturation see ::SHADE_MODES
|
||||||
} T_Shade;
|
} T_Shade;
|
||||||
|
|
||||||
|
#pragma pack(1) // is it useful ?
|
||||||
/// Data for one fullscreen video mode in configuration file. Warning, this one is saved/loaded as binary.
|
/// Data for one fullscreen video mode in configuration file. Warning, this one is saved/loaded as binary.
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
byte State; ///< How good is the mode supported. 0:Good (white) 1:OK (light) 2:So-so (dark) 4:User-disabled (black); +128 => System doesn't support it at all.
|
byte State; ///< How good is the mode supported. 0:Good (white) 1:OK (light) 2:So-so (dark) 4:User-disabled (black); +128 => System doesn't support it at all.
|
||||||
word Width; ///< Videomode width in pixels.
|
word Width; ///< Videomode width in pixels.
|
||||||
word Height;///< Videomode height in pixels.
|
word Height;///< Videomode height in pixels.
|
||||||
} __attribute__((__packed__)) T_Config_video_mode;
|
} T_Config_video_mode;
|
||||||
|
|
||||||
|
|
||||||
/// Header for gfx2.cfg. Warning, this one is saved/loaded as binary.
|
/// Header for gfx2.cfg. Warning, this one is saved/loaded as binary.
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -241,7 +245,9 @@ typedef struct
|
|||||||
byte Version2; ///< Minor version number (ex: 0)
|
byte Version2; ///< Minor version number (ex: 0)
|
||||||
byte Beta1; ///< Major beta version number (ex: 96)
|
byte Beta1; ///< Major beta version number (ex: 96)
|
||||||
byte Beta2; ///< Major beta version number (ex: 5)
|
byte Beta2; ///< Major beta version number (ex: 5)
|
||||||
} __attribute__((__packed__)) T_Config_header;
|
} T_Config_header;
|
||||||
|
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
/// Header for a config chunk in for gfx2.cfg. Warning, this one is saved/loaded as binary.
|
/// Header for a config chunk in for gfx2.cfg. Warning, this one is saved/loaded as binary.
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -250,13 +256,15 @@ typedef struct
|
|||||||
word Size; ///< Size of the configuration block that follows, in bytes.
|
word Size; ///< Size of the configuration block that follows, in bytes.
|
||||||
} T_Config_chunk;
|
} T_Config_chunk;
|
||||||
|
|
||||||
|
#pragma pack(1)
|
||||||
/// Configuration for one keyboard shortcut in gfx2.cfg. Warning, this one is saved/loaded as binary.
|
/// Configuration for one keyboard shortcut in gfx2.cfg. Warning, this one is saved/loaded as binary.
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
word Number; ///< Indicates the shortcut action. This is a number starting from 0, which matches ::T_Key_config.Number
|
word Number; ///< Indicates the shortcut action. This is a number starting from 0, which matches ::T_Key_config.Number
|
||||||
word Key; ///< Keyboard shortcut: SDLK_something, or -1 for none
|
word Key; ///< Keyboard shortcut: SDLK_something, or -1 for none
|
||||||
word Key2; ///< Alternate keyboard shortcut: SDLK_something, or -1 for none
|
word Key2; ///< Alternate keyboard shortcut: SDLK_something, or -1 for none
|
||||||
} __attribute__((__packed__)) T_Config_shortcut_info;
|
} T_Config_shortcut_info;
|
||||||
|
#pragma pack()
|
||||||
|
|
||||||
/// This structure holds all the settings saved and loaded as gfx2.ini.
|
/// This structure holds all the settings saved and loaded as gfx2.ini.
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user