gbsplay-0.0.91/0000755000175000017500000000000011051337235012234 5ustar mitchmitchgbsplay-0.0.91/HISTORY0000644000175000017500000001125611051337234013324 0ustar mitchmitch gbsplay HISTORY 2008/08/15 - 0.0.91 ~~~~~~~~~~~~~~~~~~~~~ Bugfixes: - remove possible garbage sounds on songchange Removals: - gbsxmms: As it is currently broken and propably won't be fixed soon, building of the XMMS plugin is now disabled by default. If you want to try to fix it, use 'configure --with-xmmsplugin' Enhancements: - gbsplay - more accurate handling of channel 3 and master volume - add MIDI plugout - contrib: - clarify license of gbs2ogg.sh (it's GPL'ed) - add (unfinished) bash completion script for gbsplay and gbsinfo - build process: - installation of contrib scripts is optional - gbsplay test run is optional - remove bashishms from configure script 2008/06/21 - 0.0.9 (the Still Alive release) ~~~~~~~~~~~~~~~~~~~~ Bugfixes: - muted channel settings were lost on subsong change Enhancements: - gbsplay: - allow channel mute on gbsplay startup - add ALSA plugout 2006/01/21 - 0.0.8 ~~~~~~~~~~~~~~~~~~~~ Enhancements: - code optimizations - use long instead of int where possible, better on 64bit archs - use const where possible - gbsplay: - use blipbuffer-like sound generation (better quality) - optimizations to channel 2 (interpolation, dc offset) - NAS output honors requested endianess - translation fixes - build process: - add regression test - better autotools compatibility (needs fewer tweaks in ebuild) - fix tar call in dist target for tar versions > 1.14 - optimize symbol hash tables - use -fpic instead of -fPIC - better error message when CC is undefined 2004/07/16 - 0.0.7 ~~~~~~~~~~~~~~~~~~~~ Enhancements: - gbsplay: - don't use random() for noise, emulate the original Gameboy behaviour - support more verbosity levels than just "quiet" 2004/04/26 - 0.0.6 ~~~~~~~~~~~~~~~~~~~~ Bugfixes: - fix make errors on CygWin - fix "make dist" on FreeBSD - fix path errors in configure script Enhancements: - code optimizations (using regparm where available) - include example song "Nightmode" by Laxity - gbsplay: - include a NAS driver - repeat mode for infinite playmode - set screen refresh rate (refresh_delay) - include a sound output plugin architecture - gbsinfo: - add --help option - build process: - print error on non-existing configure options - print additional diagnostic messages during configure - enable building of a shared library - some Solaris and FreeBSD bugfixes 2004/01/16 - 0.0.5 ~~~~~~~~~~~~~~~~~~~~ - build process: - fix broken Cygwin build - more standards compliant configure script 2003/12/28 - 0.0.4 ~~~~~~~~~~~~~~~~~~~~ - gbsplay: - changed -z and -Z description - output endianess can be selected - shuffled playlists are reproducible over playlist boundaries - redraw screen after SIGSTOP/SIGCONT - allow -1 as subsong (plays default subsong) - improved buffer handling - gbsxmms: - fix GTK critical error and xmms segfault when closing xmms - builds on FreeBSD - gbsinfo: - change output to an even more script friendly format - gbs2ogg.sh: - dump songs in desired length and with fadeout - fix path to gbsinfo - internationalization: - gettext support for gbsplay and gbsinfo - German translation - build process: - remove all files on uninstall - fixes for non-GNU find(1) - fixes for non-Debian mktemp(1) - rebuild only changed files 2003/12/07 - 0.0.3 ~~~~~~~~~~~~~~~~~~~~ - support other architectures than Linux/i386: - fix some endian issues - fix some c type issues - gbsplay: - fix display of help text - add pause/play - add fadeout - add gap between subsongs - add channel mute - gbsinfo: - change output to a more script friendly format - gbsxmms: - fix deadlock during seek - gbs2ogg.sh: - new script to convert .gbs to .ogg - documentation: - add info about GBS format - mention Esc key to quit gbsplay - build process: - generate versioned manpages - generate versioned directory in archive - no need for zlib any more - don't check dependencies for 'clean' and 'distclean' targets 2003/09/21 - 0.0.2 ~~~~~~~~~~~~~~~~~~~~ - gbsplay bugfixes: - don't go haywire on startup when start_at_subsong is out-of-bounds - don't exit with out-of-bounds error after playing the last song - xmms-gbs bugfixes: - fix seeking of previous subsong - build process bugfixes: - delete all temporary files created by configure - gbsplay new features: - add shuffle and random playmode - no need to press return for keyboard commands to take effect - stop after playing a given subsong - honor SIGSTOP and SIGCONT signals - build process new features: - detect working C compiler - detect zlib existence 2003/09/12 - 0.0.1 ~~~~~~~~~~~~~~~~~~~~ - Initial public release.gbsplay-0.0.91/gbhw.h0000644000175000017500000000303011051337234013327 0ustar mitchmitch/* * gbsplay is a Gameboy sound player * * 2003-2005 (C) by Tobias Diedrich * Licensed under GNU GPL. */ #ifndef _GBHW_H_ #define _GBHW_H_ #include #include "common.h" #define GBHW_CLOCK 4194304 struct gbhw_buffer { /*@dependent@*/ int16_t *data; long pos; long l_lvl; long r_lvl; long bytes; long samples; long cycles; }; struct gbhw_channel { long mute; long master; long leftgate; long rightgate; long l_lvl; long r_lvl; long volume; long env_dir; long env_tc; long env_ctr; long sweep_dir; long sweep_tc; long sweep_ctr; long sweep_shift; long len; long len_enable; long div_tc; long div_ctr; long duty_tc; long duty_ctr; }; extern struct gbhw_channel gbhw_ch[4]; typedef regparm void (*gbhw_callback_fn)(/*@temp@*/ struct gbhw_buffer *buf, /*@temp@*/ void *priv); typedef regparm void (*gbhw_iocallback_fn)(long cycles, uint32_t addr, uint8_t valu, /*@temp@*/ void *priv); regparm void gbhw_setcallback(/*@dependent@*/ gbhw_callback_fn fn, /*@dependent@*/ void *priv); regparm void gbhw_setiocallback(/*@dependent@*/ gbhw_iocallback_fn fn, /*@dependent@*/ void *priv); regparm void gbhw_setrate(long rate); regparm void gbhw_setbuffer(/*@dependent@*/ struct gbhw_buffer *buffer); regparm void gbhw_init(uint8_t *rombuf, uint32_t size); regparm void gbhw_pause(long new_pause); regparm void gbhw_master_fade(long speed, long dstvol); regparm void gbhw_getminmax(int16_t *lmin, int16_t *lmax, int16_t *rmin, int16_t *rmax); regparm long gbhw_step(long time_to_work); #endif gbsplay-0.0.91/gbsxmms.so.ver0000644000175000017500000000006511051337234015052 0ustar mitchmitch{ global: get_iplugin_info; local: *; }; gbsplay-0.0.91/plugout.c0000644000175000017500000000305311051337234014077 0ustar mitchmitch/* * gbsplay is a Gameboy sound player * * 2003-2005 (C) by Tobias Diedrich * Christian Garbs * Licensed under GNU GPL. */ #include "common.h" #include #include #include #include "plugout.h" #ifdef PLUGOUT_DEVDSP extern const struct output_plugin plugout_devdsp; #endif #ifdef PLUGOUT_ALSA extern const struct output_plugin plugout_alsa; #endif #ifdef PLUGOUT_NAS extern const struct output_plugin plugout_nas; #endif #ifdef PLUGOUT_STDOUT extern const struct output_plugin plugout_stdout; #endif #ifdef PLUGOUT_MIDI extern const struct output_plugin plugout_midi; #endif typedef /*@null@*/ const struct output_plugin* output_plugin_const_t; static output_plugin_const_t plugouts[] = { #ifdef PLUGOUT_NAS &plugout_nas, #endif #ifdef PLUGOUT_DEVDSP &plugout_devdsp, #endif #ifdef PLUGOUT_ALSA &plugout_alsa, #endif #ifdef PLUGOUT_STDOUT &plugout_stdout, #endif #ifdef PLUGOUT_MIDI &plugout_midi, #endif NULL }; regparm void plugout_list_plugins(void) { long idx; printf(_("Available output plugins:\n\n")); if (plugouts[0] == NULL) { printf(_("No output plugins available.\n\n")); return; } for (idx = 0; plugouts[idx] != NULL; idx++) { printf("%s\t- %s\n", plugouts[idx]->name, plugouts[idx]->description); } (void)puts(""); } regparm const struct output_plugin* plugout_select_by_name(const char *name) { long idx; for (idx = 0; plugouts[idx] != NULL && strcmp(plugouts[idx]->name, name) != 0; idx++); return plugouts[idx]; } gbsplay-0.0.91/plugout.h0000644000175000017500000000156511051337234014112 0ustar mitchmitch#ifndef _PLUGOUT_H_ #define _PLUGOUT_H_ #include enum plugout_endian { PLUGOUT_ENDIAN_BIG, PLUGOUT_ENDIAN_LITTLE, PLUGOUT_ENDIAN_NATIVE }; typedef long regparm (*plugout_open_fn )(enum plugout_endian endian, long rate); typedef int regparm (*plugout_skip_fn )(int subsong); typedef int regparm (*plugout_io_fn )(long cycles, uint32_t addr, uint8_t val); typedef ssize_t regparm (*plugout_write_fn)(const void *buf, size_t count); typedef void regparm (*plugout_close_fn)(void); #define PLUGOUT_USES_STDOUT 1 struct output_plugin { char *name; char *description; long flags; plugout_open_fn open; plugout_skip_fn skip; plugout_io_fn io; plugout_write_fn write; plugout_close_fn close; }; regparm void plugout_list_plugins(void); regparm /*@null@*/ /*@temp@*/ const struct output_plugin* plugout_select_by_name(const char *name); #endif gbsplay-0.0.91/cfgparser.h0000644000175000017500000000116611051337234014364 0ustar mitchmitch/* * gbsplay is a Gameboy sound player * * 2003-2005 (C) by Tobias Diedrich * Christian Garbs * Licensed under GNU GPL. */ #ifndef _CFGPARSER_H_ #define _CFGPARSER_H_ typedef void regparm (*cfg_parse_fn)(void *ptr); struct cfg_option { char *name; void *ptr; cfg_parse_fn parse_fn; }; void regparm cfg_string(void *ptr); void regparm cfg_long(void *ptr); void regparm cfg_endian(void *ptr); void regparm cfg_parse(const char *fname, const struct cfg_option *options); /*@null@*/ /*@only@*/ char* regparm get_userconfig(const char* cfgfile); #endif gbsplay-0.0.91/depend.sh0000755000175000017500000000062111051337234014030 0ustar mitchmitch#!/bin/sh DIR=`dirname $1` FILE="$1" SUBMK="" shift EXTRADEP=" $*" if [ "$DIR" = "" -o "$DIR" = "." ]; then DIR="" else DIR="$DIR/" fi if [ -f "${DIR}subdir.mk" ]; then SUBMK=" ${DIR}subdir.mk" fi exec $CC -M $GBSCFLAGS "$FILE" | sed -n -e " s@^\\(.*\\)\\.o:@$DIR\\1.d $DIR\\1.o $DIR\\1.lo: depend.sh Makefile$SUBMK$EXTRADEP@ s@/usr/[^ ]*@@g t foo :foo s@^[ ]*\\\\\$@@ t p " gbsplay-0.0.91/gbsplayrc.in.50000644000175000017500000000531611051337234014721 0ustar mitchmitch.\" This manpage 2003-2005 (C) by Christian Garbs .\" Licensed under GNU GPL. .TH "gbsplayrc" "5" "%%%VERSION%%%" "Tobias Diedrich" "Gameboy sound player" .SH "NAME" .LP \fBgbsplayrc\fR \- Gameboy sound player configuration file .SH "DESCRIPTION" \fI/etc/gbsplayrc\fR and \fI~/\.gbsplayrc\fR are used by gbsplay(1). .SH "SYNTAX" Comments are introduced by hash marks. A comment continues to the end of the line. Whitespace, including empty lines, is ignored. Option values follow the option name and an equal sign. Valid option value types are: .IP Boolean An integer number in decimal. 0 is considered \fIfalse\fR, everything else is \fItrue\fR. .IP Endian A single character denoting the endianness. n == native endian, l == little endian and b == big endian. .IP Integer An integer number in decimal. .IP Plugin The name of an output plugin. Run \fIgbsplay \-o list\fR to get a list of all available output plugins. .SH "OPTIONS" .IP "endian = \fIEndian\fR" The output endianness. .IP "fadeout = \fIInteger\fR" The fadeout time in seconds. Instead of cutting of the subsong hard, do a soft fadeout. .IP "loop = \fIBoolean\fR" In loop mode the playback will restart from the beginning after the last subsong. .IP "output_plugin = \fIPlugin\fR" The sound output plugin to be used. .IP "rate = \fIInteger\fR" The samplerate to be used. .IP "refresh_delay = \fIInteger\fR" Set the refresh delay in milliseconds. Larger values will lower CPU usage, but things as subsong changes, fadeouts, reactions to keypresses and the on\-screen display will be delayed. .IP "silence_timeout = \fIInteger\fR" The silence timeout in seconds. When a subsong contains silence for the given time, the player will skip to the next subsong. .IP "subsong_gap = \fIInteger\fR" The subsong gap in seconds. Before playing the next subsong after the subsong timeout, play \fIsubsong_gap\fR seconds of silence. .IP "subsong_timeout = \fIInteger\fR" The subsong timeout in seconds. When a subsong has been played for the given time, the player will skip to the next subsong. A timeout of 0 seconds disables automatic subsong changes. .IP "verbosity = \fIInteger\fR" Sets the verbosity level (default: 3). A value of 0 means no messages on stdout. .SH "FILES" .TP \fI/etc/gbsplayrc\fR Default location of the global configuration file. .TP \fI~/\.gbsplayrc\fR User configuration file. .SH "SEE ALSO" \fIgbsplay\fR(1), \fIgbsinfo\fR(1) .SH "BUG REPORTS" If you encounter bugs, please report them via \fIhttp://gbsplay.berlios.de/\fR or write to <\fIgbsplay-dev@lists.berlios.de\fR>. .SH "AUTHOR" gbsplay was written by Tobias Diedrich <\fIranma+gbsplay@tdiedrich.de\fR> (with contributions from others, see README). .SH "COPYRIGHT" gbsplay is licensed under GNU GPL. gbsplay-0.0.91/plugout_nas.c0000644000175000017500000001336711051337234014751 0ustar mitchmitch/* * gbsplay is a Gameboy sound player * * 2004-2005 (C) by Christian Garbs * Tobias Diedrich * Licensed under GNU GPL. * * NAS sound output plugin * * Based on the libaudiooss nas backend, which was largely rewritten * by me (Tobias Diedrich), I'd dare to say the only function left from * the xmms code is nas_find_device, but I did not check that. :-) */ /*@-nullpass@*/ /*@-onlytrans@*/ /*@-uniondef@*/ #include "common.h" #include #include #include #include #include