MorphOS port, and some tweaks to the config tool to make it look a little bit less ugly. We should probably use a better color palette for it anyways.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@456 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
159d623f44
commit
5971f4c9e3
17
Makefile
17
Makefile
@ -49,7 +49,7 @@ else
|
|||||||
|
|
||||||
PLATFORM = $(shell uname)
|
PLATFORM = $(shell uname)
|
||||||
|
|
||||||
#OS4 specific
|
#AmigaOS4 specific
|
||||||
ifeq ($(PLATFORM),AmigaOS)
|
ifeq ($(PLATFORM),AmigaOS)
|
||||||
DELCOMMAND = rm -rf
|
DELCOMMAND = rm -rf
|
||||||
MKDIR = mkdir -p
|
MKDIR = mkdir -p
|
||||||
@ -78,6 +78,20 @@ else
|
|||||||
OBJDIR = obj/aros
|
OBJDIR = obj/aros
|
||||||
else
|
else
|
||||||
|
|
||||||
|
#MorphOS specific
|
||||||
|
ifeq ($(PLATFORM),MorphOS)
|
||||||
|
DELCOMMAND = rm -rf
|
||||||
|
MKDIR = mkdir -p
|
||||||
|
RMDIR = rmdir
|
||||||
|
CP = cp
|
||||||
|
BIN = grafx2
|
||||||
|
CFGBIN = gfxcfg
|
||||||
|
COPT = -Wall -gstabs -c `sdl-config --cflags` $(TTFCOPT)
|
||||||
|
LOPT = -lSDL_image `sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT)
|
||||||
|
CC = gcc
|
||||||
|
OBJDIR = obj/morphos
|
||||||
|
else
|
||||||
|
|
||||||
#BeOS specific
|
#BeOS specific
|
||||||
ifeq ($(PLATFORM),BeOS)
|
ifeq ($(PLATFORM),BeOS)
|
||||||
DELCOMMAND = rm -rf
|
DELCOMMAND = rm -rf
|
||||||
@ -148,6 +162,7 @@ endif
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
#TrueType is optional: make NOTTF=1 to disable support and dependencies.
|
#TrueType is optional: make NOTTF=1 to disable support and dependencies.
|
||||||
ifeq ($(NOTTF),1)
|
ifeq ($(NOTTF),1)
|
||||||
|
|||||||
5
divers.c
5
divers.c
@ -79,7 +79,6 @@ void Set_palette(T_Palette Palette)
|
|||||||
PaletteSDL[i].g=Palette[i].V;
|
PaletteSDL[i].g=Palette[i].V;
|
||||||
PaletteSDL[i].b=Palette[i].B;
|
PaletteSDL[i].b=Palette[i].B;
|
||||||
}
|
}
|
||||||
//SDL_PHYSPAL|
|
|
||||||
SDL_SetPalette(Ecran_SDL, SDL_PHYSPAL | SDL_LOGPAL, PaletteSDL,0,256);
|
SDL_SetPalette(Ecran_SDL, SDL_PHYSPAL | SDL_LOGPAL, PaletteSDL,0,256);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -926,7 +925,7 @@ void Zoomer_une_ligne(byte* Ligne_originale, byte* Ligne_zoomee,
|
|||||||
#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__)
|
#elif defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__)
|
||||||
#include <proto/exec.h>
|
#include <proto/exec.h>
|
||||||
#elif defined(__SKYOS__)
|
#elif defined(__SKYOS__)
|
||||||
#include <skyos/sysinfo.h>
|
#include <skyos/sysinfo.h>
|
||||||
@ -967,7 +966,7 @@ unsigned long Memoire_libre(void)
|
|||||||
// No <sys/sysctl.h> on BeOS or Haiku
|
// No <sys/sysctl.h> on BeOS or Haiku
|
||||||
// AvailMem is misleading on os4 (os4 caches stuff in memory that you can still allocate)
|
// AvailMem is misleading on os4 (os4 caches stuff in memory that you can still allocate)
|
||||||
return 10*1024*1024;
|
return 10*1024*1024;
|
||||||
#elif defined(__AROS__)
|
#elif defined(__AROS__) || defined(__MORPHOS__)
|
||||||
return AvailMem(MEMF_ANY);
|
return AvailMem(MEMF_ANY);
|
||||||
#else
|
#else
|
||||||
struct sysinfo info;
|
struct sysinfo info;
|
||||||
|
|||||||
24
gfxcfg.c
24
gfxcfg.c
@ -118,12 +118,12 @@ void Dessiner_ecran_principal()
|
|||||||
{
|
{
|
||||||
Cadre(3,3,630,40,2);
|
Cadre(3,3,630,40,2);
|
||||||
SFont_Write(Ecran, MyFont, 8,6,"Setup program for Grafx2 (c) 1996-98 Sunset Design and 2008 PulkoMandy");
|
SFont_Write(Ecran, MyFont, 8,6,"Setup program for Grafx2 (c) 1996-98 Sunset Design and 2008 PulkoMandy");
|
||||||
SFont_Write(Ecran, MyFont, 8,18,"Use Up/Down arrows & Page-Up/Page-Down to scroll, Enter to modify, Delete to remove a hot-key, and Escape to validate or cancel.");
|
SFont_Write(Ecran, MyFont, 8,18,"Use Up/Down arrows & Page-Up/Page-Down to scroll, Enter to modify,");
|
||||||
SFont_Write(Ecran, MyFont, 8,30,"DO NOT USE Print-screen, Pause, and other special keys!");
|
SFont_Write(Ecran, MyFont, 8,30,"Delete to remove a hot-key and Escape to validate or cancel.");
|
||||||
|
|
||||||
// Cadre(3,46,630,400,COULEUR_SETUP);
|
Cadre(3,47,630,10,86);
|
||||||
SFont_Write(Ecran,MyFont,8,48,"Option");
|
SFont_Write(Ecran,MyFont,8 ,48,"Option");
|
||||||
SFont_Write(Ecran,MyFont,8*38,48,"Hot-Key");
|
SFont_Write(Ecran,MyFont,8*40,48,"Hot-Key");
|
||||||
SFont_Write(Ecran,MyFont,8*75,48,"Err");
|
SFont_Write(Ecran,MyFont,8*75,48,"Err");
|
||||||
|
|
||||||
SDL_UpdateRect(Ecran,0,0,640,480);
|
SDL_UpdateRect(Ecran,0,0,640,480);
|
||||||
@ -137,7 +137,7 @@ void Ecrire(uint8_t Ligne, uint16_t Num_option, uint8_t Couleur)
|
|||||||
SFont_Write(Ecran,MyFont,40*8,Ligne*9,Nom_touche(ConfigTouche[Num_option].Touche));
|
SFont_Write(Ecran,MyFont,40*8,Ligne*9,Nom_touche(ConfigTouche[Num_option].Touche));
|
||||||
if(Erreur[Num_option])
|
if(Erreur[Num_option])
|
||||||
SFont_Write(Ecran,MyFont,77*8,Ligne*9,"X");
|
SFont_Write(Ecran,MyFont,77*8,Ligne*9,"X");
|
||||||
Cadre(36*8,Ligne*9,1,9,255);
|
Cadre(39*8,Ligne*9,1,9,255);
|
||||||
Cadre(74*8,Ligne*9,1,9,255);
|
Cadre(74*8,Ligne*9,1,9,255);
|
||||||
SDL_UpdateRect(Ecran,3,Ligne*9,630,9);
|
SDL_UpdateRect(Ecran,3,Ligne*9,630,9);
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ void Tout_ecrire()
|
|||||||
{
|
{
|
||||||
uint8_t i = HAUTEUR_DEBUT_SETUP;
|
uint8_t i = HAUTEUR_DEBUT_SETUP;
|
||||||
|
|
||||||
Cadre(3,46,630,400,COULEUR_SETUP);
|
Cadre(3,64,630,340,COULEUR_SETUP);
|
||||||
while(i<=HAUTEUR_FIN_SETUP && i < NB_MAX_TOUCHES + HAUTEUR_DEBUT_SETUP)
|
while(i<=HAUTEUR_FIN_SETUP && i < NB_MAX_TOUCHES + HAUTEUR_DEBUT_SETUP)
|
||||||
{
|
{
|
||||||
Ecrire(i,Decalage_curseur+i-HAUTEUR_DEBUT_SETUP,
|
Ecrire(i,Decalage_curseur+i-HAUTEUR_DEBUT_SETUP,
|
||||||
@ -164,8 +164,8 @@ void Tout_ecrire()
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cadre(36*8,46,1,400,255);
|
Cadre(39*8,46,1,360,255);
|
||||||
Cadre(74*8,46,1,400,255);
|
Cadre(74*8,46,1,360,255);
|
||||||
|
|
||||||
SDL_UpdateRect(Ecran,0,0,640,480);
|
SDL_UpdateRect(Ecran,0,0,640,480);
|
||||||
|
|
||||||
@ -304,12 +304,12 @@ uint8_t Fenetre_choix(int Largeur, int Hauteur, const char* Titre, const char* C
|
|||||||
uint8_t Option_choisie;
|
uint8_t Option_choisie;
|
||||||
word Touche;
|
word Touche;
|
||||||
|
|
||||||
Hauteur *= 9;
|
Hauteur *= 8;
|
||||||
Largeur *= 9;
|
Largeur *= 8;
|
||||||
x1=(640 - Largeur)/2;
|
x1=(640 - Largeur)/2;
|
||||||
y1=(480 - Hauteur)/2;
|
y1=(480 - Hauteur)/2;
|
||||||
|
|
||||||
Cadre(x1+5,y1+5,Largeur,Hauteur,1);
|
Cadre(x1+5,y1+5,Largeur,Hauteur,0);
|
||||||
Cadre(x1,y1,Largeur,Hauteur,Couleur);
|
Cadre(x1,y1,Largeur,Hauteur,Couleur);
|
||||||
|
|
||||||
Num_choix = 0;
|
Num_choix = 0;
|
||||||
|
|||||||
2
init.c
2
init.c
@ -155,7 +155,7 @@ void Charger_DAT(void)
|
|||||||
|
|
||||||
if(stat(Nom_du_fichier,&Informations_Fichier))
|
if(stat(Nom_du_fichier,&Informations_Fichier))
|
||||||
{
|
{
|
||||||
switch errno
|
switch(errno)
|
||||||
{
|
{
|
||||||
case EACCES: puts("La permission de parcours est refusée pour un des répertoires contenu dans le chemin path."); break;
|
case EACCES: puts("La permission de parcours est refusée pour un des répertoires contenu dans le chemin path."); break;
|
||||||
case EBADF: puts("filedes est un mauvais descripteur."); break;
|
case EBADF: puts("filedes est un mauvais descripteur."); break;
|
||||||
|
|||||||
@ -491,6 +491,7 @@ void Charger_image(byte Image)
|
|||||||
Image_24b=0;
|
Image_24b=0;
|
||||||
Format_Load[Format]();
|
Format_Load[Format]();
|
||||||
|
|
||||||
|
// FIXME Le déclenchement de cette erreur 0 après lecture ratée d'une image produit un flash rouge, puis restaure la palette de l'image. Il faudrait plutot restaurer la palette qu'il y avait avant d'avoir tout cassé, non ?
|
||||||
if (Erreur_fichier>0)
|
if (Erreur_fichier>0)
|
||||||
Erreur(0);
|
Erreur(0);
|
||||||
|
|
||||||
|
|||||||
2
main.c
2
main.c
@ -58,7 +58,7 @@
|
|||||||
#elif defined(__macosx__)
|
#elif defined(__macosx__)
|
||||||
#import <corefoundation/corefoundation.h>
|
#import <corefoundation/corefoundation.h>
|
||||||
#import <sys/param.h>
|
#import <sys/param.h>
|
||||||
#elif defined(__AROS__) || defined(__BEOS__)
|
#elif defined(__AROS__) || defined(__BEOS__) || defined(__MORPHOS__)
|
||||||
#include "realpath.h"
|
#include "realpath.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ char *realpath(const char *_path, char *resolved_path)
|
|||||||
|
|
||||||
if (chdir(path)) {
|
if (chdir(path)) {
|
||||||
if (errno == ENOTDIR) {
|
if (errno == ENOTDIR) {
|
||||||
#if defined(__WIN32__)
|
#if defined(__WIN32__) || defined(__MORPHOS__)
|
||||||
// No symbolic links and no readlink()
|
// No symbolic links and no readlink()
|
||||||
l = -1;
|
l = -1;
|
||||||
#else
|
#else
|
||||||
|
|||||||
4
setup.c
4
setup.c
@ -49,7 +49,7 @@ int Create_ConfigDirectory(char * Config_Dir)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__macosx__) || defined(__amigaos4__) || defined(__AROS__)
|
#if defined(__macosx__) || defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__)
|
||||||
#define ARG_UNUSED __attribute__((unused))
|
#define ARG_UNUSED __attribute__((unused))
|
||||||
#else
|
#else
|
||||||
#define ARG_UNUSED
|
#define ARG_UNUSED
|
||||||
@ -70,7 +70,7 @@ void Set_Program_Directory(ARG_UNUSED const char * argv0,char * Program_Dir)
|
|||||||
strcat(Program_Dir ,"/");
|
strcat(Program_Dir ,"/");
|
||||||
|
|
||||||
// AmigaOS4: hard-coded volume name.
|
// AmigaOS4: hard-coded volume name.
|
||||||
#elif defined(__amigaos4__) || defined(__AROS__)
|
#elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__)
|
||||||
strcpy(Program_Dir,"PROGDIR:");
|
strcpy(Program_Dir,"PROGDIR:");
|
||||||
|
|
||||||
// Others: The part of argv[0] before the executable name.
|
// Others: The part of argv[0] before the executable name.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user