Update Amiga OS build
This commit is contained in:
parent
7e5daa65a8
commit
10f11e3359
@ -2044,7 +2044,7 @@ int L_Run(lua_State* L)
|
|||||||
saved_directory = Get_current_directory(NULL, NULL, 0);
|
saved_directory = Get_current_directory(NULL, NULL, 0);
|
||||||
|
|
||||||
full_path = strdup(script_arg);
|
full_path = strdup(script_arg);
|
||||||
#if defined (__AROS__)
|
#if defined (__AROS__) || defined(__amigaos__)
|
||||||
// Convert path written on Linux/Windows norms to AROS norms :
|
// Convert path written on Linux/Windows norms to AROS norms :
|
||||||
// Each element like ../ and ..\ is replaced by /
|
// Each element like ../ and ..\ is replaced by /
|
||||||
// Each path separator \ is replaced by /
|
// Each path separator \ is replaced by /
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef GFX2MEM_H_DEFINED
|
#ifndef GFX2MEM_H_DEFINED
|
||||||
#define GFX2MEM_H_DEFINED
|
#define GFX2MEM_H_DEFINED
|
||||||
|
#include <sys/types.h>
|
||||||
/// malloc() memory and log in case of error
|
/// malloc() memory and log in case of error
|
||||||
void * GFX2_malloc_and_log(size_t size, const char * file, unsigned line);
|
void * GFX2_malloc_and_log(size_t size, const char * file, unsigned line);
|
||||||
|
|
||||||
|
|||||||
@ -899,7 +899,7 @@ void Button_Stats(int btn)
|
|||||||
// Display free space
|
// Display free space
|
||||||
if (mem_size != 0)
|
if (mem_size != 0)
|
||||||
{
|
{
|
||||||
#if defined(__AROS__)
|
#if defined(__AROS__) || defined(__amigaos__)
|
||||||
char *colon = strchr(Main.selector.Directory, ':');
|
char *colon = strchr(Main.selector.Directory, ':');
|
||||||
int len = strlen(Main.selector.Directory);
|
int len = strlen(Main.selector.Directory);
|
||||||
if (colon)
|
if (colon)
|
||||||
|
|||||||
@ -650,7 +650,7 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
|
|||||||
true,
|
true,
|
||||||
KEY_b, // B
|
KEY_b, // B
|
||||||
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
||||||
KEY_C|GFX2_MOD_META // Right-Amiga + C
|
KEY_c|GFX2_MOD_META // Right-Amiga + C
|
||||||
#else
|
#else
|
||||||
0
|
0
|
||||||
#endif
|
#endif
|
||||||
@ -887,7 +887,7 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
|
|||||||
true,
|
true,
|
||||||
KEY_F2, // F2
|
KEY_F2, // F2
|
||||||
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
||||||
KEY_A|GFX2_MOD_META // Right-Amiga + A
|
KEY_a|GFX2_MOD_META // Right-Amiga + A
|
||||||
#else
|
#else
|
||||||
0
|
0
|
||||||
#endif
|
#endif
|
||||||
@ -900,7 +900,7 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
|
|||||||
true,
|
true,
|
||||||
KEY_F2|GFX2_MOD_SHIFT, // Shift + F2
|
KEY_F2|GFX2_MOD_SHIFT, // Shift + F2
|
||||||
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
||||||
KEY_S|GFX2_MOD_META // Right-Amiga + S
|
KEY_s|GFX2_MOD_META // Right-Amiga + S
|
||||||
#else
|
#else
|
||||||
0
|
0
|
||||||
#endif
|
#endif
|
||||||
@ -913,7 +913,7 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
|
|||||||
true,
|
true,
|
||||||
KEY_F3, // F3
|
KEY_F3, // F3
|
||||||
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
||||||
KEY_O|GFX2_MOD_META // Right-Amiga + O
|
KEY_o|GFX2_MOD_META // Right-Amiga + O
|
||||||
#else
|
#else
|
||||||
0
|
0
|
||||||
#endif
|
#endif
|
||||||
@ -963,7 +963,7 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
|
|||||||
#elif defined (__WIZ__)
|
#elif defined (__WIZ__)
|
||||||
(KEY_JOYBUTTON+JOY_BUTTON_L)
|
(KEY_JOYBUTTON+JOY_BUTTON_L)
|
||||||
#elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
#elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
||||||
KEY_Z|GFX2_MOD_META // Right-Amiga + Z
|
KEY_z|GFX2_MOD_META // Right-Amiga + Z
|
||||||
#else
|
#else
|
||||||
0
|
0
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
14
src/io.c
14
src/io.c
@ -270,7 +270,7 @@ char * Find_last_separator(const char * str)
|
|||||||
if (*str == PATH_SEPARATOR[0]
|
if (*str == PATH_SEPARATOR[0]
|
||||||
#if defined(__WIN32__) || defined(WIN32)
|
#if defined(__WIN32__) || defined(WIN32)
|
||||||
|| *str == '/'
|
|| *str == '/'
|
||||||
#elif __AROS__
|
#elif defined(__AROS__) || defined(__amigaos__)
|
||||||
|| *str == ':'
|
|| *str == ':'
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -285,7 +285,7 @@ word * Find_last_separator_unicode(const word * str)
|
|||||||
if (*str == (byte)PATH_SEPARATOR[0]
|
if (*str == (byte)PATH_SEPARATOR[0]
|
||||||
#if defined(__WIN32__) || defined(WIN32)
|
#if defined(__WIN32__) || defined(WIN32)
|
||||||
|| *str == '/'
|
|| *str == '/'
|
||||||
#elif __AROS__
|
#elif defined(__AROS__) || defined(__amigaos__)
|
||||||
|| *str == ':'
|
|| *str == ':'
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -302,7 +302,7 @@ char * Filepath_append_to_dir(const char * dir, const char * filename)
|
|||||||
if (dir[len-1] == PATH_SEPARATOR[0]
|
if (dir[len-1] == PATH_SEPARATOR[0]
|
||||||
#if defined(__WIN32__) || defined(WIN32)
|
#if defined(__WIN32__) || defined(WIN32)
|
||||||
|| dir[len-1] == '/'
|
|| dir[len-1] == '/'
|
||||||
#elif __AROS__
|
#elif defined(__AROS__) || defined(__amigaos__)
|
||||||
|| dir[len-1] == ':'
|
|| dir[len-1] == ':'
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -400,7 +400,7 @@ void Append_path(char *path, const char *filename, char *reverse_path)
|
|||||||
{
|
{
|
||||||
if (reverse_path)
|
if (reverse_path)
|
||||||
strcpy(reverse_path, separator_pos+1);
|
strcpy(reverse_path, separator_pos+1);
|
||||||
#if defined(__AROS__)
|
#if defined(__AROS__) || defined(__amigaos__)
|
||||||
// Don't strip away the colon
|
// Don't strip away the colon
|
||||||
if (*separator_pos == ':') *(separator_pos+1)='\0';
|
if (*separator_pos == ':') *(separator_pos+1)='\0';
|
||||||
else *separator_pos='\0';
|
else *separator_pos='\0';
|
||||||
@ -431,7 +431,7 @@ void Append_path(char *path, const char *filename, char *reverse_path)
|
|||||||
if (len && (strcmp(path+len-1,PATH_SEPARATOR)
|
if (len && (strcmp(path+len-1,PATH_SEPARATOR)
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
&& path[len-1]!='/'
|
&& path[len-1]!='/'
|
||||||
#elif __AROS__
|
#elif defined(__AROS__) || defined(__amigaos__)
|
||||||
&& path[len-1]!=':' // To avoid paths like volume:/dir
|
&& path[len-1]!=':' // To avoid paths like volume:/dir
|
||||||
#endif
|
#endif
|
||||||
))
|
))
|
||||||
@ -1072,6 +1072,10 @@ char * Get_current_directory(char * buf, word * * unicode, size_t size)
|
|||||||
}
|
}
|
||||||
free(cur_dir);
|
free(cur_dir);
|
||||||
return buf;
|
return buf;
|
||||||
|
#elif defined (__amigaos__)
|
||||||
|
char * ret = "";
|
||||||
|
if (unicode != NULL)
|
||||||
|
*unicode = NULL; // no unicode support
|
||||||
#else
|
#else
|
||||||
char * ret = getcwd(buf, size);
|
char * ret = getcwd(buf, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
|
|||||||
@ -89,9 +89,7 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__macosx__)
|
#if defined(__macosx__) || defined(__SWITCH__) || defined(__amigaos__)
|
||||||
#include <machine/endian.h>
|
|
||||||
#elif defined(__SWITCH__)
|
|
||||||
#include <machine/endian.h>
|
#include <machine/endian.h>
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
@ -1307,6 +1305,7 @@ void Program_shutdown(void)
|
|||||||
if (return_code)
|
if (return_code)
|
||||||
Error(return_code);
|
Error(return_code);
|
||||||
return_code=Save_INI(&Config);
|
return_code=Save_INI(&Config);
|
||||||
|
|
||||||
if (return_code)
|
if (return_code)
|
||||||
Error(return_code);
|
Error(return_code);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <setjmp.h>
|
||||||
#include <png.h>
|
#include <png.h>
|
||||||
#if !defined(PNG_HAVE_PLTE)
|
#if !defined(PNG_HAVE_PLTE)
|
||||||
#define PNG_HAVE_PLTE 0x02
|
#define PNG_HAVE_PLTE 0x02
|
||||||
|
|||||||
@ -181,7 +181,7 @@ static int Valid_character(word c, enum INPUT_TYPE input_type)
|
|||||||
// AmigaOS4: Pas de ':' car utilisé pour les volumes.
|
// AmigaOS4: Pas de ':' car utilisé pour les volumes.
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
char forbidden_char[] = {'/', '|', '?', '*', '<', '>', ':', '\\'};
|
char forbidden_char[] = {'/', '|', '?', '*', '<', '>', ':', '\\'};
|
||||||
#elif defined (__amigaos4__) || defined(__AROS__)
|
#elif defined (__amigaos4__) || defined(__AROS__) || defined(__amigaos__)
|
||||||
char forbidden_char[] = {'/', '|', '?', '*', '<', '>', ':'};
|
char forbidden_char[] = {'/', '|', '?', '*', '<', '>', ':'};
|
||||||
#else
|
#else
|
||||||
char forbidden_char[] = {'/', '|', '?', '*', '<', '>'};
|
char forbidden_char[] = {'/', '|', '?', '*', '<', '>'};
|
||||||
|
|||||||
@ -725,6 +725,7 @@ void Define_icon(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined (__amigaos__)
|
||||||
// General version: Load icon from file
|
// General version: Load icon from file
|
||||||
{
|
{
|
||||||
#if defined(USE_SDL)
|
#if defined(USE_SDL)
|
||||||
@ -735,9 +736,11 @@ void Define_icon(void)
|
|||||||
// gfx2.gif : 32x32
|
// gfx2.gif : 32x32
|
||||||
// gfx2.png : 48x48
|
// gfx2.png : 48x48
|
||||||
icon_path = Filepath_append_to_dir(Data_directory, "gfx2.png");
|
icon_path = Filepath_append_to_dir(Data_directory, "gfx2.png");
|
||||||
icon = IMG_Load(icon_path);
|
icon = IMG_Load(icon_path);
|
||||||
if (icon == NULL)
|
if (icon == NULL)
|
||||||
|
{
|
||||||
GFX2_Log(GFX2_WARNING, "Failed to load icon %s\n", icon_path);
|
GFX2_Log(GFX2_WARNING, "Failed to load icon %s\n", icon_path);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Uint32 pink;
|
Uint32 pink;
|
||||||
@ -780,6 +783,7 @@ void Define_icon(void)
|
|||||||
}
|
}
|
||||||
free(icon_path);
|
free(icon_path);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Set_mouse_position(void)
|
void Set_mouse_position(void)
|
||||||
|
|||||||
@ -165,7 +165,7 @@ char * Get_data_directory(const char * program_dir)
|
|||||||
#if defined(__macosx__)
|
#if defined(__macosx__)
|
||||||
// On MacOSX, it is stored in a special folder:
|
// On MacOSX, it is stored in a special folder:
|
||||||
to_append = "Contents/Resources/";
|
to_append = "Contents/Resources/";
|
||||||
#elif defined (__GP2X__) || defined (__gp2x__) || defined (__WIZ__) || defined (__CAANOO__) || defined(GCWZERO) || defined(__AROS__) || defined(__ANDROID__)
|
#elif defined (__GP2X__) || defined (__gp2x__) || defined (__WIZ__) || defined (__CAANOO__) || defined(GCWZERO) || defined(__AROS__) || defined(__ANDROID__) || defined(__amigaos__)
|
||||||
// On GP2X, AROS and Android, executable is not in bin/
|
// On GP2X, AROS and Android, executable is not in bin/
|
||||||
to_append = "data/";
|
to_append = "data/";
|
||||||
#elif defined (__MINT__)
|
#elif defined (__MINT__)
|
||||||
@ -212,7 +212,7 @@ char * Get_data_directory(const char * program_dir)
|
|||||||
char * Get_config_directory(const char * program_dir)
|
char * Get_config_directory(const char * program_dir)
|
||||||
{
|
{
|
||||||
// AmigaOS4 provides the PROGDIR: alias to the directory where the executable is.
|
// AmigaOS4 provides the PROGDIR: alias to the directory where the executable is.
|
||||||
#if defined(__amigaos4__) || defined(__AROS__)
|
#if defined(__amigaos4__) || defined(__AROS__) || defined(__amigaos__)
|
||||||
return strdup("PROGDIR:");
|
return strdup("PROGDIR:");
|
||||||
// GP2X
|
// GP2X
|
||||||
#elif defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
|
#elif defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user