X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=mercenary-reloaded.git;a=blobdiff_plain;f=src%2Fmercenary%2Fmain.c;h=45d87e4bca4637f5df95041260555dcbe51d4981;hp=cda13e1798734c385570beda33d03804511cc530;hb=3c70467233fef462f9bc9a132019800386978cc8;hpb=90c6e8a475982df68445bb7b0dcafb5d89669abb diff --git a/src/mercenary/main.c b/src/mercenary/main.c index cda13e1..45d87e4 100644 --- a/src/mercenary/main.c +++ b/src/mercenary/main.c @@ -20,10 +20,17 @@ #include #include #include +#include +#include #include #include +#include "../../include/keycodes.h" #include "../libsdl/sdl.h" -#include "../libsdl/opengl.h" +#ifdef HAVE_OVR +#include "../libovr/ovr.h" +#include "../libovr/keyboard.h" +#endif +#include "../libopengl/opengl.h" #include "../libsdl/print.h" #include "../libcpu/m68k.h" #include "../libcpu/execute.h" @@ -33,6 +40,7 @@ #include "../libjoystick/joystick.h" #include "../libkeyboard/keyboard.h" #include "../libdisk/disk.h" +#include "../libtext/text.h" #include "mercenary.h" #include "render.h" @@ -41,22 +49,42 @@ #define FOV_JOLLY 80.0 #define FOV_MAX 170.0 +#define STICK_WALK_THRESHOLD 0.3 /* move the stick until the player moves */ +#define STICK_ROTATE_THRESHOLD 0.3 /* move the stick until the player rotates */ +#define STICK_THRUST_THRESHOLD 0.1 /* move the stick until the craft moves */ + static int config_ctrl_c = 0; -static int config_amiga_speed = 1; -#warning fixme: make use of 10 for intro, then be as fast as given -static double config_fps = 16.0; +static int config_amiga_speed = 0; /* fast speed */ +static double config_fps = 10.0; +#if !defined(_WIN32) static const char *config_gamesave_dir = ".mercenary"; +#endif static int config_video_filter = 1; static int config_audio_filter = 1; -static int config_render = 0; +static int config_render = 1; /* opengl render */ static int config_skip_intro = 0; -static int config_multisampling = 16; -static double config_fov = FOV_NOVAGEN; +static int config_multisampling = 8; +static int config_joystick = -1, config_joystick_x = -1, config_joystick_y = -1, config_joystick_fire = -1; +#ifdef HAVE_OVR +static double config_benson_size = 0.7; +static double config_fov = FOV_JOLLY; +#else static double config_benson_size = 1.0; +static double config_fov = FOV_NOVAGEN; +#endif +static double config_monitor_distance = 41.5; /* inch */ +#ifdef HAVE_OVR +static double config_keyboard_distance = 38.5; /* inch */ +static double config_keyboard_height = -26.0; /* inch */ +#endif static int config_debug_transparent = 0; static int config_debug_opengl = 0; /* render improvements */ static int config_improve_extend_roads = 1; /* set to 1 to extend roads */ +static int config_improve_smooth_planets = 1; /* set to 1 to rotate planets smoothly */ +static int config_improve_stars_rotation = 1; /* set to 1 to improve star rendering */ +static int config_improve_fix_sky_rotation = 0; /* set to 1 to fix sky rotation */ +static int config_improve_round_planets = 0; /* set to 1 to make planets exactly round */ #define CPU_SPEED 7093790.0; @@ -81,12 +109,20 @@ static int config_improve_extend_roads = 1; /* set to 1 to extend roads */ static uint8_t *memory = NULL; static uint8_t *stop_event = NULL; static uint8_t *image = NULL; -#define SCREEN_WIDTH 320 -#define SCREEN_HEIGHT 200 +static uint8_t *help_osd[3] = { NULL, NULL, NULL }; +static uint8_t *info_osd = NULL; +static int help_view = 1; +static int help_views = 0; +static int32_t osd_timer = 0, border_timer = 0; +#define SCREEN_WIDTH (320*3) +#define SCREEN_HEIGHT (200*3) #define IMAGE_WIDTH 320 #define IMAGE_HEIGHT 200 #define BENSON_AT_LINE 136 #define IMAGE_DIWSTART 0x2c +#define HELP_ALPHA 0xd0 +#define OSD_WIDTH 320 +#define OSD_HEIGHT 16 static uint16_t *chipreg = NULL; static stereo_t *sound_buffer = NULL; /* sound buffer memory */ static int sound_buffer_size; /* buffer sample size */ @@ -97,6 +133,9 @@ static double benson_size; /* render size of benson */ static int render_legacy = 0; /* render original amiga screen, if set */ static int render_improved = 0; /* render improved image, if set */ static int debug_opengl = 0; /* render both, amiga screen and improved image, if set */ +static int intro_skipped = 0; /* indicated if we already have landed */ +static int window_width, window_height; +static int mission_disk = 0; static const char *home_dir; @@ -108,6 +147,7 @@ int parse_args(int argc, char *argv[]) while (argc > i) { if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { + /* | | */ print_info("Usage: %s\n", argv[0]); print_info(" -s --render-speed original | fast\n"); print_info(" Set speed of rendering to original Amiga or fast speed.\n"); @@ -127,6 +167,34 @@ int parse_args(int argc, char *argv[]) print_info(" Set field-of-view. Default is %.0f.\n", FOV_NOVAGEN); print_info(" -i --skip-intro\n"); print_info(" Skip intro sequence approaching to Eris space port.\n"); + print_info(" -j --joystick | list\n"); + print_info(" Select given joystick number or show list. (default = 0, if available)\n"); + print_info(" --joystick-x \n"); + print_info(" --joystick-y \n"); + print_info(" --joystick-fire