--- uae/src/svga.c 2018/04/24 16:42:10 1.1.1.4 +++ uae/src/svga.c 2018/04/24 17:16:39 1.1.1.12 @@ -16,17 +16,16 @@ #include #include -#include "config.h" #include "options.h" -#include "threaddep/penguin.h" +#include "threaddep/thread.h" #include "uae.h" #include "memory.h" -#include "custom.h" -#include "readcpu.h" -#include "newcpu.h" #include "keyboard.h" #include "xwin.h" +#include "custom.h" +#include "drawing.h" #include "keybuf.h" +#include "newcpu.h" #include "tui.h" #include "gui.h" #include "picasso96.h" @@ -438,7 +437,7 @@ static void my_kbd_handler (int scancode record_key ((akey << 1) | 1); /* "Affengriff" */ - if(keystate[AK_CTRL] && keystate[AK_LAMI] && keystate[AK_RAMI]) + if ((keystate[AK_CTRL] || keystate[AK_RCTRL]) && keystate[AK_LAMI] && keystate[AK_RAMI]) uae_reset (); } @@ -457,7 +456,7 @@ static int post_enter_graphics (void) mouse_init("/dev/mouse", vga_getmousetype (), 10); if (keyboard_init() != 0) { leave_graphics_mode (); - fprintf (stderr, "Are you sure you have a keyboard??\n"); + write_log ("Are you sure you have a keyboard??\n"); return 0; } keyboard_seteventhandler (my_kbd_handler); @@ -473,16 +472,17 @@ static int post_enter_graphics (void) static int enter_graphics_mode (int which) { int oldmode = current_vgamode; + vga_setmode (TEXT); if (vga_setmode (which) < 0) { sleep(1); vga_setmode (TEXT); - fprintf (stderr, "SVGAlib doesn't like my video mode. Giving up.\n"); + write_log ("SVGAlib doesn't like my video mode (%d). Giving up.\n", which); return 0; } current_vgamode = which; linear_mem = 0; - if ((modeinfo.flags & CAPABLE_LINEAR) && !currprefs.no_xhair) { + if ((modeinfo.flags & CAPABLE_LINEAR) && ! currprefs.svga_no_linear) { int val = vga_setlinearaddressing (); int new_ul = val != -1 ? !need_dither : 0; if (using_linear == -1) @@ -490,12 +490,12 @@ static int enter_graphics_mode (int whic else if (using_linear != new_ul) { leave_graphics_mode (); - fprintf (stderr, "SVGAlib feeling not sure about linear modes???\n"); + write_log ("SVGAlib feeling not sure about linear modes???\n"); abort (); } if (val != -1) { linear_mem = (char *)vga_getgraphmem (); - fprintf (stderr, "Using linear addressing: %p.\n", linear_mem); + write_log ("Using linear addressing: %p.\n", linear_mem); } } @@ -508,20 +508,21 @@ static int enter_graphics_mode_picasso ( if (which == oldmode) return 1; + vga_setmode (TEXT); if (vga_setmode (which) < 0) { sleep (1); vga_setmode (TEXT); - fprintf (stderr, "SVGAlib doesn't like my video mode. Giving up.\n"); + write_log ("SVGAlib doesn't like my video mode (%d). Giving up.\n", which); exit (1); } current_vgamode = which; linear_mem = 0; - if ((modeinfo.flags & CAPABLE_LINEAR) && !currprefs.no_xhair) { + if ((modeinfo.flags & CAPABLE_LINEAR) && ! currprefs.svga_no_linear) { int val = vga_setlinearaddressing (); if (val != -1) { linear_mem = (char *)vga_getgraphmem (); - fprintf (stderr, "Using linear addressing: %p.\n", linear_mem); + write_log ("Using linear addressing: %p.\n", linear_mem); } } @@ -607,7 +608,7 @@ static int select_mode_from_prefs (void) int i; if (currprefs.color_mode > 5) - fprintf (stderr, "Bad color mode selected. Using default.\n"), currprefs.color_mode = 0; + write_log ("Bad color mode selected. Using default.\n"), currprefs.color_mode = 0; mode_nr0 = 0; for (i = 1; i < MAX_SCREEN_MODES; i++) { @@ -628,15 +629,15 @@ static int select_mode_from_prefs (void) } } if (mode_nr == -1) { - fprintf (stderr, "Sorry, this combination of color and video mode is not supported.\n"); + write_log ("Sorry, this combination of color and video mode is not supported.\n"); return 0; } vgamode = vga_mode_table[mode_nr][currprefs.color_mode]; if (vgamode == -1) { - fprintf (stderr, "Bug!\n"); + write_log ("Bug!\n"); abort (); } - fprintf (stderr, "Desired resolution: %dx%d, using: %dx%d\n", + write_log ("Desired resolution: %dx%d, using: %dx%d\n", currprefs.gfx_width, currprefs.gfx_height, x_size_table[mode_nr], y_size_table[mode_nr]); @@ -697,7 +698,7 @@ int graphics_init (void) #endif gfxvidinfo.emergmem = 0; } - + printf ("rowbytes %d\n", gfxvidinfo.rowbytes); init_colors (); buttonstate[0] = buttonstate[1] = buttonstate[2] = 0; for(i = 0; i < 256; i++) @@ -861,7 +862,7 @@ static void set_window_for_amiga (void) restore_vga_colors (); } -void gfx_set_picasso_modeinfo (int w, int h, int depth) +void gfx_set_picasso_modeinfo (int w, int h, int depth, int rgbfmt) { vga_modeinfo *info; int i, mode; @@ -910,14 +911,6 @@ void gfx_set_picasso_state (int on) set_window_for_amiga (); } -void begindrawing (void) -{ -} - -void enddrawing (void) -{ -} - uae_u8 *gfx_lock_picasso (void) { return linear_mem; @@ -935,3 +928,13 @@ int lockscr (void) void unlockscr (void) { } + +void target_save_options (FILE *f, struct uae_prefs *p) +{ + fprintf (f, "svga.no_linear=%s\n", p->svga_no_linear ? "true" : "false"); +} + +int target_parse_option (struct uae_prefs *p, char *option, char *value) +{ + return (cfgfile_yesno (option, value, "no_linear", &p->svga_no_linear)); +}