kichikuou
b9f4c7c03a
Compatibility fix for Bx commands
...
These commands accept 0-127 as valid window numbers, which were 1-128
before this change.
To maintain savedata compatibility, window positions are saved in the
order 1,...,127,0.
2023-02-18 21:45:39 +09:00
kichikuou
2d2c6aa373
Remove strvar_len
...
The length limit of string variables was removed a long time ago, but it
was recorded in save files.
Now the first argument of MZ0 is completely ignored (as in System3.9).
The maxlen field in the save file is set to a constant so that older
versions of xsystem35 can load it.
2023-02-18 14:55:02 +09:00
kichikuou
850af6d140
Refactor implementation of LE and QE commands
2023-02-18 14:47:28 +09:00
kichikuou
da4cf017bf
Clean up savedata.h
2023-02-18 14:47:25 +09:00
kichikuou
e88dfcdaa1
Move load_cg_with_file to cg.c
2023-02-18 09:27:21 +09:00
kichikuou
db2bb03fdd
Add -help description for -game option
2023-02-12 09:12:09 +09:00
kichikuou
5ef949ae14
Refactor ags_setWindowTitle()
2023-02-11 21:40:14 +09:00
kichikuou
eace5d1dbd
Refactor game-specific hacks, add -game option
...
It's now possible to enable certain game-specific hacks by using the
`-game` command line option or the `game` property in the .xsys35rc
file.
2023-02-11 15:27:38 +09:00
kichikuou
ae8becc4a3
Fix menuReturnGoto when stack top is not a return address
2023-02-10 21:24:13 +09:00
kichikuou
1d863cfb2e
Implement UR command
2023-02-10 20:56:53 +09:00
kichikuou
7bb2bee693
Label return should pop TPx
2023-02-10 20:56:53 +09:00
kichikuou
47e7f5542e
Remove sl_retFar2
...
In System39.exe `%0` drops stack frames for label calls (Rance4 v2
relies on this behavior), so it's the same as `UD 1`.
2023-02-10 20:56:53 +09:00
kichikuou
8087d11b2b
Fix UC command
...
* UC0 should restore values pushed by US/TPx
* UC1 should stop when the stack top is a page call
* UC1/2 should restore status pushes by TPx
* UC1/2 should not consume the count for non-call stack frames
* Add support for UC3 command
2023-02-10 20:56:53 +09:00
kichikuou
4f1521ac90
TOx commands are no-op if the stack top is of an unexpected type
2023-02-10 20:56:53 +09:00
kichikuou
99632397da
Enable the hack in Rance4v2 recompiled with System3.9
...
The System3.9 compiler compiles `MT` command to `0x2F28`, so the hack
must be enabled in commands2F28().
Fixes https://github.com/kichikuou/xsystem35-sdl2/issues/36 .
2023-02-10 20:50:12 +09:00
kichikuou
59283815d8
Properly implement Y 1900 command
...
It is the same as patchEC, but can be used in SCO files less than
version 390.
2023-02-08 10:43:06 +09:00
kichikuou
a32c901eb8
Tweak the Rance4v2 hack
...
This fixes https://github.com/kichikuou/xsystem35-sdl2/issues/35 .
2023-02-08 10:15:06 +09:00
kichikuou
03b84b8ba7
Make UR command safer
...
It's still unimplemented, but clears the output variables for safety.
2023-02-07 22:12:35 +09:00
kichikuou
720da4e42c
Fix UC1 command
2023-02-07 22:05:00 +09:00
kichikuou
c4dc799c94
Change the condition for applying Rance4v2 hack
...
Now it's determined by the MT command argument.
2023-02-07 21:31:03 +09:00
kichikuou
ce271ae5eb
Fix CG positioning issue in Rance 4.x (TOTO port)
...
G command should reset the effect of J0/J1, even if pixel extraction is
disabled by PC command.
2023-02-05 18:37:50 +09:00
kichikuou
526e5f8709
Fix VSP palette issue
...
This fixes a palette problem when drawing a VSP image on a non-8-bit
surface after executing `ZC 0` command.
cg->vsp_bank can be overridden by the `ZC 0` command.
2023-02-05 18:08:41 +09:00
kichikuou
addf2e3728
Add BGM support for Rance4 v2
...
In Rance4 v2, `SS n` command plays the audio file n+999 stored in
WB.ald. Support this by reusing the CD->BGM bridge.
2023-01-28 14:24:26 +09:00
kichikuou
4785c8c77c
Add cdrom.bgm.c and use it when DRIFILE_BGM exists
...
This enables BGM playback in the download edition of Daiakuji, where S*
commands are plumbed to the music system (*BA.ald).
2023-01-28 13:06:38 +09:00
kichikuou
b1ac106057
Refactor bgm abstructions
2023-01-28 12:51:38 +09:00
kichikuou
acdc40ec60
Refactor cdrom abstructions
2023-01-28 12:51:34 +09:00
kichikuou
d9f635a6d0
Implement SV command
2023-01-28 09:53:44 +09:00
kichikuou
e8357c4e6f
Add a hack to improve map navigation of Rance4 v2
2023-01-28 09:53:41 +09:00
kichikuou
8e44a87069
Support Y1003 command
...
Used in Rance4 ver2.05. Similar to Y3, but waits for key release.
2023-01-26 21:44:29 +09:00
kichikuou
d1befbd355
Add stub for SV command
...
Used in Rance4 ver2.05.
2023-01-26 18:35:55 +09:00
kichikuou
ec0bae5490
Inline LittleEndian functions
...
Using memcpy(). Compilers are smart enough to eliminate memcpy()
completely.
2023-01-21 17:22:24 +09:00
kichikuou
f5b3b1a936
Support ShSound module on WASM
2023-01-21 16:40:26 +09:00
kichikuou
7aa704b3f4
midi_sdlmixer: Check playing status in midi_get_playing_info()
...
This fixes an infinite loop in Buroburo waiting for MIDI playback to
finish.
2023-01-15 13:07:51 +09:00
kichikuou
50d7d7ee33
Fix handling of multi-volume ALD with inconsistent indexes
...
When contents of the index table differ between ALD files, System3.x
uses information from the file containing the entry.
For example, if link_table[k] in SA.ALD is { file_nr = 2, ptr_no = 10 }
and link_table[k] in SB.ALD is { file_nr = 2, ptr_no = 11 }, the entry
body is in SB.ALD, so ptr_no = 11 should be used.
CA_G*.ALD of Child Assassin has this issue.
2023-01-15 12:42:38 +09:00
kichikuou
586a9c855e
Implement LXX 5 command
...
Used in Child Assassin.
2023-01-14 16:13:57 +09:00
kichikuou
83fa5db82c
Windows: Add a menu command to control automatic mouse movement
2022-12-29 21:57:53 +09:00
kichikuou
7fba19fe18
New way to simulate right-clicks on touch devices
...
As with xsystem4-android, now touches outside the game's viewport are
treated as right-clicks,
The old method (two-finger touch) still works.
2022-12-29 14:23:43 +09:00
kichikuou
29a139c8a1
Use the standard integer types
...
This replaces BYTE, WORD and DWORD types with uint8_t, uint16_t and
uint32_t respectively.
2022-10-29 09:34:21 +09:00
kichikuou
b53c82e072
Replace debug printf() calls with WARNING()
2022-09-08 21:19:19 +09:00
kichikuou
307bb2623b
Remove SDL_LockSurface() calls
...
It shouldn't be needed.
2022-09-04 22:26:58 +09:00
kichikuou
d1712ab7b4
Remove newline character from debug print macro calls
...
Now "\n" is appended by the macros.
2022-09-02 20:37:26 +09:00
kichikuou
7c24ba276d
Emscripten: Add nact_current_page() and nact_current_addr()
2022-08-28 09:25:03 +09:00
kichikuou
c8f9880efb
Fix buffer overrun in LE/QE command
2022-08-28 08:43:18 +09:00
kichikuou
d508676c70
Refactoring: Introduce getCaliArray()
...
This replaces global preVar{No,Page,Index} variables.
2022-08-27 16:11:36 +09:00
kichikuou
92506d6a94
Refactor variable page management code
...
Now system variables can be accessed via varPage[0].
2022-08-27 13:22:27 +09:00
kichikuou
fa44889047
Fix a bug in sdl_setPalette()
...
It called SDL_SetPaletteColors() with wrong arguments when `first` was
not zero. PP command was affected by this.
2022-07-31 13:53:37 +09:00
kichikuou
cee18a572e
Implement palette shift effect (CD 1001)
...
Used in Toushin Toshi 2.
2022-07-31 12:44:30 +09:00
kichikuou
652d284628
Debugger: Check out-of-bounds array access
...
This prevents the debugger from SEGVing when trying to access a
variable.
2022-07-30 18:14:35 +09:00
kichikuou
d2661e97f1
sdl_effect: Implement EFFECT_CIRCLE_WIPE_{IN,OUT}
2022-07-23 10:57:59 +09:00
kichikuou
0e9afe7c0a
Implement grDrawFillCircle
2022-07-23 09:18:58 +09:00