Commit Graph

31 Commits

Author SHA1 Message Date
Randy Heit 33a397c04b - Basic Mac support: Everything compiles but does not yet link.
SVN r1780 (trunk)
2009-09-01 02:08:53 +00:00
Randy Heit a8de4fc2da - Fixed compilation of i_keyboard.cpp with MinGW, because w32api still doesn't have
everything that was new for XP.
- Swapped snes_spc out for the full Game Music Emu library.

SVN r1631 (trunk)
2009-06-03 03:05:02 +00:00
Christoph Oelckers a908834a11 - added some default definitions for constants that may miss in some headers.
- replaced __va_copy with va_copy per Chris's suggestion.
- replaced #include <malloc.h> with #include <stdlib.h> where possible.


SVN r1524 (trunk)
2009-04-07 07:06:07 +00:00
Christoph Oelckers eb47f4fdbf - Fixed: With opl_onechip set the second OPL chip was never set to anything valid
so it contained an invalid pointer. There were also a few other places that
  simply assumed that the second chip is set to something valid.
- Fixed: NPCs which are engaged in a conversation should not move.
- Fixed: Player movement animation was not stopped when starting a conversation.


SVN r1439 (trunk)
2009-02-22 10:25:12 +00:00
Randy Heit 8f26956310 - Fixed: Some OPL state needs to be restored before calculating rhythm. Also,
since only the rhythm section uses the RNG, it doesn't need to be advanced
  for the normal voice processing.


SVN r1371 (trunk)
2009-01-27 05:25:16 +00:00
Randy Heit 7f35a95942 - Restored the rhythm section to fmopl.cpp and made some slight updates from
version 0.72 of MAME's fmopl.c. Also refactored CalcVoice so that the
  original MAME structure is more visible.


SVN r1368 (trunk)
2009-01-25 04:22:19 +00:00
Christoph Oelckers db5723997c - Cleaned up some include dependencies.
SVN r1224 (trunk)
2008-09-14 23:54:38 +00:00
Randy Heit fae19e87b7 - Implemented some more controllers for the OPL player:
* RPN select (controllers 100 and 101)
  *  RPN 0 (pitch bend sensitivity)
  * NPRN select (controllers 98 and 99)
  * Data entry (controllers 6 and 38)
  * All notes off (controller 123)
  * All sounds off (controller 120)
  * Reset controllers (controller 121)


SVN r1195 (trunk)
2008-09-05 02:04:50 +00:00
Randy Heit fb50df2c63 About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.

- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
  FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
  This is so that I can use a series of mysnprintf() calls and advance the
  pointer for each one. Once the pointer goes beyond the end of the buffer,
  the count will go negative, but since it's an unsigned type it will be
  seen as excessively huge instead. This should not be a problem, as there's
  no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
  buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
  FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
  name when given a Hexen map number. This was fine with the old scanner
  code, but only a happy coincidence prevents it from crashing with the new
  code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
  binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
  is probably broken until I get around to booting into Linux again. Niceties
  provided over the existing Makefiles they're replacing:
  * All command-line builds can use the same build system, rather than having
    a separate one for MinGW and another for Linux.
  * Microsoft's NMake tool is supported as a target.
  * Progress meters.
  * Parallel makes work from a fresh checkout without needing to be primed
    first with a single-threaded make.
  * Porting to other architectures should be simplified, whenever that day
    comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
  itself instead of generating an external makefile to do it, since I couldn't
  figure out how to generate a makefile with an external tool and include it
  with a CMake-generated makefile. Where makewad used a master list of files
  to generate the package file, zipdir just zips the entire contents of one or
  more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
  formatting can be entirely independant of the CRT.

SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
Randy Heit 8040cdd4ff - Fixed a copy-and-paste error in win32/i_main.cpp for 64-bit mode.
- Tweaked OPL centering a little.


SVN r950 (trunk)
2008-04-30 00:44:45 +00:00
Randy Heit de85314234 - Added dynamic recentering for the OPL synth. The chip has four basic
waveforms, and three of them are non-negative. This can cause a tendency
  for the resulting output waveform to go into very high ranges depending on
  the timbres used, and Heretic's exemplify this problem.
- Reduced the OPL volume level slightly.
- Fixed: The waveform view from snd_drawoutput was upside-down.


SVN r949 (trunk)
2008-04-29 04:33:43 +00:00
Randy Heit f6866df0e6 - Made the maximum number of TiMidity voices configurable through the
timidity_voices cvar.
- Added stats lines for the OPL and Timidity MIDI devices.
- Completely changed the way TiMidity volume calculations are done. It
  should now be extremely close to the output a real GUS would produce with
  its official MIDI player (excepting where TiMidity normalizes sample
  volumes). The new equations more closely match what is specified by the DLS
  and SF2 specs (but not quite), so I presume it's also more musically
  correct than what TiMidity (and TiMidity++) do.


SVN r925 (trunk)
2008-04-19 05:57:09 +00:00
Randy Heit 42c80b3ee5 - Updated fmod_wrap.h for FMOD 4.14.
- Set note velocity back to using a linear sounding volume curve, although
  it's now used to scale channel volume and expression, so recompute_amp()
  is still only doing one volume curve lookup.
- Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song.


SVN r920 (trunk)
2008-04-16 20:02:16 +00:00
Randy Heit e7ff22457e - Changed FMOD_INIT_ENABLE_DSPNET use to its replacement from 4.14.00,
FMOD_INIT_ENABLE_PROFILE. Renamed the corresponding cvar to snd_profile.
- Removed the normalize parameter from SoundStream::Play().
- Disabled the chorus and reverb effects added to SDL_mixer's Timidity,
  because they were probably never tested well, either. Thanks to the bug
  in vc_alloc(), they were never even activated.
- Restored the exact frequency range search that was missing from SDL_mixer's
  verion of select_sample().
- Fixed: vc_alloc(), kill_others(), and note_on() treated Voice::status as a
  bit mask, when it's not. These were changes made to SDL_mixer's Timidity.
- Restored the original Timidity volume equation. The other louder one was
  put in when I didn't realize all channels were mono and many notes sounded
  too quiet because they never completed their attack phase.
- Fixed: FileReader::Gets() acted as if fgets() always read the maximum
  number of characters.
- Fixed: FileReader::Open() did not set FilePos and StartPos to 0.


SVN r908 (trunk)
2008-04-13 03:23:33 +00:00
Randy Heit 10c0d67b78 - Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
  event which only has a 1 in 127 chance of being for a note that's playing
  on that channel. Then I decided it would probably be a good idea to reset
  all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
  (copied from the OPL player) improved its sound dramatically, so apparently
  Timidity has issues with short stream buffers. It's now at 1/2 sec in
  length. However, there seems to be something weird going on with
  corazonazul_ff6boss.mid near the beginning where it stops and immediately
  restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
  oscilloscopes and spectrums.
- Internal TiMidity now plays music.
- Changed the progdir global variable into an FString.

SVN r900 (trunk)
2008-04-11 04:59:23 +00:00
Randy Heit 6535283ff1 - Added the FCriticalSection class in critsec.h to make it easier to
use critical sections in other places besides the OPL player.


SVN r896 (trunk)
2008-04-09 04:17:13 +00:00
Christoph Oelckers 935764e8c1 - Added Jim's latest Linux patch
SVN r877 (trunk)
2008-04-03 22:34:52 +00:00
Randy Heit 3a5afd1418 - Added support for dumping from RAW/DRO/IMF files, so now anything that
can be played as OPL can also be dumped.
- Removed the opl_enable cvar, since OPL playback is now selectable as just
  another MIDI device.
- Added support for DRO playback and dual-chip RAW playback.
- Removed MUS support from OPLMUSSong, since using the OPLMIDIDevice with
  MUSSong2 works just as well. There are still lots of leftover bits in
  the class that should probably be removed at some point, too.
- Added dual-chip dumping support for the RAW format.
- Added DosBox Raw OPL (.DRO) dumping support. For whatever reason,
  in_adlib calculates the song length for this format wrong, even though
  the exact length is stored right in the header. (But in_adlib seems buggy
  in general; too bad it's the only Windows version of Adplug that seems to
  exist.)
- Rewrote the OPL dumper to work with MIDI as well as MUS.


SVN r872 (trunk)
2008-04-03 02:31:39 +00:00
Randy Heit f23e9df084 - Fixed: OPLMIDIDevice sent the wrong pitch wheel value to the player code.
Missimp.mid sounds a lot better now, though still a little off.
- Fixed: MIDI files that had ticks with nothing but meta-events did not play
  properly. (fixes sonic3_finalboss.mid)


SVN r868 (trunk)
2008-03-30 02:51:34 +00:00
Randy Heit 930de248fd - Applied Const's Makefile.linux changes.
- Made the OPL MIDI synth available from Linux.



SVN r866 (trunk)
2008-03-30 00:04:09 +00:00
Randy Heit cd70087ed5 - Moved sound sample rate, buffer size, and buffer count to the
advanced sound options menu. Removed opl_enable from the menu.
- Added OPL synth as MIDI device -3. Since this is based on the MUS player
  code, it only supports those events and controllers supported by MUS.
  Some of Duke's MIDIs sound awful, but I think that may be more because
  it's using different instruments... There's a thread in the MIDI streamer
  class that could be taken out for Linux, since it doesn't need to deal
  with the Windows Multimedia API, but for now, this is still Windows-only.


SVN r864 (trunk)
2008-03-29 05:01:38 +00:00
Randy Heit 8f49ea7f48 - Changed the output of the OPL emulator from 32-bit integers to 32-bit
floats, so I can write its output directly to the stream buffer. In
  addition, this lets me bring the OPL volume level much closer to the
  standard MIDI volume.


SVN r863 (trunk)
2008-03-29 01:30:37 +00:00
Randy Heit 938ae1767b - Did some restructuring of the OPL code in preparation for turning it
into a general MIDI player.
- Fixed: Passing false for a stream callback did not stop the stream.
- Removed opl_frequency, since the only time the emulation sounds good is
  when it plays at the exact frequency of a real chip.
- Music no longer plays at all when snd_musicvolume is 0.
- Bumped up snd_sfxvolume and snd_musicvolume default values.

SVN r862 (trunk)
2008-03-28 03:19:18 +00:00
Randy Heit 2b721975dd VERY IMPORTANT NOTE FOR ANYBODY BUILDING FROM THE TRUNK: This commit adds support
for FMOD Ex while at the same time removing support for FMOD 3. Be sure to update
your SDKs. GCC users, be sure to do a "make cleandep && make clean" before
building, or you will likely get inexplicable errors.

- Fixed: If you wanted to make cleandep with MinGW, you had to specifically
  specify Makefile.mingw as the makefile to use.
- Added a normalizer to the OPL synth. It helped bring up the volume a little,
  but not nearly as much as I would have liked.
- Removed MIDI Mapper references. It doesn't work with the stream API, and
  it doesn't really exist on NT kernels, either.
- Reworked music volume: Except for MIDI, all music volume is controlled
  through GSnd and not at the individual song level.
- Removed the mididevice global variable.
- Removed snd_midivolume. Now that all music uses a linear volume scale,
  there's no need for two separate music volume controls.
- Increased snd_samplerate default up to 48000.
- Added snd_format, defaulting to "PCM-16".
- Added snd_speakermode, defaulting to "Auto".
- Replaced snd_fpu with snd_resampler, defaulting to "Linear".
- Bumped the snd_channels default up from a pitiful 12 to 32.
- Changed snd_3d default to true. The new cvar snd_hw3d determines if
  hardware 3D support is used and default to false.
- Removed the libFLAC source, since FMOD Ex has native FLAC support.
- Removed the altsound code, since it was terribly gimped in comparison to
  the FMOD code. It's original purpose was to have been as a springboard for
  writing a non-FMOD sound system for Unix-y systems, but that never
  happened.
- Finished preliminary FMOD Ex support.


SVN r789 (trunk)
2008-03-09 03:13:49 +00:00
Randy Heit 6af5665575 - Fixed: Morphed pig and chicken players made normal human *usefail sounds.
- G_DoSaveGame() now receives the filename and description from its arguments
  rather than global variables, so autosaves and manual saves can be done
  in close proximity to each other without overwriting the parameters for
  one of them.
- Fixed potential buffer overrun in G_SaveGame() and added a check so that
  you can't interfere with saves that are still pending.
- Fixed: P_LineAttack() creates temporary puffs to get damage types, but this
  had the side effect of creating particles for the puff.
- Fixed: The Heretic status bar tried to use the graphic "SELECTBOX" for the
  inventory selector. The correct name is "SELECTBO".
- Fixed: Using allowrespawn for a single-player map would fire off enter
  scripts instead of respawn script because the player wasn't assigned the
  state PST_REBORN.
- Fixed: P_CheckMissileSpawn() now passes the BlockingMobj to
  P_ExplodeMissile() so that it can select the appropriate death state.
- Added the manifest to MinGW-compiled builds of updaterevision so you can
  build under Vista with MinGW without needing administrative privileges.
  (But I still want to know why Vista thinks it needs elevated privileges
  without a manifest telling it otherwise.)
- Using four 0xFF bytes for the final note of an IMF song should signal the
  end of the song.


SVN r733 (trunk)
2008-02-05 23:32:49 +00:00
Randy Heit 2c2261884c SVN r349 (trunk) 2006-10-05 03:30:44 +00:00
Randy Heit c412b42703 - Fixed: cycle_t was still a DWORD and not a QWORD under GCC.
- The stat meters now return an FString instead of sprintfing into a fixed
  output buffer.
- NOASM is now automatically defined when compiling for a non-x86 target.
- Some changes have been made to the integral types in doomtype.h:
  - For consistancy with the other integral types, byte is no longer a
    synonym for BYTE.
  - Most uses of BOOL have been change to the standard C++ bool type. Those
    that weren't were changed to INTBOOL to indicate they may contain values
    other than 0 or 1 but are still used as a boolean.
  - Compiler-provided types with explicit bit sizes are now used. In
    particular, DWORD is no longer a long so it will work with both 64-bit
    Windows and Linux.
  - Since some files need to include Windows headers, uint32 is a synonym
    for the non-Windows version of DWORD.
- Removed d_textur.h. The pic_t struct it defined was used nowhere, and that
  was all it contained.


SVN r326 (trunk)
2006-09-14 00:02:31 +00:00
Christoph Oelckers cf7d8ab43b - Removed the unused sfx_ variables for the chainsaw sounds.
- Fixed map name checks in idclev, hxvisit, for +map and the titlemap.
- Changed handling of Zips so that the patches/, graphics/, sounds/ and
  music/ subdirectories no longer are placed in the global namespace. Instead
  new namespaces are defined. These namespaces aren't merged, however and 
  searching in them either returns a lump inside it or one from the global
  namespace when it doesn't come from a Zip file. Proper order of files is
  still observed though. As a result proper use of the directories inside Zips 
  is strictly enforced now so that for example anything used as a patch must be 
  in the patches/ directory and won't be found anywhere else.


SVN r199 (trunk)
2006-06-19 15:31:10 +00:00
Randy Heit df799ade24 - Fixed GCC 4 warnings in FNodeBuilder::CreateSubsectorsForReal().
- Changed f_finale.cpp/atkstates[] into a static variable, since its
  anonymous type prevents it from being accessed from other files anyway.
- Fixed: The behavior of the eventtail advancement in d_net.cpp/CheckAbort()
  was compiler-dependant.
- Fixed warnings GCC 4 threw up while compiling re2c and lemon.
- Removed __cdecl from makewad.c again. This is already defined as a builtin
  for MinGW, and redefining it produces a warning. (Why is main explicitly
  declared __cdecl anyway?)
- Fixed building ccdv-win32 with GCC 4. GCC 4 creates a memcpy call, which
  won't work because it doesn't get linked with the standard C library.


SVN r135 (trunk)
2006-05-22 01:34:07 +00:00
Christoph Oelckers 07f35a7008 SVN r44 (trunk) 2006-04-14 12:58:52 +00:00
Randy Heit cf11cbdb30 Directory restructuring to make it easier to version projects that don't build zdoom.exe.
SVN r4 (trunk)
2006-02-24 04:48:15 +00:00