Commit Graph
29 Commits
Author SHA1 Message Date
kichikuou d97d49dbe7 Fix Y103 command (play_pcm)
* The parameter is the number of times to loop, e.g. Y103,2: will play
  the sound twice. This still does not work on Windows because
  PlaySound() does not support specifying the loop count.
* Get AMSE data size from its header. This fixes audio glitch at the end
  of sounds.
2025-03-04 15:59:22 +09:00
kichikuou c205806d7b Fix header include paths 2025-02-08 12:55:14 +09:00
kichikuou a274aaee57 GameId: Remove '_ENG' variants from Game enum
Use GameId::language field if necessary.
2025-01-03 08:52:30 +09:00
kichikuou 7f7ff91439 GameId: Replace CRC32 with enum
This makes it possible to define games that do not have a CRC32.
2025-01-03 08:52:27 +09:00
kichikuou 9173742ffb Introduce GameId class 2024-12-11 10:43:28 +09:00
kichikuou e79f24d8b9 Replace NACT::fatal() with global sys_error() 2024-12-10 07:54:56 +09:00
kichikuou 48d780add6 Introduce Dri class
It caches the link table.
2024-12-08 13:39:23 +09:00
kichikuou 4174e0c1bb Refactor DRI 2024-08-17 12:59:36 +09:00
kichikuou 480548191f Add -mididevice option 2024-08-17 08:50:22 +09:00
kichikuou 41e69d7610 Real-time MIDI playback using RtMidi
Before this, MIDI playback was done by generating an SMF data stream,
which was then played using platform-specific methods (MCI on Windows,
MediaPlayer on Android, SDL_Mixer on other platforms). However, this
approach had an issue where the Y18 command (which reads loop counts and
markers) did not work correctly.

With this change, the MAKOMidi class now uses the RtMidi library to
control MIDI devices in real-time. This approach was used in the
original "System3 for win32", but has now been made cross-platform.

The dependency on RtMidi is optional. If RtMidi is not available at
build time or a MIDI device is unavailable at runtime, FM synthesis will
be used.
2024-08-16 10:11:41 +09:00
kichikuou be18e06e09 Fix MAKO::check_music()
This fixes infinite loop in the opening demo of Only You, waiting for
the end of the music.
2023-03-17 15:53:52 +09:00
kichikuou 0c8903920a Switch FM sound emulator to ymfm 2022-08-07 15:55:07 +09:00
kichikuou cc75dd7c94 Convert linebreaks from CRLF to LF 2022-04-03 11:34:48 +09:00
kichikuou bc3580e4ef Implement MAKO::get_mark() for FM sound
It still does not work for MIDI.
2021-09-18 21:05:38 +09:00
kichikuou 0f4984bef5 Introduce Config struct
For now, it's just a container for command line arguments.
2021-06-06 16:18:17 +09:00
kichikuou 20e06235d2 Add CRC32 for English translations of Little Vampire / Rance 4.x
Note that these are still in beta; CRC32s may change.
2021-03-17 20:47:01 +09:00
kichikuou 60a0b43831 Fix warnings in MSVS build 2021-01-02 10:45:38 +09:00
kichikuou 4621c13b75 Do not stack-allocate MAKOMidi
It causes stack overflow in MSVS build.
2021-01-02 10:04:59 +09:00
kichikuou 33a0595016 Windows: Add "MIDI Sound" menu item
Now "FM Sound" really means FM sound, not MIDI.
2020-12-11 17:15:12 +09:00
kichikuou 2de55f9f4d Windows: FM sound support 2020-12-11 16:49:48 +09:00
kichikuou 602c309c47 Android: Add system menu
The system menu opens with 3-finger touch. Currently, it can only exit
the game.
2020-11-29 18:27:50 +09:00
kichikuou 4b4053cf1e Add -fm command line option 2020-11-21 14:01:38 +09:00
kichikuou f4f8b7d104 Fix use-after-free in MCIThread::close() 2020-10-26 18:39:43 +09:00
kichikuou c4c17854f9 MAKO: select_sound() sets title-dependent values in cd_track
Fixes #6.
2020-10-24 18:15:11 +09:00
kichikuou 9ddbf01d23 Minor refactoring of MAKO
- Move select_sound() from NACT to MAKO
- Make cd_track private
2020-10-24 17:53:07 +09:00
kichikuou bb9fc273ac Windows: Move MCI operation to a background thread
MCI is very slow to open a MIDI file. Not to block the main thread for
hundreds of milliseconds, this moves MCI calls to a separate thread.
2020-10-17 15:59:28 +09:00
kichikuou 520b542fcc Introduce NACT::on_syswmevent()
This is in preparation for adding more handlers for platform-specific
window messages (e.g. menu commands).
2020-10-10 15:26:01 +09:00
kichikuou c8b3cd182c Fix a bug of BGM loop in Windows
The info structure must be initialized with the SDL version before
calling SDL_GetWindowWMInfo.
2020-05-16 20:40:38 +09:00
kichikuou 9f5f4e6843 Add Windows native implementaton of MAKO
The MIDI synthesizer bundled with SDL_Mixer doesn't sound as good as
Windows' built-in software synthesizer.

This adds Windows native implementation of MAKO as win/mako.cpp. It
plays MIDI by writing out SMF to a temporary file and play it with MCI.
CD emulation (--playlist) is also implemented using MCI.
The PCM implementation is copyed from TOTO's original Win32 impl.

This removes SDL_mixer dependency in Windows.

Fixes #1.
2020-05-16 17:36:23 +09:00