From: <pa...@us...> - 2013-02-25 22:21:03
|
Revision: 4898 http://sourceforge.net/p/fuse-emulator/code/4898 Author: pak21 Date: 2013-02-25 22:20:54 +0000 (Mon, 25 Feb 2013) Log Message: ----------- Improve SpeccyBoot behaviour on non-Linux systems and when ROM is not available (patch #302) (Sergio). Modified Paths: -------------- trunk/fuse/compat/amiga/Makefile.am trunk/fuse/compat/linux/Makefile.am trunk/fuse/compat/morphos/Makefile.am trunk/fuse/compat/unix/Makefile.am trunk/fuse/compat/unix/tuntap.c trunk/fuse/compat/wii/Makefile.am trunk/fuse/compat/win32/Makefile.am trunk/fuse/configure.ac trunk/fuse/hacking/ChangeLog trunk/fuse/peripherals/nic/Makefile.am trunk/fuse/peripherals/speccyboot.c trunk/fuse/ui/options.dat Modified: trunk/fuse/compat/amiga/Makefile.am =================================================================== --- trunk/fuse/compat/amiga/Makefile.am 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/compat/amiga/Makefile.am 2013-02-25 22:20:54 UTC (rev 4898) @@ -31,8 +31,11 @@ ../unix/file.c \ osname.c \ paths.c \ - ../unix/timer.c \ - ../unix/tuntap.c + ../unix/timer.c +if HAVE_TUNTAP +libcompatos_a_SOURCES += ../unix/tuntap.c +endif + AM_CPPFLAGS += @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ \ -DFUSEDATADIR="\"${pkgdatadir}\"" Modified: trunk/fuse/compat/linux/Makefile.am =================================================================== --- trunk/fuse/compat/linux/Makefile.am 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/compat/linux/Makefile.am 2013-02-25 22:20:54 UTC (rev 4898) @@ -31,12 +31,15 @@ ../unix/file.c \ ../unix/osname.c \ paths.c \ - ../unix/timer.c \ - ../unix/tuntap.c + ../unix/timer.c if HAVE_SOCKETS libcompatos_a_SOURCES += ../unix/socket.c endif +if HAVE_TUNTAP +libcompatos_a_SOURCES += ../unix/tuntap.c +endif + AM_CPPFLAGS += @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ \ -DFUSEDATADIR="\"${pkgdatadir}\"" Modified: trunk/fuse/compat/morphos/Makefile.am =================================================================== --- trunk/fuse/compat/morphos/Makefile.am 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/compat/morphos/Makefile.am 2013-02-25 22:20:54 UTC (rev 4898) @@ -31,7 +31,10 @@ ../unix/file.c \ osname.c \ ../amiga/paths.c \ - ../unix/timer.c \ - ../unix/tuntap.c + ../unix/timer.c +if HAVE_TUNTAP +libcompatos_a_SOURCES += ../unix/tuntap.c +endif + AM_CPPFLAGS += @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ Modified: trunk/fuse/compat/unix/Makefile.am =================================================================== --- trunk/fuse/compat/unix/Makefile.am 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/compat/unix/Makefile.am 2013-02-25 22:20:54 UTC (rev 4898) @@ -31,12 +31,15 @@ file.c \ osname.c \ paths.c \ - timer.c \ - tuntap.c + timer.c if HAVE_SOCKETS libcompatos_a_SOURCES += socket.c endif +if HAVE_TUNTAP +libcompatos_a_SOURCES += tuntap.c +endif + AM_CPPFLAGS += @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ \ -DFUSEDATADIR="\"${pkgdatadir}\"" Modified: trunk/fuse/compat/unix/tuntap.c =================================================================== --- trunk/fuse/compat/unix/tuntap.c 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/compat/unix/tuntap.c 2013-02-25 22:20:54 UTC (rev 4898) @@ -30,11 +30,9 @@ #include <sys/types.h> #include <sys/stat.h> -#ifdef LINUX_TAP #include <linux/if_tun.h> #include <net/if.h> #include <sys/ioctl.h> -#endif /* #ifdef LINUX_TAP */ #include "ui/ui.h" @@ -43,8 +41,6 @@ { int fd = -1; -#ifdef LINUX_TAP - if ( (fd = open( "/dev/net/tun", O_RDWR | O_NONBLOCK )) < 0 ) ui_error( UI_ERROR_ERROR, "couldn't open TUN/TAP device '/dev/net/tun'" ); else { @@ -59,12 +55,5 @@ } } -#else - - ui_error( UI_ERROR_ERROR, - "TUN/TAP not yet supported for this operating system" ); - -#endif /* #ifdef LINUX_TAP */ - return fd; } Modified: trunk/fuse/compat/wii/Makefile.am =================================================================== --- trunk/fuse/compat/wii/Makefile.am 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/compat/wii/Makefile.am 2013-02-25 22:20:54 UTC (rev 4898) @@ -31,7 +31,10 @@ ../unix/file.c \ osname.c \ paths.c \ - timer.c \ - ../unix/tuntap.c + timer.c +if HAVE_TUNTAP +libcompatos_a_SOURCES += ../unix/tuntap.c +endif + AM_CPPFLAGS += @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ Modified: trunk/fuse/compat/win32/Makefile.am =================================================================== --- trunk/fuse/compat/win32/Makefile.am 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/compat/win32/Makefile.am 2013-02-25 22:20:54 UTC (rev 4898) @@ -31,8 +31,7 @@ ../unix/file.c \ osname.c \ paths.c \ - timer.c \ - ../unix/tuntap.c + timer.c if HAVE_SOCKETS libcompatos_a_SOURCES += socket.c Modified: trunk/fuse/configure.ac =================================================================== --- trunk/fuse/configure.ac 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/configure.ac 2013-02-25 22:20:54 UTC (rev 4898) @@ -763,11 +763,14 @@ int test2 = TUNSETIFF; ]]) ], - [AC_DEFINE([LINUX_TAP], 1, [Define to 1 if Linux TAP devices are supported.]) + [AC_DEFINE([BUILD_SPECCYBOOT], 1, [Define to 1 if SpeccyBoot is supported.]) + linux_tap=yes AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)] ) CPPFLAGS="$ac_save_CPPFLAGS" +AM_CONDITIONAL(HAVE_TUNTAP, test x$linux_tap != x) +AM_CONDITIONAL(BUILD_SPECCYBOOT, test x$linux_tap != x) dnl Work out which standard routines we're missing AC_MSG_CHECKING(which standard routines we're missing) Modified: trunk/fuse/hacking/ChangeLog =================================================================== --- trunk/fuse/hacking/ChangeLog 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/hacking/ChangeLog 2013-02-25 22:20:54 UTC (rev 4898) @@ -4403,7 +4403,7 @@ 20130212 peripherals/disk/{disciple.c,opus.c,plusd.c}: revert further changes made when reverting the fix to bug #273, causing the Opus Discovery to be left paged in after a reset and +D/DISCiPLE to be left paged in - if loading of the interface's ROM fails (bug #284) Stuart). + if loading of the interface's ROM fails (bug #284) (Stuart). 20130212 ChangeLog: document limitations of the DISCiPLE emulation (bug #285) (Stuart). 20130216 compat/win32/paths.c,keysyms.pl,man/fuse.1,sound/blipbuffer.[ch], @@ -4419,3 +4419,8 @@ functions to {disciple,plusd}_patch_{read,write} (from *_mem_*) to follow MGT terminology (Stuart). 20130223 man/fuse.1: improve NMI documentation for +D and DISCiPLE (Stuart). +20130225 compat/{win32/Makefile.am,unix/{Makefile.am,tuntap.c}, + morphos/Makefile.am,wii/Makefile.am,amiga/Makefile.am, + linux/Makefile.am},configure.ac,peripherals/{speccyboot.c, + nic/Makefile.am}: improve SpeccyBoot behaviour on non-Linux systems + and when ROM is not available (patch #302) (Sergio). Modified: trunk/fuse/peripherals/nic/Makefile.am =================================================================== --- trunk/fuse/peripherals/nic/Makefile.am 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/peripherals/nic/Makefile.am 2013-02-25 22:20:54 UTC (rev 4898) @@ -29,9 +29,12 @@ AM_CPPFLAGS += @LIBSPEC_CFLAGS@ @GLIB_CFLAGS@ @GTK_CFLAGS@ -libnic_a_SOURCES = \ - enc28j60.c +libnic_a_SOURCES = +if BUILD_SPECCYBOOT +libnic_a_SOURCES += enc28j60.c +endif + if BUILD_SPECTRANET libnic_a_SOURCES += w5100.c \ w5100_socket.c Modified: trunk/fuse/peripherals/speccyboot.c =================================================================== --- trunk/fuse/peripherals/speccyboot.c 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/peripherals/speccyboot.c 2013-02-25 22:20:54 UTC (rev 4898) @@ -38,6 +38,8 @@ #include "speccyboot.h" +#ifdef BUILD_SPECCYBOOT + /* Determine whether a bit has gone from high to low (or low to high) */ #define GONE_LO(prev, curr, mask) (((prev) & (mask)) && !((curr) & (mask))) #define GONE_HI(prev, curr, mask) (((curr) & (mask)) && !((prev) & (mask))) @@ -96,6 +98,11 @@ { static int tap_opened = 0; + speccyboot_rom_active = 0; + + if( !periph_is_active( PERIPH_TYPE_SPECCYBOOT ) ) + return; + if( machine_load_rom_bank( speccyboot_memory_map_romcs, 0, settings_current.rom_speccyboot, settings_default.rom_speccyboot, 0x2000 ) ) @@ -103,8 +110,7 @@ out_register_state = 0xff; /* force transitions to low */ - if( periph_is_active( PERIPH_TYPE_SPECCYBOOT ) ) - speccyboot_register_write( 0, 0 ); + speccyboot_register_write( 0, 0 ); /* * Open TAP. If this fails, SpeccyBoot emulation won't work. @@ -113,7 +119,7 @@ * error messages are only displayed if SpeccyBoot emulation is * actually requested. */ - if( periph_is_active( PERIPH_TYPE_SPECCYBOOT ) && !tap_opened ) { + if( !tap_opened ) { nic_enc28j60_init( nic ); tap_opened = 1; } @@ -225,3 +231,25 @@ return r; } + +#else /* #ifdef BUILD_SPECCYBOOT */ + +/* No speccyboot support */ + +void +speccyboot_init( void ) +{ +} + +void +speccyboot_end( void ) +{ +} + +int +speccyboot_unittest( void ) +{ + return 0; +} + +#endif /* #ifdef BUILD_SPECCYBOOT */ Modified: trunk/fuse/ui/options.dat =================================================================== --- trunk/fuse/ui/options.dat 2013-02-24 19:40:51 UTC (rev 4897) +++ trunk/fuse/ui/options.dat 2013-02-25 22:20:54 UTC (rev 4898) @@ -38,7 +38,9 @@ Checkbox, In(t)erface 2, interface2, INPUT_KEY_t Checkbox, Emulate (p)rinters, printer, INPUT_KEY_p Checkbox, (Z)X Printer, zxprinter, INPUT_KEY_z +#ifdef BUILD_SPECCYBOOT Checkbox, Speccy(B)oot interface, speccyboot, INPUT_KEY_b +#endif Checkbox, Spec(D)rum interface, specdrum, INPUT_KEY_d #ifdef BUILD_SPECTRANET Checkbox, Spectra(n)et, spectranet, INPUT_KEY_n This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |