From 398c8f81ad1b3d574f0051d23035dae5598e1760 Mon Sep 17 00:00:00 2001 From: "Matthew N. Dodd" Date: Mon, 7 Apr 2003 06:42:33 +0000 Subject: - Update to 0.34 - Add support for SDL Joysticks. - Possibly run on more than i386. --- emulators/generator/files/patch-aa | 140 ----------------------- emulators/generator/files/patch-ab | 13 --- emulators/generator/files/patch-ac | 75 ------------ emulators/generator/files/patch-ad | 34 ------ emulators/generator/files/patch-configure | 11 ++ emulators/generator/files/patch-configure.in | 11 ++ emulators/generator/files/patch-main-Makefile.in | 20 ++++ emulators/generator/files/patch-main-ui-gtk.c | 136 ++++++++++++++++++++++ 8 files changed, 178 insertions(+), 262 deletions(-) delete mode 100644 emulators/generator/files/patch-aa delete mode 100644 emulators/generator/files/patch-ab delete mode 100644 emulators/generator/files/patch-ac delete mode 100644 emulators/generator/files/patch-ad create mode 100644 emulators/generator/files/patch-configure create mode 100644 emulators/generator/files/patch-configure.in create mode 100644 emulators/generator/files/patch-main-Makefile.in create mode 100644 emulators/generator/files/patch-main-ui-gtk.c (limited to 'emulators/generator/files') diff --git a/emulators/generator/files/patch-aa b/emulators/generator/files/patch-aa deleted file mode 100644 index 22d33c7e4749..000000000000 --- a/emulators/generator/files/patch-aa +++ /dev/null @@ -1,140 +0,0 @@ ---- compile/configure.orig Wed Apr 18 19:33:42 2001 -+++ compile/configure Wed Apr 18 21:09:12 2001 -@@ -2009,7 +2009,7 @@ - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_save_LIBS="$LIBS" --LIBS="-ltcl8.0 $LIBS" -+LIBS="-ltcl82 $LIBS" - cat > conftest.$ac_ext <&6 -- LIBS="$LIBS -ltcl8.0"; lib=yes -+ LIBS="$LIBS -ltcl82"; lib=yes - else - echo "$ac_t""no" 1>&6 - lib=no -@@ -2051,7 +2051,7 @@ - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_save_LIBS="$LIBS" --LIBS="-ltcl $LIBS" -+LIBS="-ltcl82 $LIBS" - cat > conftest.$ac_ext <&6 -- LIBS="$LIBS -ltcl"; lib=yes -+ LIBS="$LIBS -ltcl82"; lib=yes - else - echo "$ac_t""no" 1>&6 - lib=no -@@ -2096,7 +2096,7 @@ - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_save_LIBS="$LIBS" --LIBS="-ltk8.0 $LIBS" -+LIBS="-ltk82 $LIBS" - cat > conftest.$ac_ext <&6 -- LIBS="$LIBS -ltk8.0"; lib=yes -+ LIBS="$LIBS -ltk82"; lib=yes - else - echo "$ac_t""no" 1>&6 - lib=no -@@ -2138,7 +2138,7 @@ - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_save_LIBS="$LIBS" --LIBS="-ltk $LIBS" -+LIBS="-ltk82 $LIBS" - cat > conftest.$ac_ext <&6 -- LIBS="$LIBS -ltk"; lib=yes -+ LIBS="$LIBS -ltk82"; lib=yes - else - echo "$ac_t""no" 1>&6 - lib=no -@@ -2322,18 +2322,20 @@ - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_save_LIBS="$LIBS" --LIBS="-lalleg $LIBS" -+LIBS="-L/usr/local/lib -lalleg-3.9.34 -lalleg_unsharable $LIBS" - cat > conftest.$ac_ext < - - int main() { - allegro_exit() - ; return 0; } -+ -+END_OF_MAIN(); - EOF - if { (eval echo configure:2339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* -@@ -2350,7 +2352,7 @@ - fi - if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 -- LIBS="$LIBS -lalleg";lib=yes -+ LIBS="$LIBS -L/usr/local/lib -lalleg-3.9.34 -lalleg_unsharable";lib=yes - else - echo "$ac_t""no" 1>&6 - lib=no -@@ -2599,7 +2601,7 @@ - #include "confdefs.h" - #include <$ac_hdr> - EOF --ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -+ac_try="$ac_cpp -I/usr/local/include/tk8.2/ -I/usr/local/include/tcl8.2/ conftest.$ac_ext >/dev/null 2>conftest.out" - { (eval echo configure:2604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then -@@ -2686,7 +2688,7 @@ - #include "confdefs.h" - #include <$ac_hdr> - EOF --ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -+ac_try="$ac_cpp -I/usr/local/include/tcl8.2 conftest.$ac_ext >/dev/null 2>conftest.out" - { (eval echo configure:2691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then -@@ -2950,6 +2952,7 @@ - fprintf(f, "%d\n", sizeof(unsigned char)); - exit(0); - } -+ - EOF - if { (eval echo configure:2955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then -@@ -2982,6 +2985,7 @@ - #line 2983 "configure" - #include "confdefs.h" - #include -+ - main() - { - FILE *f=fopen("conftestval", "w"); diff --git a/emulators/generator/files/patch-ab b/emulators/generator/files/patch-ab deleted file mode 100644 index 15e314e5e83a..000000000000 --- a/emulators/generator/files/patch-ab +++ /dev/null @@ -1,13 +0,0 @@ ---- src/generator.c.orig Mon May 1 02:01:59 2000 -+++ src/generator.c Wed Apr 18 22:32:44 2001 -@@ -109,8 +109,10 @@ - ui_err("Failed to initialise cpuz80 module (%d)", retval); - - /* initialise sound system */ -+/* - if ((retval = sound_init())) - ui_err("Failed to initialise sound module (%d)", retval); -+*/ - - signal(SIGINT, gen_sighandler); - diff --git a/emulators/generator/files/patch-ac b/emulators/generator/files/patch-ac deleted file mode 100644 index 87f46c1977ce..000000000000 --- a/emulators/generator/files/patch-ac +++ /dev/null @@ -1,75 +0,0 @@ ---- src/gensound.c.orig Mon May 1 02:04:06 2000 -+++ src/gensound.c Wed Apr 18 22:32:49 2001 -@@ -50,7 +50,7 @@ - - static unsigned int sound_sampsperfield = 0; - static int sound_dev = 0; --/* static int sound_dump = 0; */ -+static int sound_dump = 0; - static uint16 soundbuf[2][SOUND_MAXRATE/50]; /* pal is lowest framerate */ - static int sound_format; - static int sound_stereo; -@@ -69,15 +69,19 @@ - { - audio_buf_info sound_info; - -+ return 0; -+ - LOG_NORMAL(("Initialising sound...")); - sound_sampsperfield = SOUND_SAMPLERATE / vdp_framerate; - -- /* sound_dump = open("/tmp/sound_dump", O_CREAT|O_WRONLY|O_TRUNC); */ -+ sound_dump = open("/tmp/sound_dump", O_CREAT|O_WRONLY|O_TRUNC); - -- if ((sound_dev = open(SOUND_DEVICE, O_WRONLY, 0)) == -1) { -+/* -+ if ((sound_dev = open("/dev/null", O_WRONLY, 0)) == -1) { - LOG_CRITICAL(("open " SOUND_DEVICE " failed: %s", strerror(errno))); - return 1; - } -+ sound_dev = sound_dump; - sound_frag = (SOUND_FRAGMENTS<<16 | - (int)(ceil(log10(sound_sampsperfield*4)/log10(2)))); - if (ioctl(sound_dev, SNDCTL_DSP_SETFRAGMENT, &sound_frag) == -1) { -@@ -142,6 +146,7 @@ - return 1; - LOG_NORMAL(("YM2612 Initialised @ sample rate %d", sound_speed)); - return 0; -+*/ - } - - /*** sound_final - finalise this sub-unit ***/ -@@ -169,6 +174,7 @@ - - void sound_genreset(void) - { -+ return 0; - #ifdef JFM - jfm_reset(sound_ctx); - #else -@@ -211,6 +217,8 @@ - audio_buf_info sound_info; - unsigned int pending; - -+ return 0; -+ - if (ioctl(sound_dev, SNDCTL_DSP_GETOSPACE, &sound_info) == -1) - ui_err("Error getting output space info", strerror(errno)); - pending = (sound_info.fragstotal*sound_info.fragsize)-sound_info.bytes; -@@ -232,14 +240,14 @@ - buffer[i*2+1] = (soundbuf[1][i] >> 8) | ((soundbuf[1][i] << 8) & 0xff00); - } - } -+/* - if (write(sound_dev, buffer, sound_sampsperfield*4) == -1) { - if (errno != EINTR) - ui_err("Error writing to sound device: %s", strerror(errno)); - } -- /* -+*/ - if (write(sound_dump, buffer, sound_sampsperfield*4) == -1) - ui_err("Error writing to dump file: %s", strerror(errno)); -- */ - } - - #ifdef JFM diff --git a/emulators/generator/files/patch-ad b/emulators/generator/files/patch-ad deleted file mode 100644 index 1e2fbd9ce16c..000000000000 --- a/emulators/generator/files/patch-ad +++ /dev/null @@ -1,34 +0,0 @@ ---- src/snd/fm.c.orig Wed Apr 18 22:37:06 2001 -+++ src/snd/fm.c Wed Apr 18 22:37:27 2001 -@@ -1231,6 +1231,8 @@ - { - int fn; - -+return 0; -+ - /* frequency base */ - OPN->ST.freqbase = (OPN->ST.rate) ? ((double)OPN->ST.clock * 4096.0 / OPN->ST.rate) / pris : 0; - /* Timer base time */ -@@ -3183,6 +3185,8 @@ - YM2612 *F2612 = &(FM2612[n]); - int addr; - -+ return 0; -+ - switch( a&3){ - case 0: /* address port 0 */ - F2612->OPN.ST.address = v & 0xff; -@@ -3227,8 +3231,13 @@ - } - unsigned char YM2612Read(int n,int a) - { -+/* - YM2612 *F2612 = &(FM2612[n]); - int addr = F2612->OPN.ST.address; -+*/ -+ YM2612 *F2612; int addr; -+ -+ return 0; - - switch( a&3){ - case 0: /* status 0 */ diff --git a/emulators/generator/files/patch-configure b/emulators/generator/files/patch-configure new file mode 100644 index 000000000000..73b1b4022e0e --- /dev/null +++ b/emulators/generator/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig Sat Oct 20 16:05:45 2001 ++++ configure Mon Apr 7 02:18:27 2003 +@@ -1575,7 +1575,7 @@ + if [ "x$GCCVER" != "xno" ]; then + echo "$as_me:1576: result: Turning on gcc optimisations" >&5 + echo "${ECHO_T}Turning on gcc optimisations" >&6 +- CFLAGS="$CFLAGS -O3 -ffast-math -fomit-frame-pointer" ++ CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer" + if [ "x$GCCVER" = "x3" ]; then + echo "$as_me:1580: result: Turning on gcc 3 optimisations" >&5 + echo "${ECHO_T}Turning on gcc 3 optimisations" >&6 diff --git a/emulators/generator/files/patch-configure.in b/emulators/generator/files/patch-configure.in new file mode 100644 index 000000000000..563616dac479 --- /dev/null +++ b/emulators/generator/files/patch-configure.in @@ -0,0 +1,11 @@ +--- configure.in.orig Sat Oct 20 15:34:19 2001 ++++ configure.in Mon Apr 7 02:18:22 2003 +@@ -118,7 +118,7 @@ + else + if [[ "x$GCCVER" != "xno" ]]; then + AC_MSG_RESULT(Turning on gcc optimisations) +- CFLAGS="$CFLAGS -O3 -ffast-math -fomit-frame-pointer" ++ CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer" + if [[ "x$GCCVER" = "x3" ]]; then + AC_MSG_RESULT(Turning on gcc 3 optimisations) + CFLAGS="$CFLAGS -minline-all-stringops -fno-math-errno" diff --git a/emulators/generator/files/patch-main-Makefile.in b/emulators/generator/files/patch-main-Makefile.in new file mode 100644 index 000000000000..4da493a73a05 --- /dev/null +++ b/emulators/generator/files/patch-main-Makefile.in @@ -0,0 +1,20 @@ +--- main/Makefile.in.orig Mon Apr 7 01:54:22 2003 ++++ main/Makefile.in Mon Apr 7 01:54:57 2003 +@@ -222,7 +222,7 @@ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ +- f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ ++ f=`echo $$p1|sed 's/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ +@@ -231,7 +231,7 @@ + uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ +- f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ ++ f=`echo $$p|sed 's/$(EXEEXT)$$//;s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done diff --git a/emulators/generator/files/patch-main-ui-gtk.c b/emulators/generator/files/patch-main-ui-gtk.c new file mode 100644 index 000000000000..3465f38c47d3 --- /dev/null +++ b/emulators/generator/files/patch-main-ui-gtk.c @@ -0,0 +1,136 @@ +--- main/ui-gtk.c.orig Sun Oct 14 18:02:05 2001 ++++ main/ui-gtk.c Mon Apr 7 01:40:55 2003 +@@ -18,7 +18,8 @@ + /* need Xlib.h for XAutoRepeatOff - how poo is X */ + #include "X11/Xlib.h" + +-#include "SDL.h" ++#include ++#include + + #include "generator.h" + #include "snprintf.h" +@@ -98,6 +99,8 @@ + static int ui_query_response = -1; /* query response */ + t_gtkkeys ui_cont[2]; /* keyboard key codes */ + static int ui_musicfile = -1; /* fd of output file for GYM/GNM logging */ ++static int ui_joysticks = 0; /* number of joysticks */ ++static SDL_Joystick *js_handle[2] = { NULL, NULL }; + + static enum { + SCREEN_100, SCREEN_200, SCREEN_FULL +@@ -120,6 +123,7 @@ + static int ui_gtk_query(const char *msg, int style); + static void ui_gtk_opts_to_menu(void); + static void ui_simpleplot(void); ++static void ui_sdl_events (void); + + /*** Program entry point ***/ + +@@ -129,6 +133,8 @@ + GtkWidget *button, *draw, *obj; + struct passwd *passwd; + struct stat statbuf; ++ int i; ++ const char *name; + + gtk_set_locale(); + gtk_init(&argc, &argv); +@@ -209,10 +215,21 @@ + GDK_WINDOW_XWINDOW(draw->window)); + putenv(SDL_windowhack); + } +- if (SDL_Init(SDL_INIT_VIDEO) < 0) { ++ if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0) { + fprintf(stderr, "Couldn't initialise SDL: %s\n", SDL_GetError()); + return -1; + } ++ ui_joysticks = SDL_NumJoysticks(); ++ /* Print information about the joysticks */ ++ fprintf(stderr, "%d joysticks detected\n", ui_joysticks); ++ for (i = 0; i < ui_joysticks; ++i) { ++ name = SDL_JoystickName(i); ++ fprintf(stderr, "Joystick %d: %s\n", i, name ? name : "Unknown Joystick"); ++ } ++ js_handle[0] = SDL_JoystickOpen(0); ++ js_handle[1] = SDL_JoystickOpen(1); ++ SDL_JoystickEventState(SDL_ENABLE); ++ + ui_gtk_sizechange(); + ui_gtk_newoptions(); + ui_gtk_opts_to_menu(); +@@ -264,9 +281,11 @@ + if (ui_running) { + while (gtk_events_pending()) + gtk_main_iteration_do(0); ++ ui_sdl_events(); + ui_newframe(); + event_doframe(); + } else { ++ ui_sdl_events(); + gtk_main(); + } + } +@@ -1529,6 +1548,62 @@ + } + } + } ++ ++static void ++ui_sdl_events (void) ++{ ++ SDL_Event event; ++ ++#define LEFT(event) ((event.jaxis.value < -16384) ? 1 : 0) ++#define RIGHT(event) ((event.jaxis.value > 16384) ? 1 : 0) ++#define UP(event) ((event.jaxis.value < -16384) ? 1 : 0) ++#define DOWN(event) ((event.jaxis.value > 16384) ? 1 : 0) ++#define PRESS(event) ((event.type == SDL_JOYBUTTONDOWN) ? 1 : 0) ++ ++ while (SDL_PollEvent(&event)) { ++ switch (event.type) { ++ case SDL_JOYAXISMOTION: ++ if (event.jaxis.which > 1) ++ break; ++ switch (event.jaxis.axis) { ++ case 0: /* left & right */ ++ mem68k_cont[event.jaxis.which].left = LEFT(event); ++ mem68k_cont[event.jaxis.which].right = RIGHT(event); ++ break; ++ case 1: /* up & down */ ++ mem68k_cont[event.jaxis.which].up = UP(event); ++ mem68k_cont[event.jaxis.which].down = DOWN(event); ++ break; ++ default: ++ break; ++ } ++ break; ++ case SDL_JOYBUTTONDOWN: ++ case SDL_JOYBUTTONUP: ++ if (event.jbutton.which > 1) ++ break; ++ switch (event.jbutton.button) { ++ case 0: ++ mem68k_cont[event.jbutton.which].a = PRESS(event); ++ break; ++ case 1: ++ mem68k_cont[event.jbutton.which].b = PRESS(event); ++ break; ++ case 2: ++ mem68k_cont[event.jbutton.which].c = PRESS(event); ++ break; ++ case 3: ++ mem68k_cont[event.jbutton.which].start = PRESS(event); ++ break; ++ default: ++ break; ++ } ++ break; ++ default: ++ break; ++ } ++ } ++} + + void ui_gtk_mainenter(void) + { -- cgit v1.2.3