puae 2.3.0

This commit is contained in:
Mustafa 'GnoStiC' TUFAN 2010-09-29 18:50:28 +03:00
parent b670697fe8
commit 4bb0da50ce
12 changed files with 2780 additions and 122 deletions

5
README
View File

@ -10,11 +10,6 @@ with fixes from:
Steven 'xaind' Saunders (MacOSX)
'wuffe' (FreeBSD)
Thanks for the morale support:
Dom 'Hungry Horace' Cresswell
Christopher 'FOL' Follett
Andrew 'Truck' Holland
Richard Drummond's E-UAE 0.8.29
============

75
install_deps.sh Executable file
View File

@ -0,0 +1,75 @@
# package managers
package_managers=("aptitude" "emerge" "yum" "urpmi" "pacman" "zypper");
# linux
apt_32 = "apt-get install build-essential automake zlib1g libsdl1.2-dev libgtk2.0-dev xorg-core";
# macosx
# platform
echo "* Checking platform...";
platform=""
if [ `uname` == "Darwin" ]; then
platform="osx"
echo " Darwin";
elif [ `uname` == "Linux" ]; then
platform="linux"
echo " Linux";
fi
# bits
echo "* Checking architecture...";
is_64_bit=0
if [ `uname -m` == "x86_64" ]; then
is_64_bit=1
echo " 64 bit";
else
echo " 32 bit";
fi
# package manager
echo "* Checking package manager...";
package_manager=""
for pm in ${package_managers[@]}; do
if [ ! -f "`which $pm`" ]; then
continue;
fi
package_manager=$pm;
echo " $pm";
break;
done
# who am i?
need_sudo=1
if [ `whoami` = "root" ]; then
need_sudo=0
echo "* Logged in as root user...";
else
echo "!! You need to login as root (or sudo) !!";
fi
if [ need_sudo ]
apt_32 = "sudo " + apt_32
if
#
# Install Deps
#
if [ platform == "linux" ]
if [ is_64_bit == 0]
# LINUX 32b start
echo ">> Installing Linux 32 bit deps";
if [ package_manager==aptitude ]
fi
# LINUX 32b end
else
# LINUX 64b start
echo ">> Installing Linux 64 bit deps";
# LINUX 64b end
fi
elif [ platform == "osx" ]
# MACOSX start
echo ">> Installing MACOSX deps";
# MACOSX end
fi

View File

@ -92,7 +92,7 @@ static const struct cfg_lines opttable[] =
{"gfx_gl_left_crop", "crop image in gl mode (+ integer)" }, //koko
{"gfx_gl_right_crop", "crop image in gl mode (+ integer)" },*/ //koko
{"gfx_gl_smoothing", "Linear smoothing in gl mode (true/false)" }, //koko
{"gfx_colour_mode", "" },
{"32bit_blits", "Enable 32 bit blitter emulation" },
{"immediate_blits", "Perform blits immediately" },
@ -221,83 +221,6 @@ static const TCHAR *obsolete[] = {
#define UNEXPANDED "$(FILE_PATH)"
/*
* The beginnings of a less brittle, more easily maintainable way of handling
* prefs options.
*
* We maintain a key/value table of options.
*
* TODO:
* Make this a hash table.
* Add change notification.
* Support other value data types.
* Migrate more options.
*/
typedef struct {
const char *key;
int target_specific;
const char *value;
const char *help;
} prefs_attr_t;
static prefs_attr_t prefs_attr_table[] = {
{"floppy_path", 1, 0, "Default directory for floppy disk images"},
{"rom_path", 1, 0, "Default directory for ROM images"},
{"hardfile_path", 1, 0, "Default directory for hardfiles and filesystems"},
{"savestate_path", 1, 0, "Default directory for saved-state images"},
{0, 0, 0, 0}
};
static prefs_attr_t *lookup_attr (const char *key)
{
prefs_attr_t *attr = &prefs_attr_table[0];
while (attr->key) {
if (0 == strcmp (key, attr->key))
return attr;
attr++;
}
return 0;
}
static void prefs_dump_help (void)
{
prefs_attr_t *attr = &prefs_attr_table[0];
while (attr->key) {
int width = -MAX_OPTION_KEY_LEN;
if (attr->target_specific) {
width += strlen (TARGET_NAME) + 1;
write_log ("%s.", TARGET_NAME);
}
write_log ("%*s: %s.\n", width, attr->key, attr->help ? attr->help : "");
attr++;
}
}
void prefs_set_attr (const char *key, const char *value)
{
prefs_attr_t *attr = lookup_attr (key);
if (attr) {
if (attr->value)
free ((void *)attr->value);
attr->value = value;
}
}
const char *prefs_get_attr (const char *key)
{
prefs_attr_t *attr = lookup_attr (key);
if (attr)
return attr->value;
else
return 0;
}
static void trimwsa (char *s)
{
/* Delete trailing whitespace. */
@ -428,7 +351,7 @@ void cfgfile_write (struct zfile *f, const TCHAR *option, const TCHAR *format,..
TCHAR tmp[CONFIG_BLEN];
va_start (parms, format);
vsnprintf (tmp, CONFIG_BLEN, format, parms);
_vsntprintf (tmp, CONFIG_BLEN, format, parms);
cfg_dowrite (f, option, tmp, 0, 0);
va_end (parms);
}
@ -438,7 +361,7 @@ void cfgfile_dwrite (struct zfile *f, const TCHAR *option, const TCHAR *format,.
TCHAR tmp[CONFIG_BLEN];
va_start (parms, format);
vsnprintf (tmp, CONFIG_BLEN, format, parms);
_vsntprintf (tmp, CONFIG_BLEN, format, parms);
cfg_dowrite (f, option, tmp, 1, 0);
va_end (parms);
}
@ -448,7 +371,7 @@ void cfgfile_target_write (struct zfile *f, const TCHAR *option, const TCHAR *fo
TCHAR tmp[CONFIG_BLEN];
va_start (parms, format);
vsnprintf (tmp, CONFIG_BLEN, format, parms);
_vsntprintf (tmp, CONFIG_BLEN, format, parms);
cfg_dowrite (f, option, tmp, 0, 1);
va_end (parms);
}
@ -458,7 +381,7 @@ void cfgfile_target_dwrite (struct zfile *f, const TCHAR *option, const TCHAR *f
TCHAR tmp[CONFIG_BLEN];
va_start (parms, format);
vsnprintf (tmp, CONFIG_BLEN, format, parms);
_vsntprintf (tmp, CONFIG_BLEN, format, parms);
cfg_dowrite (f, option, tmp, 1, 1);
va_end (parms);
}
@ -483,6 +406,45 @@ static void cfgfile_write_rom (struct zfile *f, const TCHAR *path, const TCHAR *
}
static void write_filesys_config (struct uae_prefs *p, const TCHAR *unexpanded,
const TCHAR *default_path, struct zfile *f)
{
int i;
TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
TCHAR *hdcontrollers[] = { "uae",
"ide0", "ide1", "ide2", "ide3",
"scsi0", "scsi1", "scsi2", "scsi3", "scsi4", "scsi5", "scsi6",
"scsram", "scside" }; /* scsram = smart card sram = pcmcia sram card */
for (i = 0; i < p->mountitems; i++) {
struct uaedev_config_info *uci = &p->mountconfig[i];
TCHAR *str;
int bp = uci->bootpri;
if (!uci->autoboot)
bp = -128;
if (uci->donotmount)
bp = -129;
str = cfgfile_subst_path (default_path, unexpanded, uci->rootdir);
if (!uci->ishdf) {
_stprintf (tmp, "%s,%s:%s:%s,%d", uci->readonly ? "ro" : "rw",
uci->devname ? uci->devname : "", uci->volname, str, bp);
cfgfile_write_str (f, "filesystem2", tmp);
} else {
_stprintf (tmp, "%s,%s:%s,%d,%d,%d,%d,%d,%s,%s",
uci->readonly ? "ro" : "rw",
uci->devname ? uci->devname : "", str,
uci->sectors, uci->surfaces, uci->reserved, uci->blocksize,
bp, uci->filesys ? uci->filesys : "", hdcontrollers[uci->controller]);
cfgfile_write_str (f, "hardfile2", tmp);
}
_stprintf (tmp2, "uaehf%d", i);
cfgfile_write (f, tmp2, "%s,%s", uci->ishdf ? "hdf" : "dir", tmp);
xfree (str);
}
}
static void subst_home (char *f, int n)
{
const char *home = getenv ("HOME");
@ -514,13 +476,13 @@ void do_cfgfile_write (FILE *f, const char *format,...)
static void cfgfile_write_path_option (FILE *f, const char *key)
{
const char *home = getenv ("HOME");
const char *path = prefs_get_attr (key);
const char *path = "./";
char *out_path = 0;
if (path)
out_path = cfgfile_subst_path (home, "~", path);
out_path = cfgfile_subst_path (home, "~", path);
cfgfile_write (f, "%s.%s=%s\n", TARGET_NAME, key, out_path ? out_path : "");
cfgfile_write (f, "%s.%s=%s\n", TARGET_NAME, key, out_path ? out_path : "");
if (out_path)
free (out_path);
@ -965,7 +927,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
cfgfile_dwrite_bool (f, "warp", p->turbo_emulation);
#ifdef FILESYS
//write_filesys_config (currprefs.mountinfo, UNEXPANDED, prefs_get_attr ("hardfile_path"), f);
write_filesys_config (p, UNEXPANDED, p->path_hardfile, f);
if (p->filesys_no_uaefsdb)
cfgfile_write_bool (f, "filesys_no_fsdb", p->filesys_no_uaefsdb);
#endif
@ -2664,13 +2626,8 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real
cfgfile_parse_line (p, line, 0);
}
for (i = 0; i < 4; i++) {
subst (prefs_get_attr("floppy_path"), p->floppyslots[i].df, sizeof p->floppyslots[i].df);
for (i = 0; i < 4; i++)
subst (p->path_floppy, p->floppyslots[i].df, sizeof p->floppyslots[i].df / sizeof (TCHAR));
}
subst (prefs_get_attr("rom_path"), p->romfile, sizeof p->romfile);
subst (prefs_get_attr("rom_path"), p->romextfile, sizeof p->romextfile);
subst (prefs_get_attr("rom_path"), p->keyfile, sizeof p->keyfile);
subst (p->path_rom, p->romfile, sizeof p->romfile / sizeof (TCHAR));
subst (p->path_rom, p->romextfile, sizeof p->romextfile / sizeof (TCHAR));
@ -3773,17 +3730,6 @@ void default_prefs (struct uae_prefs *p, int type)
strcpy (p->cartfile, "");
#endif
prefs_set_attr ("rom_path", strdup_path_expand (TARGET_ROM_PATH));
prefs_set_attr ("floppy_path", strdup_path_expand (TARGET_FLOPPY_PATH));
prefs_set_attr ("hardfile_path", strdup_path_expand (TARGET_HARDFILE_PATH));
#ifdef SAVESTATE
prefs_set_attr ("savestate_path", strdup_path_expand (TARGET_SAVESTATE_PATH));
#endif
_tcscpy (p->romextfile, "");
_tcscpy (p->flashfile, "");
_tcscpy (p->cartfile, "");
_tcscpy (p->path_rom, "./");
_tcscpy (p->path_floppy, "./");
_tcscpy (p->path_hardfile, "./");
@ -3851,7 +3797,9 @@ void default_prefs (struct uae_prefs *p, int type)
inputdevice_default_prefs (p);
#ifdef SCSIEMU
blkdev_default_prefs (p);
#endif
zfile_fclose (default_file);
default_file = NULL;

View File

@ -5123,7 +5123,9 @@ static void vsync_handler (void)
picasso_handle_vsync ();
#endif
audio_vsync ();
#ifdef SCSIEMU
blkdev_vsync ();
#endif
if (quit_program > 0) {
/* prevent possible infinite loop at wait_cycles().. */

View File

@ -788,8 +788,8 @@ TCHAR *DISK_get_saveimagepath (const TCHAR *name)
}
i--;
}
sprintf (name1, "%s%s_save.adf", prefs_get_attr ("floppy_path"), name2 + i);
fetch_saveimagepath (path, sizeof path / sizeof (TCHAR), 1);
_stprintf (name1, "%s%s_save.adf", path, name2 + i);
return name1;
}

View File

@ -134,7 +134,7 @@ static void ersatz_init (void)
already_failed = 1;
gui_message ("You need to have a diskfile in DF0 to use the Kickstart replacement!\n");
uae_quit ();
uae_restart (-1, NULL);
//uae_restart (-1, NULL);
return;
}

View File

@ -435,7 +435,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
if (!run_once) {
run_once++;
const char *floppy_path = prefs_get_attr("floppy_path");
const char *floppy_path = currprefs.path_floppy;
if (floppy_path != NULL) {
char homedir[MAX_PATH];

2636
src/gui-glade/puae.glade Normal file

File diff suppressed because it is too large Load Diff

View File

@ -608,10 +608,10 @@ static int my_idle (void)
}
if (cmd == GUICMD_SHOW) {
gtk_widget_show (gui_window);
# if GTK_MAJOR_VERSION >= 2
#if GTK_MAJOR_VERSION >= 2
gtk_window_present (GTK_WINDOW (gui_window));
gui_active = 1;
# endif
#endif
} else {
n = read_comm_pipe_int_blocking (&to_gui_pipe);
floppyfileentry_do_dialog (FLOPPYFILEENTRY (floppy_widget[n]));
@ -943,9 +943,8 @@ static void did_romchange (GtkWidget *w, gpointer data)
{
gtk_widget_set_sensitive (rom_change_widget, 0);
rom_selector = make_file_selector ("Select a ROM file",
did_rom_select, did_close_rom);
filesel_set_path (rom_selector, prefs_get_attr ("rom_path"));
rom_selector = make_file_selector ("Select a ROM file", did_rom_select, did_close_rom);
filesel_set_path (rom_selector, currprefs.path_rom);
}
static GtkWidget *key_selector;
@ -977,7 +976,7 @@ static void did_keychange (GtkWidget *w, gpointer data)
gtk_widget_set_sensitive (key_change_widget, 0);
key_selector = make_file_selector ("Select a Kickstart key file", did_key_select, did_close_key);
filesel_set_path (key_selector, prefs_get_attr ("rom_path"));
filesel_set_path (key_selector, currprefs.path_rom);
}
static void add_empty_vbox (GtkWidget *tobox)
@ -1138,7 +1137,7 @@ static void make_floppy_disks (GtkWidget *vbox)
gtk_widget_set_sensitive(floppy_widget[i], 0);
floppyfileentry_set_drivename (FLOPPYFILEENTRY (floppy_widget[i]), buf);
floppyfileentry_set_label (FLOPPYFILEENTRY (floppy_widget[i]), buf);
floppyfileentry_set_currentdir (FLOPPYFILEENTRY (floppy_widget[i]), prefs_get_attr ("floppy_path"));
floppyfileentry_set_currentdir (FLOPPYFILEENTRY (floppy_widget[i]), currprefs.path_floppy);
gtk_box_pack_start (GTK_BOX (vbox), floppy_widget[i], FALSE, TRUE, 0);
gtk_widget_show (floppy_widget[i]);
gtk_signal_connect (GTK_OBJECT (floppy_widget[i]), "disc-changed", (GtkSignalFunc) disc_changed, GINT_TO_POINTER (i));
@ -1175,7 +1174,7 @@ static void did_sstate_change (GtkWidget *w, gpointer data)
gtk_widget_set_sensitive (sstate_change_widget, 0);
sstate_selector = make_file_selector ("Select a Savestate file", did_sstate_select, did_close_sstate);
filesel_set_path (sstate_selector, prefs_get_attr ("savestate_path"));
filesel_set_path (sstate_selector, currprefs.path_savestate);
}
static void did_sstate_load (GtkWidget *w, gpointer data)

View File

@ -79,7 +79,7 @@ static const char *get_last_floppy_dir (void)
atexit (free_last_floppy_dir);
}
last_floppy_dir = my_strdup (prefs_get_attr ("floppy_path"));
last_floppy_dir = my_strdup (currprefs.path_floppy);
}
return last_floppy_dir;
}
@ -95,7 +95,7 @@ static const char *get_last_savestate_dir (void)
atexit (free_last_savestate_dir);
}
last_savestate_dir = my_strdup (prefs_get_attr ("savestate_path"));
last_savestate_dir = my_strdup (currprefs.path_savestate);
}
return last_savestate_dir;
}

View File

@ -327,6 +327,7 @@ struct uae_prefs {
TCHAR path_floppy[256];
TCHAR path_hardfile[256];
TCHAR path_rom[256];
TCHAR path_savestate[256];
int m68k_speed;
int cpu_model;

View File

@ -439,7 +439,9 @@ void fixup_prefs (struct uae_prefs *p)
p->maprom = 0x0f000000;
if (p->tod_hack && p->cs_ciaatod == 0)
p->cs_ciaatod = p->ntscmode ? 2 : 1;
#ifdef SCSIEMU
blkdev_fix_prefs (p);
#endif
target_fixup_options (p);
}