--- uae/src/tui.c 2018/04/24 16:43:33 1.1.1.5 +++ uae/src/tui.c 2018/04/24 16:58:29 1.1.1.8 @@ -44,7 +44,9 @@ static void getline (char *p) void gui_handle_events (void) { } - +void gui_fps (int x) +{ +} static void save_settings (void) { FILE *f; @@ -54,7 +56,7 @@ static void save_settings (void) fprintf (stderr, "Error saving options file!\n"); return; } - save_options (f); + save_options (f, &currprefs); fclose (f); } @@ -249,11 +251,11 @@ static void print_configuration (void) tui_puts (" (clever)"); tui_gotoxy (OPTION_COLUMN+7, y++); tui_puts ("drawing every "); - switch (currprefs.framerate) { + switch (currprefs.gfx_framerate) { case 1: break; case 2: tui_puts ("2nd "); break; case 3: tui_puts ("3rd "); break; - default: sprintf (tmp, "%dth ",currprefs.framerate); tui_puts (tmp); break; + default: sprintf (tmp, "%dth ",currprefs.gfx_framerate); tui_puts (tmp); break; } tui_puts ("frame. "); @@ -285,7 +287,7 @@ static void print_configuration (void) tui_puts (tmp); tui_gotoxy (OPTION_COLUMN, y++); - sprintf (tmp, "ROM IMAGE: %s", trimfilename(romfile, tui_cols () - 50)); + sprintf (tmp, "ROM IMAGE: %s", trimfilename (currprefs.romfile, tui_cols () - 50)); tui_puts (tmp); tui_gotoxy (OPTION_COLUMN, y++); if (!sound_available) @@ -351,7 +353,7 @@ static void HDOptions (void) if (mountvol[strlen(mountvol)-1]==':') mountvol[strlen(mountvol)-1] = 0; tui_wgets (mountdir, "Enter mounted volume path", 78); - add_filesys_unit (currprefs.mountinfo, mountvol, mountdir, 0, 0, 0, 0); + add_filesys_unit (currprefs.mountinfo, mountvol, mountdir, 0, 0, 0, 0, 0); break; case 2: tui_wgets (mountvol, "Enter mounted volume name", 10); @@ -360,7 +362,7 @@ static void HDOptions (void) if (mountvol[strlen (mountvol)-1]==':') mountvol[strlen (mountvol)-1] = 0; tui_wgets (mountdir, "Enter mounted volume path", 78); - add_filesys_unit (currprefs.mountinfo, mountvol, mountdir, 1, 0, 0, 0); + add_filesys_unit (currprefs.mountinfo, mountvol, mountdir, 1, 0, 0, 0, 0); break; case 3: buff = tui_filereq("*", "", "Select the hardfile to be mounted"); @@ -370,9 +372,10 @@ static void HDOptions (void) tui_wgets (mountdir, "Enter number of sectors per track", 4); tui_wgets (mountdir + 10, "Enter number of heads", 4); tui_wgets (mountdir + 20, "Enter number of reserved blocks", 3); + tui_wgets (mountdir + 30, "Enter block size", 4); buff = add_filesys_unit (currprefs.mountinfo, 0, mountvol, 1, atoi (mountdir), atoi (mountdir + 10), - atoi (mountdir + 20)); + atoi (mountdir + 20), atoi (mountdir + 30)); if (buff) tui_errorbox (buff); break; @@ -477,9 +480,9 @@ static void VideoOptions (void) currprefs.gfx_correct_aspect = !currprefs.gfx_correct_aspect; break; case 9: - currprefs.framerate++; - if (currprefs.framerate > 9) - currprefs.framerate=1; + currprefs.gfx_framerate++; + if (currprefs.gfx_framerate > 9) + currprefs.gfx_framerate=1; break; case 10: currprefs.gfxmem_size += 0x100000; @@ -528,9 +531,9 @@ static void MemoryOptions (void) currprefs.bogomem_size <<= 1; break; case 3: - tmp = tui_filereq ("*.rom", romfile, "Select a ROM image"); + tmp = tui_filereq ("*.rom", currprefs.romfile, "Select a ROM image"); if (tmp != NULL) - strcpy (romfile, tmp); + strcpy (currprefs.romfile, tmp); break; } } @@ -611,7 +614,7 @@ static void SoundOptions (void) currprefs.sound_freq = atoi (tmp); break; case 5: - currprefs.stereo = !currprefs.stereo; + currprefs.stereo = (currprefs.stereo + 1) % 3; break; } } @@ -630,14 +633,14 @@ static void OtherOptions (void) break; } else switch (c) { case 0: - currprefs.fake_joystick = (currprefs.fake_joystick & 0xFF00) + ((currprefs.fake_joystick & 255) + 1) % 6; - if ((currprefs.fake_joystick & 255) == (currprefs.fake_joystick >> 8)) - currprefs.fake_joystick = (currprefs.fake_joystick & 0x00FF) + ((((currprefs.fake_joystick >> 8) - 1) % 6) << 8); + currprefs.jport0 = (currprefs.jport0 + 1) % 6; + if (currprefs.jport0 == currprefs.jport1) + currprefs.jport1 = (currprefs.jport1 + 5) % 6; break; case 1: - currprefs.fake_joystick = (currprefs.fake_joystick & 0x00FF) + ((((currprefs.fake_joystick >> 8) + 1) % 6) << 8); - if ((currprefs.fake_joystick & 255) == (currprefs.fake_joystick >> 8)) - currprefs.fake_joystick = (currprefs.fake_joystick & 0xFF00) + ((currprefs.fake_joystick & 255) - 1) % 6; + currprefs.jport1 = (currprefs.jport1 + 1) % 6; + if (currprefs.jport0 == currprefs.jport1) + currprefs.jport0 = (currprefs.jport0 + 5) % 6; break; case 2: tui_wgets (tmp, "Enter new CPU emulation speed", 6); @@ -715,7 +718,8 @@ void gui_changesettings (void) else { changed_prefs = currprefs; currprefs = oldprefs; - currprefs.fake_joystick = changed_prefs.fake_joystick; + currprefs.jport0 = changed_prefs.jport0; + currprefs.jport1 = changed_prefs.jport1; joystick_setting_changed (); } }