100 Commits
Author SHA1 Message Date
kichikuou 461673bec7 emscripten: Do not use SDL_WINDOW_HIGH_PIXEL_DENSITY in SDL3
The web shell scales the canvas to its final display size.  Enabling a
high-density backbuffer would make SDL scale to device pixels first,
followed by another scaling pass in the browser.
2026-09-17 08:59:13 +09:00
kichikuou 981c302dfc Migrate Android from SDL2 to SDL3
Make SDL3 the default and only supported SDL version for Android. Download
the official SDL3 Android AAR during Gradle configuration and expose it to
the native CMake build through Prefab. SDL_ttf 3 is built from source with
HarfBuzz and PlutoSVG disabled.
2026-09-16 09:24:40 +09:00
kichikuou 3e32da1d37 Add SDL3 support alongside SDL2
Add optional SDL3 support while keeping SDL2 as the default. SDL3 builds
must be selected explicitly with the SYSTEM3_SDL_VERSION CMake option.

Centralize most SDL2/SDL3 API differences behind compatibility interfaces.
Audio playback uses a dedicated SDL3 backend based on SDL3 audio streams,
implemented separately in mako_sdl3.cpp.

Android and Nintendo Switch remain on SDL2 for now.
2026-09-16 08:44:23 +09:00
kichikuou 647a5aa326 Split music playback from decoding
Move the playback stream into generic/mako.cpp and leave the file
format decoders in music_decoder.cpp.
2026-09-16 07:21:31 +09:00
kichikuou 3ce86d3bde Update Visual Studio build instructions 2026-09-14 11:31:04 +09:00
kichikuou 630fec153c Use scenario filename for debugger symbols 2026-09-09 11:18:16 +09:00
kichikuou 0fc5ad3f43 Reorganize nact.h 2026-09-03 14:53:32 +09:00
kichikuou 5570962a38 Reorganize ags.h 2026-09-03 13:41:39 +09:00
kichikuou 9e1e0e91b3 Remove g_nact references from ags.cpp 2026-09-03 13:25:51 +09:00
kichikuou 3f98902d98 Remove SCREEN_MENU 2026-09-03 10:16:32 +09:00
kichikuou 39f3f15282 Split TextContext into style and position
And give the two style members more specific names.
2026-09-03 09:43:15 +09:00
kichikuou 6fa1ae9a26 Refactor menu construction 2026-09-03 09:27:08 +09:00
kichikuou fcffc7ab78 Introduce ScreenId enum 2026-09-02 17:19:23 +09:00
kichikuou 4c9aee4e67 Windows: Do not allocate a console if stdout is usable
init_console() unconditionally reopened stdout, stderr and stdin on a
newly allocated console. Since ad33e72 this also happens for
`-texthook print`, which made the scenario tests fail because ctest
could no longer read the output of the process.
2026-09-02 17:12:05 +09:00
kichikuou 783584d176 Drop cursor_color and unused includes 2026-09-02 12:28:41 +09:00
kichikuou 0b4a95aca6 Move text contexts to NACT 2026-09-02 12:28:14 +09:00
kichikuou 8b2a2d8a5e Move menu_w[] and text_w[] from AGS to NACT 2026-09-02 11:57:14 +09:00
kichikuou 4a58251afd Move CG display flags to NACT 2026-09-02 11:41:24 +09:00
kichikuou 8a12fc50e7 Move box[] from AGS to NACT 2026-09-02 09:13:48 +09:00
kichikuou 0908fcd643 Move save/load display state to NACT 2026-09-02 09:10:38 +09:00
kichikuou ad33e72485 Windows: Allocate a console for -texthook print 2026-08-29 12:15:59 +09:00
kichikuou ca0f09a19e Version 1.8.0 2026-08-29 10:22:15 +09:00
kichikuou 3c7d032b78 game_compatibility.md: Mark Gakuen KING as supported 2026-08-29 10:12:26 +09:00
kichikuou dc6ed66746 Gakuen KING: K1 keeps moving while mouse button is held
Also move the pointer to the key panel on a right click in the map.

These match the System3.5 port's behavior.
2026-08-29 09:29:38 +09:00
kichikuou e0ca6ea2fb AGS: Rename draw_screen() to invalidate_screen() 2026-08-29 08:33:05 +09:00
kichikuou a9d9c32405 Gakuen KING: Draw key wait icon from GAKUEN.COM 2026-08-29 08:29:46 +09:00
kichikuou 882b380525 Fix resource names of built-in MDA files
Dri::load_mda() referenced 26 of the built-in MDAs without the ".MDA"
suffix, so open_resource() never found them.

Also add the missing cases for Rance 4 and Gakuen KING.
2026-08-29 07:58:36 +09:00
kichikuou 4e10e37444 Rename GameId::GAKUEN to GameId::GAKUEN_SENKI
To clearly distinguish it from Gakuen KING. The game id remains `gakuen`
for backward compatibility.
2026-08-29 07:09:54 +09:00
kichikuou e2afd77ec9 System3: Fix Y 4 1 (random) to return 1
Gakuen KING's original implementation returns 1 for num=1; it returns 0
only when num is 0.

The line dates back to the initial upstream import and had never been
changed. nact_sys1.cpp and nact_sys2.cpp still have the same expression
but they are left alone.
2026-08-26 18:12:39 +09:00
kichikuou 9cfadab36f Gakuen KING: Animate map view scrolling
This is an enhancement over the original. The original draws each map
redraw at its new position at once, then waits for the movement
interval. Compose the view into an offscreen screen and slide it into
place over that same interval, interpolating the sprite alongside it,
for smooth scrolling. Redraws that move more than one cell still snap.
2026-08-25 08:32:38 +09:00
kichikuou a82638c142 Gakuen KING: Draw the cursor on the I command grid
The original leaves the selection feedback to the mouse pointer,
which may be missing or impossible to move in system3-sdl2. Draw the
mouse cursor image extracted from GAKUEN.COM on the grid while the
keyboard drives the selection.
2026-08-24 16:29:15 +09:00
kichikuou 6bd5baf7c2 Implement game specific commands for Gakuen KING 2026-08-24 16:29:09 +09:00
kichikuou 64f8e7bf9f Extract NACT_GakuenKing into a separate file 2026-08-22 08:46:47 +09:00
kichikuou 44b5c46232 emscripten: Add JSPI build option 2026-08-21 08:54:22 +09:00
kichikuou 0d4884f6ba Fix key release masks for A, Y1 (Sys1) and Y253 (Sys2)
These commands should wait for release of all direction keys + RETURN,
instead of only RIGHT and RETURN.
2026-08-21 07:42:37 +09:00
kichikuou 167bc54dc0 Add -fullscreen option 2026-08-17 09:04:06 +09:00
kichikuou 64e99b9235 Add headless scenario tests
Run a compiled System 1/2/3 scenarios with SDL's dummy video and audio
drivers, and report failures through the text hook and exit status.
2026-08-08 08:16:38 +09:00
kichikuou 6f5933adaf Replace SDL_mixer with dr_mp3/stb_vorbis + SDL audio
- MP3/OGG files are now decoded with dr_mp3 and stb_vorbis via the new
  MakoMusic backend.
- Merge src/win/mako.cpp into src/generic/mako.cpp: Windows now uses the
  same SDL audio path.
- A single SDL2 audio device mixes FM, BGM and PCM in its callback with
  SDL_MixAudioFormat.
- PCM plays through SDL_AudioStream.
- dr_mp3 and stb_vorbis are vendored under deps/ and included from
  mako_music.cpp. Warnings for that translation unit are silenced.
2026-08-03 17:09:59 +09:00
kichikuou 21d2e5fb94 show_quit_dialog: Default to quitting if SDL_ShowMessageBox fails 2026-07-31 09:33:50 +09:00
kichikuou 76ff13d873 Android: Isolate game execution process
Run GameActivity in a private :game process and terminate it after SDL
shutdown completes, ensuring that each game starts with fresh native
state.

Refresh the launcher game list from disk when it resumes instead of
using the process-local Launcher singleton from GameActivity.
2026-07-19 11:03:52 +09:00
kichikuou 88d6d0a743 Android: Keep launcher install state in Launcher
Move ZIP install jobs from GlobalScope to a Launcher-owned coroutine
scope and store progress, success, and failure in InstallState. This
lets a recreated LauncherActivity render the current install state and
consume completed results once, even when observer callbacks happened
while the activity was absent.
2026-07-19 10:58:22 +09:00
kichikuou df6f1bac73 Android: Prevent ZIP path traversal in launcher 2026-07-19 10:47:02 +09:00
kichikuou efd00575f9 Merge pull request #38 from RottenBlock/patch-1
updated R4.x English CRC32s, corrected comment version #s
2026-07-18 12:28:33 +09:00
kichikuou 55c9f61a30 MSVC: Update SDL2_ttf to 2.24.0 for CMake 4 compatibility 2026-06-22 13:27:46 +09:00
kichikuou 9640fa2dd9 CI: Fix MSVS build by not pinning the VS generator version 2026-06-22 13:11:22 +09:00
kichikuou 8212548376 Use std::string_view in Encoding and AGS::draw_text() 2026-05-02 11:35:03 +09:00
kichikuou 0461d95999 Suppress -Warray-bounds for ymfm
ymfm's fm_engine_base::output() contains OPL-specific rhythm code that
accesses m_operator[13]/[17], which is out-of-bounds when instantiated
for OPN (OPERATORS=12). The code is unreachable at runtime because
rhythm_enable() returns false for OPN, but newer clang (emscripten) flag
it statically.
2026-04-14 20:25:58 +09:00
kichikuou 24ef2289cc CI: Fix emscripten build failure 2026-04-12 22:46:31 +09:00
kichikuou 891c9cbbfb CI: Update GitHub actions 2026-04-12 22:44:37 +09:00
kichikuou f04319b8b5 Version 1.7.2 2026-02-10 10:17:19 +09:00
kichikuou 86c0ef4841 Ignore zero palette entry in Gakuen Senki
This prevents unused palette portions of loaded CG from cluttering other
parts of the screen.
2026-02-08 15:10:27 +09:00
kichikuou 527f574a48 Force FM/MIDI audio when CD audio is not available
If CD audio is not available (no playlist) but CD playback is specified,
MAKO::play() falls back to FM/MIDI.

Also, on Windows, gray out the "CD Audio" menu item if CD audio is not
available.
2026-02-07 09:04:35 +09:00
kichikuou 852d82ef2c Version 1.7.1 2026-01-16 07:45:34 +09:00
kichikuou 703d90beb8 android/README.md: Add Obtainium installation instructions 2026-01-16 07:45:34 +09:00
kichikuou 556ed70b37 Android: Remove playlist migration logic
It malfunctioned when the game ZIP contained playlist.txt.

Fixes #36.
2026-01-16 07:45:30 +09:00
kichikuou 0187d0f216 System3: Implement CD availability check
The `Y14,2:` command (`Y20,2:` in Gakuen KING) now returns zero if CD
audio is not available (i.e. playlist is not loaded).
2025-11-28 10:41:20 +09:00
kichikuou 300099be5e Version 1.7.0 2025-11-27 09:16:24 +09:00
kichikuou ad73ed9271 Refactor key release handling in NACT commands 2025-11-27 08:49:51 +09:00
kichikuou fe17265cfb Fix ymfm timing issues by queuing register writes
Rapid register writes could cause audio glitches [1].
This introduces a queue to process one write per audio generation cycle.
This approach is the same as the one used in ymfm's vgmrender.cpp.

[1] https://github.com/aaronsgiles/ymfm/issues/1
2025-11-27 08:11:18 +09:00
kichikuou 257dc9c415 Y240,1 should still convert hankaku Japanese characters to zenkaku
This fixes Shade's comments in the music mode of Gakuen King.
2025-11-25 15:46:00 +09:00
kichikuou cba31e264a Implement commands for Gakuen King's music mode
This adds minimal command support to enable Gakuen King's music mode:

- P: Set text color
- I: Allow user to select a grid item using mouse/keyboard input
- Y25: Switch text window
- Y118: Set text X coordinate
- Y119: Set text Y coordinate

The meanings of these commands were investigated from the implementation
of Gakuen King's system3.5 port.
2025-11-25 15:46:00 +09:00
kichikuou a051baf5af Refactor CG constructor 2025-11-11 13:08:47 +09:00
kichikuou 0c68777226 Refactor AGS::Window struct 2025-11-11 12:38:44 +09:00
kichikuou 8f36143ce5 Refactor CG destination handling 2025-11-11 09:11:44 +09:00
kichikuou 13dbdfc4c1 Fix non-square pixels for Gakuen Senki
This was a regression by commit bf97425.
2025-11-09 16:43:54 +09:00
kichikuou 8b813e3631 Add Streamer Mode with -censor option
This introduces "Streamer Mode" to mosaic specified NSFW images, making
the game suitable for streaming or public viewing. This feature is
enabled via the '-censor <file>' command-line option, which takes a file
containing a list of image numbers to be filtered.
2025-11-09 12:08:25 +09:00
kichikuou 49cf5d55ed Refactor CG loaders
Now they return a newly introduced CG object instead of writing directly
to VRAM. The palette is still written directly in the load functions.
2025-11-09 10:41:00 +09:00
kichikuou 75e99d3fbc Version 1.6.2 2025-11-04 10:58:17 +09:00
kichikuou a819fafd56 Android/Windows: Update SDL to 2.32.10 2025-11-04 10:44:34 +09:00
kichikuou 51ab709da7 Advance messages by scrolling mouse wheel down
Now the 'A' command accepts mouse wheel down events in addition to
keyboard and mouse buttons.
2025-11-04 10:17:30 +09:00
kichikuou a911d71b57 CI: Disable debugger on mingw32
nlohmann-json MSYS2 package is no longer provided for mingw32.
2025-11-04 09:27:23 +09:00
kichikuou f9039adf1d Update game_compatibility.md
にせなぐりまくりたわあ is unsupported.
2025-11-04 09:02:35 +09:00
kichikuou 098c19bf1a Enable Y10 command (ignore palette for specified CG) in System2 2025-11-03 11:30:39 +09:00
kichikuou 58d0782781 Fix off-by-one bug in box initialization for sdps and prog_fd
This was a regerssion introduced by commit ff00165.
2025-11-03 08:34:26 +09:00
kichikuou 6de68d7337 Windows: Add NOMINMAX compile definition 2025-06-20 08:21:35 +09:00
kichikuou febee3f5a3 Refactor savefile path handling 2025-06-06 16:13:02 +09:00
kichikuou bce04adf82 Do not include SDL.h from common.h 2025-06-06 15:04:35 +09:00
kichikuou 7f527da74f nact: Change tvar from char array to std::string 2025-06-06 14:51:38 +09:00
kichikuou aef2822bc4 Add <stdint.h> include
This fixes #35.
2025-06-06 13:46:31 +09:00
kichikuou 8a88a5c06e Remove int{8,16,32} typedefs 2025-06-06 13:46:31 +09:00
kichikuou fca8cb15a8 Version 1.6.1 2025-06-06 09:43:21 +09:00
kichikuou 6e959be871 Fix MSVS build 2025-06-06 09:41:11 +09:00
kichikuou e1287e5b86 load_pms: Abort decoding when pixel data is insufficient
This fixes https://github.com/kichikuou/system3-sdl2/issues/34.

Some PMS in Rance 4.1/4.2 fan English translation have one less row of
pixel data than image height.

When such data is encountered, decoding stops. The image rows decoded
up to that point are transferred to VRAM.
2025-06-06 09:31:03 +09:00
kichikuou 073da3464b AGS: Refactor CG loading functions to take std::vector<uint8_t>& 2025-06-06 07:32:56 +09:00
kichikuou 734a77c1f0 Version 1.6.0 2025-04-26 08:17:51 +09:00
kichikuou d5de8b18b8 Enable Y 240 (draw_hankaku) in System2 2025-04-24 21:00:38 +09:00
kichikuou 04deb9061a README.md: Add Compatibility section 2025-04-23 12:42:47 +09:00
kichikuou cc528619dd s2utbl.h: Add PC-98 box-drawing characters
<0x86A2> (U+2500, BOX DRAWINGS LIGHT HORIZONTAL) is used in Funny Bee
and Only You.

Note that these are not part of CP932, so they should not be added to
the unicode table of xsystem35/xsys35c.

This also makes the tables const.
2025-04-23 12:42:47 +09:00
kichikuou 071c9bc062 emscripten: Export HEAPU8 and HEAP16
Used in Kichikou on Web shell.
2025-04-21 10:14:37 +09:00
kichikuou 4d61c84482 Move game compatibility table to game_compatibility.md 2025-04-13 08:59:41 +09:00
kichikuou 6e84b73064 Update android/README.md 2025-04-10 10:40:21 +09:00
kichikuou aedfa185c7 Android: Move "Install from ZIP" to options menu and add help message
For consistency with xsystem4-android.
2025-04-10 10:11:33 +09:00
kichikuou f6bc689fcb Android: Support audio file names prefixed with track numbers 2025-04-10 09:27:44 +09:00
kichikuou a7e1c5c32e Version 1.5.1 2025-03-23 14:31:30 +09:00
kichikuou 29770d7091 Android: Upgrade AGP to 8.7.3 and bump minSdkVersion to 21
So that it builds with the latest Android Studio.
2025-03-08 09:18:25 +09:00
kichikuou 258f63e98c Android/Windows: Update SDL to 2.32.2 2025-03-06 10:50:18 +09:00
kichikuou 2ff7156b4e Android: Remove 3-finger-touch menu 2025-03-06 08:55:01 +09:00
kichikuou c8ef298c56 Add quit confirmation dialog
On Android, the back button opens the dialog.
2025-03-06 08:54:57 +09:00
kichikuou 9733caf10f debugger: Update screen before entering REPL 2025-03-05 16:01:56 +09:00
kichikuou ae5592a35b pms: Fix palette mask handling
The PMS palette mask is 16 bits, not 8 bits. This fixes a color issue in
Rance 4.1.
2025-03-05 15:13:08 +09:00