Commit Graph
63 Commits
Author SHA1 Message Date
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 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 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 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 37273534cc Set text/menu box locations for Rance 2
Contributed by @RottenBlock.
2025-01-04 08:34:28 +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 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 b08b9f80f2 Add some helper functions to GameId 2024-12-24 12:22:10 +09:00
kichikuou daeef22a29 AGS: Introduce Palette type 2024-12-21 09:55:29 +09:00
kichikuou eab5eb075d Fix out-of-bounds memory access in text rendering
This fixes SEGV in Hashiri Onna II when custom font is used. (#32)
2024-12-11 16:30:42 +09:00
kichikuou 4930154d45 Expose g_nact 2024-12-11 14:03:55 +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 8303f7c770 Refactor FILEIO 2024-12-08 15:06:00 +09:00
kichikuou 48d780add6 Introduce Dri class
It caches the link table.
2024-12-08 13:39:23 +09:00
kichikuou 723e5cef05 Fix crash when font not found
Now NACT::fatal() immediately exits the process.
2024-04-06 08:31:37 +09:00
kichikuou 7b7394e5fe Fix use-of-uninitialized-value for text_font_maxsize
This fixes https://github.com/kichikuou/system3-sdl2/issues/25.
2023-04-15 09:29:18 +09:00
kichikuou 7f6a085f56 Scanline screen effect
It can be activated by the -scanline command line flag, system3.ini, or
the menubar on Windows. Effective especially for games with 200-line
screen mode, such as Little Vampire and Intruder.
2023-04-09 18:23:42 +09:00
kichikuou ec1dfbffcf Use non-square pixels for Gakuen Senki
Stretch 512 horizontal pixels to 582 pixels. This is the same pixel
aspect ratio used by WebMSX.

Also set SDL_HINT_RENDER_SCALE_QUALITY to "linear", to improve the
scaling quality.
2023-04-09 18:23:39 +09:00
kichikuou 24224e0d2b Merge some changes from SysEng 0.7 (for Gakuen Senki port) 2023-04-09 15:17:33 +09:00
kichikuou 32f4c0f945 Improve anti-aliasing quality of non-white text
By presetting palette.
2023-04-06 21:17:51 +09:00
kichikuou 6d6d5ca829 Reset RenderDrawColor after changing it for fading
Otherwise, the next SDL_RenderClear() will fill the screen with that
color, including areas outside the viewport.
2023-03-25 16:13:55 +09:00
kichikuou 2cb0b2a2a2 Reuse SDL_Renderer after VM reset
Otherwise mouse input doesn't work after restart in emscripten port.
2022-06-26 15:00:23 +09:00
kichikuou cc75dd7c94 Convert linebreaks from CRLF to LF 2022-04-03 11:34:48 +09:00
kichikuou dc471399e5 Rewrite fade in / fade out implementation
Before this change, fade in and fade out was implemented using a
16-steps dithering pattern.

Now fading uses alpha-blending. It behaves like the PC98 version, where
fading was done by palette animation.

This reduces `sizeof(AGS)` by 1.2MB.
2021-11-20 17:09:17 +09:00
kichikuou 98038a5c74 Do not use SDL_RWFromFile on Windows
It does not work in the MSVC build of SDL2 (although it works in
Mingw-w64's SDL2 package).

Fixes #11.
2021-07-08 17:08:20 +09:00
kichikuou 52eea935fe Android: Allow specifying custom fonts in system3.ini
Now custom font files specified in system3.ini (as relative paths from the
game directory) can be loaded correctly.
2021-06-06 22:08:07 +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 56bb588ca7 Support building with Microsoft Visual Studio 2021-01-02 09:10:51 +09:00
kichikuou 75cbb2bcef Windows: Add "Save Screenshot" menu command 2020-12-31 14:17:55 +09:00
kichikuou f2139440b6 Defer rendering to idle time
SDL_RenderCopy / SDL_RenderPresent was called too often, which sometimes
caused screen update to fail on Mac.
2020-11-29 12:06:08 +09:00
kichikuou 9637701340 Windows: Implement reset menu command
A bit hacky but works.
2020-10-10 15:26:01 +09:00
kichikuou a0af5ef10c Windows: Embed default font as a resource
After this, embedded MTLc3m.ttf is used unless the -fontfile option is
specified.
2020-05-24 22:01:32 +09:00
kichikuou 49b4ac4053 Merge upstream changes: Merge AGS changes
- Added initial text / menu positions for newly-supported games
- convert_zenkaku and convert_hankaku are now public
- load_cg supports Ayumi Floppy
- VSP: A transparency value of 101 now ignores get_palette
2020-05-23 09:52:16 +09:00
kichikuou 657057fa64 Merge upstream changes: CRC32 updates
- Check CRC32 of both ADISK.DAT (storead as crc32_a) and BDISK.DAT (crc32_b)
- Update the CRC32 database adding more titles
2020-05-22 16:09:55 +09:00
kichikuou 7a1cc2a483 Convert all Shift_JIS files to UTF-8 2020-02-24 18:06:38 +09:00
kichikuou 20ba438300 Unify executables
Instead of building multiple executables using #ifdefs, create a single
executable (still called "system3") that can run all System1-3 games.
2020-02-22 16:15:47 +09:00