diff --git a/README.md b/README.md index e86c50b..1aed3a1 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ Usage: blues [OPTIONS]... --screensize=WxH Graphics screen size (default 320x200) --cga Enable CGA colors --dosscroll Enable DOS style screen scrolling + --hybrid Enable fuchsia color as in Hybrid crack ``` ## Downloads diff --git a/intern.h b/intern.h index 5b235b5..331a420 100644 --- a/intern.h +++ b/intern.h @@ -56,6 +56,7 @@ struct options_t { bool amiga_status_bar; bool dos_scrolling; bool cga_colors; + bool hybrid_color; }; struct game_t { diff --git a/main.c b/main.c index 1d4030e..f812c42 100644 --- a/main.c +++ b/main.c @@ -24,6 +24,7 @@ static const char *USAGE = " --screensize=WxH Graphics screen size (default 320x200)\n" " --cga Enable CGA colors\n" " --dosscroll Enable DOS style screen scrolling\n" + " --hybrid Enable fuchsia color as in Hybrid crack\n" ; static struct game_t *detect_game(const char *data_path) { @@ -57,8 +58,9 @@ int main(int argc, char *argv[]) { g_options.amiga_copper_bars = true; g_options.amiga_colors = true; // g_options.amiga_status_bar = true; - g_options.dos_scrolling = false; g_options.cga_colors = false; + g_options.dos_scrolling = false; + g_options.hybrid_color = false; const char *data_path = DEFAULT_DATA_PATH; int scale_factor = DEFAULT_SCALE_FACTOR; const char *scale_filter = DEFAULT_SCALE_FILTER; @@ -82,6 +84,7 @@ int main(int argc, char *argv[]) { { "screensize", required_argument, 0, 9 }, { "cga", no_argument, 0, 10 }, { "dosscroll", no_argument, 0, 11 }, + { "hybrid", no_argument, 0, 12 }, { 0, 0, 0, 0 }, }; int index; @@ -127,6 +130,9 @@ int main(int argc, char *argv[]) { case 11: g_options.dos_scrolling = true; break; + case 12: + g_options.hybrid_color = true; + break; default: fprintf(stdout, USAGE, argv[0]); return -1; @@ -137,7 +143,7 @@ int main(int argc, char *argv[]) { fprintf(stdout, "No data files found\n"); } else { g_sys.init(); - g_sys.set_screen_size(GAME_SCREEN_W, GAME_SCREEN_H, game->name, scale_factor, scale_filter, fullscreen); + g_sys.set_screen_size(GAME_SCREEN_W, GAME_SCREEN_H, game->name, scale_factor, scale_filter, fullscreen, g_options.hybrid_color); game->run(data_path); g_sys.fini(); } diff --git a/sys.h b/sys.h index a3544af..8a1650c 100644 --- a/sys.h +++ b/sys.h @@ -38,7 +38,7 @@ struct sys_t { struct input_t input; int (*init)(); void (*fini)(); - void (*set_screen_size)(int w, int h, const char *caption, int scale, const char *filter, bool fullscreen); + void (*set_screen_size)(int w, int h, const char *caption, int scale, const char *filter, bool fullscreen, bool hybrid_color); void (*set_screen_palette)(const uint8_t *colors, int offset, int count, int depth); void (*set_palette_amiga)(const uint16_t *colors, int offset); void (*set_copper_bars)(const uint16_t *data); diff --git a/sys_sdl2.c b/sys_sdl2.c index 3feb454..a9737c5 100644 --- a/sys_sdl2.c +++ b/sys_sdl2.c @@ -40,6 +40,7 @@ static uint32_t _screen_palette[256]; static uint32_t *_screen_buffer; static int _copper_color_key; static uint32_t _copper_palette[COPPER_BARS_H]; +static bool _hybrid_color; static SDL_GameController *_controller; static SDL_Joystick *_joystick; @@ -108,7 +109,7 @@ static void sdl2_fini() { SDL_Quit(); } -static void sdl2_set_screen_size(int w, int h, const char *caption, int scale, const char *filter, bool fullscreen) { +static void sdl2_set_screen_size(int w, int h, const char *caption, int scale, const char *filter, bool fullscreen, bool hybrid_color) { assert(_screen_w == 0 && _screen_h == 0); // abort if called more than once _screen_w = w; _screen_h = h; @@ -137,6 +138,7 @@ static void sdl2_set_screen_size(int w, int h, const char *caption, int scale, c _sprites_cliprect.y = 0; _sprites_cliprect.w = w; _sprites_cliprect.h = h; + _hybrid_color = hybrid_color; } static uint32_t convert_amiga_color(uint16_t color) { @@ -196,6 +198,9 @@ static void sdl2_set_screen_palette(const uint8_t *colors, int offset, int count g = (g << shift) | (g >> (depth - shift)); b = (b << shift) | (b >> (depth - shift)); } + if(_hybrid_color && i < 2){ + g = 0; + } _screen_palette[offset + i] = SDL_MapRGB(_fmt, r, g, b); palette_colors[i].r = r; palette_colors[i].g = g;