This commit is contained in:
David Zuber
2019-09-01 14:14:08 +01:00
parent 924ff5f5ef
commit 8e8907f48b
631 changed files with 202169 additions and 0 deletions

View File

@ -0,0 +1,108 @@
dbopl.o: dbopl.c /usr/include/math.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
/usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \
/usr/include/bits/huge_vall.h /usr/include/bits/inf.h \
/usr/include/bits/nan.h /usr/include/bits/mathdef.h \
/usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
/usr/include/stdlib.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/xlocale.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/include/bits/typesizes.h /usr/include/time.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/bits/string3.h dbopl.h /usr/include/inttypes.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h \
/usr/include/stdint.h /usr/include/bits/wchar.h
/usr/include/math.h:
/usr/include/features.h:
/usr/include/sys/cdefs.h:
/usr/include/bits/wordsize.h:
/usr/include/gnu/stubs.h:
/usr/include/gnu/stubs-64.h:
/usr/include/bits/huge_val.h:
/usr/include/bits/huge_valf.h:
/usr/include/bits/huge_vall.h:
/usr/include/bits/inf.h:
/usr/include/bits/nan.h:
/usr/include/bits/mathdef.h:
/usr/include/bits/mathcalls.h:
/usr/include/bits/mathinline.h:
/usr/include/stdlib.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/bits/byteswap.h:
/usr/include/xlocale.h:
/usr/include/sys/types.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib.h:
/usr/include/string.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/bits/string3.h:
dbopl.h:
/usr/include/inttypes.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h:
/usr/include/stdint.h:
/usr/include/bits/wchar.h:

View File

@ -0,0 +1 @@
ioperm_sys.o: ioperm_sys.c

View File

@ -0,0 +1,184 @@
opl.o: opl.c ../config.h /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/bits/stdio2.h \
/usr/include/stdlib.h /usr/include/bits/waitflags.h \
/usr/include/bits/waitstatus.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
/usr/include/xlocale.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/SDL/SDL.h \
/usr/include/SDL/SDL_main.h /usr/include/SDL/SDL_stdinc.h \
/usr/include/SDL/SDL_config.h /usr/include/SDL/SDL_platform.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/bits/string3.h \
/usr/include/strings.h /usr/include/inttypes.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h \
/usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/ctype.h \
/usr/include/iconv.h /usr/include/SDL/begin_code.h \
/usr/include/SDL/close_code.h /usr/include/SDL/SDL_audio.h \
/usr/include/SDL/SDL_error.h /usr/include/SDL/SDL_endian.h \
/usr/include/SDL/SDL_mutex.h /usr/include/SDL/SDL_thread.h \
/usr/include/SDL/SDL_rwops.h /usr/include/SDL/SDL_cdrom.h \
/usr/include/SDL/SDL_cpuinfo.h /usr/include/SDL/SDL_events.h \
/usr/include/SDL/SDL_active.h /usr/include/SDL/SDL_keyboard.h \
/usr/include/SDL/SDL_keysym.h /usr/include/SDL/SDL_mouse.h \
/usr/include/SDL/SDL_video.h /usr/include/SDL/SDL_joystick.h \
/usr/include/SDL/SDL_quit.h /usr/include/SDL/SDL_loadso.h \
/usr/include/SDL/SDL_timer.h /usr/include/SDL/SDL_version.h opl.h \
opl_internal.h
../config.h:
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/sys/cdefs.h:
/usr/include/bits/wordsize.h:
/usr/include/gnu/stubs.h:
/usr/include/gnu/stubs-64.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/bits/stdio2.h:
/usr/include/stdlib.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/bits/byteswap.h:
/usr/include/xlocale.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib.h:
/usr/include/SDL/SDL.h:
/usr/include/SDL/SDL_main.h:
/usr/include/SDL/SDL_stdinc.h:
/usr/include/SDL/SDL_config.h:
/usr/include/SDL/SDL_platform.h:
/usr/include/string.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/bits/string3.h:
/usr/include/strings.h:
/usr/include/inttypes.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h:
/usr/include/stdint.h:
/usr/include/bits/wchar.h:
/usr/include/ctype.h:
/usr/include/iconv.h:
/usr/include/SDL/begin_code.h:
/usr/include/SDL/close_code.h:
/usr/include/SDL/SDL_audio.h:
/usr/include/SDL/SDL_error.h:
/usr/include/SDL/SDL_endian.h:
/usr/include/SDL/SDL_mutex.h:
/usr/include/SDL/SDL_thread.h:
/usr/include/SDL/SDL_rwops.h:
/usr/include/SDL/SDL_cdrom.h:
/usr/include/SDL/SDL_cpuinfo.h:
/usr/include/SDL/SDL_events.h:
/usr/include/SDL/SDL_active.h:
/usr/include/SDL/SDL_keyboard.h:
/usr/include/SDL/SDL_keysym.h:
/usr/include/SDL/SDL_mouse.h:
/usr/include/SDL/SDL_video.h:
/usr/include/SDL/SDL_joystick.h:
/usr/include/SDL/SDL_quit.h:
/usr/include/SDL/SDL_loadso.h:
/usr/include/SDL/SDL_timer.h:
/usr/include/SDL/SDL_version.h:
opl.h:
opl_internal.h:

View File

@ -0,0 +1,107 @@
opl_linux.o: opl_linux.c ../config.h /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/bits/stdio2.h \
/usr/include/string.h /usr/include/xlocale.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
/usr/include/stdlib.h /usr/include/bits/string3.h /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
/usr/include/asm-generic/errno-base.h /usr/include/unistd.h \
/usr/include/bits/posix_opt.h /usr/include/bits/environments.h \
/usr/include/bits/confname.h /usr/include/getopt.h \
/usr/include/bits/unistd.h /usr/include/sys/io.h opl.h opl_internal.h \
opl_timer.h
../config.h:
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/sys/cdefs.h:
/usr/include/bits/wordsize.h:
/usr/include/gnu/stubs.h:
/usr/include/gnu/stubs-64.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/bits/stdio2.h:
/usr/include/string.h:
/usr/include/xlocale.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/bits/byteswap.h:
/usr/include/stdlib.h:
/usr/include/bits/string3.h:
/usr/include/errno.h:
/usr/include/bits/errno.h:
/usr/include/linux/errno.h:
/usr/include/asm/errno.h:
/usr/include/asm-generic/errno.h:
/usr/include/asm-generic/errno-base.h:
/usr/include/unistd.h:
/usr/include/bits/posix_opt.h:
/usr/include/bits/environments.h:
/usr/include/bits/confname.h:
/usr/include/getopt.h:
/usr/include/bits/unistd.h:
/usr/include/sys/io.h:
opl.h:
opl_internal.h:
opl_timer.h:

View File

@ -0,0 +1,3 @@
opl_obsd.o: opl_obsd.c ../config.h
../config.h:

View File

@ -0,0 +1,99 @@
opl_queue.o: opl_queue.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/bits/stdio2.h \
/usr/include/stdlib.h /usr/include/bits/waitflags.h \
/usr/include/bits/waitstatus.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
/usr/include/xlocale.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/bits/string3.h opl_queue.h opl.h
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/sys/cdefs.h:
/usr/include/bits/wordsize.h:
/usr/include/gnu/stubs.h:
/usr/include/gnu/stubs-64.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/bits/stdio2.h:
/usr/include/stdlib.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/bits/byteswap.h:
/usr/include/xlocale.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib.h:
/usr/include/string.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/bits/string3.h:
opl_queue.h:
opl.h:

View File

@ -0,0 +1,211 @@
opl_sdl.o: opl_sdl.c ../config.h /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/bits/stdio2.h \
/usr/include/string.h /usr/include/xlocale.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
/usr/include/stdlib.h /usr/include/bits/string3.h /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
/usr/include/asm-generic/errno-base.h /usr/include/assert.h \
/usr/include/SDL/SDL.h /usr/include/SDL/SDL_main.h \
/usr/include/SDL/SDL_stdinc.h /usr/include/SDL/SDL_config.h \
/usr/include/SDL/SDL_platform.h /usr/include/sys/types.h \
/usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/strings.h \
/usr/include/inttypes.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h \
/usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/ctype.h \
/usr/include/iconv.h /usr/include/SDL/begin_code.h \
/usr/include/SDL/close_code.h /usr/include/SDL/SDL_audio.h \
/usr/include/SDL/SDL_error.h /usr/include/SDL/SDL_endian.h \
/usr/include/SDL/SDL_mutex.h /usr/include/SDL/SDL_thread.h \
/usr/include/SDL/SDL_rwops.h /usr/include/SDL/SDL_cdrom.h \
/usr/include/SDL/SDL_cpuinfo.h /usr/include/SDL/SDL_events.h \
/usr/include/SDL/SDL_active.h /usr/include/SDL/SDL_keyboard.h \
/usr/include/SDL/SDL_keysym.h /usr/include/SDL/SDL_mouse.h \
/usr/include/SDL/SDL_video.h /usr/include/SDL/SDL_joystick.h \
/usr/include/SDL/SDL_quit.h /usr/include/SDL/SDL_loadso.h \
/usr/include/SDL/SDL_timer.h /usr/include/SDL/SDL_version.h \
/usr/include/SDL/SDL_mixer.h /usr/include/SDL/SDL_types.h dbopl.h opl.h \
opl_internal.h opl_queue.h
../config.h:
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/sys/cdefs.h:
/usr/include/bits/wordsize.h:
/usr/include/gnu/stubs.h:
/usr/include/gnu/stubs-64.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/bits/stdio2.h:
/usr/include/string.h:
/usr/include/xlocale.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/bits/byteswap.h:
/usr/include/stdlib.h:
/usr/include/bits/string3.h:
/usr/include/errno.h:
/usr/include/bits/errno.h:
/usr/include/linux/errno.h:
/usr/include/asm/errno.h:
/usr/include/asm-generic/errno.h:
/usr/include/asm-generic/errno-base.h:
/usr/include/assert.h:
/usr/include/SDL/SDL.h:
/usr/include/SDL/SDL_main.h:
/usr/include/SDL/SDL_stdinc.h:
/usr/include/SDL/SDL_config.h:
/usr/include/SDL/SDL_platform.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib.h:
/usr/include/strings.h:
/usr/include/inttypes.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h:
/usr/include/stdint.h:
/usr/include/bits/wchar.h:
/usr/include/ctype.h:
/usr/include/iconv.h:
/usr/include/SDL/begin_code.h:
/usr/include/SDL/close_code.h:
/usr/include/SDL/SDL_audio.h:
/usr/include/SDL/SDL_error.h:
/usr/include/SDL/SDL_endian.h:
/usr/include/SDL/SDL_mutex.h:
/usr/include/SDL/SDL_thread.h:
/usr/include/SDL/SDL_rwops.h:
/usr/include/SDL/SDL_cdrom.h:
/usr/include/SDL/SDL_cpuinfo.h:
/usr/include/SDL/SDL_events.h:
/usr/include/SDL/SDL_active.h:
/usr/include/SDL/SDL_keyboard.h:
/usr/include/SDL/SDL_keysym.h:
/usr/include/SDL/SDL_mouse.h:
/usr/include/SDL/SDL_video.h:
/usr/include/SDL/SDL_joystick.h:
/usr/include/SDL/SDL_quit.h:
/usr/include/SDL/SDL_loadso.h:
/usr/include/SDL/SDL_timer.h:
/usr/include/SDL/SDL_version.h:
/usr/include/SDL/SDL_mixer.h:
/usr/include/SDL/SDL_types.h:
dbopl.h:
opl.h:
opl_internal.h:
opl_queue.h:

View File

@ -0,0 +1,186 @@
opl_timer.o: opl_timer.c /usr/include/SDL/SDL.h \
/usr/include/SDL/SDL_main.h /usr/include/SDL/SDL_stdinc.h \
/usr/include/SDL/SDL_config.h /usr/include/SDL/SDL_platform.h \
/usr/include/sys/types.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/time.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/stdio.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/bits/stdio2.h \
/usr/include/stdlib.h /usr/include/bits/waitflags.h \
/usr/include/bits/waitstatus.h /usr/include/xlocale.h \
/usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/bits/string3.h /usr/include/strings.h \
/usr/include/inttypes.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h \
/usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/ctype.h \
/usr/include/iconv.h /usr/include/SDL/begin_code.h \
/usr/include/SDL/close_code.h /usr/include/SDL/SDL_audio.h \
/usr/include/SDL/SDL_error.h /usr/include/SDL/SDL_endian.h \
/usr/include/SDL/SDL_mutex.h /usr/include/SDL/SDL_thread.h \
/usr/include/SDL/SDL_rwops.h /usr/include/SDL/SDL_cdrom.h \
/usr/include/SDL/SDL_cpuinfo.h /usr/include/SDL/SDL_events.h \
/usr/include/SDL/SDL_active.h /usr/include/SDL/SDL_keyboard.h \
/usr/include/SDL/SDL_keysym.h /usr/include/SDL/SDL_mouse.h \
/usr/include/SDL/SDL_video.h /usr/include/SDL/SDL_joystick.h \
/usr/include/SDL/SDL_quit.h /usr/include/SDL/SDL_loadso.h \
/usr/include/SDL/SDL_timer.h /usr/include/SDL/SDL_version.h opl_timer.h \
opl.h opl_queue.h
/usr/include/SDL/SDL.h:
/usr/include/SDL/SDL_main.h:
/usr/include/SDL/SDL_stdinc.h:
/usr/include/SDL/SDL_config.h:
/usr/include/SDL/SDL_platform.h:
/usr/include/sys/types.h:
/usr/include/features.h:
/usr/include/sys/cdefs.h:
/usr/include/bits/wordsize.h:
/usr/include/gnu/stubs.h:
/usr/include/gnu/stubs-64.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/time.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/bits/byteswap.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/stdio.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/bits/stdio2.h:
/usr/include/stdlib.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/xlocale.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib.h:
/usr/include/string.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/bits/string3.h:
/usr/include/strings.h:
/usr/include/inttypes.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h:
/usr/include/stdint.h:
/usr/include/bits/wchar.h:
/usr/include/ctype.h:
/usr/include/iconv.h:
/usr/include/SDL/begin_code.h:
/usr/include/SDL/close_code.h:
/usr/include/SDL/SDL_audio.h:
/usr/include/SDL/SDL_error.h:
/usr/include/SDL/SDL_endian.h:
/usr/include/SDL/SDL_mutex.h:
/usr/include/SDL/SDL_thread.h:
/usr/include/SDL/SDL_rwops.h:
/usr/include/SDL/SDL_cdrom.h:
/usr/include/SDL/SDL_cpuinfo.h:
/usr/include/SDL/SDL_events.h:
/usr/include/SDL/SDL_active.h:
/usr/include/SDL/SDL_keyboard.h:
/usr/include/SDL/SDL_keysym.h:
/usr/include/SDL/SDL_mouse.h:
/usr/include/SDL/SDL_video.h:
/usr/include/SDL/SDL_joystick.h:
/usr/include/SDL/SDL_quit.h:
/usr/include/SDL/SDL_loadso.h:
/usr/include/SDL/SDL_timer.h:
/usr/include/SDL/SDL_version.h:
opl_timer.h:
opl.h:
opl_queue.h:

View File

@ -0,0 +1,3 @@
opl_win32.o: opl_win32.c ../config.h
../config.h:

View File

@ -0,0 +1,609 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# opl/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
pkgdatadir = $(datadir)/psdoom
pkgincludedir = $(includedir)/psdoom
pkglibdir = $(libdir)/psdoom
pkglibexecdir = $(libexecdir)/psdoom
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = opl
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
AR = ar
ARFLAGS = cru
libopl_a_AR = $(AR) $(ARFLAGS)
libopl_a_LIBADD =
am_libopl_a_OBJECTS = opl.$(OBJEXT) opl_linux.$(OBJEXT) \
opl_obsd.$(OBJEXT) opl_queue.$(OBJEXT) opl_sdl.$(OBJEXT) \
opl_timer.$(OBJEXT) opl_win32.$(OBJEXT) ioperm_sys.$(OBJEXT) \
dbopl.$(OBJEXT)
libopl_a_OBJECTS = $(am_libopl_a_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libopl_a_SOURCES)
DIST_SOURCES = $(libopl_a_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run aclocal-1.11
AMTAR = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run tar
AUTOCONF = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run autoconf
AUTOHEADER = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run autoheader
AUTOMAKE = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run automake-1.11
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -O2 -g -Wall -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
CPP = gcc -E
CPPFLAGS =
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /bin/grep -E
EXEEXT =
GREP = /bin/grep
HAVE_PYTHON = true
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LDFLAGS = -lSDL -lpthread
LIBOBJS =
LIBS = -lm
LTLIBOBJS =
MAKEINFO = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run makeinfo
MKDIR_P = /bin/mkdir -p
OBJEXT = o
PACKAGE = psdoom
PACKAGE_BUGREPORT = orsonteodoro@yahoo.com
PACKAGE_COPYRIGHT = Copyright (C) 1993-2012
PACKAGE_LICENSE = GNU General Public License, version 2
PACKAGE_MAINTAINER = Orson Teodoro
PACKAGE_NAME = psdoom
PACKAGE_SHORTDESC = psdoom-ng source port - psDooM with Chocolate Doom
PACKAGE_STRING = psdoom 2012.02.05-1.6.0
PACKAGE_TARNAME = psdoom
PACKAGE_URL = https://github.com/orsonteodoro/psdoom-ng/
PACKAGE_VERSION = 2012.02.05-1.6.0
PATH_SEPARATOR = :
PROGRAM_PREFIX = ps
RANLIB = ranlib
SDLMIXER_CFLAGS =
SDLMIXER_LIBS = -lSDL_mixer
SDLNET_CFLAGS =
SDLNET_LIBS = -lSDL_net
SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
SDL_CONFIG = /usr/bin/sdl-config
SDL_LIBS = -lSDL -lpthread
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
VERSION = 2012.02.05-1.6.0
WINDOWS_RC_VERSION = 2012, 02, 05-1, 6, 0, 0
WINDRES =
abs_builddir = /home/orson/Downloads/chocolate-doom-1.6.0/opl
abs_srcdir = /home/orson/Downloads/chocolate-doom-1.6.0/opl
abs_top_builddir = /home/orson/Downloads/chocolate-doom-1.6.0
abs_top_srcdir = /home/orson/Downloads/chocolate-doom-1.6.0
ac_aux_dir = autotools
ac_ct_CC = gcc
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build_alias =
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host_alias =
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = /bin/mkdir -p
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
AM_CFLAGS =
SUBDIRS = . examples
noinst_LIBRARIES = libopl.a
libopl_a_SOURCES = \
opl_internal.h \
opl.c opl.h \
opl_linux.c \
opl_obsd.c \
opl_queue.c opl_queue.h \
opl_sdl.c \
opl_timer.c opl_timer.h \
opl_win32.c \
ioperm_sys.c ioperm_sys.h \
dbopl.c dbopl.h
all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu opl/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu opl/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
libopl.a: $(libopl_a_OBJECTS) $(libopl_a_DEPENDENCIES)
-rm -f libopl.a
$(libopl_a_AR) libopl.a $(libopl_a_OBJECTS) $(libopl_a_LIBADD)
$(RANLIB) libopl.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/dbopl.Po
include ./$(DEPDIR)/ioperm_sys.Po
include ./$(DEPDIR)/opl.Po
include ./$(DEPDIR)/opl_linux.Po
include ./$(DEPDIR)/opl_obsd.Po
include ./$(DEPDIR)/opl_queue.Po
include ./$(DEPDIR)/opl_sdl.Po
include ./$(DEPDIR)/opl_timer.Po
include ./$(DEPDIR)/opl_win32.Po
.c.o:
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile $(LIBRARIES)
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES ctags ctags-recursive distclean \
distclean-compile distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,19 @@
AM_CFLAGS=@SDLMIXER_CFLAGS@
SUBDIRS = . examples
noinst_LIBRARIES=libopl.a
libopl_a_SOURCES = \
opl_internal.h \
opl.c opl.h \
opl_linux.c \
opl_obsd.c \
opl_queue.c opl_queue.h \
opl_sdl.c \
opl_timer.c opl_timer.h \
opl_win32.c \
ioperm_sys.c ioperm_sys.h \
dbopl.c dbopl.h

View File

@ -0,0 +1,609 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = opl
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
AR = ar
ARFLAGS = cru
libopl_a_AR = $(AR) $(ARFLAGS)
libopl_a_LIBADD =
am_libopl_a_OBJECTS = opl.$(OBJEXT) opl_linux.$(OBJEXT) \
opl_obsd.$(OBJEXT) opl_queue.$(OBJEXT) opl_sdl.$(OBJEXT) \
opl_timer.$(OBJEXT) opl_win32.$(OBJEXT) ioperm_sys.$(OBJEXT) \
dbopl.$(OBJEXT)
libopl_a_OBJECTS = $(am_libopl_a_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libopl_a_SOURCES)
DIST_SOURCES = $(libopl_a_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
HAVE_PYTHON = @HAVE_PYTHON@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@
PACKAGE_LICENSE = @PACKAGE_LICENSE@
PACKAGE_MAINTAINER = @PACKAGE_MAINTAINER@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_SHORTDESC = @PACKAGE_SHORTDESC@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROGRAM_PREFIX = @PROGRAM_PREFIX@
RANLIB = @RANLIB@
SDLMIXER_CFLAGS = @SDLMIXER_CFLAGS@
SDLMIXER_LIBS = @SDLMIXER_LIBS@
SDLNET_CFLAGS = @SDLNET_CFLAGS@
SDLNET_LIBS = @SDLNET_LIBS@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_CONFIG = @SDL_CONFIG@
SDL_LIBS = @SDL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WINDOWS_RC_VERSION = @WINDOWS_RC_VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_aux_dir = @ac_aux_dir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = @SDLMIXER_CFLAGS@
SUBDIRS = . examples
noinst_LIBRARIES = libopl.a
libopl_a_SOURCES = \
opl_internal.h \
opl.c opl.h \
opl_linux.c \
opl_obsd.c \
opl_queue.c opl_queue.h \
opl_sdl.c \
opl_timer.c opl_timer.h \
opl_win32.c \
ioperm_sys.c ioperm_sys.h \
dbopl.c dbopl.h
all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu opl/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu opl/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
libopl.a: $(libopl_a_OBJECTS) $(libopl_a_DEPENDENCIES)
-rm -f libopl.a
$(libopl_a_AR) libopl.a $(libopl_a_OBJECTS) $(libopl_a_LIBADD)
$(RANLIB) libopl.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbopl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm_sys.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opl_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opl_obsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opl_queue.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opl_sdl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opl_timer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opl_win32.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile $(LIBRARIES)
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES ctags ctags-recursive distclean \
distclean-compile distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

1642
dockerdoom/trunk/opl/dbopl.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,206 @@
/*
* Copyright (C) 2002-2010 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <inttypes.h>
//Use 8 handlers based on a small logatirmic wavetabe and an exponential table for volume
#define WAVE_HANDLER 10
//Use a logarithmic wavetable with an exponential table for volume
#define WAVE_TABLELOG 11
//Use a linear wavetable with a multiply table for volume
#define WAVE_TABLEMUL 12
//Select the type of wave generator routine
#define DBOPL_WAVE WAVE_TABLEMUL
typedef struct _Chip Chip;
typedef struct _Operator Operator;
typedef struct _Channel Channel;
typedef uintptr_t Bitu;
typedef intptr_t Bits;
typedef uint32_t Bit32u;
typedef int32_t Bit32s;
typedef uint16_t Bit16u;
typedef int16_t Bit16s;
typedef uint8_t Bit8u;
typedef int8_t Bit8s;
#if (DBOPL_WAVE == WAVE_HANDLER)
typedef Bits ( DB_FASTCALL *WaveHandler) ( Bitu i, Bitu volume );
#endif
#define DB_FASTCALL
typedef Bits (*VolumeHandler)(Operator *self);
typedef Channel* (*SynthHandler)(Channel *self, Chip* chip, Bit32u samples, Bit32s* output );
//Different synth modes that can generate blocks of data
typedef enum {
sm2AM,
sm2FM,
sm3AM,
sm3FM,
sm4Start,
sm3FMFM,
sm3AMFM,
sm3FMAM,
sm3AMAM,
sm6Start,
sm2Percussion,
sm3Percussion,
} SynthMode;
//Shifts for the values contained in chandata variable
enum {
SHIFT_KSLBASE = 16,
SHIFT_KEYCODE = 24,
};
//Masks for operator 20 values
enum {
MASK_KSR = 0x10,
MASK_SUSTAIN = 0x20,
MASK_VIBRATO = 0x40,
MASK_TREMOLO = 0x80,
};
typedef enum {
OFF,
RELEASE,
SUSTAIN,
DECAY,
ATTACK,
} OperatorState;
struct _Operator {
VolumeHandler volHandler;
#if (DBOPL_WAVE == WAVE_HANDLER)
WaveHandler waveHandler; //Routine that generate a wave
#else
Bit16s* waveBase;
Bit32u waveMask;
Bit32u waveStart;
#endif
Bit32u waveIndex; //WAVE_BITS shifted counter of the frequency index
Bit32u waveAdd; //The base frequency without vibrato
Bit32u waveCurrent; //waveAdd + vibratao
Bit32u chanData; //Frequency/octave and derived data coming from whatever channel controls this
Bit32u freqMul; //Scale channel frequency with this, TODO maybe remove?
Bit32u vibrato; //Scaled up vibrato strength
Bit32s sustainLevel; //When stopping at sustain level stop here
Bit32s totalLevel; //totalLevel is added to every generated volume
Bit32u currentLevel; //totalLevel + tremolo
Bit32s volume; //The currently active volume
Bit32u attackAdd; //Timers for the different states of the envelope
Bit32u decayAdd;
Bit32u releaseAdd;
Bit32u rateIndex; //Current position of the evenlope
Bit8u rateZero; //Bits for the different states of the envelope having no changes
Bit8u keyOn; //Bitmask of different values that can generate keyon
//Registers, also used to check for changes
Bit8u reg20, reg40, reg60, reg80, regE0;
//Active part of the envelope we're in
Bit8u state;
//0xff when tremolo is enabled
Bit8u tremoloMask;
//Strength of the vibrato
Bit8u vibStrength;
//Keep track of the calculated KSR so we can check for changes
Bit8u ksr;
};
struct _Channel {
Operator op[2];
SynthHandler synthHandler;
Bit32u chanData; //Frequency/octave and derived values
Bit32s old[2]; //Old data for feedback
Bit8u feedback; //Feedback shift
Bit8u regB0; //Register values to check for changes
Bit8u regC0;
//This should correspond with reg104, bit 6 indicates a Percussion channel, bit 7 indicates a silent channel
Bit8u fourMask;
Bit8s maskLeft; //Sign extended values for both channel's panning
Bit8s maskRight;
};
struct _Chip {
//This is used as the base counter for vibrato and tremolo
Bit32u lfoCounter;
Bit32u lfoAdd;
Bit32u noiseCounter;
Bit32u noiseAdd;
Bit32u noiseValue;
//Frequency scales for the different multiplications
Bit32u freqMul[16];
//Rates for decay and release for rate of this chip
Bit32u linearRates[76];
//Best match attack rates for the rate of this chip
Bit32u attackRates[76];
//18 channels with 2 operators each
Channel chan[18];
Bit8u reg104;
Bit8u reg08;
Bit8u reg04;
Bit8u regBD;
Bit8u vibratoIndex;
Bit8u tremoloIndex;
Bit8s vibratoSign;
Bit8u vibratoShift;
Bit8u tremoloValue;
Bit8u vibratoStrength;
Bit8u tremoloStrength;
//Mask for allowed wave forms
Bit8u waveFormMask;
//0 or -1 when enabled
Bit8s opl3Active;
};
/*
struct Handler : public Adlib::Handler {
DBOPL::Chip chip;
virtual Bit32u WriteAddr( Bit32u port, Bit8u val );
virtual void WriteReg( Bit32u addr, Bit8u val );
virtual void Generate( MixerChannel* chan, Bitu samples );
virtual void Init( Bitu rate );
};
*/
void Chip__Setup(Chip *self, Bit32u rate );
void DBOPL_InitTables( void );
void Chip__Chip(Chip *self);
void Chip__WriteReg(Chip *self, Bit32u reg, Bit8u val );
void Chip__GenerateBlock2(Chip *self, Bitu total, Bit32s* output );
// haleyjd 09/09/10: Not standard C.
#ifdef _MSC_VER
#define inline __inline
#endif

View File

@ -0,0 +1,179 @@
droplay.o: droplay.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/bits/stdio2.h \
/usr/include/stdlib.h /usr/include/bits/waitflags.h \
/usr/include/bits/waitstatus.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
/usr/include/xlocale.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/SDL/SDL.h \
/usr/include/SDL/SDL_main.h /usr/include/SDL/SDL_stdinc.h \
/usr/include/SDL/SDL_config.h /usr/include/SDL/SDL_platform.h \
/usr/include/string.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/bits/string3.h \
/usr/include/strings.h /usr/include/inttypes.h \
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h \
/usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/ctype.h \
/usr/include/iconv.h /usr/include/SDL/begin_code.h \
/usr/include/SDL/close_code.h /usr/include/SDL/SDL_audio.h \
/usr/include/SDL/SDL_error.h /usr/include/SDL/SDL_endian.h \
/usr/include/SDL/SDL_mutex.h /usr/include/SDL/SDL_thread.h \
/usr/include/SDL/SDL_rwops.h /usr/include/SDL/SDL_cdrom.h \
/usr/include/SDL/SDL_cpuinfo.h /usr/include/SDL/SDL_events.h \
/usr/include/SDL/SDL_active.h /usr/include/SDL/SDL_keyboard.h \
/usr/include/SDL/SDL_keysym.h /usr/include/SDL/SDL_mouse.h \
/usr/include/SDL/SDL_video.h /usr/include/SDL/SDL_joystick.h \
/usr/include/SDL/SDL_quit.h /usr/include/SDL/SDL_loadso.h \
/usr/include/SDL/SDL_timer.h /usr/include/SDL/SDL_version.h ../opl.h
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/sys/cdefs.h:
/usr/include/bits/wordsize.h:
/usr/include/gnu/stubs.h:
/usr/include/gnu/stubs-64.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stddef.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/bits/stdio2.h:
/usr/include/stdlib.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/bits/byteswap.h:
/usr/include/xlocale.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib.h:
/usr/include/SDL/SDL.h:
/usr/include/SDL/SDL_main.h:
/usr/include/SDL/SDL_stdinc.h:
/usr/include/SDL/SDL_config.h:
/usr/include/SDL/SDL_platform.h:
/usr/include/string.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/bits/string3.h:
/usr/include/strings.h:
/usr/include/inttypes.h:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/stdint.h:
/usr/include/stdint.h:
/usr/include/bits/wchar.h:
/usr/include/ctype.h:
/usr/include/iconv.h:
/usr/include/SDL/begin_code.h:
/usr/include/SDL/close_code.h:
/usr/include/SDL/SDL_audio.h:
/usr/include/SDL/SDL_error.h:
/usr/include/SDL/SDL_endian.h:
/usr/include/SDL/SDL_mutex.h:
/usr/include/SDL/SDL_thread.h:
/usr/include/SDL/SDL_rwops.h:
/usr/include/SDL/SDL_cdrom.h:
/usr/include/SDL/SDL_cpuinfo.h:
/usr/include/SDL/SDL_events.h:
/usr/include/SDL/SDL_active.h:
/usr/include/SDL/SDL_keyboard.h:
/usr/include/SDL/SDL_keysym.h:
/usr/include/SDL/SDL_mouse.h:
/usr/include/SDL/SDL_video.h:
/usr/include/SDL/SDL_joystick.h:
/usr/include/SDL/SDL_quit.h:
/usr/include/SDL/SDL_loadso.h:
/usr/include/SDL/SDL_timer.h:
/usr/include/SDL/SDL_version.h:
../opl.h:

View File

@ -0,0 +1,431 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# opl/examples/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
pkgdatadir = $(datadir)/psdoom
pkgincludedir = $(includedir)/psdoom
pkglibdir = $(libdir)/psdoom
pkglibexecdir = $(libexecdir)/psdoom
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
noinst_PROGRAMS = droplay$(EXEEXT)
subdir = opl/examples
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
am_droplay_OBJECTS = droplay.$(OBJEXT)
droplay_OBJECTS = $(am_droplay_OBJECTS)
droplay_DEPENDENCIES = ../libopl.a
DEFAULT_INCLUDES = -I. -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(droplay_SOURCES)
DIST_SOURCES = $(droplay_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run aclocal-1.11
AMTAR = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run tar
AUTOCONF = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run autoconf
AUTOHEADER = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run autoheader
AUTOMAKE = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run automake-1.11
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -O2 -g -Wall -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
CPP = gcc -E
CPPFLAGS =
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /bin/grep -E
EXEEXT =
GREP = /bin/grep
HAVE_PYTHON = true
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LDFLAGS = -lSDL -lpthread
LIBOBJS =
LIBS = -lm
LTLIBOBJS =
MAKEINFO = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/missing --run makeinfo
MKDIR_P = /bin/mkdir -p
OBJEXT = o
PACKAGE = psdoom
PACKAGE_BUGREPORT = orsonteodoro@yahoo.com
PACKAGE_COPYRIGHT = Copyright (C) 1993-2012
PACKAGE_LICENSE = GNU General Public License, version 2
PACKAGE_MAINTAINER = Orson Teodoro
PACKAGE_NAME = psdoom
PACKAGE_SHORTDESC = psdoom-ng source port - psDooM with Chocolate Doom
PACKAGE_STRING = psdoom 2012.02.05-1.6.0
PACKAGE_TARNAME = psdoom
PACKAGE_URL = https://github.com/orsonteodoro/psdoom-ng/
PACKAGE_VERSION = 2012.02.05-1.6.0
PATH_SEPARATOR = :
PROGRAM_PREFIX = ps
RANLIB = ranlib
SDLMIXER_CFLAGS =
SDLMIXER_LIBS = -lSDL_mixer
SDLNET_CFLAGS =
SDLNET_LIBS = -lSDL_net
SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
SDL_CONFIG = /usr/bin/sdl-config
SDL_LIBS = -lSDL -lpthread
SET_MAKE =
SHELL = /bin/sh
STRIP = strip
VERSION = 2012.02.05-1.6.0
WINDOWS_RC_VERSION = 2012, 02, 05-1, 6, 0, 0
WINDRES =
abs_builddir = /home/orson/Downloads/chocolate-doom-1.6.0/opl/examples
abs_srcdir = /home/orson/Downloads/chocolate-doom-1.6.0/opl/examples
abs_top_builddir = /home/orson/Downloads/chocolate-doom-1.6.0
abs_top_srcdir = /home/orson/Downloads/chocolate-doom-1.6.0
ac_aux_dir = autotools
ac_ct_CC = gcc
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build_alias =
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host_alias =
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/orson/Downloads/chocolate-doom-1.6.0/autotools/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = /bin/mkdir -p
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../../
top_builddir = ../..
top_srcdir = ../..
AM_CFLAGS = -I..
droplay_LDADD = ../libopl.a -lSDL -lpthread -lSDL -lpthread -lSDL_mixer
droplay_SOURCES = droplay.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu opl/examples/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu opl/examples/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
droplay$(EXEEXT): $(droplay_OBJECTS) $(droplay_DEPENDENCIES)
@rm -f droplay$(EXEEXT)
$(LINK) $(droplay_OBJECTS) $(droplay_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/droplay.Po
.c.o:
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstPROGRAMS ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,8 @@
AM_CFLAGS = -I..
noinst_PROGRAMS=droplay
droplay_LDADD = ../libopl.a @LDFLAGS@ @SDL_LIBS@ @SDLMIXER_LIBS@
droplay_SOURCES = droplay.c

View File

@ -0,0 +1,431 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
noinst_PROGRAMS = droplay$(EXEEXT)
subdir = opl/examples
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
am_droplay_OBJECTS = droplay.$(OBJEXT)
droplay_OBJECTS = $(am_droplay_OBJECTS)
droplay_DEPENDENCIES = ../libopl.a
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(droplay_SOURCES)
DIST_SOURCES = $(droplay_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
HAVE_PYTHON = @HAVE_PYTHON@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@
PACKAGE_LICENSE = @PACKAGE_LICENSE@
PACKAGE_MAINTAINER = @PACKAGE_MAINTAINER@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_SHORTDESC = @PACKAGE_SHORTDESC@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROGRAM_PREFIX = @PROGRAM_PREFIX@
RANLIB = @RANLIB@
SDLMIXER_CFLAGS = @SDLMIXER_CFLAGS@
SDLMIXER_LIBS = @SDLMIXER_LIBS@
SDLNET_CFLAGS = @SDLNET_CFLAGS@
SDLNET_LIBS = @SDLNET_LIBS@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_CONFIG = @SDL_CONFIG@
SDL_LIBS = @SDL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WINDOWS_RC_VERSION = @WINDOWS_RC_VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_aux_dir = @ac_aux_dir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = -I..
droplay_LDADD = ../libopl.a @LDFLAGS@ @SDL_LIBS@ @SDLMIXER_LIBS@
droplay_SOURCES = droplay.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu opl/examples/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu opl/examples/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
droplay$(EXEEXT): $(droplay_OBJECTS) $(droplay_DEPENDENCIES)
@rm -f droplay$(EXEEXT)
$(LINK) $(droplay_OBJECTS) $(droplay_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/droplay.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-noinstPROGRAMS ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,217 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// Demonstration program for OPL library to play back DRO
// format files.
//
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include "SDL.h"
#include "opl.h"
#define HEADER_STRING "DBRAWOPL"
#define ADLIB_PORT 0x388
void WriteReg(unsigned int reg, unsigned int val)
{
int i;
// This was recorded from an OPL2, but we are probably playing
// back on an OPL3, so we need to enable the original OPL2
// channels. Doom does this already, but other games don't.
if ((reg & 0xf0) == OPL_REGS_FEEDBACK)
{
val |= 0x30;
}
OPL_WritePort(OPL_REGISTER_PORT, reg);
for (i=0; i<6; ++i)
{
OPL_ReadPort(OPL_REGISTER_PORT);
}
OPL_WritePort(OPL_DATA_PORT, val);
for (i=0; i<35; ++i)
{
OPL_ReadPort(OPL_REGISTER_PORT);
}
}
void ClearAllRegs(void)
{
int i;
for (i=0; i<=0xff; ++i)
{
WriteReg(i, 0x00);
}
}
void Init(void)
{
if (SDL_Init(SDL_INIT_TIMER) < 0)
{
fprintf(stderr, "Unable to initialise SDL timer\n");
exit(-1);
}
if (!OPL_Init(ADLIB_PORT))
{
fprintf(stderr, "Unable to initialise OPL layer\n");
exit(-1);
}
}
void Shutdown(void)
{
OPL_Shutdown();
}
struct timer_data
{
int running;
FILE *fstream;
};
void TimerCallback(void *data)
{
struct timer_data *timer_data = data;
int delay;
if (!timer_data->running)
{
return;
}
// Read data until we must make a delay.
for (;;)
{
int reg, val;
// End of file?
if (feof(timer_data->fstream))
{
timer_data->running = 0;
return;
}
reg = fgetc(timer_data->fstream);
val = fgetc(timer_data->fstream);
// Register value of 0 or 1 indicates a delay.
if (reg == 0x00)
{
delay = val;
break;
}
else if (reg == 0x01)
{
val |= (fgetc(timer_data->fstream) << 8);
delay = val;
break;
}
else
{
WriteReg(reg, val);
}
}
// Schedule the next timer callback.
OPL_SetCallback(delay, TimerCallback, timer_data);
}
void PlayFile(char *filename)
{
struct timer_data timer_data;
int running;
char buf[8];
timer_data.fstream = fopen(filename, "rb");
if (timer_data.fstream == NULL)
{
fprintf(stderr, "Failed to open %s\n", filename);
exit(-1);
}
if (fread(buf, 1, 8, timer_data.fstream) < 8)
{
fprintf(stderr, "failed to read raw OPL header\n");
exit(-1);
}
if (strncmp(buf, HEADER_STRING, 8) != 0)
{
fprintf(stderr, "Raw OPL header not found\n");
exit(-1);
}
fseek(timer_data.fstream, 28, SEEK_SET);
timer_data.running = 1;
// Start callback loop sequence.
OPL_SetCallback(0, TimerCallback, &timer_data);
// Sleep until the playback finishes.
do
{
OPL_Lock();
running = timer_data.running;
OPL_Unlock();
SDL_Delay(100);
} while (running);
fclose(timer_data.fstream);
}
int main(int argc, char *argv[])
{
if (argc < 2)
{
printf("Usage: %s <filename>\n", argv[0]);
exit(-1);
}
Init();
PlayFile(argv[1]);
ClearAllRegs();
Shutdown();
return 0;
}

View File

@ -0,0 +1,363 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2002, 2003 Marcel Telka
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// Interface to the ioperm.sys driver, based on code from the
// Cygwin ioperm library.
//
//-----------------------------------------------------------------------------
#ifdef _WIN32
#include <stdio.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winioctl.h>
#include <errno.h>
#include "ioperm_sys.h"
#define IOPERM_FILE L"\\\\.\\ioperm"
#define IOCTL_IOPERM \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0xA00, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct ioperm_data
{
unsigned long from;
unsigned long num;
int turn_on;
};
// Function pointers for advapi32.dll. This DLL does not exist on
// Windows 9x, so they are dynamically loaded from the DLL at runtime.
// haleyjd 09/09/10: Moved calling conventions into ()'s
static SC_HANDLE (WINAPI *MyOpenSCManagerW)(wchar_t *lpMachineName,
wchar_t *lpDatabaseName,
DWORD dwDesiredAccess) = NULL;
static SC_HANDLE (WINAPI *MyCreateServiceW)(SC_HANDLE hSCManager,
wchar_t *lpServiceName,
wchar_t *lpDisplayName,
DWORD dwDesiredAccess,
DWORD dwServiceType,
DWORD dwStartType,
DWORD dwErrorControl,
wchar_t *lpBinaryPathName,
wchar_t *lpLoadOrderGroup,
LPDWORD lpdwTagId,
wchar_t *lpDependencies,
wchar_t *lpServiceStartName,
wchar_t *lpPassword);
static SC_HANDLE (WINAPI *MyOpenServiceW)(SC_HANDLE hSCManager,
wchar_t *lpServiceName,
DWORD dwDesiredAccess);
static BOOL (WINAPI *MyStartServiceW)(SC_HANDLE hService,
DWORD dwNumServiceArgs,
wchar_t **lpServiceArgVectors);
static BOOL (WINAPI *MyControlService)(SC_HANDLE hService,
DWORD dwControl,
LPSERVICE_STATUS lpServiceStatus);
static BOOL (WINAPI *MyCloseServiceHandle)(SC_HANDLE hSCObject);
static BOOL (WINAPI *MyDeleteService)(SC_HANDLE hService);
static struct
{
char *name;
void **fn;
} dll_functions[] = {
{ "OpenSCManagerW", (void **) &MyOpenSCManagerW },
{ "CreateServiceW", (void **) &MyCreateServiceW },
{ "OpenServiceW", (void **) &MyOpenServiceW },
{ "StartServiceW", (void **) &MyStartServiceW },
{ "ControlService", (void **) &MyControlService },
{ "CloseServiceHandle", (void **) &MyCloseServiceHandle },
{ "DeleteService", (void **) &MyDeleteService },
};
// Globals
static SC_HANDLE scm = NULL;
static SC_HANDLE svc = NULL;
static int service_was_created = 0;
static int service_was_started = 0;
static int LoadLibraryPointers(void)
{
HMODULE dll;
int i;
// Already loaded?
if (MyOpenSCManagerW != NULL)
{
return 1;
}
dll = LoadLibraryW(L"advapi32.dll");
if (dll == NULL)
{
fprintf(stderr, "LoadLibraryPointers: Failed to open advapi32.dll\n");
return 0;
}
for (i = 0; i < sizeof(dll_functions) / sizeof(*dll_functions); ++i)
{
*dll_functions[i].fn = GetProcAddress(dll, dll_functions[i].name);
if (*dll_functions[i].fn == NULL)
{
fprintf(stderr, "LoadLibraryPointers: Failed to get address "
"for '%s'\n", dll_functions[i].name);
return 0;
}
}
return 1;
}
int IOperm_EnablePortRange(unsigned int from, unsigned int num, int turn_on)
{
HANDLE h;
struct ioperm_data ioperm_data;
DWORD BytesReturned;
BOOL r;
h = CreateFileW(IOPERM_FILE, GENERIC_READ, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (h == INVALID_HANDLE_VALUE)
{
errno = ENODEV;
return -1;
}
ioperm_data.from = from;
ioperm_data.num = num;
ioperm_data.turn_on = turn_on;
r = DeviceIoControl(h, IOCTL_IOPERM,
&ioperm_data, sizeof ioperm_data,
NULL, 0,
&BytesReturned, NULL);
if (!r)
{
errno = EPERM;
}
CloseHandle(h);
return r != 0;
}
// Load ioperm.sys driver.
// Returns 1 for success, 0 for failure.
// Remember to call IOperm_UninstallDriver to uninstall the driver later.
int IOperm_InstallDriver(void)
{
wchar_t driver_path[MAX_PATH];
int error;
int result = 1;
if (!LoadLibraryPointers())
{
return 0;
}
scm = MyOpenSCManagerW(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if (scm == NULL)
{
error = GetLastError();
fprintf(stderr, "IOperm_InstallDriver: OpenSCManager failed (%i).\n",
error);
return 0;
}
// Get the full path to the driver file.
GetFullPathNameW(L"ioperm.sys", MAX_PATH, driver_path, NULL);
// Create the service.
svc = MyCreateServiceW(scm,
L"ioperm",
L"ioperm support for Cygwin driver",
SERVICE_ALL_ACCESS,
SERVICE_KERNEL_DRIVER,
SERVICE_AUTO_START,
SERVICE_ERROR_NORMAL,
driver_path,
NULL,
NULL,
NULL,
NULL,
NULL);
if (svc == NULL)
{
error = GetLastError();
if (error != ERROR_SERVICE_EXISTS)
{
fprintf(stderr,
"IOperm_InstallDriver: Failed to create service (%i).\n",
error);
}
else
{
svc = MyOpenServiceW(scm, L"ioperm", SERVICE_ALL_ACCESS);
if (svc == NULL)
{
error = GetLastError();
fprintf(stderr,
"IOperm_InstallDriver: Failed to open service (%i).\n",
error);
}
}
if (svc == NULL)
{
MyCloseServiceHandle(scm);
return 0;
}
}
else
{
service_was_created = 1;
}
// Start the service. If the service already existed, it might have
// already been running as well.
if (!MyStartServiceW(svc, 0, NULL))
{
error = GetLastError();
if (error != ERROR_SERVICE_ALREADY_RUNNING)
{
fprintf(stderr, "IOperm_InstallDriver: Failed to start service (%i).\n",
error);
result = 0;
}
else
{
printf("IOperm_InstallDriver: ioperm driver already running.\n");
}
}
else
{
printf("IOperm_InstallDriver: ioperm driver installed.\n");
service_was_started = 1;
}
// If we failed to start the driver running, we need to clean up
// before finishing.
if (result == 0)
{
IOperm_UninstallDriver();
}
return result;
}
int IOperm_UninstallDriver(void)
{
SERVICE_STATUS stat;
int result = 1;
int error;
// If we started the service, stop it.
if (service_was_started)
{
if (!MyControlService(svc, SERVICE_CONTROL_STOP, &stat))
{
error = GetLastError();
if (error == ERROR_SERVICE_NOT_ACTIVE)
{
fprintf(stderr,
"IOperm_UninstallDriver: Service not active? (%i)\n",
error);
}
else
{
fprintf(stderr,
"IOperm_UninstallDriver: Failed to stop service (%i).\n",
error);
result = 0;
}
}
}
// If we created the service, delete it.
if (service_was_created)
{
if (!MyDeleteService(svc))
{
error = GetLastError();
fprintf(stderr,
"IOperm_UninstallDriver: DeleteService failed (%i).\n",
error);
result = 0;
}
else if (service_was_started)
{
printf("IOperm_UnInstallDriver: ioperm driver uninstalled.\n");
}
}
// Close handles.
if (svc != NULL)
{
MyCloseServiceHandle(svc);
svc = NULL;
}
if (scm != NULL)
{
MyCloseServiceHandle(scm);
scm = NULL;
}
service_was_created = 0;
service_was_started = 0;
return result;
}
#endif /* #ifndef _WIN32 */

View File

@ -0,0 +1,36 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2002, 2003 Marcel Telka
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// Interface to the ioperm.sys driver, based on code from the
// Cygwin ioperm library.
//
//-----------------------------------------------------------------------------
#ifndef IOPERM_SYS_H
#define IOPERM_SYS_H
int IOperm_EnablePortRange(unsigned int from, unsigned int num, int turn_on);
int IOperm_InstallDriver(void);
int IOperm_UninstallDriver(void);
#endif /* #ifndef IOPERM_SYS_H */

466
dockerdoom/trunk/opl/opl.c Normal file
View File

@ -0,0 +1,466 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL interface.
//
//-----------------------------------------------------------------------------
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#ifdef _WIN32_WCE
#include "libc_wince.h"
#endif
#include "SDL.h"
#include "opl.h"
#include "opl_internal.h"
//#define OPL_DEBUG_TRACE
#ifdef HAVE_IOPERM
extern opl_driver_t opl_linux_driver;
#endif
#if defined(HAVE_LIBI386) || defined(HAVE_LIBAMD64)
extern opl_driver_t opl_openbsd_driver;
#endif
#ifdef _WIN32
extern opl_driver_t opl_win32_driver;
#endif
extern opl_driver_t opl_sdl_driver;
static opl_driver_t *drivers[] =
{
#ifdef HAVE_IOPERM
&opl_linux_driver,
#endif
#if defined(HAVE_LIBI386) || defined(HAVE_LIBAMD64)
&opl_openbsd_driver,
#endif
#ifdef _WIN32
&opl_win32_driver,
#endif
&opl_sdl_driver,
NULL
};
static opl_driver_t *driver = NULL;
static int init_stage_reg_writes = 1;
unsigned int opl_sample_rate = 22050;
//
// Init/shutdown code.
//
// Initialize the specified driver and detect an OPL chip. Returns
// true if an OPL is detected.
static int InitDriver(opl_driver_t *_driver, unsigned int port_base)
{
// Initialize the driver.
if (!_driver->init_func(port_base))
{
return 0;
}
// The driver was initialized okay, so we now have somewhere
// to write to. It doesn't mean there's an OPL chip there,
// though. Perform the detection sequence to make sure.
// (it's done twice, like how Doom does it).
driver = _driver;
init_stage_reg_writes = 1;
if (!OPL_Detect() || !OPL_Detect())
{
printf("OPL_Init: No OPL detected using '%s' driver.\n", _driver->name);
_driver->shutdown_func();
driver = NULL;
return 0;
}
// Initialize all registers.
OPL_InitRegisters();
init_stage_reg_writes = 0;
printf("OPL_Init: Using driver '%s'.\n", driver->name);
return 1;
}
// Find a driver automatically by trying each in the list.
static int AutoSelectDriver(unsigned int port_base)
{
int i;
for (i=0; drivers[i] != NULL; ++i)
{
if (InitDriver(drivers[i], port_base))
{
return 1;
}
}
printf("OPL_Init: Failed to find a working driver.\n");
return 0;
}
// Initialize the OPL library. Returns true if initialized
// successfully.
int OPL_Init(unsigned int port_base)
{
char *driver_name;
int i;
driver_name = getenv("OPL_DRIVER");
if (driver_name != NULL)
{
// Search the list until we find the driver with this name.
for (i=0; drivers[i] != NULL; ++i)
{
if (!strcmp(driver_name, drivers[i]->name))
{
if (InitDriver(drivers[i], port_base))
{
return 1;
}
else
{
printf("OPL_Init: Failed to initialize "
"driver: '%s'.\n", driver_name);
return 0;
}
}
}
printf("OPL_Init: unknown driver: '%s'.\n", driver_name);
return 0;
}
else
{
return AutoSelectDriver(port_base);
}
}
// Shut down the OPL library.
void OPL_Shutdown(void)
{
if (driver != NULL)
{
driver->shutdown_func();
driver = NULL;
}
}
// Set the sample rate used for software OPL emulation.
void OPL_SetSampleRate(unsigned int rate)
{
opl_sample_rate = rate;
}
void OPL_WritePort(opl_port_t port, unsigned int value)
{
if (driver != NULL)
{
#ifdef OPL_DEBUG_TRACE
printf("OPL_write: %i, %x\n", port, value);
fflush(stdout);
#endif
driver->write_port_func(port, value);
}
}
unsigned int OPL_ReadPort(opl_port_t port)
{
if (driver != NULL)
{
unsigned int result;
#ifdef OPL_DEBUG_TRACE
printf("OPL_read: %i...\n", port);
fflush(stdout);
#endif
result = driver->read_port_func(port);
#ifdef OPL_DEBUG_TRACE
printf("OPL_read: %i -> %x\n", port, result);
fflush(stdout);
#endif
return result;
}
else
{
return 0;
}
}
//
// Higher-level functions, based on the lower-level functions above
// (register write, etc).
//
unsigned int OPL_ReadStatus(void)
{
return OPL_ReadPort(OPL_REGISTER_PORT);
}
// Write an OPL register value
void OPL_WriteRegister(int reg, int value)
{
int i;
OPL_WritePort(OPL_REGISTER_PORT, reg);
// For timing, read the register port six times after writing the
// register number to cause the appropriate delay
for (i=0; i<6; ++i)
{
// An oddity of the Doom OPL code: at startup initialization,
// the spacing here is performed by reading from the register
// port; after initialization, the data port is read, instead.
if (init_stage_reg_writes)
{
OPL_ReadPort(OPL_REGISTER_PORT);
}
else
{
OPL_ReadPort(OPL_DATA_PORT);
}
}
OPL_WritePort(OPL_DATA_PORT, value);
// Read the register port 24 times after writing the value to
// cause the appropriate delay
for (i=0; i<24; ++i)
{
OPL_ReadStatus();
}
}
// Detect the presence of an OPL chip
int OPL_Detect(void)
{
int result1, result2;
int i;
// Reset both timers:
OPL_WriteRegister(OPL_REG_TIMER_CTRL, 0x60);
// Enable interrupts:
OPL_WriteRegister(OPL_REG_TIMER_CTRL, 0x80);
// Read status
result1 = OPL_ReadStatus();
// Set timer:
OPL_WriteRegister(OPL_REG_TIMER1, 0xff);
// Start timer 1:
OPL_WriteRegister(OPL_REG_TIMER_CTRL, 0x21);
// Wait for 80 microseconds
// This is how Doom does it:
for (i=0; i<200; ++i)
{
OPL_ReadStatus();
}
OPL_Delay(1);
// Read status
result2 = OPL_ReadStatus();
// Reset both timers:
OPL_WriteRegister(OPL_REG_TIMER_CTRL, 0x60);
// Enable interrupts:
OPL_WriteRegister(OPL_REG_TIMER_CTRL, 0x80);
return (result1 & 0xe0) == 0x00
&& (result2 & 0xe0) == 0xc0;
}
// Initialize registers on startup
void OPL_InitRegisters(void)
{
int r;
// Initialize level registers
for (r=OPL_REGS_LEVEL; r <= OPL_REGS_LEVEL + OPL_NUM_OPERATORS; ++r)
{
OPL_WriteRegister(r, 0x3f);
}
// Initialize other registers
// These two loops write to registers that actually don't exist,
// but this is what Doom does ...
// Similarly, the <= is also intenational.
for (r=OPL_REGS_ATTACK; r <= OPL_REGS_WAVEFORM + OPL_NUM_OPERATORS; ++r)
{
OPL_WriteRegister(r, 0x00);
}
// More registers ...
for (r=1; r < OPL_REGS_LEVEL; ++r)
{
OPL_WriteRegister(r, 0x00);
}
// Re-initialize the low registers:
// Reset both timers and enable interrupts:
OPL_WriteRegister(OPL_REG_TIMER_CTRL, 0x60);
OPL_WriteRegister(OPL_REG_TIMER_CTRL, 0x80);
// "Allow FM chips to control the waveform of each operator":
OPL_WriteRegister(OPL_REG_WAVEFORM_ENABLE, 0x20);
// Keyboard split point on (?)
OPL_WriteRegister(OPL_REG_FM_MODE, 0x40);
}
//
// Timer functions.
//
void OPL_SetCallback(unsigned int ms, opl_callback_t callback, void *data)
{
if (driver != NULL)
{
driver->set_callback_func(ms, callback, data);
}
}
void OPL_ClearCallbacks(void)
{
if (driver != NULL)
{
driver->clear_callbacks_func();
}
}
void OPL_Lock(void)
{
if (driver != NULL)
{
driver->lock_func();
}
}
void OPL_Unlock(void)
{
if (driver != NULL)
{
driver->unlock_func();
}
}
typedef struct
{
int finished;
SDL_mutex *mutex;
SDL_cond *cond;
} delay_data_t;
static void DelayCallback(void *_delay_data)
{
delay_data_t *delay_data = _delay_data;
SDL_LockMutex(delay_data->mutex);
delay_data->finished = 1;
SDL_CondSignal(delay_data->cond);
SDL_UnlockMutex(delay_data->mutex);
}
void OPL_Delay(unsigned int ms)
{
delay_data_t delay_data;
if (driver == NULL)
{
return;
}
// Create a callback that will signal this thread after the
// specified time.
delay_data.finished = 0;
delay_data.mutex = SDL_CreateMutex();
delay_data.cond = SDL_CreateCond();
OPL_SetCallback(ms, DelayCallback, &delay_data);
// Wait until the callback is invoked.
SDL_LockMutex(delay_data.mutex);
while (!delay_data.finished)
{
SDL_CondWait(delay_data.cond, delay_data.mutex);
}
SDL_UnlockMutex(delay_data.mutex);
// Clean up.
SDL_DestroyMutex(delay_data.mutex);
SDL_DestroyCond(delay_data.cond);
}
void OPL_SetPaused(int paused)
{
if (driver != NULL)
{
driver->set_paused_func(paused);
}
}

137
dockerdoom/trunk/opl/opl.h Normal file
View File

@ -0,0 +1,137 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL interface.
//
//-----------------------------------------------------------------------------
#ifndef OPL_OPL_H
#define OPL_OPL_H
typedef void (*opl_callback_t)(void *data);
typedef enum
{
OPL_REGISTER_PORT = 0,
OPL_DATA_PORT = 1
} opl_port_t;
#define OPL_NUM_OPERATORS 21
#define OPL_NUM_VOICES 9
#define OPL_REG_WAVEFORM_ENABLE 0x01
#define OPL_REG_TIMER1 0x02
#define OPL_REG_TIMER2 0x03
#define OPL_REG_TIMER_CTRL 0x04
#define OPL_REG_FM_MODE 0x08
// Operator registers (21 of each):
#define OPL_REGS_TREMOLO 0x20
#define OPL_REGS_LEVEL 0x40
#define OPL_REGS_ATTACK 0x60
#define OPL_REGS_SUSTAIN 0x80
#define OPL_REGS_WAVEFORM 0xE0
// Voice registers (9 of each):
#define OPL_REGS_FREQ_1 0xA0
#define OPL_REGS_FREQ_2 0xB0
#define OPL_REGS_FEEDBACK 0xC0
//
// Low-level functions.
//
// Initialize the OPL subsystem.
int OPL_Init(unsigned int port_base);
// Shut down the OPL subsystem.
void OPL_Shutdown(void);
// Set the sample rate used for software emulation.
void OPL_SetSampleRate(unsigned int rate);
// Write to one of the OPL I/O ports:
void OPL_WritePort(opl_port_t port, unsigned int value);
// Read from one of the OPL I/O ports:
unsigned int OPL_ReadPort(opl_port_t port);
//
// Higher-level functions.
//
// Read the cuurrent status byte of the OPL chip.
unsigned int OPL_ReadStatus(void);
// Write to an OPL register.
void OPL_WriteRegister(int reg, int value);
// Perform a detection sequence to determine that an
// OPL chip is present.
int OPL_Detect(void);
// Initialize all registers, performed on startup.
void OPL_InitRegisters(void);
//
// Timer callback functions.
//
// Set a timer callback. After the specified number of milliseconds
// have elapsed, the callback will be invoked.
void OPL_SetCallback(unsigned int ms, opl_callback_t callback, void *data);
// Clear all OPL callbacks that have been set.
void OPL_ClearCallbacks(void);
// Begin critical section, during which, OPL callbacks will not be
// invoked.
void OPL_Lock(void);
// End critical section.
void OPL_Unlock(void);
// Block until the specified number of milliseconds have elapsed.
void OPL_Delay(unsigned int ms);
// Pause the OPL callbacks.
void OPL_SetPaused(int paused);
#endif

View File

@ -0,0 +1,64 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL internal interface.
//
//-----------------------------------------------------------------------------
#ifndef OPL_INTERNAL_H
#define OPL_INTERNAL_H
#include "opl.h"
typedef int (*opl_init_func)(unsigned int port_base);
typedef void (*opl_shutdown_func)(void);
typedef unsigned int (*opl_read_port_func)(opl_port_t port);
typedef void (*opl_write_port_func)(opl_port_t port, unsigned int value);
typedef void (*opl_set_callback_func)(unsigned int ms,
opl_callback_t callback,
void *data);
typedef void (*opl_clear_callbacks_func)(void);
typedef void (*opl_lock_func)(void);
typedef void (*opl_unlock_func)(void);
typedef void (*opl_set_paused_func)(int paused);
typedef struct
{
char *name;
opl_init_func init_func;
opl_shutdown_func shutdown_func;
opl_read_port_func read_port_func;
opl_write_port_func write_port_func;
opl_set_callback_func set_callback_func;
opl_clear_callbacks_func clear_callbacks_func;
opl_lock_func lock_func;
opl_unlock_func unlock_func;
opl_set_paused_func set_paused_func;
} opl_driver_t;
// Sample rate to use when doing software emulation.
extern unsigned int opl_sample_rate;
#endif /* #ifndef OPL_INTERNAL_H */

View File

@ -0,0 +1,110 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL Linux interface.
//
//-----------------------------------------------------------------------------
#include "config.h"
#ifdef HAVE_IOPERM
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/io.h>
#include "opl.h"
#include "opl_internal.h"
#include "opl_timer.h"
static unsigned int opl_port_base;
static int OPL_Linux_Init(unsigned int port_base)
{
// Try to get permissions:
if (ioperm(port_base, 2, 1) < 0)
{
fprintf(stderr, "Failed to get I/O port permissions for 0x%x: %s\n",
port_base, strerror(errno));
if (errno == EPERM)
{
fprintf(stderr,
"\tYou may need to run the program as root in order\n"
"\tto acquire I/O port permissions for OPL MIDI playback.\n");
}
return 0;
}
opl_port_base = port_base;
// Start callback thread
if (!OPL_Timer_StartThread())
{
ioperm(port_base, 2, 0);
return 0;
}
return 1;
}
static void OPL_Linux_Shutdown(void)
{
// Stop callback thread
OPL_Timer_StopThread();
// Release permissions
ioperm(opl_port_base, 2, 0);
}
static unsigned int OPL_Linux_PortRead(opl_port_t port)
{
return inb(opl_port_base + port);
}
static void OPL_Linux_PortWrite(opl_port_t port, unsigned int value)
{
outb(value, opl_port_base + port);
}
opl_driver_t opl_linux_driver =
{
"Linux",
OPL_Linux_Init,
OPL_Linux_Shutdown,
OPL_Linux_PortRead,
OPL_Linux_PortWrite,
OPL_Timer_SetCallback,
OPL_Timer_ClearCallbacks,
OPL_Timer_Lock,
OPL_Timer_Unlock,
OPL_Timer_SetPaused
};
#endif /* #ifdef HAVE_IOPERM */

View File

@ -0,0 +1,125 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL OpenBSD interface (also NetBSD)
//
//-----------------------------------------------------------------------------
#include "config.h"
// OpenBSD has a i386_iopl on i386 and amd64_iopl on x86_64,
// even though they do the same thing. Take care of this
// here, and map set_iopl to point to the appropriate name.
#if defined(HAVE_LIBI386)
#include <sys/types.h>
#include <machine/sysarch.h>
#include <i386/pio.h>
#define set_iopl i386_iopl
#elif defined(HAVE_LIBAMD64)
#include <sys/types.h>
#include <machine/sysarch.h>
#include <amd64/pio.h>
#define set_iopl amd64_iopl
#else
#define NO_OBSD_DRIVER
#endif
// If the above succeeded, proceed with the rest.
#ifndef NO_OBSD_DRIVER
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include "opl.h"
#include "opl_internal.h"
#include "opl_timer.h"
static unsigned int opl_port_base;
static int OPL_OpenBSD_Init(unsigned int port_base)
{
// Try to get permissions:
if (set_iopl(3) < 0)
{
fprintf(stderr, "Failed to get raise I/O privilege level: "
"check that you are running as root.\n");
return 0;
}
opl_port_base = port_base;
// Start callback thread
if (!OPL_Timer_StartThread())
{
set_iopl(0);
return 0;
}
return 1;
}
static void OPL_OpenBSD_Shutdown(void)
{
// Stop callback thread
OPL_Timer_StopThread();
// Release I/O port permissions:
set_iopl(0);
}
static unsigned int OPL_OpenBSD_PortRead(opl_port_t port)
{
return inb(opl_port_base + port);
}
static void OPL_OpenBSD_PortWrite(opl_port_t port, unsigned int value)
{
outb(opl_port_base + port, value);
}
opl_driver_t opl_openbsd_driver =
{
"OpenBSD",
OPL_OpenBSD_Init,
OPL_OpenBSD_Shutdown,
OPL_OpenBSD_PortRead,
OPL_OpenBSD_PortWrite,
OPL_Timer_SetCallback,
OPL_Timer_ClearCallbacks,
OPL_Timer_Lock,
OPL_Timer_Unlock,
OPL_Timer_SetPaused
};
#endif /* #ifndef NO_OBSD_DRIVER */

View File

@ -0,0 +1,280 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// Queue of waiting callbacks, stored in a binary min heap, so that we
// can always get the first callback.
//
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "opl_queue.h"
#define MAX_OPL_QUEUE 64
typedef struct
{
opl_callback_t callback;
void *data;
unsigned int time;
} opl_queue_entry_t;
struct opl_callback_queue_s
{
opl_queue_entry_t entries[MAX_OPL_QUEUE];
unsigned int num_entries;
};
opl_callback_queue_t *OPL_Queue_Create(void)
{
opl_callback_queue_t *queue;
queue = malloc(sizeof(opl_callback_queue_t));
queue->num_entries = 0;
return queue;
}
void OPL_Queue_Destroy(opl_callback_queue_t *queue)
{
free(queue);
}
int OPL_Queue_IsEmpty(opl_callback_queue_t *queue)
{
return queue->num_entries == 0;
}
void OPL_Queue_Clear(opl_callback_queue_t *queue)
{
queue->num_entries = 0;
}
void OPL_Queue_Push(opl_callback_queue_t *queue,
opl_callback_t callback, void *data,
unsigned int time)
{
int entry_id;
int parent_id;
if (queue->num_entries >= MAX_OPL_QUEUE)
{
fprintf(stderr, "OPL_Queue_Push: Exceeded maximum callbacks\n");
return;
}
// Add to last queue entry.
entry_id = queue->num_entries;
++queue->num_entries;
// Shift existing entries down in the heap.
while (entry_id > 0)
{
parent_id = (entry_id - 1) / 2;
// Is the heap condition satisfied?
if (time >= queue->entries[parent_id].time)
{
break;
}
// Move the existing entry down in the heap.
memcpy(&queue->entries[entry_id],
&queue->entries[parent_id],
sizeof(opl_queue_entry_t));
// Advance to the parent.
entry_id = parent_id;
}
// Insert new callback data.
queue->entries[entry_id].callback = callback;
queue->entries[entry_id].data = data;
queue->entries[entry_id].time = time;
}
int OPL_Queue_Pop(opl_callback_queue_t *queue,
opl_callback_t *callback, void **data)
{
opl_queue_entry_t *entry;
int child1, child2;
int i, next_i;
// Empty?
if (queue->num_entries <= 0)
{
return 0;
}
// Store the result:
*callback = queue->entries[0].callback;
*data = queue->entries[0].data;
// Decrease the heap size, and keep pointer to the last entry in
// the heap, which must now be percolated down from the top.
--queue->num_entries;
entry = &queue->entries[queue->num_entries];
// Percolate down.
i = 0;
for (;;)
{
child1 = i * 2 + 1;
child2 = i * 2 + 2;
if (child1 < queue->num_entries
&& queue->entries[child1].time < entry->time)
{
// Left child is less than entry.
// Use the minimum of left and right children.
if (child2 < queue->num_entries
&& queue->entries[child2].time < queue->entries[child1].time)
{
next_i = child2;
}
else
{
next_i = child1;
}
}
else if (child2 < queue->num_entries
&& queue->entries[child2].time < entry->time)
{
// Right child is less than entry. Go down the right side.
next_i = child2;
}
else
{
// Finished percolating.
break;
}
// Percolate the next value up and advance.
memcpy(&queue->entries[i],
&queue->entries[next_i],
sizeof(opl_queue_entry_t));
i = next_i;
}
// Store the old last-entry at its new position.
memcpy(&queue->entries[i], entry, sizeof(opl_queue_entry_t));
return 1;
}
unsigned int OPL_Queue_Peek(opl_callback_queue_t *queue)
{
if (queue->num_entries > 0)
{
return queue->entries[0].time;
}
else
{
return 0;
}
}
#ifdef TEST
#include <assert.h>
static void PrintQueueNode(opl_callback_queue_t *queue, int node, int depth)
{
int i;
if (node >= queue->num_entries)
{
return;
}
for (i=0; i<depth * 3; ++i)
{
printf(" ");
}
printf("%i\n", queue->entries[node].time);
PrintQueueNode(queue, node * 2 + 1, depth + 1);
PrintQueueNode(queue, node * 2 + 2, depth + 1);
}
static void PrintQueue(opl_callback_queue_t *queue)
{
PrintQueueNode(queue, 0, 0);
}
int main()
{
opl_callback_queue_t *queue;
int iteration;
queue = OPL_Queue_Create();
for (iteration=0; iteration<5000; ++iteration)
{
opl_callback_t callback;
void *data;
unsigned int time;
unsigned int newtime;
int i;
for (i=0; i<MAX_OPL_QUEUE; ++i)
{
time = rand() % 0x10000;
OPL_Queue_Push(queue, NULL, NULL, time);
}
time = 0;
for (i=0; i<MAX_OPL_QUEUE; ++i)
{
assert(!OPL_Queue_IsEmpty(queue));
newtime = OPL_Queue_Peek(queue);
assert(OPL_Queue_Pop(queue, &callback, &data));
assert(newtime >= time);
time = newtime;
}
assert(OPL_Queue_IsEmpty(queue));
assert(!OPL_Queue_Pop(queue, &callback, &data));
}
}
#endif

View File

@ -0,0 +1,45 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL callback queue.
//
//-----------------------------------------------------------------------------
#ifndef OPL_QUEUE_H
#define OPL_QUEUE_H
#include "opl.h"
typedef struct opl_callback_queue_s opl_callback_queue_t;
opl_callback_queue_t *OPL_Queue_Create(void);
int OPL_Queue_IsEmpty(opl_callback_queue_t *queue);
void OPL_Queue_Clear(opl_callback_queue_t *queue);
void OPL_Queue_Destroy(opl_callback_queue_t *queue);
void OPL_Queue_Push(opl_callback_queue_t *queue,
opl_callback_t callback, void *data,
unsigned int time);
int OPL_Queue_Pop(opl_callback_queue_t *queue,
opl_callback_t *callback, void **data);
unsigned int OPL_Queue_Peek(opl_callback_queue_t *queue);
#endif /* #ifndef OPL_QUEUE_H */

View File

@ -0,0 +1,510 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL SDL interface.
//
//-----------------------------------------------------------------------------
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include "SDL.h"
#include "SDL_mixer.h"
#include "dbopl.h"
#include "opl.h"
#include "opl_internal.h"
#include "opl_queue.h"
#define MAX_SOUND_SLICE_TIME 100 /* ms */
typedef struct
{
unsigned int rate; // Number of times the timer is advanced per sec.
unsigned int enabled; // Non-zero if timer is enabled.
unsigned int value; // Last value that was set.
unsigned int expire_time; // Calculated time that timer will expire.
} opl_timer_t;
// When the callback mutex is locked using OPL_Lock, callback functions
// are not invoked.
static SDL_mutex *callback_mutex = NULL;
// Queue of callbacks waiting to be invoked.
static opl_callback_queue_t *callback_queue;
// Mutex used to control access to the callback queue.
static SDL_mutex *callback_queue_mutex = NULL;
// Current time, in number of samples since startup:
static int current_time;
// If non-zero, playback is currently paused.
static int opl_sdl_paused;
// Time offset (in samples) due to the fact that callbacks
// were previously paused.
static unsigned int pause_offset;
// OPL software emulator structure.
static Chip opl_chip;
// Temporary mixing buffer used by the mixing callback.
static int32_t *mix_buffer = NULL;
// Register number that was written.
static int register_num = 0;
// Timers; DBOPL does not do timer stuff itself.
static opl_timer_t timer1 = { 12500, 0, 0, 0 };
static opl_timer_t timer2 = { 3125, 0, 0, 0 };
// SDL parameters.
static int sdl_was_initialized = 0;
static int mixing_freq, mixing_channels;
static Uint16 mixing_format;
static int SDLIsInitialized(void)
{
int freq, channels;
Uint16 format;
return Mix_QuerySpec(&freq, &format, &channels);
}
// Advance time by the specified number of samples, invoking any
// callback functions as appropriate.
static void AdvanceTime(unsigned int nsamples)
{
opl_callback_t callback;
void *callback_data;
SDL_LockMutex(callback_queue_mutex);
// Advance time.
current_time += nsamples;
if (opl_sdl_paused)
{
pause_offset += nsamples;
}
// Are there callbacks to invoke now? Keep invoking them
// until there are none more left.
while (!OPL_Queue_IsEmpty(callback_queue)
&& current_time >= OPL_Queue_Peek(callback_queue) + pause_offset)
{
// Pop the callback from the queue to invoke it.
if (!OPL_Queue_Pop(callback_queue, &callback, &callback_data))
{
break;
}
// The mutex stuff here is a bit complicated. We must
// hold callback_mutex when we invoke the callback (so that
// the control thread can use OPL_Lock() to prevent callbacks
// from being invoked), but we must not be holding
// callback_queue_mutex, as the callback must be able to
// call OPL_SetCallback to schedule new callbacks.
SDL_UnlockMutex(callback_queue_mutex);
SDL_LockMutex(callback_mutex);
callback(callback_data);
SDL_UnlockMutex(callback_mutex);
SDL_LockMutex(callback_queue_mutex);
}
SDL_UnlockMutex(callback_queue_mutex);
}
// Call the OPL emulator code to fill the specified buffer.
static void FillBuffer(int16_t *buffer, unsigned int nsamples)
{
unsigned int i;
// This seems like a reasonable assumption. mix_buffer is
// 1 second long, which should always be much longer than the
// SDL mix buffer.
assert(nsamples < mixing_freq);
Chip__GenerateBlock2(&opl_chip, nsamples, mix_buffer);
// Mix into the destination buffer, doubling up into stereo.
for (i=0; i<nsamples; ++i)
{
buffer[i * 2] = (int16_t) mix_buffer[i];
buffer[i * 2 + 1] = (int16_t) mix_buffer[i];
}
}
// Callback function to fill a new sound buffer:
static void OPL_Mix_Callback(void *udata,
Uint8 *byte_buffer,
int buffer_bytes)
{
int16_t *buffer;
unsigned int buffer_len;
unsigned int filled = 0;
// Buffer length in samples (quadrupled, because of 16-bit and stereo)
buffer = (int16_t *) byte_buffer;
buffer_len = buffer_bytes / 4;
// Repeatedly call the OPL emulator update function until the buffer is
// full.
while (filled < buffer_len)
{
unsigned int next_callback_time;
unsigned int nsamples;
SDL_LockMutex(callback_queue_mutex);
// Work out the time until the next callback waiting in
// the callback queue must be invoked. We can then fill the
// buffer with this many samples.
if (opl_sdl_paused || OPL_Queue_IsEmpty(callback_queue))
{
nsamples = buffer_len - filled;
}
else
{
next_callback_time = OPL_Queue_Peek(callback_queue) + pause_offset;
nsamples = next_callback_time - current_time;
if (nsamples > buffer_len - filled)
{
nsamples = buffer_len - filled;
}
}
SDL_UnlockMutex(callback_queue_mutex);
// Add emulator output to buffer.
FillBuffer(buffer + filled * 2, nsamples);
filled += nsamples;
// Invoke callbacks for this point in time.
AdvanceTime(nsamples);
}
}
static void OPL_SDL_Shutdown(void)
{
Mix_HookMusic(NULL, NULL);
if (sdl_was_initialized)
{
Mix_CloseAudio();
SDL_QuitSubSystem(SDL_INIT_AUDIO);
OPL_Queue_Destroy(callback_queue);
free(mix_buffer);
sdl_was_initialized = 0;
}
/*
if (opl_chip != NULL)
{
OPLDestroy(opl_chip);
opl_chip = NULL;
}
*/
if (callback_mutex != NULL)
{
SDL_DestroyMutex(callback_mutex);
callback_mutex = NULL;
}
if (callback_queue_mutex != NULL)
{
SDL_DestroyMutex(callback_queue_mutex);
callback_queue_mutex = NULL;
}
}
static unsigned int GetSliceSize(void)
{
int limit;
int n;
limit = (opl_sample_rate * MAX_SOUND_SLICE_TIME) / 1000;
// Try all powers of two, not exceeding the limit.
for (n=0;; ++n)
{
// 2^n <= limit < 2^n+1 ?
if ((1 << (n + 1)) > limit)
{
return (1 << n);
}
}
// Should never happen?
return 1024;
}
static int OPL_SDL_Init(unsigned int port_base)
{
// Check if SDL_mixer has been opened already
// If not, we must initialize it now
if (!SDLIsInitialized())
{
if (SDL_Init(SDL_INIT_AUDIO) < 0)
{
fprintf(stderr, "Unable to set up sound.\n");
return 0;
}
if (Mix_OpenAudio(opl_sample_rate, AUDIO_S16SYS, 2, GetSliceSize()) < 0)
{
fprintf(stderr, "Error initialising SDL_mixer: %s\n", Mix_GetError());
SDL_QuitSubSystem(SDL_INIT_AUDIO);
return 0;
}
SDL_PauseAudio(0);
// When this module shuts down, it has the responsibility to
// shut down SDL.
sdl_was_initialized = 1;
}
else
{
sdl_was_initialized = 0;
}
opl_sdl_paused = 0;
pause_offset = 0;
// Queue structure of callbacks to invoke.
callback_queue = OPL_Queue_Create();
current_time = 0;
// Get the mixer frequency, format and number of channels.
Mix_QuerySpec(&mixing_freq, &mixing_format, &mixing_channels);
// Only supports AUDIO_S16SYS
if (mixing_format != AUDIO_S16SYS || mixing_channels != 2)
{
fprintf(stderr,
"OPL_SDL only supports native signed 16-bit LSB, "
"stereo format!\n");
OPL_SDL_Shutdown();
return 0;
}
// Mix buffer:
mix_buffer = malloc(mixing_freq * sizeof(uint32_t));
// Create the emulator structure:
DBOPL_InitTables();
Chip__Chip(&opl_chip);
Chip__Setup(&opl_chip, mixing_freq);
callback_mutex = SDL_CreateMutex();
callback_queue_mutex = SDL_CreateMutex();
// TODO: This should be music callback? or-?
Mix_HookMusic(OPL_Mix_Callback, NULL);
return 1;
}
static unsigned int OPL_SDL_PortRead(opl_port_t port)
{
unsigned int result = 0;
if (timer1.enabled && current_time > timer1.expire_time)
{
result |= 0x80; // Either have expired
result |= 0x40; // Timer 1 has expired
}
if (timer2.enabled && current_time > timer2.expire_time)
{
result |= 0x80; // Either have expired
result |= 0x20; // Timer 2 has expired
}
return result;
}
static void OPLTimer_CalculateEndTime(opl_timer_t *timer)
{
int tics;
// If the timer is enabled, calculate the time when the timer
// will expire.
if (timer->enabled)
{
tics = 0x100 - timer->value;
timer->expire_time = current_time
+ (tics * opl_sample_rate) / timer->rate;
}
}
static void WriteRegister(unsigned int reg_num, unsigned int value)
{
switch (reg_num)
{
case OPL_REG_TIMER1:
timer1.value = value;
OPLTimer_CalculateEndTime(&timer1);
break;
case OPL_REG_TIMER2:
timer2.value = value;
OPLTimer_CalculateEndTime(&timer2);
break;
case OPL_REG_TIMER_CTRL:
if (value & 0x80)
{
timer1.enabled = 0;
timer2.enabled = 0;
}
else
{
if ((value & 0x40) == 0)
{
timer1.enabled = (value & 0x01) != 0;
OPLTimer_CalculateEndTime(&timer1);
}
if ((value & 0x20) == 0)
{
timer1.enabled = (value & 0x02) != 0;
OPLTimer_CalculateEndTime(&timer2);
}
}
break;
default:
Chip__WriteReg(&opl_chip, reg_num, value);
break;
}
}
static void OPL_SDL_PortWrite(opl_port_t port, unsigned int value)
{
if (port == OPL_REGISTER_PORT)
{
register_num = value;
}
else if (port == OPL_DATA_PORT)
{
WriteRegister(register_num, value);
}
}
static void OPL_SDL_SetCallback(unsigned int ms,
opl_callback_t callback,
void *data)
{
SDL_LockMutex(callback_queue_mutex);
OPL_Queue_Push(callback_queue, callback, data,
current_time - pause_offset + (ms * mixing_freq) / 1000);
SDL_UnlockMutex(callback_queue_mutex);
}
static void OPL_SDL_ClearCallbacks(void)
{
SDL_LockMutex(callback_queue_mutex);
OPL_Queue_Clear(callback_queue);
SDL_UnlockMutex(callback_queue_mutex);
}
static void OPL_SDL_Lock(void)
{
SDL_LockMutex(callback_mutex);
}
static void OPL_SDL_Unlock(void)
{
SDL_UnlockMutex(callback_mutex);
}
static void OPL_SDL_SetPaused(int paused)
{
opl_sdl_paused = paused;
}
opl_driver_t opl_sdl_driver =
{
"SDL",
OPL_SDL_Init,
OPL_SDL_Shutdown,
OPL_SDL_PortRead,
OPL_SDL_PortWrite,
OPL_SDL_SetCallback,
OPL_SDL_ClearCallbacks,
OPL_SDL_Lock,
OPL_SDL_Unlock,
OPL_SDL_SetPaused
};

View File

@ -0,0 +1,251 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL timer thread.
// Once started using OPL_Timer_StartThread, the thread sleeps,
// waking up to invoke callbacks set using OPL_Timer_SetCallback.
//
//-----------------------------------------------------------------------------
#include "SDL.h"
#include "opl_timer.h"
#include "opl_queue.h"
typedef enum
{
THREAD_STATE_STOPPED,
THREAD_STATE_RUNNING,
THREAD_STATE_STOPPING,
} thread_state_t;
static SDL_Thread *timer_thread = NULL;
static thread_state_t timer_thread_state;
static int current_time;
// If non-zero, callbacks are currently paused.
static int opl_timer_paused;
// Offset in milliseconds to adjust time due to the fact that playback
// was paused.
static unsigned int pause_offset = 0;
// Queue of callbacks waiting to be invoked.
// The callback queue mutex is held while the callback queue structure
// or current_time is being accessed.
static opl_callback_queue_t *callback_queue;
static SDL_mutex *callback_queue_mutex;
// The timer mutex is held while timer callback functions are being
// invoked, so that the calling code can prevent clashes.
static SDL_mutex *timer_mutex;
// Returns true if there is a callback at the head of the queue ready
// to be invoked. Otherwise, next_time is set to the time when the
// timer thread must wake up again to check.
static int CallbackWaiting(unsigned int *next_time)
{
// If paused, just wait in 50ms increments until unpaused.
// Update pause_offset so after we unpause, the callback
// times will be right.
if (opl_timer_paused)
{
*next_time = current_time + 50;
pause_offset += 50;
return 0;
}
// If there are no queued callbacks, sleep for 50ms at a time
// until a callback is added.
if (OPL_Queue_IsEmpty(callback_queue))
{
*next_time = current_time + 50;
return 0;
}
// Read the time of the first callback in the queue.
// If the time for the callback has not yet arrived,
// we must sleep until the callback time.
*next_time = OPL_Queue_Peek(callback_queue) + pause_offset;
return *next_time <= current_time;
}
static unsigned int GetNextTime(void)
{
opl_callback_t callback;
void *callback_data;
unsigned int next_time;
int have_callback;
// Keep running through callbacks until there are none ready to
// run. When we run out of callbacks, next_time will be set.
do
{
SDL_LockMutex(callback_queue_mutex);
// Check if the callback at the head of the list is ready to
// be invoked. If so, pop from the head of the queue.
have_callback = CallbackWaiting(&next_time);
if (have_callback)
{
OPL_Queue_Pop(callback_queue, &callback, &callback_data);
}
SDL_UnlockMutex(callback_queue_mutex);
// Now invoke the callback, if we have one.
// The timer mutex is held while the callback is invoked.
if (have_callback)
{
SDL_LockMutex(timer_mutex);
callback(callback_data);
SDL_UnlockMutex(timer_mutex);
}
} while (have_callback);
return next_time;
}
static int ThreadFunction(void *unused)
{
unsigned int next_time;
unsigned int now;
// Keep running until OPL_Timer_StopThread is called.
while (timer_thread_state == THREAD_STATE_RUNNING)
{
// Get the next time that we must sleep until, and
// wait until that time.
next_time = GetNextTime();
now = SDL_GetTicks();
if (next_time > now)
{
SDL_Delay(next_time - now);
}
// Update the current time.
SDL_LockMutex(callback_queue_mutex);
current_time = next_time;
SDL_UnlockMutex(callback_queue_mutex);
}
timer_thread_state = THREAD_STATE_STOPPED;
return 0;
}
static void InitResources(void)
{
callback_queue = OPL_Queue_Create();
timer_mutex = SDL_CreateMutex();
callback_queue_mutex = SDL_CreateMutex();
}
static void FreeResources(void)
{
OPL_Queue_Destroy(callback_queue);
SDL_DestroyMutex(callback_queue_mutex);
SDL_DestroyMutex(timer_mutex);
}
int OPL_Timer_StartThread(void)
{
InitResources();
timer_thread_state = THREAD_STATE_RUNNING;
current_time = SDL_GetTicks();
opl_timer_paused = 0;
pause_offset = 0;
timer_thread = SDL_CreateThread(ThreadFunction, NULL);
if (timer_thread == NULL)
{
timer_thread_state = THREAD_STATE_STOPPED;
FreeResources();
return 0;
}
return 1;
}
void OPL_Timer_StopThread(void)
{
timer_thread_state = THREAD_STATE_STOPPING;
while (timer_thread_state != THREAD_STATE_STOPPED)
{
SDL_Delay(1);
}
FreeResources();
}
void OPL_Timer_SetCallback(unsigned int ms, opl_callback_t callback, void *data)
{
SDL_LockMutex(callback_queue_mutex);
OPL_Queue_Push(callback_queue, callback, data,
current_time + ms - pause_offset);
SDL_UnlockMutex(callback_queue_mutex);
}
void OPL_Timer_ClearCallbacks(void)
{
SDL_LockMutex(callback_queue_mutex);
OPL_Queue_Clear(callback_queue);
SDL_UnlockMutex(callback_queue_mutex);
}
void OPL_Timer_Lock(void)
{
SDL_LockMutex(timer_mutex);
}
void OPL_Timer_Unlock(void)
{
SDL_UnlockMutex(timer_mutex);
}
void OPL_Timer_SetPaused(int paused)
{
SDL_LockMutex(callback_queue_mutex);
opl_timer_paused = paused;
SDL_UnlockMutex(callback_queue_mutex);
}

View File

@ -0,0 +1,42 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL timer thread.
//
//-----------------------------------------------------------------------------
#ifndef OPL_TIMER_H
#define OPL_TIMER_H
#include "opl.h"
int OPL_Timer_StartThread(void);
void OPL_Timer_StopThread(void);
void OPL_Timer_SetCallback(unsigned int ms,
opl_callback_t callback,
void *data);
void OPL_Timer_ClearCallbacks(void);
void OPL_Timer_Lock(void);
void OPL_Timer_Unlock(void);
void OPL_Timer_SetPaused(int paused);
#endif /* #ifndef OPL_TIMER_H */

View File

@ -0,0 +1,199 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2009 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
// OPL Win32 native interface.
//
//-----------------------------------------------------------------------------
#include "config.h"
#ifdef _WIN32
#include <stdio.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "opl.h"
#include "opl_internal.h"
#include "opl_timer.h"
#include "ioperm_sys.h"
static unsigned int opl_port_base;
// MingW?
#if defined(__GNUC__) && defined(__i386__)
static unsigned int OPL_Win32_PortRead(opl_port_t port)
{
unsigned char result;
__asm__ volatile (
"movl %1, %%edx\n"
"inb %%dx, %%al\n"
"movb %%al, %0"
: "=m" (result)
: "r" (opl_port_base + port)
: "edx", "al", "memory"
);
return result;
}
static void OPL_Win32_PortWrite(opl_port_t port, unsigned int value)
{
__asm__ volatile (
"movl %0, %%edx\n"
"movb %1, %%al\n"
"outb %%al, %%dx"
:
: "r" (opl_port_base + port), "r" ((unsigned char) value)
: "edx", "al"
);
}
// haleyjd 20110417: MSVC version
#elif defined(_MSC_VER) && defined(_M_IX86)
static unsigned int OPL_Win32_PortRead(opl_port_t port)
{
unsigned char result;
opl_port_t dst_port = opl_port_base + port;
__asm
{
mov edx, dword ptr [dst_port]
in al, dx
mov byte ptr [result], al
}
return result;
}
static void OPL_Win32_PortWrite(opl_port_t port, unsigned int value)
{
opl_port_t dst_port = opl_port_base + port;
__asm
{
mov edx, dword ptr [dst_port]
mov al, byte ptr [value]
out dx, al
}
}
#else
// Not x86, or don't know how to do port R/W on this compiler.
#define NO_PORT_RW
static unsigned int OPL_Win32_PortRead(opl_port_t port)
{
return 0;
}
static void OPL_Win32_PortWrite(opl_port_t port, unsigned int value)
{
}
#endif
static int OPL_Win32_Init(unsigned int port_base)
{
#ifndef NO_PORT_RW
OSVERSIONINFO version_info;
opl_port_base = port_base;
// Check the OS version.
memset(&version_info, 0, sizeof(version_info));
version_info.dwOSVersionInfoSize = sizeof(version_info);
GetVersionEx(&version_info);
// On NT-based systems, we must acquire I/O port permissions
// using the ioperm.sys driver.
if (version_info.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
// Install driver.
if (!IOperm_InstallDriver())
{
return 0;
}
// Open port range.
if (!IOperm_EnablePortRange(opl_port_base, 2, 1))
{
IOperm_UninstallDriver();
return 0;
}
}
// Start callback thread
if (!OPL_Timer_StartThread())
{
IOperm_UninstallDriver();
return 0;
}
return 1;
#endif
return 0;
}
static void OPL_Win32_Shutdown(void)
{
// Stop callback thread
OPL_Timer_StopThread();
// Unload IOperm library.
IOperm_UninstallDriver();
}
opl_driver_t opl_win32_driver =
{
"Win32",
OPL_Win32_Init,
OPL_Win32_Shutdown,
OPL_Win32_PortRead,
OPL_Win32_PortWrite,
OPL_Timer_SetCallback,
OPL_Timer_ClearCallbacks,
OPL_Timer_Lock,
OPL_Timer_Unlock,
OPL_Timer_SetPaused
};
#endif /* #ifdef _WIN32 */