Commit Graph
1073 Commits
Author SHA1 Message Date
kichikuou cb4a04ce14 Implement vmString functions for DALK Gaiden 2024-07-28 09:00:40 +09:00
kichikuou 877ca1f74e Implement vmSystem functions for DALK Gaiden 2024-07-28 09:00:40 +09:00
kichikuou d3bd28a0c1 Implement vmFile functions for DALK Gaiden 2024-07-28 08:52:20 +09:00
kichikuou 4e4f0b8683 vmDrawMsg: Implement tags used in DALK Gaiden 2024-07-28 07:58:59 +09:00
kichikuou dfad543f6e Implement vmDalkGaiden HLL 2024-07-28 07:53:12 +09:00
Nunuhara Cabbage 9a1f9e763a Merge pull request #168 from kichikuou/DALKDemo
Add DALKDemo and DALKEDemo HLLs
2024-07-27 07:15:16 -07:00
kichikuou 1a9021e1ed Add DALKDemo and DALKEDemo HLLs
DALKDemo is responsible not only for the opening demo but also for the
UI of the title menu. This change fully implements DALKDemo. DALKEDemo
is stubbed out.
2024-07-27 20:36:35 +09:00
Nunuhara Cabbage 5cca12b0ce Merge branch 'master' of github.com:nunuhara/xsystem4 2024-07-26 21:01:09 -07:00
Nunuhara Cabbage 0aed62f448 Merge pull request #167 from kichikuou/vmGraph
vmGraph changes for DALK Gaiden
2024-07-26 20:49:31 -07:00
Nunuhara Cabbage 37a5f977c3 Merge pull request #166 from kichikuou/vmData
Implement vmData HLL
2024-07-26 20:47:09 -07:00
Nunuhara Cabbage d7c550ea62 parts: fix GetPartsUpperLeftPos{X,Y}
Hitbox is stored in local coordinates. These functions return global
coordinates.
2024-07-26 20:28:55 -07:00
kichikuou da86fd4875 vmGraph changes for DALK Gaiden
The effect API is slightly changed so that it can be used from pre-SACT
graphics engines.
2024-07-27 07:55:32 +09:00
kichikuou aba32d7fab Implement vmData HLL
Used in DALK Gaiden to read DA.ALD.
2024-07-27 07:25:54 +09:00
Nunuhara Cabbage 103976b2b0 parts: use floats to calculate text width
gfx_render_text uses floats for layout, so the parts_text layout should
use floats to match.

This fixes an issue with off-center text in the English version of Rance
01.
2024-07-26 14:41:28 -07:00
Nunuhara Cabbage 0330006b89 parts: implement SetPartsMessageWindowShowLink
The interface to this feature is strange. The message window visibility
state is passed to Update/UpdateParts every frame rather than being a
part of the global parts state. I've implemented it using global state,
which might be subtly wrong in some way, but it seems to work as
expected in Rance 01.
2024-07-25 20:49:30 -07:00
Nunuhara Cabbage 12f3b5d241 Implement ChipmunkSpriteEngine.VIEW_SetOffsetPos
Used for screen quake effect in Rance 01.
2024-07-25 18:29:36 -07:00
Nunuhara Cabbage 673827cf70 parts: implement vibration motion 2024-07-24 20:18:04 -07:00
Nunuhara Cabbage 5212d5b7f9 dap: render parts with children
When rendering parts, render the whole hierarchy instead of just the
individual node.

Also, output parts entities in the format expected by xsys4dbg.
2024-07-24 19:18:13 -07:00
Nunuhara Cabbage bfa2deeffb Fix transition issues in Rance 01
PE_UpdateComponent needs to be called before rendering the starting
frame of a transition effect.

This fixes a glitch in the ●立ち絵 function of Rance 01 when
transitioning to a variant CG.
2024-07-23 19:51:22 -07:00
Nunuhara Cabbage 635cce877f Merge pull request #165 from kichikuou/typo
Fix typo
2024-07-23 06:30:45 -07:00
kichikuou 0bab7544cd Fix typo 2024-07-23 18:10:34 +09:00
Nunuhara Cabbage 48b6e24135 Fix A_SORT_MEM with string members
Fixes various bugs in Rance 01.
2024-07-22 11:50:33 -07:00
Nunuhara Cabbage 423ceb5abc Merge pull request #164 from kichikuou/gpx2plus
Gpx2Plus.Create() should fail if width <= 0 or height <= 0
2024-07-22 06:36:24 -07:00
Nunuhara Cabbage 9b6a032d24 Merge pull request #163 from kichikuou/vmMsgSkip
Implement vmMsgSkip HLL functions
2024-07-22 06:35:45 -07:00
Nunuhara Cabbage 525006d716 Merge pull request #162 from kichikuou/vmArray
Implement vmArray functions for DALK Gaiden
2024-07-22 06:34:41 -07:00
Nunuhara Cabbage 083fd23503 Merge pull request #161 from kichikuou/sys40vm
VM changes for DALK Gaiden (AIN v0)
2024-07-22 06:30:24 -07:00
kichikuou 3f18b181a3 Gpx2Plus.Create() should fail if width <= 0 or height <= 0
This fixes "Incomplete framebuffer" error in Daibanchou.
2024-07-21 14:26:01 +09:00
kichikuou 50ec61ba37 Implement vmMsgSkip HLL functions
Reusing the functions for MsgSkip.
2024-07-21 10:45:36 +09:00
kichikuou f1ad3ddf25 Implement vmArray functions for DALK Gaiden
This also fixes a bug of vmArray.AroundRect (although it does not affect
Mamanyonyo).
2024-07-21 09:14:17 +09:00
kichikuou 936167ee9c VM changes for DALK Gaiden (AIN v0)
- Opcode 0x62 (EOF in later games) is used as SH_STRUCTREF
- The STR0 table does not exist, S_PUSH refers to the MSG0 table instead
2024-07-21 08:21:58 +09:00
Nunuhara Cabbage 52a624009d Merge pull request #160 from kichikuou/ffmpeg
movie_ffmpeg: Use new FIFO API and channel layout
2024-07-03 21:00:12 -07:00
kichikuou 71ead2bf85 movie_ffmpeg: Use new FIFO API and channel layout
This fixes https://github.com/nunuhara/xsystem4/issues/159.

The minimum required ffmpeg version is now 5.1.
2024-07-04 12:48:56 +09:00
Nunuhara Cabbage d56f075ee3 Merge pull request #158 from kichikuou/text
Add a parameter to gfx_draw_glyph() for controlling blending behavior
2024-06-18 17:45:35 -07:00
kichikuou 04d5237020 Use glClear() to initialize texture in gfx_init_texture_rgba()
This is faster when initializing large textures.
2024-06-19 07:45:55 +09:00
kichikuou 6379dbad4b SengokuRanceFont: Draw text on sact_sprite.text.texture
To get consistent rendering results regardless of the background image
on the sprite.
2024-06-15 14:35:01 +09:00
kichikuou b155b4b79f Add a parameter to gfx_draw_glyph() for controlling blending behavior
This adds a new parameter `blend` to `gfx_draw_glyph()`. When `blend` is
true, the function performs normal alpha blending (same as
`gfx_draw_glyph_to_pmap()`).

If `blend` is false, the resulting pixel color will be the text color
and the alpha value will be copied from the glyph texture. However, if
the alpha value is less than 0.01, the pixel will not be written.

If you are drawing on a transparent texture (which will later be blended
into another texture), `blend` should be false. If you are drawing on top
of an image, `blend` should be true.

`gfx_draw_glyph()` used to fill transparent pixels with text color, but
this step is no longer needed and has been removed.
2024-06-15 14:34:58 +09:00
Nunuhara Cabbage d7fd6d4e1e Merge pull request #157 from kichikuou/mamanyonyo
Mamanyonyo support
2024-06-02 14:46:45 -07:00
kichikuou 64fd2a6858 Add HLL libraries for Mamanyonyo
== Handles

As a general pattern, these libraries have an interface based on integer
handles allocated by Open() and released by Close(); in the AliceSoft's
implementation, handles are pointers to internal objects. Note that:

* 0 is used to represent an invalid handle, and
* Small numbers cannot be handles. For example, Mamanyonyo has code that
  treats an integer as a CG number if it is less than 10000, and as a
  surface handle otherwise.

In this patch, handles are generated using id_pool.h functions. In order
to achieve the above, the interface is extended so that the minimum ID
value can be specified (the `base` parameter of id_pool_init()).

== Graphics System

Surface objects (implemented in vmSurface.[ch]) plays a central role in
Mamanyonyo's graphics system, and the sprite system (vmSprite.c) is
implemented on top of it. vmSprite.c uses scene.h functions.

== vmChrLoader and vmMapLoader

Since Mamanyonyo's character data format is the same as Widenyo's,
the ChrLoader code has been refactored and used from vmChrLoader.c.
On the other hand, MapLoader and vmMapLoader do not share code because
the map file format is different from Widenyo.
2024-05-31 13:36:29 +09:00
Nunuhara Cabbage 1ec06a4b80 Merge pull request #156 from kichikuou/sys41vm
VM changes for Mamanyonyo
2024-05-30 18:03:37 -07:00
kichikuou 2840b21946 Sys41VM: Do not unref arrays passed by value to HLL calls 2024-05-29 13:14:48 +09:00
kichikuou 69b1826d63 SR_ASSIGN does not take a struct type in ain v1 2024-05-29 13:14:48 +09:00
kichikuou 69cd1cb630 Add support for S_PLUSA instruction
I'm not sure how it is different from S_PLUSA2.
2024-05-29 13:14:48 +09:00
kichikuou 012f8f8af4 Implement scenario jump for ain v1
In ain v1, destination addresses of scenario jumps are stored in the
SLBL section of the ain.
2024-05-29 13:14:48 +09:00
kichikuou b85b426872 Local struct initialization in Sys41VM (ain v1)
Sys41VM doesn't have the SH_LOCALCREATE instruction, so struct pages
must be allocated when function_call() initializes local variables.
2024-05-29 13:14:48 +09:00
Nunuhara Cabbage 10169951c0 Merge pull request #155 from kichikuou/fix-incomplete-framebuffer
gfx: Clamp texture size larger than GL_MAX_TEXTURE_SIZE
2024-05-25 07:16:01 -07:00
kichikuou 8eefbcec95 gfx: Clamp texture size larger than GL_MAX_TEXTURE_SIZE
This prevents glTexImage2D() from failing and resulting in an invalid
texture if a width or height specified in sact2.SP_Create() is greater
than GL_MAX_TEXTURE_SIZE.

It is very rare and is probably a programming error in the game script.
If the resulting texture is used for rendering, it may mess up the
screen, but at least it won't crash.

Fixes https://github.com/kichikuou/xsystem4-android/issues/4.
2024-05-25 08:11:15 +09:00
Nunuhara Cabbage f73dd38dab Merge pull request #153 from kichikuou/remove_utf8
Fix system.DeleteSaveFile and vmFile.Delete on Windows
2024-05-19 06:46:43 -07:00
kichikuou 9e821a754c Fix system.DeleteSaveFile and vmFile.Delete on Windows 2024-05-19 16:03:48 +09:00
Nunuhara Cabbage f2caed46a8 Merge pull request #152 from kichikuou/little_endian
Use little_endian.h in libsys4
2024-05-18 22:08:14 -07:00
kichikuou 7ef9719cc7 Use little_endian.h in libsys4 2024-05-19 10:59:50 +09:00