From 79d6017866067064ba712bf6b913b59695d44a06 Mon Sep 17 00:00:00 2001 From: Adam Weinberger Date: Mon, 28 Jul 2014 18:39:29 +0000 Subject: Rename emulators/ patch-xy patches to reflect the files they modify. --- emulators/aftp/files/patch-Makefile | 37 ++ emulators/aftp/files/patch-aa | 37 -- emulators/aftp/files/patch-ab | 108 ----- emulators/aftp/files/patch-aftp.c | 108 +++++ emulators/bsvc/Makefile | 2 +- .../files/patch-Tools__xtermpipe__xtermpipe.cxx_2 | 11 + emulators/bsvc/files/patch-UI__Makefile | 48 +++ emulators/bsvc/files/patch-af | 48 --- emulators/bsvc/files/patch-ag | 11 - emulators/bsvc/files/patch-ah | 11 - emulators/bsvc/files/patch-ai | 11 - emulators/bsvc/files/patch-sim68300__cpu__Makefile | 11 + emulators/bsvc/files/patch-sim68360__cpu__Makefile | 11 + emulators/cpmemu/files/patch-Makefile | 53 +++ emulators/cpmemu/files/patch-ab | 53 --- emulators/cpmemu/files/patch-ac | 11 - emulators/cpmemu/files/patch-ad | 11 - emulators/cpmemu/files/patch-ae | 26 -- emulators/cpmemu/files/patch-bios.c | 11 + emulators/cpmemu/files/patch-io.c | 11 + emulators/cpmemu/files/patch-low.c | 26 ++ emulators/darcnes/files/patch-Makefile | 51 +++ emulators/darcnes/files/patch-aa | 11 - emulators/darcnes/files/patch-ab | 51 --- emulators/darcnes/files/patch-snd_unix.c | 11 + emulators/gbe/files/patch-Makefile | 58 +++ emulators/gbe/files/patch-aa | 58 --- emulators/gbe/files/patch-ab | 10 - emulators/gbe/files/patch-vram.c | 10 + emulators/gxemul/files/patch-aa | 32 -- emulators/gxemul/files/patch-ab | 11 - .../gxemul/files/patch-src_devices_dev_wdc.cc | 32 ++ .../gxemul/files/patch-src_include_refcount_ptr.h | 11 + emulators/klh10/files/patch-aa | 12 - emulators/klh10/files/patch-ab | 25 -- emulators/klh10/files/patch-src_Mk-fbx86.mk | 12 + emulators/klh10/files/patch-src_vmtape.c | 25 ++ emulators/qemu-devel/files/patch-bf | 37 -- emulators/qemu-devel/files/patch-bg | 24 -- .../qemu-devel/files/patch-qemu-include-net-net.h | 24 ++ .../files/patch-qemu-slirp-slirp_config.h | 37 ++ emulators/qemu/files/patch-ac | 10 - emulators/qemu/files/patch-bd | 10 - emulators/qemu/files/patch-bf | 37 -- emulators/qemu/files/patch-bg | 36 -- emulators/qemu/files/patch-bt | 109 ----- emulators/qemu/files/patch-qemu_Makefiles | 36 ++ emulators/qemu/files/patch-qemu_configure_1 | 10 + emulators/qemu/files/patch-qemu_configure_2 | 10 + emulators/qemu/files/patch-qemu_net.c | 109 +++++ .../qemu/files/patch-qemu_slirp_slirp_config.h | 37 ++ emulators/sim6811/files/patch-ab | 76 ---- emulators/sim6811/files/patch-ac | 37 -- emulators/sim6811/files/patch-main.c | 37 ++ emulators/sim6811/files/patch-sim6811.1 | 76 ++++ emulators/snes9x/files/patch-ad | 29 -- emulators/snes9x/files/patch-ae | 13 - emulators/snes9x/files/patch-af | 455 --------------------- emulators/snes9x/files/patch-ag | 32 -- emulators/snes9x/files/patch-ah | 24 -- emulators/snes9x/files/patch-memmap.cpp | 29 ++ emulators/snes9x/files/patch-port.h | 13 + emulators/snes9x/files/patch-unix_unix.cpp | 455 +++++++++++++++++++++ emulators/snes9x/files/patch-unix_xf86.cpp | 32 ++ emulators/snes9x/files/patch-unzip_unzip.h | 24 ++ emulators/vice/files/patch-ab | 12 - emulators/vice/files/patch-ac | 11 - emulators/vice/files/patch-man_c1541.1 | 12 + emulators/vice/files/patch-man_vice.1 | 11 + 69 files changed, 1490 insertions(+), 1490 deletions(-) create mode 100644 emulators/aftp/files/patch-Makefile delete mode 100644 emulators/aftp/files/patch-aa delete mode 100644 emulators/aftp/files/patch-ab create mode 100644 emulators/aftp/files/patch-aftp.c create mode 100644 emulators/bsvc/files/patch-Tools__xtermpipe__xtermpipe.cxx_2 create mode 100644 emulators/bsvc/files/patch-UI__Makefile delete mode 100644 emulators/bsvc/files/patch-af delete mode 100644 emulators/bsvc/files/patch-ag delete mode 100644 emulators/bsvc/files/patch-ah delete mode 100644 emulators/bsvc/files/patch-ai create mode 100644 emulators/bsvc/files/patch-sim68300__cpu__Makefile create mode 100644 emulators/bsvc/files/patch-sim68360__cpu__Makefile create mode 100644 emulators/cpmemu/files/patch-Makefile delete mode 100644 emulators/cpmemu/files/patch-ab delete mode 100644 emulators/cpmemu/files/patch-ac delete mode 100644 emulators/cpmemu/files/patch-ad delete mode 100644 emulators/cpmemu/files/patch-ae create mode 100644 emulators/cpmemu/files/patch-bios.c create mode 100644 emulators/cpmemu/files/patch-io.c create mode 100644 emulators/cpmemu/files/patch-low.c create mode 100644 emulators/darcnes/files/patch-Makefile delete mode 100644 emulators/darcnes/files/patch-aa delete mode 100644 emulators/darcnes/files/patch-ab create mode 100644 emulators/darcnes/files/patch-snd_unix.c create mode 100644 emulators/gbe/files/patch-Makefile delete mode 100644 emulators/gbe/files/patch-aa delete mode 100644 emulators/gbe/files/patch-ab create mode 100644 emulators/gbe/files/patch-vram.c delete mode 100644 emulators/gxemul/files/patch-aa delete mode 100644 emulators/gxemul/files/patch-ab create mode 100644 emulators/gxemul/files/patch-src_devices_dev_wdc.cc create mode 100644 emulators/gxemul/files/patch-src_include_refcount_ptr.h delete mode 100644 emulators/klh10/files/patch-aa delete mode 100644 emulators/klh10/files/patch-ab create mode 100644 emulators/klh10/files/patch-src_Mk-fbx86.mk create mode 100644 emulators/klh10/files/patch-src_vmtape.c delete mode 100644 emulators/qemu-devel/files/patch-bf delete mode 100644 emulators/qemu-devel/files/patch-bg create mode 100644 emulators/qemu-devel/files/patch-qemu-include-net-net.h create mode 100644 emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h delete mode 100644 emulators/qemu/files/patch-ac delete mode 100644 emulators/qemu/files/patch-bd delete mode 100644 emulators/qemu/files/patch-bf delete mode 100644 emulators/qemu/files/patch-bg delete mode 100644 emulators/qemu/files/patch-bt create mode 100644 emulators/qemu/files/patch-qemu_Makefiles create mode 100644 emulators/qemu/files/patch-qemu_configure_1 create mode 100644 emulators/qemu/files/patch-qemu_configure_2 create mode 100644 emulators/qemu/files/patch-qemu_net.c create mode 100644 emulators/qemu/files/patch-qemu_slirp_slirp_config.h delete mode 100644 emulators/sim6811/files/patch-ab delete mode 100644 emulators/sim6811/files/patch-ac create mode 100644 emulators/sim6811/files/patch-main.c create mode 100644 emulators/sim6811/files/patch-sim6811.1 delete mode 100644 emulators/snes9x/files/patch-ad delete mode 100644 emulators/snes9x/files/patch-ae delete mode 100644 emulators/snes9x/files/patch-af delete mode 100644 emulators/snes9x/files/patch-ag delete mode 100644 emulators/snes9x/files/patch-ah create mode 100644 emulators/snes9x/files/patch-memmap.cpp create mode 100644 emulators/snes9x/files/patch-port.h create mode 100644 emulators/snes9x/files/patch-unix_unix.cpp create mode 100644 emulators/snes9x/files/patch-unix_xf86.cpp create mode 100644 emulators/snes9x/files/patch-unzip_unzip.h delete mode 100644 emulators/vice/files/patch-ab delete mode 100644 emulators/vice/files/patch-ac create mode 100644 emulators/vice/files/patch-man_c1541.1 create mode 100644 emulators/vice/files/patch-man_vice.1 (limited to 'emulators') diff --git a/emulators/aftp/files/patch-Makefile b/emulators/aftp/files/patch-Makefile new file mode 100644 index 000000000000..74c0c99fd44a --- /dev/null +++ b/emulators/aftp/files/patch-Makefile @@ -0,0 +1,37 @@ +*** Makefile.orig Tue Jan 7 04:58:59 1997 +--- Makefile Sun May 18 01:48:32 1997 +*************** +*** 1,11 **** + +! OBJS=aftp.o pro.o dos.o + + aftp: $(OBJS) +! gcc -o aftp $(OBJS) + + .c.o: +! gcc -c $< + + clean: + rm -f $(OBJS) aftp +--- 1,23 ---- ++ # AFTP Version 1.0 ++ # Makefile updated 20th Jan, 1996 + +! OBJS= aftp.o pro.o dos.o +! #CC_OPTS= -DDIRECTORY_COMMANDS +! CC= gcc ${CC_OPTS} +! PREFIX?= /usr/local +! +! all: aftp + + aftp: $(OBJS) +! ${CC} -o aftp $(OBJS) + + .c.o: +! ${CC} -c ${CFLAGS} $< +! +! install: all +! ${BSD_INSTALL_PROGRAM} aftp ${DESTDIR}${PREFIX}/bin + + clean: + rm -f $(OBJS) aftp diff --git a/emulators/aftp/files/patch-aa b/emulators/aftp/files/patch-aa deleted file mode 100644 index 74c0c99fd44a..000000000000 --- a/emulators/aftp/files/patch-aa +++ /dev/null @@ -1,37 +0,0 @@ -*** Makefile.orig Tue Jan 7 04:58:59 1997 ---- Makefile Sun May 18 01:48:32 1997 -*************** -*** 1,11 **** - -! OBJS=aftp.o pro.o dos.o - - aftp: $(OBJS) -! gcc -o aftp $(OBJS) - - .c.o: -! gcc -c $< - - clean: - rm -f $(OBJS) aftp ---- 1,23 ---- -+ # AFTP Version 1.0 -+ # Makefile updated 20th Jan, 1996 - -! OBJS= aftp.o pro.o dos.o -! #CC_OPTS= -DDIRECTORY_COMMANDS -! CC= gcc ${CC_OPTS} -! PREFIX?= /usr/local -! -! all: aftp - - aftp: $(OBJS) -! ${CC} -o aftp $(OBJS) - - .c.o: -! ${CC} -c ${CFLAGS} $< -! -! install: all -! ${BSD_INSTALL_PROGRAM} aftp ${DESTDIR}${PREFIX}/bin - - clean: - rm -f $(OBJS) aftp diff --git a/emulators/aftp/files/patch-ab b/emulators/aftp/files/patch-ab deleted file mode 100644 index 061e93a29129..000000000000 --- a/emulators/aftp/files/patch-ab +++ /dev/null @@ -1,108 +0,0 @@ -diff -rc aftp/aftp.c aftp-1.01a/aftp.c -*** aftp.c Mon Jan 6 22:19:13 1997 ---- aftp.c Tue Jan 21 00:49:56 1997 -*************** -*** 283,299 **** - - static void print_help(void) - { -! printf("Command:\n"); -! printf(" aftp [options] {input_disk_files}\n"); - printf("Options:\n"); - printf(" -p use a (P)rodos filesystem.\n"); - printf(" -o use a prodos (O)rdered image.\n"); - printf(" -i use an xgs image file.\n"); -! printf(" -d Load images as read-only.\n"); - printf(" -? Display aftp help.\n"); -- printf("Summary:\n"); -- printf(" Ftp like interface to dsk, do, po, and img files.\n"); -- printf(" Defaults to Dos 3.3 filesystem on a dsk disk.\n"); - exit(1); - } - ---- 283,296 ---- - - static void print_help(void) - { -! printf("useage:\n"); -! printf(" aftp [options] \n"); - printf("Options:\n"); - printf(" -p use a (P)rodos filesystem.\n"); - printf(" -o use a prodos (O)rdered image.\n"); - printf(" -i use an xgs image file.\n"); -! printf(" -r Load images as read-only.\n"); - printf(" -? Display aftp help.\n"); - exit(1); - } - -*************** -*** 327,332 **** ---- 324,330 ---- - read_only = !read_only; - break; - case '?': -+ case 'h': - print_help(); - break; - default: -*************** -*** 373,378 **** ---- 371,377 ---- - ; - *p = '\0'; - system(cmd + 1); -+ printf("\n") ; - continue; - } - for (; *p && !isspace(*p); p++) -*************** -*** 386,392 **** - *p = '\0'; - if (!*cmd) - continue; -! if (!strcmp(cmd, "dir")) - { - strcpy(remot, arg); - (*d->os->name)(remot, sizeof(remot)); ---- 385,391 ---- - *p = '\0'; - if (!*cmd) - continue; -! if (!strcmp(cmd, "dir") || !strcmp(cmd, "ls")) - { - strcpy(remot, arg); - (*d->os->name)(remot, sizeof(remot)); -*************** -*** 503,508 **** ---- 502,508 ---- - else if (!strcmp(cmd, "help") || !strcmp(cmd, "?")) - { - printf("dir Display disk image directory.\n"); -+ printf("ls Alias for the dir command.\n"); - printf("get [file] Get a file from disk image.\n"); - printf("put [file] Put a file on disk image.\n"); - printf("del [file] Delete a file from disk image.\n"); -*************** -*** 511,520 **** - printf("mkdir [dir] Create a disk image directory.\n"); - printf("rmdir [dir] Remove a disk image directory.\n"); - #endif - printf("text Set text mode.\n"); - printf("binary Set binary mode.\n"); - printf("help Display help.\n"); -! printf("!dos command Execute a dos command.\n"); - printf("quit Quit Program.\n"); - } - else ---- 511,521 ---- - printf("mkdir [dir] Create a disk image directory.\n"); - printf("rmdir [dir] Remove a disk image directory.\n"); - #endif -+ printf("dump Display a hex dump of the disk image.\n") ; - printf("text Set text mode.\n"); - printf("binary Set binary mode.\n"); - printf("help Display help.\n"); -! printf("!command Shell escape.\n"); - printf("quit Quit Program.\n"); - } - else diff --git a/emulators/aftp/files/patch-aftp.c b/emulators/aftp/files/patch-aftp.c new file mode 100644 index 000000000000..061e93a29129 --- /dev/null +++ b/emulators/aftp/files/patch-aftp.c @@ -0,0 +1,108 @@ +diff -rc aftp/aftp.c aftp-1.01a/aftp.c +*** aftp.c Mon Jan 6 22:19:13 1997 +--- aftp.c Tue Jan 21 00:49:56 1997 +*************** +*** 283,299 **** + + static void print_help(void) + { +! printf("Command:\n"); +! printf(" aftp [options] {input_disk_files}\n"); + printf("Options:\n"); + printf(" -p use a (P)rodos filesystem.\n"); + printf(" -o use a prodos (O)rdered image.\n"); + printf(" -i use an xgs image file.\n"); +! printf(" -d Load images as read-only.\n"); + printf(" -? Display aftp help.\n"); +- printf("Summary:\n"); +- printf(" Ftp like interface to dsk, do, po, and img files.\n"); +- printf(" Defaults to Dos 3.3 filesystem on a dsk disk.\n"); + exit(1); + } + +--- 283,296 ---- + + static void print_help(void) + { +! printf("useage:\n"); +! printf(" aftp [options] \n"); + printf("Options:\n"); + printf(" -p use a (P)rodos filesystem.\n"); + printf(" -o use a prodos (O)rdered image.\n"); + printf(" -i use an xgs image file.\n"); +! printf(" -r Load images as read-only.\n"); + printf(" -? Display aftp help.\n"); + exit(1); + } + +*************** +*** 327,332 **** +--- 324,330 ---- + read_only = !read_only; + break; + case '?': ++ case 'h': + print_help(); + break; + default: +*************** +*** 373,378 **** +--- 371,377 ---- + ; + *p = '\0'; + system(cmd + 1); ++ printf("\n") ; + continue; + } + for (; *p && !isspace(*p); p++) +*************** +*** 386,392 **** + *p = '\0'; + if (!*cmd) + continue; +! if (!strcmp(cmd, "dir")) + { + strcpy(remot, arg); + (*d->os->name)(remot, sizeof(remot)); +--- 385,391 ---- + *p = '\0'; + if (!*cmd) + continue; +! if (!strcmp(cmd, "dir") || !strcmp(cmd, "ls")) + { + strcpy(remot, arg); + (*d->os->name)(remot, sizeof(remot)); +*************** +*** 503,508 **** +--- 502,508 ---- + else if (!strcmp(cmd, "help") || !strcmp(cmd, "?")) + { + printf("dir Display disk image directory.\n"); ++ printf("ls Alias for the dir command.\n"); + printf("get [file] Get a file from disk image.\n"); + printf("put [file] Put a file on disk image.\n"); + printf("del [file] Delete a file from disk image.\n"); +*************** +*** 511,520 **** + printf("mkdir [dir] Create a disk image directory.\n"); + printf("rmdir [dir] Remove a disk image directory.\n"); + #endif + printf("text Set text mode.\n"); + printf("binary Set binary mode.\n"); + printf("help Display help.\n"); +! printf("!dos command Execute a dos command.\n"); + printf("quit Quit Program.\n"); + } + else +--- 511,521 ---- + printf("mkdir [dir] Create a disk image directory.\n"); + printf("rmdir [dir] Remove a disk image directory.\n"); + #endif ++ printf("dump Display a hex dump of the disk image.\n") ; + printf("text Set text mode.\n"); + printf("binary Set binary mode.\n"); + printf("help Display help.\n"); +! printf("!command Shell escape.\n"); + printf("quit Quit Program.\n"); + } + else diff --git a/emulators/bsvc/Makefile b/emulators/bsvc/Makefile index 567512512094..02aa0682570c 100644 --- a/emulators/bsvc/Makefile +++ b/emulators/bsvc/Makefile @@ -15,7 +15,7 @@ COMMENT= Extensible hardware simulation framework with MC68K support WRKSRC= ${WRKDIR}/${DISTNAME}/src MAKE_ENV= PROJECT_BASE=${STAGEDIR}${PREFIX} WRKSRC=${WRKSRC} WISH=${WISH} -USES+= tk +USES= tk MAKE_JOBS_UNSAFE= yes pre-patch: diff --git a/emulators/bsvc/files/patch-Tools__xtermpipe__xtermpipe.cxx_2 b/emulators/bsvc/files/patch-Tools__xtermpipe__xtermpipe.cxx_2 new file mode 100644 index 000000000000..fb1d941727ba --- /dev/null +++ b/emulators/bsvc/files/patch-Tools__xtermpipe__xtermpipe.cxx_2 @@ -0,0 +1,11 @@ +--- Tools/xtermpipe/xtermpipe.cxx.orig Mon Nov 9 12:39:28 1998 ++++ Tools/xtermpipe/xtermpipe.cxx Sat Feb 12 11:02:02 2000 +@@ -31,7 +31,7 @@ + select(pipe_id + 1, (int*)&readfds, (int*)&writefds, (int*)&exceptfds, + (void*)0); + # else +- select(pipe_id + 1, &readfds, &writefds, &exceptfds, (void*)0); ++ select(pipe_id + 1, &readfds, &writefds, &exceptfds, (struct timeval*)0); + # endif + + if(FD_ISSET(0, &readfds)) diff --git a/emulators/bsvc/files/patch-UI__Makefile b/emulators/bsvc/files/patch-UI__Makefile new file mode 100644 index 000000000000..68e06e9f09d3 --- /dev/null +++ b/emulators/bsvc/files/patch-UI__Makefile @@ -0,0 +1,48 @@ +--- UI/Makefile.orig 1998-11-09 04:39:29.000000000 +0100 ++++ UI/Makefile 2013-11-05 17:30:19.000000000 +0100 +@@ -20,31 +20,31 @@ + echo '# export TCL_LIBRARY TK_LIBRARY' >> bsvc + echo 'ARGS=$$*' >> bsvc + echo 'export ARGS' >> bsvc +- echo 'exec $(WISH) -f $(INSTALL_DIR)/UI/bsvc.tk' >> bsvc ++ echo 'exec $(WISH) -f $(PREFIX)/lib/bsvc/bsvc.tk' >> bsvc + chmod +x bsvc + + bsvc.tk: Makefile + echo '#!$(WISH) -f' > bsvc.tk +- echo 'set Program(InstallDir) $(INSTALL_DIR)' >> bsvc.tk +- echo 'set Program(BitmapDir) $$Program(InstallDir)/UI/bitmaps' >> bsvc.tk +- echo 'set Program(HelpDir) $$Program(InstallDir)/UI/help' >> bsvc.tk +- echo 'set Program(LibDir) $$Program(InstallDir)/UI' >> bsvc.tk ++ echo 'set Program(InstallDir) $(PREFIX)' >> bsvc.tk ++ echo 'set Program(BitmapDir) $(PREFIX)/lib/bsvc/bitmaps' >> bsvc.tk ++ echo 'set Program(HelpDir) $(PREFIX)/lib/bsvc/help' >> bsvc.tk ++ echo 'set Program(LibDir) $(PREFIX)/lib/bsvc' >> bsvc.tk + echo 'set Program(WWWBrowser) "$(WWW_BROWSER)"' >> bsvc.tk + echo 'set Program(WWWHomePage) "$(WWW_HOME_PAGE)"' >> bsvc.tk + echo 'set Program(StopIndicator) C:\\BSVC\\bin\\STOP' >> bsvc.tk + echo 'if {$$tcl_version >= 7.5 && $$tcl_platform(platform) == "windows"} {' >> bsvc.tk +- echo ' option readfile $$Program(InstallDir)/UI/bsvc.win 40' >> bsvc.tk ++ echo ' option readfile $(PREFIX)/lib/bsvc/bsvc.win 40' >> bsvc.tk + echo '} else {' >> bsvc.tk +- echo ' option readfile $$Program(InstallDir)/UI/bsvc.ad 40' >> bsvc.tk ++ echo ' option readfile $(PREFIX)/lib/bsvc/bsvc.ad 40' >> bsvc.tk + echo '}' >> bsvc.tk +- echo 'source $$Program(InstallDir)/UI/main.tk' >> bsvc.tk ++ echo 'source $(PREFIX)/lib/bsvc/main.tk' >> bsvc.tk + + install: bsvc bsvc.tk +- $(MKDIR) $(INSTALL_DIR)/UI +- $(MKDIR) $(INSTALL_DIR)/UI/bitmaps +- $(MKDIR) $(INSTALL_DIR)/UI/help +- $(INSTALL) *.tk *.ad $(INSTALL_DIR)/UI +- $(INSTALL) bitmaps/* $(INSTALL_DIR)/UI/bitmaps +- $(INSTALL) help/* $(INSTALL_DIR)/UI/help ++ $(MKDIR) $(PROJECT_BASE)/lib/bsvc ++ $(MKDIR) $(PROJECT_BASE)/lib/bsvc/bitmaps ++ $(MKDIR) $(PROJECT_BASE)/lib/bsvc/help ++ $(INSTALL) *.tk *.ad $(PROJECT_BASE)/lib/bsvc ++ $(INSTALL) bitmaps/* $(PROJECT_BASE)/lib/bsvc/bitmaps ++ $(INSTALL) help/* $(PROJECT_BASE)/lib/bsvc/help + $(INSTALL) bsvc $(INSTALL_DIR) + diff --git a/emulators/bsvc/files/patch-af b/emulators/bsvc/files/patch-af deleted file mode 100644 index 68e06e9f09d3..000000000000 --- a/emulators/bsvc/files/patch-af +++ /dev/null @@ -1,48 +0,0 @@ ---- UI/Makefile.orig 1998-11-09 04:39:29.000000000 +0100 -+++ UI/Makefile 2013-11-05 17:30:19.000000000 +0100 -@@ -20,31 +20,31 @@ - echo '# export TCL_LIBRARY TK_LIBRARY' >> bsvc - echo 'ARGS=$$*' >> bsvc - echo 'export ARGS' >> bsvc -- echo 'exec $(WISH) -f $(INSTALL_DIR)/UI/bsvc.tk' >> bsvc -+ echo 'exec $(WISH) -f $(PREFIX)/lib/bsvc/bsvc.tk' >> bsvc - chmod +x bsvc - - bsvc.tk: Makefile - echo '#!$(WISH) -f' > bsvc.tk -- echo 'set Program(InstallDir) $(INSTALL_DIR)' >> bsvc.tk -- echo 'set Program(BitmapDir) $$Program(InstallDir)/UI/bitmaps' >> bsvc.tk -- echo 'set Program(HelpDir) $$Program(InstallDir)/UI/help' >> bsvc.tk -- echo 'set Program(LibDir) $$Program(InstallDir)/UI' >> bsvc.tk -+ echo 'set Program(InstallDir) $(PREFIX)' >> bsvc.tk -+ echo 'set Program(BitmapDir) $(PREFIX)/lib/bsvc/bitmaps' >> bsvc.tk -+ echo 'set Program(HelpDir) $(PREFIX)/lib/bsvc/help' >> bsvc.tk -+ echo 'set Program(LibDir) $(PREFIX)/lib/bsvc' >> bsvc.tk - echo 'set Program(WWWBrowser) "$(WWW_BROWSER)"' >> bsvc.tk - echo 'set Program(WWWHomePage) "$(WWW_HOME_PAGE)"' >> bsvc.tk - echo 'set Program(StopIndicator) C:\\BSVC\\bin\\STOP' >> bsvc.tk - echo 'if {$$tcl_version >= 7.5 && $$tcl_platform(platform) == "windows"} {' >> bsvc.tk -- echo ' option readfile $$Program(InstallDir)/UI/bsvc.win 40' >> bsvc.tk -+ echo ' option readfile $(PREFIX)/lib/bsvc/bsvc.win 40' >> bsvc.tk - echo '} else {' >> bsvc.tk -- echo ' option readfile $$Program(InstallDir)/UI/bsvc.ad 40' >> bsvc.tk -+ echo ' option readfile $(PREFIX)/lib/bsvc/bsvc.ad 40' >> bsvc.tk - echo '}' >> bsvc.tk -- echo 'source $$Program(InstallDir)/UI/main.tk' >> bsvc.tk -+ echo 'source $(PREFIX)/lib/bsvc/main.tk' >> bsvc.tk - - install: bsvc bsvc.tk -- $(MKDIR) $(INSTALL_DIR)/UI -- $(MKDIR) $(INSTALL_DIR)/UI/bitmaps -- $(MKDIR) $(INSTALL_DIR)/UI/help -- $(INSTALL) *.tk *.ad $(INSTALL_DIR)/UI -- $(INSTALL) bitmaps/* $(INSTALL_DIR)/UI/bitmaps -- $(INSTALL) help/* $(INSTALL_DIR)/UI/help -+ $(MKDIR) $(PROJECT_BASE)/lib/bsvc -+ $(MKDIR) $(PROJECT_BASE)/lib/bsvc/bitmaps -+ $(MKDIR) $(PROJECT_BASE)/lib/bsvc/help -+ $(INSTALL) *.tk *.ad $(PROJECT_BASE)/lib/bsvc -+ $(INSTALL) bitmaps/* $(PROJECT_BASE)/lib/bsvc/bitmaps -+ $(INSTALL) help/* $(PROJECT_BASE)/lib/bsvc/help - $(INSTALL) bsvc $(INSTALL_DIR) - diff --git a/emulators/bsvc/files/patch-ag b/emulators/bsvc/files/patch-ag deleted file mode 100644 index 719a3a5e0ded..000000000000 --- a/emulators/bsvc/files/patch-ag +++ /dev/null @@ -1,11 +0,0 @@ ---- sim68000/cpu/Makefile.orig Mon Sep 6 21:46:13 1999 -+++ sim68000/cpu/Makefile Mon Sep 6 21:46:36 1999 -@@ -28,7 +28,7 @@ - $(CC) $(INCLUDES) -o instruction instruction.c - - m68000DecodeTable.hxx: instruction instruction.list -- $(PROJECT_BASE)/src/sim68000/cpu/instruction -+ $(WRKSRC)/sim68000/cpu/instruction - - clean: - rm -f *.o $(LIBRARY) instruction diff --git a/emulators/bsvc/files/patch-ah b/emulators/bsvc/files/patch-ah deleted file mode 100644 index e24fb45bd13b..000000000000 --- a/emulators/bsvc/files/patch-ah +++ /dev/null @@ -1,11 +0,0 @@ ---- sim68360/cpu/Makefile.orig Mon Sep 6 21:47:20 1999 -+++ sim68360/cpu/Makefile Mon Sep 6 21:47:39 1999 -@@ -31,7 +31,7 @@ - $(CC) $(INCLUDES) -o instruction instruction.c - - cpu32DecodeTable.hxx: instruction instruction.list -- $(PROJECT_BASE)/src/sim68360/cpu/instruction -+ $(WRKSRC)/sim68360/cpu/instruction - - clean: - rm -f *.o $(LIBRARY) instruction diff --git a/emulators/bsvc/files/patch-ai b/emulators/bsvc/files/patch-ai deleted file mode 100644 index fb1d941727ba..000000000000 --- a/emulators/bsvc/files/patch-ai +++ /dev/null @@ -1,11 +0,0 @@ ---- Tools/xtermpipe/xtermpipe.cxx.orig Mon Nov 9 12:39:28 1998 -+++ Tools/xtermpipe/xtermpipe.cxx Sat Feb 12 11:02:02 2000 -@@ -31,7 +31,7 @@ - select(pipe_id + 1, (int*)&readfds, (int*)&writefds, (int*)&exceptfds, - (void*)0); - # else -- select(pipe_id + 1, &readfds, &writefds, &exceptfds, (void*)0); -+ select(pipe_id + 1, &readfds, &writefds, &exceptfds, (struct timeval*)0); - # endif - - if(FD_ISSET(0, &readfds)) diff --git a/emulators/bsvc/files/patch-sim68300__cpu__Makefile b/emulators/bsvc/files/patch-sim68300__cpu__Makefile new file mode 100644 index 000000000000..719a3a5e0ded --- /dev/null +++ b/emulators/bsvc/files/patch-sim68300__cpu__Makefile @@ -0,0 +1,11 @@ +--- sim68000/cpu/Makefile.orig Mon Sep 6 21:46:13 1999 ++++ sim68000/cpu/Makefile Mon Sep 6 21:46:36 1999 +@@ -28,7 +28,7 @@ + $(CC) $(INCLUDES) -o instruction instruction.c + + m68000DecodeTable.hxx: instruction instruction.list +- $(PROJECT_BASE)/src/sim68000/cpu/instruction ++ $(WRKSRC)/sim68000/cpu/instruction + + clean: + rm -f *.o $(LIBRARY) instruction diff --git a/emulators/bsvc/files/patch-sim68360__cpu__Makefile b/emulators/bsvc/files/patch-sim68360__cpu__Makefile new file mode 100644 index 000000000000..e24fb45bd13b --- /dev/null +++ b/emulators/bsvc/files/patch-sim68360__cpu__Makefile @@ -0,0 +1,11 @@ +--- sim68360/cpu/Makefile.orig Mon Sep 6 21:47:20 1999 ++++ sim68360/cpu/Makefile Mon Sep 6 21:47:39 1999 +@@ -31,7 +31,7 @@ + $(CC) $(INCLUDES) -o instruction instruction.c + + cpu32DecodeTable.hxx: instruction instruction.list +- $(PROJECT_BASE)/src/sim68360/cpu/instruction ++ $(WRKSRC)/sim68360/cpu/instruction + + clean: + rm -f *.o $(LIBRARY) instruction diff --git a/emulators/cpmemu/files/patch-Makefile b/emulators/cpmemu/files/patch-Makefile new file mode 100644 index 000000000000..c7efc6fabcd8 --- /dev/null +++ b/emulators/cpmemu/files/patch-Makefile @@ -0,0 +1,53 @@ +--- Makefile.orig Mon Nov 15 06:49:52 1999 ++++ Makefile Mon Nov 15 06:54:21 1999 +@@ -2,26 +2,26 @@ + + + # basic prefix for installation +-PREFIX = /usr/local ++PREFIX ?= /usr/local + + # where to install `cpm' executable. + BINDIR = $(PREFIX)/bin + + # where `cpm' looks for its files (cpm.sys and .com files). +-CPMLIBDIR = $(PREFIX)/lib/cpm ++CPMLIBDIR = $(PREFIX)/share/cpm + + + # You shouldn't need to edit below this line. + +-CC = gcc ++CC ?= gcc + +-CFLAGS = -O2 -pipe -ansi -Wall \ ++CFLAGS += $(CPPFLAGS) -ansi -Wall \ + -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \ + -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes \ + -Wnested-externs -Wwrite-strings \ + -DCPMLIBDIR=\"$(CPMLIBDIR)\" + +-LDFLAGS = -s ++#LDFLAGS = -s + + OBJS = single.o z80emu.o em.o io.o bios.o \ + commands.o running.o main.o disneu.o disz80.o low.o +@@ -42,11 +42,14 @@ + cpm: $(OBJS) + $(CC) $(LDFLAGS) -o cpm $(OBJS) + ++format: format.o ++ $(CC) $(LDFLAGS) -o format format.o ++ + clean: + rm -f *~ loads.s makeloads *.o $(TARGETS) + + install: all +- install -m 511 cpm $(BINDIR) +- -mkdir $(CPMLIBDIR) +- chmod 755 $(CPMLIBDIR) +- install -m 444 z80-binaries/* $(CPMLIBDIR) ++ ${BSD_INSTALL_PROGRAM} cpm $(DESTDIR)$(BINDIR)/cpmemu ++ ${BSD_INSTALL_PROGRAM} format $(DESTDIR)$(BINDIR)/cpmformat ++ -mkdir $(DESTDIR)$(CPMLIBDIR) ++ ${BSD_INSTALL_DATA} z80-binaries/* $(DESTDIR)$(CPMLIBDIR) diff --git a/emulators/cpmemu/files/patch-ab b/emulators/cpmemu/files/patch-ab deleted file mode 100644 index c7efc6fabcd8..000000000000 --- a/emulators/cpmemu/files/patch-ab +++ /dev/null @@ -1,53 +0,0 @@ ---- Makefile.orig Mon Nov 15 06:49:52 1999 -+++ Makefile Mon Nov 15 06:54:21 1999 -@@ -2,26 +2,26 @@ - - - # basic prefix for installation --PREFIX = /usr/local -+PREFIX ?= /usr/local - - # where to install `cpm' executable. - BINDIR = $(PREFIX)/bin - - # where `cpm' looks for its files (cpm.sys and .com files). --CPMLIBDIR = $(PREFIX)/lib/cpm -+CPMLIBDIR = $(PREFIX)/share/cpm - - - # You shouldn't need to edit below this line. - --CC = gcc -+CC ?= gcc - --CFLAGS = -O2 -pipe -ansi -Wall \ -+CFLAGS += $(CPPFLAGS) -ansi -Wall \ - -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \ - -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes \ - -Wnested-externs -Wwrite-strings \ - -DCPMLIBDIR=\"$(CPMLIBDIR)\" - --LDFLAGS = -s -+#LDFLAGS = -s - - OBJS = single.o z80emu.o em.o io.o bios.o \ - commands.o running.o main.o disneu.o disz80.o low.o -@@ -42,11 +42,14 @@ - cpm: $(OBJS) - $(CC) $(LDFLAGS) -o cpm $(OBJS) - -+format: format.o -+ $(CC) $(LDFLAGS) -o format format.o -+ - clean: - rm -f *~ loads.s makeloads *.o $(TARGETS) - - install: all -- install -m 511 cpm $(BINDIR) -- -mkdir $(CPMLIBDIR) -- chmod 755 $(CPMLIBDIR) -- install -m 444 z80-binaries/* $(CPMLIBDIR) -+ ${BSD_INSTALL_PROGRAM} cpm $(DESTDIR)$(BINDIR)/cpmemu -+ ${BSD_INSTALL_PROGRAM} format $(DESTDIR)$(BINDIR)/cpmformat -+ -mkdir $(DESTDIR)$(CPMLIBDIR) -+ ${BSD_INSTALL_DATA} z80-binaries/* $(DESTDIR)$(CPMLIBDIR) diff --git a/emulators/cpmemu/files/patch-ac b/emulators/cpmemu/files/patch-ac deleted file mode 100644 index ba9053544fd9..000000000000 --- a/emulators/cpmemu/files/patch-ac +++ /dev/null @@ -1,11 +0,0 @@ ---- bios.c.orig Mon Nov 15 06:33:54 1999 -+++ bios.c Mon Nov 15 06:39:55 1999 -@@ -227,7 +227,7 @@ - case BIOS: /* System Reset (coldboot) */ - case DIRBUF-20: - if (!silent_exit) -- printf("\nCp/M BIOS COLDBOOT takes you back to Linux\n"); -+ printf("\nCp/M BIOS COLDBOOT takes you back to FreeBSD\n"); - exit(0); - case BIOS+3: /* System Reset (warmboot) */ - case DIRBUF-19: diff --git a/emulators/cpmemu/files/patch-ad b/emulators/cpmemu/files/patch-ad deleted file mode 100644 index c655ccbcf663..000000000000 --- a/emulators/cpmemu/files/patch-ad +++ /dev/null @@ -1,11 +0,0 @@ ---- io.c.orig Wed Jun 22 03:25:46 1994 -+++ io.c Mon Nov 15 06:31:36 1999 -@@ -13,7 +13,7 @@ - /*****************************************************************************/ - #include "cpmemu.h" - --#define HAVE_RAW_IO -+#undef HAVE_RAW_IO - - /* magic for character I/O */ - #include diff --git a/emulators/cpmemu/files/patch-ae b/emulators/cpmemu/files/patch-ae deleted file mode 100644 index 01cb47a00c27..000000000000 --- a/emulators/cpmemu/files/patch-ae +++ /dev/null @@ -1,26 +0,0 @@ ---- low.c.orig Wed Dec 11 22:44:43 2002 -+++ low.c Wed Dec 11 22:44:56 2002 -@@ -18,11 +18,10 @@ - * space-invaders-type game working, I think it was. :-) -rjm - */ - -+#include - #include "cpmemu.h" - #include - #include --#include /* needed for ioperm() -rjm */ --#include - #include - #include - #include -@@ -88,10 +87,8 @@ - - /* get access to sound port */ - cptr = NULL; -- if (ioperm(0x61, 1, 1)) { - hardware_access = 0; /* no access to speaker port */ - return; -- } - - /* install signal handler */ - sa.sa_handler = tickerint; diff --git a/emulators/cpmemu/files/patch-bios.c b/emulators/cpmemu/files/patch-bios.c new file mode 100644 index 000000000000..ba9053544fd9 --- /dev/null +++ b/emulators/cpmemu/files/patch-bios.c @@ -0,0 +1,11 @@ +--- bios.c.orig Mon Nov 15 06:33:54 1999 ++++ bios.c Mon Nov 15 06:39:55 1999 +@@ -227,7 +227,7 @@ + case BIOS: /* System Reset (coldboot) */ + case DIRBUF-20: + if (!silent_exit) +- printf("\nCp/M BIOS COLDBOOT takes you back to Linux\n"); ++ printf("\nCp/M BIOS COLDBOOT takes you back to FreeBSD\n"); + exit(0); + case BIOS+3: /* System Reset (warmboot) */ + case DIRBUF-19: diff --git a/emulators/cpmemu/files/patch-io.c b/emulators/cpmemu/files/patch-io.c new file mode 100644 index 000000000000..c655ccbcf663 --- /dev/null +++ b/emulators/cpmemu/files/patch-io.c @@ -0,0 +1,11 @@ +--- io.c.orig Wed Jun 22 03:25:46 1994 ++++ io.c Mon Nov 15 06:31:36 1999 +@@ -13,7 +13,7 @@ + /*****************************************************************************/ + #include "cpmemu.h" + +-#define HAVE_RAW_IO ++#undef HAVE_RAW_IO + + /* magic for character I/O */ + #include diff --git a/emulators/cpmemu/files/patch-low.c b/emulators/cpmemu/files/patch-low.c new file mode 100644 index 000000000000..01cb47a00c27 --- /dev/null +++ b/emulators/cpmemu/files/patch-low.c @@ -0,0 +1,26 @@ +--- low.c.orig Wed Dec 11 22:44:43 2002 ++++ low.c Wed Dec 11 22:44:56 2002 +@@ -18,11 +18,10 @@ + * space-invaders-type game working, I think it was. :-) -rjm + */ + ++#include + #include "cpmemu.h" + #include + #include +-#include /* needed for ioperm() -rjm */ +-#include + #include + #include + #include +@@ -88,10 +87,8 @@ + + /* get access to sound port */ + cptr = NULL; +- if (ioperm(0x61, 1, 1)) { + hardware_access = 0; /* no access to speaker port */ + return; +- } + + /* install signal handler */ + sa.sa_handler = tickerint; diff --git a/emulators/darcnes/files/patch-Makefile b/emulators/darcnes/files/patch-Makefile new file mode 100644 index 000000000000..7d046d199615 --- /dev/null +++ b/emulators/darcnes/files/patch-Makefile @@ -0,0 +1,51 @@ +--- Makefile.orig 2001-03-28 02:51:41.000000000 +0200 ++++ Makefile 2008-04-01 16:53:11.000000000 +0200 +@@ -11,16 +11,16 @@ + + #C_ONLY=-DC_ONLY + +-MACH_TYPES=-DMACH_TYPES=\"types-i386.h\" ++#MACH_TYPES=-DMACH_TYPES=\"types-i386.h\" + + #BYTE_ORDER=-DMSB_FIRST +-BYTE_ORDER=-DLSB_FIRST ++#BYTE_ORDER=-DLSB_FIRST + +-DEBUG=-g ++#DEBUG=-g + +-OPTFLAGS=-O2 -fomit-frame-pointer ++#OPTFLAGS=-O2 -fomit-frame-pointer + +-BASE_CFLAGS=-Wall $(DEBUG) $(OPTFLAGS) $(C_ONLY) $(BYTE_ORDER) $(MACH_TYPES) ++BASE_CFLAGS=-Wall $(DEBUG) $(OPTFLAGS) $(C_ONLY) $(MACH_TYPES) + BASE_SFLAGS=-Wall $(DEBUG) $(OPTFLAGS) + BASE_LDFLAGS= + +@@ -33,8 +33,12 @@ + # + ifeq ($(TARGET),Linux_svgalib) + CONFFLAGS=-DPCE_CD_SUPPORT -DSOUND ++LOCALBASE?=/usr/local ++LDFLAGS+=-L${LOCALBASE}/lib ++CFLAGS+=-I${LOCALBASE}/include ++SFLAGS+=-I${LOCALBASE}/include + SYSTEMSRCS=video_svga.c ui_svga.c snd_unix.c cd_unix.c +-BINFILE=sdarcnes ++BINFILE=darcnes + LIBS=-lvgagl -lvga + endif + +@@ -43,9 +47,9 @@ + # + ifeq ($(TARGET),Linux_X) + CONFFLAGS=-DPCE_CD_SUPPORT -DSOUND +-LDFLAGS+=-L/usr/X11R6/lib +-CFLAGS+=-I/usr/X11R6/include +-SFLAGS+=-I/usr/X11R6/include ++LDFLAGS+=-L${LOCALBASE}/lib ++CFLAGS+=-I${LOCALBASE}/include ++SFLAGS+=-I${LOCALBASE}/include + SYSTEMSRCS=video_x.c ui_x.c snd_unix.c keyboard_x.c cd_unix.c + BINFILE=darcnes + LIBS=-lXext -lXaw -lXmu -lXt -lX11 diff --git a/emulators/darcnes/files/patch-aa b/emulators/darcnes/files/patch-aa deleted file mode 100644 index 18290f5fc77c..000000000000 --- a/emulators/darcnes/files/patch-aa +++ /dev/null @@ -1,11 +0,0 @@ ---- snd_unix.c.orig Wed Oct 23 20:11:53 2002 -+++ snd_unix.c Wed Oct 23 20:12:07 2002 -@@ -23,7 +23,7 @@ - #endif - - #ifdef SYSTEM_FREEBSD --#include -+#include - #define SOUND_DEVICE "/dev/dsp" - #endif - diff --git a/emulators/darcnes/files/patch-ab b/emulators/darcnes/files/patch-ab deleted file mode 100644 index 7d046d199615..000000000000 --- a/emulators/darcnes/files/patch-ab +++ /dev/null @@ -1,51 +0,0 @@ ---- Makefile.orig 2001-03-28 02:51:41.000000000 +0200 -+++ Makefile 2008-04-01 16:53:11.000000000 +0200 -@@ -11,16 +11,16 @@ - - #C_ONLY=-DC_ONLY - --MACH_TYPES=-DMACH_TYPES=\"types-i386.h\" -+#MACH_TYPES=-DMACH_TYPES=\"types-i386.h\" - - #BYTE_ORDER=-DMSB_FIRST --BYTE_ORDER=-DLSB_FIRST -+#BYTE_ORDER=-DLSB_FIRST - --DEBUG=-g -+#DEBUG=-g - --OPTFLAGS=-O2 -fomit-frame-pointer -+#OPTFLAGS=-O2 -fomit-frame-pointer - --BASE_CFLAGS=-Wall $(DEBUG) $(OPTFLAGS) $(C_ONLY) $(BYTE_ORDER) $(MACH_TYPES) -+BASE_CFLAGS=-Wall $(DEBUG) $(OPTFLAGS) $(C_ONLY) $(MACH_TYPES) - BASE_SFLAGS=-Wall $(DEBUG) $(OPTFLAGS) - BASE_LDFLAGS= - -@@ -33,8 +33,12 @@ - # - ifeq ($(TARGET),Linux_svgalib) - CONFFLAGS=-DPCE_CD_SUPPORT -DSOUND -+LOCALBASE?=/usr/local -+LDFLAGS+=-L${LOCALBASE}/lib -+CFLAGS+=-I${LOCALBASE}/include -+SFLAGS+=-I${LOCALBASE}/include - SYSTEMSRCS=video_svga.c ui_svga.c snd_unix.c cd_unix.c --BINFILE=sdarcnes -+BINFILE=darcnes - LIBS=-lvgagl -lvga - endif - -@@ -43,9 +47,9 @@ - # - ifeq ($(TARGET),Linux_X) - CONFFLAGS=-DPCE_CD_SUPPORT -DSOUND --LDFLAGS+=-L/usr/X11R6/lib --CFLAGS+=-I/usr/X11R6/include --SFLAGS+=-I/usr/X11R6/include -+LDFLAGS+=-L${LOCALBASE}/lib -+CFLAGS+=-I${LOCALBASE}/include -+SFLAGS+=-I${LOCALBASE}/include - SYSTEMSRCS=video_x.c ui_x.c snd_unix.c keyboard_x.c cd_unix.c - BINFILE=darcnes - LIBS=-lXext -lXaw -lXmu -lXt -lX11 diff --git a/emulators/darcnes/files/patch-snd_unix.c b/emulators/darcnes/files/patch-snd_unix.c new file mode 100644 index 000000000000..18290f5fc77c --- /dev/null +++ b/emulators/darcnes/files/patch-snd_unix.c @@ -0,0 +1,11 @@ +--- snd_unix.c.orig Wed Oct 23 20:11:53 2002 ++++ snd_unix.c Wed Oct 23 20:12:07 2002 +@@ -23,7 +23,7 @@ + #endif + + #ifdef SYSTEM_FREEBSD +-#include ++#include + #define SOUND_DEVICE "/dev/dsp" + #endif + diff --git a/emulators/gbe/files/patch-Makefile b/emulators/gbe/files/patch-Makefile new file mode 100644 index 000000000000..ca6942297088 --- /dev/null +++ b/emulators/gbe/files/patch-Makefile @@ -0,0 +1,58 @@ +--- Makefile.orig Mon Sep 27 00:29:10 1999 ++++ Makefile Sun Jul 6 19:34:42 2003 +@@ -1,42 +1,42 @@ +-LFLAGS = -L/usr/X11R6/lib -lX11 -g3 -lreadline -lncurses -lvga +-CFLAGS = -O6 -DBUILD_SVGA -DBUILD_X11 -DBUILD_JLIB -DCPU_DEBUG -g3 -ffast-math -fomit-frame-pointer -finline-functions #-DNOT_LINEBASED #-DCPU_DEBUG_EXTENDED ++LFLAGS = -lX11 -g3 $(LDFLAGS) ++CFLAGS += ${CPPFLAGS} -DBUILD_X11 -g3 #-DNOT_LINEBASED #-DCPU_DEBUG_EXTENDED + OBJS = main.o rom.o mem.o cpu.o vram.o debug.o joypad.o jlib.o x11.o svga.o + BIN = gbe + + all: $(BIN) + + $(BIN): $(OBJS) +- gcc $(CFLAGS) -o $(BIN) $(OBJS) $(LFLAGS) ++ $(CC) $(CFLAGS) -o $(BIN) $(OBJS) $(LFLAGS) + + main.o: main.c rom.h mem.h data.h vram.h +- gcc $(CFLAGS) -o main.o -c main.c ++ $(CC) $(CFLAGS) -o main.o -c main.c + + rom.o: rom.c rom.h mem.h +- gcc $(CFLAGS) -o rom.o -c rom.c ++ $(CC) $(CFLAGS) -o rom.o -c rom.c + + mem.o: mem.c mem.h regs.h +- gcc $(CFLAGS) -o mem.o -c mem.c ++ $(CC) $(CFLAGS) -o mem.o -c mem.c + + cpu.o: cpu.c cpu.h mem.h data.h +- gcc $(CFLAGS) -o cpu.o -c cpu.c ++ $(CC) $(CFLAGS) -o cpu.o -c cpu.c + + vram.o: vram.c vram.h x11.h mem.h regs.h +- gcc $(CFLAGS) -o vram.o -c vram.c ++ $(CC) $(CFLAGS) -o vram.o -c vram.c + + debug.o: debug.c debug.h +- gcc $(CFLAGS) -o debug.o -c debug.c ++ $(CC) $(CFLAGS) -o debug.o -c debug.c + + joypad.o: joypad.c joypad.c jlib.h +- gcc $(CFLAGS) -o joypad.o -c joypad.c ++ $(CC) $(CFLAGS) -o joypad.o -c joypad.c + + jlib.o: jlib.c jlib.h +- gcc $(CFLAGS) -o jlib.o -c jlib.c ++ $(CC) $(CFLAGS) -o jlib.o -c jlib.c + + x11.o: x11.c x11.h +- gcc $(CFLAGS) -o x11.o -c x11.c ++ $(CC) $(CFLAGS) -o x11.o -c x11.c + + svga.o: svga.c svga.h +- gcc $(CFLAGS) -o svga.o -c svga.c ++ $(CC) $(CFLAGS) -o svga.o -c svga.c + + clean: + rm -f $(BIN) $(OBJS) *~ core vram.dump diff --git a/emulators/gbe/files/patch-aa b/emulators/gbe/files/patch-aa deleted file mode 100644 index ca6942297088..000000000000 --- a/emulators/gbe/files/patch-aa +++ /dev/null @@ -1,58 +0,0 @@ ---- Makefile.orig Mon Sep 27 00:29:10 1999 -+++ Makefile Sun Jul 6 19:34:42 2003 -@@ -1,42 +1,42 @@ --LFLAGS = -L/usr/X11R6/lib -lX11 -g3 -lreadline -lncurses -lvga --CFLAGS = -O6 -DBUILD_SVGA -DBUILD_X11 -DBUILD_JLIB -DCPU_DEBUG -g3 -ffast-math -fomit-frame-pointer -finline-functions #-DNOT_LINEBASED #-DCPU_DEBUG_EXTENDED -+LFLAGS = -lX11 -g3 $(LDFLAGS) -+CFLAGS += ${CPPFLAGS} -DBUILD_X11 -g3 #-DNOT_LINEBASED #-DCPU_DEBUG_EXTENDED - OBJS = main.o rom.o mem.o cpu.o vram.o debug.o joypad.o jlib.o x11.o svga.o - BIN = gbe - - all: $(BIN) - - $(BIN): $(OBJS) -- gcc $(CFLAGS) -o $(BIN) $(OBJS) $(LFLAGS) -+ $(CC) $(CFLAGS) -o $(BIN) $(OBJS) $(LFLAGS) - - main.o: main.c rom.h mem.h data.h vram.h -- gcc $(CFLAGS) -o main.o -c main.c -+ $(CC) $(CFLAGS) -o main.o -c main.c - - rom.o: rom.c rom.h mem.h -- gcc $(CFLAGS) -o rom.o -c rom.c -+ $(CC) $(CFLAGS) -o rom.o -c rom.c - - mem.o: mem.c mem.h regs.h -- gcc $(CFLAGS) -o mem.o -c mem.c -+ $(CC) $(CFLAGS) -o mem.o -c mem.c - - cpu.o: cpu.c cpu.h mem.h data.h -- gcc $(CFLAGS) -o cpu.o -c cpu.c -+ $(CC) $(CFLAGS) -o cpu.o -c cpu.c - - vram.o: vram.c vram.h x11.h mem.h regs.h -- gcc $(CFLAGS) -o vram.o -c vram.c -+ $(CC) $(CFLAGS) -o vram.o -c vram.c - - debug.o: debug.c debug.h -- gcc $(CFLAGS) -o debug.o -c debug.c -+ $(CC) $(CFLAGS) -o debug.o -c debug.c - - joypad.o: joypad.c joypad.c jlib.h -- gcc $(CFLAGS) -o joypad.o -c joypad.c -+ $(CC) $(CFLAGS) -o joypad.o -c joypad.c - - jlib.o: jlib.c jlib.h -- gcc $(CFLAGS) -o jlib.o -c jlib.c -+ $(CC) $(CFLAGS) -o jlib.o -c jlib.c - - x11.o: x11.c x11.h -- gcc $(CFLAGS) -o x11.o -c x11.c -+ $(CC) $(CFLAGS) -o x11.o -c x11.c - - svga.o: svga.c svga.h -- gcc $(CFLAGS) -o svga.o -c svga.c -+ $(CC) $(CFLAGS) -o svga.o -c svga.c - - clean: - rm -f $(BIN) $(OBJS) *~ core vram.dump diff --git a/emulators/gbe/files/patch-ab b/emulators/gbe/files/patch-ab deleted file mode 100644 index e8e469ed273a..000000000000 --- a/emulators/gbe/files/patch-ab +++ /dev/null @@ -1,10 +0,0 @@ ---- vram.c.orig Mon Apr 16 22:12:03 2001 -+++ vram.c Mon Apr 16 22:12:08 2001 -@@ -31,7 +31,6 @@ - #include "cpu.h" - #include "data.h" - #include "x11.h" --#include "svga.h" - #include "win32.h" - #include "joypad.h" - diff --git a/emulators/gbe/files/patch-vram.c b/emulators/gbe/files/patch-vram.c new file mode 100644 index 000000000000..e8e469ed273a --- /dev/null +++ b/emulators/gbe/files/patch-vram.c @@ -0,0 +1,10 @@ +--- vram.c.orig Mon Apr 16 22:12:03 2001 ++++ vram.c Mon Apr 16 22:12:08 2001 +@@ -31,7 +31,6 @@ + #include "cpu.h" + #include "data.h" + #include "x11.h" +-#include "svga.h" + #include "win32.h" + #include "joypad.h" + diff --git a/emulators/gxemul/files/patch-aa b/emulators/gxemul/files/patch-aa deleted file mode 100644 index 752e7f318aae..000000000000 --- a/emulators/gxemul/files/patch-aa +++ /dev/null @@ -1,32 +0,0 @@ ---- src/devices/dev_wdc.cc.orig 2013-06-27 18:10:50.000000000 -0700 -+++ src/devices/dev_wdc.cc 2013-06-27 18:11:13.000000000 -0700 -@@ -274,12 +274,12 @@ - + (int64_t)d->head * d->sectors_per_track[d->drive] + - (int64_t)d->heads[d->drive] * d->sectors_per_track[d->drive] * cyl); - --#if 0 -+#if 1 - /* LBA: */ - if (d->lba) - offset = 512 * (((d->head & 0xf) << 24) + (cyl << 8) - + d->sector); -- printf("WDC read from offset %lli\n", (long long)offset); -+ debug("WDC read from offset %lli\n", (long long)offset); - #endif - - while (count > 0) { -@@ -320,12 +320,12 @@ - uint64_t offset = 512 * (d->sector - 1 - + (int64_t)d->head * d->sectors_per_track[d->drive] + - (int64_t)d->heads[d->drive] * d->sectors_per_track[d->drive] * cyl); --#if 0 -+#if 1 - /* LBA: */ - if (d->lba) - offset = 512 * (((d->head & 0xf) << 24) + - (cyl << 8) + d->sector); -- printf("WDC write to offset %lli\n", (long long)offset); -+ debug("WDC write to offset %lli\n", (long long)offset); - #endif - - d->write_in_progress = d->cur_command; diff --git a/emulators/gxemul/files/patch-ab b/emulators/gxemul/files/patch-ab deleted file mode 100644 index aa155710ce96..000000000000 --- a/emulators/gxemul/files/patch-ab +++ /dev/null @@ -1,11 +0,0 @@ ---- src/include/refcount_ptr.h 2010-02-14 02:33:54.000000000 -0700 -+++ src/include/refcount_ptr.h 2014-02-24 03:48:14.000000000 -0700 -@@ -28,6 +28,8 @@ - * SUCH DAMAGE. - */ - -+#include -+ - /** - * \brief Base class for reference countable objects. - * diff --git a/emulators/gxemul/files/patch-src_devices_dev_wdc.cc b/emulators/gxemul/files/patch-src_devices_dev_wdc.cc new file mode 100644 index 000000000000..752e7f318aae --- /dev/null +++ b/emulators/gxemul/files/patch-src_devices_dev_wdc.cc @@ -0,0 +1,32 @@ +--- src/devices/dev_wdc.cc.orig 2013-06-27 18:10:50.000000000 -0700 ++++ src/devices/dev_wdc.cc 2013-06-27 18:11:13.000000000 -0700 +@@ -274,12 +274,12 @@ + + (int64_t)d->head * d->sectors_per_track[d->drive] + + (int64_t)d->heads[d->drive] * d->sectors_per_track[d->drive] * cyl); + +-#if 0 ++#if 1 + /* LBA: */ + if (d->lba) + offset = 512 * (((d->head & 0xf) << 24) + (cyl << 8) + + d->sector); +- printf("WDC read from offset %lli\n", (long long)offset); ++ debug("WDC read from offset %lli\n", (long long)offset); + #endif + + while (count > 0) { +@@ -320,12 +320,12 @@ + uint64_t offset = 512 * (d->sector - 1 + + (int64_t)d->head * d->sectors_per_track[d->drive] + + (int64_t)d->heads[d->drive] * d->sectors_per_track[d->drive] * cyl); +-#if 0 ++#if 1 + /* LBA: */ + if (d->lba) + offset = 512 * (((d->head & 0xf) << 24) + + (cyl << 8) + d->sector); +- printf("WDC write to offset %lli\n", (long long)offset); ++ debug("WDC write to offset %lli\n", (long long)offset); + #endif + + d->write_in_progress = d->cur_command; diff --git a/emulators/gxemul/files/patch-src_include_refcount_ptr.h b/emulators/gxemul/files/patch-src_include_refcount_ptr.h new file mode 100644 index 000000000000..aa155710ce96 --- /dev/null +++ b/emulators/gxemul/files/patch-src_include_refcount_ptr.h @@ -0,0 +1,11 @@ +--- src/include/refcount_ptr.h 2010-02-14 02:33:54.000000000 -0700 ++++ src/include/refcount_ptr.h 2014-02-24 03:48:14.000000000 -0700 +@@ -28,6 +28,8 @@ + * SUCH DAMAGE. + */ + ++#include ++ + /** + * \brief Base class for reference countable objects. + * diff --git a/emulators/klh10/files/patch-aa b/emulators/klh10/files/patch-aa deleted file mode 100644 index 66ef7d4f6eb7..000000000000 --- a/emulators/klh10/files/patch-aa +++ /dev/null @@ -1,12 +0,0 @@ ---- src/Mk-fbx86.mk.DIST Sat Jan 12 15:40:10 2002 -+++ src/Mk-fbx86.mk Sat Jan 12 15:40:55 2002 -@@ -21,7 +21,7 @@ - - # Build definitions - SRC = ../../src --CFLAGS = -c -g3 -O -I. -I$(SRC) -+CFLAGS += -c -I. -I$(SRC) - CFLAGS_LINT = -ansi -pedantic -Wall -Wshadow \ - -Wstrict-prototypes -Wmissing-prototypes \ - -Wmissing-declarations -Wredundant-decls - diff --git a/emulators/klh10/files/patch-ab b/emulators/klh10/files/patch-ab deleted file mode 100644 index 70c3a5dbac9a..000000000000 --- a/emulators/klh10/files/patch-ab +++ /dev/null @@ -1,25 +0,0 @@ ---- src/vmtape.c 2002/01/12 16:47:42 1.1 -+++ src/vmtape.c 2002/01/12 16:48:35 -@@ -696,13 +696,11 @@ - - /* Now verify filenames don't already exist */ - if (cfn && (cf = fopen(cfn, "r"))) { -- fclose(cf); - vmterror(t, "Tape control file \"%.256s\" already exists", cfn); - goto badret; - } - - if (df = fopen(dfn, "rb")) { -- fclose(df); - vmterror(t, "Tape data file \"%.256s\" already exists", dfn); - goto badret; - } -@@ -714,8 +712,6 @@ - goto badret; - } - if (!(df = fopen(dfn, "w+b"))) { -- fclose(df); -- if (cfn) fclose(cf); - vmterror(t, "Cannot create tape data file \"%.256s\": %.80s", - dfn, os_strerror(errno)); - goto badret; diff --git a/emulators/klh10/files/patch-src_Mk-fbx86.mk b/emulators/klh10/files/patch-src_Mk-fbx86.mk new file mode 100644 index 000000000000..66ef7d4f6eb7 --- /dev/null +++ b/emulators/klh10/files/patch-src_Mk-fbx86.mk @@ -0,0 +1,12 @@ +--- src/Mk-fbx86.mk.DIST Sat Jan 12 15:40:10 2002 ++++ src/Mk-fbx86.mk Sat Jan 12 15:40:55 2002 +@@ -21,7 +21,7 @@ + + # Build definitions + SRC = ../../src +-CFLAGS = -c -g3 -O -I. -I$(SRC) ++CFLAGS += -c -I. -I$(SRC) + CFLAGS_LINT = -ansi -pedantic -Wall -Wshadow \ + -Wstrict-prototypes -Wmissing-prototypes \ + -Wmissing-declarations -Wredundant-decls + diff --git a/emulators/klh10/files/patch-src_vmtape.c b/emulators/klh10/files/patch-src_vmtape.c new file mode 100644 index 000000000000..70c3a5dbac9a --- /dev/null +++ b/emulators/klh10/files/patch-src_vmtape.c @@ -0,0 +1,25 @@ +--- src/vmtape.c 2002/01/12 16:47:42 1.1 ++++ src/vmtape.c 2002/01/12 16:48:35 +@@ -696,13 +696,11 @@ + + /* Now verify filenames don't already exist */ + if (cfn && (cf = fopen(cfn, "r"))) { +- fclose(cf); + vmterror(t, "Tape control file \"%.256s\" already exists", cfn); + goto badret; + } + + if (df = fopen(dfn, "rb")) { +- fclose(df); + vmterror(t, "Tape data file \"%.256s\" already exists", dfn); + goto badret; + } +@@ -714,8 +712,6 @@ + goto badret; + } + if (!(df = fopen(dfn, "w+b"))) { +- fclose(df); +- if (cfn) fclose(cf); + vmterror(t, "Cannot create tape data file \"%.256s\": %.80s", + dfn, os_strerror(errno)); + goto badret; diff --git a/emulators/qemu-devel/files/patch-bf b/emulators/qemu-devel/files/patch-bf deleted file mode 100644 index 57cc889e3119..000000000000 --- a/emulators/qemu-devel/files/patch-bf +++ /dev/null @@ -1,37 +0,0 @@ -Index: qemu/slirp/slirp_config.h -@@ -86,7 +86,7 @@ - #undef BAD_SPRINTF - - /* Define if you have readv */ --#undef HAVE_READV -+#define HAVE_READV - - /* Define if iovec needs to be declared */ - #undef DECLARE_IOVEC -@@ -95,7 +95,7 @@ - #undef DECLARE_SPRINTF - - /* Define if you have a POSIX.1 sys/wait.h */ --#undef HAVE_SYS_WAIT_H -+#define HAVE_SYS_WAIT_H - - /* Define if you have sys/select.h */ - #define HAVE_SYS_SELECT_H -@@ -107,7 +107,7 @@ - #define HAVE_ARPA_INET_H - - /* Define if you have sys/signal.h */ --#undef HAVE_SYS_SIGNAL_H -+#define HAVE_SYS_SIGNAL_H - - /* Define if you have sys/stropts.h */ - #undef HAVE_SYS_STROPTS_H -@@ -180,7 +180,7 @@ - #undef HAVE_GRANTPT - - /* Define if you have fchmod */ --#undef HAVE_FCHMOD -+#define HAVE_FCHMOD - - /* Define if you have */ - #undef HAVE_SYS_TYPES32_H diff --git a/emulators/qemu-devel/files/patch-bg b/emulators/qemu-devel/files/patch-bg deleted file mode 100644 index 719e8baf1210..000000000000 --- a/emulators/qemu-devel/files/patch-bg +++ /dev/null @@ -1,24 +0,0 @@ -Index: qemu/include/net/net.h -@@ -174,8 +174,8 @@ void net_host_device_remove(Monitor *mon - int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data); - int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data); - --#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" --#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" -+#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" -+#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" - #define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper" - #define DEFAULT_BRIDGE_INTERFACE "br0" - -Index: qemu/net/tap_int.h -@@ -29,8 +29,8 @@ - #include "qemu-common.h" - #include "qemu-option.h" - --#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" --#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" -+#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" -+#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" - - int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan); - diff --git a/emulators/qemu-devel/files/patch-qemu-include-net-net.h b/emulators/qemu-devel/files/patch-qemu-include-net-net.h new file mode 100644 index 000000000000..719e8baf1210 --- /dev/null +++ b/emulators/qemu-devel/files/patch-qemu-include-net-net.h @@ -0,0 +1,24 @@ +Index: qemu/include/net/net.h +@@ -174,8 +174,8 @@ void net_host_device_remove(Monitor *mon + int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data); + int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data); + +-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" +-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" ++#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" ++#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" + #define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper" + #define DEFAULT_BRIDGE_INTERFACE "br0" + +Index: qemu/net/tap_int.h +@@ -29,8 +29,8 @@ + #include "qemu-common.h" + #include "qemu-option.h" + +-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" +-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" ++#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" ++#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" + + int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan); + diff --git a/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h b/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h new file mode 100644 index 000000000000..57cc889e3119 --- /dev/null +++ b/emulators/qemu-devel/files/patch-qemu-slirp-slirp_config.h @@ -0,0 +1,37 @@ +Index: qemu/slirp/slirp_config.h +@@ -86,7 +86,7 @@ + #undef BAD_SPRINTF + + /* Define if you have readv */ +-#undef HAVE_READV ++#define HAVE_READV + + /* Define if iovec needs to be declared */ + #undef DECLARE_IOVEC +@@ -95,7 +95,7 @@ + #undef DECLARE_SPRINTF + + /* Define if you have a POSIX.1 sys/wait.h */ +-#undef HAVE_SYS_WAIT_H ++#define HAVE_SYS_WAIT_H + + /* Define if you have sys/select.h */ + #define HAVE_SYS_SELECT_H +@@ -107,7 +107,7 @@ + #define HAVE_ARPA_INET_H + + /* Define if you have sys/signal.h */ +-#undef HAVE_SYS_SIGNAL_H ++#define HAVE_SYS_SIGNAL_H + + /* Define if you have sys/stropts.h */ + #undef HAVE_SYS_STROPTS_H +@@ -180,7 +180,7 @@ + #undef HAVE_GRANTPT + + /* Define if you have fchmod */ +-#undef HAVE_FCHMOD ++#define HAVE_FCHMOD + + /* Define if you have */ + #undef HAVE_SYS_TYPES32_H diff --git a/emulators/qemu/files/patch-ac b/emulators/qemu/files/patch-ac deleted file mode 100644 index cc7638d0f26e..000000000000 --- a/emulators/qemu/files/patch-ac +++ /dev/null @@ -1,10 +0,0 @@ -Index: qemu/configure -@@ -868,7 +868,7 @@ - sdl_too_old=no - - if test "$sdl" = "yes" ; then -- sdl_config="sdl-config" -+ sdl_config="${SDL_CONFIG}" - sdl=no - sdl_static=no - diff --git a/emulators/qemu/files/patch-bd b/emulators/qemu/files/patch-bd deleted file mode 100644 index b8b49a136432..000000000000 --- a/emulators/qemu/files/patch-bd +++ /dev/null @@ -1,10 +0,0 @@ -Index: qemu/configure -@@ -570,7 +570,7 @@ - if test -z "$prefix" ; then - prefix="/usr/local" - fi -- mansuffix="/share/man" -+ mansuffix="/man" - datasuffix="/share/qemu" - docsuffix="/share/doc/qemu" - binsuffix="/bin" diff --git a/emulators/qemu/files/patch-bf b/emulators/qemu/files/patch-bf deleted file mode 100644 index 57cc889e3119..000000000000 --- a/emulators/qemu/files/patch-bf +++ /dev/null @@ -1,37 +0,0 @@ -Index: qemu/slirp/slirp_config.h -@@ -86,7 +86,7 @@ - #undef BAD_SPRINTF - - /* Define if you have readv */ --#undef HAVE_READV -+#define HAVE_READV - - /* Define if iovec needs to be declared */ - #undef DECLARE_IOVEC -@@ -95,7 +95,7 @@ - #undef DECLARE_SPRINTF - - /* Define if you have a POSIX.1 sys/wait.h */ --#undef HAVE_SYS_WAIT_H -+#define HAVE_SYS_WAIT_H - - /* Define if you have sys/select.h */ - #define HAVE_SYS_SELECT_H -@@ -107,7 +107,7 @@ - #define HAVE_ARPA_INET_H - - /* Define if you have sys/signal.h */ --#undef HAVE_SYS_SIGNAL_H -+#define HAVE_SYS_SIGNAL_H - - /* Define if you have sys/stropts.h */ - #undef HAVE_SYS_STROPTS_H -@@ -180,7 +180,7 @@ - #undef HAVE_GRANTPT - - /* Define if you have fchmod */ --#undef HAVE_FCHMOD -+#define HAVE_FCHMOD - - /* Define if you have */ - #undef HAVE_SYS_TYPES32_H diff --git a/emulators/qemu/files/patch-bg b/emulators/qemu/files/patch-bg deleted file mode 100644 index 27c544f14341..000000000000 --- a/emulators/qemu/files/patch-bg +++ /dev/null @@ -1,36 +0,0 @@ -Index: qemu/Makefile -@@ -19,6 +19,7 @@ - CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@ - CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE - CPPFLAGS += -U_FORTIFY_SOURCE -+CPPFLAGS += -DSMBD_COMMAND=\"${LOCALBASE}/sbin/smbd\" -I${LOCALBASE}/include -DPREFIX=\"${PREFIX}\" - LIBS= - ifdef CONFIG_STATIC - LDFLAGS += -static -Index: qemu/Makefile.target -@@ -54,6 +54,7 @@ - - CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE - CPPFLAGS+=-U_FORTIFY_SOURCE -+CPPFLAGS+=-DSMBD_COMMAND=\"${LOCALBASE}/sbin/smbd\" -I${LOCALBASE}/include -DPREFIX=\"${PREFIX}\" - LIBS+=-lm - ifdef CONFIG_WIN32 - LIBS+=-lwinmm -lws2_32 -liphlpapi -Index: qemu/net.h -@@ -99,12 +99,14 @@ - int slirp_is_inited(void); - void net_client_check(void); - --#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" --#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" -+#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" -+#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" -+#ifndef SMBD_COMMAND - #ifdef __sun__ - #define SMBD_COMMAND "/usr/sfw/sbin/smbd" - #else - #define SMBD_COMMAND "/usr/sbin/smbd" - #endif -+#endif - - #endif diff --git a/emulators/qemu/files/patch-bt b/emulators/qemu/files/patch-bt deleted file mode 100644 index 69e70482fefc..000000000000 --- a/emulators/qemu/files/patch-bt +++ /dev/null @@ -1,109 +0,0 @@ -Index: qemu/net.c -@@ -76,6 +76,11 @@ - #endif - #endif - #endif -+#ifdef __FreeBSD__ -+#include -+#include -+#include -+#endif - - #if defined(CONFIG_SLIRP) - #include "libslirp.h" -@@ -3407,6 +3410,34 @@ - - #endif /* CONFIG_SLIRP */ - -+#ifdef __FreeBSD__ -+#define LOAD_QUIETLY 1 -+#define LOAD_VERBOSLY 2 -+ -+static int -+loadmodules(int how, const char *module, ...) -+{ -+ int loaded = 0; -+ va_list ap; -+ -+ va_start(ap, module); -+#ifndef NO_MODULES -+ while (module != NULL) { -+ if (modfind(module) == -1) { -+ if (kldload(module) == -1) { -+ if (how == LOAD_VERBOSLY) -+ fprintf(stderr, "%s: Cannot load module\n", module); -+ } else -+ loaded++; -+ } -+ module = va_arg(ap, const char *); -+ } -+ va_end(ap); -+#endif -+ return loaded; -+} -+#endif -+ - #if !defined(_WIN32) - - typedef struct TAPState { -@@ -3470,11 +3501,59 @@ - char *dev; - struct stat s; - -+#ifdef __FreeBSD__ -+ int i, kldtried = 0, enoentcount = 0, err = 0; -+ char dname[100]; -+#ifdef USE_DEVTAP -+ /* -+ * 5.x has /dev/tap, but that seems to just blindly increase its -+ * couter on every open() for some people(??), i.e. on every qemu run. -+ */ -+ i = -1; -+#else -+ i = 0; -+#endif -+ for (; i < 10; i++) { -+ if (*ifname) -+ snprintf(dname, sizeof dname, "/dev/%s", ifname); -+ else if (i == -1) -+ strcpy(dname, "/dev/tap"); -+ else -+ snprintf(dname, sizeof dname, "%s%d", -+ "/dev/tap", i); -+ TFR(fd = open(dname, O_RDWR)); -+ if (fd >= 0) -+ break; -+ else if (errno == ENXIO || errno == ENOENT) { -+ if (i == 0 && !kldtried++) { -+ /* -+ * Attempt to load the tunnel interface KLD if it isn't loaded -+ * already. -+ */ -+ if (loadmodules(LOAD_VERBOSLY, "if_tap", NULL)) -+ i = -1; -+ continue; -+ } -+ if (errno != ENOENT || ++enoentcount > 3) { -+ err = errno; -+ break; -+ } -+ } else -+ err = errno; -+ if (*ifname) -+ break; -+ } -+ if (fd < 0) { -+ fprintf(stderr, "warning: could not open %s (%s): no virtual network emulation\n", dname, strerror(err)); -+ return -1; -+ } -+#else - TFR(fd = open("/dev/tap", O_RDWR)); - if (fd < 0) { -- fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n"); -+ fprintf(stderr, "warning: could not open /dev/tap (%s): no virtual network emulation\n", strerror(errno)); - return -1; - } -+#endif - - fstat(fd, &s); - dev = devname(s.st_rdev, S_IFCHR); diff --git a/emulators/qemu/files/patch-qemu_Makefiles b/emulators/qemu/files/patch-qemu_Makefiles new file mode 100644 index 000000000000..27c544f14341 --- /dev/null +++ b/emulators/qemu/files/patch-qemu_Makefiles @@ -0,0 +1,36 @@ +Index: qemu/Makefile +@@ -19,6 +19,7 @@ + CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@ + CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + CPPFLAGS += -U_FORTIFY_SOURCE ++CPPFLAGS += -DSMBD_COMMAND=\"${LOCALBASE}/sbin/smbd\" -I${LOCALBASE}/include -DPREFIX=\"${PREFIX}\" + LIBS= + ifdef CONFIG_STATIC + LDFLAGS += -static +Index: qemu/Makefile.target +@@ -54,6 +54,7 @@ + + CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + CPPFLAGS+=-U_FORTIFY_SOURCE ++CPPFLAGS+=-DSMBD_COMMAND=\"${LOCALBASE}/sbin/smbd\" -I${LOCALBASE}/include -DPREFIX=\"${PREFIX}\" + LIBS+=-lm + ifdef CONFIG_WIN32 + LIBS+=-lwinmm -lws2_32 -liphlpapi +Index: qemu/net.h +@@ -99,12 +99,14 @@ + int slirp_is_inited(void); + void net_client_check(void); + +-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" +-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" ++#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" ++#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" ++#ifndef SMBD_COMMAND + #ifdef __sun__ + #define SMBD_COMMAND "/usr/sfw/sbin/smbd" + #else + #define SMBD_COMMAND "/usr/sbin/smbd" + #endif ++#endif + + #endif diff --git a/emulators/qemu/files/patch-qemu_configure_1 b/emulators/qemu/files/patch-qemu_configure_1 new file mode 100644 index 000000000000..cc7638d0f26e --- /dev/null +++ b/emulators/qemu/files/patch-qemu_configure_1 @@ -0,0 +1,10 @@ +Index: qemu/configure +@@ -868,7 +868,7 @@ + sdl_too_old=no + + if test "$sdl" = "yes" ; then +- sdl_config="sdl-config" ++ sdl_config="${SDL_CONFIG}" + sdl=no + sdl_static=no + diff --git a/emulators/qemu/files/patch-qemu_configure_2 b/emulators/qemu/files/patch-qemu_configure_2 new file mode 100644 index 000000000000..b8b49a136432 --- /dev/null +++ b/emulators/qemu/files/patch-qemu_configure_2 @@ -0,0 +1,10 @@ +Index: qemu/configure +@@ -570,7 +570,7 @@ + if test -z "$prefix" ; then + prefix="/usr/local" + fi +- mansuffix="/share/man" ++ mansuffix="/man" + datasuffix="/share/qemu" + docsuffix="/share/doc/qemu" + binsuffix="/bin" diff --git a/emulators/qemu/files/patch-qemu_net.c b/emulators/qemu/files/patch-qemu_net.c new file mode 100644 index 000000000000..69e70482fefc --- /dev/null +++ b/emulators/qemu/files/patch-qemu_net.c @@ -0,0 +1,109 @@ +Index: qemu/net.c +@@ -76,6 +76,11 @@ + #endif + #endif + #endif ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#endif + + #if defined(CONFIG_SLIRP) + #include "libslirp.h" +@@ -3407,6 +3410,34 @@ + + #endif /* CONFIG_SLIRP */ + ++#ifdef __FreeBSD__ ++#define LOAD_QUIETLY 1 ++#define LOAD_VERBOSLY 2 ++ ++static int ++loadmodules(int how, const char *module, ...) ++{ ++ int loaded = 0; ++ va_list ap; ++ ++ va_start(ap, module); ++#ifndef NO_MODULES ++ while (module != NULL) { ++ if (modfind(module) == -1) { ++ if (kldload(module) == -1) { ++ if (how == LOAD_VERBOSLY) ++ fprintf(stderr, "%s: Cannot load module\n", module); ++ } else ++ loaded++; ++ } ++ module = va_arg(ap, const char *); ++ } ++ va_end(ap); ++#endif ++ return loaded; ++} ++#endif ++ + #if !defined(_WIN32) + + typedef struct TAPState { +@@ -3470,11 +3501,59 @@ + char *dev; + struct stat s; + ++#ifdef __FreeBSD__ ++ int i, kldtried = 0, enoentcount = 0, err = 0; ++ char dname[100]; ++#ifdef USE_DEVTAP ++ /* ++ * 5.x has /dev/tap, but that seems to just blindly increase its ++ * couter on every open() for some people(??), i.e. on every qemu run. ++ */ ++ i = -1; ++#else ++ i = 0; ++#endif ++ for (; i < 10; i++) { ++ if (*ifname) ++ snprintf(dname, sizeof dname, "/dev/%s", ifname); ++ else if (i == -1) ++ strcpy(dname, "/dev/tap"); ++ else ++ snprintf(dname, sizeof dname, "%s%d", ++ "/dev/tap", i); ++ TFR(fd = open(dname, O_RDWR)); ++ if (fd >= 0) ++ break; ++ else if (errno == ENXIO || errno == ENOENT) { ++ if (i == 0 && !kldtried++) { ++ /* ++ * Attempt to load the tunnel interface KLD if it isn't loaded ++ * already. ++ */ ++ if (loadmodules(LOAD_VERBOSLY, "if_tap", NULL)) ++ i = -1; ++ continue; ++ } ++ if (errno != ENOENT || ++enoentcount > 3) { ++ err = errno; ++ break; ++ } ++ } else ++ err = errno; ++ if (*ifname) ++ break; ++ } ++ if (fd < 0) { ++ fprintf(stderr, "warning: could not open %s (%s): no virtual network emulation\n", dname, strerror(err)); ++ return -1; ++ } ++#else + TFR(fd = open("/dev/tap", O_RDWR)); + if (fd < 0) { +- fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n"); ++ fprintf(stderr, "warning: could not open /dev/tap (%s): no virtual network emulation\n", strerror(errno)); + return -1; + } ++#endif + + fstat(fd, &s); + dev = devname(s.st_rdev, S_IFCHR); diff --git a/emulators/qemu/files/patch-qemu_slirp_slirp_config.h b/emulators/qemu/files/patch-qemu_slirp_slirp_config.h new file mode 100644 index 000000000000..57cc889e3119 --- /dev/null +++ b/emulators/qemu/files/patch-qemu_slirp_slirp_config.h @@ -0,0 +1,37 @@ +Index: qemu/slirp/slirp_config.h +@@ -86,7 +86,7 @@ + #undef BAD_SPRINTF + + /* Define if you have readv */ +-#undef HAVE_READV ++#define HAVE_READV + + /* Define if iovec needs to be declared */ + #undef DECLARE_IOVEC +@@ -95,7 +95,7 @@ + #undef DECLARE_SPRINTF + + /* Define if you have a POSIX.1 sys/wait.h */ +-#undef HAVE_SYS_WAIT_H ++#define HAVE_SYS_WAIT_H + + /* Define if you have sys/select.h */ + #define HAVE_SYS_SELECT_H +@@ -107,7 +107,7 @@ + #define HAVE_ARPA_INET_H + + /* Define if you have sys/signal.h */ +-#undef HAVE_SYS_SIGNAL_H ++#define HAVE_SYS_SIGNAL_H + + /* Define if you have sys/stropts.h */ + #undef HAVE_SYS_STROPTS_H +@@ -180,7 +180,7 @@ + #undef HAVE_GRANTPT + + /* Define if you have fchmod */ +-#undef HAVE_FCHMOD ++#define HAVE_FCHMOD + + /* Define if you have */ + #undef HAVE_SYS_TYPES32_H diff --git a/emulators/sim6811/files/patch-ab b/emulators/sim6811/files/patch-ab deleted file mode 100644 index 58b932f662ee..000000000000 --- a/emulators/sim6811/files/patch-ab +++ /dev/null @@ -1,76 +0,0 @@ -*** sim6811.1~ Wed Sep 6 10:58:03 1995 ---- sim6811.1 Wed Sep 6 10:59:11 1995 -*************** -*** 0 **** ---- 1,71 ---- -+ .Dd June 5, 1993 -+ .Dt sim6811 1 -+ .Os BSD 4 -+ .Sh NAME -+ .Nm sim6811 -+ .Nd very simple and crude simulator for the 6811 -+ .Sh SYNOPSIS -+ .Nm sim6811 -+ .Ar s19-file -+ .Sh DESCRIPTION -+ .Ar s19-file -+ is a Motorola s19 assembler output file -+ -+ some instructions aren't there yet (notably converning multiplication -+ and interrupts) and the interface only allows stepping. this should -+ be easily rectifiable, however, and the simple structure should make -+ grafting on a graphical interface quite simple. -+ -+ to run the simulator, just provide the name of an object file on the -+ command line. the object file must be in s19 format, and must include -+ a reset vector in order to tell the simulator where to start -+ execution. simulation proceeds one instruction at a time, with a -+ register and page zero memory dump being performed at each step. -+ -+ several simple commands are supported, but additional commands to -+ modify memory, cause interrupts and simulate the special registers -+ would all be nice, and relatively easy to add. -+ -+ .Sh COMMANDS -+ -+ The current -+ .Nm sim6811 -+ command set includes -+ -+ .Bl -tag -width Ds -+ -+ .Nm l [address [n]] -+ .br -+ .ti 8 -+ disassemble n instructions starting at address -+ -+ .Nm g [address [n]] -+ .br -+ .ti 8 -+ go starting at address for n steps. -+ -+ .Nm s [n] -+ .br -+ .ti 8 -+ step n times (n=1 default) -+ -+ .Nm b [address[cnt]] -+ .br -+ .ti 8 -+ set a breakpoint, which will stop cnt times -+ -+ .Nm t [address[cnt]] -+ .br -+ .ti 8 -+ set a temporary breakpoint. -+ -+ .Nm -+ .br -+ .ti 8 -+ step once -+ -+ .Sh HISTORY -+ .Nm sim6811 -+ was written by Ted Dunning . This manual page was created out of -+ various C-sources by Eric L. Hernes . Some example sources -+ and s19 files can be found in ftp://crl.nmsu.edu/pub/non-lexical/6811 diff --git a/emulators/sim6811/files/patch-ac b/emulators/sim6811/files/patch-ac deleted file mode 100644 index 4553b0f45d3c..000000000000 --- a/emulators/sim6811/files/patch-ac +++ /dev/null @@ -1,37 +0,0 @@ ---- main.c.orig Tue Mar 22 17:16:59 1994 -+++ main.c Tue Aug 10 21:28:07 2004 -@@ -70,13 +70,6 @@ - #include - #include "sim.h" - --extern int printf(); --extern int fprintf(); --extern int fclose(); --extern int fscanf(); --extern int sscanf(); --extern int fflush(); -- - /* how to handle all other op codes */ - void bad_op(m6811 state) - { -@@ -323,19 +316,7 @@ - - case '?': /* help */ - (void) fgets(line, sizeof(line), stdin); -- printf( -- " -- -- (empty line) step once --s [n] step n times --b [add [n]] set break at add which will survive n hits --g [add [n]] set pc to add, step n times --l [add [n]] list n lines of disassembly starting from pc --m add n set specified memory location to n --R Reset memory, regs and reload code --t [add [n]] set temporary break at add which will survive n hits --q or EOF exit simulator --? print this list\n\n"); -+ printf("\n\n (empty line) step once\ns [n] step n times\nb [add [n]] set break at add which will survive n hits\ng [add [n]] set pc to add, step n times\nl [add [n]] list n lines of disassembly starting from pc\nm add n set specified memory location to n\nR Reset memory, regs and reload code\nt [add [n]] set temporary break at add which will survive n hits\nq or EOF exit simulator\n? print this list\n\n"); - printf("hit return to continue"); - fflush(stdout); - fgets(line, sizeof(line), stdin); diff --git a/emulators/sim6811/files/patch-main.c b/emulators/sim6811/files/patch-main.c new file mode 100644 index 000000000000..4553b0f45d3c --- /dev/null +++ b/emulators/sim6811/files/patch-main.c @@ -0,0 +1,37 @@ +--- main.c.orig Tue Mar 22 17:16:59 1994 ++++ main.c Tue Aug 10 21:28:07 2004 +@@ -70,13 +70,6 @@ + #include + #include "sim.h" + +-extern int printf(); +-extern int fprintf(); +-extern int fclose(); +-extern int fscanf(); +-extern int sscanf(); +-extern int fflush(); +- + /* how to handle all other op codes */ + void bad_op(m6811 state) + { +@@ -323,19 +316,7 @@ + + case '?': /* help */ + (void) fgets(line, sizeof(line), stdin); +- printf( +- " +- +- (empty line) step once +-s [n] step n times +-b [add [n]] set break at add which will survive n hits +-g [add [n]] set pc to add, step n times +-l [add [n]] list n lines of disassembly starting from pc +-m add n set specified memory location to n +-R Reset memory, regs and reload code +-t [add [n]] set temporary break at add which will survive n hits +-q or EOF exit simulator +-? print this list\n\n"); ++ printf("\n\n (empty line) step once\ns [n] step n times\nb [add [n]] set break at add which will survive n hits\ng [add [n]] set pc to add, step n times\nl [add [n]] list n lines of disassembly starting from pc\nm add n set specified memory location to n\nR Reset memory, regs and reload code\nt [add [n]] set temporary break at add which will survive n hits\nq or EOF exit simulator\n? print this list\n\n"); + printf("hit return to continue"); + fflush(stdout); + fgets(line, sizeof(line), stdin); diff --git a/emulators/sim6811/files/patch-sim6811.1 b/emulators/sim6811/files/patch-sim6811.1 new file mode 100644 index 000000000000..58b932f662ee --- /dev/null +++ b/emulators/sim6811/files/patch-sim6811.1 @@ -0,0 +1,76 @@ +*** sim6811.1~ Wed Sep 6 10:58:03 1995 +--- sim6811.1 Wed Sep 6 10:59:11 1995 +*************** +*** 0 **** +--- 1,71 ---- ++ .Dd June 5, 1993 ++ .Dt sim6811 1 ++ .Os BSD 4 ++ .Sh NAME ++ .Nm sim6811 ++ .Nd very simple and crude simulator for the 6811 ++ .Sh SYNOPSIS ++ .Nm sim6811 ++ .Ar s19-file ++ .Sh DESCRIPTION ++ .Ar s19-file ++ is a Motorola s19 assembler output file ++ ++ some instructions aren't there yet (notably converning multiplication ++ and interrupts) and the interface only allows stepping. this should ++ be easily rectifiable, however, and the simple structure should make ++ grafting on a graphical interface quite simple. ++ ++ to run the simulator, just provide the name of an object file on the ++ command line. the object file must be in s19 format, and must include ++ a reset vector in order to tell the simulator where to start ++ execution. simulation proceeds one instruction at a time, with a ++ register and page zero memory dump being performed at each step. ++ ++ several simple commands are supported, but additional commands to ++ modify memory, cause interrupts and simulate the special registers ++ would all be nice, and relatively easy to add. ++ ++ .Sh COMMANDS ++ ++ The current ++ .Nm sim6811 ++ command set includes ++ ++ .Bl -tag -width Ds ++ ++ .Nm l [address [n]] ++ .br ++ .ti 8 ++ disassemble n instructions starting at address ++ ++ .Nm g [address [n]] ++ .br ++ .ti 8 ++ go starting at address for n steps. ++ ++ .Nm s [n] ++ .br ++ .ti 8 ++ step n times (n=1 default) ++ ++ .Nm b [address[cnt]] ++ .br ++ .ti 8 ++ set a breakpoint, which will stop cnt times ++ ++ .Nm t [address[cnt]] ++ .br ++ .ti 8 ++ set a temporary breakpoint. ++ ++ .Nm ++ .br ++ .ti 8 ++ step once ++ ++ .Sh HISTORY ++ .Nm sim6811 ++ was written by Ted Dunning . This manual page was created out of ++ various C-sources by Eric L. Hernes . Some example sources ++ and s19 files can be found in ftp://crl.nmsu.edu/pub/non-lexical/6811 diff --git a/emulators/snes9x/files/patch-ad b/emulators/snes9x/files/patch-ad deleted file mode 100644 index 138e6414fde7..000000000000 --- a/emulators/snes9x/files/patch-ad +++ /dev/null @@ -1,29 +0,0 @@ ---- memmap.cpp 2007-10-03 11:11:07.000000000 -0500 -+++ memmap.cpp 2007-10-03 11:11:34.000000000 -0500 -@@ -169,7 +169,7 @@ - #include - #include - --#ifdef __linux -+#if defined(__linux) || defined(__FreeBSD__) - #include - #endif - -@@ -1473,7 +1473,7 @@ - { - fwrite((char *) Multi.sramB, size, 1, file); - fclose(file); --#ifdef __linux -+#if defined(__linux) || defined(__FreeBSD__) - chown(name, getuid(), getgid()); - #endif - } -@@ -1502,7 +1502,7 @@ - { - fwrite((char *) SRAM, size, 1, file); - fclose(file); --#ifdef __linux -+#if defined(__linux) || defined(__FreeBSD__) - chown(sramName, getuid(), getgid()); - #endif - if (Settings.SPC7110RTC) diff --git a/emulators/snes9x/files/patch-ae b/emulators/snes9x/files/patch-ae deleted file mode 100644 index ad032b66b036..000000000000 --- a/emulators/snes9x/files/patch-ae +++ /dev/null @@ -1,13 +0,0 @@ ---- port.h.orig Fri Jun 30 08:40:56 2006 -+++ port.h Tue Dec 26 23:09:22 2006 -@@ -360,6 +360,10 @@ - #define SYS_CONFIG_FILE "/etc/snes9x/snes9x.conf" - #endif - -+#ifdef __FreeBSD__ -+#define TITLE "Snes9X: FreeBSD" -+#endif -+ - #ifndef TITLE - #define TITLE "Snes9x" - #endif diff --git a/emulators/snes9x/files/patch-af b/emulators/snes9x/files/patch-af deleted file mode 100644 index 4f6d59b7a753..000000000000 --- a/emulators/snes9x/files/patch-af +++ /dev/null @@ -1,455 +0,0 @@ ---- unix/unix.cpp 2007-04-28 19:51:08.000000000 -0500 -+++ unix/unix.cpp 2007-10-03 16:53:16.000000000 -0500 -@@ -173,7 +173,7 @@ - #include - #include - /* FIXME: Linux alpha (aristocat) has a broken timercmp. Make testcase */ --#if defined(__linux) -+#if defined(__linux) || defined(__FreeBSD__) - # ifndef timercmp - # define timercmp(tvp, uvp, cmp)\ - ((tvp)->tv_sec cmp (uvp)->tv_sec ||\ -@@ -197,7 +197,7 @@ - pthread_mutex_t mutex; - #endif - --#if !defined(NOSOUND) && defined(__linux) -+#if !defined(NOSOUND) && (defined(__linux) || defined(__FreeBSD__)) - #include - #include - #endif -@@ -210,6 +210,11 @@ - #endif - #endif - -+#if defined(__FreeBSD__) -+typedef sig_t SIG_PF; -+#include -+#endif -+ - //Breaks sol9 and probably others. - //#if defined(__sun) && defined(__GNUC__) - //typedef void (*SIG_PF)(); -@@ -233,11 +238,12 @@ - - #ifdef NETPLAY_SUPPORT - #include "netplay.h" -- - #ifdef _DEBUG - #define NP_DEBUG 2 - #endif -+#endif - -+#if defined(NETPLAY_SUPPORT) || defined(JOYSTICK_SUPPORT) - /* accessors into controls.cpp static variables */ - uint16 MovieGetJoypad(int i); - void MovieSetJoypad(int i, uint16 buttons); -@@ -245,22 +251,86 @@ - /* Joypads status information */ - uint32 old_joypads[8]; - uint32 joypads[8]; -- - #endif - - #ifdef JOYSTICK_SUPPORT -+#define JOYSTICK_MAX_DEVICES 4 -+int JoystickShift = 0; -+uint8 js_mod [8] = {0, 0, 0, 0, 0, 0, 0, 0}; - #if defined(__linux) -+#define JOYSTICK_MAX_BUTTONS 4 - #include --uint8 js_mod [8] = {0, 0, 0, 0, 0, 0, 0, 0}; - int js_fd [8] = {-1, -1, -1, -1, -1, -1, -1, -1}; - char *js_device [8] = {"/dev/js0", "/dev/js1", "/dev/js2", "/dev/js3", "/dev/js4", "/dev/js5", "/dev/js6", "/dev/js7" }; - #endif - -+#if defined(__FreeBSD__) -+#include -+#include -+ -+extern "C" { -+#define class klass -+#include -+#include -+#undef class -+ -+#if __FreeBSD_version < 500111 -+#include -+#else -+#include -+#endif -+} -+ -+#define JOYSTICK_MAX_BUTTONS 16 -+ -+#define JOYSTICK_MAP_BUTTON_INITIALIZER \ -+ { \ -+ SNES_Y_MASK, SNES_B_MASK, SNES_A_MASK, \ -+ SNES_X_MASK, SNES_TL_MASK, SNES_TR_MASK, \ -+ SNES_TL_MASK, SNES_TR_MASK, \ -+ SNES_SELECT_MASK, SNES_START_MASK, 0, 0, 0, 0, 0, 0 \ -+ } -+ -+int js_map_button[JOYSTICK_MAX_BUTTONS][16] = { -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER, -+ JOYSTICK_MAP_BUTTON_INITIALIZER -+}; -+char *js_device [4] = {"/dev/uhid0", "/dev/uhid1", "/dev/uhid2", "/dev/uhid3"}; -+struct js_range { -+ int min, max, lower_third, higher_third; -+}; -+struct js_info { -+ char *buf; -+ int reportlen; -+ int offset; -+ struct js_range x, y; -+ int buttons; -+ struct hid_item *hids; -+ int fd; -+ int joy; -+} js_info[4]; -+int js_count = 0; -+#endif -+ - void InitJoysticks (); - void ReadJoysticks (); - #endif - --#if !defined(NOSOUND) && defined (__linux) -+#if !defined(NOSOUND) && (defined (__linux) || defined(__FreeBSD__)) - #define CONFIGURABLE_SOUND_DEVICE - char *sound_device = "/dev/dsp"; - #endif -@@ -285,7 +355,7 @@ - const char *inc_format="%03d"; - - //FIXME: I see no reason not to configureenable this for all Unixen --#if defined(DEBUGGER) && (defined(__linux) || defined(__sun)) -+#if defined(DEBUGGER) && (defined(__linux) || defined(__sun) || defined(__FreeBSD__)) - static void sigbrkhandler(int) - { - CPU.Flags |= DEBUG_MODE_FLAG; -@@ -326,22 +396,54 @@ - - void S9xParseArg (char **argv, int &i, int argc) - { -+#ifdef JOYSTICK_SUPPORT - if (strcmp (argv [i], "-j") == 0 || - strcasecmp (argv [i], "-nojoy") == 0) { --#ifdef JOYSTICK_SUPPORT - Settings.JoystickEnabled = FALSE; -+ } -+ -+#ifdef __FreeBSD__ -+ else if (strcasecmp(argv[i], "-joyshift") == 0) -+ JoystickShift = 1; -+#endif -+ else if (strncasecmp(argv[i], "-joydev", sizeof("-joydev") - 1) == 0) { -+ char *end, *snum = argv[i] + sizeof("-joydev") - 1; -+ unsigned long num; -+ -+ if (*snum == '\0' || argc < i + 1) -+ S9xUsage(); -+ if ((num = strtoul(snum, &end, 10)) < JOYSTICK_MAX_DEVICES && -+ num > 0 && *end == '\0') -+ js_device[num - 1] = argv[++i]; -+ else -+ S9xUsage (); -+ } -+ else if (strncasecmp(argv[i], "-joymap", sizeof("-joymap") - 1) == 0) { -+ static const int button_masks[] = { -+ SNES_A_MASK, SNES_B_MASK, SNES_X_MASK, SNES_Y_MASK, -+ SNES_TL_MASK, SNES_TR_MASK, SNES_START_MASK, SNES_SELECT_MASK -+ }; -+ char *end, *snum = argv[i] + sizeof("-joymap") - 1; -+ unsigned long num; -+ int *js_buttons, b; -+ -+ if (argc < i + (sizeof(button_masks) / sizeof(int)) || *snum == '\0') -+ S9xUsage(); -+ num = strtoul(snum, &end, 10); -+ if (*end != '\0') -+ S9xUsage(); -+ if (num == 0 || num > 4) /* hardcode: max joysticks */ -+ S9xUsage(); -+ js_buttons = js_map_button[num - 1]; -+ for (b = 0; b < (sizeof(button_masks) / sizeof(int)); b++) -+ if ((num = strtoul(argv[++i], &end, 10)) <= 16 && num != 0 && -+ *end == '\0') -+ js_buttons[num - 1] = button_masks[b]; -+ } -+ -+ else - #endif -- } else if (strncasecmp (argv [i], "-joydev", 7) == 0 && argv[i][7]>='1' && argv[i][7]<='8' && argv[i][8]=='\0') -- { -- int j = argv[i][7]-'1'; -- if (i + 1 < argc) { --#ifdef JOYSTICK_SUPPORT -- js_device[j] = argv[++i]; --#else -- S9xMessage(S9X_WARNING, S9X_USAGE, "Joystick support is not available!"); --#endif -- } else S9xUsage (); -- } else if (strcasecmp (argv [i], "-sounddev") == 0) { -+ if (strcasecmp (argv [i], "-sounddev") == 0) { - if (i + 1 < argc) { - #if defined(CONFIGURABLE_SOUND_DEVICE) - sound_device = argv[++i]; -@@ -552,7 +654,7 @@ - #if !defined(__MSDOS) && defined(DEBUGGER) - #if defined(__unix) && !defined(__NeXT__) - struct sigaction sa; --#if defined(__linux) -+#if defined(__linux) || defined(__FreeBSD__) - sa.sa_handler = sigbrkhandler; - #else - sa.sa_handler = (SIG_PF) sigbrkhandler; -@@ -770,6 +872,7 @@ - } - - #ifdef JOYSTICK_SUPPORT -+#ifdef __linux - void InitJoysticks () - { - #ifdef JSIOCGVERSION -@@ -854,6 +957,189 @@ - } - #endif - } -+#endif -+#if defined(__FreeBSD__) -+ -+/* -+ * USB HID code for FreeBSD/NetBSD -+ * Brian Feldman -+ * -+ * Reference used: -+ * X-Mame USB HID joystick driver for NetBSD. -+ * -+ * Written by Krister Walfridsson -+ */ -+ -+int -+InitJoystickFd(int fd, char *dev) { -+ report_desc_t rd; -+ struct hid_data *d; -+ struct hid_item h, new_h; -+ struct js_info *my_info; -+ int reportlen, report_id, is_joystick; -+ -+ my_info = &js_info[js_count]; -+ rd = hid_get_report_desc(fd); -+ if (rd == 0) { -+ warn("%s", dev); -+ return (-1); -+ } -+ report_id = 0; -+#if __FreeBSD_version < 500111 -+ reportlen = hid_report_size(rd, report_id, hid_input); -+#else -+ reportlen = hid_report_size(rd, hid_input, report_id); -+#endif -+ my_info->buf = (char *)malloc(reportlen); -+ if (my_info->buf == NULL) -+ err(1, "malloc"); -+ my_info->reportlen = reportlen; -+ my_info->offset = report_id != 0; -+ my_info->buttons = 0; -+ my_info->hids = NULL; -+ -+ is_joystick = 0; -+#if __FreeBSD_version < 500111 -+ for (d = hid_start_parse(rd, 1 << hid_input); -+#else -+ for (d = hid_start_parse(rd, 1 << hid_input, report_id); -+#endif -+ hid_get_item(d, &h);) { -+ int usage, page, link_it = 0; -+ struct js_range *axis; -+ -+ page = HID_PAGE(h.usage); -+ usage = HID_USAGE(h.usage); -+ if (!is_joystick) -+ is_joystick = (h.kind == hid_collection && -+ page == HUP_GENERIC_DESKTOP && -+ (usage == HUG_JOYSTICK || usage == HUG_GAME_PAD)); -+ if (h.kind != hid_input || !is_joystick) -+ continue; -+ axis = NULL; -+ if (page == HUP_GENERIC_DESKTOP) { -+ switch (usage) { -+ case HUG_X: -+ case HUG_RX: -+ axis = &my_info->x; -+ break; -+ case HUG_Y: -+ case HUG_RY: -+ axis = &my_info->y; -+ break; -+ } -+ } -+ if (axis != NULL) { -+ axis->min = h.logical_minimum; -+ axis->max = h.logical_maximum; -+ axis->lower_third = axis->min + -+ (axis->max - axis->min) / 3; -+ axis->higher_third = axis->min + -+ (axis->max - axis->min) * 2 / 3; -+ link_it = 1; -+ } -+ if (!link_it) { -+ if (page != HUP_BUTTON || usage > 16) -+ continue; -+ if (usage > my_info->buttons) -+ my_info->buttons = usage; -+ } -+ new_h = h; -+ new_h.next = my_info->hids; -+ my_info->hids = (struct hid_item *) -+ malloc(sizeof(*my_info->hids)); -+ if (my_info->hids == NULL) -+ err(1, "malloc"); -+ *my_info->hids = new_h; -+ } -+ printf("Joystick %s: %d buttons, X range %d - %d, Y range %d - %d\n", -+ dev, my_info->buttons, my_info->x.min, my_info->x.max, -+ my_info->y.min, my_info->y.max); -+ my_info->fd = fd; -+ if (JoystickShift) { -+ my_info->joy = js_count + 1; -+ } else -+ my_info->joy = js_count; -+ return (0); -+} -+ -+void -+InitJoysticks() { -+ int i, fd; -+ -+ for (i = 0; i < (sizeof(js_device) / sizeof(js_device[0])); i++) { -+ fd = open(js_device[i], O_RDONLY | O_NONBLOCK); -+ if (fd == -1) -+ continue; -+ if (InitJoystickFd(fd, js_device[i]) == 0) -+ js_count++; -+ else -+ close(fd); -+ } -+} -+ -+void -+ReadJoysticks() { -+ struct hid_item *h; -+ int page, usage, njoy, joy; -+ -+ for (njoy = 0; njoy < js_count; njoy++) { -+ struct js_info *jsi; -+ -+ jsi = &js_info[njoy]; -+ joy = jsi->joy; -+ -+ if (read(jsi->fd, jsi->buf, jsi->reportlen) != jsi->reportlen) -+ continue; -+ for (h = jsi->hids; h != NULL; h = h->next) { -+ int d; -+ -+ d = hid_get_data(jsi->buf + jsi->offset, h); -+ page = HID_PAGE(h->usage); -+ usage = HID_USAGE(h->usage); -+ -+ switch (page) { -+ case HUP_GENERIC_DESKTOP: -+ switch (usage) { -+ case HUG_X: -+ case HUG_RX: -+ if (d < jsi->x.lower_third) { -+ joypads[joy] |= SNES_LEFT_MASK; -+ joypads[joy] &= ~SNES_RIGHT_MASK; -+ } else if (d < jsi->x.higher_third) { -+ joypads[joy] &= ~SNES_LEFT_MASK; -+ joypads[joy] &= ~SNES_RIGHT_MASK; -+ } else { -+ joypads[joy] &= ~SNES_LEFT_MASK; -+ joypads[joy] |= SNES_RIGHT_MASK; -+ } -+ break; -+ case HUG_Y: -+ case HUG_RY: -+ if (d < jsi->y.lower_third) { -+ joypads[joy] |= SNES_UP_MASK; -+ joypads[joy] &= ~SNES_DOWN_MASK; -+ } else if (d < jsi->y.higher_third) { -+ joypads[joy] &= ~SNES_UP_MASK; -+ joypads[joy] &= ~SNES_DOWN_MASK; -+ } else { -+ joypads[joy] &= ~SNES_UP_MASK; -+ joypads[joy] |= SNES_DOWN_MASK; -+ } -+ break; -+ } -+ break; -+ case HUP_BUTTON: -+ if (d) -+ joypads[joy] |= js_map_button[njoy][usage - 1]; -+ else -+ joypads[joy] &= ~js_map_button[njoy][usage - 1]; -+ break; -+ } -+ } -+ } -+} -+#endif // defined(__FreeBSD__) - #endif // defined (JOYSTICK_SUPPORT) - - START_EXTERN_C -@@ -1716,7 +2002,7 @@ - } - #endif - --#if !defined(NOSOUND) && defined(__linux) -+#if !defined(NOSOUND) && (defined(__linux) || defined(__FreeBSD__)) - static int Rates[8] = - { - 0, 8000, 11025, 16000, 22050, 32000, 44100, 48000 -@@ -1847,7 +2133,7 @@ - #endif - - --#if !defined(NOSOUND) && (defined (__linux) || defined (__sun)) -+#if !defined(NOSOUND) && (defined (__linux) || defined (__sun) || defined(__FreeBSD__)) - void S9xUnixProcessSound (void) - { - } -@@ -1890,7 +2176,7 @@ - } - #endif - --#if !defined(NOSOUND) && (defined (__linux) || defined (__sun)) -+#if !defined(NOSOUND) && (defined (__linux) || defined (__sun) || defined(__FreeBSD__)) - void S9xGenerateSound () - { - /* Linux and Sun versions */ -@@ -1985,7 +2271,7 @@ - /* If not, this will be called by timer */ - if (Settings.Mute) - return NULL; --#ifdef __linux -+#if defined(__linux) || defined(__FreeBSD__) - audio_buf_info info; - - if (!Settings.ThreadSound && diff --git a/emulators/snes9x/files/patch-ag b/emulators/snes9x/files/patch-ag deleted file mode 100644 index eaac096d8699..000000000000 --- a/emulators/snes9x/files/patch-ag +++ /dev/null @@ -1,32 +0,0 @@ -diff -ru ../../work/release/unix/xf86.cpp ./unix/xf86.cpp ---- ../../work/release/unix/xf86.cpp Tue Sep 22 06:36:50 1998 -+++ ./unix/xf86.cpp Wed Dec 29 01:54:04 1999 -@@ -4,16 +4,20 @@ - Question/comments regarding this file only: maciej@imsa.edu - */ - --#ifdef __linux -+#if defined(__linux) || defined(__FreeBSD__) - //#define USE_XF86VIDMODE - -+#ifdef __linux - #include -+#endif -+#include - #include - #include -+#ifdef __linux - #include -+#endif - - #include --#include - - #include - #include -@@ -833,4 +837,4 @@ - ret = 1; - return (ret); - } --#endif /* __linux */ -+#endif /* __linux || __FreeBSD__ */ diff --git a/emulators/snes9x/files/patch-ah b/emulators/snes9x/files/patch-ah deleted file mode 100644 index dcd11e451271..000000000000 --- a/emulators/snes9x/files/patch-ah +++ /dev/null @@ -1,24 +0,0 @@ ---- unzip/unzip.h 2007-10-03 12:28:47.000000000 -0500 -+++ unzip/unzip.h 2007-10-03 12:30:22.000000000 -0500 -@@ -41,14 +41,18 @@ - #ifndef _unz_H - #define _unz_H - --#ifdef __cplusplus --extern "C" { --#endif -+#include - - #ifndef _ZLIB_H - #include - #endif - -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#define ZEXPORT -+ - #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) - /* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ diff --git a/emulators/snes9x/files/patch-memmap.cpp b/emulators/snes9x/files/patch-memmap.cpp new file mode 100644 index 000000000000..138e6414fde7 --- /dev/null +++ b/emulators/snes9x/files/patch-memmap.cpp @@ -0,0 +1,29 @@ +--- memmap.cpp 2007-10-03 11:11:07.000000000 -0500 ++++ memmap.cpp 2007-10-03 11:11:34.000000000 -0500 +@@ -169,7 +169,7 @@ + #include + #include + +-#ifdef __linux ++#if defined(__linux) || defined(__FreeBSD__) + #include + #endif + +@@ -1473,7 +1473,7 @@ + { + fwrite((char *) Multi.sramB, size, 1, file); + fclose(file); +-#ifdef __linux ++#if defined(__linux) || defined(__FreeBSD__) + chown(name, getuid(), getgid()); + #endif + } +@@ -1502,7 +1502,7 @@ + { + fwrite((char *) SRAM, size, 1, file); + fclose(file); +-#ifdef __linux ++#if defined(__linux) || defined(__FreeBSD__) + chown(sramName, getuid(), getgid()); + #endif + if (Settings.SPC7110RTC) diff --git a/emulators/snes9x/files/patch-port.h b/emulators/snes9x/files/patch-port.h new file mode 100644 index 000000000000..ad032b66b036 --- /dev/null +++ b/emulators/snes9x/files/patch-port.h @@ -0,0 +1,13 @@ +--- port.h.orig Fri Jun 30 08:40:56 2006 ++++ port.h Tue Dec 26 23:09:22 2006 +@@ -360,6 +360,10 @@ + #define SYS_CONFIG_FILE "/etc/snes9x/snes9x.conf" + #endif + ++#ifdef __FreeBSD__ ++#define TITLE "Snes9X: FreeBSD" ++#endif ++ + #ifndef TITLE + #define TITLE "Snes9x" + #endif diff --git a/emulators/snes9x/files/patch-unix_unix.cpp b/emulators/snes9x/files/patch-unix_unix.cpp new file mode 100644 index 000000000000..4f6d59b7a753 --- /dev/null +++ b/emulators/snes9x/files/patch-unix_unix.cpp @@ -0,0 +1,455 @@ +--- unix/unix.cpp 2007-04-28 19:51:08.000000000 -0500 ++++ unix/unix.cpp 2007-10-03 16:53:16.000000000 -0500 +@@ -173,7 +173,7 @@ + #include + #include + /* FIXME: Linux alpha (aristocat) has a broken timercmp. Make testcase */ +-#if defined(__linux) ++#if defined(__linux) || defined(__FreeBSD__) + # ifndef timercmp + # define timercmp(tvp, uvp, cmp)\ + ((tvp)->tv_sec cmp (uvp)->tv_sec ||\ +@@ -197,7 +197,7 @@ + pthread_mutex_t mutex; + #endif + +-#if !defined(NOSOUND) && defined(__linux) ++#if !defined(NOSOUND) && (defined(__linux) || defined(__FreeBSD__)) + #include + #include + #endif +@@ -210,6 +210,11 @@ + #endif + #endif + ++#if defined(__FreeBSD__) ++typedef sig_t SIG_PF; ++#include ++#endif ++ + //Breaks sol9 and probably others. + //#if defined(__sun) && defined(__GNUC__) + //typedef void (*SIG_PF)(); +@@ -233,11 +238,12 @@ + + #ifdef NETPLAY_SUPPORT + #include "netplay.h" +- + #ifdef _DEBUG + #define NP_DEBUG 2 + #endif ++#endif + ++#if defined(NETPLAY_SUPPORT) || defined(JOYSTICK_SUPPORT) + /* accessors into controls.cpp static variables */ + uint16 MovieGetJoypad(int i); + void MovieSetJoypad(int i, uint16 buttons); +@@ -245,22 +251,86 @@ + /* Joypads status information */ + uint32 old_joypads[8]; + uint32 joypads[8]; +- + #endif + + #ifdef JOYSTICK_SUPPORT ++#define JOYSTICK_MAX_DEVICES 4 ++int JoystickShift = 0; ++uint8 js_mod [8] = {0, 0, 0, 0, 0, 0, 0, 0}; + #if defined(__linux) ++#define JOYSTICK_MAX_BUTTONS 4 + #include +-uint8 js_mod [8] = {0, 0, 0, 0, 0, 0, 0, 0}; + int js_fd [8] = {-1, -1, -1, -1, -1, -1, -1, -1}; + char *js_device [8] = {"/dev/js0", "/dev/js1", "/dev/js2", "/dev/js3", "/dev/js4", "/dev/js5", "/dev/js6", "/dev/js7" }; + #endif + ++#if defined(__FreeBSD__) ++#include ++#include ++ ++extern "C" { ++#define class klass ++#include ++#include ++#undef class ++ ++#if __FreeBSD_version < 500111 ++#include ++#else ++#include ++#endif ++} ++ ++#define JOYSTICK_MAX_BUTTONS 16 ++ ++#define JOYSTICK_MAP_BUTTON_INITIALIZER \ ++ { \ ++ SNES_Y_MASK, SNES_B_MASK, SNES_A_MASK, \ ++ SNES_X_MASK, SNES_TL_MASK, SNES_TR_MASK, \ ++ SNES_TL_MASK, SNES_TR_MASK, \ ++ SNES_SELECT_MASK, SNES_START_MASK, 0, 0, 0, 0, 0, 0 \ ++ } ++ ++int js_map_button[JOYSTICK_MAX_BUTTONS][16] = { ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER, ++ JOYSTICK_MAP_BUTTON_INITIALIZER ++}; ++char *js_device [4] = {"/dev/uhid0", "/dev/uhid1", "/dev/uhid2", "/dev/uhid3"}; ++struct js_range { ++ int min, max, lower_third, higher_third; ++}; ++struct js_info { ++ char *buf; ++ int reportlen; ++ int offset; ++ struct js_range x, y; ++ int buttons; ++ struct hid_item *hids; ++ int fd; ++ int joy; ++} js_info[4]; ++int js_count = 0; ++#endif ++ + void InitJoysticks (); + void ReadJoysticks (); + #endif + +-#if !defined(NOSOUND) && defined (__linux) ++#if !defined(NOSOUND) && (defined (__linux) || defined(__FreeBSD__)) + #define CONFIGURABLE_SOUND_DEVICE + char *sound_device = "/dev/dsp"; + #endif +@@ -285,7 +355,7 @@ + const char *inc_format="%03d"; + + //FIXME: I see no reason not to configureenable this for all Unixen +-#if defined(DEBUGGER) && (defined(__linux) || defined(__sun)) ++#if defined(DEBUGGER) && (defined(__linux) || defined(__sun) || defined(__FreeBSD__)) + static void sigbrkhandler(int) + { + CPU.Flags |= DEBUG_MODE_FLAG; +@@ -326,22 +396,54 @@ + + void S9xParseArg (char **argv, int &i, int argc) + { ++#ifdef JOYSTICK_SUPPORT + if (strcmp (argv [i], "-j") == 0 || + strcasecmp (argv [i], "-nojoy") == 0) { +-#ifdef JOYSTICK_SUPPORT + Settings.JoystickEnabled = FALSE; ++ } ++ ++#ifdef __FreeBSD__ ++ else if (strcasecmp(argv[i], "-joyshift") == 0) ++ JoystickShift = 1; ++#endif ++ else if (strncasecmp(argv[i], "-joydev", sizeof("-joydev") - 1) == 0) { ++ char *end, *snum = argv[i] + sizeof("-joydev") - 1; ++ unsigned long num; ++ ++ if (*snum == '\0' || argc < i + 1) ++ S9xUsage(); ++ if ((num = strtoul(snum, &end, 10)) < JOYSTICK_MAX_DEVICES && ++ num > 0 && *end == '\0') ++ js_device[num - 1] = argv[++i]; ++ else ++ S9xUsage (); ++ } ++ else if (strncasecmp(argv[i], "-joymap", sizeof("-joymap") - 1) == 0) { ++ static const int button_masks[] = { ++ SNES_A_MASK, SNES_B_MASK, SNES_X_MASK, SNES_Y_MASK, ++ SNES_TL_MASK, SNES_TR_MASK, SNES_START_MASK, SNES_SELECT_MASK ++ }; ++ char *end, *snum = argv[i] + sizeof("-joymap") - 1; ++ unsigned long num; ++ int *js_buttons, b; ++ ++ if (argc < i + (sizeof(button_masks) / sizeof(int)) || *snum == '\0') ++ S9xUsage(); ++ num = strtoul(snum, &end, 10); ++ if (*end != '\0') ++ S9xUsage(); ++ if (num == 0 || num > 4) /* hardcode: max joysticks */ ++ S9xUsage(); ++ js_buttons = js_map_button[num - 1]; ++ for (b = 0; b < (sizeof(button_masks) / sizeof(int)); b++) ++ if ((num = strtoul(argv[++i], &end, 10)) <= 16 && num != 0 && ++ *end == '\0') ++ js_buttons[num - 1] = button_masks[b]; ++ } ++ ++ else + #endif +- } else if (strncasecmp (argv [i], "-joydev", 7) == 0 && argv[i][7]>='1' && argv[i][7]<='8' && argv[i][8]=='\0') +- { +- int j = argv[i][7]-'1'; +- if (i + 1 < argc) { +-#ifdef JOYSTICK_SUPPORT +- js_device[j] = argv[++i]; +-#else +- S9xMessage(S9X_WARNING, S9X_USAGE, "Joystick support is not available!"); +-#endif +- } else S9xUsage (); +- } else if (strcasecmp (argv [i], "-sounddev") == 0) { ++ if (strcasecmp (argv [i], "-sounddev") == 0) { + if (i + 1 < argc) { + #if defined(CONFIGURABLE_SOUND_DEVICE) + sound_device = argv[++i]; +@@ -552,7 +654,7 @@ + #if !defined(__MSDOS) && defined(DEBUGGER) + #if defined(__unix) && !defined(__NeXT__) + struct sigaction sa; +-#if defined(__linux) ++#if defined(__linux) || defined(__FreeBSD__) + sa.sa_handler = sigbrkhandler; + #else + sa.sa_handler = (SIG_PF) sigbrkhandler; +@@ -770,6 +872,7 @@ + } + + #ifdef JOYSTICK_SUPPORT ++#ifdef __linux + void InitJoysticks () + { + #ifdef JSIOCGVERSION +@@ -854,6 +957,189 @@ + } + #endif + } ++#endif ++#if defined(__FreeBSD__) ++ ++/* ++ * USB HID code for FreeBSD/NetBSD ++ * Brian Feldman ++ * ++ * Reference used: ++ * X-Mame USB HID joystick driver for NetBSD. ++ * ++ * Written by Krister Walfridsson ++ */ ++ ++int ++InitJoystickFd(int fd, char *dev) { ++ report_desc_t rd; ++ struct hid_data *d; ++ struct hid_item h, new_h; ++ struct js_info *my_info; ++ int reportlen, report_id, is_joystick; ++ ++ my_info = &js_info[js_count]; ++ rd = hid_get_report_desc(fd); ++ if (rd == 0) { ++ warn("%s", dev); ++ return (-1); ++ } ++ report_id = 0; ++#if __FreeBSD_version < 500111 ++ reportlen = hid_report_size(rd, report_id, hid_input); ++#else ++ reportlen = hid_report_size(rd, hid_input, report_id); ++#endif ++ my_info->buf = (char *)malloc(reportlen); ++ if (my_info->buf == NULL) ++ err(1, "malloc"); ++ my_info->reportlen = reportlen; ++ my_info->offset = report_id != 0; ++ my_info->buttons = 0; ++ my_info->hids = NULL; ++ ++ is_joystick = 0; ++#if __FreeBSD_version < 500111 ++ for (d = hid_start_parse(rd, 1 << hid_input); ++#else ++ for (d = hid_start_parse(rd, 1 << hid_input, report_id); ++#endif ++ hid_get_item(d, &h);) { ++ int usage, page, link_it = 0; ++ struct js_range *axis; ++ ++ page = HID_PAGE(h.usage); ++ usage = HID_USAGE(h.usage); ++ if (!is_joystick) ++ is_joystick = (h.kind == hid_collection && ++ page == HUP_GENERIC_DESKTOP && ++ (usage == HUG_JOYSTICK || usage == HUG_GAME_PAD)); ++ if (h.kind != hid_input || !is_joystick) ++ continue; ++ axis = NULL; ++ if (page == HUP_GENERIC_DESKTOP) { ++ switch (usage) { ++ case HUG_X: ++ case HUG_RX: ++ axis = &my_info->x; ++ break; ++ case HUG_Y: ++ case HUG_RY: ++ axis = &my_info->y; ++ break; ++ } ++ } ++ if (axis != NULL) { ++ axis->min = h.logical_minimum; ++ axis->max = h.logical_maximum; ++ axis->lower_third = axis->min + ++ (axis->max - axis->min) / 3; ++ axis->higher_third = axis->min + ++ (axis->max - axis->min) * 2 / 3; ++ link_it = 1; ++ } ++ if (!link_it) { ++ if (page != HUP_BUTTON || usage > 16) ++ continue; ++ if (usage > my_info->buttons) ++ my_info->buttons = usage; ++ } ++ new_h = h; ++ new_h.next = my_info->hids; ++ my_info->hids = (struct hid_item *) ++ malloc(sizeof(*my_info->hids)); ++ if (my_info->hids == NULL) ++ err(1, "malloc"); ++ *my_info->hids = new_h; ++ } ++ printf("Joystick %s: %d buttons, X range %d - %d, Y range %d - %d\n", ++ dev, my_info->buttons, my_info->x.min, my_info->x.max, ++ my_info->y.min, my_info->y.max); ++ my_info->fd = fd; ++ if (JoystickShift) { ++ my_info->joy = js_count + 1; ++ } else ++ my_info->joy = js_count; ++ return (0); ++} ++ ++void ++InitJoysticks() { ++ int i, fd; ++ ++ for (i = 0; i < (sizeof(js_device) / sizeof(js_device[0])); i++) { ++ fd = open(js_device[i], O_RDONLY | O_NONBLOCK); ++ if (fd == -1) ++ continue; ++ if (InitJoystickFd(fd, js_device[i]) == 0) ++ js_count++; ++ else ++ close(fd); ++ } ++} ++ ++void ++ReadJoysticks() { ++ struct hid_item *h; ++ int page, usage, njoy, joy; ++ ++ for (njoy = 0; njoy < js_count; njoy++) { ++ struct js_info *jsi; ++ ++ jsi = &js_info[njoy]; ++ joy = jsi->joy; ++ ++ if (read(jsi->fd, jsi->buf, jsi->reportlen) != jsi->reportlen) ++ continue; ++ for (h = jsi->hids; h != NULL; h = h->next) { ++ int d; ++ ++ d = hid_get_data(jsi->buf + jsi->offset, h); ++ page = HID_PAGE(h->usage); ++ usage = HID_USAGE(h->usage); ++ ++ switch (page) { ++ case HUP_GENERIC_DESKTOP: ++ switch (usage) { ++ case HUG_X: ++ case HUG_RX: ++ if (d < jsi->x.lower_third) { ++ joypads[joy] |= SNES_LEFT_MASK; ++ joypads[joy] &= ~SNES_RIGHT_MASK; ++ } else if (d < jsi->x.higher_third) { ++ joypads[joy] &= ~SNES_LEFT_MASK; ++ joypads[joy] &= ~SNES_RIGHT_MASK; ++ } else { ++ joypads[joy] &= ~SNES_LEFT_MASK; ++ joypads[joy] |= SNES_RIGHT_MASK; ++ } ++ break; ++ case HUG_Y: ++ case HUG_RY: ++ if (d < jsi->y.lower_third) { ++ joypads[joy] |= SNES_UP_MASK; ++ joypads[joy] &= ~SNES_DOWN_MASK; ++ } else if (d < jsi->y.higher_third) { ++ joypads[joy] &= ~SNES_UP_MASK; ++ joypads[joy] &= ~SNES_DOWN_MASK; ++ } else { ++ joypads[joy] &= ~SNES_UP_MASK; ++ joypads[joy] |= SNES_DOWN_MASK; ++ } ++ break; ++ } ++ break; ++ case HUP_BUTTON: ++ if (d) ++ joypads[joy] |= js_map_button[njoy][usage - 1]; ++ else ++ joypads[joy] &= ~js_map_button[njoy][usage - 1]; ++ break; ++ } ++ } ++ } ++} ++#endif // defined(__FreeBSD__) + #endif // defined (JOYSTICK_SUPPORT) + + START_EXTERN_C +@@ -1716,7 +2002,7 @@ + } + #endif + +-#if !defined(NOSOUND) && defined(__linux) ++#if !defined(NOSOUND) && (defined(__linux) || defined(__FreeBSD__)) + static int Rates[8] = + { + 0, 8000, 11025, 16000, 22050, 32000, 44100, 48000 +@@ -1847,7 +2133,7 @@ + #endif + + +-#if !defined(NOSOUND) && (defined (__linux) || defined (__sun)) ++#if !defined(NOSOUND) && (defined (__linux) || defined (__sun) || defined(__FreeBSD__)) + void S9xUnixProcessSound (void) + { + } +@@ -1890,7 +2176,7 @@ + } + #endif + +-#if !defined(NOSOUND) && (defined (__linux) || defined (__sun)) ++#if !defined(NOSOUND) && (defined (__linux) || defined (__sun) || defined(__FreeBSD__)) + void S9xGenerateSound () + { + /* Linux and Sun versions */ +@@ -1985,7 +2271,7 @@ + /* If not, this will be called by timer */ + if (Settings.Mute) + return NULL; +-#ifdef __linux ++#if defined(__linux) || defined(__FreeBSD__) + audio_buf_info info; + + if (!Settings.ThreadSound && diff --git a/emulators/snes9x/files/patch-unix_xf86.cpp b/emulators/snes9x/files/patch-unix_xf86.cpp new file mode 100644 index 000000000000..eaac096d8699 --- /dev/null +++ b/emulators/snes9x/files/patch-unix_xf86.cpp @@ -0,0 +1,32 @@ +diff -ru ../../work/release/unix/xf86.cpp ./unix/xf86.cpp +--- ../../work/release/unix/xf86.cpp Tue Sep 22 06:36:50 1998 ++++ ./unix/xf86.cpp Wed Dec 29 01:54:04 1999 +@@ -4,16 +4,20 @@ + Question/comments regarding this file only: maciej@imsa.edu + */ + +-#ifdef __linux ++#if defined(__linux) || defined(__FreeBSD__) + //#define USE_XF86VIDMODE + ++#ifdef __linux + #include ++#endif ++#include + #include + #include ++#ifdef __linux + #include ++#endif + + #include +-#include + + #include + #include +@@ -833,4 +837,4 @@ + ret = 1; + return (ret); + } +-#endif /* __linux */ ++#endif /* __linux || __FreeBSD__ */ diff --git a/emulators/snes9x/files/patch-unzip_unzip.h b/emulators/snes9x/files/patch-unzip_unzip.h new file mode 100644 index 000000000000..dcd11e451271 --- /dev/null +++ b/emulators/snes9x/files/patch-unzip_unzip.h @@ -0,0 +1,24 @@ +--- unzip/unzip.h 2007-10-03 12:28:47.000000000 -0500 ++++ unzip/unzip.h 2007-10-03 12:30:22.000000000 -0500 +@@ -41,14 +41,18 @@ + #ifndef _unz_H + #define _unz_H + +-#ifdef __cplusplus +-extern "C" { +-#endif ++#include + + #ifndef _ZLIB_H + #include + #endif + ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#define ZEXPORT ++ + #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) + /* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ diff --git a/emulators/vice/files/patch-ab b/emulators/vice/files/patch-ab deleted file mode 100644 index eb5758f67d6a..000000000000 --- a/emulators/vice/files/patch-ab +++ /dev/null @@ -1,12 +0,0 @@ ---- ./man/c1541.1.orig Sat May 29 11:34:58 1999 -+++ ./man/c1541.1 Sat May 29 11:35:16 1999 -@@ -77,7 +77,8 @@ - .B \- - as a file name, it stands for \fIstdin\fR or \fIstdout\fR. - .SH SEE ALSO --.BR VICE (1), -+.BR vice (1), -+.BR c1541 (1), - .BR petcat (1) - .SH AUTHORS - Teemu Rantanen diff --git a/emulators/vice/files/patch-ac b/emulators/vice/files/patch-ac deleted file mode 100644 index d107826f8370..000000000000 --- a/emulators/vice/files/patch-ac +++ /dev/null @@ -1,11 +0,0 @@ ---- man/vice.1.orig Mon Nov 22 06:25:55 1999 -+++ man/vice.1 Fri Nov 23 02:01:16 2001 -@@ -31,7 +31,7 @@ - .PP - The whole documentation for these programs is available in HTML - format; the main file should be installed on your system as --/usr/local/lib/VICE/doc/vice_toc.html. -+%%PREFIX%%/share/doc/vice/vice_toc.html. - .P - For up to date news about VICE, have a look at the official home page - at diff --git a/emulators/vice/files/patch-man_c1541.1 b/emulators/vice/files/patch-man_c1541.1 new file mode 100644 index 000000000000..eb5758f67d6a --- /dev/null +++ b/emulators/vice/files/patch-man_c1541.1 @@ -0,0 +1,12 @@ +--- ./man/c1541.1.orig Sat May 29 11:34:58 1999 ++++ ./man/c1541.1 Sat May 29 11:35:16 1999 +@@ -77,7 +77,8 @@ + .B \- + as a file name, it stands for \fIstdin\fR or \fIstdout\fR. + .SH SEE ALSO +-.BR VICE (1), ++.BR vice (1), ++.BR c1541 (1), + .BR petcat (1) + .SH AUTHORS + Teemu Rantanen diff --git a/emulators/vice/files/patch-man_vice.1 b/emulators/vice/files/patch-man_vice.1 new file mode 100644 index 000000000000..d107826f8370 --- /dev/null +++ b/emulators/vice/files/patch-man_vice.1 @@ -0,0 +1,11 @@ +--- man/vice.1.orig Mon Nov 22 06:25:55 1999 ++++ man/vice.1 Fri Nov 23 02:01:16 2001 +@@ -31,7 +31,7 @@ + .PP + The whole documentation for these programs is available in HTML + format; the main file should be installed on your system as +-/usr/local/lib/VICE/doc/vice_toc.html. ++%%PREFIX%%/share/doc/vice/vice_toc.html. + .P + For up to date news about VICE, have a look at the official home page + at -- cgit v1.2.3