diff options
-rw-r--r-- | ChangeLog | 809 | ||||
-rw-r--r-- | NEWS | 9 | ||||
-rw-r--r-- | codeblocks/config.h | 6 | ||||
-rw-r--r-- | codeblocks/game-res.rc | 10 | ||||
-rw-r--r-- | codeblocks/setup-res.rc | 8 | ||||
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | msvc/config.h | 6 | ||||
-rw-r--r-- | msvc/win32.rc | 10 | ||||
-rw-r--r-- | pkg/osx/Execute.m | 11 | ||||
-rw-r--r-- | pkg/osx/LauncherManager.h | 1 | ||||
-rw-r--r-- | pkg/osx/LauncherManager.m | 1 | ||||
-rw-r--r-- | pkg/osx/Resources/launcher.nib/classes.nib | 1 | ||||
-rw-r--r-- | pkg/osx/Resources/launcher.nib/info.nib | 2 | ||||
-rw-r--r-- | pkg/osx/Resources/launcher.nib/keyedobjects.nib | bin | 19494 -> 19616 bytes | |||
-rw-r--r-- | src/mus2mid.c | 1019 | ||||
-rw-r--r-- | src/resource.rc.in | 2 |
16 files changed, 1397 insertions, 501 deletions
@@ -1,3 +1,812 @@ +2010-01-31 18:21:50 fraggle + + Change Windows resource file to use PACKAGE_COPYRIGHT and + PACKAGE_LICENSE macros. + +2010-01-30 16:14:04 fraggle + + Change directory to home directory before launching the game, so that + recorded demos go somewhere sensible. + +2010-01-30 16:04:24 fraggle + + Set launch button as default button, so that it is possible to launch + the game by pressing return. + +2010-01-30 00:37:17 fraggle + + Rename mus2mid functions to be consistent with coding standard. + +2010-01-29 23:28:35 fraggle + + Remove unused PACKAGE_LONGDESC. + +2010-01-29 19:17:56 fraggle + + When doing a MUS to MID conversion, allocate MIDI channels so that the + lowest-numbered MIDI channels are used before higher-numbered ones. + Fixes ear-piercing whistle sound in the MAP05 music when playing with + timidity and EAWPATS (thanks entryway / HackNeyed). + +2010-01-29 03:55:20 fraggle + + Fix indentation/style etc. in mus2mid.c. + +2010-01-27 19:16:26 fraggle + + Add tags files to svn:ignore properties. + +2010-01-26 19:21:18 fraggle + + Minor fix of British spelling -> American. + +2010-01-26 19:18:18 fraggle + + Fix glass hack windows where a linedef is flagged as two sided but has + only one side. Fixes WADs such as OTTAWAU.WAD (thanks Never_Again). + +2010-01-23 23:06:45 fraggle + + Add menu item to launcher to open a terminal window that can be used + to start the game. Add missing 'edit' menu. Set svn:ignore property + for osx directory. + +2010-01-18 19:40:50 fraggle + + Fix package source URL. + +2010-01-18 19:29:48 fraggle + + Tweak package description slightly. + +2010-01-18 19:14:54 fraggle + + Define project short description, copyright, maintainer and URL in + configure.in. Use these for the Info-gnustep.plist file. Add + generated .spec file for building RPM packages. + +2010-01-17 16:58:37 fraggle + + Update NEWS. + +2010-01-17 16:31:03 fraggle + + Restore the original cursor when shutting down video code, this should + hopefully fix the problem with the mouse cursor disappearing when + exiting on Win9x (thanks Janizdreg). + +2010-01-16 19:20:11 fraggle + + Update TODO file. + +2010-01-15 19:29:28 fraggle + + Don't open the configuration window when the launcher is first run; + display an error message if the user tries to launch the game without + an IWAD selected. + +2010-01-15 19:14:02 fraggle + + Fix GNUstep info panel. + +2010-01-15 18:51:35 fraggle + + Center the launcher window and config window on startup. + +2010-01-15 18:40:37 fraggle + + Add wadfile.png for GNUstep build. + +2010-01-15 18:13:05 fraggle + + Extend osx makefile to allow building of a working GNUstep + application, for testing purposes. Add GNUstep version of Info.plist, + remove app-skeleton directory and move contents up. + +2010-01-14 18:47:03 fraggle + + In Chex Quest, use the radiation suit colormap instead of the red + colormaps that are usually used when taking damage (or using the + berserk pack). This matches the Vanilla chex.exe behavior (thanks + Fuzztooth). + +2010-01-12 20:16:25 fraggle + + Oops. + +2010-01-12 20:15:34 fraggle + + Strip executables when building Windows CE packages. + +2010-01-12 20:14:11 fraggle + + Rearrange order of Makefile generation to alphabetical order. + +2010-01-12 20:12:56 fraggle + + Move Makefile definitions for CC and STRIP into config.make, use + versions from autoconf. + +2010-01-12 20:09:54 fraggle + + Set main menu title based on package name, not fixed string. + +2010-01-12 20:09:01 fraggle + + Place commercial level name strings consecutively in the same array, + so that overflowing the end of one list accesses the start of the + next. This trick is used by pl2.wad for its MAP33 secret level. + +2010-01-12 01:32:24 fraggle + + Add missing connection for plutonia.wad set button. + +2010-01-12 01:20:48 fraggle + + Add document icon file and use for file associations. + +2010-01-11 19:10:42 fraggle + + Insert new files into the command line at the correct location, + allowing multiple files to be opened at once. + +2010-01-11 01:35:04 fraggle + + When launching a file from the finder, add the new file into the + command line at the appropriate position in the command line string. + +2010-01-10 20:46:15 fraggle + + Change "@executable_path@" to "@executable_path" + +2010-01-10 18:48:21 fraggle + + Install docs with a single cp, rather than using a for loop. + +2010-01-10 18:42:35 fraggle + + Recursively copy library dependencies into destination package. + Identify libraries to be installed based on the path in which they are + located, rather than whether there is "libSDL" in the name. Use + install_name_tool to change the search path so that the system looks + for libraries in @executable_path@ rather than their location on the + machine upon which the program was built. + +2010-01-09 21:06:31 fraggle + + Clear existing arguments when adding a file. + +2010-01-09 20:42:30 fraggle + + Add file to command line when opened; add link from AppController to + LauncherManager. + +2010-01-09 18:54:04 fraggle + + Initial code to identify file type by extension and add file to + command line. + +2010-01-09 18:38:48 fraggle + + Hook in AppController as delegate for application, add file + associations to property list file. + +2010-01-05 17:20:58 fraggle + + Add "clean" target to package makefiles. + +2010-01-05 15:52:12 fraggle + + Move config.make up to pkg/ directory. Use static makefiles to + generate all packages, rather than dynamically generated makefiles. + Add pkg/osx to dist. Make OS X staging directory depend on top level + documentation files. Generate CMDLINE as part of standard build if it + is not already present. Set svn:ignore properties. + +2010-01-04 22:53:44 fraggle + + Fix single space error when listing libraries. + +2010-01-04 22:45:45 fraggle + + Copy binaries into app dir along with libraries. + +2010-01-04 22:24:48 fraggle + + Include documentation files in package. + +2010-01-04 22:19:53 fraggle + + Fix GNUstep build. + +2010-01-04 22:11:11 fraggle + + Generate Info.plist and config.make in configure and remove temporary + versions. Include config.h from top level. + +2010-01-04 22:01:32 fraggle + + Import OS X launcher code to trunk. + +2010-01-03 03:49:11 fraggle + + Add quotes around $@ in autogen script (thanks exp[x]) + +2009-12-28 20:57:20 fraggle + + When recording low resolution (non-longtics) Vanilla demos, carry + forward the error from angleturn caused by the reduced resolution, so + that consecutive errors can accumulate, possibly making turning + slightly smoother. + +2009-12-27 01:42:13 fraggle + + Oops. + +2009-12-27 00:11:18 fraggle + + Allow DOOMWADDIR/DOOMWADPATH to contain the complete path to IWAD + files, as well as directories in which to search for IWAD files. + +2009-12-18 22:11:06 fraggle + + Fix poor quality application icons seen when the game is running. Add + back 8-bit icon files alongside files including both 8-bit and high + quality 32-bit versions. Use the high quality icon files for resource + files includes, and the low quality ones for in-game SDL. + +2009-12-18 21:11:32 fraggle + + Update generated source files containing icon data. + +2009-12-18 21:10:35 fraggle + + Make ExecuteCommand() under Unix return a failure when the executable + cannot be executed. + +2009-12-14 20:57:04 fraggle + + Use GetModuleFileNameW to get the (Unicode) path to the Doom + executable. This hopefully fixes problems with Unicode directory + names. + +2009-12-14 18:54:25 fraggle + + Add Chocolate Doom/setup icons with scaled versions for various + different icon sizes (thanks MikeRS). + +2009-12-12 01:20:49 fraggle + + Fix textscreen black border bug. + +2009-12-09 02:40:39 fraggle + + Fix the setup tool on Windows Vista/7 to not prompt for elevated + permissions and to disable the "Program Compatibility Assistant" + (thanks hobbs and MikeRS). + +2009-11-29 22:50:17 fraggle + + Add other missing files to dist. + +2009-11-29 22:25:51 fraggle + + Include .lvimrc in dist. + +2009-11-21 03:56:59 fraggle + + Add Makefile to build Win32 packages. + +2009-11-21 02:05:56 fraggle + + Use execvp() rather than execv(), to look up Doom binary in the PATH + if necessary. + +2009-11-21 00:40:58 fraggle + + Apply configuration file invalid key setting fix to setup code. + +2009-11-21 00:38:16 fraggle + + Don't crash if key settings are set in a configuration file that are + out of range (thanks entryway). + +2009-11-21 00:24:59 fraggle + + Fix crash with chocolate-setup under Windows (thanks Janizdreg). + +2009-11-19 21:49:13 fraggle + + Rework the OS X MIDI disabling code, as SDL_mixer 1.2.11 fixes the + crash. Check and disable MIDI by default if using an older version of + SDL on OS X. + +2009-11-19 21:07:31 fraggle + + Make chocolate-setup use its own location in the filesystem to find + the location of the chocolate-doom executable. Remove INSTALL_DIR + define. + +2009-11-05 19:57:55 fraggle + + Perform bounds checking on values passed to TXT_UpdateScreenArea() to + avoid crashes. + +2009-10-26 19:28:12 fraggle + + Initial hacks for compiling under SDL 1.3. + +2009-10-17 21:13:54 fraggle + + Fix error in last change. + +2009-10-17 20:39:37 fraggle + + Use M_StrToInt() when processing values passed with -spechit, so that + hex values can be specified. + +2009-10-17 20:29:46 fraggle + + Import donut overrun emulation code from PrBoom+ (Thanks entryway). + +2009-10-16 19:10:30 fraggle + + Fix compilation under MSVC (thanks entryway). + +2009-10-10 23:58:25 fraggle + + Rename pkg/wince/Makefile to pkg/wince/GNUmakefile (it uses GNU + extensions). + +2009-10-10 22:46:14 fraggle + + Add pkg directory to make dist. + +2009-10-10 02:02:58 fraggle + + Don't crash when using the donut special type and the joining linedef + is one sided (thanks Alexander Waldmann). + +2009-10-05 21:25:53 fraggle + + Fix desync in ep1-0500.lmp on 64-bit (thanks exp(x)). + +2009-10-05 00:38:14 fraggle + + Provide pointer to STARTUPINFO structure when calling CreateProcessW, + to stop crash under normal Windows (not CE) when launching Doom from + the setup tools (thanks Janizdreg). + +2009-10-01 20:08:21 fraggle + + Oops. + +2009-10-01 02:04:00 fraggle + + Oops. + +2009-10-01 00:07:03 fraggle + + Change British English spellings to American English, for consistency. + +2009-09-20 16:27:40 fraggle + + Use "const char" in libtextscreen where appropriate (thanks entryway). + +2009-09-11 22:56:47 fraggle + + Add (lack of) copyright notice for SDL workaround. + +2009-09-07 20:43:04 fraggle + + Fix compilation under MacOS X. + +2009-09-06 19:15:52 fraggle + + Fixes for MSVC compile (thanks entryway). + +2009-08-28 00:27:47 fraggle + + Allow PGUP/PGDN to scroll up and down in scroll panes (thanks + LionsPhil). + +2009-07-20 23:27:59 fraggle + + Remove redundant variable assignment (thanks Quasar/Yagisan) + +2009-07-20 01:37:41 fraggle + + Save and display the loading disk icon as a fixed 16x16 square, from + an image drawn at the bottom right corner of the screen. This seems + to be the same as how Vanilla behaves, and fixes chook3.wad, that uses + an STDISK replacement with an offset that pushes the image to the + left. + +2009-07-13 23:43:06 fraggle + + Add stdio.h include to fix MSVC build (thanks Kaiser) + +2009-07-12 17:47:12 fraggle + + Fix compile with libsamplerate. + +2009-07-12 15:00:50 fraggle + + On Windows CE, use the Windows API to find the amount of available + memory, so that at least two megabytes are always left available to + the OS. + +2009-07-11 12:15:32 fraggle + + Add missing item to NEWS. + +2009-07-07 20:46:55 fraggle + + Update NEWS. + +2009-07-07 20:38:00 fraggle + + Fix launching of the game from the setup tool in Windows CE. + +2009-06-21 20:33:35 fraggle + + Add Makefile for building CAB files, dependency calculation. + +2009-06-21 20:19:43 fraggle + + Use correct filename for SDL_net DLL. + +2009-06-21 20:03:38 fraggle + + Remove temporary files after generating CAB file. + +2009-06-20 23:13:44 fraggle + + Add script to generate Windows CE install package. + +2009-06-16 20:47:13 fraggle + + Automatically allocate a smaller zone size if it was not possible to + allocate the default 16 MiB. + +2009-06-13 18:10:18 fraggle + + Don't post zero key events. + +2009-06-12 20:07:55 fraggle + + On Windows CE systems without a keyboard, patch the default settings + to use hardware keys. + +2009-06-12 18:58:42 fraggle + + Remove debug messages. + +2009-06-12 18:35:39 fraggle + + Set the USER environment variable based on the owner information from + the registry. + +2009-06-12 18:34:27 fraggle + + Always grab input on Windows CE. + +2009-06-11 22:34:36 fraggle + + Include libc_wince.a in chocolate-server build. + +2009-06-11 20:41:20 fraggle + + Grab the input in setup when reading a new key binding, so that + Windows CE buttons are read properly. Map buttons to PC function + keys. + +2009-06-11 19:19:05 fraggle + + Include libc_wince.h on Windows CE. + +2009-06-11 19:18:12 fraggle + + Declare getenv/putenv on Windows CE for recent SDL versions that do + not declare it. + +2009-06-10 20:03:08 fraggle + + Add key bindings for pause, message refresh. + +2009-06-08 20:26:29 fraggle + + Remove debugging code. + +2009-06-08 19:15:57 fraggle + + Use SDL's getenv/putenv implementation, and populate at startup. + +2009-06-08 00:41:10 fraggle + + Use CreateFileW instead of OpenFile (doesn't exist on Windows CE) + +2009-06-07 20:08:08 fraggle + + Fix header includes (thanks exp[x]) + +2009-06-07 19:18:02 fraggle + + Don't add DirectX/Windib selector on Windows CE. + +2009-06-07 18:53:25 fraggle + + Use home dir to store configuration and savegames under Windows CE. + +2009-06-07 18:33:19 fraggle + + Fix setup tool display configuration dialog when fullscreen is not + supported. + +2009-06-07 18:10:05 fraggle + + Make auto-adjust code switch to windowed mode if no fullscreen modes + are available. + +2009-06-07 17:41:46 fraggle + + Catch errors when initialising SDL. Use the small textscreen font by + default on Windows CE if no fullscreen modes are available. + +2009-06-07 17:39:08 fraggle + + Add missing SDL_thread include. + +2009-06-07 17:35:43 fraggle + + Don't try to use the SDL DirectX driver under Windows CE. + +2009-06-07 16:21:41 fraggle + + Fix setup tool compile on Windows CE. + +2009-06-07 16:15:40 fraggle + + Remove call to setbuf. + +2009-06-07 15:35:27 fraggle + + Add IWAD search dirs for Windows CE. + +2009-06-07 15:20:46 fraggle + + Exit with an error on failure to allocate zone memory. + +2009-06-07 03:10:21 fraggle + + Use MessageBoxW instead of MessageBox (doesn't exist on Windows CE) + +2009-06-07 02:59:49 fraggle + + Add README file for Windows CE library. + +2009-06-07 02:56:21 fraggle + + Detect Windows CE target and build/include libc_wince files as + necessary. + +2009-06-07 02:50:47 rtc_marine + + - Update textscreen codeblocks project to include txt_scrollpane.* and + txt_smallfont.h + +2009-06-07 02:33:58 fraggle + + Include libc_wince.h when on Windows CE. + +2009-06-07 02:32:15 fraggle + + Add CPU affinity function for Windows CE. + +2009-06-07 02:27:58 fraggle + + Add libc_wince.h header, and EISDIR error value. + +2009-06-07 02:27:30 fraggle + + Use GetUserNameExW, not GetUserName (doesn't exist on WinCE) + +2009-06-07 02:26:45 fraggle + + Fix compile with FEATURE_MULTIPLAYER disabled. + +2009-06-07 02:24:40 fraggle + + Fix compile with FEATURE_SOUND disabled. + +2009-06-07 01:56:23 fraggle + + Add Windows CE implementations of some ANSI C functions that are + missing. + +2009-06-06 22:13:44 fraggle + + Don't check for Steam/CD installer versions on Windows CE. + +2009-06-05 17:58:48 fraggle + + Add key binding variables for automap and weapon keys. + +2009-06-04 00:37:02 fraggle + + Increase height of menu bindings dialog. + +2009-06-04 00:35:05 fraggle + + Use newer keyboard bindings dialog layout from raven-branch. + +2009-06-04 00:20:37 fraggle + + Add unique key groups for menu navigation and shortcuts. + +2009-06-04 00:20:06 fraggle + + Use key for confirming menu messages, not typed char. + +2009-06-03 21:45:54 fraggle + + Add dialog to setup tool for editing menu shortcuts. + +2009-06-03 21:18:04 fraggle + + Add config file variables to increase/decrease screen size. + +2009-06-03 20:59:26 fraggle + + Fix shortcut keys for menu items. + +2009-06-03 20:55:50 fraggle + + Add configuration file entries for menu key bindings. + +2009-06-03 20:37:19 fraggle + + Add key_ variables for the keys used to control the menu. + +2009-05-26 23:14:24 fraggle + + Fix tags for functions using TXT_UNCAST_ARG. + +2009-05-26 22:13:18 fraggle + + Set appropriate vim 'tags' variable for ctags files. + +2009-05-21 20:18:38 fraggle + + Set display settings window position based on screen dimensions, + rather than hard coding position. + +2009-05-19 18:07:49 fraggle + + Fix manpage documentation for DOOMWADPATH (thanks MikeRS) + +2009-05-18 19:30:49 fraggle + + Fix A_BossDeath behavior in v1.9 emulation mode (thanks entryway) + +2009-05-17 14:54:19 fraggle + + Always use an SDL buffer size that is a power of two. Reduce buffer + size to 70ms. + +2009-05-12 19:03:20 fraggle + + Add option to "join game" dialog in setup tool to autojoin a LAN game. + +2009-05-12 19:01:27 fraggle + + Make txt_inputboxes emit a "changed" signal when their value is + changed. + +2009-05-07 22:59:38 fraggle + + Calculate SDL buffer size automatically based on sample rate. + +2009-05-05 01:00:53 fraggle + + Better ASCII chart. + +2009-05-05 00:46:27 fraggle + + Minor smallfont fixups. + +2009-05-01 22:05:57 fraggle + + Add copyright headers to textscreen examples. + +2009-04-26 17:59:08 fraggle + + More smallfont fixups. + +2009-04-23 20:58:11 fraggle + + Fix up some extended ASCII characters. + +2009-04-23 19:19:52 fraggle + + Oops. + +2009-04-23 19:18:43 fraggle + + Add small textscreen font for low resolution displays, based on the + Atari-Small font by Tom Fine. + +2009-03-15 14:44:23 fraggle + + Fix clipped sounds when using libsamplerate (thanks David Flater) + +2009-03-14 15:28:41 fraggle + + Add check to allow sched_setaffinity code to work on older versions of + libc. + +2009-03-12 18:55:27 fraggle + + Define INVALID_SET_FILE_POINTER if it is not defined, to fix + compilation under MSVC6 (thanks Quasar) + +2009-03-08 22:51:25 fraggle + + Add "make doc" target to run Doxygen, and add a Doxyfile. Add @file + tags to start of header files so that Doxygen will process them. + +2009-03-07 00:35:08 fraggle + + Add documentation for high-level txt_desktop.h functions. + +2009-03-07 00:24:45 fraggle + + Add documentation for high-level textscreen functions. + +2009-03-06 20:01:32 fraggle + + Fix signed/unsigned conversion warning. + +2009-03-03 19:26:20 fraggle + + Look up SetProcessAffinityMask function at runtime, so that the + program should work under Win9x again. + +2009-01-30 23:53:47 fraggle + + Fix layout of widgets within scroll panes. Scroll scroll panes in + response to keyboard events. + +2009-01-29 23:26:03 fraggle + + Shrink text box slightly. + +2009-01-29 23:00:14 fraggle + + Allow clicking within scroll bars to set position. + +2009-01-29 22:54:13 fraggle + + Add scrollable pane widget to textscreen library. + +2009-01-17 14:05:31 fraggle + + Fix '-mmap' command line parameter. + +2009-01-07 22:05:13 fraggle + + Create the ~/.chocolate-doom/savegames directory on startup if it does + not exist. + +2009-01-07 21:51:37 fraggle + + Replace -nommap with -mmap; do not use mmap()ed file access by + default. Fixes Plutonia 2, and several other minor things. + +2008-12-10 20:25:05 fraggle + + Bump version to 1.2.1, update NEWS and ChangeLog. + 2008-12-10 20:20:10 fraggle Fix crash when playing Doom 1 levels. @@ -1,4 +1,4 @@ -... +1.3.0 (2010-02-10): * Chocolate Doom now runs on Windows Mobile/Windows CE! * It is possible to rebind most/all of the keys that control the @@ -9,7 +9,8 @@ no longer necessary to compile binaries for this system by hand. The package includes a simple graphical launcher program and can be installed simply by dragging the "Chocolate - Doom" icon to the Applications folder. + Doom" icon to the Applications folder. (thanks to Rikard Lang + for extensive testing and feedback) * The video mode auto-adjust code will automatically choose windowed mode if no fullscreen video modes are available. * The zone memory size is automatically reduced on systems with @@ -34,6 +35,8 @@ * When recording shorttics demos, errors caused by the reduced turning resolution are carried forward, possibly making turning smoother. + * The source tarball can now be used to build an RPM package: + rpmbuild -tb chocolate-doom-VER.tar.gz Compatibility: * The A_BossDeath behavior in v1.9 emulation mode was fixed @@ -79,6 +82,8 @@ linedef is one sided (thanks Alexander Waldmann). * Key settings in a configuration file that are out of range do not cause a crash (thanks entryway). + * Fix ear-piercing whistle when playing the MAP05 MIDI music + using timidity with EAWPATS (thanks entryway / HackNeyed). libtextscreen: * There is now a second, small textscreen font, so that the diff --git a/codeblocks/config.h b/codeblocks/config.h index fe1bde8f..70a4a742 100644 --- a/codeblocks/config.h +++ b/codeblocks/config.h @@ -9,19 +9,19 @@ #define PACKAGE_NAME "Chocolate Doom" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "Chocolate Doom 1.2.1" +#define PACKAGE_STRING "Chocolate Doom 1.3.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "chocolate-doom" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.2.1" +#define PACKAGE_VERSION "1.3.0" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "1.2.1" +#define VERSION "1.3.0" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ diff --git a/codeblocks/game-res.rc b/codeblocks/game-res.rc index 4a9e289b..98e58491 100644 --- a/codeblocks/game-res.rc +++ b/codeblocks/game-res.rc @@ -1,21 +1,21 @@ 1 ICON "../data/doom.ico" 1 VERSIONINFO -PRODUCTVERSION 1,2,1,0 -FILEVERSION 1,2,1,0 +PRODUCTVERSION 1,3,0,0 +FILEVERSION 1,3,0,0 FILETYPE 1 { BLOCK "StringFileInfo" { BLOCK "040904E4" { - VALUE "FileVersion", "1.2.1" - VALUE "FileDescription", "1.2.1" + VALUE "FileVersion", "1.3.0" + VALUE "FileDescription", "1.3.0" VALUE "InternalName", "Chocolate-Doom" VALUE "CompanyName", "Chocolate-Doom" VALUE "LegalCopyright", "GNU General Public License" VALUE "ProductName", "Chocolate-Doom" - VALUE "ProductVersion", "1.2.1" + VALUE "ProductVersion", "1.3.0" } } } diff --git a/codeblocks/setup-res.rc b/codeblocks/setup-res.rc index fe791088..906658f3 100644 --- a/codeblocks/setup-res.rc +++ b/codeblocks/setup-res.rc @@ -3,21 +3,21 @@ CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "setup-manifest.xml" 1 VERSIONINFO -PRODUCTVERSION 1,2,1,0 -FILEVERSION 1,2,1,0 +PRODUCTVERSION 1,3,0,0 +FILEVERSION 1,3,0,0 FILETYPE 1 { BLOCK "StringFileInfo" { BLOCK "040904E4" { - VALUE "FileVersion", "1.2.1" + VALUE "FileVersion", "1.3.0" VALUE "FileDescription", "Chocolate-Doom Setup" VALUE "InternalName", "chocolate-setup" VALUE "CompanyName", "fraggle@gmail.com" VALUE "LegalCopyright", "GNU General Public License" VALUE "ProductName", "Chocolate-Doom Setup" - VALUE "ProductVersion", "1.2.1" + VALUE "ProductVersion", "1.3.0" } } } diff --git a/configure.in b/configure.in index b097bb2f..258822ce 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -AC_INIT(Chocolate Doom, 1.2.1, fraggle@gmail.com, chocolate-doom) +AC_INIT(Chocolate Doom, 1.3.0, fraggle@gmail.com, chocolate-doom) PACKAGE_SHORTDESC="Conservative Doom source port" PACKAGE_COPYRIGHT="Copyright (C) 1993-2010" @@ -127,7 +127,6 @@ AC_SUBST(PACKAGE_COPYRIGHT) AC_SUBST(PACKAGE_LICENSE) AC_SUBST(PACKAGE_MAINTAINER) AC_SUBST(PACKAGE_URL) -AC_SUBST(PACKAGE_LONGDESC) dnl Shut up the datarootdir warnings. AC_DEFUN([AC_DATAROOTDIR_CHECKED]) diff --git a/msvc/config.h b/msvc/config.h index 7880c3c1..2dbf8c11 100644 --- a/msvc/config.h +++ b/msvc/config.h @@ -11,16 +11,16 @@ #define PACKAGE_NAME "Chocolate Doom" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "Chocolate Doom 1.2.1" +#define PACKAGE_STRING "Chocolate Doom 1.3.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "chocolate-doom" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.2.1" +#define PACKAGE_VERSION "1.3.0" /* Version number of package */ -#define VERSION "1.2.1" +#define VERSION "1.3.0" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ diff --git a/msvc/win32.rc b/msvc/win32.rc index b9bc06a2..72bb7802 100644 --- a/msvc/win32.rc +++ b/msvc/win32.rc @@ -32,21 +32,21 @@ #endif
1 VERSIONINFO
-PRODUCTVERSION 1,2,1,0
-FILEVERSION 1,2,1,0
+PRODUCTVERSION 1,3,0,0
+FILEVERSION 1,3,0,0
FILETYPE 1
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
- VALUE "FileVersion", "1.2.1"
- VALUE "FileDescription", "Chocolate Doom 1.2.1"
+ VALUE "FileVersion", "1.3.0"
+ VALUE "FileDescription", "Chocolate Doom 1.3.0"
VALUE "InternalName", "chocolate-doom"
VALUE "CompanyName", "fraggle@gmail.com"
VALUE "LegalCopyright", "GNU General Public License"
VALUE "ProductName", "Chocolate Doom"
- VALUE "ProductVersion", "1.2.1"
+ VALUE "ProductVersion", "1.3.0"
END
END
END
diff --git a/pkg/osx/Execute.m b/pkg/osx/Execute.m index bb4eed45..608443e2 100644 --- a/pkg/osx/Execute.m +++ b/pkg/osx/Execute.m @@ -100,6 +100,7 @@ static void DoExec(const char *executable, const char *iwad, const char *args) void ExecuteProgram(const char *executable, const char *iwad, const char *args) { pid_t childpid; + char *homedir; childpid = fork(); @@ -107,6 +108,16 @@ void ExecuteProgram(const char *executable, const char *iwad, const char *args) { signal(SIGCHLD, SIG_DFL); + // Change directory to home dir before launch, so that any demos + // are saved somewhere sensible. + + homedir = getenv("HOME"); + + if (homedir != NULL) + { + chdir(homedir); + } + DoExec(executable, iwad, args); } else diff --git a/pkg/osx/LauncherManager.h b/pkg/osx/LauncherManager.h index 76c74624..e454ab4f 100644 --- a/pkg/osx/LauncherManager.h +++ b/pkg/osx/LauncherManager.h @@ -32,6 +32,7 @@ IWADController *iwadController; id launcherWindow; + id launchButton; id commandLineArguments; id packageLabel; diff --git a/pkg/osx/LauncherManager.m b/pkg/osx/LauncherManager.m index ee7ed3dc..ae91ef4d 100644 --- a/pkg/osx/LauncherManager.m +++ b/pkg/osx/LauncherManager.m @@ -330,6 +330,7 @@ static NSString *AppendQuotedFilename(NSString *str, NSString *fileName) [self->packageLabel setStringValue: @PACKAGE_STRING]; [self->launcherWindow setTitle: @PACKAGE_NAME " Launcher"]; [self->launcherWindow center]; + [self->launcherWindow setDefaultButtonCell: [self->launchButton cell]]; [self setConfig]; } diff --git a/pkg/osx/Resources/launcher.nib/classes.nib b/pkg/osx/Resources/launcher.nib/classes.nib index 236f6b67..7efc837a 100644 --- a/pkg/osx/Resources/launcher.nib/classes.nib +++ b/pkg/osx/Resources/launcher.nib/classes.nib @@ -36,6 +36,7 @@ OUTLETS = { commandLineArguments = id; iwadController = id; + launchButton = id; launcherWindow = id; packageLabel = id; }; diff --git a/pkg/osx/Resources/launcher.nib/info.nib b/pkg/osx/Resources/launcher.nib/info.nib index 32b331f5..512ee6dd 100644 --- a/pkg/osx/Resources/launcher.nib/info.nib +++ b/pkg/osx/Resources/launcher.nib/info.nib @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>484 105 612 260 0 0 1440 878 </string> + <string>325 73 612 260 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> <key>29</key> diff --git a/pkg/osx/Resources/launcher.nib/keyedobjects.nib b/pkg/osx/Resources/launcher.nib/keyedobjects.nib Binary files differindex 4f078d7c..cc763056 100644 --- a/pkg/osx/Resources/launcher.nib/keyedobjects.nib +++ b/pkg/osx/Resources/launcher.nib/keyedobjects.nib diff --git a/src/mus2mid.c b/src/mus2mid.c index 66051bae..6b8b4f5c 100644 --- a/src/mus2mid.c +++ b/src/mus2mid.c @@ -1,4 +1,4 @@ -// Emacs style mode select -*- C++ -*- +// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // Copyright(C) 1993-1996 Id Software, Inc. @@ -32,594 +32,663 @@ #include "memio.h" #include "mus2mid.h" +#define NUM_CHANNELS 16 + +#define MIDI_PERCUSSION_CHAN 9 +#define MUS_PERCUSSION_CHAN 15 + // MUS event codes -typedef enum +typedef enum { - mus_releasekey = 0x00, - mus_presskey = 0x10, - mus_pitchwheel = 0x20, - mus_systemevent = 0x30, - mus_changecontroller = 0x40, - mus_scoreend = 0x60 + mus_releasekey = 0x00, + mus_presskey = 0x10, + mus_pitchwheel = 0x20, + mus_systemevent = 0x30, + mus_changecontroller = 0x40, + mus_scoreend = 0x60 } musevent; // MIDI event codes -typedef enum +typedef enum { - midi_releasekey = 0x80, - midi_presskey = 0x90, - midi_aftertouchkey = 0xA0, - midi_changecontroller = 0xB0, - midi_changepatch = 0xC0, - midi_aftertouchchannel = 0xD0, - midi_pitchwheel = 0xE0 + midi_releasekey = 0x80, + midi_presskey = 0x90, + midi_aftertouchkey = 0xA0, + midi_changecontroller = 0xB0, + midi_changepatch = 0xC0, + midi_aftertouchchannel = 0xD0, + midi_pitchwheel = 0xE0 } midievent; - // Structure to hold MUS file header -typedef struct +typedef struct { - byte id[4]; - unsigned short scorelength; - unsigned short scorestart; - unsigned short primarychannels; - unsigned short secondarychannels; - unsigned short instrumentcount; + byte id[4]; + unsigned short scorelength; + unsigned short scorestart; + unsigned short primarychannels; + unsigned short secondarychannels; + unsigned short instrumentcount; } PACKEDATTR musheader; // Standard MIDI type 0 header + track header -static byte midiheader[] = +static const byte midiheader[] = { - 'M', 'T', 'h', 'd', // Main header - 0x00, 0x00, 0x00, 0x06, // Header size - 0x00, 0x00, // MIDI type (0) - 0x00, 0x01, // Number of tracks - 0x00, 0x46, // Resolution - 'M', 'T', 'r', 'k', // Start of track - 0x00, 0x00, 0x00, 0x00 // Placeholder for track length + 'M', 'T', 'h', 'd', // Main header + 0x00, 0x00, 0x00, 0x06, // Header size + 0x00, 0x00, // MIDI type (0) + 0x00, 0x01, // Number of tracks + 0x00, 0x46, // Resolution + 'M', 'T', 'r', 'k', // Start of track + 0x00, 0x00, 0x00, 0x00 // Placeholder for track length }; // Cached channel velocities -static byte channelvelocities[] = -{ - 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127 +static byte channelvelocities[] = +{ + 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127 }; // Timestamps between sequences of MUS events -static unsigned int queuedtime = 0; +static unsigned int queuedtime = 0; // Counter for the length of the track static unsigned int tracksize; -static byte mus2midi_translation[] = -{ - 0x00, 0x20, 0x01, 0x07, 0x0A, 0x0B, 0x5B, 0x5D, - 0x40, 0x43, 0x78, 0x7B, 0x7E, 0x7F, 0x79 +static const byte controller_map[] = +{ + 0x00, 0x20, 0x01, 0x07, 0x0A, 0x0B, 0x5B, 0x5D, + 0x40, 0x43, 0x78, 0x7B, 0x7E, 0x7F, 0x79 }; +static int channel_map[NUM_CHANNELS]; + // Write timestamp to a MIDI file. -static boolean midi_writetime(unsigned int time, MEMFILE *midioutput) +static boolean WriteTime(unsigned int time, MEMFILE *midioutput) { - unsigned int buffer = time & 0x7F; - byte writeval; - - while ((time >>= 7) != 0) - { - buffer <<= 8; - buffer |= ((time & 0x7F) | 0x80); - } - - for (;;) - { - writeval = (byte)(buffer & 0xFF); - - if (mem_fwrite(&writeval, 1, 1, midioutput) != 1) - { - return true; - } - - ++tracksize; - - if ((buffer & 0x80) != 0) - { - buffer >>= 8; - } - else - { - queuedtime = 0; - return false; - } - } + unsigned int buffer = time & 0x7F; + byte writeval; + + while ((time >>= 7) != 0) + { + buffer <<= 8; + buffer |= ((time & 0x7F) | 0x80); + } + + for (;;) + { + writeval = (byte)(buffer & 0xFF); + + if (mem_fwrite(&writeval, 1, 1, midioutput) != 1) + { + return true; + } + + ++tracksize; + + if ((buffer & 0x80) != 0) + { + buffer >>= 8; + } + else + { + queuedtime = 0; + return false; + } + } } // Write the end of track marker -static boolean midi_writeendtrack(MEMFILE *midioutput) +static boolean WriteEndTrack(MEMFILE *midioutput) { - byte endtrack[] = {0xFF, 0x2F, 0x00}; + byte endtrack[] = {0xFF, 0x2F, 0x00}; - if (midi_writetime(queuedtime, midioutput)) - { - return true; - } + if (WriteTime(queuedtime, midioutput)) + { + return true; + } - if (mem_fwrite(endtrack, 1, 3, midioutput) != 3) - { - return true; - } + if (mem_fwrite(endtrack, 1, 3, midioutput) != 3) + { + return true; + } - tracksize += 3; - return false; + tracksize += 3; + return false; } // Write a key press event -static boolean midi_writepresskey(byte channel, byte key, - byte velocity, MEMFILE *midioutput) +static boolean WritePressKey(byte channel, byte key, + byte velocity, MEMFILE *midioutput) { - byte working = midi_presskey | channel; - - if (midi_writetime(queuedtime, midioutput)) - { - return true; - } - - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } - - working = key & 0x7F; - - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } - - working = velocity & 0x7F; - - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } - - tracksize += 3; - - return false; + byte working = midi_presskey | channel; + + if (WriteTime(queuedtime, midioutput)) + { + return true; + } + + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } + + working = key & 0x7F; + + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } + + working = velocity & 0x7F; + + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } + + tracksize += 3; + + return false; } // Write a key release event -static boolean midi_writereleasekey(byte channel, byte key, - MEMFILE *midioutput) +static boolean WriteReleaseKey(byte channel, byte key, + MEMFILE *midioutput) { - byte working = midi_releasekey | channel; + byte working = midi_releasekey | channel; - if (midi_writetime(queuedtime, midioutput)) - { - return true; - } + if (WriteTime(queuedtime, midioutput)) + { + return true; + } - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - working = key & 0x7F; + working = key & 0x7F; - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - working = 0; + working = 0; - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - tracksize += 3; + tracksize += 3; - return false; + return false; } // Write a pitch wheel/bend event -static boolean midi_writepitchwheel(byte channel, short wheel, - MEMFILE *midioutput) +static boolean WritePitchWheel(byte channel, short wheel, + MEMFILE *midioutput) { - byte working = midi_pitchwheel | channel; + byte working = midi_pitchwheel | channel; - if (midi_writetime(queuedtime, midioutput)) - { - return true; - } + if (WriteTime(queuedtime, midioutput)) + { + return true; + } - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - working = wheel & 0x7F; + working = wheel & 0x7F; - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - working = (wheel >> 7) & 0x7F; + working = (wheel >> 7) & 0x7F; - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - tracksize += 3; - return false; + tracksize += 3; + return false; } // Write a patch change event -static boolean midi_writechangepatch(byte channel, byte patch, - MEMFILE *midioutput) +static boolean WriteChangePatch(byte channel, byte patch, + MEMFILE *midioutput) { - byte working = midi_changepatch | channel; - - if (midi_writetime(queuedtime, midioutput)) - { - return true; - } + byte working = midi_changepatch | channel; - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + if (WriteTime(queuedtime, midioutput)) + { + return true; + } - working = patch & 0x7F; + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + working = patch & 0x7F; - tracksize += 2; - - return false; -} + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } + tracksize += 2; + return false; +} // Write a valued controller change event -static boolean midi_writechangecontroller_valued(byte channel, - byte control, - byte value, - MEMFILE *midioutput) + +static boolean WriteChangeController_Valued(byte channel, + byte control, + byte value, + MEMFILE *midioutput) { - byte working = midi_changecontroller | channel; + byte working = midi_changecontroller | channel; + + if (WriteTime(queuedtime, midioutput)) + { + return true; + } - if (midi_writetime(queuedtime, midioutput)) - { - return true; - } + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + working = control & 0x7F; - working = control & 0x7F; + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } - // Quirk in vanilla DOOM? MUS controller values should be - // 7-bit, not 8-bit. + // Quirk in vanilla DOOM? MUS controller values should be + // 7-bit, not 8-bit. - working = value;// & 0x7F; + working = value;// & 0x7F; - // Fix on said quirk to stop MIDI players from complaining that - // the value is out of range: + // Fix on said quirk to stop MIDI players from complaining that + // the value is out of range: - if (working & 0x80) - { - working = 0x7F; - } + if (working & 0x80) + { + working = 0x7F; + } - if (mem_fwrite(&working, 1, 1, midioutput) != 1) - { - return true; - } + if (mem_fwrite(&working, 1, 1, midioutput) != 1) + { + return true; + } - tracksize += 3; + tracksize += 3; - return false; + return false; } // Write a valueless controller change event -static boolean midi_writechangecontroller_valueless(byte channel, - byte control, - MEMFILE *midioutput) +static boolean WriteChangeController_Valueless(byte channel, + byte control, + MEMFILE *midioutput) { - return midi_writechangecontroller_valued(channel, control, 0, - midioutput); + return WriteChangeController_Valued(channel, control, 0, + midioutput); } -static boolean read_musheader(MEMFILE *file, musheader *header) +// Allocate a free MIDI channel. + +static int AllocateMIDIChannel(void) { - boolean result; - - result = (mem_fread(&header->id, sizeof(byte), 4, file) == 4) - && (mem_fread(&header->scorelength, sizeof(short), 1, file) == 1) - && (mem_fread(&header->scorestart, sizeof(short), 1, file) == 1) - && (mem_fread(&header->primarychannels, sizeof(short), 1, file) == 1) - && (mem_fread(&header->secondarychannels, sizeof(short), 1, file) == 1) - && (mem_fread(&header->instrumentcount, sizeof(short), 1, file) == 1); - - if (result) - { - header->scorelength = SHORT(header->scorelength); - header->scorestart = SHORT(header->scorestart); - header->primarychannels = SHORT(header->primarychannels); - header->secondarychannels = SHORT(header->secondarychannels); - header->instrumentcount = SHORT(header->instrumentcount); - } - - return result; + int result; + int max; + int i; + + // Find the current highest-allocated channel. + + max = -1; + + for (i=0; i<NUM_CHANNELS; ++i) + { + if (channel_map[i] > max) + { + max = channel_map[i]; + } + } + + // max is now equal to the highest-allocated MIDI channel. We can + // now allocate the next available channel. This also works if + // no channels are currently allocated (max=-1) + + result = max + 1; + + // Don't allocate the MIDI percussion channel! + + if (result == MIDI_PERCUSSION_CHAN) + { + ++result; + } + + return result; } +// Given a MUS channel number, get the MIDI channel number to use +// in the outputted file. -// Read a MUS file from a stream (musinput) and output a MIDI file to +static int GetMIDIChannel(int mus_channel) +{ + // Find the MIDI channel to use for this MUS channel. + // MUS channel 15 is the percusssion channel. + + if (mus_channel == MUS_PERCUSSION_CHAN) + { + return MIDI_PERCUSSION_CHAN; + } + else + { + // If a MIDI channel hasn't been allocated for this MUS channel + // yet, allocate the next free MIDI channel. + + if (channel_map[mus_channel] == -1) + { + channel_map[mus_channel] = AllocateMIDIChannel(); + } + + return channel_map[mus_channel]; + } +} + +static boolean ReadMusHeader(MEMFILE *file, musheader *header) +{ + boolean result; + + result = mem_fread(&header->id, sizeof(byte), 4, file) == 4 + && mem_fread(&header->scorelength, sizeof(short), 1, file) == 1 + && mem_fread(&header->scorestart, sizeof(short), 1, file) == 1 + && mem_fread(&header->primarychannels, sizeof(short), 1, file) == 1 + && mem_fread(&header->secondarychannels, sizeof(short), 1, file) == 1 + && mem_fread(&header->instrumentcount, sizeof(short), 1, file) == 1; + + if (result) + { + header->scorelength = SHORT(header->scorelength); + header->scorestart = SHORT(header->scorestart); + header->primarychannels = SHORT(header->primarychannels); + header->secondarychannels = SHORT(header->secondarychannels); + header->instrumentcount = SHORT(header->instrumentcount); + } + + return result; +} + + +// Read a MUS file from a stream (musinput) and output a MIDI file to // a stream (midioutput). // // Returns 0 on success or 1 on failure. -boolean mus2mid(MEMFILE *musinput, MEMFILE *midioutput) +boolean mus2mid(MEMFILE *musinput, MEMFILE *midioutput) { - // Header for the MUS file - musheader musfileheader; + // Header for the MUS file + musheader musfileheader; + + // Descriptor for the current MUS event + byte eventdescriptor; + int channel; // Channel number + musevent event; + + + // Bunch of vars read from MUS lump + byte key; + byte controllernumber; + byte controllervalue; - // Descriptor for the current MUS event - byte eventdescriptor; - int channel; // Channel number - musevent event; - + // Buffer used for MIDI track size record + byte tracksizebuffer[4]; - // Bunch of vars read from MUS lump - byte key; - byte controllernumber; - byte controllervalue; + // Flag for when the score end marker is hit. + int hitscoreend = 0; - // Buffer used for MIDI track size record - byte tracksizebuffer[4]; + // Temp working byte + byte working; + // Used in building up time delays + unsigned int timedelay; - // Flag for when the score end marker is hit. - int hitscoreend = 0; + // Initialise channel map to mark all channels as unused. - // Temp working byte - byte working; - // Used in building up time delays - unsigned int timedelay; + for (channel=0; channel<NUM_CHANNELS; ++channel) + { + channel_map[channel] = -1; + } - // Grab the header + // Grab the header - if (!read_musheader(musinput, &musfileheader)) - { - return true; - } + if (!ReadMusHeader(musinput, &musfileheader)) + { + return true; + } #ifdef CHECK_MUS_HEADER - // Check MUS header - if (musfileheader.id[0] != 'M' - || musfileheader.id[1] != 'U' - || musfileheader.id[2] != 'S' - || musfileheader.id[3] != 0x1A) - { - return true; - } + // Check MUS header + if (musfileheader.id[0] != 'M' + || musfileheader.id[1] != 'U' + || musfileheader.id[2] != 'S' + || musfileheader.id[3] != 0x1A) + { + return true; + } #endif - // Seek to where the data is held - if (mem_fseek(musinput, (long)musfileheader.scorestart, - MEM_SEEK_SET) != 0) - { - return true; - } - - // So, we can assume the MUS file is faintly legit. Let's start - // writing MIDI data... - - mem_fwrite(midiheader, 1, sizeof(midiheader), midioutput); - tracksize = 0; - - // Now, process the MUS file: - while (!hitscoreend) - { - // Handle a block of events: - - while (!hitscoreend) - { - // Fetch channel number and event code: - - if (mem_fread(&eventdescriptor, 1, 1, musinput) != 1) - { - return true; - } - - channel = eventdescriptor & 0x0F; - event = eventdescriptor & 0x70; - - // Swap channels 15 and 9. - // MIDI channel 9 = percussion. - // MUS channel 15 = percussion. - - if (channel == 15) - { - channel = 9; - } - else if (channel == 9) - { - channel = 15; - } - - switch (event) - { - case mus_releasekey: - if (mem_fread(&key, 1, 1, musinput) != 1) - { - return true; - } - - if (midi_writereleasekey(channel, key, midioutput)) - { - return true; - } - - break; - - case mus_presskey: - if (mem_fread(&key, 1, 1, musinput) != 1) - { - return true; - } - - if (key & 0x80) - { - if (mem_fread(&channelvelocities[channel], 1, 1, musinput) != 1) - { - return true; - } - - channelvelocities[channel] &= 0x7F; - } - - if (midi_writepresskey(channel, key, channelvelocities[channel], midioutput)) - { - return true; - } - - break; - - case mus_pitchwheel: - if (mem_fread(&key, 1, 1, musinput) != 1) - { - break; - } - if (midi_writepitchwheel(channel, (short)(key * 64), midioutput)) - { - return true; - } - - break; - - case mus_systemevent: - if (mem_fread(&controllernumber, 1, 1, musinput) != 1) - { - return true; - } - if (controllernumber < 10 || controllernumber > 14) - { - return true; - } - - if (midi_writechangecontroller_valueless(channel, mus2midi_translation[controllernumber], midioutput)) - { - return true; - } - - break; - - case mus_changecontroller: - if (mem_fread(&controllernumber, 1, 1, musinput) != 1) - { - return true; - } - - if (mem_fread(&controllervalue, 1, 1, musinput) != 1) - { - return true; - } - - if (controllernumber == 0) - { - if (midi_writechangepatch(channel, controllervalue, midioutput)) - { - return true; - } - } - else - { - if (controllernumber < 1 || controllernumber > 9) - { - return true; - } - - if (midi_writechangecontroller_valued(channel, mus2midi_translation[controllernumber], controllervalue, midioutput)) - { - return true; - } - } - - break; - - case mus_scoreend: - hitscoreend = 1; - break; - - default: - return true; - break; - } - - if (eventdescriptor & 0x80) - { - break; - } - } - // Now we need to read the time code: - if (!hitscoreend) - { - timedelay = 0; - for (;;) - { - if (mem_fread(&working, 1, 1, musinput) != 1) - { - return true; - } - - timedelay = timedelay * 128 + (working & 0x7F); - if ((working & 0x80) == 0) - { - break; - } - } - queuedtime += timedelay; - } - } - - // End of track - if (midi_writeendtrack(midioutput)) - { - return true; - } - - // Write the track size into the stream - if (mem_fseek(midioutput, 18, MEM_SEEK_SET)) - { - return true; - } - - tracksizebuffer[0] = (tracksize >> 24) & 0xff; - tracksizebuffer[1] = (tracksize >> 16) & 0xff; - tracksizebuffer[2] = (tracksize >> 8) & 0xff; - tracksizebuffer[3] = tracksize & 0xff; - - if (mem_fwrite(tracksizebuffer, 1, 4, midioutput) != 4) - { - return true; - } - - return false; + // Seek to where the data is held + if (mem_fseek(musinput, (long)musfileheader.scorestart, + MEM_SEEK_SET) != 0) + { + return true; + } + + // So, we can assume the MUS file is faintly legit. Let's start + // writing MIDI data... + + mem_fwrite(midiheader, 1, sizeof(midiheader), midioutput); + tracksize = 0; + + // Now, process the MUS file: + while (!hitscoreend) + { + // Handle a block of events: + + while (!hitscoreend) + { + // Fetch channel number and event code: + + if (mem_fread(&eventdescriptor, 1, 1, musinput) != 1) + { + return true; + } + + channel = GetMIDIChannel(eventdescriptor & 0x0F); + event = eventdescriptor & 0x70; + + switch (event) + { + case mus_releasekey: + if (mem_fread(&key, 1, 1, musinput) != 1) + { + return true; + } + + if (WriteReleaseKey(channel, key, midioutput)) + { + return true; + } + + break; + + case mus_presskey: + if (mem_fread(&key, 1, 1, musinput) != 1) + { + return true; + } + + if (key & 0x80) + { + if (mem_fread(&channelvelocities[channel], 1, 1, musinput) != 1) + { + return true; + } + + channelvelocities[channel] &= 0x7F; + } + + if (WritePressKey(channel, key, + channelvelocities[channel], midioutput)) + { + return true; + } + + break; + + case mus_pitchwheel: + if (mem_fread(&key, 1, 1, musinput) != 1) + { + break; + } + if (WritePitchWheel(channel, (short)(key * 64), midioutput)) + { + return true; + } + + break; + + case mus_systemevent: + if (mem_fread(&controllernumber, 1, 1, musinput) != 1) + { + return true; + } + if (controllernumber < 10 || controllernumber > 14) + { + return true; + } + + if (WriteChangeController_Valueless(channel, + controller_map[controllernumber], + midioutput)) + { + return true; + } + + break; + + case mus_changecontroller: + if (mem_fread(&controllernumber, 1, 1, musinput) != 1) + { + return true; + } + + if (mem_fread(&controllervalue, 1, 1, musinput) != 1) + { + return true; + } + + if (controllernumber == 0) + { + if (WriteChangePatch(channel, controllervalue, + midioutput)) + { + return true; + } + } + else + { + if (controllernumber < 1 || controllernumber > 9) + { + return true; + } + + if (WriteChangeController_Valued(channel, + controller_map[controllernumber], + controllervalue, + midioutput)) + { + return true; + } + } + + break; + + case mus_scoreend: + hitscoreend = 1; + break; + + default: + return true; + break; + } + + if (eventdescriptor & 0x80) + { + break; + } + } + // Now we need to read the time code: + if (!hitscoreend) + { + timedelay = 0; + for (;;) + { + if (mem_fread(&working, 1, 1, musinput) != 1) + { + return true; + } + + timedelay = timedelay * 128 + (working & 0x7F); + if ((working & 0x80) == 0) + { + break; + } + } + queuedtime += timedelay; + } + } + + // End of track + if (WriteEndTrack(midioutput)) + { + return true; + } + + // Write the track size into the stream + if (mem_fseek(midioutput, 18, MEM_SEEK_SET)) + { + return true; + } + + tracksizebuffer[0] = (tracksize >> 24) & 0xff; + tracksizebuffer[1] = (tracksize >> 16) & 0xff; + tracksizebuffer[2] = (tracksize >> 8) & 0xff; + tracksizebuffer[3] = tracksize & 0xff; + + if (mem_fwrite(tracksizebuffer, 1, 4, midioutput) != 4) + { + return true; + } + + return false; } diff --git a/src/resource.rc.in b/src/resource.rc.in index 318a3fc6..537b4410 100644 --- a/src/resource.rc.in +++ b/src/resource.rc.in @@ -13,7 +13,7 @@ FILETYPE 1 VALUE "FileDescription", "@PACKAGE_STRING@" VALUE "InternalName", "@PACKAGE_TARNAME@" VALUE "CompanyName", "@PACKAGE_BUGREPORT@" - VALUE "LegalCopyright", "GNU General Public License" + VALUE "LegalCopyright", "@PACKAGE_COPYRIGHT@. Licensed under @PACKAGE_LICENSE@" VALUE "ProductName", "@PACKAGE_NAME@" VALUE "ProductVersion", "@PACKAGE_VERSION@" } |