Commit Graph
251 Commits
Author SHA1 Message Date
kichikuou 7f527da74f nact: Change tvar from char array to std::string 2025-06-06 14:51:38 +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 d5de8b18b8 Enable Y 240 (draw_hankaku) in System2 2025-04-24 21:00:38 +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
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 c0d8566dbd AGS: Refresh screen when palette is changed by CG loading 2025-02-22 22:26:18 +09:00
kichikuou 446d34132a AGS: Defer texture update until update_screen() 2025-02-22 15:24:27 +09:00
kichikuou 3f55a90c64 AGS: Remove intermediate screen buffer
Pixels are now copied directly from the 8-bit buffer to the texture.
2025-02-10 07:38:45 +09:00
kichikuou bf9742533f AGS: Move scroll handling to update_screen()
This fixes an out-of-bounds access bug when scroll > 400.
2025-02-09 14:42:52 +09:00
kichikuou b1dfc57e9b AGS: Refactor palette loading logic 2025-02-09 11:06:37 +09:00
kichikuou c205806d7b Fix header include paths 2025-02-08 12:55:14 +09:00
kichikuou aae15c34e1 AGS: Update draw_push() to use draw_gaiji() 2025-01-19 11:09:00 +09:00
kichikuou 43d1af3a44 AGS: Refactor text layout logic 2025-01-19 10:41:14 +09:00
kichikuou ff00165f47 AGS: Refactor Box struct 2025-01-18 15:37:15 +09:00
kichikuou fad34f7bb9 Refactor text / menu window code 2025-01-18 15:37:13 +09:00
kichikuou 32a510d543 Add AGS::load() and AGS::save() 2025-01-18 14:41:14 +09:00
kichikuou 11a366005f AGS: Refactor VRAM accessors 2025-01-17 15:13:32 +09:00
kichikuou 1673a5eb3c AGS: Refactor palette management to use SDL_Palette 2025-01-17 13:47:10 +09:00
kichikuou 12e7804d9f AGS: Use SDL drawing functions 2025-01-17 10:58:50 +09:00
kichikuou ca2ca7276f AGS: Use SDL_Surface to save / restore screen 2025-01-17 10:58:50 +09:00
kichikuou 33418f8cb5 AGS: Make VRAM 8 bits per pixel
Before this, the virtual VRAM was 32 bits per pixel, with each pixel
holding an 8-bit index color or 0x80RRGGBB. The latter was for Ayumi-
chan Monogatari Jisshaban, which has been unsupported since system3-sdl2
was forked from System3 for Win32.

This change removes the 0x80RRGGBB format and makes the virtual VRAM 8
bits per pixel.
2025-01-17 10:58:46 +09:00
kichikuou 7f0bae6f74 Remove unnecessary SDL_{Lock,Unlock}Surface calls 2025-01-16 15:26:19 +09:00
kichikuou fad7a843f0 Add NACT_Rance4 and NACT_Toushin2
These games are still unsupported, but at least they should not crash
due to command parsing errors.
2025-01-11 13:27:18 +09:00
kichikuou 4f4077a9c8 Add game IDs for unsupported titles 2025-01-11 11:47:19 +09:00
kichikuou d676a68b95 Add TRACE_UNIMPLEMENTED macro 2025-01-11 10:59:23 +09:00
kichikuou d8c20c94be NACT: Handle unused commands in base class 2025-01-11 10:37:19 +09:00
kichikuou cb937e97ca NACT_Sys[12]: Refactor wait macros 2025-01-11 10:25:06 +09:00
kichikuou 5d1b8f82cf Refactor NACT_Sys1 introducing inheritance-based structure
System1 commands have very different meanings from game to game
(especially the Y and Z commands), so this moves game-specific logic to
separate derived classes (e.g., NACT_LittleVampire, NACT_GakuenSenki)
for better modularization.
2025-01-11 10:25:03 +09:00
kichikuou d98b2884ed Refactoring: Move declaration of NACT_Sys* classes to cpp files 2025-01-05 08:14:02 +09:00
kichikuou 37273534cc Set text/menu box locations for Rance 2
Contributed by @RottenBlock.
2025-01-04 08:34:28 +09:00
kichikuou ceadba8f4d Load GDISK.DAT and GG00.DAT if game_id is rance2_hint
AG00.DAT on the hint disk must be renamed to GG00.DAT to avoid conflicts
with AG00.DAT of the main game. This is the setup used in the Ryu1's
porting kit (http://www.ryu1.jp/alice/r2port.html).
2025-01-03 13:17:22 +09:00
kichikuou 67b6d71232 Clean up 2025-01-03 13:17:18 +09:00
kichikuou 15c9d0e820 RottenBlock's changes for Rance 2 Hint Disk 2025-01-03 13:17:12 +09:00
kichikuou ffe11c695e Reorganize initialization error reporting
- Invalid game id -> sys_error() in GameId::GameId()
- Unknown crc32 -> SDL_ShowSimpleMessageBox() in GameId::GameId()
- Cannot open ADISK.DAT -> sys_error() in NACT::NACT()
2025-01-03 12:36:27 +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 1a53c50c75 Rework NACT command tracing
- Now tracing is not a build-time config but a runtime option (`-trace`)
- One command per line, so that traces are not mixed with other outputs
- Send traces to DAP client
- Fix garbled characters in non-SJIS environments
2025-01-02 16:53:01 +09:00
kichikuou 6800258113 NACT: Add warnings for unimplemented Y commands 2025-01-02 10:54:21 +09:00
kichikuou ddc790b268 Add error message when game files not found 2024-12-31 22:05:04 +09:00
kichikuou 64b3e2a284 dabugger: Add support for custom DAP messages for palette changes
This implements "xsystem35.palette" custom request and
"xsystem35.paletteChanged" custom event, introduced in
kichikuou/xsystem35-sdl2@4b15f45.
2024-12-28 14:09:57 +09:00
kichikuou 909140f3bc Add support for Debug Adapter Protocol 2024-12-28 14:09:56 +09:00
kichikuou 8883bd5d68 Add command line debugger 2024-12-28 14:09:53 +09:00
kichikuou d6e3cb8415 Scenario: Label / page calls share a single call stack
This allows the debugger to present a linear backtrace.
It's still possible to return from the other call type.
2024-12-27 16:08:58 +09:00
kichikuou a13719d84c AGS: Fix a bug in GAIJI.DAT loading code
There was a bug in the JIS to Shift_JIS conversion code, causing out-of-
range access to the gaiji array. Since the conversion was not necessary
in the first place, the indexes to the array are now calculated directly
from JIS code points.
2024-12-27 14:47:20 +09:00
kichikuou 2498669da3 NACT: Refactor data structure for menu 2024-12-24 13:46:47 +09:00
kichikuou b08b9f80f2 Add some helper functions to GameId 2024-12-24 12:22:10 +09:00