├── .gitignore ├── BUILDDEFS ├── CMakeLists.txt ├── COPYING ├── COPYING.LIB ├── ChangeLog ├── KoboPlayer ├── README ├── README.html ├── README.jp ├── README.md ├── README.osx ├── README.sfont ├── README.xkobo ├── README.xkobo.jp ├── TODO ├── build-packages ├── build-win32-packages ├── buildconfig.h.cmake ├── clean-all ├── configure ├── data ├── gfx │ ├── bigfont3.png │ ├── bigship.png │ ├── bmr-green.png │ ├── bmr-pink.png │ ├── bmr-purple.png │ ├── bolt.png │ ├── boltexpl.png │ ├── bomb.png │ ├── bombdeto.png │ ├── brushes.png │ ├── bullet5b.png │ ├── bulletexpl2.png │ ├── counterfont.png │ ├── crosshair.png │ ├── deluxe.png │ ├── explo1e.png │ ├── explo3e.png │ ├── explo4e.png │ ├── explo5e.png │ ├── fighter.png │ ├── flatstars1.png │ ├── focusfx.png │ ├── goldfont.png │ ├── hitnoise.png │ ├── icefont2.png │ ├── loading3.png │ ├── logo-outline.png │ ├── logomask3.png │ ├── missile.png │ ├── missile2.png │ ├── missile3.png │ ├── noise.png │ ├── player.png │ ├── ring.png │ ├── ringexpl2b.png │ ├── rock1c.png │ ├── rock2.png │ ├── rockexpl.png │ ├── screen2.png │ ├── shinyrock.png │ ├── tiles-blood.png │ ├── tiles-chrome.png │ ├── tiles-double.png │ ├── tiles-green.png │ └── tiles-metal.png └── sfx │ ├── aguitar1.agw │ ├── bassdrum5.agw │ ├── bleep1.agw │ ├── bleep3.agw │ ├── boltfire2.agw │ ├── boltfire2e.agw │ ├── boltfire2o.agw │ ├── boltfire2s.agw │ ├── brass2.agw │ ├── bzzzt1.agw │ ├── cannon1.agw │ ├── claps1.agw │ ├── edge2.agw │ ├── explo1b-rg.agw │ ├── explo1b.agw │ ├── explo1c-rg.agw │ ├── explo1c.agw │ ├── explo3d.agw │ ├── explo4d.agw │ ├── explo5.agw │ ├── explo5b.agw │ ├── explo5c.agw │ ├── explo6.agw │ ├── fmthump1b.agw │ ├── gameover1.agw │ ├── hardsync1.agw │ ├── impact2.agw │ ├── impact2b.agw │ ├── impact2c.agw │ ├── klank2b.agw │ ├── klank3.agw │ ├── klank3b.agw │ ├── klank3c.agw │ ├── klank4.agw │ ├── kobosfx.h │ ├── launch.agw │ ├── launch2.agw │ ├── launch3b.agw │ ├── launch4.agw │ ├── metallic7.agw │ ├── metallic7rs.agw │ ├── music.agw │ ├── music_c.agw │ ├── noiseburst2.agw │ ├── phattpad2.agw │ ├── pioing1b.agw │ ├── rockexplo.agw │ ├── save_waves.agw │ ├── schwoom1.agw │ ├── schwoop2.agw │ ├── schwoop3.agw │ ├── sfx.agw │ ├── sfx_c.agw │ ├── sine.agw │ ├── snare1.agw │ ├── synbass1.agw │ ├── test2.agw │ ├── test2.mid │ ├── thunder1.agw │ ├── trance1.agw │ ├── trance1.mid │ ├── trance1_c.agw │ └── zapp1.agw ├── icons ├── kobodl.png ├── net.olofson.kobodeluxe.desktop └── windows │ ├── kobodl.ico │ └── kobodl.rc ├── install-libs ├── install-win32-redist ├── kobodl.6 ├── make-all └── src ├── CMakeLists.txt ├── cfgform.cpp ├── cfgform.h ├── cfgparse.cpp ├── cfgparse.h ├── config.h ├── dashboard.cpp ├── dashboard.h ├── eel ├── _e_script.h ├── e_builtin.c ├── e_builtin.h ├── e_getargs.c ├── e_lexer.c ├── e_lexer.h ├── e_path.c ├── e_register.c ├── e_register.h ├── e_script.c ├── e_script.h ├── e_symtab.c ├── e_symtab.h ├── e_util.c ├── e_util.h ├── eel-comp-src.txt ├── eel-lang.txt ├── eel.c └── eel.h ├── enemies.cpp ├── enemies.h ├── enemy.cpp ├── filemap.cpp ├── filemap.h ├── form.cpp ├── form.h ├── game.cpp ├── game.h ├── gamectl.cpp ├── gamectl.h ├── gamestate.cpp ├── gamestate.h ├── graphics ├── cs.c ├── cs.h ├── display.cpp ├── display.h ├── filters.c ├── filters.h ├── gfxengine.cpp ├── gfxengine.h ├── glSDL.c ├── glSDL.h ├── region.c ├── region.h ├── sofont.cpp ├── sofont.h ├── sprite.c ├── sprite.h ├── toolkit.cpp ├── toolkit.h ├── vidmodes.c ├── vidmodes.h ├── window.cpp └── window.h ├── kobo.cpp ├── kobo.h ├── kobolog.h ├── logger.c ├── logger.h ├── manage.cpp ├── manage.h ├── map.cpp ├── map.h ├── myship.cpp ├── myship.h ├── options.cpp ├── options.h ├── pfile.cpp ├── pfile.h ├── prefs.cpp ├── prefs.h ├── radar.cpp ├── radar.h ├── random.cpp ├── random.h ├── scenes.cpp ├── scenes.h ├── score.cpp ├── score.h ├── screen.cpp ├── screen.h ├── sound.cpp ├── sound.h ├── sound ├── a_agw.c ├── a_agw.h ├── a_bus.c ├── a_bus.h ├── a_channel.c ├── a_channel.h ├── a_commands.c ├── a_commands.h ├── a_control.c ├── a_control.h ├── a_delay.c ├── a_delay.h ├── a_events.c ├── a_events.h ├── a_filters.c ├── a_filters.h ├── a_globals.c ├── a_globals.h ├── a_limiter.c ├── a_limiter.h ├── a_math.h ├── a_midi.c ├── a_midi.h ├── a_midicon.c ├── a_midicon.h ├── a_midifile.c ├── a_midifile.h ├── a_midisock.c ├── a_midisock.h ├── a_mixers.h ├── a_patch.c ├── a_patch.h ├── a_pitch.c ├── a_pitch.h ├── a_plugin.c ├── a_plugin.h ├── a_sequencer.c ├── a_sequencer.h ├── a_struct.c ├── a_struct.h ├── a_tools.h ├── a_types.h ├── a_voice.c ├── a_voice.h ├── a_wave.c ├── a_wave.h ├── a_wca.c ├── a_wca.h ├── a_wcaosc.h ├── audio.c ├── audio.h ├── audiodev.c ├── audiodev.h ├── ptable.h ├── sfifo.c └── sfifo.h ├── states.cpp └── states.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | -------------------------------------------------------------------------------- /BUILDDEFS: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #---------------------- 4 | # --- Configuration --- 5 | #---------------------- 6 | 7 | # Set to true to build SDL2, SDL2_image, libpng, and Audiality 2 for static 8 | # linking only. 9 | # 10 | # NOTE: This will NOT work if these libraries are already installed in the 11 | # system! 12 | # 13 | # NOTE 2: Dynamic linking has not been tested after the recent changes, and 14 | # there is at least one known problem: Libs will NOT be copied from the 15 | # system, so packaging will only work if build-packages is run without 16 | # any of these libraries installed in the system. 17 | # 18 | KOBO_STATIC_LINUX=true 19 | 20 | 21 | #-------------------- 22 | # --- Kobo Deluxe --- 23 | #-------------------- 24 | 25 | # Kobo Deluxe source git repository 26 | KDLREPO="https://github.com/olofson/kobodeluxe" 27 | 28 | # Official Kobo Deluxe home site (with downloads directory) 29 | KDLHOME="http://kobodeluxe.com" 30 | 31 | # Archive with Win32 SDL2 redistributables suitable for this release 32 | REDISTARCH="kobodeluxe-0.6.0-libs-redist-win32.tar.bz2" 33 | 34 | 35 | #-------------------- 36 | # --- Audiality 2 --- 37 | #-------------------- 38 | 39 | # Recommended Audiality 2 version for this Kobo Redux release 40 | #A2RELEASE=1.9.4 41 | 42 | # Audiality 2 git repository 43 | #A2REPO="https://github.com/olofson/audiality2" 44 | 45 | 46 | #------------ 47 | # --- SDL --- 48 | #------------ 49 | 50 | SDLRELEASE=1.2.15 51 | SDLURL="https://www.libsdl.org/release/SDL-${SDLRELEASE}.tar.gz" 52 | 53 | 54 | #------------- 55 | # --- SDL2 --- 56 | #------------- 57 | 58 | #SDLRELEASE=2.0.12 59 | #SDLURL="https://www.libsdl.org/release/SDL2-${SDLRELEASE}.tar.gz" 60 | 61 | 62 | #--------------- 63 | # --- libpng --- 64 | #--------------- 65 | 66 | #PNGRELEASE=1.6.37 67 | #PNGURL="ftp://ftp-osl.osuosl.org/pub/libpng/src/libpng16/libpng-${PNGRELEASE}.tar.xz" 68 | 69 | 70 | #------------------ 71 | # --- SDL_image --- 72 | #------------------ 73 | 74 | IMGRELEASE=1.2.12 75 | IMGURL="https://www.libsdl.org/projects/SDL_image/release/SDL_image-${IMGRELEASE}.tar.gz" 76 | 77 | 78 | #------------------- 79 | # --- SDL2_image --- 80 | #------------------- 81 | 82 | #IMGRELEASE=2.0.5 83 | #IMGURL="https://www.libsdl.org/projects/SDL_image/release/SDL2_image-${IMGRELEASE}.tar.gz" 84 | 85 | 86 | #-------------------- 87 | # --- Directories --- 88 | #-------------------- 89 | 90 | # Root of the source tree 91 | SOURCEDIR="$(pwd)" 92 | 93 | # CMake top-level build directory. (NOTE: The actual build directories are 94 | # inside this one!) 95 | BUILDDIR="$(pwd)/build" 96 | 97 | # Staging directory for dependency library builds, downloads, packages etc 98 | WORKDIR="$(pwd)/work" 99 | 100 | # Download directory 101 | DLDIR="${WORKDIR}/downloads" 102 | 103 | # Final package output directory 104 | PKGDIR="${WORKDIR}/packages" 105 | 106 | 107 | #------------ 108 | # --- MXE --- 109 | #------------ 110 | 111 | # MinGW32 cross build using MXE (http://mxe.cc/) 112 | if [ -z $MXEPATH ]; then 113 | MXEPATH=/usr/lib/mxe/ 114 | fi 115 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/ChangeLog -------------------------------------------------------------------------------- /KoboPlayer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/KoboPlayer -------------------------------------------------------------------------------- /README.jp: -------------------------------------------------------------------------------- 1 | 2 | Kobo Deluxe 3 | ----------- 4 | v0.4 5 | 6 | $B%7%e!<%F%#%s%0%2!<%`(B XKobo$B$N6/2=HG(B 7 | 8 | Kobo Deluxe $B$OBh;0e>:$7!"E(5!$NAH$_9g$o$;$,JQ2=$7$^$9!#$&$^$/@Z$jH4$1$k(B 14 | $B$?$a$K$O$=$NETEYE*3N$J@oN,$rI,MW$H$7$^$9!#(B 15 | 16 | Kobo Deluxe$B$O%0%i%U%#%C%/%(%s%8%s$r?J2=$5$;!"%2!<%`$N?J9T$d%?%$(B 17 | $B%_%s%0$K0MB8$7$J$$=@Fp$J%U%l!<%`%l!<%H@_Dj$r2DG=$H$7$F$$$^$9!#$^$?!"(B 18 | $B8z2L2;!"GIe$GF0:n$7$^$9!#$"$^$j0lHLE*$G$O$J%W%i%C%H%[!<%`$G$bF0:n$9$k(B 22 | $B$+$b$7$l$^$;$s!#(B 23 | 24 | $B$R$H$3$H$G8@$&$J$i!"(BKobo Deluxe$B$O%/%i%7%C%/$J%"!<%1!<%I%9%?%$%k$N(B 25 | $B%2!<%`$r!"MM!9$J4D6-$N%^%7%s$GM7$Y$k$h$&$K$7$?$H$$$&$3$H$G$9!#(B 26 | 27 | Enjoy...! 28 | 29 | David Olofson 30 | http://olofson.net 31 | 32 | 33 | Thanks to: 34 | Akira Higuchi ($B%*%j%8%J%kHG(BXKobo$B$N:n------------------------------------ 2 | 3 | License: GPL 4 | Author: Karl Bartel 5 | WWW: http://members.linuxstart.com/~karlb/ 6 | 7 | Usage: 8 | 1. Load a font and place it in an SDL_Surface *. If your are using the 9 | SDL_image library you can do this with Font=IMG_Load("filename"); 10 | 2. Initialize the font by using InitFont(surface *Font); 11 | 3. Now you can use the font in you SDL program. 12 | Please take a look at SFont.h to get info about the funtions. 13 | 14 | FileFormat: 15 | The font file can be any type image file. The characters start with 16 | ASCII symbol #33. They are seperated by pink(255,0,255) lines at the top 17 | of the image. The space between these lines is the width of the caracter. 18 | Just take a look at the font, and you'll be able to understand what I tried 19 | to explain here. 20 | The easiest way to create a new font is to use the GIMP's Logo function. 21 | Use the following string as text (ASCII 33-127 with escape sequences and 22 | spaces between the letters): 23 | ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ 24 | 25 | Example for the font file format: 26 | 27 | ____ _____ _____ _____ <- This is the pink line at the top 28 | 29 | # ##### #### 30 | # # # # # 31 | # # # # # 32 | # # ##### # 33 | ##### # # # 34 | # # # # # 35 | # # ##### #### 36 | 37 | |----| 38 | Width of the character 39 | 40 | |----------| 41 | Part of the font surface that is beeing blitted 42 | 43 | 44 | ChangeLog: 45 | 2.0 beta 46 | *** Added SoFont, a C++ version of SFont *** 47 | Added lock and unlock for hardware surfaces 48 | Added blinking cursor to SFont_Input 49 | Added check for ASCII<33 in SFont_Input 50 | TextWidth returned a too highh value -> fixed 51 | 52 | 1.4 53 | Added support for multiple fonts in one program 54 | Add a missing "*" in the SFont.h file 55 | Proper '\0' at the end of stings produced by SFont_Input 56 | Fixed problems in SFont_Input, which were creating '\b' in the string 57 | Fixed two other bugs in SFont_Input 58 | Added the SFontViewer adn new test programs 59 | 60 | 1.3 61 | Fixed three wrong interpretations of the file format 62 | o wrong division (float had to be used) 63 | o detection of right ends of pink lines (were one pixel too far right) 64 | o blit destination (all blits were too far right) 65 | support for non-alpha mapped fonts 66 | some fonts updated 67 | 68 | 1.2 69 | added XCenteredString 70 | 71 | 1.1 72 | renamed font.c to SFont.c and font.h to SFont.h 73 | better Makefile 74 | 1.0 75 | Added the Input function 76 | Added a check wether the Font has been loaded 77 | 0.9 78 | better Makefile for the example (using sdl-config) 79 | better Neon Font 80 | 0.8 81 | First Release 82 | 83 | If you have any Questions please write a mail! 84 | 85 | Karl -------------------------------------------------------------------------------- /build-packages: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . ./BUILDDEFS 3 | 4 | shopt -s extglob 5 | shopt -s nullglob 6 | 7 | if [ $# -eq 0 ]; then 8 | # Default: Build all native demo and release packages 9 | FILTER=@(release|demo) 10 | elif [ "$1" == all ]; then 11 | FILTER="*" 12 | else 13 | FILTER="$1" 14 | fi 15 | 16 | ./install-libs 17 | ./install-win32-redist 18 | 19 | ./configure "${FILTER}" 20 | 21 | mkdir -p "${PKGDIR}" 22 | rm -rf "${PKGDIR}/*" 23 | 24 | for i in ${BUILDDIR}/${FILTER} ; do 25 | echo 26 | echo "[ Building $(basename $i) ]" 27 | echo $i 28 | cd $i 29 | make -j20 30 | make package 31 | mv *.@(rpm|deb|tar.bz2|zip) "${PKGDIR}" 32 | echo "[ Leaving $(basename $i) ]" 33 | echo 34 | done 35 | cd ${SOURCEDIR} 36 | 37 | # HAX: Can't get CPack to stop adding those bogus directories... 38 | for a in ${PKGDIR}/KoboDeluxe-*-win32.zip ; do 39 | echo $a 40 | zip -d $a "*/home/*" 41 | done 42 | 43 | # HAX: No reliable way of selectively flattening archives with CPack. >:-/ 44 | for a in ${PKGDIR}/kobodeluxe-*-Linux.tar.bz2 ; do 45 | echo $a 46 | "${SOURCEDIR}/fix-linux-bz2-package" $a 47 | done 48 | 49 | # HAX: CPack makes pretty bad DEBs and RPMs 50 | for a in ${PKGDIR}/kobodeluxe-*-Linux.deb ; do 51 | echo $a 52 | fakeroot "${SOURCEDIR}/fix-linux-deb-package" $a 53 | done 54 | for a in ${PKGDIR}/kobodeluxe-*-Linux.rpm ; do 55 | echo $a 56 | "${SOURCEDIR}/fix-linux-rpm-package" $a 57 | done 58 | -------------------------------------------------------------------------------- /build-win32-packages: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | shopt -s extglob 3 | # Build only Win32 demo and release packages 4 | ./build-packages mingw-@(release|demo) 5 | -------------------------------------------------------------------------------- /buildconfig.h.cmake: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | @KOBODELUXE_AUTO_MESSAGE@ 4 | --------------------------------------------------------------------------- 5 | */ 6 | 7 | #cmakedefine KOBO_HAVE_SNPRINTF 8 | #cmakedefine KOBO_HAVE__SNPRINTF 9 | #cmakedefine KOBO_HAVE_VSNPRINTF 10 | #cmakedefine KOBO_HAVE__VSNPRINTF 11 | #cmakedefine KOBO_HAVE_STAT 12 | #cmakedefine KOBO_HAVE_LSTAT 13 | 14 | #cmakedefine KOBO_HAVE_GETEGID 15 | #cmakedefine KOBO_HAVE_SETGID 16 | 17 | #cmakedefine KOBO_ENABLE_TOUCHSCREEN 18 | 19 | #define RETSIGTYPE @RETSIGTYPE@ 20 | 21 | #define PACKAGE "@PACKAGE@" 22 | #define KOBO_VERSION_STRING "@VERSION_STRING@" 23 | #define KOBO_MAKE_VERSION(major, minor, micro, build) \ 24 | (((major) << 24) | ((minor) << 16) | ((micro) << 8) | (build)) 25 | #define KOBO_MAJOR(ver) (((ver) >> 24) & 0xff) 26 | #define KOBO_MINOR(ver) (((ver) >> 16) & 0xff) 27 | #define KOBO_MICRO(ver) (((ver) >> 8) & 0xff) 28 | #define KOBO_BUILD(ver) ((ver) & 0xff) 29 | #define KOBO_VERSION KOBO_MAKE_VERSION(@VERSION_MAJOR@, @VERSION_MINOR@, @VERSION_PATCH@, @VERSION_BUILD@) 30 | 31 | #cmakedefine KOBO_ORGANIZATION "@KOBO_ORGANIZATION@" 32 | #cmakedefine KOBO_APPLICATION "@KOBO_APPLICATION@" 33 | 34 | #cmakedefine KOBO_DATADIR "@KOBO_DATADIR@" 35 | #cmakedefine KOBO_USERDIR "@KOBO_USERDIR@" 36 | #cmakedefine KOBO_EXEFILE "@KOBO_EXEFILE@" 37 | #cmakedefine KOBO_CONFIGFILE "@KOBO_CONFIGFILE@" 38 | 39 | #cmakedefine KOBO_SYSCONFDIR "@KOBO_SYSCONFDIR@" 40 | -------------------------------------------------------------------------------- /clean-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . ./BUILDDEFS 3 | 4 | rm -rf "${BUILDDIR}" 5 | rm -rf "${WORKDIR}" 6 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . ./BUILDDEFS 3 | 4 | # Required for static linking, because CMake doesn't get them from SDL2 5 | if [ "${KOBO_STATIC_LINUX}" = true ] ; then 6 | LINUX_EXTRA_LIBS="-lpthread -ldl -lrt -lm -lpng -lz" 7 | else 8 | LINUX_EXTRA_LIBS="" 9 | fi 10 | 11 | # Similar problem as above, but for Win32 12 | WIN32_EXTRA_LIBS="-lws2_32 -liphlpapi -lz" 13 | 14 | shopt -s extglob 15 | shopt -s nullglob 16 | 17 | if [ $# -eq 0 ]; then 18 | FILTER=@(release) 19 | elif [ "$1" == all ]; then 20 | FILTER="*" 21 | else 22 | FILTER="$1" 23 | fi 24 | 25 | mkdir -p $BUILDDIR 26 | 27 | create_build_dir() { 28 | local dname=$1 29 | local btype=$2 30 | local desc=$3 31 | echo 32 | echo "=== build/$dname ($btype, $desc) ===" 33 | if [ ! -e $BUILDDIR/$dname ]; then 34 | mkdir $BUILDDIR/$dname 35 | fi 36 | if [ ! -e $BUILDDIR/$dname/src ]; then 37 | mkdir $BUILDDIR/$dname/src 38 | fi 39 | cd $BUILDDIR/$dname 40 | } 41 | 42 | setup_header() { 43 | local dname=$1 44 | local desc=$2 45 | echo 46 | echo "==========================================================" 47 | echo "Setting up build dirs for ${dname} ($desc)" 48 | echo "==========================================================" 49 | } 50 | 51 | setup_footer() { 52 | echo 53 | echo "==========================================================" 54 | echo "Done!" 55 | echo "==========================================================" 56 | echo 57 | } 58 | 59 | setup_native() { 60 | local dname=$1 61 | local btype=$2 62 | local desc=$3 63 | local prefix=$4 64 | local opts="$5" 65 | setup_header $dname "$desc" 66 | create_build_dir $dname $btype "$desc" 67 | cmake $opts $SOURCEDIR -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_BUILD_TYPE="$btype" -DWORKDIR="${WORKDIR}" -DKOBO_EXTRA_LIBRARIES="${LINUX_EXTRA_LIBS}" 68 | cd $SOURCEDIR 69 | setup_footer 70 | } 71 | 72 | setup_cross() { 73 | local dname=$1 74 | local btype=$2 75 | local desc=$3 76 | local target=$4 77 | local opts="$5 -DWIN32_ZIP_BUILD=ON" 78 | if [ -e $MXEPATH ]; then 79 | setup_header $dname "$desc" 80 | create_build_dir $dname $btype "$desc" 81 | cmake $opts $SOURCEDIR -DCMAKE_BUILD_TYPE="$btype" -DCMAKE_TOOLCHAIN_FILE=$MXEPATH/usr/$target/share/cmake/mxe-conf.cmake -DBUILD_SHARED_LIBS=ON -DWORKDIR="${WORKDIR}" -DKOBO_EXTRA_LIBRARIES="${WIN32_EXTRA_LIBS}" 82 | cd $SOURCEDIR 83 | setup_footer 84 | else 85 | echo "MXE not found! Skipping target ${dname} ($desc)." 86 | fi 87 | } 88 | 89 | if [[ "release" = ${FILTER} ]] ; then 90 | setup_native release Release "host native" /usr 91 | fi 92 | 93 | if [[ "maintainer" = ${FILTER} ]] ; then 94 | setup_native maintainer Maintainer "host native" /usr 95 | fi 96 | 97 | if [[ "debug" = ${FILTER} ]] ; then 98 | setup_native debug Debug "host native" /usr 99 | fi 100 | 101 | if [[ "mingw-release" = ${FILTER} ]] ; then 102 | setup_cross mingw-release Release "MXE cross" i686-w64-mingw32.shared 103 | fi 104 | 105 | if [[ "mingw-debug" = ${FILTER} ]] ; then 106 | setup_cross mingw-debug Debug "MXE cross" i686-w64-mingw32.shared 107 | fi 108 | -------------------------------------------------------------------------------- /data/gfx/bigfont3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bigfont3.png -------------------------------------------------------------------------------- /data/gfx/bigship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bigship.png -------------------------------------------------------------------------------- /data/gfx/bmr-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bmr-green.png -------------------------------------------------------------------------------- /data/gfx/bmr-pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bmr-pink.png -------------------------------------------------------------------------------- /data/gfx/bmr-purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bmr-purple.png -------------------------------------------------------------------------------- /data/gfx/bolt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bolt.png -------------------------------------------------------------------------------- /data/gfx/boltexpl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/boltexpl.png -------------------------------------------------------------------------------- /data/gfx/bomb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bomb.png -------------------------------------------------------------------------------- /data/gfx/bombdeto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bombdeto.png -------------------------------------------------------------------------------- /data/gfx/brushes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/brushes.png -------------------------------------------------------------------------------- /data/gfx/bullet5b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bullet5b.png -------------------------------------------------------------------------------- /data/gfx/bulletexpl2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/bulletexpl2.png -------------------------------------------------------------------------------- /data/gfx/counterfont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/counterfont.png -------------------------------------------------------------------------------- /data/gfx/crosshair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/crosshair.png -------------------------------------------------------------------------------- /data/gfx/deluxe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/deluxe.png -------------------------------------------------------------------------------- /data/gfx/explo1e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/explo1e.png -------------------------------------------------------------------------------- /data/gfx/explo3e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/explo3e.png -------------------------------------------------------------------------------- /data/gfx/explo4e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/explo4e.png -------------------------------------------------------------------------------- /data/gfx/explo5e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/explo5e.png -------------------------------------------------------------------------------- /data/gfx/fighter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/fighter.png -------------------------------------------------------------------------------- /data/gfx/flatstars1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/flatstars1.png -------------------------------------------------------------------------------- /data/gfx/focusfx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/focusfx.png -------------------------------------------------------------------------------- /data/gfx/goldfont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/goldfont.png -------------------------------------------------------------------------------- /data/gfx/hitnoise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/hitnoise.png -------------------------------------------------------------------------------- /data/gfx/icefont2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/icefont2.png -------------------------------------------------------------------------------- /data/gfx/loading3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/loading3.png -------------------------------------------------------------------------------- /data/gfx/logo-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/logo-outline.png -------------------------------------------------------------------------------- /data/gfx/logomask3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/logomask3.png -------------------------------------------------------------------------------- /data/gfx/missile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/missile.png -------------------------------------------------------------------------------- /data/gfx/missile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/missile2.png -------------------------------------------------------------------------------- /data/gfx/missile3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/missile3.png -------------------------------------------------------------------------------- /data/gfx/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/noise.png -------------------------------------------------------------------------------- /data/gfx/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/player.png -------------------------------------------------------------------------------- /data/gfx/ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/ring.png -------------------------------------------------------------------------------- /data/gfx/ringexpl2b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/ringexpl2b.png -------------------------------------------------------------------------------- /data/gfx/rock1c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/rock1c.png -------------------------------------------------------------------------------- /data/gfx/rock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/rock2.png -------------------------------------------------------------------------------- /data/gfx/rockexpl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/rockexpl.png -------------------------------------------------------------------------------- /data/gfx/screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/screen2.png -------------------------------------------------------------------------------- /data/gfx/shinyrock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/shinyrock.png -------------------------------------------------------------------------------- /data/gfx/tiles-blood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/tiles-blood.png -------------------------------------------------------------------------------- /data/gfx/tiles-chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/tiles-chrome.png -------------------------------------------------------------------------------- /data/gfx/tiles-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/tiles-double.png -------------------------------------------------------------------------------- /data/gfx/tiles-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/tiles-green.png -------------------------------------------------------------------------------- /data/gfx/tiles-metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/gfx/tiles-metal.png -------------------------------------------------------------------------------- /data/sfx/aguitar1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Acoustic Guitar 1 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 33488; 7 | w_blank target, 33488, 0; 8 | 9 | //string 10 | w_env AMPLITUDE, 11 | 0, .4, 12 | .005, .1, 13 | .995, 0; 14 | w_env FREQUENCY, 0, 261.65; 15 | w_env MOD1, 16 | 0, .2, 17 | 1, .1; 18 | w_osc target, PULSE; 19 | 20 | w_env AMPLITUDE, 21 | 0, .6, 22 | .005, .2, 23 | .5, 0; 24 | w_env FREQUENCY, 0, 261.75; 25 | w_env MOD1, 26 | 0, .2, 27 | 1, .1; 28 | w_osc target, PULSE; 29 | 30 | w_env AMPLITUDE, 31 | 0, 2, 32 | .1, 1.5; 33 | w_env FREQUENCY, 34 | 0, 8000, 35 | .01, 2500, 36 | .1, 1500; 37 | w_filter target, LOWPASS_12; 38 | 39 | w_env AMPLITUDE, 1; 40 | w_env FREQUENCY, 300; 41 | w_env MOD1, 0; 42 | w_filter target, HIGHPASS_12; 43 | 44 | //body 45 | w_env AMPLITUDE, 0, 5; 46 | w_env FREQUENCY, 0, 150; 47 | w_filter target, PEAK_12; 48 | w_env FREQUENCY, 0, 180; 49 | w_filter target, PEAK_12; 50 | -------------------------------------------------------------------------------- /data/sfx/bassdrum5.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Bass Drum 5 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 8000; 7 | w_blank target, 8000, 0; 8 | 9 | //attack 10 | w_env AMPLITUDE, 11 | 0, .3, 12 | .01, .07, 13 | .04, .02, 14 | .5, 0; 15 | w_env FREQUENCY, 16 | 0, 4000, 17 | .03, 500; 18 | w_osc target, NOISE; 19 | 20 | //power 21 | w_env AMPLITUDE, 22 | 0, .8, 23 | .05, .9, 24 | .15, .7, 25 | .8, 0; 26 | w_env MOD1, 27 | 0, .05, 28 | .1, 0; 29 | w_env FREQUENCY, 30 | 0, 300, 31 | .02, 160, 32 | .03, 70, 33 | .2, 40; 34 | w_osc target, SINE; 35 | 36 | //filter 37 | w_env AMPLITUDE, 0, 0; 38 | w_env FREQUENCY, 39 | 0, 1500, 40 | 0.02, 500, 41 | 0.2, 400; 42 | w_filter target, LOWPASS_12; 43 | -------------------------------------------------------------------------------- /data/sfx/bleep1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Bleep 1 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 3200, 0; 8 | 9 | w_env AMPLITUDE, .5; 10 | w_env FREQUENCY, 1700; 11 | w_osc target, SINE; 12 | w_env FREQUENCY, 2295; 13 | w_osc target, SINE; 14 | 15 | w_env AMPLITUDE, 1; 16 | w_env BALANCE, 1; 17 | w_env FREQUENCY, 1500.5; 18 | w_osc target, SINE, MUL; 19 | 20 | w_env AMPLITUDE, 21 | 0, .9, 22 | .01, .2, 23 | .08, .3, 24 | .005, .7, 25 | .005, 0; 26 | w_env BALANCE, 27 | 0, 20, 28 | .01, 35, 29 | .08, 45, 30 | .01, 0; 31 | w_env FREQUENCY, 1000; 32 | w_osc target, SINE, FM; 33 | 34 | w_env FREQUENCY, 500; 35 | w_env AMPLITUDE, 0; 36 | w_filter target, HIGHPASS_12; 37 | -------------------------------------------------------------------------------- /data/sfx/bleep3.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Bleep 3 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 800, 0; 8 | 9 | w_env AMPLITUDE, .5; 10 | w_env FREQUENCY, 3400; 11 | w_osc target, SINE; 12 | w_env FREQUENCY, 4600; 13 | w_osc target, SINE; 14 | 15 | w_env AMPLITUDE, 1; 16 | w_env BALANCE, 1; 17 | w_env FREQUENCY, 7010; 18 | w_osc target, SINE, MUL; 19 | 20 | w_env AMPLITUDE, 21 | .00125, .8, 22 | .00125, .3, 23 | .02, .4, 24 | .0025, 0; 25 | w_env BALANCE, 26 | 0, 20, 27 | .0025, 30, 28 | .02, 40, 29 | .0025, 0; 30 | w_env FREQUENCY, 2000; 31 | w_osc target, SINE, FM; 32 | 33 | w_env FREQUENCY, 1600; 34 | w_env AMPLITUDE, 5; 35 | w_filter target, HIGHPASS_12; 36 | -------------------------------------------------------------------------------- /data/sfx/boltfire2.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Bolt Fire 2 3 | // Copyright (C) 2003, 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 1600, 0; 8 | 9 | //fm thump 10 | w_env AMPLITUDE, .5; 11 | w_env FREQUENCY, 1965; 12 | w_osc target, SINE; 13 | w_env FREQUENCY, 1985; 14 | w_osc target, SINE; 15 | 16 | w_env AMPLITUDE, 1; 17 | w_env BALANCE, 1; 18 | w_env FREQUENCY, 2000; 19 | w_osc target, SINE, MUL; 20 | 21 | w_env AMPLITUDE, 22 | 0, .5, 23 | .01, .25, 24 | .02, .1, 25 | .02, 0; 26 | w_env BALANCE, 27 | 0, 50, 28 | .05, 20; 29 | w_env FREQUENCY, 400; 30 | w_osc target, SINE, FM; 31 | 32 | //tecno squeal 33 | w_env AMPLITUDE, 34 | .04, .05, 35 | .01, 0; 36 | w_env MOD1, 37 | 0, .15, 38 | .05, .25; 39 | w_env FREQUENCY, 40 | 0, 3000, 41 | .05, 4000; 42 | w_osc target, SINE; 43 | w_env FREQUENCY, 44 | 0, 1800, 45 | .05, 2000; 46 | w_osc target, SINE; 47 | w_env MOD1, 48 | 0, .4, 49 | .05, .6; 50 | w_env FREQUENCY, 51 | 0, 500, 52 | .05, 600; 53 | w_osc target, SINE; 54 | -------------------------------------------------------------------------------- /data/sfx/boltfire2e.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Bolt Fire 2 - End (*after* last shot) 3 | // Copyright (C) 2003, 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 16000, 0; 8 | 9 | //tecno squeal 10 | w_env AMPLITUDE, 11 | .1, .05, 12 | .4, 0; 13 | w_env MOD1, 14 | 0, .2, 15 | .5, 0; 16 | w_env FREQUENCY, 17 | 0, 4000, 18 | .5, 2000; 19 | w_osc target, SINE; 20 | w_env FREQUENCY, 21 | 0, 2200, 22 | .5, 1100; 23 | w_osc target, SINE; 24 | w_env MOD1, 25 | 0, .5, 26 | .5, 0; 27 | w_env FREQUENCY, 28 | 0, 600, 29 | .5, 300; 30 | w_osc target, SINE; 31 | -------------------------------------------------------------------------------- /data/sfx/boltfire2o.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Bolt Fire 2 - Overheat 3 | // Copyright (C) 2003, 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 3200, 0; 8 | 9 | //tecno squeal 10 | w_env AMPLITUDE, 11 | .07, .05, 12 | .03, 0; 13 | w_env MOD1, 14 | 0, .25, 15 | .1, .1; 16 | w_env FREQUENCY, 17 | 0, 4000, 18 | .1, 3000; 19 | w_osc target, SINE; 20 | w_env FREQUENCY, 21 | 0, 1800, 22 | .1, 2000; 23 | w_osc target, SINE; 24 | w_env MOD1, 25 | 0, .6, 26 | .1, .2; 27 | w_env FREQUENCY, 28 | 0, 600, 29 | .1, 500; 30 | w_osc target, SINE; 31 | -------------------------------------------------------------------------------- /data/sfx/boltfire2s.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Bolt Fire 2 - Start (first shot) 3 | // Copyright (C) 2003, 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 6400, 0; 8 | 9 | //fm thump 10 | w_env AMPLITUDE, .5; 11 | w_env FREQUENCY, 1965; 12 | w_osc target, SINE; 13 | w_env FREQUENCY, 1985; 14 | w_osc target, SINE; 15 | 16 | w_env AMPLITUDE, 1; 17 | w_env BALANCE, 1; 18 | w_env FREQUENCY, 2000; 19 | w_osc target, SINE, MUL; 20 | 21 | w_env AMPLITUDE, 22 | .02, 0, 23 | 0, .5, 24 | .01, .25, 25 | .02, .1, 26 | .02, 0; 27 | w_env BALANCE, 28 | .02, 0, 29 | 0, 50, 30 | .05, 20; 31 | w_env FREQUENCY, 900; 32 | w_osc target, SINE, FM; 33 | 34 | //tecno squeal 35 | w_env AMPLITUDE, 36 | .03, .075, 37 | .07, .05, 38 | .07, 0; 39 | w_env MOD1, .2; 40 | w_env FREQUENCY, 41 | 0, 1500, 42 | .2, 4000; 43 | w_osc target, SINE; 44 | w_env FREQUENCY, 45 | 0, 900, 46 | .2, 2000; 47 | w_osc target, SINE; 48 | w_env MOD1, .5; 49 | w_env FREQUENCY, 50 | 0, 150, 51 | .2, 600; 52 | w_osc target, SINE; 53 | -------------------------------------------------------------------------------- /data/sfx/brass2.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Brass 2 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 128000, 0; 8 | 9 | C = 523.25; 10 | 11 | //modulator 12 | w_env FREQUENCY, C; 13 | w_env AMPLITUDE, 1; 14 | w_env MOD2, .5; 15 | w_osc target, SINEMORPH; 16 | 17 | //FM oscillator 18 | w_env AMPLITUDE, 1; 19 | w_env FREQUENCY, 20 | 0, C * 0.93, 21 | .07, C; 22 | w_mod FREQUENCY, .2, 0, 0.002; 23 | w_env MOD1, 24 | 0, 1, 25 | .5, .5, 26 | 2, 0; 27 | w_env MOD2; 28 | w_env BALANCE, 29 | 0, 2, 30 | 1, 1.3, 31 | 3, .7; 32 | w_osc target, SINEMORPH, FM; 33 | 34 | //"chorus" 35 | w_env FREQUENCY, C; 36 | w_mod FREQUENCY, 3, 0, .01; 37 | w_env AMPLITUDE, 1; 38 | w_env MOD1, 1; 39 | w_env MOD2, 0; 40 | w_osc target, SINEMORPH; 41 | 42 | //Soft dist 43 | w_env AMPLITUDE, .7; 44 | w_gain target; 45 | 46 | w_env AMPLITUDE, 1; 47 | w_env FREQUENCY, 3000; 48 | w_env MOD1; 49 | w_filter target, LOWPASS_12; 50 | 51 | //final envelope 52 | w_env AMPLITUDE, 53 | 0, 1, 54 | 1, 1, 55 | 2, .5, 56 | 1, 0; 57 | w_gain target; 58 | -------------------------------------------------------------------------------- /data/sfx/bzzzt1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Bzzzt! 1 3 | // Copyright (C) David Olofson, 2003 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 16000, 0; 8 | 9 | w_env AMPLITUDE, .5; 10 | w_env FREQUENCY, 55; 11 | w_env MOD1, 1; 12 | w_osc target, TRIANGLE; 13 | 14 | w_env FREQUENCY, 50; 15 | w_osc target, TRIANGLE, SYNC; 16 | 17 | w_env FREQUENCY, 7000; 18 | w_env BALANCE, 1; 19 | w_osc target, NOISE, MUL; 20 | 21 | w_env AMPLITUDE, .1; 22 | w_env FREQUENCY, 49; 23 | w_env BALANCE, .5; 24 | w_osc target, TRIANGLE, MUL; 25 | w_env AMPLITUDE, .05; 26 | w_env FREQUENCY, 57; 27 | w_env MOD1, .1; 28 | w_osc target, PULSE; 29 | 30 | w_env AMPLITUDE, 31 | .01, 1, 32 | .09, .8, 33 | .2, .6, 34 | .05, .1, 35 | .1, .05, 36 | .05, 0; 37 | w_gain target; 38 | -------------------------------------------------------------------------------- /data/sfx/cannon1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Cannon 1 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | a = .8; 7 | 8 | w_format target, MONO16, 24000; 9 | w_blank target, 24000*3, 0; 10 | 11 | // Rumble 12 | w_env AMPLITUDE, 13 | 0, a/4, 14 | .5, a/8, 15 | .5, a/16, 16 | 1, a/32, 17 | 1, 0; 18 | w_env FREQUENCY, 19 | 0, 100, 20 | 3, 70; 21 | w_osc target, NOISE; 22 | 23 | w_env FREQUENCY, 24 | 0, 100, 25 | .5, 300, 26 | .5, 100, 27 | .1, 200, 28 | .1, 50, 29 | .2, 150, 30 | .2, 250, 31 | .4, 100, 32 | 1, 10; 33 | w_env AMPLITUDE, 2; 34 | w_filter target, LOWPASS_12; 35 | 36 | // Ka-blam 37 | w_env AMPLITUDE, 38 | 0, a/4, 39 | .5, a/8, 40 | .5, a/16, 41 | 1, a/32, 42 | 1, 0; 43 | w_env FREQUENCY, 44 | 0, 700, 45 | .1, 200, 46 | .1, 700, 47 | 2.8, 850; 48 | w_osc target, NOISE; 49 | w_env FREQUENCY, 50 | 0, 500, 51 | .1, 100, 52 | .5, 300, 53 | 2.4, 200; 54 | w_osc target, NOISE; 55 | 56 | 57 | // Attack 58 | w_env AMPLITUDE, 59 | 0, a/2, 60 | .1, a/8, 61 | .5, 0; 62 | w_env FREQUENCY, 1500; 63 | w_osc target, NOISE; 64 | 65 | 66 | // Mod 67 | w_env AMPLITUDE, 1; 68 | w_env FREQUENCY, 15; 69 | w_env BALANCE, .4; 70 | w_osc target, NOISE, MUL; 71 | 72 | 73 | // Thunder reso 74 | w_env FREQUENCY, 75 | 0, 300, 76 | .02, 50, 77 | .08, 300, 78 | .1, 150, 79 | .2, 300, 80 | .2, 150, 81 | .4, 50, 82 | 2.2, 150; 83 | w_env AMPLITUDE, 84 | 0, 5, 85 | .02, 10, 86 | .08, 5, 87 | .1, 0, 88 | .2, 5, 89 | .2, 0, 90 | .4, 2, 91 | 2.2, 0; 92 | w_filter target, PEAK_12; 93 | 94 | 95 | // Quake reso 96 | w_env FREQUENCY, 97 | 0, 200, 98 | .1, 70, 99 | 2.9, 50; 100 | w_env AMPLITUDE, 101 | 0, 5, 102 | .1, 0, 103 | .5, 7, 104 | 2.4, 15; 105 | w_filter target, PEAK_12; 106 | 107 | 108 | // Crackle boost 109 | w_env FREQUENCY, 400; 110 | w_env AMPLITUDE, 111 | 0, 5, 112 | .5, 15, 113 | 2.5, 0; 114 | w_filter target, PEAK_12; 115 | w_env FREQUENCY, 750; 116 | w_env AMPLITUDE, 3; 117 | w_filter target, PEAK_12; 118 | w_env FREQUENCY, 1100; 119 | w_env AMPLITUDE, 120 | 0, 1, 121 | 1, 8, 122 | 2, 0; 123 | w_filter target, PEAK_12; 124 | w_env FREQUENCY, 1700; 125 | w_env AMPLITUDE, 126 | 0, 8, 127 | 1, 0; 128 | w_filter target, PEAK_12; 129 | 130 | 131 | // Treble damping 132 | w_env FREQUENCY, 133 | 0, 9000, 134 | .25, 4000, 135 | 1.25, 2000, 136 | 1.5, 500; 137 | w_env AMPLITUDE, 0; 138 | w_env MOD1, 139 | 0, .3, 140 | .5, 0; 141 | w_filter target, LOWPASS_12; 142 | -------------------------------------------------------------------------------- /data/sfx/claps1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Claps 1 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 8000, 0; 8 | 9 | procedure clap(delay, l1, l2, l3) 10 | { 11 | w_env AMPLITUDE, 12 | delay, 0, 13 | 0, l1, 14 | .01, l2, 15 | .02, l3, 16 | .2, 0; 17 | w_osc target, NOISE; 18 | } 19 | 20 | //claps 21 | w_env FREQUENCY, 0, 8000; 22 | clap 0, .15, .05, .01; 23 | clap .02, .5, .1, .02; 24 | clap .05, .2, .1, .02; 25 | clap .085, .15, .05, .015; 26 | 27 | //lpf 28 | w_env MOD1; 29 | w_env AMPLITUDE, 0, 1; 30 | w_env FREQUENCY, 0, 4500; 31 | w_filter target, LOWPASS_12; 32 | 33 | //coloration 34 | w_env AMPLITUDE, 0, 4; 35 | w_env FREQUENCY, 0, 800; 36 | w_filter target, PEAK_12; 37 | w_env FREQUENCY, 0, 1200; 38 | w_filter target, PEAK_12; 39 | w_env AMPLITUDE, 0, 2; 40 | w_env FREQUENCY, 0, 4000; 41 | w_filter target, PEAK_12; 42 | -------------------------------------------------------------------------------- /data/sfx/edge2.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Edge 2 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 32000, 0; 8 | 9 | w_env FREQUENCY, 8000; 10 | w_env AMPLITUDE, 11 | 0, .5, 12 | .02, .05, 13 | .03, .006, 14 | .95, 0; 15 | w_osc target, NOISE; 16 | 17 | //attack shaper 18 | w_env AMPLITUDE, 0; 19 | w_env MOD1, .2; 20 | w_env FREQUENCY, 21 | 0, 6000, 22 | .01, 3500, 23 | .9, 1700; 24 | w_filter target, LOWPASS_12; 25 | w_env FREQUENCY, 26 | 0, 100, 27 | .01, 800, 28 | .9, 1200; 29 | w_filter target, HIGHPASS_12; 30 | 31 | //drum resonance 32 | w_env AMPLITUDE, 33 | 0, 3, 34 | .2, 2; 35 | w_env FREQUENCY, 2200; 36 | w_filter target, PEAK_12; 37 | 38 | //stick resonance 39 | w_env AMPLITUDE, 4; 40 | w_env FREQUENCY, 3700; 41 | w_filter target, PEAK_12; 42 | -------------------------------------------------------------------------------- /data/sfx/explo1b-rg.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 1 B Rumble Grain 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000, 0; 8 | 9 | procedure f(tp, f0, res) 10 | { 11 | w_env FREQUENCY, f0; 12 | w_env AMPLITUDE, res; 13 | w_filter target, tp; 14 | } 15 | 16 | // Rumble 17 | w_env AMPLITUDE, .3; 18 | w_env FREQUENCY, 130; 19 | w_osc target, NOISE; 20 | 21 | // Crackle 22 | w_env AMPLITUDE, .8; 23 | w_env FREQUENCY, 350; 24 | w_osc target, NOISE; 25 | 26 | // Attack 27 | w_env AMPLITUDE, .4; 28 | w_env FREQUENCY, 5000; 29 | w_osc target, NOISE; 30 | 31 | // Mod 32 | w_env AMPLITUDE, 1; 33 | w_env FREQUENCY, 70; 34 | w_env BALANCE, .8; 35 | w_osc target, NOISE, MUL; 36 | 37 | // Resonances 38 | f PEAK_12, 900, 1; 39 | f PEAK_12, 1100, 2; 40 | f PEAK_12, 2700, 2; 41 | 42 | // Treble damping 43 | w_env FREQUENCY, 44 | 0, 5000, 45 | 1, 100; 46 | w_filter target, LOWPASS_6; 47 | w_env FREQUENCY, 150; 48 | w_env AMPLITUDE, 0; 49 | w_env MOD1, 50 | .05, 1, 51 | .15, .3, 52 | .8, .1; 53 | w_filter target, LOWPASS_12; 54 | 55 | w_env AMPLITUDE, 56 | .1, 1, 57 | .9, 0; 58 | w_gain target; 59 | -------------------------------------------------------------------------------- /data/sfx/explo1b.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 1 B - Short version 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000, 0; 8 | 9 | procedure ax(a) 10 | { 11 | w_env AMPLITUDE, 12 | 0, a, 13 | .5, a/2, 14 | .5, 0; 15 | } 16 | 17 | procedure f(tp, f0, res) 18 | { 19 | w_env FREQUENCY, f0; 20 | w_env AMPLITUDE, res; 21 | w_filter target, tp; 22 | } 23 | 24 | // Rumble 25 | ax .3; 26 | w_env FREQUENCY, 130; 27 | w_osc target, NOISE; 28 | f LOWPASS_12, 80, 2; 29 | 30 | // Crackle 31 | ax .8; 32 | w_env FREQUENCY, 350; 33 | w_osc target, NOISE; 34 | 35 | // Attack 36 | ax .4; 37 | w_env FREQUENCY, 5000; 38 | w_osc target, NOISE; 39 | 40 | // Mod 41 | w_env AMPLITUDE, 1; 42 | w_env FREQUENCY, 70; 43 | w_env BALANCE, 1; 44 | w_osc target, NOISE, MUL; 45 | 46 | // Resonances 47 | f PEAK_12, 40, 11; 48 | f PEAK_12, 220, 8; 49 | f PEAK_12, 900, 2; 50 | f PEAK_12, 1100, 3; 51 | f PEAK_12, 2700, 4; 52 | 53 | // Treble damping 54 | w_env FREQUENCY, 55 | 0, 16000, 56 | .2, 4000, 57 | .8, 1000; 58 | w_filter target, LOWPASS_6; 59 | w_env FREQUENCY, 150; 60 | w_env AMPLITUDE, 3; 61 | w_env MOD1, 62 | 0, 1, 63 | .2, .4, 64 | .8, 0; 65 | w_filter target, LOWPASS_12; 66 | 67 | w_env AMPLITUDE, 68 | 0, 1, 69 | .5, 1, 70 | .5, 0; 71 | w_gain target; 72 | -------------------------------------------------------------------------------- /data/sfx/explo1c-rg.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 1 C Rumble Grain 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000, 0; 8 | 9 | procedure f(tp, f0, res) 10 | { 11 | w_env FREQUENCY, f0; 12 | w_env AMPLITUDE, res; 13 | w_filter target, tp; 14 | } 15 | 16 | // Rumble 17 | w_env AMPLITUDE, .3; 18 | w_env FREQUENCY, 130; 19 | w_osc target, NOISE; 20 | 21 | // Crackle 22 | w_env AMPLITUDE, .8; 23 | w_env FREQUENCY, 350; 24 | w_osc target, NOISE; 25 | 26 | // Attack 27 | w_env AMPLITUDE, .2; 28 | w_env FREQUENCY, 7000; 29 | w_osc target, NOISE; 30 | 31 | // Mod 32 | w_env AMPLITUDE, 1; 33 | w_env FREQUENCY, 70; 34 | w_env BALANCE, .8; 35 | w_osc target, NOISE, MUL; 36 | 37 | // Resonances 38 | f PEAK_12, 900, 2; 39 | f PEAK_12, 1700, 1; 40 | f PEAK_12, 3100, 5; 41 | 42 | // Treble damping 43 | w_env FREQUENCY, 44 | 0, 5000, 45 | 1, 100; 46 | w_filter target, LOWPASS_6; 47 | w_env FREQUENCY, 150; 48 | w_env AMPLITUDE, 0; 49 | w_env MOD1, 50 | .05, 1, 51 | .15, .4, 52 | .8, .1; 53 | w_filter target, LOWPASS_12; 54 | 55 | w_env AMPLITUDE, 56 | .1, 1, 57 | .9, 0; 58 | w_gain target; 59 | -------------------------------------------------------------------------------- /data/sfx/explo1c.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 1 C - Short version, variation 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000, 0; 8 | 9 | procedure ax(a) 10 | { 11 | w_env AMPLITUDE, 12 | 0, a, 13 | .5, a/2, 14 | .5, 0; 15 | } 16 | 17 | procedure f(tp, f0, res) 18 | { 19 | w_env FREQUENCY, f0; 20 | w_env AMPLITUDE, res; 21 | w_filter target, tp; 22 | } 23 | 24 | // Rumble 25 | ax .3; 26 | w_env FREQUENCY, 130; 27 | w_osc target, NOISE; 28 | f LOWPASS_12, 80, 2; 29 | 30 | // Crackle 31 | ax .8; 32 | w_env FREQUENCY, 350; 33 | w_osc target, NOISE; 34 | 35 | // Attack 36 | ax .4; 37 | w_env FREQUENCY, 7000; 38 | w_osc target, NOISE; 39 | 40 | // Mod 41 | w_env AMPLITUDE, 1; 42 | w_env FREQUENCY, 70; 43 | w_env BALANCE, 1; 44 | w_osc target, NOISE, MUL; 45 | 46 | // Resonances 47 | f PEAK_12, 40, 11; 48 | f PEAK_12, 180, 8; 49 | f PEAK_12, 500, 3; 50 | f PEAK_12, 900, 4; 51 | f PEAK_12, 1700, 3; 52 | f PEAK_12, 3100, 5; 53 | 54 | // Treble damping 55 | w_env FREQUENCY, 56 | 0, 16000, 57 | .2, 4000, 58 | .8, 1000; 59 | w_filter target, LOWPASS_6; 60 | w_env FREQUENCY, 150; 61 | w_env AMPLITUDE, 3; 62 | w_env MOD1, 63 | 0, 1, 64 | .2, .3, 65 | .8, 0; 66 | w_filter target, LOWPASS_12; 67 | 68 | w_env AMPLITUDE, 69 | 0, 1, 70 | .5, 1, 71 | .5, 0; 72 | w_gain target; 73 | -------------------------------------------------------------------------------- /data/sfx/explo3d.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 3 D - Short version, less rumble 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000, 0; 8 | 9 | procedure f(tp, f0, res) 10 | { 11 | w_env FREQUENCY, f0; 12 | w_env AMPLITUDE, res; 13 | w_filter target, tp; 14 | } 15 | 16 | // Rumble 17 | w_env AMPLITUDE, 18 | 0, .1, 19 | .5, .5; 20 | w_env FREQUENCY, 150; 21 | w_osc target, NOISE; 22 | 23 | // Crackle 24 | w_env AMPLITUDE, 25 | 0, 1, 26 | .5, .5; 27 | w_env FREQUENCY, 300; 28 | w_osc target, NOISE; 29 | w_env FREQUENCY, 50; 30 | w_osc target, NOISE; 31 | 32 | // Attack 33 | w_env AMPLITUDE, 34 | 0, 1, 35 | .5, .1; 36 | w_env FREQUENCY, 3000; 37 | w_osc target, NOISE; 38 | 39 | // Mod 40 | w_env FREQUENCY, 25; 41 | w_env BALANCE, 42 | 0, .5, 43 | .5, .2; 44 | w_osc target, NOISE, MUL; 45 | 46 | // Resonances 47 | f PEAK_12, 200, 5; 48 | f PEAK_12, 350, 7; 49 | f PEAK_12, 500, 5; 50 | f PEAK_12, 2100, 3; 51 | f PEAK_12, 4700, 0; 52 | 53 | // Treble damping 54 | w_env FREQUENCY, 55 | 0, 16000, 56 | .25, 4000, 57 | .75, 1000; 58 | w_filter target, LOWPASS_6; 59 | w_env FREQUENCY, 60; 60 | w_env AMPLITUDE, 1; 61 | w_env MOD1, 62 | 0, 1, 63 | .2, .3, 64 | .8, 0; 65 | w_filter target, LOWPASS_12; 66 | 67 | w_env AMPLITUDE, 68 | 0, 1, 69 | .3, 1, 70 | .7, 0; 71 | w_gain target; 72 | -------------------------------------------------------------------------------- /data/sfx/explo4d.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 4 D - Short version, less rumble 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000, 0; 8 | 9 | procedure ax(a) 10 | { 11 | w_env AMPLITUDE, 12 | 0, a, 13 | .25, a/2, 14 | .25, a/4, 15 | .25, a/8, 16 | .25, 0; 17 | } 18 | 19 | procedure f(tp, f0, res) 20 | { 21 | w_env FREQUENCY, f0; 22 | w_env AMPLITUDE, res; 23 | w_filter target, tp; 24 | } 25 | 26 | // Rumble 27 | w_env AMPLITUDE, .5; 28 | w_env FREQUENCY, 150; 29 | w_osc target, NOISE; 30 | 31 | // Crackle 32 | ax 1; 33 | w_env FREQUENCY, 300; 34 | w_osc target, NOISE; 35 | w_env FREQUENCY, 50; 36 | w_osc target, NOISE; 37 | 38 | // Attack 39 | w_env AMPLITUDE, 40 | 0, .7, 41 | .5, .1; 42 | w_env FREQUENCY, 6000; 43 | w_osc target, NOISE; 44 | w_env FREQUENCY, 2000; 45 | w_osc target, NOISE; 46 | 47 | // Mod 48 | w_env AMPLITUDE, 1; 49 | w_env FREQUENCY, 25; 50 | w_env BALANCE, 51 | 0, .5, 52 | .5, .2; 53 | w_osc target, NOISE, MUL; 54 | 55 | // Resonances 56 | f PEAK_12, 110, 10; 57 | f PEAK_12, 220, 10; 58 | f PEAK_12, 400, 5; 59 | f PEAK_12, 1700, 3; 60 | f PEAK_12, 3000, 2; 61 | 62 | // Treble damping 63 | w_env FREQUENCY, 64 | 0, 16000, 65 | .25, 4000, 66 | .75, 1000; 67 | w_filter target, LOWPASS_6; 68 | w_env FREQUENCY, 60; 69 | w_env AMPLITUDE, 1; 70 | w_env MOD1, 71 | 0, 1, 72 | .2, .2, 73 | .8, 0; 74 | w_filter target, LOWPASS_12; 75 | 76 | w_env AMPLITUDE, 77 | 0, 1, 78 | .3, 1, 79 | .7, 0; 80 | w_gain target; 81 | -------------------------------------------------------------------------------- /data/sfx/explo5.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 5 - Electric 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 32000*.75, 0; 8 | 9 | procedure f(tp, f0, res) 10 | { 11 | w_env FREQUENCY, f0; 12 | w_env AMPLITUDE, res; 13 | w_filter target, tp; 14 | } 15 | 16 | // Bump 17 | w_env AMPLITUDE, 18 | 0, .5, 19 | .1, 0; 20 | w_env FREQUENCY, 1000; 21 | w_osc target, NOISE; 22 | f LOWPASS_12, 2000, 2; 23 | 24 | // Crackle 25 | w_env AMPLITUDE, 26 | 0, .1, 27 | .5, .05, 28 | .55, 0; 29 | w_env FREQUENCY, 8000; 30 | w_osc target, NOISE; 31 | w_env FREQUENCY, 15000; 32 | w_osc target, NOISE; 33 | 34 | // Mod 35 | w_env AMPLITUDE, 1; 36 | w_env FREQUENCY, 50; 37 | w_env BALANCE, 38 | 0, .5, 39 | .5, 1; 40 | w_osc target, NOISE, MUL; 41 | 42 | // Resonances 43 | f PEAK_12, 90, 10; 44 | f PEAK_12, 160, 15; 45 | f PEAK_12, 800, 5; 46 | f PEAK_12, 1700, 3; 47 | f PEAK_12, 3500, 1; 48 | -------------------------------------------------------------------------------- /data/sfx/explo5b.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 5 B 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 32000*.75, 0; 8 | 9 | procedure f(tp, f0, res) 10 | { 11 | w_env FREQUENCY, f0; 12 | w_env AMPLITUDE, res; 13 | w_filter target, tp; 14 | } 15 | 16 | // Bump 17 | w_env AMPLITUDE, 18 | 0, .5, 19 | .1, 0; 20 | w_env FREQUENCY, 900; 21 | w_osc target, NOISE; 22 | f LOWPASS_12, 1900, 2; 23 | 24 | // Crackle 25 | w_env AMPLITUDE, 26 | 0, .1, 27 | .5, .05, 28 | .25, 0; 29 | w_env FREQUENCY, 7000; 30 | w_osc target, NOISE; 31 | w_env FREQUENCY, 13000; 32 | w_osc target, NOISE; 33 | 34 | // Mod 35 | w_env AMPLITUDE, 1; 36 | w_env FREQUENCY, 30; 37 | w_env BALANCE, 38 | 0, .5, 39 | .5, 1; 40 | w_osc target, NOISE, MUL; 41 | 42 | // Resonances 43 | f PEAK_12, 80, 10; 44 | f PEAK_12, 140, 10; 45 | f PEAK_12, 900, 3; 46 | f PEAK_12, 1500, 3; 47 | f PEAK_12, 4000, 3; 48 | -------------------------------------------------------------------------------- /data/sfx/explo5c.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 5 C 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 32000*.75, 0; 8 | 9 | procedure f(tp, f0, res) 10 | { 11 | w_env FREQUENCY, f0; 12 | w_env AMPLITUDE, res; 13 | w_filter target, tp; 14 | } 15 | 16 | // Bump 17 | w_env AMPLITUDE, 18 | 0, .5, 19 | .1, 0; 20 | w_env FREQUENCY, 800; 21 | w_osc target, NOISE; 22 | f LOWPASS_12, 2100, 2; 23 | 24 | // Crackle 25 | w_env AMPLITUDE, 26 | 0, .1, 27 | .5, .05, 28 | .25, 0; 29 | w_env FREQUENCY, 9000; 30 | w_osc target, NOISE; 31 | w_env FREQUENCY, 11000; 32 | w_osc target, NOISE; 33 | 34 | // Mod 35 | w_env AMPLITUDE, 1; 36 | w_env FREQUENCY, 40; 37 | w_env BALANCE, 38 | 0, .5, 39 | .5, 1; 40 | w_osc target, NOISE, MUL; 41 | 42 | // Resonances 43 | f PEAK_12, 100, 15; 44 | f PEAK_12, 900, 3; 45 | f PEAK_12, 2000, 3; 46 | f PEAK_12, 5000, 3; 47 | -------------------------------------------------------------------------------- /data/sfx/explo6.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Explo 6 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 24000; 7 | w_blank target, 24000*4, 0; 8 | 9 | procedure f(tp, f0, res) 10 | { 11 | w_env FREQUENCY, f0; 12 | w_env AMPLITUDE, res; 13 | w_filter target, tp; 14 | } 15 | 16 | // Rumble 17 | w_env AMPLITUDE, .5; 18 | w_env FREQUENCY, 150; 19 | w_osc target, NOISE; 20 | 21 | f LOWPASS_12, 150, 5; 22 | 23 | // Crackle 24 | w_env AMPLITUDE, .5; 25 | w_env FREQUENCY, 300; 26 | w_osc target, NOISE; 27 | w_env FREQUENCY, 50; 28 | w_osc target, NOISE; 29 | 30 | // Attack 31 | w_env AMPLITUDE, 32 | 0, .5, 33 | .5, .1, 34 | 3, 0; 35 | w_env FREQUENCY, 6000; 36 | w_osc target, NOISE; 37 | w_env FREQUENCY, 2000; 38 | w_osc target, NOISE; 39 | 40 | // Mod 41 | w_env AMPLITUDE, 1; 42 | w_env FREQUENCY, 25; 43 | w_env BALANCE, 44 | 0, .7, 45 | 1.5, .2; 46 | w_osc target, NOISE, MUL; 47 | 48 | // Resonances 49 | f PEAK_12, 45, 5; 50 | f PEAK_12, 110, 12; 51 | f PEAK_12, 220, 15; 52 | f PEAK_12, 400, 7; 53 | f PEAK_12, 600, 3; 54 | f PEAK_12, 1100, 2; 55 | f PEAK_12, 1900, 4; 56 | f PEAK_12, 3200, 3; 57 | 58 | // Treble damping 59 | w_env FREQUENCY, 60 | 0, 24000, 61 | .5, 6000, 62 | 1.25, 1500; 63 | w_filter target, LOWPASS_6; 64 | w_env FREQUENCY, 60; 65 | w_env AMPLITUDE, 1; 66 | w_env MOD1, 67 | 0, 1, 68 | .5, .5, 69 | 1, .3, 70 | 2.5, .1; 71 | w_filter target, LOWPASS_12; 72 | 73 | w_env AMPLITUDE, 74 | 0, 1, 75 | 2, .8, 76 | 1, .2, 77 | 1, 0; 78 | w_gain target; 79 | -------------------------------------------------------------------------------- /data/sfx/fmthump1b.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // FM Thump 1 B 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 3200, 0; 8 | 9 | w_env AMPLITUDE, .5; 10 | w_env FREQUENCY, 1955; 11 | w_osc target, SINE; 12 | w_env FREQUENCY, 1985; 13 | w_osc target, SINE; 14 | 15 | w_env AMPLITUDE, 1; 16 | w_env BALANCE, 1; 17 | w_env FREQUENCY, 1975; 18 | w_osc target, SINE, MUL; 19 | 20 | w_env AMPLITUDE, 21 | 0, .5, 22 | .02, .2, 23 | .04, .05, 24 | .04, 0; 25 | w_env BALANCE, 26 | 0, 50, 27 | .1, 10; 28 | w_env FREQUENCY, 1200; 29 | w_osc target, SINE, FM; 30 | -------------------------------------------------------------------------------- /data/sfx/gameover1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Game Over 1 3 | // Copyright (C) David Olofson, 2003 4 | ///////////////////////////////////////////// 5 | 6 | SWEEP = 10; 7 | 8 | w_format target, MONO16, 32000; 9 | w_blank target, 48000, 0; 10 | 11 | //Pulses 12 | w_env AMPLITUDE, 13 | .1, .05, 14 | 1.3, .05, 15 | .1, 0; 16 | w_env MOD1, .1; 17 | 18 | w_env FREQUENCY, 19 | 0, 43.9, 20 | 1.5, 43.9 - SWEEP; 21 | w_osc target, PULSE; 22 | 23 | w_env FREQUENCY, 24 | 0, 44.1, 25 | 1.5, 44.1 - SWEEP; 26 | w_osc target, PULSE; 27 | 28 | w_env FREQUENCY, 29 | 0, 88, 30 | 1.5, 88 - SWEEP; 31 | w_osc target, PULSE; 32 | 33 | //LF 34 | w_env AMPLITUDE, .2; 35 | w_env FREQUENCY, 36 | 0, 22, 37 | 1.5, 22 - SWEEP; 38 | w_env MOD1, .5; 39 | w_osc target, SINE; 40 | 41 | //noise 42 | w_env AMPLITUDE, .05; 43 | w_env MOD1, 20000; 44 | w_env FREQUENCY, 45 | 0, 1000, 46 | 1.5, 50; 47 | w_osc target, NOISE; 48 | 49 | //Filters 50 | w_env MOD1, 0; 51 | w_env AMPLITUDE, 50; 52 | w_env FREQUENCY, 53 | 0, 700, 54 | .6, 5300, 55 | .9, 200; 56 | w_filter target, LOWPASS_12; 57 | 58 | w_env AMPLITUDE, 40; 59 | w_env FREQUENCY, 60 | 0, 300, 61 | .6, 700, 62 | .9, 30; 63 | w_filter target, PEAK_12; 64 | 65 | //Envelope 66 | w_env AMPLITUDE, 67 | .1, 1, 68 | 1, .5, 69 | .4, 0; 70 | w_gain, target; 71 | -------------------------------------------------------------------------------- /data/sfx/hardsync1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Hardsync 1 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 128000, 0; 8 | 9 | //fundamental 10 | w_env FREQUENCY, 261.625 / 2; 11 | w_env AMPLITUDE, .3; 12 | w_env MOD2, 1; 13 | w_osc target, SINEMORPH; 14 | 15 | //hardsync'ed harmonics 16 | w_env AMPLITUDE, 17 | 0, .4, 18 | 1, .25, 19 | 1, .1, 20 | 1, .07, 21 | 1, 0; 22 | w_env FREQUENCY, 23 | 0, 200, 24 | 4, 4000; 25 | w_env MOD2, 1; 26 | w_osc target, SINEMORPH, SYNC_ADD; 27 | 28 | //filter 29 | w_env AMPLITUDE, 30 | 0, 15, 31 | 1, 5, 32 | 3, 0; 33 | w_env FREQUENCY, 34 | 0, 5000, 35 | .5, 2500, 36 | 3, 1500; 37 | w_filter target, LOWPASS_12; 38 | 39 | //final envelope 40 | w_env AMPLITUDE, 41 | 0, 1, 42 | 3, 1, 43 | 1, 0; 44 | w_gain target; 45 | -------------------------------------------------------------------------------- /data/sfx/impact2.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Impact 2 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000*.05, 0; 8 | 9 | w_env AMPLITUDE, 10 | 0, 1, 11 | .01, .2, 12 | .04, 0; 13 | w_env FREQUENCY, 14 | 0, 8000, 15 | .01, 4000, 16 | .04, 50; 17 | w_osc target, NOISE; 18 | 19 | w_env AMPLITUDE, 20 | .002, 1, 21 | .018, .5, 22 | .03, 0; 23 | w_env FREQUENCY, 24 | 0, 2000, 25 | .01, 250, 26 | .04, 50; 27 | w_osc target, SINE; 28 | -------------------------------------------------------------------------------- /data/sfx/impact2b.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Impact 2 B 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000*.05, 0; 8 | 9 | w_env AMPLITUDE, 10 | 0, 1, 11 | .01, .2, 12 | .01, 0; 13 | w_env FREQUENCY, 14 | 0, 7000, 15 | .01, 3000, 16 | .04, 200; 17 | w_osc target, NOISE; 18 | 19 | w_env AMPLITUDE, 20 | .002, 1, 21 | .028, .3, 22 | .02, 0; 23 | w_env FREQUENCY, 24 | 0, 1700, 25 | .01, 270, 26 | .04, 50; 27 | w_osc target, SINE; 28 | -------------------------------------------------------------------------------- /data/sfx/impact2c.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Impact 2 C 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000*.05, 0; 8 | 9 | w_env AMPLITUDE, 10 | 0, 1, 11 | .01, .2, 12 | .04, 0; 13 | w_env FREQUENCY, 14 | 0, 9000, 15 | .01, 2000, 16 | .04, 300; 17 | w_osc target, NOISE; 18 | 19 | w_env AMPLITUDE, 20 | .001, 1, 21 | .005, .5, 22 | .044, 0; 23 | w_env FREQUENCY, 24 | 0, 2200, 25 | .01, 220, 26 | .04, 50; 27 | w_osc target, SINE; 28 | -------------------------------------------------------------------------------- /data/sfx/klank2b.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Klank 2 B 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 3200, 0; 8 | 9 | w_env AMPLITUDE, .5; 10 | w_env FREQUENCY, 1975; 11 | w_osc target, SINE; 12 | w_env FREQUENCY, 1990; 13 | w_osc target, SINE; 14 | 15 | w_env AMPLITUDE, 1; 16 | w_env BALANCE, 1; 17 | w_env FREQUENCY, 5650; 18 | w_osc target, SINE, MUL; 19 | 20 | w_env AMPLITUDE, 21 | 0, .9, 22 | .02, .4, 23 | .04, .1, 24 | .04, 0; 25 | w_env BALANCE, 26 | 0, 60, 27 | .1, 10; 28 | w_env FREQUENCY, 1300; 29 | w_osc target, SINE, FM; 30 | -------------------------------------------------------------------------------- /data/sfx/klank3.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Klank 3 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 3200, 0; 8 | 9 | w_env AMPLITUDE, .5; 10 | w_env FREQUENCY, 1980; 11 | w_osc target, SINE; 12 | w_env FREQUENCY, 1990; 13 | w_osc target, SINE; 14 | 15 | w_env AMPLITUDE, 1; 16 | w_env BALANCE, 1; 17 | w_env FREQUENCY, 5700; 18 | w_osc target, SINE, MUL; 19 | 20 | w_env AMPLITUDE, 21 | 0, .9, 22 | .02, .4, 23 | .04, .1, 24 | .04, 0; 25 | w_env BALANCE, 26 | 0, 60, 27 | .1, 10; 28 | w_env FREQUENCY, 1200; 29 | w_osc target, SINE, FM; 30 | 31 | w_env AMPLITUDE, 32 | .002, 1, 33 | .018, .5, 34 | .075, 0; 35 | w_env FREQUENCY, 36 | 0, 2000, 37 | .02, 150, 38 | .08, 50; 39 | w_osc target, SINE; 40 | -------------------------------------------------------------------------------- /data/sfx/klank3b.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Klank 2 B 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 3200, 0; 8 | 9 | w_env AMPLITUDE, .5; 10 | w_env FREQUENCY, 1975; 11 | w_osc target, SINE; 12 | w_env FREQUENCY, 1990; 13 | w_osc target, SINE; 14 | 15 | w_env AMPLITUDE, 1; 16 | w_env BALANCE, 1; 17 | w_env FREQUENCY, 5650; 18 | w_osc target, SINE, MUL; 19 | 20 | w_env AMPLITUDE, 21 | 0, .9, 22 | .02, .4, 23 | .04, .1, 24 | .04, 0; 25 | w_env BALANCE, 26 | 0, 60, 27 | .1, 10; 28 | w_env FREQUENCY, 1300; 29 | w_osc target, SINE, FM; 30 | 31 | w_env AMPLITUDE, 32 | .002, 1, 33 | .015, .3, 34 | .075, 0; 35 | w_env FREQUENCY, 36 | 0, 1800, 37 | .02, 200, 38 | .08, 50; 39 | w_osc target, SINE; 40 | -------------------------------------------------------------------------------- /data/sfx/klank3c.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Klank 2 C 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 3200, 0; 8 | 9 | w_env AMPLITUDE, .5; 10 | w_env FREQUENCY, 1975; 11 | w_osc target, SINE; 12 | w_env FREQUENCY, 2000; 13 | w_osc target, SINE; 14 | 15 | w_env AMPLITUDE, 1; 16 | w_env BALANCE, 1; 17 | w_env FREQUENCY, 5550; 18 | w_osc target, SINE, MUL; 19 | 20 | w_env AMPLITUDE, 21 | 0, .9, 22 | .02, .4, 23 | .04, .1, 24 | .04, 0; 25 | w_env BALANCE, 26 | 0, 60, 27 | .1, 10; 28 | w_env FREQUENCY, 1100; 29 | w_osc target, SINE, FM; 30 | 31 | w_env AMPLITUDE, 32 | .001, 1, 33 | .005, .5, 34 | .08, 0; 35 | w_env FREQUENCY, 36 | 0, 2200, 37 | .02, 130, 38 | .08, 50; 39 | w_osc target, SINE; 40 | -------------------------------------------------------------------------------- /data/sfx/klank4.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Klank 4 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 32000*.5, 0; 8 | 9 | procedure cr(f, r) 10 | { 11 | w_env FREQUENCY, f; 12 | w_env MOD1, 13 | .01, r, 14 | .49, r*.9; 15 | w_env MOD2, 16 | .01, .93, 17 | .19, .4, 18 | .3, 0; 19 | w_osc target, ASPECTRUM; 20 | } 21 | 22 | w_env AMPLITUDE, 23 | 0, .1, 24 | .1, .05, 25 | .2, .02, 26 | .2, 0; 27 | 28 | cr 170, 1.3; 29 | cr 270, 1.07; 30 | cr 285, 1.09; 31 | cr 460, 1.2; 32 | cr 480, 1.3; 33 | cr 773, 1.35; 34 | cr 810, 1.15; 35 | 36 | w_env AMPLITUDE, 37 | .002, 1, 38 | .02, .5, 39 | .1, 0; 40 | w_env FREQUENCY, 41 | 0, 2000, 42 | .02, 100, 43 | .1, 50; 44 | w_env MOD1, 0; 45 | w_osc target, SINE; 46 | -------------------------------------------------------------------------------- /data/sfx/kobosfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Kobo Deluxe Sound Effects 3 | * 4 | * IF YOU EDIT THIS FILE, YOU WILL NEED 5 | * TO RECOMPILE THE KOBO DELUXE BINARY! 6 | * 7 | * NOTE: 8 | * Songs use waves 16 and up by convention, so 9 | * we need to stay away from those indices here! 10 | */ 11 | 12 | #define SOUND_BGM 0 13 | #define SOUND_ONEUP 1 14 | #define SOUND_FINE 2 15 | #define SOUND_BEAM 3 16 | #define SOUND_RING 4 17 | 18 | #define SOUND_BOMB_DETO 5 19 | #define SOUND_EXPLO_NODE1 6 20 | #define SOUND_EXPLO_NODE2 7 21 | #define SOUND_EXPLO_ENEMY1 8 22 | #define SOUND_EXPLO_ENEMY2 9 23 | #define SOUND_EXPLO_PLAYER 10 24 | #define SOUND_EXPLO_RING1 11 25 | #define SOUND_EXPLO_RING2 12 26 | #define SOUND_EXPLO_RING3 13 27 | #define SOUND_EXPLO_ROCK 14 28 | 29 | #define SOUND_BZZZT 127 30 | #define SOUND_GAMEOVER 126 31 | #define SOUND_READY 125 32 | #define SOUND_PLAY 124 33 | #define SOUND_PAUSE 123 34 | #define SOUND_TITLE 122 35 | #define SOUND_CANCEL 121 36 | #define SOUND_LAUNCH2 120 37 | #define SOUND_LAUNCH 119 38 | #define SOUND_RUMBLE_NODE2 118 39 | #define SOUND_RUMBLE_NODE1 117 40 | #define SOUND_SHOT_START 116 41 | #define SOUND_SHOT 115 42 | #define SOUND_SHOT_END 114 43 | #define SOUND_SHOT_OVERHEAT 113 44 | #define SOUND_OVERHEAT 112 45 | #define SOUND_METALLIC3 111 46 | #define SOUND_METALLIC2 110 47 | #define SOUND_METALLIC1 109 48 | #define SOUND_DAMAGE 108 49 | #define SOUND_MOVE 107 50 | #define SOUND_HIT3 106 51 | #define SOUND_HIT2 105 52 | #define SOUND_HIT1 104 53 | #define SOUND_TICK 103 54 | #define SOUND_ENEMYM 102 55 | -------------------------------------------------------------------------------- /data/sfx/launch.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Turbine howl + acceleration stall noise 3 | // Copyright (C) 2002, 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 12800, 0; 8 | 9 | //noise 10 | w_env FREQUENCY, 0, 8000; 11 | w_env AMPLITUDE, 12 | .05, .03, 13 | .05, .05, 14 | .1, .08, 15 | .5, 0; 16 | w_env MOD1, 1; 17 | w_osc target, NOISE; 18 | 19 | //low turbine 20 | w_env AMPLITUDE, 21 | .2, .03, 22 | .6, 0; 23 | 24 | w_env FREQUENCY, 25 | 0, 700, 26 | .3, 1400, 27 | .5, 1500; 28 | w_env MOD1, .5; 29 | w_osc target, TRIANGLE; 30 | 31 | w_env FREQUENCY, 32 | 0, 800, 33 | .3, 1600, 34 | .5, 1750; 35 | w_osc target, TRIANGLE; 36 | 37 | //high turbine 38 | w_env AMPLITUDE, 39 | .5, .04, 40 | .3, 0; 41 | w_env FREQUENCY, 42 | 0, 2200, 43 | .3, 3300, 44 | .5, 3540; 45 | w_env MOD1, 0; 46 | w_osc target, SINE; 47 | 48 | //bp filter sweep 49 | w_env FREQUENCY, 50 | 0, 3000, 51 | .15, 2000, 52 | .05, 1000, 53 | .6, 800; 54 | w_env AMPLITUDE, 55 | 0, 1.5, 56 | .02, 1.5, 57 | .01, 10, 58 | .17, 8, 59 | .6, 5; 60 | w_filter target, BANDPASS_12; 61 | -------------------------------------------------------------------------------- /data/sfx/launch2.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // "Open gate and eject!" 3 | // Copyright (C) 2002, 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 5500, 0; 8 | 9 | //noise 10 | w_env FREQUENCY, 0, 8000; 11 | w_env AMPLITUDE, 12 | .01, .1, 13 | .01, .15, 14 | .01, .02, 15 | .15, .03, 16 | .15, .01, 17 | .01, 0; 18 | w_env MOD1, 1; 19 | w_osc target, NOISE; 20 | 21 | //bp filter sweep 22 | w_env FREQUENCY, 23 | 0, 4000, 24 | .1, 2000, 25 | .15, 2000, 26 | .01, 1000; 27 | w_env AMPLITUDE, 0, 13; 28 | w_env MOD1, 0; 29 | w_filter target, BANDPASS_12; 30 | 31 | //electro humming 32 | w_env AMPLITUDE, 33 | .01, .1, 34 | .14, .2, 35 | .05, 0; 36 | w_env FREQUENCY, 0, 60; 37 | w_env MOD1, 38 | .2, .5; 39 | w_osc target, SINE; 40 | 41 | //electro buzz 42 | w_env AMPLITUDE, 43 | .01, .01, 44 | .14, .02, 45 | .05, 0; 46 | w_env FREQUENCY, 47 | 0, 59, 48 | .2, 60; 49 | w_env MOD1, 50 | 0, 0.5, 51 | .2, 0.6; 52 | w_osc target, PULSE; 53 | 54 | //tecno squeal 55 | wf = SINE; 56 | w_env AMPLITUDE, 57 | .01, .02, 58 | .14, .05, 59 | .05, 0; 60 | w_env MOD1, 61 | .3, 1; 62 | w_env FREQUENCY, 63 | 0, 1000, 64 | .3, 1500; 65 | w_osc target, wf; 66 | w_env FREQUENCY, 67 | 0, 1200, 68 | .3, 2000; 69 | w_osc target, wf; 70 | w_env FREQUENCY, 71 | 0, 3500, 72 | .3, 4000; 73 | w_osc target, wf; 74 | -------------------------------------------------------------------------------- /data/sfx/launch3b.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Teleport launch, short version 3 | // Copyright (C) 2002, 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | d = .7; 7 | 8 | w_format target, MONO16, 16000; 9 | w_blank target, 16000*d, 0; 10 | 11 | //noise 12 | w_env FREQUENCY, 0, 8000; 13 | w_env AMPLITUDE, 14 | d*.01, .1, 15 | d*.01, .15, 16 | d*.01, .02, 17 | d*.15, .03, 18 | d*.15, .01, 19 | d*.17, 0; 20 | w_env MOD1, 1; 21 | w_osc target, NOISE; 22 | 23 | //bp filter sweep 24 | w_env FREQUENCY, 25 | 0, 4000, 26 | d*.1, 2000, 27 | d*.15, 2000, 28 | d*.01, 1000; 29 | w_env AMPLITUDE, 0, 13; 30 | w_env MOD1, 3; 31 | w_filter target, BANDPASS_12; 32 | 33 | //electro humming 34 | w_env AMPLITUDE, 35 | d*.01, .1, 36 | d*.14, .3, 37 | d*.35, .1, 38 | d*.55, 0; 39 | w_env FREQUENCY, 40 | 0, 59, 41 | d*.5, 60, 42 | d*.5, 180; 43 | w_env MOD1, 44 | d*.2, .7, 45 | d*.2, 2, 46 | d*.1, 0; 47 | w_osc target, SINE; 48 | 49 | //electro buzz 50 | w_env AMPLITUDE, 51 | d*.01, .1, 52 | d*.14, .05, 53 | d*.3, .1, 54 | d*.05, .05, 55 | d*.55, 0; 56 | w_env FREQUENCY, 57 | 0, 59, 58 | d*.5, 60, 59 | d*.5, 180; 60 | w_env MOD1, 61 | 0, .5, 62 | d*.2, .6; 63 | w_osc target, PULSE; 64 | 65 | //tecno squeal 66 | w_env AMPLITUDE, 67 | d*.01, .03, 68 | d*.14, .1, 69 | d*.05, .05, 70 | d*.8, 0; 71 | w_env MOD1, 72 | d*.3, 2, 73 | d*.7, 0; 74 | procedure ts(f0) 75 | { 76 | w_env FREQUENCY, 77 | 0, f0, 78 | d*.3, f0*1.1+400, 79 | d*.1, f0, 80 | d*.6, f0*3; 81 | w_osc target, SINE; 82 | } 83 | ts(200); 84 | ts(700); 85 | ts(1500); 86 | ts(2500); 87 | ts(4000); 88 | ts(5000); 89 | -------------------------------------------------------------------------------- /data/sfx/launch4.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Boss teleport launch 3 | // Copyright (C) 2002, 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000, 0; 8 | 9 | //noise 10 | w_env FREQUENCY, 0, 8000; 11 | w_env AMPLITUDE, 12 | .01, .1, 13 | .01, .15, 14 | .01, .02, 15 | .15, .03, 16 | .15, .01, 17 | .17, 0; 18 | w_env MOD1, 1; 19 | w_osc target, NOISE; 20 | 21 | //bp filter sweep 22 | w_env FREQUENCY, 23 | 0, 4000, 24 | .1, 2000, 25 | .15, 2000, 26 | .01, 1000; 27 | w_env AMPLITUDE, 0, 13; 28 | w_env MOD1, 3; 29 | w_filter target, BANDPASS_12; 30 | 31 | //electro buzz 32 | w_env AMPLITUDE, 33 | .01, .2, 34 | .14, .05, 35 | .3, .1, 36 | .2, 0; 37 | w_env FREQUENCY, 38 | 0, 30, 39 | .3, 60, 40 | .2, 30, 41 | .2, 10; 42 | w_env MOD1, 43 | 0, .5, 44 | .5, .9; 45 | w_osc target, PULSE; 46 | 47 | //tecno squeal 48 | w_env AMPLITUDE, 49 | .01, .03, 50 | .14, .1, 51 | .05, .05, 52 | .8, 0; 53 | w_env MOD1, 54 | .3, 2, 55 | .5, 0; 56 | procedure ts(f0) 57 | { 58 | w_env FREQUENCY, 59 | 0, f0, 60 | .3, f0*1.1+400, 61 | .4, f0/2, 62 | .3, f0*3; 63 | w_osc target, SINE; 64 | } 65 | ts(150); 66 | ts(500); 67 | ts(1500); 68 | ts(2500); 69 | ts(4500); 70 | ts(6500); 71 | -------------------------------------------------------------------------------- /data/sfx/metallic7.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Metallic 7 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 48000; 7 | w_blank target, 48000, 0; 8 | 9 | procedure cr(f, r) 10 | { 11 | w_env FREQUENCY, 12 | 0, 4.5*f, 13 | .01, 4*f; 14 | w_env MOD1, 15 | 0, r*.8, 16 | .01, r, 17 | .99, r*.9; 18 | w_env MOD2, 19 | 0, 1, 20 | .02, .5, 21 | .08, .3, 22 | .2, .05, 23 | .8, 0; 24 | w_osc target, ASPECTRUM; 25 | } 26 | 27 | w_env AMPLITUDE, 28 | 0, .1, 29 | .1, .05, 30 | .2, .02, 31 | .2, .005, 32 | .2, .00125, 33 | .3, 0; 34 | 35 | cr 170, 1.3; 36 | cr 270, 1.07; 37 | cr 275, 1.09; 38 | cr 560, 1.2; 39 | cr 565, 1.3; 40 | cr 773, 1.35; 41 | cr 800, 1.15; 42 | 43 | w_env AMPLITUDE, 44 | 0, .5, 45 | .1, .1, 46 | .1, 0, 47 | .01, .2, 48 | .1, .04, 49 | .1, 0, 50 | .01, .1, 51 | .1, .02, 52 | .1, 0, 53 | .01, .05, 54 | .1, .01, 55 | .1, 0, 56 | .01, .025, 57 | .1, .005, 58 | .06, 0; 59 | w_env MOD1, 60 | 0, 2, 61 | .5, 3, 62 | .5, 0; 63 | w_env FREQUENCY, 64 | 0, 50, 65 | 1, 40; 66 | w_osc target, SINE; 67 | -------------------------------------------------------------------------------- /data/sfx/metallic7rs.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Metallic 7 R S - Reverse, short 3 | // Copyright (C) 2007, David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 48000; 7 | w_blank target, 24000, 0; 8 | 9 | procedure cr(f, r) 10 | { 11 | w_env FREQUENCY, 4*f; 12 | w_env MOD1, 13 | 0, r*.9, 14 | .49, r, 15 | .01, r*.8; 16 | w_env MOD2, 17 | .3, .05, 18 | .1, .3, 19 | .08, .4, 20 | .02, .7; 21 | w_osc target, ASPECTRUM; 22 | } 23 | 24 | w_env AMPLITUDE, 25 | .15, .00125, 26 | .1, .005, 27 | .1, .02, 28 | .1, .05, 29 | .05, .1; 30 | 31 | cr 170, 1.3; 32 | cr 270, 1.07; 33 | cr 275, 1.09; 34 | cr 560, 1.2; 35 | cr 565, 1.3; 36 | cr 773, 1.35; 37 | cr 800, 1.15; 38 | 39 | w_env AMPLITUDE, 40 | .08, .05, 41 | .01, 0, 42 | .1, .04, 43 | .1, .2, 44 | .01, 0, 45 | .1, .1, 46 | .1, .5; 47 | w_env MOD1, 48 | 0, 3, 49 | .5, 2; 50 | w_env FREQUENCY, 51 | 0, 45, 52 | .5, 50; 53 | w_osc target, SINE; 54 | -------------------------------------------------------------------------------- /data/sfx/music.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Music loader script for Kobo Deluxe 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | #include "kobosfx.h" 7 | 8 | w_load SOUND_BGM, "trance1.agw"; 9 | w_load SOUND_TITLE, "test2.agw"; 10 | -------------------------------------------------------------------------------- /data/sfx/music_c.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Music loader script for Kobo Deluxe 3 | // (Cached version; uses prerendered sounds) 4 | // Copyright (C) David Olofson, 2002, 2003 5 | ///////////////////////////////////////////// 6 | 7 | #include "kobosfx.h" 8 | 9 | w_load SOUND_BGM, "trance1_c.agw"; 10 | 11 | // We don't bother caching the "one period of sine" waveform... :-) 12 | w_load SOUND_TITLE, "test2.agw"; 13 | -------------------------------------------------------------------------------- /data/sfx/noiseburst2.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Noise Burst 2 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 16000, 0; 8 | 9 | w_env AMPLITUDE, 10 | 0, .5, 11 | .01, .06, 12 | .12, .02, 13 | .3, 0; 14 | w_env FREQUENCY, 0, 6000; 15 | w_osc target, NOISE; 16 | 17 | w_env AMPLITUDE, 18 | 0, 10, 19 | .02, 50, 20 | .1, 20; 21 | w_env FREQUENCY, 22 | 0, 3000, 23 | 0.01, 2093; 24 | w_env MOD1; 25 | w_filter target, BANDPASS_12; 26 | -------------------------------------------------------------------------------- /data/sfx/phattpad2.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Phatt Pad 2 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | wid = target; 7 | 8 | w_format wid, MONO16, 33488; 9 | w_blank wid, 33488, 1; 10 | 11 | // The exact desired frequency is 523.25 Hz, 12 | // but as we need a perfect loop, we'll round 13 | // all frequencies so that we get integer 14 | // numbers of periods per loop. 15 | 16 | w_env AMPLITUDE, 17 | 0, .15, 18 | .25, .25, 19 | .5, .25, 20 | .25, .15; 21 | w_env MOD1, 22 | 0, 0, 23 | .5, .1, 24 | .5, 0; 25 | w_env FREQUENCY, 519; 26 | w_osc wid, TRIANGLE; 27 | w_env FREQUENCY, 521; 28 | w_osc wid, TRIANGLE; 29 | 30 | w_env MOD1, 31 | 0, 0, 32 | .2, .2, 33 | .3, .07, 34 | .3, .15, 35 | .2, 0; 36 | w_env FREQUENCY, 523; 37 | w_osc wid, TRIANGLE; 38 | w_env FREQUENCY, 526; 39 | w_osc wid, TRIANGLE; 40 | 41 | p_param target, WAVE, wid; 42 | p_param target, DRIVER, POLY; 43 | p_param target, ENV_SKIP, 1; 44 | p_param target, ENV_L0, 0; 45 | p_param target, ENV_DELAY, 0; 46 | p_param target, ENV_T1, .001; 47 | p_param target, ENV_L1, 1; 48 | p_param target, ENV_HOLD, .05; 49 | p_param target, ENV_T2, .1; 50 | p_param target, ENV_L2, .6; 51 | p_param target, ENV_T3, -1; 52 | p_param target, ENV_T4, .02; 53 | -------------------------------------------------------------------------------- /data/sfx/pioing1b.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Pioioioioio....ing 1 B 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 32000, 0; 8 | 9 | // Vibrato (w_mod not implemented...) 10 | w_env FREQUENCY, 10; 11 | w_env AMPLITUDE, 1; 12 | w_osc target, SINE, FM; 13 | 14 | w_env AMPLITUDE, 15 | 0, .5, 16 | .1, .8, 17 | .2, .6, 18 | .2, .3, 19 | .4, 0; 20 | w_env FREQUENCY, 21 | 0, 1200, 22 | .01, 440; 23 | w_env MOD1, 24 | 0, .8, 25 | .05, 2.5, 26 | .05, 1.2, 27 | .9, .5; 28 | w_env BALANCE, .45; 29 | w_osc target, SINE, FM; 30 | 31 | w_env AMPLITUDE, 32 | .005, 1, 33 | .03, 1, 34 | .02, 0; 35 | w_env FREQUENCY, 36 | 0, 700, 37 | .05, 220; 38 | w_env MOD1, 39 | 0, 1, 40 | .05, 0; 41 | w_osc target, SINE; 42 | 43 | w_env AMPLITUDE, 0; 44 | w_env MOD1, 0; 45 | w_env FREQUENCY, 2600; 46 | w_filter target, NOTCH_12; 47 | w_env FREQUENCY, 600; 48 | w_filter target, NOTCH_12; 49 | -------------------------------------------------------------------------------- /data/sfx/rockexplo.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Rock Explosion 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 24000; 7 | w_blank target, 24000, 0; 8 | 9 | // Rumble 10 | w_env AMPLITUDE, 11 | 0, 1/4, 12 | .5, 1/8, 13 | .5, 1/16; 14 | w_env FREQUENCY, 15 | 0, 200, 16 | 1, 140; 17 | w_osc target, NOISE; 18 | w_env FREQUENCY, 19 | 0, 200, 20 | .5, 600, 21 | .5, 200; 22 | w_env AMPLITUDE, 1; 23 | w_filter target, LOWPASS_12; 24 | 25 | // Ka-blam 26 | w_env AMPLITUDE, 27 | 0, 1/4, 28 | .5, 1/8, 29 | .5, 1/16; 30 | w_env FREQUENCY, 31 | 0, 1400, 32 | .1, 400, 33 | .1, 1400, 34 | .8, 1700; 35 | w_osc target, NOISE; 36 | w_env FREQUENCY, 37 | 0, 1000, 38 | .1, 200, 39 | .5, 600, 40 | .4, 400; 41 | w_osc target, NOISE; 42 | 43 | // Attack 44 | w_env AMPLITUDE, 45 | 0, 1/4, 46 | .1, 1/16, 47 | .1, 0; 48 | w_env FREQUENCY, 49 | 0, 10000, 50 | .2, 0; 51 | w_osc target, NOISE; 52 | 53 | // Mod 54 | w_env AMPLITUDE, 1; 55 | w_env FREQUENCY, 15; 56 | w_env BALANCE, 57 | 0, .5, 58 | 1, 1; 59 | w_osc target, NOISE, MUL; 60 | 61 | // Resonances 62 | w_env FREQUENCY, 150; 63 | w_env AMPLITUDE, 3; 64 | w_filter target, PEAK_12; 65 | w_env FREQUENCY, 400; 66 | w_env AMPLITUDE, 3; 67 | w_filter target, PEAK_12; 68 | w_env FREQUENCY, 1750; 69 | w_env AMPLITUDE, 2; 70 | w_filter target, PEAK_12; 71 | w_env FREQUENCY, 2100; 72 | w_env AMPLITUDE, 2; 73 | w_filter target, PEAK_12; 74 | w_env FREQUENCY, 3700; 75 | w_env AMPLITUDE, 76 | 0, 3, 77 | 1, 1; 78 | w_filter target, PEAK_12; 79 | 80 | // Treble damping 81 | w_env FREQUENCY, 82 | 0, 24000, 83 | .3, 6000, 84 | .7, 1000; 85 | w_filter target, LOWPASS_6; 86 | 87 | w_env AMPLITUDE, 88 | 0, 1, 89 | 1, .1; 90 | w_gain target; -------------------------------------------------------------------------------- /data/sfx/save_waves.agw: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////// 2 | // Script to write all sounds to disk 3 | // Copyright (C) 2003, 2007 David Olofson 4 | ////////////////////////////////////////// 5 | 6 | #include "kobosfx.h" 7 | 8 | w_save SOUND_LAUNCH, "launch_c.raw"; 9 | w_save SOUND_LAUNCH2, "launch2_c.raw"; 10 | 11 | w_save SOUND_BZZZT, "bzzzt1_c.raw"; 12 | w_save SOUND_GAMEOVER, "gameover1_c.raw"; 13 | 14 | w_save SOUND_EXPLO_NODE1, "explo1b_c.raw"; 15 | w_save SOUND_EXPLO_NODE2, "explo1c_c.raw"; 16 | w_save SOUND_RUMBLE_NODE1, "explo1b-rg_c.raw"; 17 | w_save SOUND_RUMBLE_NODE2, "explo1c-rg_c.raw"; 18 | w_save SOUND_EXPLO_ENEMY1, "explo3d_c.raw"; 19 | w_save SOUND_EXPLO_ENEMY2, "explo4d_c.raw"; 20 | w_save SOUND_EXPLO_PLAYER, "explo6_c.raw"; 21 | w_save SOUND_EXPLO_RING1, "explo5_c.raw"; 22 | w_save SOUND_EXPLO_RING2, "explo5b_c.raw"; 23 | w_save SOUND_EXPLO_RING3, "explo5c_c.raw"; 24 | w_save SOUND_BOMB_DETO, "launch3b_c.raw"; 25 | w_save SOUND_EXPLO_ROCK, "rockexplo_c.raw"; 26 | w_save SOUND_FINE, "cannon1_c.raw"; 27 | w_save SOUND_SHOT_START, "boltfire2s_c.raw"; 28 | w_save SOUND_SHOT, "boltfire2_c.raw"; 29 | w_save SOUND_SHOT_END, "boltfire2e_c.raw"; 30 | w_save SOUND_SHOT_OVERHEAT, "boltfire2o_c.raw"; 31 | w_save SOUND_OVERHEAT, "bleep3_c.raw"; 32 | w_save SOUND_METALLIC1, "klank3_c.raw"; 33 | w_save SOUND_METALLIC2, "klank3b_c.raw"; 34 | w_save SOUND_METALLIC3, "klank3c_c.raw"; 35 | w_save SOUND_DAMAGE, "klank4_c.raw"; 36 | w_save SOUND_CANCEL, "bleep1_c.raw"; 37 | w_save SOUND_PLAY, "metallic7_c.raw"; 38 | w_save SOUND_PAUSE, "metallic7rs_c.raw"; 39 | w_save SOUND_ONEUP, "pioing1b_c.raw"; 40 | w_save SOUND_READY, "schwoop2_c.raw"; 41 | w_save SOUND_MOVE, "schwoom1_c.raw"; 42 | w_save SOUND_HIT1, "impact2_c.raw"; 43 | w_save SOUND_HIT2, "impact2b_c.raw"; 44 | w_save SOUND_HIT3, "impact2c_c.raw"; 45 | w_save SOUND_TICK, "klank2b_c.raw"; 46 | w_save SOUND_BEAM, "zapp1_c.raw"; 47 | w_save SOUND_RING, "schwoop3_c.raw"; 48 | w_save SOUND_ENEMYM, "launch4_c.raw"; 49 | 50 | w_save 16, "aguitar1_c.raw"; 51 | w_save 30, "synbass1_c.raw"; 52 | w_save 50, "snare1_c.raw"; 53 | w_save 55, "edge2_c.raw"; 54 | w_save 58, "bassdrum5_c.raw"; 55 | w_save 60, "claps1_c.raw"; 56 | w_save 63, "noiseburst2_c.raw"; 57 | w_save 74, "phattpad2_c.raw"; 58 | w_save 84, "hardsync1_c.raw"; 59 | w_save 86, "brass2_c.raw"; 60 | w_save 87, "thunder1_c.raw"; 61 | -------------------------------------------------------------------------------- /data/sfx/schwoom1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Schwoom 1 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 8000, 0; 8 | 9 | // Low noise 10 | w_env FREQUENCY, 11 | 0, 1500, 12 | .2, 150; 13 | w_env AMPLITUDE, 14 | .1, .5, 15 | .1, .05, 16 | .1, .01, 17 | .2, 0; 18 | w_osc target, NOISE; 19 | w_env FREQUENCY, 20 | .1, 600, 21 | .1, 150; 22 | w_env AMPLITUDE, 5; 23 | w_filter target, PEAK_12; 24 | 25 | // High noise 26 | w_env FREQUENCY, 8000; 27 | w_env AMPLITUDE, 28 | .05, .2, 29 | .1, 0; 30 | w_osc target, NOISE; 31 | 32 | // Mod 33 | w_env AMPLITUDE, 1; 34 | w_env FREQUENCY, 150; 35 | w_env BALANCE, .5; 36 | w_osc target, NOISE, MUL; 37 | 38 | // Bass 39 | w_env AMPLITUDE, 40 | .05, .5, 41 | .15, .1, 42 | .2, .05, 43 | .1, 0; 44 | w_env MOD1, 45 | 0, 1, 46 | .1, 2.5, 47 | .1, .5, 48 | .3, 0; 49 | w_env FREQUENCY, 50 | 0, 50, 51 | .5, 45; 52 | w_osc target, SINE; 53 | -------------------------------------------------------------------------------- /data/sfx/schwoop2.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Schwoop 2 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 32000, 0; 8 | 9 | w_env AMPLITUDE, 10 | .1, .02, 11 | .8, .1, 12 | .1, 0; 13 | w_env FREQUENCY, 14 | 0, 500, 15 | 1, 1000; 16 | w_osc target, NOISE; 17 | 18 | w_env FREQUENCY, 19 | 0, 2000, 20 | 1, 4000; 21 | w_env AMPLITUDE, 5; 22 | w_env MOD1, 0; 23 | w_filter target, BANDPASS_12; 24 | 25 | w_env AMPLITUDE, 26 | .1, .1, 27 | .8, .2, 28 | .1, 0; 29 | w_env MOD1, 30 | 0, 2, 31 | 1, .5; 32 | w_env FREQUENCY, 33 | 0, 600, 34 | 1, 1200; 35 | w_osc target, SINE; 36 | 37 | w_env AMPLITUDE, 38 | .1, .01, 39 | .8, .1, 40 | .1, 0; 41 | w_env MOD1, 3; 42 | w_env FREQUENCY, 43 | 0, 300, 44 | 1, 600; 45 | w_osc target, SINE; 46 | 47 | w_env AMPLITUDE, 48 | .5, .2, 49 | .5, 0; 50 | w_env MOD1, 51 | .5, 1.5, 52 | .5, 0; 53 | w_env FREQUENCY, 54 | 0, 50, 55 | 1, 48; 56 | w_osc target, SINE; 57 | -------------------------------------------------------------------------------- /data/sfx/schwoop3.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Schwoop 3 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 16000*.4, 0; 8 | 9 | w_env FREQUENCY, 600; 10 | w_env AMPLITUDE, 11 | .1, .1, 12 | .1, 0; 13 | w_osc target, NOISE; 14 | 15 | w_env FREQUENCY, 12000; 16 | w_env AMPLITUDE, 17 | .02, .2, 18 | .1, 0; 19 | w_osc target, NOISE; 20 | 21 | w_env FREQUENCY, 22 | 0, 500, 23 | .1, 800, 24 | .3, 1000; 25 | w_env AMPLITUDE, 30; 26 | w_env MOD1, 27 | .02, .2, 28 | .1, .1, 29 | .1, 0; 30 | w_filter target, BANDPASS_12; 31 | 32 | w_env AMPLITUDE, 33 | .1, .02, 34 | .3, 0; 35 | w_env MOD1, 36 | .2, 1, 37 | .2, 0; 38 | w_env FREQUENCY, 39 | 0, 500, 40 | .1, 800, 41 | .3, 1000; 42 | w_osc target, SINE; 43 | -------------------------------------------------------------------------------- /data/sfx/sfx.agw: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////// 2 | // Sound effect loader script for Kobo Deluxe 3 | // Copyright (C) 2002, 2003, 2007 David Olofson 4 | //////////////////////////////////////////////// 5 | 6 | #include "kobosfx.h" 7 | 8 | procedure load(pid, name, randpitch) 9 | { 10 | wid = pid; 11 | w_load wid, name; 12 | p_param pid, WAVE, wid; 13 | p_param pid, DRIVER, POLY; 14 | p_param pid, RANDPITCH, randpitch; 15 | } 16 | 17 | /* 18 | * New for 0.4-pre7 (David Olofson) 19 | */ 20 | load SOUND_LAUNCH, "launch.agw", .6; 21 | load SOUND_LAUNCH2, "launch2.agw", .2; 22 | 23 | /* 24 | * New for 0.4.0 (David Olofson) 25 | */ 26 | load SOUND_BZZZT, "bzzzt1.agw", .3; 27 | load SOUND_GAMEOVER, "gameover1.agw", .1; 28 | 29 | /* 30 | * New for 0.5.1 (David Olofson) 31 | */ 32 | load SOUND_EXPLO_NODE1, "explo1b.agw", 1; 33 | load SOUND_EXPLO_NODE2, "explo1c.agw", 1; 34 | load SOUND_RUMBLE_NODE1, "explo1b-rg.agw", 2; 35 | load SOUND_RUMBLE_NODE2, "explo1c-rg.agw", 2; 36 | load SOUND_EXPLO_ENEMY1, "explo3d.agw", 2; 37 | load SOUND_EXPLO_ENEMY2, "explo4d.agw", 1; 38 | load SOUND_EXPLO_PLAYER, "explo6.agw", 0; 39 | load SOUND_EXPLO_RING1, "explo5.agw", .5; 40 | load SOUND_EXPLO_RING2, "explo5b.agw", .5; 41 | load SOUND_EXPLO_RING3, "explo5c.agw", .5; 42 | load SOUND_BOMB_DETO, "launch3b.agw", .4; 43 | load SOUND_EXPLO_ROCK, "rockexplo.agw", 2; 44 | load SOUND_FINE, "cannon1.agw", 0; 45 | load SOUND_SHOT_START, "boltfire2s.agw", 1; 46 | load SOUND_SHOT, "boltfire2.agw", 1; 47 | load SOUND_SHOT_END, "boltfire2e.agw", 1; 48 | load SOUND_SHOT_OVERHEAT, "boltfire2o.agw", 1; 49 | load SOUND_OVERHEAT, "bleep3.agw", .1; 50 | load SOUND_METALLIC1, "klank3.agw", .5; 51 | load SOUND_METALLIC2, "klank3b.agw", .5; 52 | load SOUND_METALLIC3, "klank3c.agw", .5; 53 | load SOUND_DAMAGE, "klank4.agw", 0; 54 | load SOUND_CANCEL, "bleep1.agw", .2; 55 | load SOUND_PLAY, "metallic7.agw", 0; 56 | load SOUND_PAUSE, "metallic7rs.agw", 0; 57 | load SOUND_ONEUP, "pioing1b.agw", 0; 58 | load SOUND_READY, "schwoop2.agw", 0; 59 | load SOUND_MOVE, "schwoom1.agw", .5; 60 | load SOUND_HIT1, "impact2.agw", 1.5; 61 | load SOUND_HIT2, "impact2b.agw", 1.5; 62 | load SOUND_HIT3, "impact2c.agw", 1.5; 63 | load SOUND_TICK, "klank2b.agw", 0; 64 | load SOUND_BEAM, "zapp1.agw", 1; 65 | load SOUND_RING, "schwoop3.agw", 1.5; 66 | load SOUND_ENEMYM, "launch4.agw", .5; 67 | -------------------------------------------------------------------------------- /data/sfx/sfx_c.agw: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////// 2 | // Sound effect loader script for Kobo Deluxe 3 | // (Cached version; uses prerendered sounds) 4 | // Copyright (C) 2002, 2003, 2007 David Olofson 5 | //////////////////////////////////////////////// 6 | 7 | #include "kobosfx.h" 8 | 9 | procedure load(pid, name, randpitch) 10 | { 11 | wid = pid; 12 | w_load wid, name; 13 | p_param pid, WAVE, wid; 14 | p_param pid, DRIVER, POLY; 15 | p_param pid, RANDPITCH, randpitch; 16 | } 17 | 18 | load SOUND_LAUNCH, "launch_c.raw", .6; 19 | load SOUND_LAUNCH2, "launch2_c.raw", .2; 20 | 21 | load SOUND_BZZZT, "bzzzt1_c.raw", .3; 22 | load SOUND_GAMEOVER, "gameover1_c.raw", .1; 23 | 24 | load SOUND_EXPLO_NODE1, "explo1b_c.raw", 1; 25 | load SOUND_EXPLO_NODE2, "explo1c_c.raw", 1; 26 | load SOUND_RUMBLE_NODE1, "explo1b-rg_c.raw", 2; 27 | load SOUND_RUMBLE_NODE2, "explo1c-rg_c.raw", 2; 28 | load SOUND_EXPLO_ENEMY1, "explo3d_c.raw", 2; 29 | load SOUND_EXPLO_ENEMY2, "explo4d_c.raw", 1; 30 | load SOUND_EXPLO_PLAYER, "explo6_c.raw", 0; 31 | load SOUND_EXPLO_RING1, "explo5_c.raw", .5; 32 | load SOUND_EXPLO_RING2, "explo5b_c.raw", .5; 33 | load SOUND_EXPLO_RING3, "explo5c_c.raw", .5; 34 | load SOUND_BOMB_DETO, "launch3b_c.raw", .4; 35 | load SOUND_EXPLO_ROCK, "rockexplo_c.raw", 2; 36 | load SOUND_FINE, "cannon1_c.raw", 0; 37 | load SOUND_SHOT_START, "boltfire2s_c.raw", 1; 38 | load SOUND_SHOT, "boltfire2_c.raw", 1; 39 | load SOUND_SHOT_END, "boltfire2e_c.raw", 1; 40 | load SOUND_SHOT_OVERHEAT, "boltfire2o_c.raw", 1; 41 | load SOUND_OVERHEAT, "bleep3_c.raw", .1; 42 | load SOUND_METALLIC1, "klank3_c.raw", .5; 43 | load SOUND_METALLIC2, "klank3b_c.raw", .5; 44 | load SOUND_METALLIC3, "klank3c_c.raw", .5; 45 | load SOUND_DAMAGE, "klank4_c.raw", 0; 46 | load SOUND_CANCEL, "bleep1_c.raw", .2; 47 | load SOUND_PLAY, "metallic7_c.raw", 0; 48 | load SOUND_PAUSE, "metallic7rs_c.raw", 0; 49 | load SOUND_ONEUP, "pioing1b_c.raw", 0; 50 | load SOUND_READY, "schwoop2_c.raw", 0; 51 | load SOUND_MOVE, "schwoom1_c.raw", .5; 52 | load SOUND_HIT1, "impact2_c.raw", 1.5; 53 | load SOUND_HIT2, "impact2b_c.raw", 1.5; 54 | load SOUND_HIT3, "impact2c_c.raw", 1.5; 55 | load SOUND_TICK, "klank2b_c.raw", 0; 56 | load SOUND_BEAM, "zapp1_c.raw", 1; 57 | load SOUND_RING, "schwoop3_c.raw", 1.5; 58 | load SOUND_ENEMYM, "launch4_c.raw", .5; 59 | -------------------------------------------------------------------------------- /data/sfx/sine.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Plain looped sine waveform 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | wid = target; 7 | 8 | w_format wid, MONO16, 33488; 9 | w_blank wid, 128, 1; 10 | 11 | w_env FREQUENCY, 523.25; 12 | w_osc wid, SINE; 13 | 14 | p_param target, WAVE, wid; 15 | p_param target, DRIVER, POLY; 16 | p_param target, ENV_SKIP, 1; 17 | p_param target, ENV_L0, 0; 18 | p_param target, ENV_DELAY, 0; 19 | p_param target, ENV_T1, .001; 20 | p_param target, ENV_L1, 1; 21 | p_param target, ENV_HOLD, .01; 22 | p_param target, ENV_T2, .05; 23 | p_param target, ENV_L2, .5; 24 | p_param target, ENV_T3, -1; 25 | p_param target, ENV_T4, .1; 26 | -------------------------------------------------------------------------------- /data/sfx/snare1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Snare Drum 1 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 32000, 0; 8 | 9 | w_env AMPLITUDE, 10 | 0, .3, 11 | .015, .07, 12 | .08, .013, 13 | .4, .003, 14 | .5, 0; 15 | w_env FREQUENCY, 0, 1200; 16 | w_osc target, NOISE; 17 | w_env FREQUENCY, 0, 4000; 18 | w_osc target, NOISE; 19 | w_env FREQUENCY, 0, 16000; 20 | w_osc target, NOISE; 21 | 22 | w_env MOD1; 23 | w_env AMPLITUDE, 0, 20; 24 | w_env FREQUENCY, 0, 180; 25 | w_filter target, PEAK_12; 26 | w_env AMPLITUDE, 0, 10; 27 | w_env FREQUENCY, 0, 260; 28 | w_filter target, PEAK_12; 29 | 30 | //reverberation shaper 31 | w_env AMPLITUDE, 0, 0; 32 | w_env MOD1, 33 | 0, 1, 34 | .3, .6, 35 | .7, .3; 36 | w_env FREQUENCY, 0, 3500; 37 | w_filter target, LOWPASS_12; 38 | 39 | //attack 40 | w_env AMPLITUDE, 0, 10; 41 | w_env FREQUENCY, 0, 1700; 42 | w_env MOD1, 43 | 0, 0, 44 | .007, 1; 45 | w_filter target, PEAK_12; 46 | -------------------------------------------------------------------------------- /data/sfx/synbass1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Synth Bass 1 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 33488; 7 | w_blank target, 33488, 0; 8 | 9 | //attack 10 | w_env AMPLITUDE, 11 | 0, .5, 12 | .01, .1, 13 | .4, 0; 14 | w_env FREQUENCY, 15 | 0, 4000, 16 | .01, 1000; 17 | w_osc target, NOISE; 18 | 19 | //bass 20 | w_env AMPLITUDE, 21 | 0, .9, 22 | .01, .5, 23 | .49, .3, 24 | .5, 0; 25 | w_env FREQUENCY, 26 | 0, 200, 27 | .01, 65.40625; 28 | w_env MOD1, 29 | 0, 1, 30 | .5, .1, 31 | .5, 0; 32 | w_osc target, SINE; 33 | 34 | //filter 35 | w_env AMPLITUDE, 1; 36 | w_env FREQUENCY, 37 | 0, 1500, 38 | 0.1, 200; 39 | w_env MOD1, 0; 40 | w_filter target, LOWPASS_12; 41 | -------------------------------------------------------------------------------- /data/sfx/test2.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // MIDI Song Loader for "test2.mid" 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | print "Loading \"Test2\"...\n"; 7 | print " Copyright (C) David Olofson, 2002.\n"; 8 | 9 | w_load target, "test2.mid"; 10 | p_param target, WAVE, target; 11 | p_param target, DRIVER, MIDI; 12 | 13 | w_load 32, "sine.agw"; 14 | 15 | print " Done!\n"; 16 | -------------------------------------------------------------------------------- /data/sfx/test2.mid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/sfx/test2.mid -------------------------------------------------------------------------------- /data/sfx/thunder1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Thunder 1 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 16000; 7 | w_blank target, 48000, 0; 8 | 9 | w_env AMPLITUDE, 10 | 0, .1, 11 | 1, 1, 12 | 2, 0; 13 | w_env FREQUENCY, 150; 14 | w_osc target, NOISE; 15 | 16 | w_env FREQUENCY, 150; 17 | w_env AMPLITUDE, 5; 18 | w_filter target, LOWPASS_12; 19 | 20 | w_env AMPLITUDE, 0.80; 21 | w_gain target; 22 | 23 | w_env FREQUENCY, 150; 24 | w_env AMPLITUDE, 0; 25 | w_filter target, LOWPASS_12; 26 | -------------------------------------------------------------------------------- /data/sfx/trance1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // MIDI Song Loader for "trance1.mid" 3 | // Copyright (C) David Olofson, 2002 4 | ///////////////////////////////////////////// 5 | 6 | print "Loading \"Trance1\"...\n"; 7 | print " Copyright (C) David Olofson, 2002.\n"; 8 | 9 | w_load target, "trance1.mid"; 10 | p_param target, WAVE, target; 11 | p_param target, DRIVER, MIDI; 12 | 13 | w_load 16, "aguitar1.agw"; 14 | w_load 30, "synbass1.agw"; 15 | w_load 50, "snare1.agw"; 16 | w_load 55, "edge2.agw"; 17 | w_load 58, "bassdrum5.agw"; 18 | w_load 60, "claps1.agw"; 19 | w_load 63, "noiseburst2.agw"; 20 | w_load 74, "phattpad2.agw"; 21 | w_load 84, "hardsync1.agw"; 22 | w_load 86, "brass2.agw"; 23 | w_load 87, "thunder1.agw"; 24 | 25 | print " Done!\n"; 26 | -------------------------------------------------------------------------------- /data/sfx/trance1.mid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/data/sfx/trance1.mid -------------------------------------------------------------------------------- /data/sfx/trance1_c.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // MIDI Song Loader for "trance1.mid" 3 | // (Cached version; uses prerendered sounds) 4 | // Copyright (C) David Olofson, 2002, 2003 5 | ///////////////////////////////////////////// 6 | 7 | print "Loading \"Trance1\"...\n"; 8 | print " Copyright (C) David Olofson, 2002.\n"; 9 | 10 | w_load target, "trance1.mid"; 11 | p_param target, WAVE, target; 12 | p_param target, DRIVER, MIDI; 13 | 14 | w_load 16, "aguitar1_c.raw"; 15 | w_load 30, "synbass1_c.raw"; 16 | w_load 50, "snare1_c.raw"; 17 | w_load 55, "edge2_c.raw"; 18 | w_load 58, "bassdrum5_c.raw"; 19 | w_load 60, "claps1_c.raw"; 20 | w_load 63, "noiseburst2_c.raw"; 21 | w_load 74, "phattpad2_c.raw"; 22 | w_load 84, "hardsync1_c.raw"; 23 | w_load 86, "brass2_c.raw"; 24 | w_load 87, "thunder1_c.raw"; 25 | 26 | print " Done!\n"; 27 | -------------------------------------------------------------------------------- /data/sfx/zapp1.agw: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////// 2 | // Zapp 1 3 | // Copyright (C) 2007 David Olofson 4 | ///////////////////////////////////////////// 5 | 6 | w_format target, MONO16, 32000; 7 | w_blank target, 3200, 0; 8 | 9 | w_env AMPLITUDE, 1; 10 | w_env FREQUENCY, 120; 11 | w_osc target, SINE; 12 | 13 | w_env AMPLITUDE, 14 | .02, 1, 15 | .03, 1, 16 | .05, 0; 17 | w_env FREQUENCY, 18 | 0, 1500, 19 | .02, 400, 20 | .08, 150; 21 | w_env MOD1, 22 | 0, 1.5, 23 | .1, 0; 24 | w_env BALANCE, 1; 25 | w_osc target, SINE, MUL; 26 | 27 | w_env AMPLITUDE, 0; 28 | w_env MOD1, 0; 29 | w_env FREQUENCY, 2200; 30 | w_filter target, NOTCH_12; 31 | w_env FREQUENCY, 600; 32 | w_filter target, NOTCH_12; 33 | -------------------------------------------------------------------------------- /icons/kobodl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/icons/kobodl.png -------------------------------------------------------------------------------- /icons/net.olofson.kobodeluxe.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Name=Kobo Deluxe 5 | GenericName=Arcade Game 6 | Comment=Arcade style 2D shooter 7 | TryExec=kobodl 8 | Exec=kobodl 9 | Icon=kobodl 10 | Terminal=false 11 | Categories=Application;Game;ArcadeGame;2DGraphics; 12 | -------------------------------------------------------------------------------- /icons/windows/kobodl.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/icons/windows/kobodl.ico -------------------------------------------------------------------------------- /icons/windows/kobodl.rc: -------------------------------------------------------------------------------- 1 | 1 ICON "kobodl.ico" 2 | -------------------------------------------------------------------------------- /install-libs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . ./BUILDDEFS 3 | 4 | # FIXME: Grab libs from system if we build dynamic, but don't build libs here! 5 | 6 | set -ex 7 | 8 | if [ ! -d "${WORKDIR}/libs-build" ]; then 9 | mkdir -p "${WORKDIR}/libs-build" 10 | fi 11 | 12 | rm -rf "${WORKDIR}/linux-bundle-lib" 13 | if [ "${KOBO_STATIC_LINUX}" = true ] ; then 14 | AUTOTOOLS_EXTRA="--enable-static --disable-shared" 15 | LIBPNG_FLAGS="--enable-png --disable-png-shared" 16 | CMAKE_EXTRA="-DBUILD_SHARED_LIBS=OFF" 17 | else 18 | AUTOTOOLS_EXTRA="--disable-static --enable-shared" 19 | LIBPNG_FLAGS="--enable-png --enable-png-shared" 20 | CMAKE_EXTRA="-DBUILD_SHARED_LIBS=ON" 21 | mkdir "${WORKDIR}/linux-bundle-lib" 22 | fi 23 | 24 | cd "${WORKDIR}/libs-build" 25 | 26 | # SDL2 27 | if pkg-config sdl2 --exists; then 28 | echo "SDL2 already installed in the system!" 29 | else 30 | if [ ! -f "SDL2-${SDLRELEASE}.tar.gz" ]; then 31 | curl -O ${SDLURL} 32 | fi 33 | tar -xzvf "SDL2-${SDLRELEASE}.tar.gz" 34 | cd SDL2-${SDLRELEASE} 35 | ./configure --prefix=/usr ${AUTOTOOLS_EXTRA} 36 | make 37 | sudo make install 38 | if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then 39 | cp -L build/.libs/libSDL2-*.so.0 "${WORKDIR}/linux-bundle-lib" 40 | fi 41 | cd .. 42 | fi 43 | 44 | # libPNG 45 | if [ -f "/usr/include/png.h" ]; then 46 | echo "libpng already installed in the system!" 47 | else 48 | if [ ! -f "libpng-${PNGRELEASE}.tar.xz" ]; then 49 | curl -O ${PNGURL} 50 | fi 51 | tar -xf "libpng-${PNGRELEASE}.tar.xz" 52 | cd libpng-${PNGRELEASE} 53 | ./configure --prefix=/usr ${AUTOTOOLS_EXTRA} 54 | make 55 | sudo make install 56 | if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then 57 | cp -L build/.libs/libSDL2-*.so.0 "${WORKDIR}/linux-bundle-lib" 58 | fi 59 | cd .. 60 | fi 61 | 62 | # SDL2_image 63 | if [ -f "/usr/include/SDL2/SDL_image.h" ]; then 64 | echo "SDL2_image already installed in the system!" 65 | else 66 | if [ ! -f "SDL2_image-${IMGRELEASE}.tar.gz" ]; then 67 | curl -O ${IMGURL} 68 | fi 69 | tar -xzvf "SDL2_image-${IMGRELEASE}.tar.gz" 70 | cd SDL2_image-${IMGRELEASE} 71 | ./configure --prefix=/usr ${AUTOTOOLS_EXTRA} ${LIBPNG_FLAGS} --disable-bmp --disable-gif --disable-jpg --disable-jpg-shared --disable-lbm --disable-pcx --disable-pnm --disable-tga --disable-tif --disable-tif-shared --disable-xcf --disable-xpm --disable-xv --disable-webp --disable-webp-shared 72 | make 73 | sudo make install 74 | if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then 75 | cp -L .libs/libSDL2_image-*.so.0 "${WORKDIR}/linux-bundle-lib" 76 | fi 77 | cd .. 78 | fi 79 | 80 | # Audiality 2 81 | if pkg-config audiality2 --exists; then 82 | echo "Audiality 2 already installed in the system!" 83 | else 84 | if [ ! -d "audiality2" ]; then 85 | git clone https://github.com/olofson/audiality2.git 86 | cd audiality2 87 | else 88 | cd audiality2 89 | git checkout master 90 | git pull 91 | fi 92 | git checkout v${A2RELEASE} 93 | ./configure static 94 | cd build/static 95 | make 96 | sudo make install 97 | if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then 98 | cp -L build/src/libaudiality2-*.so.0 "${WORKDIR}/linux-bundle-lib" 99 | fi 100 | cd ../.. 101 | fi 102 | 103 | if [ ! "${KOBO_STATIC_LINUX}" = true ] ; then 104 | strip "${WORKDIR}/linux-bundle-lib/*" 105 | fi 106 | -------------------------------------------------------------------------------- /install-win32-redist: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . ./BUILDDEFS 3 | 4 | if [ ! -d "${WORKDIR}" ]; then 5 | mkdir "${WORKDIR}" 6 | fi 7 | 8 | if [ -d "${WORKDIR}/win32-redist" ]; then 9 | echo "Win32 redistributables (win32-redist) already in place!" 10 | exit 11 | fi 12 | 13 | set -ex 14 | 15 | mkdir "${WORKDIR}/win32-redist" 16 | cd "${WORKDIR}/win32-redist" 17 | 18 | # Grab Win32 DLL package from koboredux.com 19 | wget "${KRHOME}/download/${REDISTARCH}" 20 | tar -xjvf ${REDISTARCH} --strip-components=1 21 | rm ${REDISTARCH} 22 | 23 | # Grab Audiality2 DLL and COPYING file from GitHub 24 | wget "${A2REPO}/releases/download/v${A2RELEASE}/libaudiality2.dll" 25 | wget https://raw.githubusercontent.com/olofson/audiality2/master/LICENSE.txt 26 | awk 'sub("$", "\r")' LICENSE.txt > LICENSE-Audiality2.txt 27 | rm LICENSE.txt 28 | -------------------------------------------------------------------------------- /make-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . ./BUILDDEFS 3 | 4 | shopt -s nullglob 5 | for i in ${BUILDDIR}/* ; do 6 | echo 7 | echo "[ Building $(basename $i) ]" 8 | echo $i 9 | cd $i 10 | make -j20 11 | echo "[ Leaving $(basename $i) ]" 12 | echo 13 | done 14 | -------------------------------------------------------------------------------- /src/cfgform.cpp: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 2001-2003, 2006-2007 David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the 9 | * Free Software Foundation; either version 2 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along 18 | * with this program; if not, write to the Free Software Foundation, Inc., 19 | * 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "kobolog.h" 23 | #include "config.h" 24 | #include "cfgform.h" 25 | #include "kobo.h" 26 | #include "sound.h" 27 | #include "vidmodes.h" 28 | 29 | int global_status = 0; 30 | 31 | 32 | config_form_t::config_form_t() 33 | { 34 | prf = NULL; 35 | stat = 0; 36 | } 37 | 38 | 39 | config_form_t::~config_form_t() 40 | { 41 | } 42 | 43 | 44 | void config_form_t::open(prefs_t *p) 45 | { 46 | init(gengine); 47 | place(wmain->x(), wmain->y(), wmain->width(), wmain->height()); 48 | font(B_NORMAL_FONT); 49 | foreground(wmain->map_rgb(0xffffff)); 50 | background(wmain->map_rgb(0x000000)); 51 | prf = p; 52 | prfbak = *p; 53 | stat = global_status & (OS_RELOAD | OS_RESTART | OS_UPDATE); 54 | build_all(); 55 | } 56 | 57 | 58 | void config_form_t::close() 59 | { 60 | vmm_Close(); 61 | clean(); 62 | } 63 | 64 | 65 | void config_form_t::undo() 66 | { 67 | *prf = prfbak; 68 | undo_hook(); 69 | } 70 | 71 | 72 | int config_form_t::status() 73 | { 74 | return stat; 75 | } 76 | 77 | 78 | void config_form_t::clearstatus(int mask) 79 | { 80 | stat &= ~mask; 81 | global_status = stat & (OS_RELOAD | OS_RESTART | OS_UPDATE); 82 | } 83 | 84 | 85 | void config_form_t::setstatus(int mask) 86 | { 87 | stat |= mask; 88 | global_status = stat & (OS_RELOAD | OS_RESTART | OS_UPDATE); 89 | } 90 | 91 | /*virtual*/ void config_form_t::change(int delta) 92 | { 93 | kobo_form_t::change(delta); 94 | 95 | if(!selected()) 96 | return; 97 | 98 | if(selected()->tag & OS_CLOSE) 99 | { 100 | if(delta == 0) 101 | { 102 | sound.ui_ok(); 103 | setstatus(OS_CLOSE); 104 | } 105 | } 106 | else if(selected()->tag & OS_CANCEL) 107 | { 108 | if(delta == 0) 109 | { 110 | sound.ui_cancel(); 111 | undo(); 112 | setstatus(OS_CLOSE); 113 | } 114 | } 115 | else 116 | sound.ui_tick(); 117 | 118 | if(selected()->user) 119 | prf->changed = 1; 120 | 121 | setstatus(selected()->tag & (OS_RELOAD | OS_RESTART | OS_UPDATE)); 122 | 123 | // If a video mode from the table is selected, get the parameters 124 | // from the video mode manager! 125 | if(prf->videomode) 126 | { 127 | VMM_Mode *m = vmm_FindMode(prf->videomode); 128 | if(m) 129 | { 130 | prf->width = m->width; 131 | prf->height = m->height; 132 | prf->aspect = (int)(m->aspect * 1000.0f + .5f); 133 | } 134 | } 135 | 136 | if(selected()->tag & OS_REBUILD) 137 | { 138 | int sel = selected_index(); 139 | build_all(); 140 | select(sel); 141 | } 142 | } 143 | 144 | /* virtual */void config_form_t::build() 145 | { 146 | } 147 | 148 | /* virtual */ void config_form_t::undo_hook() 149 | { 150 | stat = 0; 151 | global_status = 0; 152 | } 153 | -------------------------------------------------------------------------------- /src/cfgform.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 2001, 2003, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the 9 | * Free Software Foundation; either version 2 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along 18 | * with this program; if not, write to the Free Software Foundation, Inc., 19 | * 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _CONFIG_FORM_H_ 23 | #define _CONFIG_FORM_H_ 24 | 25 | #include "form.h" 26 | #include "prefs.h" 27 | 28 | enum 29 | { 30 | OS_CLOSE = 0x0001, 31 | OS_CANCEL = 0x0002, 32 | OS_REBUILD = 0x0004, 33 | OS_ACTION = 0x000f, 34 | 35 | OS_RELOAD_GRAPHICS = 0x0010, 36 | OS_RELOAD_AUDIO_CACHE = 0x0020, 37 | OS_RELOAD = 0x0070, 38 | 39 | OS_RESTART_VIDEO = 0x0100, 40 | OS_RESTART_AUDIO = 0x0200, 41 | OS_RESTART_ENGINE = 0x0400, 42 | OS_RESTART_INPUT = 0x0800, 43 | OS_RESTART_LOGGER = 0x0080, 44 | OS_RESTART = 0x0f80, 45 | 46 | OS_UPDATE_AUDIO = 0x1000, 47 | OS_UPDATE_ENGINE = 0x2000, 48 | OS_UPDATE = 0xf000 49 | }; 50 | 51 | 52 | class config_form_t : public kobo_form_t 53 | { 54 | protected: 55 | prefs_t *prf; 56 | prefs_t prfbak; 57 | int stat; 58 | public: 59 | config_form_t(); 60 | virtual ~config_form_t(); 61 | void open(prefs_t *p); 62 | virtual void build(); // <-- Override this! 63 | //...and this, if you need. Normally, 64 | //it just sets the status to 0. 65 | virtual void undo_hook(); 66 | void close(); 67 | int status(); 68 | void setstatus(int mask); 69 | void clearstatus(int mask); 70 | void undo(); 71 | void change(int delta); 72 | }; 73 | 74 | extern int global_status; 75 | 76 | #endif //_CONFIG_FORM_H_ 77 | -------------------------------------------------------------------------------- /src/dashboard.h: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 2003, 2007 David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the 9 | * Free Software Foundation; either version 2 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along 18 | * with this program; if not, write to the Free Software Foundation, Inc., 19 | * 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef KOBO_DASHBOARD_H 23 | #define KOBO_DASHBOARD_H 24 | 25 | #include "window.h" 26 | 27 | 28 | /* "Screen" window; takes care of the border, if any. */ 29 | class screen_window_t : public window_t 30 | { 31 | int _top, _left, _right, _bottom; 32 | public: 33 | void border(int top, int left, int right, int bottom); 34 | void refresh(SDL_Rect *r); 35 | }; 36 | 37 | 38 | enum dashboard_modes_t { 39 | DASHBOARD_OFF = 0, 40 | DASHBOARD_BLACK, 41 | DASHBOARD_GAME, 42 | DASHBOARD_LOADING 43 | }; 44 | 45 | /* Dashboard window; dashboard or loading screen. */ 46 | class dashboard_window_t : public window_t 47 | { 48 | char *_msg; 49 | float _percent; 50 | dashboard_modes_t _mode; 51 | int progress_index; 52 | float *progress_table; 53 | Uint32 progress_time; 54 | int progress_bench; 55 | void render_progress(); 56 | public: 57 | dashboard_window_t(); 58 | ~dashboard_window_t(); 59 | void mode(dashboard_modes_t m); 60 | void doing(const char *msg); 61 | void progress_init(float *progtab); 62 | void progress(); 63 | void progress_done(); 64 | /* 65 | * Tools: 66 | * -1: Random tool 67 | * 0: Black 4x4 square 68 | * 1+: Brushes from "brushes.png"; 69 | * 1: Soft black 16 pixel round brush 70 | * 2: (4/8)x4 tilable romboid brush 71 | * 3: Tilable garbage brush 72 | * 4: Vertical "D" brush 73 | */ 74 | void nibble(int tool = -1); 75 | void refresh(SDL_Rect *r); 76 | }; 77 | 78 | 79 | /* Bar graph display */ 80 | class bargraph_t : public window_t 81 | { 82 | float _value; 83 | int _redmax; 84 | int _y; 85 | int _enabled; 86 | public: 87 | bargraph_t(); 88 | void value(float val); 89 | void refresh(SDL_Rect *r); 90 | void redmax(int rm) 91 | { 92 | _redmax = rm; 93 | } 94 | void enable(int ena); 95 | }; 96 | 97 | 98 | #endif /* KOBO_DASHBOARD_H */ 99 | -------------------------------------------------------------------------------- /src/eel/_e_script.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | _e_script.h - EEL source code management (Private) 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _EEL__SCRIPT_H_ 23 | #define _EEL__SCRIPT_H_ 24 | 25 | #include "eel.h" 26 | #include "e_script.h" 27 | 28 | #define MAX_SCRIPTS 256 29 | 30 | typedef struct script_t 31 | { 32 | char *name; 33 | unsigned char *data; 34 | unsigned len; 35 | } script_t; 36 | 37 | extern script_t eel_scripttab[MAX_SCRIPTS]; 38 | 39 | 40 | #endif /*_EEL__SCRIPT_H_*/ 41 | -------------------------------------------------------------------------------- /src/eel/e_builtin.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | e_builtin.c - EEL built-in commands and directives 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _EEL_BUILTIN_H_ 23 | #define _EEL_BUILTIN_H_ 24 | 25 | #include "eel.h" 26 | 27 | /*---------------------------------------------------------- 28 | Command Callbacks 29 | ----------------------------------------------------------*/ 30 | int eel_cmd_end(int argc, struct eel_data_t *argv); 31 | int eel_cmd_set(int argc, struct eel_data_t *argv); 32 | int eel_cmd_print(int argc, struct eel_data_t *argv); 33 | 34 | 35 | /*---------------------------------------------------------- 36 | Operator Callbacks 37 | ----------------------------------------------------------*/ 38 | int eel_op_add(int argc, struct eel_data_t *argv); 39 | int eel_op_sub(int argc, struct eel_data_t *argv); 40 | int eel_op_mul(int argc, struct eel_data_t *argv); 41 | int eel_op_div(int argc, struct eel_data_t *argv); 42 | int eel_op_mod(int argc, struct eel_data_t *argv); 43 | int eel_op_pow(int argc, struct eel_data_t *argv); 44 | 45 | 46 | /*---------------------------------------------------------- 47 | Directive Callbacks 48 | ----------------------------------------------------------*/ 49 | int eel_dir_include(void); 50 | int eel_dir_define(void); 51 | 52 | 53 | /*---------------------------------------------------------- 54 | Special Callbacks 55 | ----------------------------------------------------------*/ 56 | int eel_spec_function(void); 57 | int eel_spec_procedure(void); 58 | 59 | #endif /*_EEL_BUILTIN_H_*/ 60 | -------------------------------------------------------------------------------- /src/eel/e_lexer.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | e_lexer.h - EEL engine lexer 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _EEL_LEXER_H_ 23 | #define _EEL_LEXER_H_ 24 | 25 | #include "eel.h" 26 | 27 | 28 | /*---------------------------------------------------------- 29 | Tokens and Unique User Token management 30 | ----------------------------------------------------------*/ 31 | 32 | /* Errors... */ 33 | #define TK_ERROR -1 /* Lexer complains about something */ 34 | 35 | /* Immediate arguments */ 36 | #define TK_RNUM 300 /* Real number */ 37 | #define TK_INUM 301 /* Integer number */ 38 | #define TK_STRN 302 /* String literal */ 39 | 40 | /* Symbol reference */ 41 | #define TK_SYMREF 303 42 | 43 | /* New symbol */ 44 | #define TK_NEWSYM 304 45 | 46 | #define TK_USER 1024 47 | 48 | int eel_get_unique_token(); 49 | 50 | 51 | /*---------------------------------------------------------- 52 | The Lexer 53 | ----------------------------------------------------------*/ 54 | /* Get next "token" */ 55 | int eel_lex(int report_eoln); 56 | 57 | /* 58 | * Push back last token + lval. 59 | * Works only for *one* token per context! 60 | */ 61 | void eel_unlex(void); 62 | 63 | void eel_lexer_cleanup(void); 64 | 65 | #endif /*_EEL_LEXER_H_*/ 66 | -------------------------------------------------------------------------------- /src/eel/e_path.c: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | e_path.c - EEL file 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | #include "eel.h" 26 | 27 | 28 | /*---------------------------------------------------------- 29 | File System Interface (Hah! :-) 30 | ----------------------------------------------------------*/ 31 | 32 | static char *_eel_path = NULL; 33 | 34 | 35 | void eel_set_path(const char *path) 36 | { 37 | if(_eel_path) 38 | free(_eel_path); 39 | if(path) 40 | _eel_path = strdup(path); 41 | else 42 | _eel_path = NULL; 43 | } 44 | 45 | 46 | const char *eel_path(void) 47 | { 48 | if(!_eel_path) 49 | { 50 | #if defined(WIN32) 51 | eel_set_path(""); 52 | #elif defined(MACOS) 53 | eel_set_path(""); 54 | #else 55 | eel_set_path("./"); 56 | #endif 57 | } 58 | return _eel_path; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /src/eel/e_register.c: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | e_register.c - EEL extension registry 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "e_register.h" 23 | #include "e_symtab.h" 24 | #include "e_lexer.h" 25 | 26 | eel_symbol_t *_register(const char *name, eel_symtypes_t stype, 27 | eel_datatypes_t type) 28 | { 29 | eel_symbol_t *s = eel_s_new(name, stype); 30 | if(!s) 31 | return (eel_symbol_t *)0; 32 | s->data.type = type; 33 | return s; 34 | } 35 | 36 | 37 | int eel_register_operator(const char *name, eel_operator_cb_t handler, 38 | int priority, int retargs, int preargs) 39 | { 40 | eel_symbol_t *s = _register(name, EST_OPERATOR, EDT_OPERATOR); 41 | if(!s) 42 | return -1; 43 | 44 | s->token = eel_get_unique_token(); 45 | s->data.value.op.priority = priority; 46 | s->data.value.op.retargs = retargs; 47 | s->data.value.op.preargs = preargs; 48 | s->data.value.op.cb = handler; 49 | return s->token; 50 | } 51 | 52 | 53 | int eel_register_enum_class(void) 54 | { 55 | return eel_get_unique_token(); 56 | } 57 | 58 | 59 | int eel_register_enum(int eclass, const char *name, int value) 60 | { 61 | eel_symbol_t *s = _register(name, EST_ENUM, EDT_INTEGER); 62 | if(!s) 63 | return -1; 64 | s->token = eclass; 65 | s->data.value.i = value; 66 | return 0; 67 | } 68 | 69 | 70 | int eel_register_directive(const char *name, eel_parser_cb_t parser) 71 | { 72 | eel_symbol_t *s = _register(name, EST_DIRECTIVE, EDT_DIRECTIVE); 73 | if(!s) 74 | return -1; 75 | s->token = eel_get_unique_token(); 76 | s->data.value.parse = parser; 77 | return 0; 78 | } 79 | 80 | 81 | int eel_register_special(const char *name, eel_parser_cb_t parser) 82 | { 83 | eel_symbol_t *s = _register(name, EST_SPECIAL, EDT_SPECIAL); 84 | if(!s) 85 | return -1; 86 | s->token = eel_get_unique_token(); 87 | s->data.value.parse = parser; 88 | return 0; 89 | } 90 | -------------------------------------------------------------------------------- /src/eel/e_register.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | e_register.h - EEL extension registry 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _EEL_REGISTER_H_ 23 | #define _EEL_REGISTER_H_ 24 | 25 | #include "eel.h" 26 | 27 | /*---------------------------------------------------------- 28 | Language Extension API 29 | ----------------------------------------------------------*/ 30 | 31 | /* 32 | * Register an EEL operator. ("The real thing") 33 | * 34 | * (This is the "direct to the metal" interface; you may want 35 | * to use eel_register_cmd_operator(), eel_register_func_operator() 36 | * or eel_register_math_operator() instead most of the time.) 37 | * 38 | * The callback should check the types and number of 39 | * arguments (easily done with eel_get_args()), and return 40 | * 1 upon success, -1 in case of an error, or 0 if the script 41 | * should be terminated. 42 | * 43 | * Operator precendence in expressions is controlled by means 44 | * of operator priorities specified when operators are 45 | * registered. EEL built-in operators also have priorities, 46 | * and these are of course put in relation to the ones 47 | * specified for extension operators; 48 | * '=' (assignment) 0 (always lowest) 49 | * '+' '-' (add, sub) 10 50 | * '*' '/' '%' (mul, div, mod) 20 51 | * '^' (power) 30 52 | * (command and function operators) 100 53 | * 54 | * 'retargs' is the number of return arguments, and 'preargs' 55 | * is the number of arguments that must be placed *before* the 56 | * operator token. (Only normal, "post operator token" argument 57 | * lists can be variable length!) 58 | * 59 | * The return value is the command's unique token, or a 60 | * negative value upon failure. 61 | */ 62 | int eel_register_operator(const char *name, eel_operator_cb_t handler, 63 | int priority, int retargs, int preargs); 64 | 65 | /* Register a new enum class. The unique token is returned. */ 66 | int eel_register_enum_class(void); 67 | 68 | /* 69 | * Add enum constant to specified enum class. 70 | * 71 | * A negative value is returned if the operation fails. 72 | */ 73 | int eel_register_enum(int eclass, const char *name, int value); 74 | 75 | /* 76 | * Register a directive. 77 | * 78 | * A directive is similar to a command, but can optionally be 79 | * invoked with a '#' before it's name. It does argument 80 | * parsing itself, which provides more detailed control. 81 | * 82 | * A negative value is returned if the operation fails. 83 | */ 84 | int eel_register_directive(const char *name, int (*parser)(void)); 85 | 86 | /* 87 | * Register a special. 88 | * 89 | * A special does argument parsing itself, like a directive, 90 | * but the # syntax is not valid. 91 | * 92 | * A negative value is returned if the operation fails. 93 | */ 94 | int eel_register_special(const char *name, int (*parser)(void)); 95 | 96 | #endif /*_EEL_REGISTER_H_*/ 97 | -------------------------------------------------------------------------------- /src/eel/e_script.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | e_script.h - EEL source code management (API) 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _EEL_SCRIPT_H_ 23 | #define _EEL_SCRIPT_H_ 24 | 25 | int eel_load(const char *filename); 26 | int eel_load_from_mem(const char *script, unsigned len); 27 | void eel_free(int handle); 28 | 29 | #endif /*_EEL_SCRIPT_H_*/ 30 | -------------------------------------------------------------------------------- /src/eel/e_util.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | e_util.h - EEL engine utilities 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _EEL_UTIL_H_ 23 | #define _EEL_UTIL_H_ 24 | 25 | #include 26 | #include "eel.h" 27 | 28 | 29 | /*---------------------------------------------------------- 30 | "stdio" style API for raw memory buffers 31 | ----------------------------------------------------------*/ 32 | 33 | typedef struct bio_file_t 34 | { 35 | unsigned char *data; 36 | int len; 37 | int pos; 38 | } bio_file_t; 39 | 40 | bio_file_t *bio_open(void *data, int len); 41 | bio_file_t *bio_clone(bio_file_t *bio); 42 | void bio_close(bio_file_t *bio); 43 | 44 | /* Get the next character from the buffer */ 45 | static inline int bio_getchar(bio_file_t *bio) 46 | { 47 | if(bio->pos < bio->len) 48 | return bio->data[bio->pos++]; 49 | else 50 | return EOF; 51 | } 52 | 53 | /* Push last character back */ 54 | static inline void bio_ungetc(bio_file_t *bio) 55 | { 56 | if(bio->pos > 0) 57 | --bio->pos; 58 | } 59 | 60 | /* 61 | * Get the current source buffer position 62 | */ 63 | static inline int bio_tell(bio_file_t *bio) 64 | { 65 | return bio->pos; 66 | } 67 | 68 | /* 69 | * Set the current source buffer position 70 | */ 71 | int bio_seek(bio_file_t *bio, int offset, int whence); 72 | 73 | /* 74 | * Read 'count' bytes from the source code, 75 | * starting at the current position, into 76 | * 'buf'. Returns the number of bytes 77 | * actually read. 78 | */ 79 | int bio_read(bio_file_t *bio, char *buf, int count); 80 | 81 | double bio_strtod(bio_file_t *bio); 82 | 83 | 84 | /*---------------------------------------------------------- 85 | Context management ("VM stack") 86 | ------------------------------------------------------------ 87 | * This supports skipping between scripts, and also keeps 88 | * track of the arg count for error messages. 89 | */ 90 | 91 | typedef struct eel_context_t 92 | { 93 | struct eel_context_t *previous; 94 | bio_file_t *bio; 95 | int script; 96 | int arg; 97 | int unlexed; 98 | int token; 99 | eel_data_t *lval; 100 | } eel_context_t; 101 | 102 | extern eel_context_t eel_current; 103 | 104 | void eel_push_context(void); 105 | void eel_pop_context(void); 106 | 107 | #endif /*_EEL_UTIL_H_*/ 108 | -------------------------------------------------------------------------------- /src/eel/eel-comp-src.txt: -------------------------------------------------------------------------------- 1 | 2 | The "EEL Compressed Source" file format 3 | --------------------------------------- 4 | 5 | EEL Compressed Source files are EEL source files stripped of 6 | all comments and formatting information. They are tokenized 7 | using an external dictionary, which contains all keywords of 8 | EEL and extensions, and any project names. Immediate values 9 | are encoded using an extended "variable length number" BCD 10 | format. 11 | 12 | * EEL Compressed Source files should have the extension 13 | ".eec" instead of the normal ".eel", for reliable 14 | identification, and to avoid accidentally overwriting 15 | source files with compressed source files. (That would 16 | be nasty, as the compression is destructive WRT comments, 17 | symbol names and code formatting...) 18 | 19 | * The files are based on 4 bit words. Wider words (8 or 16 20 | bits) are *not* aligned to 8 or 16 bits, but start 21 | directly at the current 4 bit word position. 22 | 23 | * There are two modes: XASCII and XBCD. Decoding of a file 24 | starts in the XASCII mode. XASCII codes are 8 bits, and 25 | XBCD codes are 4 bits. 26 | 27 | * The file starts with an 8 bit version code for the EEL 28 | dictionary to use. Then follows a list of 4 byte EEL 29 | extension IDs, terminated by a 0 byte. The EEL extension 30 | IDs are of the form "XXXv", where "XXX" is an acronym 31 | identifying the extension, and "v" is the version of the 32 | extension dictionary to use. 33 | 34 | Any extension ID that doesn't math any known EEL 35 | extension is assumed to be a Local Dictionary name. 36 | ".eed" will be appended to the full 4 byte string (no 37 | version code), and then EEL will try to find a file by 38 | that name and load it as a Local Dictionary. 39 | 40 | * A Local Dictionary file consists of a 32 bit little 41 | endian integer that holds the number of tokens needed 42 | by the dictionary, *optionally* followed by a list of 43 | null terminated ASCII strings, holding the human 44 | readable names of all tokens. (The token name list is 45 | useful when mixing compressed source with ASCII source 46 | during development.) 47 | 48 | * Token values are allocated from 0 and up as 49 | dictionaries are loaded. This is why there are 50 | extension version numbers in the dictionary lists - 51 | and it should also make it obvious that EEL extensions 52 | must only *add* to their dictionaries if compatibility 53 | with old compressed sources is to be maintained. 54 | 55 | * XASCII code: 56 | 0-14 XBCD code + enter XBCD mode 57 | 58 | 15 Local token dictionary follows 59 | 16 8 bit character follows 60 | 17 Null terminated 8 bit quoted string 61 | 18 Quoted 8 bit Pascal string follows 62 | 19 Quoted 8 bit Pascal string continued 63 | 20 64 | 21 65 | 22 66 | 23 67 | 24 68 | 25 69 | 26 70 | 27 71 | 28 72 | 29 73 | 30 74 | 31 75 | 76 | 32-127 Standard 7 bit ASCII (copied as is) 77 | 78 | 128-191 Short Tokens 79 | 192-254 Extended Tokens (8 extra bits follow) 80 | 255 Wide Tokens (16 extra bits follow) 81 | 82 | * XBCD code: 83 | 0-9 Decimal numbers 0-9 84 | 10 Decimal point (.) 85 | 11 Unary minus (-) 86 | 12 Argument separator/white space 87 | 13 Statement terminator (;) 88 | 14 Single XASCII character follows 89 | 15 Switch to XASCII mode 90 | -------------------------------------------------------------------------------- /src/eel/eel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/src/eel/eel.h -------------------------------------------------------------------------------- /src/filemap.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/src/filemap.cpp -------------------------------------------------------------------------------- /src/form.h: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 2001, 2007 David Olofson 6 | * Copyright (C) 2005 Erik Auerswald 7 | * 8 | * This program is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by the 10 | * Free Software Foundation; either version 2 of the License, or (at your 11 | * option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; if not, write to the Free Software Foundation, Inc., 20 | * 675 Mass Ave, Cambridge, MA 02139, USA. 21 | */ 22 | 23 | #ifndef _KOBO_FORM_H_ 24 | #define _KOBO_FORM_H_ 25 | 26 | #include "toolkit.h" 27 | #include "cfgparse.h" 28 | 29 | #define LINE_H 9 30 | #define SPACE_SIZE 7 31 | 32 | #define BIG_LINE_H 18 33 | #define BIG_SPACE_SIZE 14 34 | 35 | class kobo_form_t : public ct_form_t 36 | { 37 | config_parser_t *_data; 38 | //Called by build_all(). 39 | void begin(); 40 | void end(); 41 | protected: 42 | ct_widget_t *current_widget; 43 | ct_list_t *current_list; 44 | int ypos; 45 | int _big; 46 | float xoffs; 47 | ct_align_t halign; 48 | virtual void init_widget(ct_widget_t *wg); 49 | 50 | //Toolkit 51 | void big(); 52 | void medium(); 53 | void small(); 54 | void label(const char *cap); 55 | void yesno(const char *cap, int *var, int tag = 0); 56 | void onoff(const char *cap, int *var, int tag = 0); 57 | void spin(const char *cap, int *var, int min, int max, 58 | const char *unit, int tag = 0); 59 | void button(const char *cap, int tag = 0); 60 | void space(int lines = 1); 61 | 62 | //config_parser_t aware version! :-) 63 | void data(config_parser_t *_d); 64 | void editor(int handle, int tag = 0); 65 | void editor(const char *name, int tag = 0); 66 | 67 | //List tools 68 | void list(const char *cap, int *var, int tag = 0); 69 | void item(const char *cap, int value, int ind = 0); 70 | void perc_list(int first, int last, int step); 71 | void enum_list(int first, int last); 72 | 73 | //Internal wrapper for build() 74 | void build_all(); 75 | public: 76 | kobo_form_t(); 77 | virtual ~kobo_form_t(); 78 | void next(); 79 | void prev(); 80 | virtual void change(int delta); 81 | virtual void build(); 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /src/game.cpp: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 2002, 2007 David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the 9 | * Free Software Foundation; either version 2 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along 18 | * with this program; if not, write to the Free Software Foundation, Inc., 19 | * 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "config.h" 23 | #include "game.h" 24 | 25 | game_t game; 26 | 27 | 28 | game_t::game_t() 29 | { 30 | reset(); 31 | } 32 | 33 | 34 | void game_t::reset() 35 | { 36 | set(GAME_SINGLE, SKILL_CLASSIC); 37 | } 38 | 39 | 40 | void game_t::set(game_types_t tp, skill_levels_t sk) 41 | { 42 | type = tp; 43 | skill = sk; 44 | 45 | // Game and player 46 | speed = 30; 47 | lives = 5; 48 | bonus_first = 2000; 49 | bonus_every = 3000; 50 | health = 1; 51 | health_fade = 5; 52 | damage = 0; 53 | bolts = 10; 54 | bolt_damage = 20; 55 | noseloadtime = 1; 56 | noseheatup = 0; 57 | nosecooling = 256; 58 | altfire = 0; 59 | tailloadtime = 1; 60 | tailheatup = 0; 61 | tailcooling = 256; 62 | 63 | // Enemies 64 | rock_health = 255 * bolt_damage; 65 | rock_damage = 1000; 66 | 67 | switch(skill) 68 | { 69 | case SKILL_CLASSIC: 70 | break; 71 | case SKILL_NEWBIE: 72 | speed = 40; 73 | lives = 5; 74 | bonus_first = 5000; 75 | bonus_every = 7000; 76 | health = 100; 77 | damage = 100; 78 | bolts = MAX_BOLTS; 79 | noseloadtime = 1; 80 | noseheatup = 14; 81 | nosecooling = 5; 82 | tailloadtime = 0; 83 | tailheatup = 7; 84 | tailcooling = 5; 85 | altfire = 1; 86 | rock_health = 200; 87 | rock_damage = 50; 88 | break; 89 | case SKILL_GAMER: 90 | speed = 30; 91 | lives = 5; 92 | bonus_first = 8000; 93 | bonus_every = 8000; 94 | health = 60; 95 | damage = 100; 96 | bolts = MAX_BOLTS; 97 | noseloadtime = 0; 98 | noseheatup = 10; 99 | nosecooling = 5; 100 | tailloadtime = 1; 101 | tailheatup = 20; 102 | tailcooling = 5; 103 | rock_health = 500; 104 | rock_damage = 50; 105 | break; 106 | case SKILL_ELITE: 107 | speed = 27; 108 | lives = 4; 109 | bonus_first = 10000; 110 | bonus_every = 10000; 111 | health = 50; 112 | damage = 50; 113 | bolts = MAX_BOLTS; 114 | noseloadtime = 1; 115 | noseheatup = 26; 116 | nosecooling = 5; 117 | tailloadtime = 2; 118 | tailheatup = 39; 119 | tailcooling = 5; 120 | break; 121 | case SKILL_GOD: 122 | default: 123 | speed = 25; 124 | lives = 3; 125 | bonus_first = 10000; 126 | bonus_every = 10000; 127 | health = 40; 128 | damage = 30; 129 | bolts = MAX_BOLTS; 130 | noseloadtime = 1; 131 | noseheatup = 30; 132 | nosecooling = 5; 133 | tailloadtime = 2; 134 | tailheatup = 45; 135 | tailcooling = 5; 136 | break; 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /src/game.h: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 2002, 2007 David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the 9 | * Free Software Foundation; either version 2 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along 18 | * with this program; if not, write to the Free Software Foundation, Inc., 19 | * 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _KOBO_GAME_H_ 23 | #define _KOBO_GAME_H_ 24 | 25 | // Max number of player bolts flying 26 | #define MAX_BOLTS 40 27 | 28 | enum game_types_t 29 | { 30 | GAME_UNKNOWN = -1, 31 | GAME_SINGLE, 32 | GAME_SINGLE_NEW, 33 | GAME_COOPERATIVE, 34 | GAME_DEATHMATCH, 35 | GAME_EXPERIMENTAL = 0x10000000 // Testing! No official highscores. 36 | }; 37 | 38 | 39 | enum skill_levels_t 40 | { 41 | SKILL_UNKNOWN = -1, 42 | SKILL_CLASSIC, 43 | SKILL_NEWBIE, 44 | SKILL_GAMER, 45 | SKILL_ELITE, 46 | SKILL_GOD 47 | }; 48 | 49 | class game_t 50 | { 51 | public: 52 | int type; 53 | int skill; 54 | int speed; // ms per logic frame 55 | int lives; // When starting new games of certain types 56 | int bonus_first; // First bonus ship at this score 57 | int bonus_every; // New bonus ship every N points 58 | int health; // Initial health 59 | int health_fade; // Health fade period (logic frames/unit) 60 | int damage; // Damage player inflicts when colliding with 61 | // another object 62 | int bolts; // maximum active at a time 63 | int noseloadtime; // logic frames per nose shot 64 | int noseheatup; // nose cannon heatup per shot 65 | int nosecooling; // nose cannon cooling speed 66 | int altfire; // use wing mounted cannons and stuff 67 | int tailloadtime; // logic frames per tail shot 68 | int tailheatup; // tail cannon heatup per shot 69 | int tailcooling; // tail cannon cooling speed 70 | int bolt_damage; // Damage inflicted by player fire bolt 71 | 72 | // Enemies 73 | int rock_health; 74 | int rock_damage; 75 | 76 | game_t(); 77 | void reset(); 78 | void set(game_types_t tp, skill_levels_t sk); 79 | }; 80 | 81 | extern game_t game; 82 | 83 | #endif /*_KOBO_GAME_H_*/ 84 | -------------------------------------------------------------------------------- /src/gamectl.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 1995, 1996, Akira Higuchi 6 | * Copyright (C) 2001, 2002, 2006, David Olofson 7 | * 8 | * This program is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by the 10 | * Free Software Foundation; either version 2 of the License, or (at your 11 | * option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; if not, write to the Free Software Foundation, Inc., 20 | * 675 Mass Ave, Cambridge, MA 02139, USA. 21 | */ 22 | 23 | #ifndef _KOBO_GAMECTL_H_ 24 | #define _KOBO_GAMECTL_H_ 25 | 26 | #include "glSDL.h" 27 | #include "config.h" 28 | 29 | #define KEY_KP_DOWN SDLK_KP2 30 | #define KEY_KP_LEFT SDLK_KP4 31 | #define KEY_KP_UP SDLK_KP8 32 | #define KEY_KP_RIGHT SDLK_KP6 33 | #define KEY_KP_DL SDLK_KP1 34 | #define KEY_KP_DR SDLK_KP3 35 | #define KEY_KP_UL SDLK_KP7 36 | #define KEY_KP_UR SDLK_KP9 37 | 38 | 39 | enum buttons_t 40 | { 41 | BTN_UP, //Joystick, arrows, numpad etc 42 | BTN_DOWN, 43 | BTN_LEFT, 44 | BTN_RIGHT, 45 | BTN_UL, 46 | BTN_UR, 47 | BTN_DL, 48 | BTN_DR, 49 | 50 | BTN_INC, // + 51 | BTN_DEC, // - 52 | 53 | BTN_NEXT, // PageUp 54 | BTN_PREV, // PageDn 55 | 56 | BTN_YES, // 'Y' 57 | BTN_NO, // 'N' 58 | 59 | BTN_FIRE, //ctrl, fire button, mouse button,... 60 | BTN_START, //Space 61 | BTN_SELECT, //Return, enter,... 62 | BTN_EXIT, //ESC 63 | BTN_PAUSE, //Pause or P; also used as an internal event. 64 | BTN_CLOSE, //Window close button, ALT-F4,... 65 | BTN_BACK, //Backspace 66 | 67 | BTN_F1, //Function keys 68 | BTN_F2, 69 | BTN_F3, 70 | BTN_F4, 71 | 72 | BTN_F5, 73 | BTN_F6, 74 | BTN_F7, 75 | BTN_F8, 76 | 77 | BTN_F9, 78 | BTN_F10, 79 | BTN_F11, 80 | BTN_F12 81 | }; 82 | 83 | 84 | enum mousemodes_t 85 | { 86 | MMD_OFF = 0, 87 | MMD_CROSSHAIR, 88 | MMD_RELATIVE 89 | }; 90 | 91 | 92 | class gamecontrol_t 93 | { 94 | static int r_delay, r_interval; 95 | static int afire; 96 | static int space; 97 | static int left, up, down, right, ul, ur, dl, dr; 98 | static int shot; 99 | static int direction, new_direction; 100 | static int latch_timer; 101 | static int movekey_pressed; 102 | static void change(); 103 | public: 104 | gamecontrol_t(); 105 | static void init(int always_fire); 106 | static void repeat(int delay, int interval); 107 | static void clear(); 108 | static int map(SDLKey sym); 109 | static void process(); // Call every frame! 110 | static void press(int k); 111 | static void release(int k); 112 | static void mouse_press(int n); 113 | static void mouse_release(int n); 114 | static void mouse_position(int h, int v); 115 | static inline int dir() { return direction; } 116 | static inline int get_shot() { return shot || afire; } 117 | static inline int dir_push() { return movekey_pressed; } 118 | }; 119 | 120 | extern gamecontrol_t gamecontrol; 121 | 122 | #endif //_KOBO_KEY_H_ 123 | -------------------------------------------------------------------------------- /src/gamestate.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | ------------------------------------------------------------ 3 | Game State Manager 4 | ------------------------------------------------------------ 5 | * Copyright (C) 2001-2003, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _GAMESTATEMANAGER_H_ 23 | #define _GAMESTATEMANAGER_H_ 24 | 25 | class gamestatemanager_t; 26 | 27 | class gamestate_t 28 | { 29 | friend class gamestatemanager_t; 30 | private: 31 | gamestate_t *next; //LIFO stack 32 | gamestatemanager_t *manager; 33 | protected: 34 | const char *name; 35 | int unicode; //for last press()/release() 36 | void pop(); 37 | 38 | virtual void press(int button); 39 | virtual void release(int button); 40 | virtual void pos(int x, int y); 41 | virtual void delta(int dx, int dy); 42 | 43 | virtual void enter(); 44 | virtual void leave(); 45 | virtual void yield(); 46 | virtual void reenter(); 47 | 48 | virtual void frame(); //Control system stuff 49 | virtual void pre_render(); //Background rendering 50 | virtual void post_render(); //Foreground rendering 51 | public: 52 | gamestate_t(); 53 | virtual ~gamestate_t(); 54 | }; 55 | 56 | 57 | class gamestatemanager_t 58 | { 59 | private: 60 | gamestate_t *top; //Stack top 61 | public: 62 | gamestatemanager_t(); 63 | ~gamestatemanager_t(); 64 | 65 | /* Event router interface */ 66 | void press(int button, int unicode = 0); 67 | void release(int button, int unicode = 0); 68 | void pos(int x, int y); 69 | void delta(int dx, int dy); 70 | 71 | /* CS frame and rendering callbacks */ 72 | void frame(); 73 | void pre_render(); 74 | void post_render(); 75 | 76 | /* State management */ 77 | void change(gamestate_t *gs); 78 | void push(gamestate_t *gs); 79 | void pop(); 80 | gamestate_t *current(); 81 | gamestate_t *previous(); 82 | }; 83 | 84 | #endif /*_GAMESTATEMANAGER_H_*/ 85 | -------------------------------------------------------------------------------- /src/graphics/display.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/src/graphics/display.cpp -------------------------------------------------------------------------------- /src/graphics/display.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/src/graphics/display.h -------------------------------------------------------------------------------- /src/graphics/region.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | ---------------------------------------------------------------------- 3 | region.h - Graphics Engine 4 | ---------------------------------------------------------------------- 5 | * Copyright (C) 2007 David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef KOBO_REGION_H 23 | #define KOBO_REGION_H 24 | 25 | #include "glSDL.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* 32 | * Region 33 | * Describes an area as a number of pixel spaced rows, 34 | * each containing zero or more spans on the form . 35 | */ 36 | typedef struct RGN_region 37 | { 38 | int rows; 39 | Uint16 **spans; 40 | } RGN_region; 41 | 42 | /* Construct region by scanning an SDL surface */ 43 | RGN_region *RGN_ScanMask(SDL_Surface *src, Uint32 key); 44 | 45 | /* Free a region */ 46 | void RGN_FreeRegion(RGN_region *rgn); 47 | 48 | /* Set target for region rendering */ 49 | void RGN_Target(SDL_Surface *tgt); 50 | 51 | /* Select and position region for subsequent operations */ 52 | void RGN_SetRegion(RGN_region *rgn, int xpos, int ypos); 53 | 54 | /* Blit to region! */ 55 | int RGN_Blit(SDL_Surface *src, SDL_Rect *sr, int x, int y); 56 | 57 | #ifdef __cplusplus 58 | }; 59 | #endif 60 | 61 | #endif /* KOBO_REGION_H */ 62 | -------------------------------------------------------------------------------- /src/graphics/sofont.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/src/graphics/sofont.h -------------------------------------------------------------------------------- /src/graphics/vidmodes.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | vidmodes.h - Video Mode Manager for Kobo Deluxe 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2007 David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef KOBO_VIDMODES_H 23 | #define KOBO_VIDMODES_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | 30 | /*------------------------------------------------------------------------- 31 | Data Types and Structures 32 | -------------------------------------------------------------------------*/ 33 | 34 | typedef enum 35 | { 36 | VMM_ALL = 0xffffffff, 37 | VMM_DETECT = 0x00000001, /* Available modes as detected by SDL */ 38 | VMM_4_3 = 0x00000010, /* 4:3 modes */ 39 | VMM_3_2 = 0x00000020, /* 3:2 modes */ 40 | VMM_5_4 = 0x00000040, /* 5:4 modes */ 41 | VMM_16_10 = 0x00000080, /* 16:10 modes */ 42 | VMM_16_9 = 0x00000100, /* 16:9 modes */ 43 | VMM_PC = 0x00010000, /* Standard PC/Mac modes */ 44 | VMM_WPC = 0x00020000, /* Widescreen PC/Mac modes */ 45 | VMM_TV = 0x00040000, /* Standard TV modes */ 46 | VMM_WTV = 0x00080000, /* Widescreen TV modes */ 47 | VMM_LORES = 0x10000000 /* Special low resolution modes */ 48 | } VMM_Flags; 49 | 50 | 51 | typedef struct VMM_Mode VMM_Mode; 52 | struct VMM_Mode 53 | { 54 | VMM_Mode *next; /* Next mode in list */ 55 | char *name; /* Name, if any */ 56 | int id; /* Somewhat constant mode ID */ 57 | int width; /* Display width in pixels */ 58 | int height; /* Display height in pixels */ 59 | int flags; /* (WMM_Flags) */ 60 | float aspect; /* Pixel aspect ratio */ 61 | }; 62 | 63 | 64 | /*------------------------------------------------------------------------- 65 | Gathering and constructing modes 66 | -------------------------------------------------------------------------*/ 67 | int vmm_Init(int show, int hide); 68 | void vmm_Close(void); 69 | 70 | 71 | /*------------------------------------------------------------------------- 72 | Scanning 73 | -------------------------------------------------------------------------*/ 74 | VMM_Mode *vmm_First(void); 75 | VMM_Mode *vmm_Next(VMM_Mode *current); 76 | 77 | 78 | /*------------------------------------------------------------------------- 79 | Indexing 80 | -------------------------------------------------------------------------*/ 81 | VMM_Mode *vmm_FindMode(int id); 82 | 83 | 84 | /*------------------------------------------------------------------------- 85 | Searching 86 | -------------------------------------------------------------------------*/ 87 | /* TODO: VMM_Mode *vmm_Find(int width, int height, int aspect); */ 88 | 89 | #ifdef __cplusplus 90 | }; 91 | #endif 92 | 93 | #endif /* KOBO_VIDMODES_H */ 94 | -------------------------------------------------------------------------------- /src/kobolog.h: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - Logger definitions 4 | ------------------------------------------------------------ 5 | * Copyright (C) 2003, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the 9 | * Free Software Foundation; either version 2 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along 18 | * with this program; if not, write to the Free Software Foundation, Inc., 19 | * 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef KOBOLOG_H 23 | #define KOBOLOG_H 24 | 25 | #include "logger.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Critical error messages: "Huston, we have a problem." */ 32 | #define CELOG 5 33 | 34 | /* Debug messages; level 2: Detailed */ 35 | #define D2LOG 6 36 | 37 | /* Debug messages; level 3: Deep Hack Mode stuff */ 38 | #define D3LOG 7 39 | 40 | #ifdef __cplusplus 41 | }; 42 | #endif 43 | 44 | #endif /* KOBOLOG_H */ 45 | -------------------------------------------------------------------------------- /src/map.h: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 1995, 1996 Akira Higuchi 6 | * Copyright (C) 2002, 2007 David Olofson 7 | * 8 | * This program is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by the 10 | * Free Software Foundation; either version 2 of the License, or (at your 11 | * option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; if not, write to the Free Software Foundation, Inc., 20 | * 675 Mass Ave, Cambridge, MA 02139, USA. 21 | */ 22 | 23 | #ifndef XKOBO_H_MAP 24 | #define XKOBO_H_MAP 25 | 26 | #include "config.h" 27 | 28 | #define SITE_MAX 1024 29 | 30 | #define WALL 1 31 | 32 | // Tile state bits 33 | #define U_MASK (1<<0) 34 | #define R_MASK (1<<1) 35 | #define D_MASK (1<<2) 36 | #define L_MASK (1<<3) 37 | #define CORE (1<<4) 38 | #define HIT_MASK (CORE | U_MASK | R_MASK | D_MASK | L_MASK) 39 | #define HARD (1<<5) 40 | #define SPACE (1<<6) 41 | #define MAP_BITS(x) ((x) & 0xff) 42 | 43 | #define IS_SPACE(x) ((x) & SPACE) 44 | 45 | class _map 46 | { 47 | public: 48 | void init(); 49 | void make_maze(int x, int y, int difx, int dify); 50 | void convert(unsigned ratio); /* ratio < 64 */ 51 | inline unsigned short &pos(int x, int y) 52 | { 53 | x &= MAP_SIZEX - 1; 54 | y &= MAP_SIZEY - 1; 55 | return data[(y << MAP_SIZEX_LOG2) + x]; 56 | } 57 | void clearpos(int x, int y); 58 | protected: 59 | int sitex[SITE_MAX]; 60 | int sitey[SITE_MAX]; 61 | int site_max; 62 | unsigned short data[1 << (MAP_SIZEX_LOG2 + MAP_SIZEY_LOG2)]; 63 | int maze_pop(); 64 | void maze_push(int x, int y); 65 | void maze_move_and_push(int x, int y, int d); 66 | int maze_judge(int cx, int cy, int dx, int dy, int x, int y); 67 | }; 68 | 69 | #endif // XKOBO_H_MAP 70 | -------------------------------------------------------------------------------- /src/myship.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 1995, 1996, Akira Higuchi 6 | * Copyright (C) 2001, 2003, 2007 David Olofson 7 | * 8 | * This program is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by the 10 | * Free Software Foundation; either version 2 of the License, or (at your 11 | * option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; if not, write to the Free Software Foundation, Inc., 20 | * 675 Mass Ave, Cambridge, MA 02139, USA. 21 | */ 22 | 23 | #ifndef XKOBO_H_MYSHIP 24 | #define XKOBO_H_MYSHIP 25 | 26 | #include "config.h" 27 | #include "gfxengine.h" 28 | #include "game.h" 29 | 30 | #define ABS(x) (((x)>=0) ? (x) : (-(x))) 31 | #define MAX(x,y) (((x)>(y)) ? (x) : (y)) 32 | 33 | //---------------------------------------------------------------------------// 34 | enum _myship_state 35 | { 36 | normal, 37 | dead 38 | }; 39 | 40 | class _myship 41 | { 42 | static _myship_state _state; 43 | static int di; /* direction */ 44 | static int virtx, virty; /* scroll position */ 45 | static int x, y; 46 | static int _health; 47 | static int health_time; 48 | static int explo_time; 49 | static int nose_reload_timer; 50 | static int nose_temperature; 51 | static int nose_alt; 52 | static int tail_reload_timer; 53 | static int tail_temperature; 54 | static int tail_alt; 55 | static int lapx, lapy; 56 | static int boltx[MAX_BOLTS], bolty[MAX_BOLTS]; 57 | static int boltdx[MAX_BOLTS], boltdy[MAX_BOLTS]; 58 | static int boltst[MAX_BOLTS]; 59 | /* For the gfxengine connection */ 60 | static cs_obj_t *object; 61 | static cs_obj_t *bolt_objects[MAX_BOLTS]; 62 | static cs_obj_t *crosshair; 63 | static void state(_myship_state s); 64 | static void shot_single(int i, int dir, int offset); 65 | static void apply_position(); 66 | static void explode(int x, int y); 67 | public: 68 | _myship(); 69 | static inline int get_x() 70 | { 71 | return x; 72 | } 73 | static inline int get_y() 74 | { 75 | return y; 76 | } 77 | static inline int get_virtx() 78 | { 79 | return virtx; 80 | } 81 | static inline int get_virty() 82 | { 83 | return virty; 84 | } 85 | static inline int get_nose_temp() 86 | { 87 | return nose_temperature; 88 | } 89 | static inline int get_tail_temp() 90 | { 91 | return tail_temperature; 92 | } 93 | static int init(); 94 | static void off(); 95 | static int move(); 96 | static int put(); 97 | static void put_crosshair(); 98 | static int xkobo_shot(); 99 | static int nose_fire(); 100 | static int tail_fire(); 101 | static int hit_structure(); 102 | static int hit_bolt(int ex, int ey, int hitsize, int health); 103 | static void hit(int dmg); 104 | static int health() { return _health; } 105 | static void health(int h) { _health = h; } 106 | static void health_bonus(int h); 107 | static void set_position(int px, int py); 108 | static int alive() { return _state == normal; } 109 | }; 110 | 111 | extern _myship myship; 112 | 113 | #endif // XKOBO_H_MYSHIP 114 | -------------------------------------------------------------------------------- /src/options.h: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 2001, 2003, 2007 David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the 9 | * Free Software Foundation; either version 2 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along 18 | * with this program; if not, write to the Free Software Foundation, Inc., 19 | * 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _KOBO_OPTIONS_H_ 23 | #define _KOBO_OPTIONS_H_ 24 | 25 | #include "cfgform.h" 26 | #include "vidmodes.h" 27 | 28 | class system_options_t : public config_form_t 29 | { 30 | public: 31 | void build(); 32 | }; 33 | 34 | class video_options_t : public config_form_t 35 | { 36 | int showmodes; 37 | int showlow; 38 | int firstbuild; 39 | public: 40 | video_options_t() 41 | { 42 | showmodes = VMM_PC; 43 | showlow = 0; 44 | firstbuild = 1; 45 | } 46 | void build(); 47 | }; 48 | 49 | class graphics_options_t : public config_form_t 50 | { 51 | public: 52 | void build(); 53 | }; 54 | 55 | class audio_options_t : public config_form_t 56 | { 57 | public: 58 | void build(); 59 | void undo_hook(); 60 | }; 61 | 62 | class control_options_t : public config_form_t 63 | { 64 | public: 65 | void build(); 66 | }; 67 | 68 | class game_options_t : public config_form_t 69 | { 70 | public: 71 | void build(); 72 | void undo_hook(); 73 | }; 74 | 75 | #endif //_KOBO_OPTIONS_H_ 76 | -------------------------------------------------------------------------------- /src/radar.h: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 1995, 1996 Akira Higuchi 6 | * Copyright (C) 2001-2003, 2005-2007 David Olofson 7 | * 8 | * This program is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by the 10 | * Free Software Foundation; either version 2 of the License, or (at your 11 | * option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; if not, write to the Free Software Foundation, Inc., 20 | * 675 Mass Ave, Cambridge, MA 02139, USA. 21 | */ 22 | 23 | #ifndef KOBO_RADAR_H 24 | #define KOBO_RADAR_H 25 | 26 | #include "window.h" 27 | 28 | enum radar_modes_t 29 | { 30 | RM__REINIT, // Reinitialize (lost windows etc) 31 | RM_OFF, // Gray, empty 32 | RM_RADAR, // Radar display 33 | RM_SHOW, // Show map (no player ship cursor) 34 | RM_NOISE, // Radar interference 35 | RM_INFO // Scrolling info display 36 | }; 37 | 38 | // The off-screen map window 39 | class radar_map_t : public window_t 40 | { 41 | public: 42 | int w, h; //Map size (tiles) 43 | Uint32 pixel_core; //Pixel colors 44 | Uint32 pixel_launcher; 45 | Uint32 pixel_hard; 46 | Uint32 pixel_bg; 47 | radar_map_t(); 48 | void refresh(SDL_Rect *r); 49 | void update(int x, int y, int force); //Update one tile 50 | }; 51 | 52 | // The on-screen radar window 53 | class radar_window_t : public window_t 54 | { 55 | radar_modes_t _mode; 56 | int old_scrollradar; //To detect prefs change 57 | int xpos, ypos; //Player position (tiles) 58 | int xoffs, yoffs; //Scroll offset (tiles) 59 | int pxoffs, pyoffs; //Scroll offset for player marker 60 | int platched; //p*offset latched yet? 61 | int time; //for delta time calc 62 | int refresh_pos; //Sweeping refresh posn 63 | void sweep(); //Incremental sweeping refresh 64 | void radar(); //Drive any actual radar mode 65 | void noise(); //Render noise effect 66 | void set_scroll(int xs, int ys);//Set map scroll offset 67 | public: 68 | radar_window_t(); 69 | void refresh(SDL_Rect *r); 70 | void mode(radar_modes_t newmode);//Set radar mode 71 | void update(int mx, int my); //Update map + radar 72 | void update_player(int px, int py);//Update player cursor 73 | void frame(); //Track player, drive logic etc... 74 | }; 75 | 76 | #endif // KOBO_RADAR_H 77 | -------------------------------------------------------------------------------- /src/random.cpp: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 1995, 1996, Akira Higuchi 6 | * Copyright (C) 2002, David Olofson 7 | * 8 | * This program is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by the 10 | * Free Software Foundation; either version 2 of the License, or (at your 11 | * option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; if not, write to the Free Software Foundation, Inc., 20 | * 675 Mass Ave, Cambridge, MA 02139, USA. 21 | */ 22 | 23 | #include "random.h" 24 | 25 | rand_num_t gamerand; 26 | rand_num_t pubrand; 27 | -------------------------------------------------------------------------------- /src/random.h: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 1995, 1996, Akira Higuchi 6 | * Copyright (C) 2002, 2007 David Olofson 7 | * 8 | * This program is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by the 10 | * Free Software Foundation; either version 2 of the License, or (at your 11 | * option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; if not, write to the Free Software Foundation, Inc., 20 | * 675 Mass Ave, Cambridge, MA 02139, USA. 21 | */ 22 | 23 | #ifndef _KOBO_RANDOM_H_ 24 | #define _KOBO_RANDOM_H_ 25 | 26 | #include 27 | #include "glSDL.h" 28 | 29 | class rand_num_t 30 | { 31 | Uint32 seed; 32 | public: 33 | void init(Uint32 _seed = 0) 34 | { 35 | if(_seed) 36 | seed = _seed; 37 | else 38 | seed = SDL_GetTicks(); 39 | } 40 | Uint32 get_seed() { return seed; } 41 | Uint32 get() 42 | { 43 | seed *= 1566083941UL; 44 | seed++; 45 | seed &= 0xffffffffUL; 46 | return seed; 47 | } 48 | Uint32 get(Uint32 bit) 49 | { 50 | seed *= 1566083941UL; 51 | seed++; 52 | seed &= 0xffffffffUL; 53 | return (seed >> (32 - bit)); 54 | } 55 | }; 56 | 57 | //This instance is *ONLY* for map generation and 58 | //pure game AI stuff!!! Stealing numbers from here 59 | //will screw up demo playback totally, as demos 60 | //record only the seed used for each level; not 61 | //every random number used. 62 | extern rand_num_t gamerand; 63 | 64 | //Use this "public" random number generator for 65 | //other stuff, like explosion effects, and things 66 | //that may pick different amounts of numbers 67 | //depending on engine version, configuration, 68 | //computer speed and the like. 69 | extern rand_num_t pubrand; 70 | 71 | #endif //_KOBO_RANDOM_H_ 72 | -------------------------------------------------------------------------------- /src/scenes.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * XKOBO, a video-oriented game 4 | * Copyright (C) 1995,1996 Akira Higuchi 5 | * a-higuti@math.hokudai.ac.jp 6 | * Copyright (C) 2006, 2007 David Olofson 7 | * 8 | * This program is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by the 10 | * Free Software Foundation; either version 2 of the License, or (at your 11 | * option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; if not, write to the Free Software Foundation, Inc., 20 | * 675 Mass Ave, Cambridge, MA 02139, USA. 21 | * 22 | */ 23 | 24 | #ifndef XKOBO_H_SCENES 25 | #define XKOBO_H_SCENES 26 | 27 | #include "config.h" 28 | #include "enemies.h" 29 | 30 | #define SCENE_ENEMY_MAX 20 31 | #define SCENE_BASE_MAX 40 32 | 33 | struct enemy_set 34 | { 35 | const enemy_kind *kind; 36 | int num; 37 | int speed; 38 | }; 39 | 40 | struct _base 41 | { 42 | int x, y, h, v; 43 | }; 44 | 45 | struct _scene 46 | { 47 | int ratio; 48 | int startx; 49 | int starty; 50 | const enemy_kind *ek1; 51 | int ek1_interval; 52 | const enemy_kind *ek2; 53 | int ek2_interval; 54 | int enemy_max; 55 | enemy_set enemy[SCENE_ENEMY_MAX]; 56 | int base_max; 57 | _base base[SCENE_BASE_MAX]; 58 | }; 59 | 60 | extern const _scene scene[]; 61 | 62 | #endif // XKOBO_H_SCENES 63 | -------------------------------------------------------------------------------- /src/screen.h: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | ------------------------------------------------------------ 3 | Kobo Deluxe - An enhanced SDL port of XKobo 4 | ------------------------------------------------------------ 5 | * Copyright (C) 1995, 1996 Akira Higuchi 6 | * Copyright (C) 2001-2003, 2007 David Olofson 7 | * 8 | * This program is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU General Public License as published by the 10 | * Free Software Foundation; either version 2 of the License, or (at your 11 | * option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; if not, write to the Free Software Foundation, Inc., 20 | * 675 Mass Ave, Cambridge, MA 02139, USA. 21 | */ 22 | 23 | #ifndef _KOBO_SCREEN_H_ 24 | #define _KOBO_SCREEN_H_ 25 | 26 | #include "map.h" 27 | #include "radar.h" 28 | 29 | #define STAR_COLORS 16 30 | #define STAR_ZBITS 10 31 | #define STAR_Z0 256 32 | 33 | class window_t; 34 | 35 | struct KOBO_Star 36 | { 37 | short x; 38 | short y; 39 | unsigned short z; 40 | }; 41 | 42 | class _screen 43 | { 44 | protected: 45 | static int scene_num; 46 | static int level; 47 | static int generate_count; 48 | static _map map; 49 | static int scene_max; 50 | static int show_title; 51 | static int do_noise; 52 | static float _fps; 53 | static float scroller_speed; 54 | static float target_speed; 55 | static int noise_y; 56 | static int noise_h; 57 | static int noise_source; 58 | static float noise_fade; 59 | static float noise_bright; 60 | static float noise_depth; 61 | static int highlight_y; 62 | static int highlight_h; 63 | static int hi_sc[10]; 64 | static int hi_st[10]; 65 | static char hi_nm[10][20]; 66 | static int nstars; 67 | static KOBO_Star *stars; 68 | static Uint32 starcolors[STAR_COLORS]; 69 | static int star_oxo; 70 | static int star_oyo; 71 | static void render_noise(window_t *win); 72 | static void render_highlight(window_t *win); 73 | static void render_title_plasma(int t, float fade, int y, int h); 74 | static void render_title_noise(float fade, int y, int h, int bank, int frame); 75 | static void render_starfield(window_t *win, int xo, int yo); 76 | public: 77 | ~_screen(); 78 | static radar_modes_t radar_mode; // Last set radar mode 79 | static void init(); 80 | static void init_scene(int sc); 81 | static int prepare(); 82 | static void generate_fixed_enemies(); 83 | static inline int get_map(int x, int y) 84 | { 85 | return map.pos(x, y); 86 | } 87 | static void set_map(int x, int y, int n); 88 | static void set_highlight(int y, int h); 89 | static void set_noise(int source, float fade, float bright, float depth); 90 | static void render_background(window_t * win); 91 | static void render_fx(window_t * win); 92 | static void title(int t, float fade, int mode); 93 | static void init_highscores(); 94 | static void highscores(int t, float fade); 95 | static void credits(int t); 96 | static void help(int t); 97 | static void scroller(); 98 | static void fps(float f); 99 | static float fps() { return _fps; } 100 | static void noise(int on); 101 | }; 102 | 103 | extern _screen screen; 104 | 105 | #endif //_KOBO_SCREEN_H_ 106 | -------------------------------------------------------------------------------- /src/sound/a_bus.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_bus.h - Audio Engine bus 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _A_BUS_H_ 23 | #define _A_BUS_H_ 24 | 25 | #include "a_globals.h" 26 | #include "a_types.h" 27 | #include "a_plugin.h" 28 | #include "a_filters.h" 29 | 30 | typedef struct 31 | { 32 | /* Control */ 33 | abcbank_t bctl[AUDIO_MAX_INSERTS+1]; 34 | 35 | /* DC filter (applied before all sends and inserts) */ 36 | dcf6s_t dcfilter; 37 | 38 | int in_use; /* Set by whoever sends to the bus */ 39 | 40 | /* Insert FX plugins */ 41 | audio_plugin_t insert[AUDIO_MAX_INSERTS]; 42 | } audio_bus_t; 43 | 44 | void audio_bus_open(void); 45 | void audio_bus_close(void); 46 | 47 | void bus_process_all(int *bufs[], int *master, unsigned frames); 48 | void bus_ctl_set(unsigned bus, unsigned slot, unsigned ctl, int arg); 49 | 50 | #endif /*_A_BUS_H_*/ 51 | -------------------------------------------------------------------------------- /src/sound/a_commands.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | asynccmd.h - Asynchronous Command Interface for the audio engine 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001-2003, 2007 David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _ASYNCCMD_H_ 23 | #define _ASYNCCMD_H_ 24 | 25 | #include "sfifo.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #define MAX_COMMANDS 128 32 | 33 | /*---------------------------------------------------------- 34 | Asynchronous command interface stuff 35 | ----------------------------------------------------------*/ 36 | 37 | typedef struct 38 | { 39 | enum 40 | { 41 | CMD_STOP = 0, 42 | CMD_STOP_ALL, 43 | CMD_PLAY, 44 | CMD_CCONTROL, /* Channel Control */ 45 | CMD_GCONTROL, /* Group Control */ 46 | CMD_MCONTROL, /* Mixer Control */ 47 | CMD_WAIT /* Advance Audio Time */ 48 | } action; 49 | signed char cid; 50 | unsigned char index; 51 | int tag; 52 | int arg1; 53 | int arg2; 54 | } command_t; 55 | 56 | extern sfifo_t commands; 57 | 58 | 59 | /*---------------------------------------------------------- 60 | Mixer Control 61 | ----------------------------------------------------------*/ 62 | void audio_bus_controlf(unsigned bus, unsigned slot, unsigned ctl, float arg); 63 | void audio_bus_control(unsigned bus, unsigned slot, unsigned ctl, int arg); 64 | 65 | 66 | /*---------------------------------------------------------- 67 | Group Control 68 | ----------------------------------------------------------*/ 69 | //void audio_group_default(unsigned gid, unsigned ctl, int arg); 70 | 71 | void audio_group_stop(unsigned gid); 72 | void audio_group_controlf(unsigned gid, unsigned ctl, float arg); 73 | void audio_group_control(unsigned gid, unsigned ctl, int arg); 74 | 75 | 76 | /*---------------------------------------------------------- 77 | Channel Control 78 | ----------------------------------------------------------*/ 79 | void audio_channel_play(int cid, int tag, int pitch, int velocity); 80 | void audio_channel_controlf(int cid, int tag, int ctl, float arg); 81 | void audio_channel_control(int cid, int tag, int ctl, int arg); 82 | void audio_channel_stop(int cid, int tag); /* -1 to stop all */ 83 | 84 | /* 85 | FIXME: Broken API. Broken implementation. It just "seems" to work. 86 | */ 87 | int audio_channel_playing(int cid); 88 | 89 | /* 90 | * Set audio time for subsequent calls to 'ms'. 91 | */ 92 | void audio_bump(unsigned ms); 93 | 94 | #ifdef __cplusplus 95 | }; 96 | #endif 97 | 98 | #endif /*_ASYNCCMD_H_*/ 99 | -------------------------------------------------------------------------------- /src/sound/a_control.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_control.h - Group/Channel/Voice Control Implementation 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _A_CONTROL_H_ 23 | #define _A_CONTROL_H_ 24 | 25 | #include 26 | #include "a_struct.h" 27 | 28 | 29 | /*---------------------------------------------------------- 30 | Tools 31 | ----------------------------------------------------------*/ 32 | 33 | /* Controller bank copy macros */ 34 | static inline void acc_copy(accbank_t *to, accbank_t *from, 35 | unsigned first, unsigned last) 36 | { 37 | memcpy(to + first, from + first, (last - first + 1) * sizeof(int)); 38 | } 39 | 40 | static inline void acc_copya(accbank_t *to, accbank_t *from) 41 | { 42 | memcpy(to, from, sizeof(accbank_t)); 43 | } 44 | 45 | #define ACC_IS_FIXEDPOINT(x) (((x) >= ACC_PAN) && ((x) <= ACC_Z)) 46 | 47 | #define ACC_NOTRANSFORM_FIRST ACC_GROUP 48 | #define ACC_NOTRANSFORM_LAST ACC_SEND_BUS 49 | #define case_ACC_NOTRANSFORM \ 50 | case ACC_GROUP: \ 51 | case ACC_PRIORITY: \ 52 | case ACC_PATCH: \ 53 | case ACC_PRIM_BUS: \ 54 | case ACC_SEND_BUS 55 | #define for_ACC_NOTRANSFORM(x) \ 56 | for(x = ACC_NOTRANSFORM_FIRST; x <= ACC_NOTRANSFORM_LAST; ++x) 57 | 58 | #define ACC_ADDTRANSFORM_FIRST ACC_PAN 59 | #define ACC_ADDTRANSFORM_LAST ACC_PITCH 60 | #define case_ACC_ADDTRANSFORM \ 61 | case ACC_PAN: \ 62 | case ACC_PITCH 63 | #define for_ACC_ADDTRANSFORM(x) \ 64 | for(x = ACC_ADDTRANSFORM_FIRST; x <= ACC_ADDTRANSFORM_LAST; ++x) 65 | extern const int addtrans_min[2]; 66 | extern const int addtrans_max[2]; 67 | extern const int addtrans_bias[2]; 68 | 69 | #define ACC_MULTRANSFORM_FIRST ACC_VOLUME 70 | #define ACC_MULTRANSFORM_LAST ACC_SEND 71 | #define case_ACC_MULTRANSFORM \ 72 | case ACC_VOLUME: \ 73 | case ACC_SEND 74 | #define for_ACC_MULTRANSFORM(x) \ 75 | for(x = ACC_MULTRANSFORM_FIRST; x <= ACC_MULTRANSFORM_LAST; ++x) 76 | 77 | 78 | /*---------------------------------------------------------- 79 | Group Control 80 | ----------------------------------------------------------*/ 81 | 82 | /* 83 | * Set a group control, and update all channels that belong 84 | * to the group. (Expensive!) 85 | */ 86 | void acc_group_set(unsigned gid, unsigned ctl, int arg); 87 | 88 | void audio_group_open(void); 89 | void audio_group_close(void); 90 | 91 | #endif /*_A_CONTROL_H_*/ 92 | -------------------------------------------------------------------------------- /src/sound/a_globals.c: -------------------------------------------------------------------------------- 1 | /*(GPL) 2 | --------------------------------------------------------------------------- 3 | audio_p.c - Private global audio engine stuff 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the 9 | * Free Software Foundation; either version 2.1 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along 18 | * with this program; if not, write to the Free Software Foundation, Inc., 19 | * 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "a_globals.h" 23 | 24 | /* For debug oscilloscope */ 25 | #ifdef DEBUG 26 | int *oscbufl = NULL; 27 | int *oscbufr = NULL; 28 | int oscframes = 0; 29 | int oscpos = 0; 30 | #endif 31 | 32 | int _audio_running = 0; 33 | 34 | 35 | /* Global engine settings: defaults */ 36 | struct settings_t a_settings = { 37 | 44100, /* samplerate */ 38 | 256, /* output_buffersize */ 39 | 32, /* buffersize */ 40 | AQ_HIGH /* quality */ 41 | }; 42 | 43 | 44 | /* 45 | * Default control values 46 | */ 47 | accbank_t a_channel_def_ctl = { 48 | 0, /* ACC_GROUP */ 49 | 1000, /* ACC_PRIORITY */ 50 | 0, /* ACC_PATCH */ 51 | 52 | 0, /* ACC_PRIM_BUS */ 53 | -1, /* ACC_SEND_BUS [Off] */ 54 | 55 | 0, /* ACC_PAN [0.0] */ 56 | 60<<16, /* ACC_PITCH [1.0 * sample_rate] */ 57 | 58 | 65536, /* ACC_VOLUME [1.0] */ 59 | 0, /* ACC_SEND [0.0] */ 60 | 61 | 0, /* ACC_MOD1 [0.0] */ 62 | 0, /* ACC_MOD2 [0.0] */ 63 | 0, /* ACC_MOD3 [0.0] */ 64 | 65 | 0, /* ACC_X [0.0] */ 66 | 0, /* ACC_Y [0.0] */ 67 | 0 /* ACC_Z [0.0] */ 68 | }; 69 | 70 | accbank_t a_group_def_ctl = { 71 | 0, /* ACC_GROUP */ 72 | 1000, /* ACC_PRIORITY */ 73 | 0, /* ACC_PATCH */ 74 | 75 | 0, /* ACC_PRIM_BUS */ 76 | -1, /* ACC_SEND_BUS [Off] */ 77 | 78 | 0, /* ACC_PAN [0.0] */ 79 | 60<<16, /* ACC_PITCH [1.0 * sample_rate] */ 80 | 81 | 65536, /* ACC_VOLUME [1.0] */ 82 | 65536, /* ACC_SEND [1.0] */ 83 | 84 | 0, /* ACC_MOD1 [0.0] */ 85 | 0, /* ACC_MOD2 [0.0] */ 86 | 0, /* ACC_MOD3 [0.0] */ 87 | 88 | 0, /* ACC_X [0.0] */ 89 | 0, /* ACC_Y [0.0] */ 90 | 0 /* ACC_Z [0.0] */ 91 | }; 92 | 93 | 94 | abcbank_t a_bus_def_ctl = { 95 | 0, /* ABC_FX_TYPE[None - allpass] */ 96 | 0, /* ABC_FX_PARAM_1 */ 97 | 0, /* ABC_FX_PARAM_2 */ 98 | 0, /* ABC_FX_PARAM_3 */ 99 | 0, /* ABC_FX_PARAM_4 */ 100 | 0, /* ABC_FX_PARAM_5 */ 101 | 0, /* ABC_FX_PARAM_6 */ 102 | 103 | 0, /* ABC_SEND_MASTER */ 104 | 105 | 0, /* ABC_SEND_BUS_0 */ 106 | 0, /* ABC_SEND_BUS_1 */ 107 | 0, /* ABC_SEND_BUS_2 */ 108 | 0, /* ABC_SEND_BUS_3 */ 109 | 0, /* ABC_SEND_BUS_4 */ 110 | 0, /* ABC_SEND_BUS_5 */ 111 | 0, /* ABC_SEND_BUS_6 */ 112 | 0 /* ABC_SEND_BUS_7 */ 113 | }; 114 | -------------------------------------------------------------------------------- /src/sound/a_limiter.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_limiter.h - Simple limiter 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001. 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _A_LIMITER_H_ 23 | #define _A_LIMITER_H_ 24 | 25 | typedef struct limiter_t 26 | { 27 | int samplerate; 28 | unsigned threshold; /* Reaction threshold */ 29 | int release; /* Release "speed" */ 30 | unsigned peak; /* Filtered peak value */ 31 | unsigned attenuation; /* Current output attenuation */ 32 | } limiter_t; 33 | 34 | enum lim_params_t 35 | { 36 | LIM_THRESHOLD = 0, /* 16 bit sample units */ 37 | LIM_RELEASE /* Units per second */ 38 | }; 39 | 40 | 41 | int lim_open(limiter_t *lim, int samplerate); 42 | void lim_close(limiter_t *lim); 43 | 44 | void lim_control(limiter_t *lim, int param, int value); 45 | 46 | /* 47 | * Limiter stereo process function. 48 | * Supports in-place processing. 49 | */ 50 | void lims_process(limiter_t *lim, int *in, int *out, unsigned frames); 51 | 52 | /* 53 | * Smart Stereo version. 54 | * 55 | * This algorithm takes both channels in account in a way 56 | * that reduces the effect of the center appearing to have 57 | * more power after compression of signals with unbalanced 58 | * stereo images. 59 | * 60 | * A dead center signal can only get 3 dB louder than the 61 | * same signal in one channel only, as opposed to the 62 | * normal 6 dB of a limiter that only looks at max(L, R). 63 | * 64 | * Meanwhile, with "normal" material (ie most power 65 | * relatively centered), this limiter gets an extra 3 dB 66 | * compared to a limiter that checks (L+R). 67 | */ 68 | void limss_process(limiter_t *lim, int *in, int *out, unsigned frames); 69 | 70 | #endif /*_A_LIMITER_H_*/ 71 | -------------------------------------------------------------------------------- /src/sound/a_math.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_math.h - Currently just to make sure we have M_PI... 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | 23 | #ifndef _A_MATH_H_ 24 | #define _A_MATH_H_ 25 | 26 | #include 27 | 28 | #ifndef M_PI 29 | # define M_PI 3.14159265358979323846 /* pi */ 30 | #endif 31 | 32 | #endif /*_A_MATH_H_*/ 33 | -------------------------------------------------------------------------------- /src/sound/a_midi.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_midi.h - midi_socket_t MIDI Input Driver for OSS or ALSA 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _A_MIDI_H_ 23 | #define _A_MIDI_H_ 24 | 25 | #include "a_midisock.h" 26 | 27 | /* 28 | * Define if you'd like to layer with 29 | * an external synth or something... 30 | */ 31 | #undef MIDI_THRU 32 | 33 | #define MIDIMAXBYTES 1024 34 | 35 | 36 | int midi_open(midisock_t *output); 37 | void midi_close(void); 38 | 39 | void midi_process(void); 40 | 41 | #endif /*_A_MIDI_H_*/ 42 | -------------------------------------------------------------------------------- /src/sound/a_midicon.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_midicon.h - Engine MIDI Control Implementation 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001. 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _A_MIDICON_H_ 23 | #define _A_MIDICON_H_ 24 | 25 | #include "a_midisock.h" 26 | 27 | int midicon_open(float framerate, int first_ch); 28 | void midicon_close(void); 29 | 30 | void midicon_process(unsigned frames); 31 | 32 | /* Send MIDI messages here. */ 33 | extern midisock_t midicon_midisock; 34 | 35 | #endif /*_A_MIDICON_H_*/ 36 | -------------------------------------------------------------------------------- /src/sound/a_midifile.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/olofson/kobodeluxe/943aa38f941e4f463863d56c8aac6f23a2ef663b/src/sound/a_midifile.c -------------------------------------------------------------------------------- /src/sound/a_midisock.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_midisock.h - Generic Interface for Modular MIDI Management 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | /* 23 | * TODO: System messages. 24 | */ 25 | 26 | #ifndef _A_MIDISOCK_H_ 27 | #define _A_MIDISOCK_H_ 28 | 29 | /* Note: NULL pointers are used for callbacks not desired. */ 30 | typedef struct midisock_t 31 | { 32 | void (*note_off)(unsigned ch, unsigned pitch, unsigned vel); 33 | void (*note_on)(unsigned ch, unsigned pitch, unsigned vel); 34 | void (*poly_pressure)(unsigned ch, unsigned pitch, unsigned press); 35 | void (*control_change)(unsigned ch, unsigned ctrl, unsigned amt); 36 | void (*program_change)(unsigned ch, unsigned prog); 37 | void (*channel_pressure)(unsigned ch, unsigned press); 38 | void (*pitch_bend)(unsigned ch, int amt); 39 | } midisock_t; 40 | 41 | /* These two can be assumed to have all callbacks defined - no NULLs. */ 42 | extern midisock_t dummy_midisock; /* NOP */ 43 | extern midisock_t monitor_midisock; /* printf()s MIDI messages as text */ 44 | 45 | #endif /*_A_MIDISOCK_H_*/ 46 | -------------------------------------------------------------------------------- /src/sound/a_patch.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_patch.h - Audio Engine "instrument" definitions 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _A_PATCH_H_ 23 | #define _A_PATCH_H_ 24 | 25 | #include "a_globals.h" 26 | #include "a_types.h" 27 | #include "a_events.h" 28 | #include "eel.h" 29 | 30 | /*---------------------------------------------------------- 31 | Audio Patch 32 | ----------------------------------------------------------*/ 33 | struct audio_channel_t; 34 | 35 | typedef struct audio_patch_t 36 | { 37 | appbank_t param; 38 | 39 | /* 40 | * Process input events, update internal state and 41 | * generate output events for 'frames' frames. 42 | * 43 | * IMPORTANT! 44 | * The engine may occasionally call this 45 | * function with a 0 'frames' argument. This 46 | * doesn't mean "do nothing", but rather 47 | * "process all events available for the 48 | * first frame". (It's used whenever the 49 | * engine needs to split for an ACC_PATCH 50 | * while there are more events for the 51 | * same frame.) 52 | */ 53 | void (*process)(struct audio_patch_t *p, 54 | struct audio_channel_t *c, unsigned frames); 55 | 56 | eel_symbol_t *eel_process; 57 | } audio_patch_t; 58 | 59 | 60 | typedef enum 61 | { 62 | PES_START = 0, 63 | PES_START2, 64 | PES_DELAY, 65 | PES_ATTACK, 66 | PES_HOLD, 67 | PES_DECAY, 68 | PES_SUSTAIN, 69 | PES_WAIT, 70 | PES_RELEASE, 71 | PES_DEAD 72 | } A_patch_env_states; 73 | 74 | /* 75 | * Temporary kludge. Something more flexible will probably 76 | * be needed, but I'm using this for now, to avoid type 77 | * casting void pointers all over the place. (Not an issue 78 | * with EEL based patches.) 79 | */ 80 | typedef struct patch_closure_t 81 | { 82 | /* Arguments from CE_START */ 83 | int velocity; 84 | int pitch; /* w/ RANDPITCH, but w/o channel PITCH */ 85 | int velvol; /* For envelope */ 86 | 87 | /* Envelope generator state */ 88 | A_patch_env_states env_state; 89 | int queued_stop; 90 | aev_timestamp_t env_next; 91 | int lvol, rvol; 92 | int lsend, rsend; 93 | } patch_closure_t; 94 | 95 | 96 | void audio_patch_open(void); 97 | void audio_patch_close(void); 98 | 99 | #endif /*_A_PATCH_H_*/ 100 | -------------------------------------------------------------------------------- /src/sound/a_pitch.c: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | a_pitch.c - Simple fixed point linear pitch table. 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include 23 | #include "a_globals.h" 24 | #include "a_pitch.h" 25 | 26 | /* 27 | * Start pitch, based on the assumption that 1.0 (original 28 | * sample playback speed) gives you a middle C (MIDI #60). 29 | */ 30 | #define FIVE_OCTAVES (1 << 5) 31 | 32 | /* 1 + twelfth root of two */ 33 | #define SEMITONE_MULTIPLIER 1.0594630943592953 34 | 35 | int *__pitchtab = NULL; 36 | 37 | int ptab_init(int middle_c) 38 | { 39 | int p; 40 | double pitch; 41 | free(__pitchtab); 42 | __pitchtab = malloc(129 * sizeof(int)); 43 | if(!__pitchtab) 44 | return -1; 45 | 46 | pitch = (double)middle_c / FIVE_OCTAVES; 47 | for(p = 0; p < 129; ++p) 48 | { 49 | __pitchtab[p] = (int)pitch; 50 | pitch *= SEMITONE_MULTIPLIER; 51 | } 52 | return 0; 53 | } 54 | 55 | void ptab_close(void) 56 | { 57 | free(__pitchtab); 58 | __pitchtab = NULL; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /src/sound/a_pitch.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_pitch.h - Simple fixed point linear pitch table. 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001. 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _PITCHTAB_H_ 23 | #define _PITCHTAB_H_ 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | extern int *__pitchtab; 30 | 31 | /* 32 | * 'middle_c' is the output value you want with an input of 33 | * 60; MIDI standard middle C. The table will start 5 octaves 34 | * down from there, and will contain 129 semitone steps. (The 35 | * last step is for sub-semitone interpolation.) 36 | */ 37 | int ptab_init(int middle_c); 38 | 39 | void ptab_close(void); 40 | 41 | /* 42 | * Interpolated linear frequency -> frequency factor lookup. 43 | * 44 | * 'pith' is a 16:16 fixed point linear frequency value. 45 | * 46 | * Returns engine pitch as 16:16 fixed point. 47 | */ 48 | static inline int ptab_convert(int pitch) 49 | { 50 | int bfrac; 51 | int btone = pitch >> 16; 52 | if(btone < 0) 53 | return __pitchtab[0]; 54 | else if(btone > 127) 55 | return __pitchtab[128]; 56 | bfrac = (pitch & 0xffff) >> 8; 57 | return (__pitchtab[btone+1] * bfrac + 58 | __pitchtab[btone] * (256-bfrac)) >> 8; 59 | } 60 | 61 | 62 | /* 63 | * Interpolated linear frequency -> frequency factor lookup, 64 | * MIDI style. 65 | * 66 | * 'pith' is a MIDI pitch code (0..127; 60 <==> middle C, 67 | * which maps to the original sample rate of the current 68 | * waveform). 69 | * 70 | * 'bend' is a 16:16 fixed point value in the same unit. 71 | * That is, the integer part of bend is added to pitch, 72 | * whereas the fraction part is used for fractional tone 73 | * interpolation. 74 | * 75 | * Returns engine pitch as 16:16 fixed point. 76 | */ 77 | #define ptab_convert_midi(p, b) ptab_convert((b) + ((p)<<16)) 78 | #if 0 79 | static inline int ptab_convert_midi(int pitch, int bend) 80 | { 81 | int bfrac; 82 | int btone = pitch + (bend >> 16); 83 | if(btone < 0) 84 | return __pitchtab[0]; 85 | else if(btone > 127) 86 | return __pitchtab[128]; 87 | bfrac = (bend & 0xffff) >> 8; 88 | return (__pitchtab[btone+1] * bfrac + 89 | __pitchtab[btone] * (256-bfrac)) >> 8; 90 | } 91 | #endif 92 | 93 | /* 94 | * Simple semitone resolution lookup - nonchecking. 95 | */ 96 | #define _ptab_lookup(p) (__pitchtab[p]) 97 | 98 | /* 99 | * ...and with checking. 100 | */ 101 | #define ptab_lookup(p) (__pitchtab ? _ptab_lookup(p) : 65536) 102 | 103 | #ifdef __cplusplus 104 | }; 105 | #endif 106 | 107 | #endif /*_PITCHTAB_H_*/ 108 | -------------------------------------------------------------------------------- /src/sound/a_sequencer.c: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_sequencer.c - MIDI Sequencer 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "a_globals.h" 23 | #include "a_struct.h" 24 | 25 | #include "a_sequencer.h" 26 | #include "a_midisock.h" 27 | 28 | /* 29 | * Temporary MIDI playback hack. 30 | * 31 | * Only one sequence at a time, and it uses the 32 | * same midisock as the external MIDI input. 33 | */ 34 | 35 | midi_player_t *midiplayer = 0; 36 | static float fs = 44100; 37 | 38 | 39 | int sequencer_open(midisock_t *ms, float framerate) 40 | { 41 | aev_client("sequencer_open()"); 42 | fs = framerate; 43 | #if 1 44 | midiplayer = mp_open(ms); 45 | #else 46 | midiplayer = mp_open(&monitor_midisock); 47 | #endif 48 | return (midiplayer != 0); 49 | } 50 | 51 | 52 | void sequencer_close(void) 53 | { 54 | aev_client("sequencer_close()"); 55 | if(!midiplayer) 56 | return; 57 | 58 | mp_close(midiplayer); 59 | midiplayer = 0; 60 | } 61 | 62 | 63 | int sequencer_play(midi_file_t *mf, int tag, int pitch, int volume) 64 | { 65 | aev_client("sequencer_play()"); 66 | if(!midiplayer) 67 | return -1; 68 | 69 | midiplayer->pitch = pitch - (60 << 16); 70 | mp_select(midiplayer, mf); 71 | return 0; 72 | } 73 | 74 | 75 | void sequencer_stop(int tag) 76 | { 77 | aev_client("sequencer_stop()"); 78 | if(!midiplayer) 79 | return; 80 | 81 | mp_stop(midiplayer); 82 | } 83 | 84 | 85 | int sequencer_playing(int tag) 86 | { 87 | if(!midiplayer) 88 | return 0; 89 | 90 | return (midiplayer->mf != 0); 91 | } 92 | 93 | 94 | void sequencer_process(unsigned frames) 95 | { 96 | int i; 97 | aev_client("sequencer_process()"); 98 | if(!midiplayer) 99 | return; 100 | 101 | if(mp_play(midiplayer, (float)frames / fs)) 102 | return; 103 | 104 | for(i = 0; i < AUDIO_MAX_CHANNELS; ++i) 105 | { 106 | int wave; 107 | if(!channeltab[i].playing) 108 | continue; 109 | wave = patchtab[channeltab[i].ctl[ACC_PATCH]].param[APP_WAVE]; 110 | if((wave < 0) || (wave >= AUDIO_MAX_WAVES)) 111 | continue; 112 | if(AF_MIDI != wavetab[wave].format) 113 | continue; 114 | channeltab[i].playing = 0; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/sound/a_sequencer.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_sequencer.h - MIDI Sequencer 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _A_SEQUENCER_H_ 23 | #define _A_SEQUENCER_H_ 24 | 25 | #include "a_midisock.h" 26 | #include "a_midifile.h" 27 | 28 | int sequencer_open(midisock_t *ms, float framerate); 29 | void sequencer_close(void); 30 | 31 | /* 32 | * Starts playing 'mf' at 'pitch' (0 ==> normal) and 'volume'. 33 | * The sequencer context is marked with the positive value 'tag' 34 | * for later reference. 'pitch' and 'volume' are 16:16 fixed 35 | * point values, to match the engine control data type. 36 | * Returns a negative value if an error occurred. 37 | */ 38 | int sequencer_play(midi_file_t *mf, int tag, int pitch, int volume); 39 | 40 | /* 41 | * Stop the sequence marked with 'tag'. 42 | * Pass -1 for 'tag' to stop all playing sequences. 43 | */ 44 | void sequencer_stop(int tag); 45 | 46 | /* Returns 1 if the sequence marked 'tag' is still playing. */ 47 | int sequencer_playing(int tag); 48 | 49 | void sequencer_process(unsigned frames); 50 | 51 | #endif /*_A_SEQUENCER_H_*/ 52 | -------------------------------------------------------------------------------- /src/sound/a_struct.c: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_struct.c - Audio Engine internal structures 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | 23 | #include 24 | #include "a_globals.h" 25 | #include "a_struct.h" 26 | #include "a_control.h" 27 | 28 | /*---------------------------------------------------------- 29 | Engine Global Data 30 | ----------------------------------------------------------*/ 31 | audio_wave_t wavetab[AUDIO_MAX_WAVES]; 32 | audio_patch_t patchtab[AUDIO_MAX_PATCHES]; 33 | audio_voice_t voicetab[AUDIO_MAX_VOICES]; 34 | audio_group_t grouptab[AUDIO_MAX_GROUPS]; 35 | audio_channel_t channeltab[AUDIO_MAX_CHANNELS]; 36 | audio_bus_t bustab[AUDIO_MAX_BUSSES]; 37 | -------------------------------------------------------------------------------- /src/sound/a_struct.h: -------------------------------------------------------------------------------- 1 | /*(LGPL) 2 | --------------------------------------------------------------------------- 3 | a_struct.h - Audio Engine internal structures 4 | --------------------------------------------------------------------------- 5 | * Copyright (C) 2001, 2002, David Olofson 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation; either version 2.1 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this program; if not, write to the Free Software Foundation, 19 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #ifndef _A_STRUCT_H_ 23 | #define _A_STRUCT_H_ 24 | 25 | #include "a_wave.h" 26 | #include "a_patch.h" 27 | #include "a_channel.h" 28 | #include "a_voice.h" 29 | #include "a_bus.h" 30 | 31 | /*---------------------------------------------------------- 32 | Engine Global Data 33 | ----------------------------------------------------------*/ 34 | extern audio_wave_t wavetab[AUDIO_MAX_WAVES]; 35 | extern audio_patch_t patchtab[AUDIO_MAX_PATCHES]; 36 | extern audio_group_t grouptab[AUDIO_MAX_GROUPS]; 37 | extern audio_channel_t channeltab[AUDIO_MAX_CHANNELS]; 38 | extern audio_voice_t voicetab[AUDIO_MAX_VOICES]; 39 | extern audio_bus_t bustab[AUDIO_MAX_BUSSES]; 40 | 41 | void _audio_init(void); 42 | 43 | #endif /*_A_STRUCT_H_*/ 44 | -------------------------------------------------------------------------------- /src/sound/audiodev.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------ 3 | audiodev.h: Little silly audio device "class" 4 | ------------------------------------------------------------ 5 | * Copyright (C) David Olofson, 1999-2001 6 | * This code is released under the terms of the LGPL 7 | */ 8 | 9 | #ifndef _AUDIODEV_H_ 10 | #define _AUDIODEV_H_ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | typedef struct audiodev_t 17 | { 18 | const char *devicename; 19 | int outfd, infd; 20 | int mode; 21 | int rate; 22 | int fragmentsize; 23 | int fragments; 24 | } audiodev_t; 25 | void audiodev_init(struct audiodev_t *ad); 26 | int audiodev_open(struct audiodev_t *ad); 27 | void audiodev_close(struct audiodev_t *ad); 28 | 29 | #ifdef __cplusplus 30 | }; 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /src/sound/sfifo.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------ 3 | SFIFO 1.4 4 | ------------------------------------------------------------ 5 | * Simple portable lock-free FIFO 6 | * (c) 2000-2002, David Olofson 7 | * 8 | * Platform support: 9 | * gcc / Linux / x86: Works 10 | * gcc / Linux / x86 kernel: Works 11 | * gcc / FreeBSD / x86: Works 12 | * gcc / NetBSD / x86: Works 13 | * gcc / Mac OS X / PPC: Works 14 | * gcc / Win32 / x86: Works 15 | * Borland C++ / DOS / x86RM: Works 16 | * gcc / BeOS / x86: Works 17 | * gcc / BeOS / PPC: Works 18 | * ? / Solaris / x86 Works 19 | * ? / Solaris / SPARC Works 20 | * ? / AmigaOS / PPC Works 21 | * Borland C++ / Win32 / x86PM16: Untested 22 | * ? / Various Un*ces / ?: Untested 23 | * ? / Mac OS Classic / PPC: Untested 24 | * ? / ? / Alpha: Untested 25 | * ? / ? / MIPS: Untested 26 | * 27 | * 1.2: Max buffer size halved, to avoid problems with 28 | * the sign bit... 29 | * 30 | * 1.3: Critical buffer allocation bug fixed! For certain 31 | * requested buffer sizes, older version would 32 | * allocate a buffer of insufficient size, which 33 | * would result in memory thrashing. (Amazing that 34 | * I've manage to use this to the extent I have 35 | * without running into this... *heh*) 36 | * 37 | * 1.4: Trying to make sfifo more robust, and easier to 38 | * use. It's now safe to close an sfifo more than 39 | * once. I've also changed some arguments and 40 | * variables to unsigned, to prevent signed input 41 | * from causing things to blow up. free/malloc 42 | * wrappers renamed _sf_free/_sf_malloc, to avoid 43 | * confusion and macro collisions. 44 | * 45 | */ 46 | 47 | #ifndef _SFIFO_H_ 48 | #define _SFIFO_H_ 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | #include 55 | 56 | /*------------------------------------------------ 57 | "Private" stuff 58 | ------------------------------------------------*/ 59 | /* 60 | * Porting note: 61 | * Reads and writes of a variable of this type in memory 62 | * must be *atomic*! 'int' is *not* atomic on all platforms. 63 | * A safe type should be used, and sfifo should limit the 64 | * maximum buffer size accordingly. 65 | */ 66 | typedef int sfifo_atomic_t; 67 | #ifdef __TURBOC__ 68 | # define SFIFO_MAX_BUFFER_SIZE 0x7fff 69 | #else /* Kludge: Assume 32 bit platform */ 70 | # define SFIFO_MAX_BUFFER_SIZE 0x7fffffff 71 | #endif 72 | 73 | typedef struct sfifo_t 74 | { 75 | char *buffer; 76 | unsigned size; /* Number of bytes */ 77 | sfifo_atomic_t readpos; /* Read position */ 78 | sfifo_atomic_t writepos; /* Write position */ 79 | } sfifo_t; 80 | 81 | #define SFIFO_SIZEMASK(x) ((x)->size - 1) 82 | 83 | 84 | /*------------------------------------------------ 85 | API 86 | ------------------------------------------------*/ 87 | int sfifo_init(sfifo_t *f, unsigned size); 88 | void sfifo_close(sfifo_t *f); 89 | void sfifo_flush(sfifo_t *f); 90 | int sfifo_write(sfifo_t *f, const void *buf, unsigned len); 91 | int sfifo_read(sfifo_t *f, void *buf, unsigned len); 92 | #define sfifo_used(x) (((x)->writepos - (x)->readpos) & SFIFO_SIZEMASK(x)) 93 | #define sfifo_space(x) ((x)->size - 1 - sfifo_used(x)) 94 | 95 | 96 | /*------------------------------------------------ 97 | Linux kernel space interface 98 | ------------------------------------------------*/ 99 | #ifdef __KERNEL__ 100 | int sfifo_write_user(sfifo_t *f, const void *buf, unsigned len); 101 | int sfifo_read_user(sfifo_t *f, void *buf, unsigned len); 102 | #else 103 | # define sfifo_write_user sfifo_write 104 | # define sfifo_read_user sfifo_read 105 | #endif 106 | 107 | #ifdef __cplusplus 108 | }; 109 | #endif 110 | #endif 111 | --------------------------------------------------------------------------------