diff --git a/Makefile b/Makefile index 2a4f1ba6..ee2d7a7d 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ else PLATFORM = $(shell uname) - #OS4 specific + #AmigaOS4 specific ifeq ($(PLATFORM),AmigaOS) DELCOMMAND = rm -rf MKDIR = mkdir -p @@ -78,6 +78,20 @@ else OBJDIR = obj/aros 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 ifeq ($(PLATFORM),BeOS) DELCOMMAND = rm -rf @@ -148,6 +162,7 @@ endif endif endif endif +endif #TrueType is optional: make NOTTF=1 to disable support and dependencies. ifeq ($(NOTTF),1) diff --git a/divers.c b/divers.c index ab057ec1..3661850c 100644 --- a/divers.c +++ b/divers.c @@ -79,7 +79,6 @@ void Set_palette(T_Palette Palette) PaletteSDL[i].g=Palette[i].V; PaletteSDL[i].b=Palette[i].B; } - //SDL_PHYSPAL| 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 #elif defined(__BEOS__) || defined(__HAIKU__) // sysinfo not implemented -#elif defined(__AROS__) || defined(__amigaos4__) +#elif defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__) #include #elif defined(__SKYOS__) #include @@ -967,7 +966,7 @@ unsigned long Memoire_libre(void) // No on BeOS or Haiku // AvailMem is misleading on os4 (os4 caches stuff in memory that you can still allocate) return 10*1024*1024; - #elif defined(__AROS__) + #elif defined(__AROS__) || defined(__MORPHOS__) return AvailMem(MEMF_ANY); #else struct sysinfo info; diff --git a/gfx2.cfg b/gfx2.cfg index 8beb953c..3eb19431 100644 Binary files a/gfx2.cfg and b/gfx2.cfg differ diff --git a/gfxcfg.c b/gfxcfg.c index b2606746..ca62ecd0 100644 --- a/gfxcfg.c +++ b/gfxcfg.c @@ -118,12 +118,12 @@ void Dessiner_ecran_principal() { 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,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,30,"DO NOT USE Print-screen, Pause, and other special keys!"); + 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,"Delete to remove a hot-key and Escape to validate or cancel."); -// Cadre(3,46,630,400,COULEUR_SETUP); - SFont_Write(Ecran,MyFont,8,48,"Option"); - SFont_Write(Ecran,MyFont,8*38,48,"Hot-Key"); + Cadre(3,47,630,10,86); + SFont_Write(Ecran,MyFont,8 ,48,"Option"); + SFont_Write(Ecran,MyFont,8*40,48,"Hot-Key"); SFont_Write(Ecran,MyFont,8*75,48,"Err"); 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)); if(Erreur[Num_option]) 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); SDL_UpdateRect(Ecran,3,Ligne*9,630,9); } @@ -156,7 +156,7 @@ void Tout_ecrire() { 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) { Ecrire(i,Decalage_curseur+i-HAUTEUR_DEBUT_SETUP, @@ -164,8 +164,8 @@ void Tout_ecrire() i++; } - Cadre(36*8,46,1,400,255); - Cadre(74*8,46,1,400,255); + Cadre(39*8,46,1,360,255); + Cadre(74*8,46,1,360,255); 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; word Touche; - Hauteur *= 9; - Largeur *= 9; + Hauteur *= 8; + Largeur *= 8; x1=(640 - Largeur)/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); Num_choix = 0; diff --git a/init.c b/init.c index 2fbf5ff2..f7527111 100644 --- a/init.c +++ b/init.c @@ -155,7 +155,7 @@ void Charger_DAT(void) 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 EBADF: puts("filedes est un mauvais descripteur."); break; diff --git a/loadsave.c b/loadsave.c index a26f61c3..a849c9a8 100644 --- a/loadsave.c +++ b/loadsave.c @@ -491,6 +491,7 @@ void Charger_image(byte Image) Image_24b=0; 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) Erreur(0); diff --git a/main.c b/main.c index 6b30a1e0..911af9aa 100644 --- a/main.c +++ b/main.c @@ -58,7 +58,7 @@ #elif defined(__macosx__) #import #import -#elif defined(__AROS__) || defined(__BEOS__) +#elif defined(__AROS__) || defined(__BEOS__) || defined(__MORPHOS__) #include "realpath.h" #endif diff --git a/realpath.c b/realpath.c index d9498835..00d2cade 100644 --- a/realpath.c +++ b/realpath.c @@ -43,7 +43,7 @@ char *realpath(const char *_path, char *resolved_path) if (chdir(path)) { if (errno == ENOTDIR) { - #if defined(__WIN32__) + #if defined(__WIN32__) || defined(__MORPHOS__) // No symbolic links and no readlink() l = -1; #else diff --git a/setup.c b/setup.c index 3d16b3f3..fe9b8812 100644 --- a/setup.c +++ b/setup.c @@ -49,7 +49,7 @@ int Create_ConfigDirectory(char * Config_Dir) #endif } -#if defined(__macosx__) || defined(__amigaos4__) || defined(__AROS__) +#if defined(__macosx__) || defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) #define ARG_UNUSED __attribute__((unused)) #else #define ARG_UNUSED @@ -70,7 +70,7 @@ void Set_Program_Directory(ARG_UNUSED const char * argv0,char * Program_Dir) strcat(Program_Dir ,"/"); // AmigaOS4: hard-coded volume name. - #elif defined(__amigaos4__) || defined(__AROS__) + #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) strcpy(Program_Dir,"PROGDIR:"); // Others: The part of argv[0] before the executable name.