Compare commits

...
38 Commits
Author SHA1 Message Date
kichikuou 51eca5c8c0 Version 2.14.0 2025-01-09 10:31:50 +09:00
kichikuou 1699fbda6c Update game_compatibility.md
Ore no Shita de Agake and Rakuen Yuki are now supported.

Fixes #63.
2025-01-09 10:21:42 +09:00
kichikuou abbe8b9be1 Add warning for missing .ALD files
This warns when the link table has an entry but the contents cannot be
read.

For example, Atlach-Nacha installs only GA.ALD on the hard drive and
read GB.ALD directly from the CD-ROM. This warning message prompts the
user to copy GB.ALD to the game directory.
2025-01-09 09:24:50 +09:00
kichikuou 10735b8be6 Windows: Add application manifest to set ActiveCodePage to UTF-8
This will set the process code page to UTF-8 on Windows 10 version 1903
or above, allowing Japanese file names to be handled correctly even if
the system locale is not Japanese.
2025-01-09 08:58:14 +09:00
kichikuou e9d8a9d1a6 Refactor: Remove sdl_videodev and its accessor macros 2025-01-09 08:26:53 +09:00
kichikuou 780d30c01f Fix lnkIsLink
If the link table indicates the existence of an entry, but the volume
containing that entry is missing, this command returns 1.
2025-01-08 16:15:37 +09:00
kichikuou d6adb3241c Add sdl_showMessageBox and replace menu_msgbox_open 2025-01-08 11:24:49 +09:00
kichikuou 3594fc19dc Fix slot game speed in Persiom 2025-01-08 10:54:56 +09:00
kichikuou 883f538709 Fix SACT.QueryTextPos
It should return screen coordinates, not sprite-local coordinates.
2025-01-08 10:04:31 +09:00
kichikuou c280fc719b Implement SACT.PeekKey and SACT.MessagePeek
Used in Rakuen Yuki.
2025-01-08 10:04:28 +09:00
kichikuou 7da9e64ab6 Fix speed of slot game in Ore no Shita de Agake 2025-01-07 16:16:01 +09:00
kichikuou bba602ab04 Scheduler: Yield based on scenario address
Now it yields execution when the device state is checked multiple times
from the same scenario address.
2025-01-07 16:15:59 +09:00
kichikuou 78dc226d13 Add scheduler.c
It consolidates VM throttling logic that was scattered in various
places.
2025-01-07 15:52:48 +09:00
kichikuou a2792d502e Implement mathSetClipWindow and mathClip
Used in Ore no Shita de Agake.
2025-01-07 15:52:47 +09:00
kichikuou e800a23e1d Implement Gpx functions for Ore no Shita de Agake 2025-01-07 15:52:44 +09:00
kichikuou e731b4ec95 Implement ShCalc functions for Ore no Shita de Agake 2025-01-07 15:41:53 +09:00
kichikuou dde697d3b4 Implement S3xMusic HLL
Used in Ore no Shita de Agake.

Since the musbgm_* interface does not allow multiple channels, this
implementation uses musbgm_* for channel 0 and muspcm_* for channel 1.
2025-01-07 15:41:43 +09:00
kichikuou c4d4f85ae4 Use consistent message format in sys_message() 2025-01-06 14:26:47 +09:00
kichikuou 84e3666a66 Rename DEBUG_COMMAND{,_YET} to TRACE{,_UNIMPLEMENTED}
And now TRACE_UNIMPLEMENTED is not ignored in release build.
2025-01-06 14:14:10 +09:00
kichikuou c2f11ecfbe Fix Gpx.IsSurface()
Used in Ore no Shita de Agake.
2025-01-05 12:59:07 +09:00
kichikuou 85d69aa5f0 Output debug messages by ZD command at log level 2 2025-01-05 12:46:37 +09:00
kichikuou 7beb558140 Fix compiler warnings about unused results 2024-12-30 15:47:31 +09:00
kichikuou 49126c506d debug_symbol: Fix warning message format 2024-12-26 08:37:14 +09:00
kichikuou 4c57c98e67 Update bug report template 2024-12-26 08:36:08 +09:00
kichikuou e464d92164 Fix buffer overrun in stretch functions
Fixes #61.
2024-12-09 20:31:23 +09:00
kichikuou b30fd71e4b Version 2.13.0 2024-12-07 08:23:49 +09:00
kichikuou 99ad91306b Emscripten: Use texthook suppression list 2024-12-06 13:11:09 +09:00
kichikuou ed96f26cea Add texthook_suppress option
For suppressing text hook on specified scenario pages.
2024-12-06 09:24:08 +09:00
kichikuou e6f71190ed Add texthook option
`-texthook print` prints text to console, and `-texthook copy`
automatically copies text to clipboard (for use with text hooker tools).

On Windows, copy mode can be toggled from the menu bar.
2024-12-04 16:34:12 +09:00
kichikuou 8219feee6d Windows: Redirect stderr to console
So that WARNING messages are printed on the console.
2024-12-04 11:43:59 +09:00
kichikuou bc8a85e046 Version 2.12.1 2024-12-02 10:42:58 +09:00
kichikuou 67f62f02e6 MSYS build: Static link portmidi
Fixes #60.
2024-12-02 10:12:20 +09:00
kichikuou 471c65973b emscripten: Do not use mmap for ALDs
To save memory, as ALD files are now stored as regular files in memfs.
2024-11-28 10:23:21 +09:00
kichikuou 5ff7149dc1 Fix a compiler warning 2024-11-28 10:21:18 +09:00
kichikuou 80988e52cf emscripten: Restore a hack to asyncify send_agsevent() callers
It was inadvertently removed in commit 61ad428.
2024-11-27 09:12:39 +09:00
kichikuou ade76adda6 Version 2.12.0 2024-11-26 20:49:17 +09:00
kichikuou 53d0e8ffef NightDemonDemo, tDemo: refresh screen when frame rate < 30 2024-11-25 17:30:15 +09:00
kichikuou b2e14bd19a Implement tDemo module
Fixes #59.
2024-11-25 16:35:05 +09:00
118 changed files with 2028 additions and 1299 deletions
+2
View File
@@ -10,6 +10,7 @@ assignees: ''
### Environment
- xsystem35 version:
- OS:
- Game title:
### Steps to reproduce the behavior
1.
@@ -22,3 +23,4 @@ assignees: ''
<!-- If applicable, add screenshots to help explain your problem. -->
### Additional context
<!-- Note: Please do not post copyrighted game files. -->
+16
View File
@@ -1,5 +1,21 @@
# Changelog
## 2.14.0 - 2024-01-09
- New supported games: 俺の下であがけ and 楽園行.
- Windows: On Windows 10 version 1903 or above, now xsystem35 can handle
Japanese filenames correctly even if the system locale is not Japanese.
## 2.13.0 - 2024-12-07
- Windows: `Option` -> `Auto Copy Text to Clipboard` menu command has been added.
When enabled, in-game text will be copied to the clipboard automatically. This
can be used with text hooker tools that support clipboard monitoring.
## 2.12.1 - 2024-12-02
- Windows: Fixed missing DLL error (#60)
## 2.12.0 - 2024-11-26
- Implemented playback of the opening movie for 妻みぐい2.
## 2.11.7 - 2024-11-12
- Fixed crash when canceling menu with two-finger touch (#58)
- Fixed screen artifact in Rance 3 immediately after selecting "Game Start"
+13 -4
View File
@@ -10,7 +10,7 @@ set(CMAKE_C_STANDARD 99)
enable_testing()
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(XSYSTEM35_VERSION "2.11.7")
set(XSYSTEM35_VERSION "2.14.0")
include(CheckSymbolExists)
include(FetchContent)
@@ -143,9 +143,18 @@ else() # non-emscripten, non-android
endif()
endif()
find_library(PORTMIDI portmidi)
if (PORTMIDI)
set(HAVE_PORTMIDI 1)
if (WIN32)
optional_pkg_check_modules(PORTMIDI IMPORTED_TARGET portmidi)
if (PORTMIDI_FOUND)
set(HAVE_PORTMIDI 1)
add_static_library(portmidi_static PORTMIDI)
set(PORTMIDI portmidi_static)
endif()
else ()
find_library(PORTMIDI portmidi)
if (PORTMIDI)
set(HAVE_PORTMIDI 1)
endif()
endif()
endif()
+2 -2
View File
@@ -16,8 +16,8 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 34
versionCode 25
versionName "2.11.7" + gitRevision()
versionCode 29
versionName "2.14.0" + gitRevision()
externalNativeBuild {
cmake {
arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static"
+9 -1
View File
@@ -30,7 +30,7 @@ finds System 3.x game files (*.ALD) from the current directory.
*-game* _game_::
Enables game-specific hacks. Usually auto-detected, but must be specified for
games with modified / translated titles. Possible values are: `toushin2`,
`rance3_eng`, `rance4_eng`, `rance4_v2`.
`rance3_eng`, `rance4_eng`, `rance4_v2`, `persiom`, `agake`.
*-savedir* _dir_::
Directory to save game state files. If _dir_ begins with '~', it is expanded
@@ -40,6 +40,14 @@ finds System 3.x game files (*.ALD) from the current directory.
The format when writing save files. Possible values are: `xsystem35`,
`system36`, `system39` (default).
*-texthook* _mode_::
Set the text hook mode. Possible values are: `none` (default), `print` (print
text to console), `copy` (copy text to clipboard).
*-texthook_suppress* _list_::
Suppress text hook on specified scenario pages. _list_ is a comma-separated
list of page numbers. Used to suppress system messages, etc.
*-renderer* _name_::
Use the SDL rendering driver named _name_.
+7 -7
View File
@@ -4,10 +4,10 @@ Game Compatibility
| Game | Status | Notes |
| ------------------------------------------- | ----------- | ----- |
| 鬼畜王ランス | Supported | |
| Kichikuou Rance (EN) | Supported | |
| Kichikuou Rance (EN) | Supported | Fan translation |
| RanceIV -教団の遺産- | Supported | Win95 edition and [Ver2.05](https://hannylaboratory.blogspot.com/2023/01/blog-post_26.html) |
| Rance4 -Legacy of the Sect- (EN) | Supported | |
| 兰斯IV -教团的遗产- (CN) | Supported | |
| Rance4 -Legacy of the Sect- (EN) | Supported | Fan translation |
| 兰斯IV -教团的遗产- (CN) | Supported | Fan translation |
| ランス4.1 | Supported | [Ver1.05](https://hannylaboratory.blogspot.com/2023/02/blog-post_9.html). Use system3-sdl2 for older versions |
| ランス4.2 | Supported | [Ver1.05](https://hannylaboratory.blogspot.com/2023/02/blog-post_9.html). Use system3-sdl2 for older versions |
| いけないかつみ先生 | Supported | Emojis are not supported |
@@ -52,10 +52,10 @@ Game Compatibility
| 妻みぐい | Supported | Opening demo is not supported |
| 超昂天使エスカレイヤー | Supported | Opening demo is not supported |
| ランス5D | Supported | |
| Rance 5D - The Lonely Girl (MangaGamer) | Supported | |
| 俺の下であがけ | Unknown | |
| 楽園行 | Unknown | |
| 妻みぐい2 | Supported | Opening demo is not supported |
| Rance 5D - The Lonely Girl (EN) | Supported | MangaGamer version |
| 俺の下であがけ | Supported | |
| 楽園行 | Supported | |
| 妻みぐい2 | Supported | |
| シェル・クレイル | Supported | |
| ナイトデーモン | Supported | |
| 学園KING | Supported | From アリスCD |
+3 -3
View File
@@ -16,21 +16,21 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("AliceLogo.Init %d,%d,%d,%p:", p1, p2, p3, var);
TRACE_UNIMPLEMENTED("AliceLogo.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetWaveNum() {
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("AliceLogo.SetWaveNum %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("AliceLogo.SetWaveNum %d,%d:", p1, p2);
}
static void Run() {
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("AliceLogo.Run %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("AliceLogo.Run %d,%d:", p1, p2);
}
static const ModuleFunc functions[] = {
+1
View File
@@ -23,6 +23,7 @@ add_library(modules STATIC
NIGHTDLL/nt_sound.c
NightDemonDemo/NightDemonDemo.c
RandMT/RandMT.c
S3xMusic/S3xMusic.c
SACT/SACT.c
SACT/sactcg.c
SACT/sactsound.c
+4 -4
View File
@@ -10,7 +10,7 @@
static void Init() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("Confirm.Init %d:", p1);
TRACE_UNIMPLEMENTED("Confirm.Init %d:", p1);
}
static void ExistKeyFile() {
@@ -20,7 +20,7 @@ static void ExistKeyFile() {
*var = 1;
DEBUG_COMMAND_YET("Confirm.ExistKeyFile %s,%p,%p:",p1, p2, var);
TRACE_UNIMPLEMENTED("Confirm.ExistKeyFile %s,%p,%p:",p1, p2, var);
}
static void CheckProtectFile() {
@@ -30,7 +30,7 @@ static void CheckProtectFile() {
*var = 1;
DEBUG_COMMAND_YET("Confirm.CheckProtectFile %s,%p,%p:", p1,p2,var);
TRACE_UNIMPLEMENTED("Confirm.CheckProtectFile %s,%p,%p:", p1,p2,var);
}
static void CreateKeyFile() {
@@ -40,7 +40,7 @@ static void CreateKeyFile() {
*var = 1;
DEBUG_COMMAND_YET("Confirm.CreateKeyFile %s,%p,%p:", p1,p2,var);
TRACE_UNIMPLEMENTED("Confirm.CreateKeyFile %s,%p,%p:", p1,p2,var);
}
static const ModuleFunc functions[] = {
+100 -111
View File
@@ -136,7 +136,7 @@ static void Init() {
// surface0 を pre_freesurfno として返さないように。
pre_freesurfno = 1;
DEBUG_COMMAND("Gpx.Init %d:", p1);
TRACE("Gpx.Init %d:", p1);
}
static void Gpx_reset(void) {
@@ -171,7 +171,7 @@ static void Create() {
suf[no] = s;
}
DEBUG_COMMAND("Gpx.Create %p,%d,%d,%d:", var, width, height, bpp);
TRACE("Gpx.Create %p,%d,%d,%d:", var, width, height, bpp);
}
static void CreatePixelOnly() {
@@ -199,7 +199,7 @@ static void CreatePixelOnly() {
suf[no] = s;
}
DEBUG_COMMAND("Gpx.CreatePixelOnly %d,%d,%d,%d:", *var, width, height, bpp);
TRACE("Gpx.CreatePixelOnly %d,%d,%d,%d:", *var, width, height, bpp);
}
static void CreateAMapOnly() {
@@ -225,30 +225,22 @@ static void CreateAMapOnly() {
suf[no] = s;
}
DEBUG_COMMAND("Gpx.CreateAMapOnly %p,%d,%d:", var, width, height);
TRACE("Gpx.CreateAMapOnly %p,%d,%d:", var, width, height);
}
static void IsSurface() {
/*
Gpx.IsSurface(): 指定の番号の surface が surface かどうか
(pixel と alpha の両方のデータを持つ)を調べる
Gpx.IsSurface(): 指定の番号が surface かどうかを調べる
p1 : surface 番号
var : 結果を返す変数。surface ならば 1, !surface ならば 0
*/
int p1 = getCaliValue();
int *var = getCaliVariable();
surface_t *s;
s = sf_get(p1);
if (s == NULL) {
*var = 0;
} else {
*var = (s->alpha && s->pixel) ? 1 : 0;
}
DEBUG_COMMAND("Gpx.IsSurface %d,%p:", p1, var);
*var = sf_get(p1) ? 1 : 0;
TRACE("Gpx.IsSurface %d,%p:", p1, var);
}
static void IsPixel() {
@@ -270,7 +262,7 @@ static void IsPixel() {
*var = s->pixel ? 1 : 0;
}
DEBUG_COMMAND("Gpx.IsPixel %d,%p:", p1, var);
TRACE("Gpx.IsPixel %d,%p:", p1, var);
}
static void IsAlpha() {
@@ -292,7 +284,7 @@ static void IsAlpha() {
*var = s->alpha ? 1 : 0;
}
DEBUG_COMMAND("Gpx.IsAlpha %d,%p:", p1, var);
TRACE("Gpx.IsAlpha %d,%p:", p1, var);
}
static void GetWidth() {
@@ -314,7 +306,7 @@ static void GetWidth() {
*var = s->width;
}
DEBUG_COMMAND("Gpx.GetWidth %d,%d:", p1, *var);
TRACE("Gpx.GetWidth %d,%d:", p1, *var);
}
static void GetHeight() {
@@ -336,13 +328,13 @@ static void GetHeight() {
*var = s->height;
}
DEBUG_COMMAND("Gpx.GetHeight %d,%d:", p1, *var);
TRACE("Gpx.GetHeight %d,%d:", p1, *var);
}
static void GetCreatedSurface() { /* not used ? */
int *var = getCaliVariable();
DEBUG_COMMAND_YET("Gpx.GetCreatedSurface %p:", var);
TRACE_UNIMPLEMENTED("Gpx.GetCreatedSurface %p:", var);
}
static void LoadCG() {
@@ -357,21 +349,21 @@ static void LoadCG() {
*var = load_cg_main(p1 -1);
DEBUG_COMMAND("Gpx.LoadCG %p,%d (%d):", var, p1, *var);
TRACE("Gpx.LoadCG %p,%d (%d):", var, p1, *var);
}
static void GetCGPosX() { /* not useed ? */
int *var = getCaliVariable();
int p1 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.GetCgPosX %p,%d:", var, p1);
TRACE_UNIMPLEMENTED("Gpx.GetCgPosX %p,%d:", var, p1);
}
static void GetCGPosY() { /* not useed ? */
int *var = getCaliVariable();
int p1 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.GetCgPosY %p,%d:", var, p1);
TRACE_UNIMPLEMENTED("Gpx.GetCgPosY %p,%d:", var, p1);
}
static void Free() {
@@ -382,7 +374,7 @@ static void Free() {
*/
int p1 = getCaliValue();
DEBUG_COMMAND("Gpx.Free %d:", p1);
TRACE("Gpx.Free %d:", p1);
if (p1 != 0) {
sf_free_one(p1);
@@ -395,7 +387,7 @@ static void FreeAll() {
*/
sf_free_all();
DEBUG_COMMAND("Gpx.FreeAll:");
TRACE("Gpx.FreeAll:");
}
static void Copy() {
@@ -421,25 +413,29 @@ static void Copy() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.Copy %d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss, sx, sy, sw, sh);
TRACE("Gpx.Copy %d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss, sx, sy, sw, sh);
src = sf_get(ss);
dst = sf_get(ds);
gr_copy(dst, dx, dy, src, sx, sy, sw, sh);
}
static void CopyBright() { /* not used ? */
int p1 = getCaliValue();
int p2 = getCaliValue();
int p3 = getCaliValue();
int p4 = getCaliValue();
int p5 = getCaliValue();
int p6 = getCaliValue();
int p7 = getCaliValue();
int p8 = getCaliValue();
int p9 = getCaliValue();
static void CopyBright(void) {
int ds = getCaliValue();
int dx = getCaliValue();
int dy = getCaliValue();
int ss = getCaliValue();
int sx = getCaliValue();
int sy = getCaliValue();
int w = getCaliValue();
int h = getCaliValue();
int lv = getCaliValue();
DEBUG_COMMAND_YET("Gpx.CopyBright %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
surface_t *dst = sf_get(ds);
surface_t *src = sf_get(ss);
gr_copy_bright(dst, dx, dy, src, sx, sy, w, h, lv);
TRACE("Gpx.CopyBright %d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss, sx, sy, w, h, lv);
}
static void CopyAMap() {
@@ -465,25 +461,29 @@ static void CopyAMap() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.CopyAMap %d,%d,%d,%d,%d,%d,%d,%d:", da, dx, dy, sa, sx, sy, sw, sh);
TRACE("Gpx.CopyAMap %d,%d,%d,%d,%d,%d,%d,%d:", da, dx, dy, sa, sx, sy, sw, sh);
src = sf_get(sa);
dst = sf_get(da);
gr_copy_alpha_map(dst, dx, dy, src, sx, sy, sw, sh);
}
static void Blend() { /* not used ? */
int p1 = getCaliValue();
int p2 = getCaliValue();
int p3 = getCaliValue();
int p4 = getCaliValue();
int p5 = getCaliValue();
int p6 = getCaliValue();
int p7 = getCaliValue();
int p8 = getCaliValue();
int p9 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.Blend %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
static void Blend(void) {
int ds = getCaliValue();
int dx = getCaliValue();
int dy = getCaliValue();
int ss = getCaliValue();
int sx = getCaliValue();
int sy = getCaliValue();
int w = getCaliValue();
int h = getCaliValue();
int lv = getCaliValue();
surface_t *dst = sf_get(ds);
surface_t *src = sf_get(ss);
gr_blend(dst, dx, dy, src, sx, sy, w, h, lv);
TRACE("Gpx.Blend %d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss, sx, sy, w, h, lv);
}
static void BlendSrcBright() { /* not used ? */
@@ -498,7 +498,7 @@ static void BlendSrcBright() { /* not used ? */
int p9 = getCaliValue();
int p10 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendSrcBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
TRACE_UNIMPLEMENTED("Gpx.BlendSrcBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
}
static void BlendAddSatur() { /* not used ? */
@@ -511,7 +511,7 @@ static void BlendAddSatur() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAddStatur %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
TRACE_UNIMPLEMENTED("Gpx.BlendAddStatur %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void BlendAMap() {
@@ -537,7 +537,7 @@ static void BlendAMap() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.BlendAMap %d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss, sx, sy, sw, sh);
TRACE("Gpx.BlendAMap %d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss, sx, sy, sw, sh);
src = sf_get(ss);
dst = sf_get(ds);
@@ -554,7 +554,7 @@ static void BlendAMapSrcOnly() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapSrcOnly %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
TRACE_UNIMPLEMENTED("Gpx.BlendAMapSrcOnly %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void BlendAMapColor() { /* not used ? */
@@ -570,7 +570,7 @@ static void BlendAMapColor() { /* not used ? */
int p10 = getCaliValue();
int p11 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
TRACE_UNIMPLEMENTED("Gpx.BlendAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
}
static void BlendAMapColorAlpha() { /* not used ? */
@@ -587,7 +587,7 @@ static void BlendAMapColorAlpha() { /* not used ? */
int p11 = getCaliValue();
int p12 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapColorAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
TRACE_UNIMPLEMENTED("Gpx.BlendAMapColorAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
}
static void BlendAMapAlpha() { /* not used ? */
@@ -601,7 +601,7 @@ static void BlendAMapAlpha() { /* not used ? */
int p8 = getCaliValue();
int p9 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
TRACE_UNIMPLEMENTED("Gpx.BlendAMapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
static void BlendAMapBright() { /* not used ? */
@@ -615,7 +615,7 @@ static void BlendAMapBright() { /* not used ? */
int p8 = getCaliValue();
int p9 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
TRACE_UNIMPLEMENTED("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
static void BlendAMapAlphaSrcBright() { /* not used ? */
@@ -630,7 +630,7 @@ static void BlendAMapAlphaSrcBright() { /* not used ? */
int p9 = getCaliValue();
int p10 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
TRACE_UNIMPLEMENTED("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
}
static void BlendUseAMapColor() { /* not used ? */
@@ -647,7 +647,7 @@ static void BlendUseAMapColor() { /* not used ? */
int p11 = getCaliValue();
int p12 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendUseAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
TRACE_UNIMPLEMENTED("Gpx.BlendUseAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
}
static void BlendScreen() { /* not used ? */
@@ -660,7 +660,7 @@ static void BlendScreen() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendScreen %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
TRACE_UNIMPLEMENTED("Gpx.BlendScreen %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void BlendMultiply() { /* not used ? */
@@ -673,7 +673,7 @@ static void BlendMultiply() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendMultiply %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
TRACE_UNIMPLEMENTED("Gpx.BlendMultiply %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void BlendScreenAlpha() { /* not used ? */
@@ -687,7 +687,7 @@ static void BlendScreenAlpha() { /* not used ? */
int p8 = getCaliValue();
int p9 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendScreenAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
TRACE_UNIMPLEMENTED("Gpx.BlendScreenAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
static void Fill() {
@@ -713,7 +713,7 @@ static void Fill() {
int b = getCaliValue();
surface_t *dst;
DEBUG_COMMAND("Gpx.Fill %d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, r, g, b);
TRACE("Gpx.Fill %d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, r, g, b);
dst = sf_get(ds);
gr_fill(dst, dx, dy, dw, dh, r, g, b);
@@ -731,21 +731,24 @@ static void FillAlphaColor() { /* not used ? */
int lv = getCaliValue();
surface_t *dst;
DEBUG_COMMAND_YET("Gpx.FillAlphaColor %d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, r, g, b, lv);
TRACE("Gpx.FillAlphaColor %d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, r, g, b, lv);
dst = sf_get(ds);
gr_fill_alpha_color(dst, dx, dy, dw, dh, r, g, b, lv);
}
static void FillAMap() { /* not used ? */
int p1 = getCaliValue();
int p2 = getCaliValue();
int p3 = getCaliValue();
int p4 = getCaliValue();
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.FillAMap %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
static void FillAMap(void) {
int ds = getCaliValue();
int x = getCaliValue();
int y = getCaliValue();
int w = getCaliValue();
int h = getCaliValue();
int lv = getCaliValue();
surface_t *dst = sf_get(ds);
gr_fill_alpha_map(dst, x, y, w, h, lv);
TRACE("Gpx.FillAMap %d,%d,%d,%d,%d,%d:", ds, x, y, w, h, lv);
}
static void FillAMapOverBorder() {
@@ -770,7 +773,7 @@ static void FillAMapOverBorder() {
int d = getCaliValue();
surface_t *dst;
DEBUG_COMMAND("Gpx.FillAMapOverBorder %d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, s, d);
TRACE("Gpx.FillAMapOverBorder %d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, s, d);
dst = sf_get(ds);
gr_fill_alpha_overborder(dst, dx, dy, dw, dh, s, d);
@@ -785,7 +788,7 @@ static void FillAMapUnderBorder() { /* not used ? */
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.FillAMapUnderBorder %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
TRACE_UNIMPLEMENTED("Gpx.FillAMapUnderBorder %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void SaturDP_DPxSA() { /* not used ? */
@@ -798,7 +801,7 @@ static void SaturDP_DPxSA() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.SaturDP_DPxSA %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
TRACE_UNIMPLEMENTED("Gpx.SaturDP_DPxSA %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void ScreenDA_DAxSA() { /* not used ? */
@@ -811,7 +814,7 @@ static void ScreenDA_DAxSA() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.ScreenDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
TRACE_UNIMPLEMENTED("Gpx.ScreenDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void AddDA_DAxSA() { /* not used ? */
@@ -824,7 +827,7 @@ static void AddDA_DAxSA() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.AddDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
TRACE_UNIMPLEMENTED("Gpx.AddDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void SpriteCopyAMap() {
@@ -852,7 +855,7 @@ static void SpriteCopyAMap() {
int cl = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.SpriteCopyAMap %d,%d,%d,%d,%d,%d,%d,%d,%d:", da, dx, dy, sa, sx, sy, sw, sh, cl);
TRACE("Gpx.SpriteCopyAMap %d,%d,%d,%d,%d,%d,%d,%d,%d:", da, dx, dy, sa, sx, sy, sw, sh, cl);
src = sf_get(sa);
dst = sf_get(da);
@@ -879,7 +882,7 @@ static void BrightDestOnly() {
int r = getCaliValue();
surface_t *dst;
DEBUG_COMMAND("Gpx.BrightDestOnly %d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, r);
TRACE("Gpx.BrightDestOnly %d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, r);
dst = sf_get(ds);
@@ -900,7 +903,7 @@ static void CopyTextureWrap() { /* not used ? */
int p11 = getCaliValue();
int p12 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.CopyTextureWrap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
TRACE_UNIMPLEMENTED("Gpx.CopyTextureWrap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
}
static void CopyTextureWrapAlpha() { /* not used ? */
@@ -918,7 +921,7 @@ static void CopyTextureWrapAlpha() { /* not used ? */
int p12 = getCaliValue();
int p13 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.CopyTextureWrapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);
TRACE_UNIMPLEMENTED("Gpx.CopyTextureWrapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);
}
static void CopyStretch() {
@@ -948,7 +951,7 @@ static void CopyStretch() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND_YET("Gpx.CopyStretch %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh);
TRACE("Gpx.CopyStretch %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh);
src = sf_get(ss);
dst = sf_get(ds);
@@ -968,7 +971,7 @@ static void CopyStretchBlend() { /* not used ? */
int p10 = getCaliValue();
int p11 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.CopyStretchBlend %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
TRACE_UNIMPLEMENTED("Gpx.CopyStretchBlend %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
}
static void CopyStretchBlendAMap() {
@@ -998,7 +1001,7 @@ static void CopyStretchBlendAMap() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.CopyStretchBlendAMap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh);
TRACE("Gpx.CopyStretchBlendAMap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh);
src = sf_get(ss);
dst = sf_get(ds);
@@ -1015,7 +1018,7 @@ static void StretchBlendScreen2x2() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.StretchBlendScreen2x2 %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
TRACE_UNIMPLEMENTED("Gpx.StretchBlendScreen2x2 %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
@@ -1049,7 +1052,7 @@ static void StretchBlendScreen2x2WDS() {
int sh = getCaliValue();
surface_t *src1, *src2, *dst;
DEBUG_COMMAND("Gpx.StretchBlendScreen2x2WDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh);
TRACE("Gpx.StretchBlendScreen2x2WDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh);
src1 = sf_get(ss1);
src2 = sf_get(ss2);
@@ -1086,7 +1089,7 @@ static void BlendScreenWDS() {
int sh = getCaliValue();
surface_t *src1, *src2, *dst;
DEBUG_COMMAND("Gpx.BlendScreenWDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh);
TRACE("Gpx.BlendScreenWDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh);
src1 = sf_get(ss1);
src2 = sf_get(ss2);
@@ -1137,25 +1140,11 @@ static void EffectCopy() {
int sh = getCaliValue();
int time = getCaliValue();
int *var = getCaliVariable();
surface_t *dib, *dst, *src;
switch(no) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 7:
case 11:
case 12:
case 13:
DEBUG_COMMAND("Gpx.EffectCopy %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:", no, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh, time, var);
break;
default:
DEBUG_COMMAND_YET("Gpx.EffectCopy %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:", no, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh, time, var);
}
dst = sf_get(ss1);
src = sf_get(ss2);
TRACE("Gpx.EffectCopy %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:", no, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh, time, var);
surface_t *dst = sf_get(ss1);
surface_t *src = sf_get(ss2);
gpx_effect(no, dx, dy, dst, sx1, sy1, src, sx2, sy2, sw, sh, time, var);
}
@@ -1163,7 +1152,7 @@ static void EffectCopy() {
static void SetClickCancelFlag() { /* not used ? */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.SetClikCancelFlag %d:", p1);
TRACE_UNIMPLEMENTED("Gpx.SetClikCancelFlag %d:", p1);
}
static const ModuleFunc functions[] = {
+4 -4
View File
@@ -42,7 +42,7 @@ static void RandMTInit() {
*/
int p1 = getCaliValue(); /* ITimer */
DEBUG_COMMAND("Math.RandMTInit %d:", p1);
TRACE("Math.RandMTInit %d:", p1);
}
static void RandMTGet() {
@@ -61,7 +61,7 @@ static void RandMTGet() {
*var = (int)(genrand() * num) + 1;
}
DEBUG_COMMAND("Math.RandMTGet %d,%p:", num, var);
TRACE("Math.RandMTGet %d,%p:", num, var);
}
static void RandMTMakeNumTable() {
@@ -74,7 +74,7 @@ static void RandMTMakeNumTable() {
numtblmax = p1;
DEBUG_COMMAND("Math.RandMTMakeNumTable %d:", p1);
TRACE("Math.RandMTMakeNumTable %d:", p1);
}
static void RandMTGetNumTable() {
@@ -87,7 +87,7 @@ static void RandMTGetNumTable() {
*var = (int)(genrand() * numtblmax) + 1;
DEBUG_COMMAND("Math.RandMTGetNumTable %d:", *var);
TRACE("Math.RandMTGetNumTable %d:", *var);
}
static const ModuleFunc functions[] = {
+8 -8
View File
@@ -26,7 +26,7 @@ static void Init() {
valid = true;
*p1 = 0;
DEBUG_COMMAND("MsgSkip.Init %p,%d,%d,%d:", p1, p2, p3, p4);
TRACE("MsgSkip.Init %p,%d,%d,%d:", p1, p2, p3, p4);
}
static void Start() {
@@ -39,7 +39,7 @@ static void Start() {
free(path);
free(fname_utf8);
DEBUG_COMMAND("MsgSkip.Start %p,%d:", p1, p2);
TRACE("MsgSkip.Start %p,%d:", p1, p2);
}
static void SetValid() {
@@ -48,7 +48,7 @@ static void SetValid() {
valid = p1;
msgskip_pause(!valid);
DEBUG_COMMAND("MsgSkip.SetValid %d:", p1);
TRACE("MsgSkip.SetValid %d:", p1);
}
static void GetValid() {
@@ -56,7 +56,7 @@ static void GetValid() {
*p1 = valid;
DEBUG_COMMAND("MsgSkip.GetValid %p:", p1);
TRACE("MsgSkip.GetValid %p:", p1);
}
static void SetAction() {
@@ -64,7 +64,7 @@ static void SetAction() {
action = p1;
DEBUG_COMMAND("MsgSkip.SetAcion %d:", p1);
TRACE("MsgSkip.SetAcion %d:", p1);
}
static void GetAction() {
@@ -72,19 +72,19 @@ static void GetAction() {
*p1 = action;
DEBUG_COMMAND("MsgSkip.GetAcion %p:", p1);
TRACE("MsgSkip.GetAcion %p:", p1);
}
static void PushStr() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("MsgSkip.PushStr %d:", p1);
TRACE_UNIMPLEMENTED("MsgSkip.PushStr %d:", p1);
}
static void PopStr() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("MsgSkip.PopStr %d:", p1);
TRACE_UNIMPLEMENTED("MsgSkip.PopStr %d:", p1);
}
static const ModuleFunc functions[] = {
+68 -68
View File
@@ -36,7 +36,7 @@ static void Init(void) { /* 0 */
*var = 1;
DEBUG_COMMAND_YET("NIGHTDLL.Init %p:", var);
TRACE_UNIMPLEMENTED("NIGHTDLL.Init %p:", var);
}
static void NIGHTDLL_reset(void) {
@@ -62,7 +62,7 @@ static void InitGame() { /* 1 */
ntmsg_init();
nt_sstr_init();
DEBUG_COMMAND_YET("NIGHTDLL.InitGame:");
TRACE_UNIMPLEMENTED("NIGHTDLL.InitGame:");
}
// メッセージの枠の表示
@@ -71,7 +71,7 @@ static void SetMsgFrame() { /* 2 */
ntmsg_set_frame(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgFram %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetMsgFram %d:", p1);
}
// メッセージの表示位置の設定
@@ -80,21 +80,21 @@ static void SetMsgPlaceMethod(void) { /* 3 */
// 2=メッセージ枠+顔つき
ntmsg_set_place(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgPlaceMethod %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetMsgPlaceMethod %d:", p1);
}
// 未実装?
static void SetMsgDrawEffect(void) { /* 4 */
int p1 = getCaliValue(); // 0, 1, 2, 3 (実際にはどれも機能しない?)
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgDrawEffect %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetMsgDrawEffect %d:", p1);
}
// 未実装?
static void SetMsgClearEffect(void) { /* 5 */
int p1 = getCaliValue(); // 0, 1, 2, 4 (実際にはどれも機能しない?)
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgClearEffect %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetMsgClearEffect %d:", p1);
}
// 壁紙CGの設定
@@ -103,7 +103,7 @@ static void SetWallPaper(void) { /* 6 */
nt_gr_set_wallpaper(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetWallPaper %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetWallPaper %d:", p1);
}
// 背景CGの設定
@@ -112,7 +112,7 @@ static void SetScenery(void) { /* 7 */
nt_gr_set_scenery(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetScenery %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetScenery %d:", p1);
}
// 顔CGの設定
@@ -121,7 +121,7 @@ static void SetFace(void) { /* 8 */
nt_gr_set_face(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetFace %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetFace %d:", p1);
}
// 立ち絵左の設定
@@ -130,7 +130,7 @@ static void SetSpriteL(void) { /* 9 */
nt_gr_set_spL(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteL %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetSpriteL %d:", p1);
}
// 立ち絵中央の設定
@@ -139,7 +139,7 @@ static void SetSpriteM(void) { /* 10 */
nt_gr_set_spM(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteM %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetSpriteM %d:", p1);
}
// 立ち絵右の設定
@@ -148,7 +148,7 @@ static void SetSpriteR(void) { /* 11 */
nt_gr_set_spR(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteR %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetSpriteR %d:", p1);
}
// 立ち絵左の設定(季節違い?)
@@ -157,7 +157,7 @@ static void SetSpriteSeasonL(void) { /* 12 */
nt_gr_set_spsL(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonL %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetSpriteSeasonL %d:", p1);
}
// 立ち絵中央の設定(季節違い?)
@@ -166,7 +166,7 @@ static void SetSpriteSeasonM(void) { /* 13 */
nt_gr_set_spM(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonM %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetSpriteSeasonM %d:", p1);
}
// 立ち絵右の設定(季節違い?)
@@ -175,14 +175,14 @@ static void SetSpriteSeasonR(void) { /* 14 */
nt_gr_set_spsR(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonR %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetSpriteSeasonR %d:", p1);
}
// 改行
static void StartNewLine(void) { /* 15 */
ntmsg_newline();
DEBUG_COMMAND_YET("NIGHTDLL.StartNewLine:");
TRACE_UNIMPLEMENTED("NIGHTDLL.StartNewLine:");
}
// メッセージフォントサイズの設定
@@ -191,7 +191,7 @@ static void SetFontSize(void) { /* 16 */
night.fontsize = p1;
DEBUG_COMMAND_YET("NIGHTDLL.SetFontSize %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetFontSize %d:", p1);
}
// フォントの種類の設定
@@ -200,7 +200,7 @@ static void SetFont(void) { /* 17 */
night.fonttype = p1;
DEBUG_COMMAND_YET("NIGHTDLL.SetFont %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetFont %d:", p1);
}
// 選択肢モード ON
@@ -209,7 +209,7 @@ static void SetSelMode(void) { /* 18 */
night.selmode = p1;
DEBUG_COMMAND_YET("NIGHTDLL.SetSelMode %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetSelMode %d:", p1);
}
// キー入力待ち後、改ページ
@@ -218,7 +218,7 @@ static void AnalyzeMessage(void) { /* 19 */
*var = ntmsg_ana();
DEBUG_COMMAND_YET("NIGHTDLL.AnalyzeMessage %p:", var);
TRACE_UNIMPLEMENTED("NIGHTDLL.AnalyzeMessage %p:", var);
}
// ~DRAWの効果時間
@@ -227,7 +227,7 @@ static void SetDrawTime(void) { /* 20 */
nt_gr_set_drawtime(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetDrawTime %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetDrawTime %d:", p1);
}
// 効果つき画面更新
@@ -236,7 +236,7 @@ static void Draw(void) { /* 21 */
nt_gr_draw(p1);
DEBUG_COMMAND_YET("NIGHTDLL.Draw %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.Draw %d:", p1);
}
// 音声データを再生
@@ -245,21 +245,21 @@ static void SetVoice(void) { /* 22 */
nt_voice_set(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetVoice %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetVoice %d:", p1);
}
// 未使用
static void WaitKey(void) { /* 23 */
int p1 = getCaliValue(); //
DEBUG_COMMAND_YET("NIGHTDLL.WaitKey %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.WaitKey %d:", p1);
}
static void AddFeeling(void) { /* 24 */
int p1 = getCaliValue(); // person(1:新開,2:星川,3:百瀬,4:いずみ,5:鏡花,6:真言美,7:マコト
int p2 = getCaliValue(); // val
DEBUG_COMMAND_YET("NIGHTDLL.AddFeeling %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.AddFeeling %d:", p1);
}
@@ -267,7 +267,7 @@ static void SubFeeling(void) { /* 25 */
int p1 = getCaliValue(); // person
int p2 = getCaliValue(); // val
DEBUG_COMMAND_YET("NIGHTDLL.SubFeeling %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SubFeeling %d:", p1);
}
static void CallEvent(void) { /* 26 */
@@ -275,7 +275,7 @@ static void CallEvent(void) { /* 26 */
nt_sco_callevent(p1);
DEBUG_COMMAND_YET("NIGHTDLL.CallEvent %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.CallEvent %d:", p1);
}
static void ScreenCG(void) { /* 27 */
@@ -294,7 +294,7 @@ static void ScreenCG(void) { /* 27 */
nt_gr_screencg(no, x, y);
DEBUG_COMMAND_YET("NIGHTDLL.ScreenCG %d,%d,%d:", x, y, no);
TRACE_UNIMPLEMENTED("NIGHTDLL.ScreenCG %d,%d,%d:", x, y, no);
}
static void RunGameMain(void) { /* 28 */
@@ -310,7 +310,7 @@ static void RunGameMain(void) { /* 28 */
*p1 = nt_sco_main(p5);
DEBUG_COMMAND_YET("NIGHTDLL.RunGameMain %p,%d,%d,%d,%d:", p1, p2, p3, p4, p5);
TRACE_UNIMPLEMENTED("NIGHTDLL.RunGameMain %p,%d,%d,%d,%d:", p1, p2, p3, p4, p5);
}
static void CheckNewGame(void) { /* 29 */
@@ -318,21 +318,21 @@ static void CheckNewGame(void) { /* 29 */
*p1 = 0;
DEBUG_COMMAND_YET("NIGHTDLL.CheckNewGame %p:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.CheckNewGame %p:", p1);
}
static void SaveStartData(void) { /* 30 */
DEBUG_COMMAND_YET("NIGHTDLL.SaveStartData:");
TRACE_UNIMPLEMENTED("NIGHTDLL.SaveStartData:");
}
static void PrintExitSystem(void) { /* 31 */
DEBUG_COMMAND_YET("NIGHTDLL.PrintExitSystem:");
TRACE_UNIMPLEMENTED("NIGHTDLL.PrintExitSystem:");
}
static void SetCalendar(void) { /* 32 */
int p1 = getCaliValue(); // 0, 1, 2
DEBUG_COMMAND_YET("NIGHTDLL.SetCalendar %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetCalendar %d:", p1);
}
static void SetDate(void) { /* 33 */
@@ -344,7 +344,7 @@ static void SetDate(void) { /* 33 */
night.Day = p2;
night.DayOfWeek = p3;
DEBUG_COMMAND_YET("NIGHTDLL.SetDate %d,%d,%d:", p1, p2, p3);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetDate %d,%d,%d:", p1, p2, p3);
}
static void GetDate(void) { /* 34 */
@@ -356,11 +356,11 @@ static void GetDate(void) { /* 34 */
*p2 = night.Day;
*p3 = night.DayOfWeek;
DEBUG_COMMAND_YET("NIGHTDLL.GetDate %p,%p,%p:", p1, p2, p3);
TRACE_UNIMPLEMENTED("NIGHTDLL.GetDate %p,%p,%p:", p1, p2, p3);
}
static void SelectGameLevel(void) { /* 35 */
DEBUG_COMMAND_YET("NIGHTDLL.SelectGameLevel:");
TRACE_UNIMPLEMENTED("NIGHTDLL.SelectGameLevel:");
}
static void RunEventDungeon(void) { /* 36 */
@@ -369,13 +369,13 @@ static void RunEventDungeon(void) { /* 36 */
*p1 = 1;
DEBUG_COMMAND_YET("NIGHTDLL.RunEventDungeon %p,%d:", p1, p2);
TRACE_UNIMPLEMENTED("NIGHTDLL.RunEventDungeon %p,%d:", p1, p2);
}
static void RunEventBattle(void) { /* 37 */
int p1 = getCaliValue(); // 実際には機能しない?
DEBUG_COMMAND_YET("NIGHTDLL.RunEventBattle %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.RunEventBattle %d:", p1);
}
// CD再生開始
@@ -384,7 +384,7 @@ static void CDPlay(void) { /* 38 */
nt_cd_play(p1);
DEBUG_COMMAND_YET("NIGHTDLL.CDPlay %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.CDPlay %d:", p1);
}
// CD再生停止
@@ -393,7 +393,7 @@ static void CDStop(void) { /* 39 */
nt_cd_stop(p1);
DEBUG_COMMAND_YET("NIGHTDLL.CDStop %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.CDStop %d:", p1);
}
// CDのmute
@@ -402,7 +402,7 @@ static void CDMute(void) { /* 40 */
nt_cd_mute(p1 == 0 ? FALSE : TRUE);
DEBUG_COMMAND_YET("NIGHTDLL.CDMute %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.CDMute %d:", p1);
}
// ch に効果音番号をセット
@@ -412,7 +412,7 @@ static void SoundEffectSetWave(void) { /* 41 */
nt_snd_setwave(p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetWave %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("NIGHTDLL.SoundEffectSetWave %d,%d:", p1, p2);
}
// ch にくり返し数をセット
@@ -422,7 +422,7 @@ static void SoundEffectSetLoop(void) { /* 42 */
nt_snd_setloop(p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetLoop %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("NIGHTDLL.SoundEffectSetLoop %d,%d:", p1, p2);
}
// ch に音量をセット
@@ -432,7 +432,7 @@ static void SoundEffectSetVolume(void) { /* 43 */
nt_snd_setvol(p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetVolue %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("NIGHTDLL.SoundEffectSetVolue %d,%d:", p1, p2);
}
// 効果音の再生を終るまで待つか待たないか?
@@ -442,7 +442,7 @@ static void SoundEffectSetSyncFlag(void) { /* 44 */
nt_snd_waitend(p1, p2 == 0 ? FALSE : TRUE);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetSyncFlag %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("NIGHTDLL.SoundEffectSetSyncFlag %d,%d:", p1, p2);
}
// ch の効果音を再生
@@ -451,7 +451,7 @@ static void SoundEffectPlay(void) { /* 45 */
nt_snd_play(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectPlay %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SoundEffectPlay %d:", p1);
}
// ch の効果音を停止
@@ -461,7 +461,7 @@ static void SoundEffectStop(void) { /* 46 */
nt_snd_stop(p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStop %d,%d:", p1,p2);
TRACE_UNIMPLEMENTED("NIGHTDLL.SoundEffectStop %d,%d:", p1,p2);
}
// 全てのチャンネルの再生を停止
@@ -470,86 +470,86 @@ static void SoundEffectStopAll(void) { /* 47 */
nt_snd_stopall(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStopAll %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SoundEffectStopAll %d:", p1);
}
static void RunSoundMode(void) { /* 48 */
DEBUG_COMMAND_YET("NIGHTDLL.RunSoundMode:");
TRACE_UNIMPLEMENTED("NIGHTDLL.RunSoundMode:");
}
static void RunMapEditor(void) { /* 49 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.RunMapEditor %p:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.RunMapEditor %p:", p1);
}
static void VisualListClear(void) { /* 50 */
DEBUG_COMMAND_YET("NIGHTDLL.VisualListClear:");
TRACE_UNIMPLEMENTED("NIGHTDLL.VisualListClear:");
}
static void VisualListAdd(void) { /* 51 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.VisualListAdd %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.VisualListAdd %d:", p1);
}
static void GetLocalCountCG(void) { /* 52 */
int *p1 = getCaliVariable();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.GetLocalCountCG %p,%d:", p1, p2);
TRACE_UNIMPLEMENTED("NIGHTDLL.GetLocalCountCG %p,%d:", p1, p2);
}
static void PlayMemory(void) { /* 53 */
int *p1 = getCaliVariable(); // 回想ページ
int *p2 = getCaliVariable(); // 回想RESULT
DEBUG_COMMAND_YET("NIGHTDLL.PlayMemory %p,%p:", p1, p2);
TRACE_UNIMPLEMENTED("NIGHTDLL.PlayMemory %p,%p:", p1, p2);
}
static void GetEventFlagTotal(void) { /* 54 */
int *p1 = getCaliVariable();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.GetEventFlagTotal %p,%d:", p1, p2);
TRACE_UNIMPLEMENTED("NIGHTDLL.GetEventFlagTotal %p,%d:", p1, p2);
}
static void SetPlayerName(void) { /* 55 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.SetPlayerName %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetPlayerName %d:", p1);
}
static void GetPlayerName(void) { /* 56 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.GetPlayerName %d:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.GetPlayerName %d:", p1);
}
static void SaveGame(void) { /* 57 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.SaveGame %p:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.SaveGame %p:", p1);
}
static void LoadGame(void) { /* 58 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.LoadGame %p:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.LoadGame %p:", p1);
}
static void ExistSaveData(void) { /* 59 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.ExistSaveData %p:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.ExistSaveData %p:", p1);
}
static void ExistStartData(void) { /* 60 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.ExistStartData %p:", p1);
TRACE_UNIMPLEMENTED("NIGHTDLL.ExistStartData %p:", p1);
}
static void SetAreaData(void) { /* 61 */
@@ -557,27 +557,27 @@ static void SetAreaData(void) { /* 61 */
int p2 = getCaliValue();
int p3 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.SetAreaData %d,%d,%d:", p1, p2, p3);
TRACE_UNIMPLEMENTED("NIGHTDLL.SetAreaData %d,%d,%d:", p1, p2, p3);
}
static void RunBattleTest(void) { /* 62 */
DEBUG_COMMAND_YET("NIGHTDLL.RunBattleTest:");
TRACE_UNIMPLEMENTED("NIGHTDLL.RunBattleTest:");
}
static void RunTrainingTest(void) { /* 63 */
DEBUG_COMMAND_YET("NIGHTDLL.RunTrainingTest:");
TRACE_UNIMPLEMENTED("NIGHTDLL.RunTrainingTest:");
}
static void TestEventCall(void) { /* 64 */
DEBUG_COMMAND_YET("NIGHTDLL.TestEventCall:");
TRACE_UNIMPLEMENTED("NIGHTDLL.TestEventCall:");
}
static void Test(void) { /* 65 */
DEBUG_COMMAND_YET("NIGHTDLL.Test:");
TRACE_UNIMPLEMENTED("NIGHTDLL.Test:");
}
static void DebugScenario(void) { /* 66 */
DEBUG_COMMAND_YET("NIGHTDLL.DebugScenario:");
TRACE_UNIMPLEMENTED("NIGHTDLL.DebugScenario:");
}
static void GetDLLTime(void) { /* 67 */
@@ -589,7 +589,7 @@ static void GetDLLTime(void) { /* 67 */
int *p6 = getCaliVariable();
int *p7 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.GetDLLTime %p,%p,%p,%p,%p,%p,%p:", p1, p2, p3, p4, p5, p6, p7);
TRACE_UNIMPLEMENTED("NIGHTDLL.GetDLLTime %p,%p,%p,%p,%p,%p,%p:", p1, p2, p3, p4, p5, p6, p7);
}
static const ModuleFunc functions[] = {
+4 -4
View File
@@ -9,6 +9,7 @@
#include "system.h"
#include "input.h"
#include "sdl_core.h"
#include "scheduler.h"
#include "xsystem35.h"
#include "nact.h"
#include "scenario.h"
@@ -52,7 +53,8 @@ static void ntmain(struct _scoadr inadr) {
struct _scoadr curadr;
while (!nact->is_quit) {
for (int cnt = 0; !nact->is_quit && !nact->wait_vsync && cnt < 10000; cnt++) {
while (!nact->is_quit && !is_yield_requested()) {
scheduler_on_command();
//SACT_DEBUG("%d:%x", sl_getPage(), sl_getIndex());
if (!nact->popupmenu_opened) {
exec_command();
@@ -71,9 +73,7 @@ static void ntmain(struct _scoadr inadr) {
nact->callback();
}
sys_getInputInfo();
sdl_wait_vsync();
nact->frame_count++;
nact->wait_vsync = FALSE;
scheduler_yield();
}
}
+4 -4
View File
@@ -57,15 +57,15 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
#define SCALEDCOPYAREA(type) { \
int x, y; \
type *sl, *dl; \
uint8_t *_sl, *_dl; \
uint8_t *_sl, *_dl; \
for (y = 0; y < dh; y++) { \
sl = (type *)(sdata + *(y + col) * src->bytes_per_line);\
dl = (type *)(ddata + y * dst->bytes_per_line);\
for (x = 0; x < dw; x++) { \
*(dl + x) = *(sl + *(row + x)); \
} \
_dl = (uint8_t *)dl; \
while(*(col + y) == *(col + y + 1)) { \
_dl = (uint8_t *)dl; \
while (y < dh - 1 && *(col + y) == *(col + y + 1)) { \
_sl = _dl; \
_dl += dst->bytes_per_line; \
memcpy(_dl, _sl, dw * sizeof(type)); \
@@ -98,7 +98,7 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
*(dl + x) = *(sl + *(row + x));
}
_dl = (uint8_t *)dl;
while(*(col + y) == *(col + y + 1)) {
while (y < dh - 1 && *(col + y) == *(col + y + 1)) {
_sl = _dl;
_dl += dst->width;
memcpy(_dl, _sl, dw);
+4 -3
View File
@@ -51,7 +51,7 @@ static void ndd_run(int demonum) {
int mus = ndemo_mus[demonum];
if (mus)
musbgm_play(mus, 0, 100);
musbgm_play(mus, 0, 100, 0);
uint32_t start = sdl_getTicks();
while (!nact->is_quit) {
@@ -73,6 +73,7 @@ static void ndd_run(int demonum) {
if (sys_keywait(wait_ms, KEYWAIT_CANCELABLE))
break;
} else {
sdl_updateScreen();
if (sys_getInputInfo())
break;
}
@@ -92,7 +93,7 @@ static void Init() {
*var = 1;
DEBUG_COMMAND("NightDemonDemo.Init %d,%d,%d,%p:", p1, p2, p3, var);
TRACE("NightDemonDemo.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void Run() {
@@ -101,7 +102,7 @@ static void Run() {
ndd_run(p1);
DEBUG_COMMAND("NightDemonDemo.Run %d,%d:", p1, p2);
TRACE("NightDemonDemo.Run %d,%d:", p1, p2);
}
static const ModuleFunc functions[] = {
+3 -3
View File
@@ -40,7 +40,7 @@ static void Init() {
*/
int p1 = getCaliValue(); /* ITimer */
DEBUG_COMMAND_YET("RandMT.Init %p:", p1);
TRACE_UNIMPLEMENTED("RandMT.Init %p:", p1);
}
static void Get() {
@@ -59,7 +59,7 @@ static void Get() {
*var = (int)(genrand() * num) + 1;
}
DEBUG_COMMAND("RandMT.Get %d,%p:", num, var);
TRACE("RandMT.Get %d,%p:", num, var);
}
static void GetNoOverlap() {
@@ -69,7 +69,7 @@ static void GetNoOverlap() {
*var = (int)(genrand() * n) + min;
DEBUG_COMMAND("RandMT.GetNoOverlap %d,%d,%p:", min, n, var);
TRACE("RandMT.GetNoOverlap %d,%d,%p:", min, n, var);
}
static const ModuleFunc functions[] = {
+238
View File
@@ -0,0 +1,238 @@
/*
* Copyright (C) 2025 <KichikuouChrome@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "config.h"
#include "modules.h"
#include "nact.h"
#include "bgm.h"
#include "music.h"
#include "music_pcm.h"
#define SLOT 128
static int current_no = 0;
static void Init(void) {
int isys3x = getCaliValue();
TRACE("S3xMusic.Init %d:", isys3x);
}
static void CreateChannel(void) {
int nr_channels = getCaliValue();
if (nr_channels != 2)
SYSERROR("Unsupported number of channels: %d", nr_channels);
TRACE("S3xMusic.CreateChannel %d:", nr_channels);
}
static void Prepare(void) {
int ch = getCaliValue();
int no = getCaliValue();
int *result = getCaliVariable();
if (ch == 0) {
current_no = no;
*result = 1;
} else {
*result = muspcm_load_bgm(SLOT, no) == OK;
}
TRACE("S3xMusic.Prepare %d, %d => %d:", ch, no, *result);
}
static void Unprepare(void) {
int ch = getCaliValue();
if (ch == 0) {
if (current_no) {
musbgm_stop(current_no, 0);
current_no = 0;
}
} else {
muspcm_unload(SLOT);
}
TRACE("S3xMusic.Unprepare %d:", ch);
}
static void Play(void) {
int p1 = getCaliValue();
int p2 = getCaliValue();
TRACE_UNIMPLEMENTED("S3xMusic.Play %d, %d:", p1, p2);
}
static void FadePlay(void) {
int ch = getCaliValue();
int fadein_time = getCaliValue();
int volume = getCaliValue();
int loop_count = getCaliValue(); // 0 = infinite
if (ch == 0) {
musbgm_play(current_no, fadein_time, volume, loop_count);
} else {
muspcm_start(SLOT, loop_count == 0 ? -1 : loop_count);
}
TRACE("S3xMusic.FadePlay %d, %d, %d, %d:", ch, fadein_time, volume, loop_count);
}
static void PlayPosSample(void) {
int p1 = getCaliValue();
int p2 = getCaliValue();
int p3 = getCaliValue();
int p4 = getCaliValue();
TRACE_UNIMPLEMENTED("S3xMusic.PlayPosSample %d, %d, %d, %d:", p1, p2, p3, p4);
}
static void IsPlay(void) {
int ch = getCaliValue();
int *result = getCaliVariable();
if (ch == 0) {
*result = current_no && musbgm_isplaying(current_no);
} else {
*result = muspcm_isplaying(SLOT);
}
TRACE("S3xMusic.IsPlay %d => %d:", ch, *result);
}
static void Stop(void) {
int ch = getCaliValue();
if (ch == 0) {
if (current_no)
musbgm_stop(current_no, 0);
current_no = 0;
} else {
muspcm_stop(SLOT);
}
TRACE("S3xMusic.Stop %d:", ch);
}
static void Restart(void) {
int p1 = getCaliValue();
TRACE_UNIMPLEMENTED("S3xMusic.Restart %d:", p1);
}
static void GetPlayPos(void) {
int ch = getCaliValue();
int *hour = getCaliVariable();
int *min = getCaliVariable();
int *sec = getCaliVariable();
int *msec = getCaliVariable();
if (ch == 0) {
int time = musbgm_getpos(current_no);
*hour = time / 360000;
*min = (time / 6000) % 60;
*sec = (time / 100) % 60;
*msec = (time % 100) * 10;
} else {
// not implemented
*hour = 0;
*min = 0;
*sec = 0;
*msec = 0;
}
TRACE("S3xMusic.GetPlayPos %d => %d, %d, %d, %d:", ch, *hour, *min, *sec, *msec);
}
static void GetPlayPosSample(void) {
int p1 = getCaliValue();
int *var1 = getCaliVariable();
int *var2 = getCaliVariable();
TRACE_UNIMPLEMENTED("S3xMusic.GetPlayPosSample %d, %p, %p:", p1, var1, var2);
}
static void SetRepeatStart(void) {
int p1 = getCaliValue();
int p2 = getCaliValue();
int p3 = getCaliValue();
TRACE_UNIMPLEMENTED("S3xMusic.SetRepeatStart %d, %d, %d:", p1, p2, p3);
}
static void SetRepeatEnd(void) {
int p1 = getCaliValue();
int p2 = getCaliValue();
int p3 = getCaliValue();
TRACE_UNIMPLEMENTED("S3xMusic.SetRepeatEnd %d, %d, %d:", p1, p2, p3);
}
static void FadeVolume(void) {
int ch = getCaliValue();
int time = getCaliValue();
int volume = getCaliValue();
int stop_after_fade = getCaliValue();
if (ch == 0) {
if (stop_after_fade) {
musbgm_stop(current_no, time / 10);
} else {
musbgm_fade(current_no, time / 10, volume);
}
} else {
if (stop_after_fade) {
muspcm_fadeout(SLOT, time);
} else {
muspcm_setvol(SLOT, volume);
}
}
TRACE("S3xMusic.FadeVolume %d, %d, %d, %d:", ch, time, volume, stop_after_fade);
}
static void IsFade(void) {
int ch = getCaliValue();
int *result = getCaliVariable();
*result = 0;
TRACE_UNIMPLEMENTED("S3xMusic.IsFade %d => %d:", ch, *result);
}
static void StopFade(void) {
int ch = getCaliValue();
TRACE_UNIMPLEMENTED("S3xMusic.StopFade %d:", ch);
}
static void WaitEnd(void) {
int p1 = getCaliValue();
int p2 = getCaliValue(); // IWinMsg
TRACE_UNIMPLEMENTED("S3xMusic.WaitEnd %d, %d:", p1, p2);
}
static void sleep(void) {
int p1 = getCaliValue(); // IWinMsg
TRACE_UNIMPLEMENTED("S3xMusic.sleep %d:", p1);
}
static const ModuleFunc functions[] = {
{"CreateChannel", CreateChannel},
{"FadePlay", FadePlay},
{"FadeVolume", FadeVolume},
{"GetPlayPos", GetPlayPos},
{"GetPlayPosSample", GetPlayPosSample},
{"Init", Init},
{"IsFade", IsFade},
{"IsPlay", IsPlay},
{"Play", Play},
{"PlayPosSample", PlayPosSample},
{"Prepare", Prepare},
{"Restart", Restart},
{"SetRepeatEnd", SetRepeatEnd},
{"SetRepeatStart", SetRepeatStart},
{"Stop", Stop},
{"StopFade", StopFade},
{"Unprepare", Unprepare},
{"WaitEnd", WaitEnd},
{"sleep", sleep},
};
const Module module_S3xMusic = {"S3xMusic", functions, sizeof(functions) / sizeof(ModuleFunc)};
+138 -139
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -57,15 +57,15 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
#define SCALEDCOPYAREA(type) { \
int x, y; \
type *sl, *dl; \
uint8_t *_sl, *_dl; \
uint8_t *_sl, *_dl; \
for (y = 0; y < dh; y++) { \
sl = (type *)(sdata + *(y + col) * src->bytes_per_line);\
dl = (type *)(ddata + y * dst->bytes_per_line);\
for (x = 0; x < dw; x++) { \
*(dl + x) = *(sl + *(row + x)); \
} \
_dl = (uint8_t *)dl; \
while(*(col + y) == *(col + y + 1)) { \
_dl = (uint8_t *)dl; \
while (y < dh - 1 && *(col + y) == *(col + y + 1)) { \
_sl = _dl; \
_dl += dst->bytes_per_line; \
memcpy(_dl, _sl, dw * sizeof(type)); \
@@ -98,7 +98,7 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
*(dl + x) = *(sl + *(row + x));
}
_dl = (uint8_t *)dl;
while(*(col + y) == *(col + y + 1)) {
while (y < dh - 1 && *(col + y) == *(col + y + 1)) {
_sl = _dl;
_dl += dst->width;
memcpy(_dl, _sl, dw);
+5 -4
View File
@@ -586,10 +586,11 @@ int sp_query_size(int wNum, int *vw, int *vh) {
// テキストスプライトの現在の文字表示位置の取得
int sp_query_textpos(int wNum, int *vx, int *vy) {
if (wNum >= SPRITEMAX) goto errexit;
if (sact.sp[wNum]->type != SPRITE_MSG) goto errexit;
*vx = sact.sp[wNum]->u.msg.dspcur.x;
*vy = sact.sp[wNum]->u.msg.dspcur.y;
sprite_t *sp = sact.sp[wNum];
if (sp->type != SPRITE_MSG) goto errexit;
*vx = sp->u.msg.dspcur.x + sp->loc.x;
*vy = sp->u.msg.dspcur.y + sp->loc.y;
return OK;
errexit:
+1
View File
@@ -89,6 +89,7 @@ extern void smsg_newline(int wNum, int size);
extern void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wFont, int wSpeed, int wLineSpace, int wAlign, int wRSize, int wRFont, int wRLineSpace, int *wLength);
extern void smsg_clear(int wNum);
extern int smsg_is_empty();
extern int smsg_peek(int nTopStringNum);
extern int smsg_keywait(int sp1, int sp2, int timeout);
extern int smsg_update(sprite_t *sp);
+19
View File
@@ -385,6 +385,25 @@ int smsg_is_empty() {
return (sact.msgbuf[0] == '\0');
}
int smsg_peek(int nTopStringNum) {
char *p = sact.msgbuf;
int i;
for (i = 0; *p; i++) {
char *q = strchr(p, '\n');
if (q)
*q = '\0';
svar_set(nTopStringNum + i, p);
if (q) {
*q = '\n';
p = q + 2;
} else {
i++;
break;
}
}
return i;
}
/*
メッセージキー入力待ち
@param wNum1: スプライト番号1(アニメーションスプライト)
+54 -54
View File
@@ -49,7 +49,7 @@ static void GetAtArray(void) { /* 0 */
int *vResult = getCaliVariable();
int i, j;
DEBUG_COMMAND("ShArray.GetAtArray %p,%d,%d,%p:", vAry, cnt, type, vResult);
TRACE("ShArray.GetAtArray %p,%d,%d,%p:", vAry, cnt, type, vResult);
j = *vAry; vAry++;
for (i = 1; i < cnt; i++) {
@@ -93,7 +93,7 @@ static void AddAtArray(void) { /* 1 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.AddAtArray %p,%p,%d:", vAry1, vAry2, cnt);
TRACE("ShArray.AddAtArray %p,%p,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
int result = (*vAry1) + (*vAry2);
@@ -119,7 +119,7 @@ static void SubAtArray(void) { /* 2 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.SubAtArray %p,%p,%d:", vAry1, vAry2, cnt);
TRACE("ShArray.SubAtArray %p,%p,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
int result = (*vAry1) - (*vAry2);
@@ -145,7 +145,7 @@ static void MulAtArray(void) { /* 3 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.MulAtArray %p,%p,%d:", vAry1, vAry2, cnt);
TRACE("ShArray.MulAtArray %p,%p,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
int result = (*vAry1) * (*vAry2);
@@ -171,7 +171,7 @@ static void DivAtArray(void) { /* 4 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.DivAtArray: %d,%d,%d:", vAry1, vAry2, cnt);
TRACE("ShArray.DivAtArray: %d,%d,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
if (*vAry2 == 0) {
@@ -201,7 +201,7 @@ static void MinAtArray(void) { /* 5 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.MinAtArray: %d,%d,%d:", vAry1, vAry2, cnt);
TRACE("ShArray.MinAtArray: %d,%d,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
if (*vAry1 < *vAry2) {
@@ -224,7 +224,7 @@ static void MaxAtArray(void) { /* 6 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.MaxAtArray: %d,%d,%d:", vAry1, vAry2, cnt);
TRACE("ShArray.MaxAtArray: %d,%d,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
if (*vAry1 > *vAry2) {
@@ -247,7 +247,7 @@ static void AndNumArray(void) { /* 7 */
int val = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.AndNumArray: %p,%d,%d:", vAry, cnt, val);
TRACE("ShArray.AndNumArray: %p,%d,%d:", vAry, cnt, val);
for (i = 0; i < cnt; i++) {
(*vAry) &= val;
@@ -268,7 +268,7 @@ static void OrNumArray(void) { /* 8 */
int val = getCaliValue();
int i;
DEBUG_COMMAND_YET("ShArray.OrNumArray: %p,%d,%d:", vAry, cnt, val);
TRACE("ShArray.OrNumArray: %p,%d,%d:", vAry, cnt, val);
for (i = 0; i < cnt; i++) {
(*vAry) |= val;
@@ -289,7 +289,7 @@ static void XorNumArray(void) { /* 9 */
int val = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.XorNumArray %p,%d,%d:", vAry, cnt, val);
TRACE("ShArray.XorNumArray %p,%d,%d:", vAry, cnt, val);
for (i = 0; i < cnt; i++) {
(*vAry) ^= val;
@@ -313,7 +313,7 @@ static void SetEquArray(void) { /* 10 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetEquArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
TRACE("ShArray.SetEquArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults = (*vAry == val) ? 1 : 0;
@@ -337,7 +337,7 @@ static void SetNotArray(void) { /* 11 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetNotArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
TRACE("ShArray.SetNotArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults = (*vAry != val) ? 1 : 0;
@@ -360,7 +360,7 @@ static void SetLowArray(void) { /* 12 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetLowArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
TRACE("ShArray.SetLowArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
(*vResults) = ((*vAry < val) ? 1 : 0);
@@ -383,7 +383,7 @@ static void SetHighArray(void) { /* 13 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetHighArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
TRACE("ShArray.SetHighArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
(*vResults) = ((*vAry > val) ? 1 : 0);
@@ -410,7 +410,7 @@ static void SetRangeArray(void) { /* 14 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetRangeArray %p,%d,%d,%d,%p:", vAry, cnt, min, max, vResults);
TRACE("ShArray.SetRangeArray %p,%d,%d,%d,%p:", vAry, cnt, min, max, vResults);
for (i = 0; i < cnt; i++) {
*vResults = ((*vAry > min) && (*vAry < max)) ? 1 : 0;
@@ -437,7 +437,7 @@ static void SetAndEquArray(void) { /* 15 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetAndEquArray: %p,%d,%d,%d,%p:", vAry, mask, cnt, val, vResults);
TRACE("ShArray.SetAndEquArray: %p,%d,%d,%d,%p:", vAry, mask, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults = ((*vAry & mask) == val) ? 1 : 0;
@@ -461,7 +461,7 @@ static void AndEquArray(void) { /* 16 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndEquArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
TRACE("ShArray.AndEquArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= ((*vAry == val) ? 1 : 0);
@@ -485,7 +485,7 @@ static void AndNotArray(void) { /* 17 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndNotArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
TRACE("ShArray.AndNotArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= ((*vAry != val) ? 1 : 0);
@@ -509,7 +509,7 @@ static void AndLowArray(void) { /* 18 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndLowArray: %d,%d,%d,%d:", vAry, cnt, min, vResults);
TRACE("ShArray.AndLowArray: %d,%d,%d,%d:", vAry, cnt, min, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= ((*vAry < min) ? 1 : 0);
@@ -533,7 +533,7 @@ static void AndHighArray(void) { /* 19 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndHighArray: %p,%d,%d,%p:", vAry, cnt, max, vResults);
TRACE("ShArray.AndHighArray: %p,%d,%d,%p:", vAry, cnt, max, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= ((*vAry > max) ? 1 : 0);
@@ -559,7 +559,7 @@ static void AndRangeArray(void) { /* 20 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndRangeArray %d,%d,%d,%d,%d:", vAry, cnt, min, max, vResults);
TRACE("ShArray.AndRangeArray %d,%d,%d,%d,%d:", vAry, cnt, min, max, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= (((*vAry > min) && (*vAry < max)) ? 1 : 0);
@@ -586,7 +586,7 @@ static void AndAndEquArray(void) { /* 21 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndAndEquArray: %d,%d,%d,%d,%d:", vAry, mask, cnt, val, vResults);
TRACE("ShArray.AndAndEquArray: %d,%d,%d,%d,%d:", vAry, mask, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
(*vResults) &= (((*vAry & mask) == val) ? 1 : 0);
@@ -600,7 +600,7 @@ static void OrEquArray(void) { /* 22 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrEquArray: %d,%d,%d,%d:", p1, p2, p3, p4);
TRACE_UNIMPLEMENTED("ShArray.OrEquArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void OrNotArray(void) { /* 23 */
@@ -618,7 +618,7 @@ static void OrNotArray(void) { /* 23 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.OrNotArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
TRACE("ShArray.OrNotArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
// if (*vAry != val) *vResults = 1;
@@ -633,7 +633,7 @@ static void OrLowArray(void) { /* 24 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrLowArray: %d,%d,%d,%d:", p1, p2, p3, p4);
TRACE_UNIMPLEMENTED("ShArray.OrLowArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void OrHighArray(void) { /* 25 */
@@ -642,7 +642,7 @@ static void OrHighArray(void) { /* 25 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrHighArray: %d,%d,%d,%d:", p1, p2, p3, p4);
TRACE_UNIMPLEMENTED("ShArray.OrHighArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void OrRangeArray(void) { /* 26 */
@@ -652,7 +652,7 @@ static void OrRangeArray(void) { /* 26 */
int p4 = getCaliValue();
int p5 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrRangeArray: %d,%d,%d,%d,%d:", p1, p2, p3, p4,p5);
TRACE_UNIMPLEMENTED("ShArray.OrRangeArray: %d,%d,%d,%d,%d:", p1, p2, p3, p4,p5);
}
static void OrAndEquArray(void) { /* 27 */
@@ -662,7 +662,7 @@ static void OrAndEquArray(void) { /* 27 */
int p4 = getCaliValue();
int p5 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrAndEquArray: %d,%d,%d,%d,%d:", p1, p2, p3, p4,p5);
TRACE_UNIMPLEMENTED("ShArray.OrAndEquArray: %d,%d,%d,%d,%d:", p1, p2, p3, p4,p5);
}
static void EnumEquArray(void) { /* 28 */
@@ -680,7 +680,7 @@ static void EnumEquArray(void) { /* 28 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.EnumEquArray %p,%d,%d,%p:", vAry, cnt, val, vResult);
TRACE("ShArray.EnumEquArray %p,%d,%d,%p:", vAry, cnt, val, vResult);
*vResult = 0;
@@ -698,7 +698,7 @@ static void EnumEquArray2(void) { /* 29 */
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.EnumEquArray2: %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
TRACE_UNIMPLEMENTED("ShArray.EnumEquArray2: %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
}
static void EnumEquNotArray2(void) { /* 30 */
@@ -721,7 +721,7 @@ static void EnumEquNotArray2(void) { /* 30 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.EnumEquNotArray2 %p,%p,%d,%d,%d,%p:", vAry1, vAry2, cnt, val1, val2, vResult);
TRACE("ShArray.EnumEquNotArray2 %p,%p,%d,%d,%d,%p:", vAry1, vAry2, cnt, val1, val2, vResult);
*vResult = 0;
@@ -748,7 +748,7 @@ static void EnumNotArray(void) { /* 31 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.EnumNotArray %p, %d, %d, %p:", vAry, cnt, val, vResult);
TRACE("ShArray.EnumNotArray %p, %d, %d, %p:", vAry, cnt, val, vResult);
*vResult = 0;
@@ -768,7 +768,7 @@ static void EnumNotArray2(void) { /* 32 */
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.EnumNotArray2: %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
TRACE_UNIMPLEMENTED("ShArray.EnumNotArray2: %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
}
static void EnumLowArray(void) { /* 33 */
@@ -777,7 +777,7 @@ static void EnumLowArray(void) { /* 33 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.EnumLowArray: %d,%d,%d,%d:", p1, p2, p3, p4);
TRACE_UNIMPLEMENTED("ShArray.EnumLowArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void EnumHighArray(void) { /* 34 */
@@ -786,7 +786,7 @@ static void EnumHighArray(void) { /* 34 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.EnumHighArray: %d,%d,%d,%d:", p1, p2, p3, p4);
TRACE_UNIMPLEMENTED("ShArray.EnumHighArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void EnumRangeArray(void) { /* 35 */
@@ -806,7 +806,7 @@ static void EnumRangeArray(void) { /* 35 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.EnumRangeArray %d,%d,%d,%d,%d:", vAry, cnt, min, max, vResult);
TRACE("ShArray.EnumRangeArray %d,%d,%d,%d,%d:", vAry, cnt, min, max, vResult);
*vResult = 0;
@@ -837,7 +837,7 @@ static void GrepEquArray(void) { /* 36 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepEquArray %p,%d,%d,%p,%p:", vAry, cnt, val, vMatch, vResult);
TRACE("ShArray.GrepEquArray %p,%d,%d,%p,%p:", vAry, cnt, val, vMatch, vResult);
*vResult = 0;
@@ -869,7 +869,7 @@ static void GrepNotArray(void) { /* 37 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepNotArray %p,%d,%d,%p,%p:", vAry, cnt, val, vMatch, vResult);
TRACE("ShArray.GrepNotArray %p,%d,%d,%p,%p:", vAry, cnt, val, vMatch, vResult);
*vResult = 0;
@@ -892,7 +892,7 @@ static void GrepEquArray2(void) { /* 38 */
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.GrepEquArray2: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
TRACE_UNIMPLEMENTED("ShArray.GrepEquArray2: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void GrepNotArray2(void) { /* 39 */
@@ -904,7 +904,7 @@ static void GrepNotArray2(void) { /* 39 */
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.GrepNotArray2: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
TRACE_UNIMPLEMENTED("ShArray.GrepNotArray2: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void GrepEquNotArray2(void) { /* 40 */
@@ -916,7 +916,7 @@ static void GrepEquNotArray2(void) { /* 40 */
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.GrepEquNotArray2: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
TRACE_UNIMPLEMENTED("ShArray.GrepEquNotArray2: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void GrepLowArray(void) { /* 41 */
@@ -937,7 +937,7 @@ static void GrepLowArray(void) { /* 41 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepLowArray: %p,%d,%d,%p,%p:", vAry, cnt, min, vMatch, vResult);
TRACE("ShArray.GrepLowArray: %p,%d,%d,%p,%p:", vAry, cnt, min, vMatch, vResult);
*vResult = 0;
@@ -969,7 +969,7 @@ static void GrepHighArray(void) { /* 42 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepHighArray: %p,%d,%d,%p,%p:", vAry, cnt, max, vMatch, vResult);
TRACE("ShArray.GrepHighArray: %p,%d,%d,%p,%p:", vAry, cnt, max, vMatch, vResult);
*vResult = 0;
@@ -1003,7 +1003,7 @@ static void GrepRangeArray(void) { /* 43 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepRangeArray %p,%d,%d,%d,%p,%p:", vAry, cnt, max, min, vMatch, vResult);
TRACE("ShArray.GrepRangeArray %p,%d,%d,%d,%p,%p:", vAry, cnt, max, min, vMatch, vResult);
*vResult = 0;
@@ -1040,7 +1040,7 @@ static void GrepLowOrderArray(void) { /* 44 */
int *vResult = getCaliVariable();
int i, j, k = 0;
DEBUG_COMMAND("ShArray.GrepLowOrderArray %p,%d,%d,%d,%p,%p,%p:", vAry, cnt, min, max, v1, vLastMatch, vResult);
TRACE("ShArray.GrepLowOrderArray %p,%d,%d,%d,%p,%p,%p:", vAry, cnt, min, max, v1, vLastMatch, vResult);
*vResult = 0;
for (i = 0; i < cnt; i++) {
@@ -1091,7 +1091,7 @@ static void GrepHighOrderArray(void) { /* 45 */
int *vResult = getCaliVariable();
int i, j, k = 0;
DEBUG_COMMAND("ShArray.GrepHighOrderArray %p,%d,%d,%d,%p,%p,%p:", vAry, cnt, min, max, v1, vLastMatch, vResult);
TRACE("ShArray.GrepHighOrderArray %p,%d,%d,%d,%p,%p,%p:", vAry, cnt, min, max, v1, vLastMatch, vResult);
*vResult = 0;
for (i = 0; i < cnt; i++) {
@@ -1125,7 +1125,7 @@ static void ChangeEquArray(void) { /* 46 */
int dst = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.ChangeEquArray: %d,%d,%d,%d:", vAry, cnt, src, dst);
TRACE("ShArray.ChangeEquArray: %d,%d,%d,%d:", vAry, cnt, src, dst);
for (i = 0; i < cnt; i++) {
if (*vAry == src) {
@@ -1141,7 +1141,7 @@ static void ChangeNotArray(void) { /* 47 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.ChangeNotArray: %d,%d,%d,%d:", p1, p2, p3, p4);
TRACE_UNIMPLEMENTED("ShArray.ChangeNotArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void ChangeLowArray(void) { /* 48 */
@@ -1150,7 +1150,7 @@ static void ChangeLowArray(void) { /* 48 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.ChangeLowArray: %d,%d,%d,%d:", p1, p2, p3, p4);
TRACE_UNIMPLEMENTED("ShArray.ChangeLowArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void ChangeHighArray(void) { /* 49 */
@@ -1159,7 +1159,7 @@ static void ChangeHighArray(void) { /* 49 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.ChangeHighArray: %d,%d,%d,%d:", p1, p2, p3, p4);
TRACE_UNIMPLEMENTED("ShArray.ChangeHighArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void ChangeRangeArray(void) { /* 50 */
@@ -1179,7 +1179,7 @@ static void ChangeRangeArray(void) { /* 50 */
int val = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.ChangeRangeArray %p,%d,%d,%d,%d:", vAry, cnt, min, max, val);
TRACE("ShArray.ChangeRangeArray %p,%d,%d,%d,%d:", vAry, cnt, min, max, val);
for (i = 0; i < cnt; i++) {
if ((*vAry > min) && (*vAry < max)) {
@@ -1212,7 +1212,7 @@ static void CopyArrayToRect(void) { /* 51 */
int dh = getCaliValue();
int x, y;
DEBUG_COMMAND("ShArray.CopyArrayToRect %p,%d,%d,%d,%d,%p,%d,%d:", vSrc, sw, sh, sx, sy, vDst, dw, dh);
TRACE("ShArray.CopyArrayToRect %p,%d,%d,%d,%d,%p,%d,%d:", vSrc, sw, sh, sx, sy, vDst, dw, dh);
vSrc += (sy * sw + sx);
for (y = 0; y < dh; y++) {
@@ -1246,7 +1246,7 @@ static void CopyRectToArray(void) { /* 52 */
int dy = getCaliValue();
int x, y;
DEBUG_COMMAND("ShArray.CopyRectToArray %p,%d,%d,%p,%d,%d,%d,%d:", vSrc, sw, sh, vDst, dw, dh, dx, dy);
TRACE("ShArray.CopyRectToArray %p,%d,%d,%p,%d,%d,%d,%d:", vSrc, sw, sh, vDst, dw, dh, dx, dy);
vDst += (dy * dw + dx);
for (y = 0; y < sh; y++) {
@@ -1272,7 +1272,7 @@ static void ChangeSecretArray(void) { /* 53 */
int *vResult = getCaliVariable();
static uint16_t key[4] = { 0x7A7A, 0xADAD, 0xBCBC, 0xCECE }; /* key */
DEBUG_COMMAND("ShArray.ChangeSecretArray %p,%d,%d,%p:", vAry, cnt, type, vResult);
TRACE("ShArray.ChangeSecretArray %p,%d,%d,%p:", vAry, cnt, type, vResult);
*vResult = 0;
+68 -44
View File
@@ -38,9 +38,7 @@
#include "randMT.h"
static int numbase;
static int64_t l_1000A0C8;
static int64_t l_1000A0D0;
static int64_t l_1000A0D8;
static int64_t accumulator;
static int64_t mul64(int64_t a1, int64_t a2) {
return a1 * a2;
@@ -52,6 +50,10 @@ static int64_t div64(int64_t a1, int64_t a2) {
return a1 / a2;
}
static int64_t get32(int *var) {
return var[0] + mul64(var[1], 0x10000);
}
static void SetIntNumBase(void) { /* 0 */
/*
64 bit 演算のための倍数をセット
@@ -62,7 +64,7 @@ static void SetIntNumBase(void) { /* 0 */
numbase = base;
DEBUG_COMMAND("ShCalc.SetIntNumBase %d:", base);
TRACE("ShCalc.SetIntNumBase %d:", base);
}
@@ -74,15 +76,17 @@ static void SetIntNum16(void) { /* 1 */
*/
int *var = getCaliVariable();
l_1000A0D8 = mul64(*var, numbase);
accumulator = mul64(*var, numbase);
DEBUG_COMMAND("ShCalc.SetIntNum16 %p:", var);
TRACE("ShCalc.SetIntNum16 %p:", var);
}
static void SetIntNum32(void) { /* 2 */
int p1 = getCaliValue();
int *var = getCaliVariable();
accumulator = mul64(get32(var), numbase);
DEBUG_COMMAND_YET("ShCalc.SetIntNum32: %d:", p1);
TRACE("ShCalc.SetIntNum32: %p:", var);
}
static void GetIntNum16(void) { /* 3 */
@@ -94,21 +98,26 @@ static void GetIntNum16(void) { /* 3 */
int *var = getCaliVariable();
int64_t i;
i = div64(l_1000A0D8, numbase);
i = div64(accumulator, numbase);
if (i > 65535) {
i = l_1000A0C8 = 65535;
i = 65535;
}
*var = i;
DEBUG_COMMAND("ShCalc.GetIntNum16 %d:", var);
TRACE("ShCalc.GetIntNum16 %d:", var);
}
static void GetIntNum32(void) { /* 4 */
int p1 = getCaliValue();
int *var = getCaliVariable();
int64_t i = div64(accumulator, numbase);
DEBUG_COMMAND_YET("ShCalc.GetIntNum32: %d:", p1);
var[0] = i & 0xFFFF;
i >>= 16;
var[1] = i > 0xFFFF ? 0xFFFF : i;
TRACE("ShCalc.GetIntNum32: %p:", var);
}
static void AddIntNum16(void) { /* 5 */
@@ -119,27 +128,31 @@ static void AddIntNum16(void) { /* 5 */
*/
int *var = getCaliVariable();
l_1000A0D8 += mul64(*var, numbase);
accumulator += mul64(*var, numbase);
DEBUG_COMMAND("ShCalc.AddIntNum16 %p:", var);
TRACE("ShCalc.AddIntNum16 %p:", var);
}
static void AddIntNum32(void) { /* 6 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.AddIntNum32: %d:", p1);
int *var = getCaliVariable();
accumulator += mul64(get32(var), numbase);
TRACE("ShCalc.AddIntNum32: %p:", var);
}
static void SubIntNum16(void) { /* 7 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.SubIntNum16: %d:", p1);
TRACE_UNIMPLEMENTED("ShCalc.SubIntNum16: %d:", p1);
}
static void SubIntNum32(void) { /* 8 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.SubIntNum32: %d:", p1);
int *var = getCaliVariable();
accumulator -= mul64(get32(var), numbase);
TRACE("ShCalc.SubIntNum32: %p:", var);
}
static void MulIntNum16(void) { /* 9 */
@@ -150,15 +163,15 @@ static void MulIntNum16(void) { /* 9 */
*/
int *var = getCaliVariable();
l_1000A0D8 *= mul64(*var, numbase);
accumulator *= mul64(*var, numbase);
DEBUG_COMMAND("ShCalc.MulIntNum16: %p:", var);
TRACE("ShCalc.MulIntNum16: %p:", var);
}
static void MulIntNum32(void) { /* 10 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.MulIntNum32: %d:", p1);
TRACE_UNIMPLEMENTED("ShCalc.MulIntNum32: %d:", p1);
}
static void DivIntNum16(void) { /* 11 */
@@ -170,18 +183,16 @@ static void DivIntNum16(void) { /* 11 */
int *var = getCaliVariable();
int64_t i;
l_1000A0C8 = *var;
i = mul64(*var, numbase);
accumulator = div64(accumulator, i);
i = mul64(l_1000A0C8, numbase);
l_1000A0D8 = div64(l_1000A0D8, i);
DEBUG_COMMAND("ShCalc.DivIntNum16 %p:", var);
TRACE("ShCalc.DivIntNum16 %p:", var);
}
static void DivIntNum32(void) { /* 12 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.DivIntNum32: %d:", p1);
TRACE_UNIMPLEMENTED("ShCalc.DivIntNum32: %d:", p1);
}
static void CmpIntNum16(void) { /* 13 */
@@ -189,15 +200,28 @@ static void CmpIntNum16(void) { /* 13 */
int p2 = getCaliValue();
int p3 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.CmpIntNum16: %d,%d,%d:", p1, p2, p3);
TRACE_UNIMPLEMENTED("ShCalc.CmpIntNum16: %d,%d,%d:", p1, p2, p3);
}
static void CmpIntNum32(void) { /* 14 */
int p1 = getCaliValue();
int p2 = getCaliValue();
int p3 = getCaliValue();
int *var = getCaliVariable();
int op = getCaliValue();
int *result = getCaliVariable();
DEBUG_COMMAND_YET("ShCalc.CmpIntNum32: %d,%d,%d:", p1, p2, p3);
int64_t val = mul64(get32(var), numbase);
switch (op) {
case 1: *result = val == accumulator; break;
case 2: *result = val > accumulator; break;
case 3: *result = val < accumulator; break;
case 4: *result = val >= accumulator; break;
case 5: *result = val <= accumulator; break;
default:
WARNING("ShCalc.CmpIntNum32: unknown operator %d", op);
break;
}
TRACE("ShCalc.CmpIntNum32: %p,%d,%p:", var, op, result);
}
static void GetLengthNum16(void) { /* 15 */
@@ -221,14 +245,14 @@ static void GetLengthNum16(void) { /* 15 */
*vResult = 1;
}
DEBUG_COMMAND("ShCalc.GetLengthNum16 %p,%p:", var, vResult);
TRACE("ShCalc.GetLengthNum16 %p,%p:", var, vResult);
}
static void GetLengthNum32(void) { /* 16 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.GetLengthNum32: %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("ShCalc.GetLengthNum32: %d,%d:", p1, p2);
}
static void NumToRate(void) { /* 17 */
@@ -259,7 +283,7 @@ static void NumToRate(void) { /* 17 */
*vResult = i;
DEBUG_COMMAND("ShCalc.NumToRate %d,%d,%d,%d,%p:", p1, p2, p3, flag, vResult);
TRACE("ShCalc.NumToRate %d,%d,%d,%d,%p:", p1, p2, p3, flag, vResult);
}
@@ -291,7 +315,7 @@ static void NumToRateNum(void) { /* 18 */
*vResult = i;
DEBUG_COMMAND("ShCalc.NumToRateNum %d,%d,%d,%d,%p:", p1, p2, p3, flag, vResult);
TRACE("ShCalc.NumToRateNum %d,%d,%d,%d,%p:", p1, p2, p3, flag, vResult);
}
static void SetRandomSeed() {
@@ -304,7 +328,7 @@ static void SetRandomSeed() {
sgenrand(seed);
DEBUG_COMMAND("ShCalc.SetRandomSeed %d:", seed);
TRACE("ShCalc.SetRandomSeed %d:", seed);
}
static void GetRandomNumA() {
@@ -317,7 +341,7 @@ static void GetRandomNumA() {
*var = (int)(genrand() * num) + 1;
}
DEBUG_COMMAND("ShCalc.GetRandomNumA %d,%p:", num, var);
TRACE("ShCalc.GetRandomNumA %d,%p:", num, var);
}
static void NumToBit() {
@@ -339,7 +363,7 @@ static void NumToBit() {
*var = 0;
}
DEBUG_COMMAND("ShCalc.NumToBit %d,%p:", beki, var);
TRACE("ShCalc.NumToBit %d,%p:", beki, var);
}
static void BitToNum() {
@@ -358,7 +382,7 @@ static void BitToNum() {
int *var = getCaliVariable();
int i;
DEBUG_COMMAND("ShCalc.BitToNum %d,%p:", val, var);
TRACE("ShCalc.BitToNum %d,%p:", val, var);
if (val == 0) {
*var = 0;
+12 -12
View File
@@ -96,13 +96,13 @@ static void Init() {
*/
int p1 = getCaliValue(); /* ISurface */
DEBUG_COMMAND("ShGraph.Init %d:", p1);
TRACE("ShGraph.Init %d:", p1);
}
static void GetSurfaceData() {
int p1 = getCaliValue(); /* ISurface */
DEBUG_COMMAND_YET("ShGraph.GetSurfaceData %d:", p1);
TRACE_UNIMPLEMENTED("ShGraph.GetSurfaceData %d:", p1);
}
static void ChangeEquColor() {
@@ -114,7 +114,7 @@ static void ChangeEquColor() {
int *p6 = getCaliVariable();
int p7 = getCaliValue(); /* ISurface */
DEBUG_COMMAND_YET("ShGraph.ChangeEquColor %d,%d,%d,%d,%p,%p,%d:", p1, p2, p3, p4, p5, p6, p7);
TRACE_UNIMPLEMENTED("ShGraph.ChangeEquColor %d,%d,%d,%d,%p,%p,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void ChangeNotColor() {
@@ -139,7 +139,7 @@ static void ChangeNotColor() {
int x, y;
uint8_t *dp;
DEBUG_COMMAND("ShGraph.ChangeNotColor %d,%d,%d,%d,%p,%p,%d:", x0, y0, width, height, src, dst, p7);
TRACE("ShGraph.ChangeNotColor %d,%d,%d,%d,%p,%p,%d:", x0, y0, width, height, src, dst, p7);
ags_check_param(&x0, &y0, &width, &height);
@@ -222,7 +222,7 @@ static void ResetAnimeData() {
*/
int no = getCaliValue();
DEBUG_COMMAND("ShGraph.ResetAnimeData %d:", no);
TRACE("ShGraph.ResetAnimeData %d:", no);
if (no > 0 && no <= SLOT) {
memset(&src[no-1], 0, sizeof(struct animsrc));
@@ -262,7 +262,7 @@ static void SetAnimeSrc() {
int *pal = getCaliVariable();
int r, g, b;
DEBUG_COMMAND("ShGraph.SetAnimeSrc %d,%d,%d,%d,%d,%d,%d,%p:", no, x0, y0, w, h, uw, uh, pal);
TRACE("ShGraph.SetAnimeSrc %d,%d,%d,%d,%d,%d,%d,%p:", no, x0, y0, w, h, uw, uh, pal);
if (no <= 0 || no > SLOT) return;
@@ -302,7 +302,7 @@ static void SetAnimeDst() {
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND("ShGraph.SetAnimeDst %d,%p,%p,%d,%d,%d,%d:", no, p1, p2, p3, p4, p5, p6);
TRACE("ShGraph.SetAnimeDst %d,%p,%p,%d,%d,%d,%d:", no, p1, p2, p3, p4, p5, p6);
if (no <= 0 || no > SLOT) return;
@@ -336,7 +336,7 @@ static void AddAnimeData() {
int p6 = getCaliValue();
int i;
DEBUG_COMMAND("ShGraph.AddAnimeData %d,%d,%d,%d,%p,%d:", no, p2, p3, p4, p5, p6);
TRACE("ShGraph.AddAnimeData %d,%d,%d,%d,%p,%d:", no, p2, p3, p4, p5, p6);
if (no <= 0 || no > SLOT) return;
@@ -370,7 +370,7 @@ static void AddAnimeRemain() {
int no = getCaliValue();
int i, _max = 0;
DEBUG_COMMAND("ShGraph.AddAnimeRemain %d:", no);
TRACE("ShGraph.AddAnimeRemain %d:", no);
if (no <= 0 || no > SLOT) return;
@@ -401,7 +401,7 @@ static void SetAnimeRect() {
int w = getCaliValue();
int h = getCaliValue();
DEBUG_COMMAND("ShGraph.SetAnimeRect %d,%d,%d,%d:", x, y, w, h);
TRACE("ShGraph.SetAnimeRect %d,%d,%d,%d:", x, y, w, h);
maprect.x = x;
maprect.y = y;
@@ -427,7 +427,7 @@ static void SetAnimeBack() {
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND("ShGraph.SetAnimeBack %d,%d,%d,%d,%d,%d:", sx, sy, w, h, p5, p6);
TRACE("ShGraph.SetAnimeBack %d,%d,%d,%d,%d,%d:", sx, sy, w, h, p5, p6);
mapback.x = sx;
mapback.y = sy;
@@ -455,7 +455,7 @@ static void PlayAnimeData() {
boolean is_backcopied;
agsurface_t *dib;
DEBUG_COMMAND("ShGraph.PlayAnimeData %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
TRACE("ShGraph.PlayAnimeData %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
interval = p2 * 10;
+10 -11
View File
@@ -36,7 +36,6 @@
#include "xsystem35.h"
#include "modules.h"
#include "sdl_core.h"
#include "sdl_private.h"
#include "input.h"
#include "menu.h"
@@ -55,12 +54,12 @@ static void OutputMessageBox(void) { /* 0 */
char *title_utf8 = toUTF8(svar_get(title));
char *msg_utf8 = toUTF8(svar_get(msg));
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, title_utf8, msg_utf8, sdl_window);
sdl_showMessageBox(MESSAGEBOX_INFO, title_utf8, msg_utf8);
free(title_utf8);
free(msg_utf8);
DEBUG_COMMAND("ShPort.OutputMessageBox: %d,%d,%d,%d,%p,%d:", p1, p2, title, msg, res, ISys3xSystem);
TRACE("ShPort.OutputMessageBox: %d,%d,%d,%d,%p,%d:", p1, p2, title, msg, res, ISys3xSystem);
}
static void InputListNum(void) { /* 1 */
@@ -88,7 +87,7 @@ static void InputListNum(void) { /* 1 */
}
free(ni_param.title);
DEBUG_COMMAND("ShPort.InputListNum: %d,%d,%p,%d,%d,%p,%d:", flags, title, val, minval, maxval, res, ISys3xSystem);
TRACE("ShPort.InputListNum: %d,%d,%p,%d,%d,%p,%d:", flags, title, val, minval, maxval, res, ISys3xSystem);
}
/**
@@ -99,7 +98,7 @@ static void InputListNum(void) { /* 1 */
static void Init(void) {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShPort.Init: %d:", p1);
TRACE_UNIMPLEMENTED("ShPort.Init: %d:", p1);
}
/**
@@ -121,7 +120,7 @@ static void InitKeyStatus(void) {
memset(keymap[no -1], 0, 256);
}
DEBUG_COMMAND("ShPort.InitKeyStatus: %d:", no);
TRACE("ShPort.InitKeyStatus: %d:", no);
}
/**
@@ -143,7 +142,7 @@ static void SetKeyStatus(void) {
keymap[no -1][key] = func;
DEBUG_COMMAND("ShPort.SetKeyStatus: %d,%d,%d:", no, key, func);
TRACE("ShPort.SetKeyStatus: %d,%d,%d:", no, key, func);
}
/**
@@ -167,7 +166,7 @@ static void GetKeyStatus(void) {
*var |= (keymap[no -1][i] * RawKeyInfo[i]);
}
DEBUG_COMMAND("ShPort.GetKeyStatus: %d,%p:", no, var);
TRACE("ShPort.GetKeyStatus: %d,%p:", no, var);
}
static void InputListString(void) {
@@ -179,7 +178,7 @@ static void InputListString(void) {
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShPort.InputListString: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p3, p4, p5, p6, p7);
TRACE_UNIMPLEMENTED("ShPort.InputListString: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p3, p4, p5, p6, p7);
}
static void InputOpenFile(void) {
@@ -191,7 +190,7 @@ static void InputOpenFile(void) {
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShPort.InputOpenFile: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p3, p4, p5, p6, p7);
TRACE_UNIMPLEMENTED("ShPort.InputOpenFile: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p3, p4, p5, p6, p7);
}
static void InputSaveFile(void) {
@@ -203,7 +202,7 @@ static void InputSaveFile(void) {
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShPort.InputSaveFile: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p3, p4, p5, p6, p7);
TRACE_UNIMPLEMENTED("ShPort.InputSaveFile: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p3, p4, p5, p6, p7);
}
static const ModuleFunc functions[] = {
+16 -16
View File
@@ -54,7 +54,7 @@ static void Init() {
*/
int p1 = getCaliValue(); /* ISys3x */
DEBUG_COMMAND("ShSound.Init %d:", p1);
TRACE("ShSound.Init %d:", p1);
}
static void wavLoad() {
@@ -67,7 +67,7 @@ static void wavLoad() {
int slot = getCaliValue();
int no = getCaliValue();
DEBUG_COMMAND("ShSound.wavLoad %d,%d:", slot, no);
TRACE("ShSound.wavLoad %d,%d:", slot, no);
mus_wav_load(slot, no);
}
@@ -82,7 +82,7 @@ static void wavUnload() {
mus_wav_unload(slot);
DEBUG_COMMAND("ShSound.wavUnload %d:",slot);
TRACE("ShSound.wavUnload %d:",slot);
}
static void wavUnloadRange() {
@@ -100,7 +100,7 @@ static void wavUnloadRange() {
mus_wav_unload(i);
}
DEBUG_COMMAND("ShSound.wavUnloadRange %d,%d:", slot, range);
TRACE("ShSound.wavUnloadRange %d,%d:", slot, range);
}
static void wavUnloadAll() {
@@ -113,7 +113,7 @@ static void wavUnloadAll() {
mus_wav_unload(i);
}
DEBUG_COMMAND("ShSound.wavUnloadAll:");
TRACE("ShSound.wavUnloadAll:");
}
static void wavLoadMemory() {
@@ -142,7 +142,7 @@ static void wavLoadMemory() {
return;
}
DEBUG_COMMAND("ShSound.wavLoadMemory %d:", no);
TRACE("ShSound.wavLoadMemory %d:", no);
}
static void wavSendMemory() {
@@ -186,7 +186,7 @@ static void wavSendMemory() {
free_memory_wav();
free(wav_buf);
DEBUG_COMMAND("ShSound.wavSendMemory %d:", slot);
TRACE("ShSound.wavSendMemory %d:", slot);
}
static void wavFadeVolumeMemory() {
@@ -220,7 +220,7 @@ static void wavFadeVolumeMemory() {
// 残りは無音
memset(buf, 0, memwav.buf + memwav.len - (uint8_t*)buf);
DEBUG_COMMAND("ShSound.wavFadeVolumeMemory %d,%d:", start, range);
TRACE("ShSound.wavFadeVolumeMemory %d,%d:", start, range);
}
static void wavReversePanMemory() {
@@ -240,7 +240,7 @@ static void wavReversePanMemory() {
buf += 2;
}
DEBUG_COMMAND("ShSound.wavReversePanMemory:");
TRACE("ShSound.wavReversePanMemory:");
}
static void wavPlay() {
@@ -255,7 +255,7 @@ static void wavPlay() {
mus_wav_play(slot, loop == 0 ? 1 : -1);
DEBUG_COMMAND("ShSound.wavPlay %d, %d:", slot, loop);
TRACE("ShSound.wavPlay %d, %d:", slot, loop);
}
static void wavPlayRing() {
@@ -273,7 +273,7 @@ static void wavPlayRing() {
mus_wav_play(start + (*cur % cnt), 1);
*cur = (*cur + 1) % cnt;
DEBUG_COMMAND("ShSound.wavPlayRing %d,%d,%d:", start, cnt, *cur);
TRACE("ShSound.wavPlayRing %d,%d,%d:", start, cnt, *cur);
}
static void wavStop() {
@@ -284,7 +284,7 @@ static void wavStop() {
*/
int slot = getCaliValue();
DEBUG_COMMAND("ShSound.wavStop %d:", slot);
TRACE("ShSound.wavStop %d:", slot);
mus_wav_stop(slot);
}
@@ -299,7 +299,7 @@ static void wavStopAll() {
mus_wav_stop(i);
}
DEBUG_COMMAND("ShSound.wavStopAll:");
TRACE("ShSound.wavStopAll:");
}
static void wavPause() {
@@ -310,7 +310,7 @@ static void wavPause() {
*/
int slot = getCaliValue();
DEBUG_COMMAND_YET("ShSound.wavPause %d:", slot);
TRACE_UNIMPLEMENTED("ShSound.wavPause %d:", slot);
}
static void wavIsPlay() {
@@ -325,7 +325,7 @@ static void wavIsPlay() {
*result = mus_wav_get_playposition(slot);
DEBUG_COMMAND("ShSound.wavIsPlay %d,%p:", slot, result);
TRACE("ShSound.wavIsPlay %d,%p:", slot, result);
}
static void wavIsPlayRange() {
@@ -347,7 +347,7 @@ static void wavIsPlayRange() {
*result = ret;
DEBUG_COMMAND("ShSound.wavIsPlayRange %d,%d,%p:", slot, range, result);
TRACE("ShSound.wavIsPlayRange %d,%d,%p:", slot, range, result);
}
static const ModuleFunc functions[] = {
+10 -10
View File
@@ -46,35 +46,35 @@ static void ExchangeString(void) {
int pat = getCaliValue();
int patr = getCaliValue();
svar_replaceAll(target, pat, patr);
DEBUG_COMMAND("ShString.ExchangeString: %d,%d,%d:", target, pat, patr);
TRACE("ShString.ExchangeString: %d,%d,%d:", target, pat, patr);
}
static void SetNum16String(void) { /* 1 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShString.SetNum16String: %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("ShString.SetNum16String: %d,%d:", p1, p2);
}
static void SetNum16HalfString(void) { /* 2 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShString.SetNum16HalfString: %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("ShString.SetNum16HalfString: %d,%d:", p1, p2);
}
static void SetNum32String(void) { /* 3 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShString.SetNum32String: %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("ShString.SetNum32String: %d,%d:", p1, p2);
}
static void SetNum32HalfString(void) { /* 4 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShString.SetNum32HalfString: %d,%d:", p1, p2);
TRACE_UNIMPLEMENTED("ShString.SetNum32HalfString: %d,%d:", p1, p2);
}
static void GetArrayString(void) { /* 5 */
@@ -82,7 +82,7 @@ static void GetArrayString(void) { /* 5 */
int p2 = getCaliValue();
int p3 = getCaliValue();
DEBUG_COMMAND_YET("ShString.GetArrayString: %d,%d,%d:", p1, p2, p3);
TRACE_UNIMPLEMENTED("ShString.GetArrayString: %d,%d,%d:", p1, p2, p3);
}
static void SetWindowTitle(void) { /* 6 */
@@ -93,7 +93,7 @@ static void SetWindowTitle(void) { /* 6 */
ags_setWindowTitle(title_utf8);
free(title_utf8);
DEBUG_COMMAND("ShString.SetWindowTitle: %d,%d:", strno, p2);
TRACE("ShString.SetWindowTitle: %d,%d:", strno, p2);
}
static void FillString() {
@@ -115,7 +115,7 @@ static void FillString() {
svar_set(st + i, svar_get(src));
}
DEBUG_COMMAND("ShString.FillString: %d,%d,%d,%d:", st, cnt, src, p4);
TRACE("ShString.FillString: %d,%d,%d,%d:", st, cnt, src, p4);
}
static void SetStringNum16(void) {
@@ -132,7 +132,7 @@ static void SetStringNum16(void) {
char _dst[100];
char *dst = _dst;
DEBUG_COMMAND("ShString.SetStringNum16: %d,%p:", st, var);
TRACE("ShString.SetStringNum16: %d,%p:", st, var);
while(*str) {
@@ -162,7 +162,7 @@ static void SetStringNum32(void) {
int p1 = getCaliValue();
int *p2 = getCaliVariable();
DEBUG_COMMAND_YET("ShString.SetStringNum32: %d,%p:", p1, p2);
TRACE_UNIMPLEMENTED("ShString.SetStringNum32: %d,%p:", p1, p2);
}
static const ModuleFunc functions[] = {
+4 -4
View File
@@ -29,24 +29,24 @@ static void Init() {
dd.alk = alk_new("/home/masaki-c/game/daiakuji/dDemo.alk");
#endif
DEBUG_COMMAND_YET("dDemo.Init %d,%d,%d,%p:", p1, p2, p3, var);
TRACE_UNIMPLEMENTED("dDemo.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("dDemo.SetKeyCancelFlag %d:", cancelflag);
TRACE_UNIMPLEMENTED("dDemo.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("dDemo.SetLoopFlag %d:", loopflag);
TRACE_UNIMPLEMENTED("dDemo.SetLoopFlag %d:", loopflag);
}
static void Run() {
DEBUG_COMMAND_YET("dDemo.Run:");
TRACE_UNIMPLEMENTED("dDemo.Run:");
#ifdef DDEMODEV
muscd_start(13, 1);
+5 -5
View File
@@ -17,31 +17,31 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("eDEMO.Init %d,%d,%d,%p:", p1, p2, p3, var);
TRACE_UNIMPLEMENTED("eDEMO.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("eDEMO.SetKeyCancelFlag %d:", cancelflag);
TRACE_UNIMPLEMENTED("eDEMO.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("eDEMO.SetLoopFlag %d:", loopflag);
TRACE_UNIMPLEMENTED("eDEMO.SetLoopFlag %d:", loopflag);
}
static void SetDrawStaffFlag() {
/* Loop Flag */
int staffflag = getCaliValue();
DEBUG_COMMAND_YET("eDEMO.SetDrawStaffFlag %d:", staffflag);
TRACE_UNIMPLEMENTED("eDEMO.SetDrawStaffFlag %d:", staffflag);
}
static void Run() {
DEBUG_COMMAND_YET("eDEMO.Run:");
TRACE_UNIMPLEMENTED("eDEMO.Run:");
}
static const ModuleFunc functions[] = {
+4 -4
View File
@@ -17,26 +17,26 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("eeDEMO.Init %d,%d,%d,%p:", p1, p2, p3, var);
TRACE_UNIMPLEMENTED("eeDEMO.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("eeDEMO.SetKeyCancelFlag %d:", cancelflag);
TRACE_UNIMPLEMENTED("eeDEMO.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("eeDEMO.SetLoopFlag %d:", loopflag);
TRACE_UNIMPLEMENTED("eeDEMO.SetLoopFlag %d:", loopflag);
}
static void Run() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("eeDEMO.Run %d:", p1);
TRACE_UNIMPLEMENTED("eeDEMO.Run %d:", p1);
}
static const ModuleFunc functions[] = {
+4 -4
View File
@@ -179,8 +179,8 @@ void gr_init() {
void gr_blend(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv) {
if (!gr_clip(src, &sx, &sy, &width, &height, dst, &dx, &dy)) return;
gre_Blend(dst, dx, dy, dst, dx, dy, src, sx, sy, width, height, lv);
}
void gr_blend_src_bright(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int alpha, int rate) {
@@ -284,7 +284,7 @@ void gr_copy_stretch_blend_alpha_map(surface_t *dst, int dx, int dy, int dw, int
for (x = 0; x < dw; x++) {
*(yld + x) = ALPHABLEND16(*(yls+ *(row + x)), *(yld+x), *(yla+*(row+x)));
}
while(*(col + y) == *(col + y + 1)) {
while (y < dh - 1 && *(col + y) == *(col + y + 1)) {
yld += dst->width;
for (x = 0; x < dw; x++) {
*(yld + x) = ALPHABLEND16(*(yls+ *(row+x)), *(yld+x), *(yla+*(row+x)));
@@ -307,7 +307,7 @@ void gr_copy_stretch_blend_alpha_map(surface_t *dst, int dx, int dy, int dw, int
for (x = 0; x < dw; x++) {
*(yld + x) = ALPHABLEND24(*(yls+ *(row + x)), *(yld+x), *(yla+*(row+x)));
}
while(*(col + y) == *(col + y + 1)) {
while (y < dh - 1 && *(col + y) == *(col + y + 1)) {
yld += dst->width;
for (x = 0; x < dw; x++) {
*(yld + x) = ALPHABLEND24(*(yls+ *(row+x)), *(yld+x), *(yla+*(row+x)));
+1
View File
@@ -6,6 +6,7 @@
extern void gr_init();
extern void gr_blend(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv);
extern void gr_copy_stretch_blend_alpha_map(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *src, int sx, int sy, int sw, int sh);
extern void gr_fill_alpha_overborder(surface_t *dst, int dx, int dy, int dw, int dh, int s, int d);
extern void gr_fill_alpha_underborder(surface_t *dst, int dx, int dy, int dw, int dh, int s, int d);
+2 -2
View File
@@ -50,7 +50,7 @@ void gr_copy_stretch(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *
*(yld + x) = *(yls + *(row + x));
}
_yld = (uint8_t *)yld;
while(*(col + y) == *(col + y + 1)) {
while (y < dh - 1 && *(col + y) == *(col + y + 1)) {
_yls = _yld;
_yld += dst->bytes_per_line;
memcpy(_yld, _yls, dw * 2);
@@ -72,7 +72,7 @@ void gr_copy_stretch(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *
*(yld + x) = *(yls+ *(row + x));
}
_yld = (uint8_t *)yld;
while(*(col + y) == *(col + y + 1)) {
while (y < dh - 1 && *(col + y) == *(col + y + 1)) {
_yls = _yld;
_yld += dst->bytes_per_line;
memcpy(_yld, _yls, dw * 4);
+1
View File
@@ -35,6 +35,7 @@ static const Module *modules[] = {
&module_NIGHTDLL,
&module_NightDemonDemo,
&module_RandMT,
&module_S3xMusic,
&module_SACT,
&module_ShArray,
&module_ShCalc,
+1
View File
@@ -42,6 +42,7 @@ extern const Module module_MsgSkip;
extern const Module module_NIGHTDLL;
extern const Module module_NightDemonDemo;
extern const Module module_RandMT;
extern const Module module_S3xMusic;
extern const Module module_SACT;
extern const Module module_ShArray;
extern const Module module_ShCalc;
+4 -4
View File
@@ -16,23 +16,23 @@ static void Init() {
*var = 0;
DEBUG_COMMAND_YET("nDEMO.Init %p:", var);
TRACE_UNIMPLEMENTED("nDEMO.Init %p:", var);
}
static void SetKeyCancelFlag() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("nDEMO.SetKeyCancelFlag %d:", p1);
TRACE_UNIMPLEMENTED("nDEMO.SetKeyCancelFlag %d:", p1);
}
static void SetLoopFlag() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("nDEMO.SetLoopFlag %d:", p1);
TRACE_UNIMPLEMENTED("nDEMO.SetLoopFlag %d:", p1);
}
static void Run() {
DEBUG_COMMAND_YET("nDEMO.Run:");
TRACE_UNIMPLEMENTED("nDEMO.Run:");
}
static const ModuleFunc functions[] = {
+3 -3
View File
@@ -14,17 +14,17 @@ static void Init() {
int p3 = getCaliValue();
int *var = getCaliVariable();
DEBUG_COMMAND_YET("nDEMOE.Init %p:", var);
TRACE_UNIMPLEMENTED("nDEMOE.Init %p:", var);
}
static void SetKeyCancelFlag() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("nDEMOE.SetKeyCancelFlag %d:", p1);
TRACE_UNIMPLEMENTED("nDEMOE.SetKeyCancelFlag %d:", p1);
}
static void Run() {
DEBUG_COMMAND_YET("nDEMOE.Run:");
TRACE_UNIMPLEMENTED("nDEMOE.Run:");
}
static const ModuleFunc functions[] = {
+4 -4
View File
@@ -17,24 +17,24 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("oDEMO.Init %d,%d,%d,%p:", p1, p2, p3, var);
TRACE_UNIMPLEMENTED("oDEMO.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("oDEMO.SetKeyCancelFlag %d:", cancelflag);
TRACE_UNIMPLEMENTED("oDEMO.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("oDEMO.SetLoopFlag %d:", loopflag);
TRACE_UNIMPLEMENTED("oDEMO.SetLoopFlag %d:", loopflag);
}
static void Run() {
DEBUG_COMMAND_YET("oDEMO.Run:");
TRACE_UNIMPLEMENTED("oDEMO.Run:");
}
static const ModuleFunc functions[] = {
+12 -12
View File
@@ -54,7 +54,7 @@ static void MakeMapSetParam() {
window_height = p3;
map_width = p4;
DEBUG_COMMAND("oujimisc.MakeMapSetParam %d,%d,%d,%d:", p1,p2,p3,p4);
TRACE("oujimisc.MakeMapSetParam %d,%d,%d,%d:", p1,p2,p3,p4);
}
static void MakeMapSetChipParam() {
@@ -74,7 +74,7 @@ static void MakeMapSetChipParam() {
r->w = p3;
r->h = p4;
DEBUG_COMMAND("oujimisc.MakeMapSeChipParam %d,%d,%d,%d,%d:", p1,p2,p3,p4,p5);
TRACE("oujimisc.MakeMapSeChipParam %d,%d,%d,%d,%d:", p1,p2,p3,p4,p5);
}
static void MakeMapDraw() {
@@ -106,13 +106,13 @@ static void MakeMapDraw() {
}
}
DEBUG_COMMAND("oujimisc.MakeMapDraw %d,%d,%d,%d,%d,%p,%p,%p:", p1,dstX,dstY,posX,posY,a1,a2,a3);
TRACE("oujimisc.MakeMapDraw %d,%d,%d,%d,%d,%p,%p,%p:", p1,dstX,dstY,posX,posY,a1,a2,a3);
}
static void MakeMapInit() {
int p1 = getCaliValue(); /* ISys3x */
DEBUG_COMMAND_YET("oujimisc.MakeMapInit %d:", p1);
TRACE_UNIMPLEMENTED("oujimisc.MakeMapInit %d:", p1);
}
static void DrawNumber() {
@@ -137,7 +137,7 @@ static void DrawNumber() {
dstX += width;
}
DEBUG_COMMAND("oujimisc.DrawNumber %d,%d,%d,%d,%d,%d,%d,%d:", p1,srcX,srcY,width,height,dstX,dstY,num);
TRACE("oujimisc.DrawNumber %d,%d,%d,%d,%d,%d,%d,%d:", p1,srcX,srcY,width,height,dstX,dstY,num);
}
static void TempMapCreateShadow() {
@@ -153,14 +153,14 @@ static void TempMapCreateShadow() {
ald_freedata(dfile);
}
DEBUG_COMMAND("oujimisc.TempMapCreateShadow:");
TRACE("oujimisc.TempMapCreateShadow:");
}
static void TempMapInit() {
int p1 = getCaliValue(); /* ISys3x */
int p2 = getCaliValue();
DEBUG_COMMAND_YET("oujimisc.TempMapInit %d,%d:", p1,p2);
TRACE_UNIMPLEMENTED("oujimisc.TempMapInit %d,%d:", p1,p2);
}
static void TempMapLoadToShadow() {
@@ -189,7 +189,7 @@ static void TempMapLoadToShadow() {
for (int i = 0; i < size; i++)
*a3++ = SDL_SwapLE16(*p++);
DEBUG_COMMAND("oujimisc.TempMapLoadToShadow %d,%p,%p,%p,%d:", map,a1,a2,a3,size);
TRACE("oujimisc.TempMapLoadToShadow %d,%p,%p,%p,%d:", map,a1,a2,a3,size);
}
static void TempMapSaveToShadow() {
@@ -218,7 +218,7 @@ static void TempMapSaveToShadow() {
for (int i = 0; i < size; i++)
*p++ = SDL_SwapLE16(*a3++);
DEBUG_COMMAND("oujimisc.TempMapSaveToShadow %d,%p,%p,%p,%d:", map,a1,a2,a3,size);
TRACE("oujimisc.TempMapSaveToShadow %d,%p,%p,%p,%d:", map,a1,a2,a3,size);
}
static void TempMapFileSave() {
@@ -250,7 +250,7 @@ static void TempMapFileSave() {
}
fclose(fp);
DEBUG_COMMAND("oujimisc.TempMapFileSave %d:", p1);
TRACE("oujimisc.TempMapFileSave %d:", p1);
}
static void TempMapFileLoad() {
@@ -292,7 +292,7 @@ static void TempMapFileLoad() {
}
fclose(fp);
DEBUG_COMMAND("oujimisc.TempMapFileLoad %d:", p1);
TRACE("oujimisc.TempMapFileLoad %d:", p1);
}
static void CalcMoveDiffer() {
@@ -322,7 +322,7 @@ static void CalcMoveDiffer() {
*pt = t >= duration ? 1 : 0;
DEBUG_COMMAND("oujimisc.CalcMoveDiffer %p,%p,%d,%d,%d,%d,%p,%d:", dx,dy,moveL,moveU,moveR,moveD,pt,duration);
TRACE("oujimisc.CalcMoveDiffer %p,%p,%d,%d,%d,%d,%p,%d:", dx,dy,moveL,moveU,moveR,moveD,pt,duration);
}
static const ModuleFunc functions[] = {
+74 -4
View File
@@ -1,3 +1,23 @@
/*
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
* 1998- <masaki-c@is.aist-nara.ac.jp>
* 2024 kichikuou <KichikuouChrome@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "config.h"
#include <stdio.h>
@@ -7,6 +27,16 @@
#include "xsystem35.h"
#include "modules.h"
#include "nact.h"
#include "alk.h"
#include "input.h"
#include "bgm.h"
#include "sdl_core.h"
#include "ngraph.h"
#include "cg.h"
#include "jpeg.h"
#define TDEMO_MUSIC_NO 1
#define FPS 30
static void Init() {
int p1 = getCaliValue();
@@ -16,24 +46,64 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("tDemo.Init %d,%d,%d,%p:", p1, p2, p3, var);
TRACE("tDemo.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("tDemo.SetKeyCancelFlag %d:", cancelflag);
TRACE_UNIMPLEMENTED("tDemo.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("tDemo.SetLoopFlag %d:", loopflag);
TRACE_UNIMPLEMENTED("tDemo.SetLoopFlag %d:", loopflag);
}
static void Run() {
DEBUG_COMMAND_YET("tDemo.Run:");
alk_t *alk = alk_new("tDEMO.alk");
if (!alk) {
WARNING("Cannot open tDEMO.alk");
return;
}
while (sys_getInputInfo()); // wait for key up
musbgm_play(TDEMO_MUSIC_NO, 0, 100, 0);
uint32_t start = sdl_getTicks();
while (!nact->is_quit) {
int i = (sdl_getTicks() - start) / (1000 / FPS);
if (i >= alk->datanum)
break;
cgdata *cg = jpeg_extract(alk->entries[i].data, alk->entries[i].size);
if (cg) {
gr_drawimage24(sf0, cg, 0, 0);
ags_updateFull();
cgdata_free(cg);
} else {
WARNING("Cannot decode CG %d", i);
}
int wait_ms = (i + 1) * (1000 / FPS) - (sdl_getTicks() - start);
if (wait_ms > 0) {
if (sys_keywait(wait_ms, KEYWAIT_CANCELABLE))
break;
} else {
sdl_updateScreen();
if (sys_getInputInfo())
break;
}
}
musbgm_stop(TDEMO_MUSIC_NO, 0);
alk_free(alk);
TRACE("tDemo.Run:");
}
static const ModuleFunc functions[] = {
+5 -1
View File
@@ -81,6 +81,7 @@ target_sources(xsystem35 PRIVATE
s39ain.c
savedata.c
scenario.c
scheduler.c
sdl_cursor.c
sdl_draw.c
sdl_effect.c
@@ -162,11 +163,14 @@ if (EMSCRIPTEN)
-sASYNCIFY_IGNORE_INDIRECT=1
-sASYNCIFY_REMOVE=SDL_Delay
-sASYNCIFY_IMPORTS=wait_vsync
# Functions that call an asynchronous function via a function pointer must
# be added to ASYNCIFY_ADD, even if it had a direct call to another
# asynchronous function, so that the indirect call itself is instrumented.
-sASYNCIFY_ADD=commands2F60,nact_main,send_agsevent,cb_waitkey_sprite
-sALLOW_MEMORY_GROWTH=1
-sNO_EXIT_RUNTIME=1
-sEXPORTED_FUNCTIONS=_main,_malloc
-sEXPORTED_RUNTIME_METHODS=FS,IDBFS,getValue,addRunDependency,removeRunDependency
-sEXPORTED_RUNTIME_METHODS=FS,IDBFS,getValue,addRunDependency,removeRunDependency,stringToUTF8OnStack
--emit-tsd=xsystem35.d.ts
)
+12
View File
@@ -45,6 +45,18 @@ static void ald_free(dridata *dfile) {
free(dfile);
}
bool ald_is_linked(DRIFILETYPE type, int no) {
if (type >= DRIFILETYPEMAX || !dri[type])
return false;
return dri_is_linked(dri[type], no);
}
bool ald_exists(DRIFILETYPE type, int no) {
if (type >= DRIFILETYPEMAX || !dri[type])
return false;
return dri_exists(dri[type], no);
}
/*
* load dri data
* type: data type
+2
View File
@@ -39,6 +39,8 @@ typedef enum {
} DRIFILETYPE;
void ald_init(int type, const char **file, int cnt, boolean use_mmap);
bool ald_is_linked(DRIFILETYPE type, int no);
bool ald_exists(DRIFILETYPE type, int no);
dridata *ald_getdata(DRIFILETYPE type, int no);
void ald_freedata(dridata *data);
int ald_get_maxno(DRIFILETYPE type);
+2 -2
View File
@@ -44,9 +44,9 @@ int musbgm_reset(void) {
return OK;
}
EM_JS(int, musbgm_play, (int no, int time, int vol), {
EM_JS(int, musbgm_play, (int no, int time, int vol, int loop_count), {
xsystem35.cdPlayer.fade(time * 10, vol / 100);
xsystem35.cdPlayer.play(no, 1);
xsystem35.cdPlayer.play(no, loop_count == 0);
return xsystem35.Status.OK;
});
+1 -1
View File
@@ -24,7 +24,7 @@
int musbgm_init(DRIFILETYPE type, int base_no);
int musbgm_exit(void);
int musbgm_reset(void);
int musbgm_play(int no, int time, int vol);
int musbgm_play(int no, int time, int vol, int loop_count);
int musbgm_stop(int no, int time);
int musbgm_fade(int no, int time, int vol);
int musbgm_getpos(int no);
+2 -2
View File
@@ -96,7 +96,7 @@ int musbgm_reset(void) {
return OK;
}
int musbgm_play(int no, int time, int vol) {
int musbgm_play(int no, int time, int vol, int loop_count) {
if (current_no)
musbgm_stop(current_no, 0);
@@ -107,7 +107,7 @@ int musbgm_play(int no, int time, int vol) {
// understands loop info in the WAVE's "smpl" chunk.
Mix_VolumeMusic(vol * MIX_MAX_VOLUME / 100);
if (Mix_FadeInMusic(mix_music, -1, time * 10) != 0) {
if (Mix_FadeInMusic(mix_music, loop_count == 0 ? -1 : loop_count, time * 10) != 0) {
free_music();
return NG;
}
+1 -1
View File
@@ -42,7 +42,7 @@ static int cdrom_bgm_reset(void) {
}
static int cdrom_bgm_start(int trk, int loop) {
if (musbgm_play(trk, 0, 100) != OK)
if (musbgm_play(trk, 0, 100, loop) != OK)
return NG;
current_track = trk;
return OK;
+2 -6
View File
@@ -23,9 +23,7 @@
#include <emscripten.h>
#include "portab.h"
#include "cdrom.h"
#include "nact.h"
static int frame_of_getpos = -1;
#include "scheduler.h"
int cdrom_init(char *playlist) {
return OK;
@@ -52,9 +50,7 @@ int cdrom_reset(void) {
}
int cdrom_getPlayingInfo(cd_time *info) {
if (nact->frame_count == frame_of_getpos)
nact->wait_vsync = TRUE;
frame_of_getpos = nact->frame_count;
scheduler_on_event(SCHEDULER_EVENT_AUDIO_CHECK);
int t = EM_ASM_INT_V( return xsystem35.cdPlayer.getPosition(); );
if (!t)
+165 -164
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -174,7 +174,7 @@ static void message(int c0) {
}
void exec_command(void) {
DEBUG_MESSAGE("%d:%x\n", sl_getPage(), sl_getIndex());
TRACE_MESSAGE("%d:%x\n", sl_getPage(), sl_getIndex());
int page, index;
int c0 = sl_getc();
@@ -535,7 +535,7 @@ void exec_command(void) {
/* hit Any Key */
sys_hit_any_key();
msg_nextPage(TRUE);
DEBUG_COMMAND("A");
TRACE("A");
break;
case 'B':
switch(sl_getc()) {
@@ -949,7 +949,7 @@ void exec_command(void) {
break;
case 'R':
/* 改行 */
DEBUG_MESSAGE("\n");
TRACE_MESSAGE("\n");
msg_nextLine();
break;
case 'S':
@@ -1085,7 +1085,7 @@ void exec_command(void) {
{
int num=getCaliValue();
sys_addMsg(svar_get(num));
DEBUG_COMMAND("X %d:", num);
TRACE("X %d:", num);
}
break;
case 'Y':
+18 -18
View File
@@ -43,7 +43,7 @@ void commandB0() {
break;
}
DEBUG_COMMAND("B0 %d:", num);
TRACE("B0 %d:", num);
}
void commandB1() {
@@ -64,7 +64,7 @@ void commandB1() {
nact->sel.wininfo[num].height = Y2;
nact->sel.wininfo[num].save = (V == 0) ? false : true;
DEBUG_COMMAND("B1 %d,%d,%d,%d,%d,%d:", num, X1, Y1, X2, Y2, V);
TRACE("B1 %d,%d,%d,%d,%d,%d:", num, X1, Y1, X2, Y2, V);
}
void commandB2() {
@@ -89,7 +89,7 @@ void commandB2() {
nact->sel.FrameCgNoBot = C3;
nact->sel.Framedot = W == 0 ? 0 : W == 1 ? 8 : dot ;
DEBUG_COMMAND("B2 %d,%d,%d,%d,%d,%d:", num, W, C1, C2, C3, dot);
TRACE("B2 %d,%d,%d,%d,%d,%d:", num, W, C1, C2, C3, dot);
}
void commandB3() {
@@ -110,7 +110,7 @@ void commandB3() {
nact->msg.wininfo[num].height = Y2;
nact->msg.wininfo[num].save = (V == 0) ? FALSE : TRUE;
DEBUG_COMMAND("B3 %d,%d,%d,%d,%d,%d:", num, X1, Y1, X2, Y2, V);
TRACE("B3 %d,%d,%d,%d,%d,%d:", num, X1, Y1, X2, Y2, V);
}
void commandB4() {
@@ -130,7 +130,7 @@ void commandB4() {
nact->msg.win = &nact->msg.wininfo[num];
msg_openWindow(W, C1, C2, N, M);
DEBUG_COMMAND("B4 %d,%d,%d,%d,%d,%d:", num, W, C1, C2, N, M);
TRACE("B4 %d,%d,%d,%d,%d,%d:", num, W, C1, C2, N, M);
}
void commandB10() {
@@ -141,7 +141,7 @@ void commandB10() {
msg_getMessageLocation(&p);
*x_var = p.x;
*y_var = p.y;
DEBUG_COMMAND("B10 %d,%d:", *x_var, *y_var);
TRACE("B10 %d,%d:", *x_var, *y_var);
}
void commandB11() {
@@ -151,28 +151,28 @@ void commandB11() {
*sel_no_var = nact->sel.winno;
*msg_no_var = nact->msg.winno;
DEBUG_COMMAND("B11 %d,%d:", *sel_no_var, *msg_no_var);
TRACE("B11 %d,%d:", *sel_no_var, *msg_no_var);
}
void commandB12() {
int *var = getCaliVariable();
*var = sel_getRegistoredElementNumber();
DEBUG_COMMAND("B12 %d:", *var);
TRACE("B12 %d:", *var);
}
void commandB13() {
int *var = getCaliVariable();
*var = sel_getRegistoredElementWidth();
DEBUG_COMMAND("B13 %d:", *var);
TRACE("B13 %d:", *var);
}
void commandB14() {
int *var = getCaliVariable();
*var = sel_getRegistoredElement_strlen();
DEBUG_COMMAND("B14 %d:", *var);
TRACE("B14 %d:", *var);
}
void commandB21() {
@@ -183,7 +183,7 @@ void commandB21() {
*x_var = nact->sel.win->x;
*y_var = nact->sel.win->y;
DEBUG_COMMAND("B21 %d,%d,%d:", no, *x_var, *y_var);
TRACE("B21 %d,%d,%d:", no, *x_var, *y_var);
}
void commandB22() {
@@ -194,7 +194,7 @@ void commandB22() {
*x_var = nact->sel.win->width;
*y_var = nact->sel.win->height;
DEBUG_COMMAND("B22 %d,%d,%d:", no, *x_var, *y_var);
TRACE("B22 %d,%d,%d:", no, *x_var, *y_var);
}
void commandB23() {
@@ -205,7 +205,7 @@ void commandB23() {
*x_var = nact->msg.win->x;
*y_var = nact->msg.win->y;
DEBUG_COMMAND("B23 %d,%d,%d:", no, *x_var, *y_var);
TRACE("B23 %d,%d,%d:", no, *x_var, *y_var);
}
void commandB24() {
@@ -216,7 +216,7 @@ void commandB24() {
*x_var_size = nact->msg.win->width;
*y_var_size = nact->msg.win->height;
DEBUG_COMMAND("B24 %d,%d,%d:", no, *x_var_size, *y_var_size);
TRACE("B24 %d,%d,%d:", no, *x_var_size, *y_var_size);
}
void commandB31() {
@@ -228,7 +228,7 @@ void commandB31() {
*x_var = nact->sel.wininfo[no].x;
*y_var = nact->sel.wininfo[no].y;
DEBUG_COMMAND("B31 %d,%d,%d:", no, *x_var, *y_var);
TRACE("B31 %d,%d,%d:", no, *x_var, *y_var);
}
void commandB32() {
@@ -239,7 +239,7 @@ void commandB32() {
*x_var_size = nact->sel.wininfo[no].width;
*y_var_size = nact->sel.wininfo[no].height;
DEBUG_COMMAND("B32 %d,%d,%d:", no, *x_var_size, *y_var_size);
TRACE("B32 %d,%d,%d:", no, *x_var_size, *y_var_size);
}
void commandB33() {
@@ -249,7 +249,7 @@ void commandB33() {
*x_var = nact->msg.wininfo[no].x;
*y_var = nact->msg.wininfo[no].y;
DEBUG_COMMAND("B33 %d,%d,%d:", no, *x_var, *y_var);
TRACE("B33 %d,%d,%d:", no, *x_var, *y_var);
}
void commandB34() {
@@ -259,6 +259,6 @@ void commandB34() {
*x_var_size = nact->msg.wininfo[no].width;
*y_var_size = nact->msg.wininfo[no].height;
DEBUG_COMMAND("B34 %d,%d,%d:", no, *x_var_size, *y_var_size);
TRACE("B34 %d,%d,%d:", no, *x_var_size, *y_var_size);
}
+20 -20
View File
@@ -40,7 +40,7 @@ void commandCC() {
ags_copyArea(src_x, src_y, width, height, dst_x, dst_y);
ags_updateArea(dst_x, dst_y, width, height);
DEBUG_COMMAND("CC %d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y);
TRACE("CC %d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y);
}
void commandCS() {
@@ -55,7 +55,7 @@ void commandCS() {
ags_copyAreaSP(src_x, src_y, width, height, dst_x, dst_y, sprite);
ags_updateArea(dst_x, dst_y, width, height);
DEBUG_COMMAND("CS %d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, sprite);
TRACE("CS %d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, sprite);
}
void commandCX() {
@@ -101,12 +101,12 @@ void commandCX() {
ags_copyToAlpha(src_x, src_y, width, height, dst_x, dst_y, col == 1 ? FROM_24R : col == 2 ? FROM_24G : FROM_24B);
break;
case 6:
DEBUG_COMMAND_YET("CX %d,%d,%d,%d,%d,%d,%d,%d:", mode, src_x, src_y, width, height, dst_x, dst_y, col);
TRACE_UNIMPLEMENTED("CX %d,%d,%d,%d,%d,%d,%d,%d:", mode, src_x, src_y, width, height, dst_x, dst_y, col);
break;
}
daiakuji_cx_hack = false;
DEBUG_COMMAND("CX %d,%d,%d,%d,%d,%d,%d,%d:", mode, src_x, src_y, width, height, dst_x, dst_y, col);
TRACE("CX %d,%d,%d,%d,%d,%d,%d,%d:", mode, src_x, src_y, width, height, dst_x, dst_y, col);
}
void commandCM() {
@@ -123,7 +123,7 @@ void commandCM() {
ags_scaledCopyArea(src_x, src_y, src_width, src_height, dst_x, dst_y, dst_width, dst_height, mirror_sw);
ags_updateArea(dst_x, dst_y, dst_width, dst_height);
DEBUG_COMMAND("CM %d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, src_width, src_height, dst_x, dst_y, dst_width, dst_height, mirror_sw);
TRACE("CM %d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, src_width, src_height, dst_x, dst_y, dst_width, dst_height, mirror_sw);
}
void commandCE() {
@@ -148,10 +148,10 @@ void commandCE() {
case 54:
case 1000:
case 1001:
DEBUG_COMMAND_YET("CE %d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag);
TRACE_UNIMPLEMENTED("CE %d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag);
break;
default:
DEBUG_COMMAND("CE %d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag);
TRACE("CE %d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag);
}
}
@@ -189,10 +189,10 @@ void commandCD() {
case 1000:
case 2000:
case 2001:
DEBUG_COMMAND_YET("CD %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag, color);
TRACE_UNIMPLEMENTED("CD %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag, color);
break;
default:
DEBUG_COMMAND("CD %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag, color);
TRACE("CD %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag, color);
}
}
@@ -211,14 +211,14 @@ void commandCK() {
case 1:
ags_wrapColor(x, y, width, height, d1, d2); break;
case 2:
DEBUG_COMMAND_YET("CK %d,%d,%d,%d,%d,%d,%d,%d,%d:", no, x, y, width, height, d1, d2, d3, d4); break;
TRACE_UNIMPLEMENTED("CK %d,%d,%d,%d,%d,%d,%d,%d,%d:", no, x, y, width, height, d1, d2, d3, d4); break;
case 3: /* from T2 */
ags_changeColorArea(x, y, width, height, d1, d2, d3); break;
default:
WARNING("Unknown CK Command %d", no);
}
ags_updateArea(x, y, width, height);
DEBUG_COMMAND("CK %d,%d,%d,%d,%d,%d,%d,%d,%d:", no, x, y, width, height, d1, d2, d3, d4);
TRACE("CK %d,%d,%d,%d,%d,%d,%d,%d,%d:", no, x, y, width, height, d1, d2, d3, d4);
}
void commandCL() {
@@ -231,7 +231,7 @@ void commandCL() {
ags_drawLine(x0, y0, x1, y1, color);
ags_updateArea(min(x0, x1), min(y0, y1), abs(x1 - x0) + 1, abs(y1 - y0) + 1);
DEBUG_COMMAND("CL %d,%d,%d,%d,%d:", x0, y0, x1, y1, color);
TRACE("CL %d,%d,%d,%d,%d:", x0, y0, x1, y1, color);
}
void commandCB() {
@@ -244,7 +244,7 @@ void commandCB() {
ags_drawRectangle(x, y, width, height, color);
ags_updateArea (x, y, width, height);
DEBUG_COMMAND("CB %d,%d,%d,%d,%d:", x, y, width, height, color);
TRACE("CB %d,%d,%d,%d,%d:", x, y, width, height, color);
}
void commandCF() {
@@ -257,7 +257,7 @@ void commandCF() {
ags_fillRectangle(x, y, width, height, color);
ags_updateArea (x, y, width, height);
DEBUG_COMMAND("CF %d,%d,%d,%d,%d:", x, y, width, height, color);
TRACE("CF %d,%d,%d,%d,%d:", x, y, width, height, color);
}
void commandCP() {
@@ -269,7 +269,7 @@ void commandCP() {
if (!SDL_RectEmpty(&rec))
ags_updateArea(rec.x, rec.y, rec.w, rec.h);
DEBUG_COMMAND("CP %d,%d,%d:", x, y, color);
TRACE("CP %d,%d,%d:", x, y, color);
}
void commandCT() {
@@ -279,7 +279,7 @@ void commandCT() {
int y = getCaliValue();
ags_alpha_getPixel(x, y, var);
DEBUG_COMMAND("CT %d,%d,%d:", *var, x, y);
TRACE("CT %d,%d,%d:", *var, x, y);
}
void commandCU() {
@@ -292,7 +292,7 @@ void commandCU() {
int set = getCaliValue();
ags_alpha_lowercut(x, y, width, height, border, set);
DEBUG_COMMAND("CU %d,%d,%d,%d,%d,%d:", x, y, width, height, border, set);
TRACE("CU %d,%d,%d,%d,%d,%d:", x, y, width, height, border, set);
}
void commandCV() {
@@ -305,7 +305,7 @@ void commandCV() {
int set = getCaliValue();
ags_alpha_uppercut(x, y, width, height, border, set);
DEBUG_COMMAND("CV %d,%d,%d,%d,%d,%d:", x, y, width, height, border, set);
TRACE("CV %d,%d,%d,%d,%d,%d:", x, y, width, height, border, set);
}
void commandCY() {
@@ -317,7 +317,7 @@ void commandCY() {
int lv = getCaliValue();
ags_alpha_setLevel(x, y, w, h, lv);
DEBUG_COMMAND("CY %d,%d,%d,%d,%d:", x, y, w, h, lv);
TRACE("CY %d,%d,%d,%d,%d:", x, y, w, h, lv);
}
void commandCZ() {
@@ -331,5 +331,5 @@ void commandCZ() {
int op = getCaliValue();
ags_alpha_copyArea(sx, sy, w, h, dx, dy);
DEBUG_COMMAND("CZ %d,%d,%d,%d,%d,%d,%d:", sx, sy, w, h, dx, dy, op);
TRACE("CZ %d,%d,%d,%d,%d,%d,%d:", sx, sy, w, h, dx, dy, op);
}
+5 -5
View File
@@ -34,7 +34,7 @@ void commandDC() {
if (!v_allocatePage(page, maxindex + 1, !!save))
WARNING("Array allocation failed: page=%d size=%d", page, maxindex);
DEBUG_COMMAND("DC %d,%d,%d:", page, maxindex, save);
TRACE("DC %d,%d,%d:", page, maxindex, save);
}
void commandDI() {
@@ -44,7 +44,7 @@ void commandDI() {
v_getPageStatus(page, var_use, var_size);
DEBUG_COMMAND("DI %d,%p,%p:", page, var_use, var_size);
TRACE("DI %d,%p,%p:", page, var_use, var_size);
}
void commandDS() {
@@ -54,7 +54,7 @@ void commandDS() {
int offset = getCaliValue();
int page = getCaliValue();
DEBUG_COMMAND("DS %p,%d,%d,%d:",point_var, data_var.var, offset, page);
TRACE("DS %p,%d,%d,%d:",point_var, data_var.var, offset, page);
if (!v_bindArray(data_var.var, point_var, offset, page)) {
WARNING("commandDS(): Array allocate failed");
WARNING("if you are playing 'Pastel Chime', please patch to scenario(see patch/README.TXT for detail)");
@@ -67,7 +67,7 @@ void commandDR() {
getCaliArray(&data_var);
v_unbindArray(data_var.var);
DEBUG_COMMAND("DR %d:", data_var.var);
TRACE("DR %d:", data_var.var);
}
void commandDF() {
@@ -76,7 +76,7 @@ void commandDF() {
int cnt = getCaliValue();
int data = getCaliValue();
DEBUG_COMMAND("DF %p,%d,%d:", data_var, cnt, data);
TRACE("DF %p,%d,%d:", data_var, cnt, data);
if (data_var.page) {
int maxlen = v_sliceSize(&data_var);
+5 -5
View File
@@ -49,7 +49,7 @@ void commandES() {
tbl[num - 1].r.h = height;
tbl[num - 1].pal = pal;
DEBUG_COMMAND("ES %d,%d,%d,%d,%d,%d:", num, pal, x, y, width, height);
TRACE("ES %d,%d,%d,%d,%d,%d:", num, pal, x, y, width, height);
}
void commandEC() {
@@ -67,7 +67,7 @@ void commandEC() {
ags_fillRectangle(e->r.x, e->r.y, e->r.w + adj, e->r.h + adj, e->pal);
ags_updateArea(e->r.x, e->r.y, e->r.w + adj, e->r.h + adj);
}
DEBUG_COMMAND("EC %d:", num);
TRACE("EC %d:", num);
}
void commandEG() {
@@ -82,7 +82,7 @@ void commandEG() {
*width = tbl[num -1].r.w;
*height = tbl[num -1].r.h;
DEBUG_COMMAND("EG %d,%d,%d,%d,%d:", num, *x, *y, *width, *height);
TRACE("EG %d,%d,%d,%d,%d:", num, *x, *y, *width, *height);
}
void commandEM() {
@@ -98,7 +98,7 @@ void commandEM() {
r.h -= 1;
}
*var = SDL_PointInRect(&p, &r) ? 1 : 0;
DEBUG_COMMAND("EM %d,%d,%d,%d:", num, *var, x, y);
TRACE("EM %d,%d,%d,%d:", num, *var, x, y);
}
void commandEN() {
@@ -121,5 +121,5 @@ void commandEN() {
*var = i;
}
DEBUG_COMMAND("EN %d,%d,%d,%d,%d:", *var, min, max, x, y);
TRACE("EN %d,%d,%d,%d,%d:", *var, min, max, x, y);
}
+11 -11
View File
@@ -80,7 +80,7 @@ static void commandF1() {
int i;
char *p;
DEBUG_COMMAND("F1 %d,%d:", str_number, skip);
TRACE("F1 %d,%d:", str_number, skip);
p = (char *)nact->datatbl_addr;
for (i = 0; i < skip; i++) {
@@ -104,7 +104,7 @@ static void commandF2() {
p++;
nact->datatbl_addr = (void *)p;
DEBUG_COMMAND("F2 %d,%d:", *read_var, skip);
TRACE("F2 %d,%d:", *read_var, skip);
}
static void commandF3() {
@@ -113,7 +113,7 @@ static void commandF3() {
*read_var = LittleEndian_getW(nact->datatbl_addr, skip *2);
DEBUG_COMMAND("F3 %d,%d:", *read_var, skip);
TRACE("F3 %d,%d:", *read_var, skip);
}
static void commandF4() {
@@ -130,7 +130,7 @@ static void commandF4() {
nact->datatbl_addr = p;
DEBUG_COMMAND("F4 %d,%d:", *read_var, count);
TRACE("F4 %d,%d:", *read_var, count);
}
static void commandF5() {
@@ -143,7 +143,7 @@ static void commandF5() {
read_var++;
}
DEBUG_COMMAND("F5 %d,%d:", *read_var, count);
TRACE("F5 %d,%d:", *read_var, count);
}
static void commandF6() {
@@ -152,7 +152,7 @@ static void commandF6() {
F6Index[index] = var;
DEBUG_COMMAND("F6 %d,%d:", *var, index);
TRACE("F6 %d,%d:", *var, index);
}
static void commandF7() {
@@ -170,29 +170,29 @@ static void commandF7() {
nact->datatbl_addr = p;
DEBUG_COMMAND("F7 %d,%d", data_width, count);
TRACE("F7 %d,%d", data_width, count);
}
static void commandF8() {
int snum = getCaliValue();
int scnt = getCaliValue();
DEBUG_COMMAND_YET("F8 %d,%d:", snum, scnt);
TRACE_UNIMPLEMENTED("F8 %d,%d:", snum, scnt);
}
static void commandF9() {
int snum = getCaliValue();
int scnt = getCaliValue();
DEBUG_COMMAND_YET("F9 %d,%d:", snum, scnt);
TRACE_UNIMPLEMENTED("F9 %d,%d:", snum, scnt);
}
static void commandF10() {
int snum = getCaliValue();
int scnt = getCaliValue();
DEBUG_COMMAND_YET("F10 %d,%d:", snum, scnt);
TRACE_UNIMPLEMENTED("F10 %d,%d:", snum, scnt);
}
static void commandF11() {
int snum = getCaliValue();
int ends = getCaliValue();
DEBUG_COMMAND_YET("F11 %d,%d:", snum, ends);
TRACE_UNIMPLEMENTED("F11 %d,%d:", snum, ends);
}
+4 -4
View File
@@ -37,7 +37,7 @@ void commandG0() {
cg_load(num - 1, -1);
DEBUG_COMMAND("G %d:",num);
TRACE("G %d:",num);
}
void commandG1() {
@@ -52,7 +52,7 @@ void commandG1() {
cg_load(num - 1, sprite);
DEBUG_COMMAND("G %d,%d:",num,sprite);
TRACE("G %d,%d:",num,sprite);
}
void commandGS() {
@@ -72,7 +72,7 @@ void commandGS() {
var[2] = r.w;
var[3] = r.h;
DEBUG_COMMAND("GS %d,%p:",num,var);
TRACE("GS %d,%p:",num,var);
}
void commandGX() {
@@ -86,5 +86,5 @@ void commandGX() {
cg_load_with_alpha(cg_num -1, shadow_num -1);
DEBUG_COMMAND("GX %d,%d:",cg_num, shadow_num);
TRACE("GX %d,%d:",cg_num, shadow_num);
}
+2 -2
View File
@@ -39,7 +39,7 @@ void commandH() {
sys_addMsg(s);
free(s);
DEBUG_COMMAND("H %d,%d:",fig,num);
TRACE("H %d,%d:",fig,num);
}
void commandHH(void) {
@@ -49,5 +49,5 @@ void commandHH(void) {
sys_addMsg(format_number(num, fig, buf));
DEBUG_COMMAND("HH %d,%d:",fig,num);
TRACE("HH %d,%d:",fig,num);
}
+8 -8
View File
@@ -43,7 +43,7 @@ void commandIK() {
int num = sl_getc();
int key;
DEBUG_COMMAND("IK %d:",num);
TRACE("IK %d:",num);
/* to be fix
* IK0/1 is affected by ZI
@@ -107,7 +107,7 @@ void commandIM() {
sysVar[0] = sys_getMouseInfo(&p, FALSE);
*x_var = p.x;
*y_var = p.y;
DEBUG_COMMAND("IM %d,%d:", *x_var, *y_var);
TRACE("IM %d,%d:", *x_var, *y_var);
}
void commandIC() {
@@ -119,7 +119,7 @@ void commandIC() {
pre = cursor_num;
ags_setCursorType(cursor_num);
DEBUG_COMMAND("IC %d,%p:", cursor_num, oldcursor);
TRACE("IC %d,%p:", cursor_num, oldcursor);
}
void commandIZ() {
@@ -128,7 +128,7 @@ void commandIZ() {
int y = getCaliValue();
ags_setCursorLocation(x, y, true, false);
DEBUG_COMMAND("IZ %d,%d:", x, y);
TRACE("IZ %d,%d:", x, y);
}
void commandIX() {
@@ -136,7 +136,7 @@ void commandIX() {
int *var = getCaliVariable();
*var = msgskip_isSkipping() == TRUE ? 1 : 0;
DEBUG_COMMAND("IX %p:",var);
TRACE("IX %p:",var);
}
void commandIY() {
@@ -152,7 +152,7 @@ void commandIY() {
msgskip_setFlags(0, MSGSKIP_STOP_ON_MENU);
}
DEBUG_COMMAND("IY %d:",p1);
TRACE("IY %d:",p1);
}
void commandIG() { /* T2 */
@@ -167,7 +167,7 @@ void commandIG() { /* T2 */
var++;
}
DEBUG_COMMAND("IG %p,%d,%d,%d", var, code, cnt, rsv);
TRACE("IG %p,%d,%d,%d", var, code, cnt, rsv);
}
void commandIE() {
@@ -175,5 +175,5 @@ void commandIE() {
int p2 = getCaliValue();
ags_loadCursor(p1, p2);
DEBUG_COMMAND("IE %d,%d", p1, p2);
TRACE("IE %d,%d", p1, p2);
}
+5 -5
View File
@@ -32,7 +32,7 @@ void commandJ0() {
int y = getCaliValue();
cg_set_display_location(x, y, OFFSET_ABSOLUTE_GC);
DEBUG_COMMAND("J0 %d,%d:", x, y);
TRACE("J0 %d,%d:", x, y);
}
void commandJ1() {
@@ -40,7 +40,7 @@ void commandJ1() {
int y = getCaliValue();
cg_set_display_location(x, y, OFFSET_RELATIVE_GC);
DEBUG_COMMAND("J1 %d,%d:", x, y);
TRACE("J1 %d,%d:", x, y);
}
void commandJ2() {
@@ -48,7 +48,7 @@ void commandJ2() {
int y = getCaliValue();
cg_set_display_location(x, y, OFFSET_ABSOLUTE_JC);
DEBUG_COMMAND("J2:%d,%d", x, y);
TRACE("J2:%d,%d", x, y);
}
void commandJ3() {
@@ -56,10 +56,10 @@ void commandJ3() {
int y = getCaliValue();
cg_set_display_location(x, y, OFFSET_RELATIVE_JC);
DEBUG_COMMAND("J3:%d,%d", x, y);
TRACE("J3:%d,%d", x, y);
}
void commandJ4() {
cg_set_display_location(0, 0, OFFSET_NOMOVE);
DEBUG_COMMAND("J4 :");
TRACE("J4 :");
}
+7 -7
View File
@@ -34,7 +34,7 @@ void commandKI() {
*var = network_create_channel(port_num, user_max);
DEBUG_COMMAND_YET("KI %d,%d,%d:", *var, port_num, user_max);
TRACE_UNIMPLEMENTED("KI %d,%d,%d:", *var, port_num, user_max);
return;
}
@@ -44,7 +44,7 @@ void commandKK() {
network_close(use_num);
DEBUG_COMMAND_YET("KK %d:", use_num);
TRACE_UNIMPLEMENTED("KK %d:", use_num);
return;
}
@@ -54,7 +54,7 @@ void commandKN() {
*var = network_get_channel();
DEBUG_COMMAND_YET("KN %d:", *var);
TRACE_UNIMPLEMENTED("KN %d:", *var);
return;
}
@@ -64,7 +64,7 @@ void commandKP() {
*var = network_check_buffer();
DEBUG_COMMAND_YET("KP %d:", *var);
TRACE_UNIMPLEMENTED("KP %d:", *var);
return;
}
@@ -75,7 +75,7 @@ void commandKQ() {
*var = network_get_user_state(user_num);
DEBUG_COMMAND_YET("KQ %d,%d:", *var, user_num);
TRACE_UNIMPLEMENTED("KQ %d,%d:", *var, user_num);
return;
}
@@ -85,7 +85,7 @@ void commandKR() {
network_read_buffer(var);
DEBUG_COMMAND_YET("KR %d:", *var);
TRACE_UNIMPLEMENTED("KR %d:", *var);
return;
}
@@ -96,6 +96,6 @@ void commandKW() {
network_write_buffer(var, num);
DEBUG_COMMAND_YET("KR %d,%d:", *var, num);
TRACE_UNIMPLEMENTED("KR %d,%d:", *var, num);
return;
}
+22 -22
View File
@@ -46,7 +46,7 @@ void commandLD() {
} else {
sysVar[0] = save_loadAll(num - 1);
}
DEBUG_COMMAND("LD %d:",num);
TRACE("LD %d:",num);
}
void commandLP() {
@@ -61,7 +61,7 @@ void commandLP() {
} else {
sysVar[0] = save_loadPartial(num - 1, &point, cnt);
}
DEBUG_COMMAND("LP %d,%d,%d:",num, point.var, cnt);
TRACE("LP %d,%d,%d:",num, point.var, cnt);
}
void commandLT() {
@@ -103,7 +103,7 @@ void commandLT() {
var[5] = lc->tm_sec;
sysVar[0] = 0;
}
DEBUG_COMMAND("LT %d,%p",num, var);
TRACE("LT %d,%p",num, var);
}
void commandLE() {
@@ -133,7 +133,7 @@ void commandLE() {
}
free(fname_utf8);
DEBUG_COMMAND("LE %d,%s,%d,%d:",type, filename, var, cnt);
TRACE("LE %d,%s,%d,%d:",type, filename, var, cnt);
}
void commandLL() {
@@ -158,7 +158,7 @@ void commandLL() {
var = getCaliVariable();
num = getCaliValue();
DEBUG_COMMAND("LL %d,%d,%d,%d:",type, link_no, _var, num);
TRACE("LL %d,%d,%d,%d:",type, link_no, _var, num);
if (dfile->size < num * sizeof(uint16_t)) {
WARNING("data shortage (link_no = %d, requested %d, loaded %d)", link_no, num, dfile->size/ sizeof(uint16_t));
@@ -174,7 +174,7 @@ void commandLL() {
case 1:
_var = getCaliValue();
num = getCaliValue();
DEBUG_COMMAND_YET("LL1 not yet %d, %d", _var, num);
TRACE_UNIMPLEMENTED("LL1 not yet %d, %d", _var, num);
sysVar[0] = 255;
goto out;
break;
@@ -197,7 +197,7 @@ void commandLHD() {
// X版では全てをHDDに置くのでサポートしない
sysVar[0] = 255;
DEBUG_COMMAND("LHD %d,%d:",p1,no);
TRACE("LHD %d,%d:",p1,no);
}
void commandLHG() {
@@ -221,7 +221,7 @@ void commandLHG() {
sysVar[0] = (no == last_registered) ? 1 : 0;
break;
}
DEBUG_COMMAND("LHG %d,%d:",p1,no);
TRACE("LHG %d,%d:",p1,no);
}
void commandLHM() {
@@ -231,7 +231,7 @@ void commandLHM() {
// X版では全てをHDDに置くのでサポートしない
sysVar[0] = 255;
DEBUG_COMMAND("LHM %d,%d:",p1,no);
TRACE("LHM %d,%d:",p1,no);
}
void commandLHS() {
@@ -241,7 +241,7 @@ void commandLHS() {
// X版では全てをHDDに置くのでサポートしない
sysVar[0] = 255;
DEBUG_COMMAND("LHS %d,%d:",p1,no);
TRACE("LHS %d,%d:",p1,no);
}
void commandLHW() {
@@ -251,7 +251,7 @@ void commandLHW() {
// X版では全てをHDDに置くのでサポートしない
sysVar[0] = 255;
DEBUG_COMMAND("LHW %d,%d:",p1,no);
TRACE("LHW %d,%d:",p1,no);
}
void commandLC() {
@@ -263,7 +263,7 @@ void commandLC() {
sysVar[0] = cg_load_with_filename(fname_utf8, x, y);
free(fname_utf8);
DEBUG_COMMAND("LC %d,%d,%s:", x, y, filename);
TRACE("LC %d,%d,%s:", x, y, filename);
}
void commandLXG() {
@@ -272,7 +272,7 @@ void commandLXG() {
const char *title = sl_getString(':');
const char *filter = sl_getString(':');
DEBUG_COMMAND_YET("LXG %d,%s,%s:", file_name, title, filter);
TRACE_UNIMPLEMENTED("LXG %d,%s,%s:", file_name, title, filter);
}
void commandLXO() {
@@ -282,14 +282,14 @@ void commandLXO() {
int how_to_create = getCaliValue();
sysVar[0]=255;
DEBUG_COMMAND_YET("LXO %d,%d,%d:",num,file_name,how_to_create);
TRACE_UNIMPLEMENTED("LXO %d,%d,%d:",num,file_name,how_to_create);
}
void commandLXC() {
/* ファイルをクローズする */
int num = getCaliValue();
DEBUG_COMMAND_YET("LXC %d:",num);
TRACE_UNIMPLEMENTED("LXC %d:",num);
}
void commandLXL() {
@@ -298,7 +298,7 @@ void commandLXL() {
int y = getCaliValue();
int file_name = getCaliValue();
DEBUG_COMMAND_YET("LXL %d,%d,%d:",x,y,file_name);
TRACE_UNIMPLEMENTED("LXL %d,%d,%d:",x,y,file_name);
}
void commandLXS() {
@@ -307,7 +307,7 @@ void commandLXS() {
int *hi = getCaliVariable();
int *lo = getCaliVariable();
DEBUG_COMMAND_YET("LXS %d,%d,%d:", num, *hi, *lo);
TRACE_UNIMPLEMENTED("LXS %d,%d,%d:", num, *hi, *lo);
}
void commandLXP() {
@@ -316,7 +316,7 @@ void commandLXP() {
int hi = getCaliValue();
int lo = getCaliValue();
DEBUG_COMMAND_YET("LXP %d,%d,%d:",num,hi,lo);
TRACE_UNIMPLEMENTED("LXP %d,%d,%d:",num,hi,lo);
}
void commandLXR() {
@@ -325,7 +325,7 @@ void commandLXR() {
int *var = getCaliVariable();
int size = getCaliValue();
DEBUG_COMMAND_YET("LXR %d,%d,%d:",num,*var,size);
TRACE_UNIMPLEMENTED("LXR %d,%d,%d:",num,*var,size);
}
void commandLXW() {
@@ -334,7 +334,7 @@ void commandLXW() {
int *var = getCaliVariable();
int size = getCaliValue();
DEBUG_COMMAND_YET("LXW %d,%d,%d:",num,*var,size);
TRACE_UNIMPLEMENTED("LXW %d,%d,%d:",num,*var,size);
}
void commandLXX() {
@@ -370,9 +370,9 @@ void commandLXX() {
case 4: // data
case 6: // resource
default:
DEBUG_COMMAND_YET("LXX %d,%d,%d:", type, num, *var);
TRACE_UNIMPLEMENTED("LXX %d,%d,%d:", type, num, *var);
return;
}
DEBUG_COMMAND("LXX %d,%d,%d:", type, num, *var);
TRACE("LXX %d,%d,%d:", type, num, *var);
}
+17 -17
View File
@@ -44,7 +44,7 @@ void commandMS() {
const char *str = sl_getString(':');
svar_set(num, str);
DEBUG_COMMAND("MS %d,%s:",num,str);
TRACE("MS %d,%s:",num,str);
}
void commandMP() {
@@ -85,7 +85,7 @@ void commandMP() {
}
sys_addMsg(str);
DEBUG_COMMAND("MP %d,%d:",num1,num2);
TRACE("MP %d,%d:",num1,num2);
free(str);
}
@@ -118,7 +118,7 @@ void commandMI() { /* T2 */
free(t1);
free(t2);
free(t3);
DEBUG_COMMAND("MI %d,%d,%s:",dst_no,max_len, title);
TRACE("MI %d,%d,%s:",dst_no,max_len, title);
}
void commandMA() {
@@ -134,7 +134,7 @@ void commandMA() {
svar_append(num1, svar_get(num2));
}
DEBUG_COMMAND("MA %d,%d:",num1,num2);
TRACE("MA %d,%d:",num1,num2);
}
void commandMC() {
@@ -144,7 +144,7 @@ void commandMC() {
sysVar[0] = strcmp(svar_get(num1), svar_get(num2)) == 0 ? 1 : 0;
DEBUG_COMMAND("MC %d,%d:",num1,num2);
TRACE("MC %d,%d:",num1,num2);
}
void commandMT() {
@@ -158,7 +158,7 @@ void commandMT() {
enable_hack_by_title(nact->game_title_utf8);
DEBUG_COMMAND("MT %s:",str);
TRACE("MT %s:",str);
}
void commandMM() {
@@ -169,7 +169,7 @@ void commandMM() {
if (num1 != num2)
svar_set(num1, svar_get(num2));
DEBUG_COMMAND("MM %d,%d:",num1, num2);
TRACE("MM %d,%d:",num1, num2);
}
void commandMH() {
@@ -183,7 +183,7 @@ void commandMH() {
svar_set(num1, s);
free(s);
DEBUG_COMMAND("MH %d,%d,%d:",num1,fig,num2);
TRACE("MH %d,%d,%d:",num1,fig,num2);
}
void commandMV() {
@@ -191,7 +191,7 @@ void commandMV() {
int version = getCaliValue();
nact->scenario_version = version;
DEBUG_COMMAND("MV %d:",version);
TRACE("MV %d:",version);
}
void commandML() {
@@ -201,7 +201,7 @@ void commandML() {
*var = svar_length(str_no);
DEBUG_COMMAND("ML %p,%d:",var, str_no);
TRACE("ML %p,%d:",var, str_no);
}
void commandMD() {
@@ -212,7 +212,7 @@ void commandMD() {
svar_copy(dst_str_no, 0, src_str_no, 0, len);
DEBUG_COMMAND("MD %d,%d,%d:",dst_str_no, src_str_no, len);
TRACE("MD %d,%d,%d:",dst_str_no, src_str_no, len);
}
void commandME() {
@@ -225,7 +225,7 @@ void commandME() {
svar_copy(dst_str_no, dst_pos, src_str_no, src_pos, len);
DEBUG_COMMAND("ME %d,%d,%d,%d,%d:",dst_str_no, dst_pos, src_str_no, src_pos, len);
TRACE("ME %d,%d,%d,%d,%d:",dst_str_no, dst_pos, src_str_no, src_pos, len);
}
void commandMF() {
@@ -244,7 +244,7 @@ void commandMF() {
sysVar[0] = 0;
}
DEBUG_COMMAND("MF %p,%d,%d,%d:",var, dst_no, key_no, start_pos);
TRACE("MF %p,%d,%d,%d:",var, dst_no, key_no, start_pos);
}
void commandMZ0() {
@@ -253,7 +253,7 @@ void commandMZ0() {
int max_num = getCaliValue();
int rsv = getCaliValue();
DEBUG_COMMAND("MZ0 %d,%d,%d:",max_len, max_num, rsv);
TRACE("MZ0 %d,%d,%d:",max_len, max_num, rsv);
svar_init(max_num);
}
@@ -306,7 +306,7 @@ void commandMG() {
break;
}
DEBUG_COMMAND("MG %d,%d:",no, sw);
TRACE("MG %d,%d:",no, sw);
}
void commandMJ() {
@@ -335,7 +335,7 @@ void commandMJ() {
free(t1);
free(t2);
DEBUG_COMMAND("MJ %d,%d,%d,%d,%d:", num, x, y, h, max_len);
TRACE("MJ %d,%d,%d,%d,%d:", num, x, y, h, max_len);
}
void commandMN() {
@@ -355,5 +355,5 @@ void commandMN() {
default:
WARNING("UnKnown MN command(%d)", no);
}
DEBUG_COMMAND("MN %d,%d,%d:",no, num, *var);
TRACE("MN %d,%d,%d:",no, num, *var);
}
+28 -28
View File
@@ -51,7 +51,7 @@ void commandNB() {
return;
}
DEBUG_COMMAND("NB %d,%d,%d:", *var1, *var2, cnt);
TRACE("NB %d,%d,%d:", *var1, *var2, cnt);
while(cnt--) {
*var1 = *var2; var1++; var2++;
}
@@ -62,7 +62,7 @@ void commandNC() {
int *var1 = getCaliVariable();
int cnt = getCaliValue();
DEBUG_COMMAND("NC %d,%d:", *var1, cnt);
TRACE("NC %d,%d:", *var1, cnt);
while(cnt--) {
*var1++ = 0;
@@ -76,7 +76,7 @@ void commandNR() {
int *var2 = getCaliVariable();
*var2 = (int)sqrtf(var1);
DEBUG_COMMAND("NR %d,%d:", var1, *var2);
TRACE("NR %d,%d:", var1, *var2);
}
void commandN_ADD() {
@@ -85,7 +85,7 @@ void commandN_ADD() {
int num = getCaliValue();
int cnt = getCaliValue();
DEBUG_COMMAND("N+ %d,%d,%d:", *var1, num, cnt);
TRACE("N+ %d,%d,%d:", *var1, num, cnt);
while(cnt--) {
*var1 = (uint16_t)(*var1 + num); var1++;
// *var1 += num; var1++;
@@ -98,7 +98,7 @@ void commandN_SUB() {
int num = getCaliValue();
int cnt = getCaliValue();
DEBUG_COMMAND("N- %d,%d,%d:", *var1, num, cnt);
TRACE("N- %d,%d,%d:", *var1, num, cnt);
while(cnt--) {
*var1 = max(0, *var1 - num); var1++;
// *var1 -= num; var1++;
@@ -111,7 +111,7 @@ void commandN_MUL() {
int num = getCaliValue();
int cnt = getCaliValue();
DEBUG_COMMAND("N* %d,%d,%d:", *var1, num, cnt);
TRACE("N* %d,%d,%d:", *var1, num, cnt);
while(cnt--) {
*var1 = (uint16_t)(*var1 * num); var1++;
// *var1 *= num; var1++;
@@ -124,7 +124,7 @@ void commandN_DIV() {
int num = getCaliValue();
int cnt = getCaliValue();
DEBUG_COMMAND("N/ %d,%d,%d:", *var1, num, cnt);
TRACE("N/ %d,%d,%d:", *var1, num, cnt);
while(cnt--) {
// *var1 = (unsigned short)(*var1)/num; var1++;
*var1 /= num; var1++;
@@ -140,7 +140,7 @@ void commandN_GT() {
int cnt = getCaliValue();
int *var2 = getCaliVariable();
DEBUG_COMMAND("N> %d,%d,%d,%d:", *var1, num, cnt, *var2);
TRACE("N> %d,%d,%d,%d:", *var1, num, cnt, *var2);
while (cnt--) {
*var2 = *var1 > num ? 1 : 0; var1++; var2++;
}
@@ -155,7 +155,7 @@ void commandN_LT() {
int cnt = getCaliValue();
int *var2 = getCaliVariable();
DEBUG_COMMAND("N< %p,%d,%d,%p:", var1, num, cnt, var2);
TRACE("N< %p,%d,%d,%p:", var1, num, cnt, var2);
while(cnt--) {
*var2 = *var1 < num ? 1 : 0; var1++; var2++;
}
@@ -170,7 +170,7 @@ void commandN_EQ() {
int cnt = getCaliValue();
int *var2 = getCaliVariable();
DEBUG_COMMAND("N= %p,%d,%d,%p:", var1, num, cnt, var2);
TRACE("N= %p,%d,%d,%p:", var1, num, cnt, var2);
while(cnt--) {
*var2 = *var1 == num ? 1 : 0; var1++; var2++;
}
@@ -181,7 +181,7 @@ void commandN_NE() {
int *var1 = getCaliVariable();
int cnt = getCaliValue();
DEBUG_COMMAND("N\\ %p,%d:", var1, cnt);
TRACE("N\\ %p,%d:", var1, cnt);
while(cnt--) {
*var1 ^= 1; var1++;
}
@@ -193,7 +193,7 @@ void commandN_AND() {
int cnt = getCaliValue();
int *var2 = getCaliVariable();
DEBUG_COMMAND("N& %p,%d,%p:", var1, cnt, var2);
TRACE("N& %p,%d,%p:", var1, cnt, var2);
while(cnt--) {
*var2 &= *var1; var1++; var2++;
}
@@ -205,7 +205,7 @@ void commandN_OR() {
int cnt = getCaliValue();
int *var2 = getCaliVariable();
DEBUG_COMMAND("N| %p,%d,%p:", var1, cnt, var2);
TRACE("N| %p,%d,%p:", var1, cnt, var2);
while(cnt--) {
*var2 |= *var1; var1++; var2++;
}
@@ -217,7 +217,7 @@ void commandN_XOR() {
int cnt = getCaliValue();
int *var2 = getCaliVariable();
DEBUG_COMMAND("N^ %p,%d,%p:", var1, cnt, var2);
TRACE("N^ %p,%d,%p:", var1, cnt, var2);
while(cnt--) {
*var2 ^= *var1; var1++; var2++;
}
@@ -228,7 +228,7 @@ void commandN_NOT() {
int *var = getCaliVariable();
int cnt = getCaliValue();
DEBUG_COMMAND("N~ %p,%d", var, cnt);
TRACE("N~ %p,%d", var, cnt);
while(cnt--) {
*var ^= 0xffff; var++;
}
@@ -262,7 +262,7 @@ void commandNO() { /* T2 */
WARNING("Unknown NO %d command", p1);
}
DEBUG_COMMAND("NO %d,%p,%p,%d:", p1, src_var, dst_var, cnt);
TRACE("NO %d,%p,%p,%d:", p1, src_var, dst_var, cnt);
}
void commandNDC() {
@@ -271,7 +271,7 @@ void commandNDC() {
int num = getCaliValue();
longVar[w64n] = num;
DEBUG_COMMAND("NDC %d,%d:", w64n, num);
TRACE("NDC %d,%d:", w64n, num);
}
void commandNDD() {
@@ -280,7 +280,7 @@ void commandNDD() {
int w64n = getCaliValue();
*var = (int)longVar[w64n];
DEBUG_COMMAND("NDD %p,%d:", var, w64n);
TRACE("NDD %p,%d:", var, w64n);
}
void commandNDM() {
@@ -288,7 +288,7 @@ void commandNDM() {
int str = getCaliValue();
int w64n = getCaliValue();
DEBUG_COMMAND_YET("NDM %d,%d:", str, w64n);
TRACE_UNIMPLEMENTED("NDM %d,%d:", str, w64n);
}
void commandNDA() {
@@ -296,7 +296,7 @@ void commandNDA() {
int str = getCaliValue();
int w64n = getCaliValue();
DEBUG_COMMAND_YET("NDA %d,%d:", str, w64n);
TRACE_UNIMPLEMENTED("NDA %d,%d:", str, w64n);
}
void commandNDH() {
@@ -304,7 +304,7 @@ void commandNDH() {
int str = getCaliValue();
int w64n = getCaliValue();
DEBUG_COMMAND_YET("NDH %d,%d:", str, w64n);
TRACE_UNIMPLEMENTED("NDH %d,%d:", str, w64n);
}
void commandND_ADD() {
@@ -315,7 +315,7 @@ void commandND_ADD() {
longVar[w64n1] = longVar[w64n2] + longVar[w64n3];
DEBUG_COMMAND("ND+ %d,%d,%d:", w64n1, w64n2);
TRACE("ND+ %d,%d,%d:", w64n1, w64n2);
}
void commandND_SUB() {
@@ -326,7 +326,7 @@ void commandND_SUB() {
longVar[w64n1] = longVar[w64n2] - longVar[w64n3];
DEBUG_COMMAND("ND- %d,%d,%d:", w64n1, w64n2, w64n3);
TRACE("ND- %d,%d,%d:", w64n1, w64n2, w64n3);
}
void commandND_MUL() {
@@ -337,7 +337,7 @@ void commandND_MUL() {
longVar[w64n1] = longVar[w64n2] * longVar[w64n3];
DEBUG_COMMAND("ND* %d,%d,%d:", w64n1, w64n2, w64n3);
TRACE("ND* %d,%d,%d:", w64n1, w64n2, w64n3);
}
void commandND_DIV() {
@@ -348,7 +348,7 @@ void commandND_DIV() {
longVar[w64n1] = longVar[w64n2] / longVar[w64n3];
DEBUG_COMMAND("ND/ %d,%d,%d:", w64n1, w64n2, w64n3);
TRACE("ND/ %d,%d,%d:", w64n1, w64n2, w64n3);
}
void commandNI() { /* From Panyo */
@@ -373,7 +373,7 @@ void commandNI() { /* From Panyo */
sysVar[0] = 0;
}
DEBUG_COMMAND("NI %p,%d,%d,%d:", var, def, _min, _max);
TRACE("NI %p,%d,%d,%d:", var, def, _min, _max);
}
void commandNT() { /* From Panyo */
@@ -383,7 +383,7 @@ void commandNT() { /* From Panyo */
free(ni_param.title);
ni_param.title = toUTF8(str);
DEBUG_COMMAND("NT %p:", str);
TRACE("NT %p:", str);
}
void commandNP() {
@@ -393,7 +393,7 @@ void commandNP() {
int count = getCaliValue();
int *result = getCaliVariable();
DEBUG_COMMAND("NP %d,%d,%d,%d:", *var1, *var2, count, *result);
TRACE("NP %d,%d,%d,%d:", *var1, *var2, count, *result);
while(count--) {
if (*var1 != *var2) {
+11 -11
View File
@@ -32,7 +32,7 @@ void commandPN() {
/* num 番のCGを表示する時、カラーパレットを展開しないようにする。*/
int num = getCaliValue();
DEBUG_COMMAND_YET("PN %d:",num);
TRACE_UNIMPLEMENTED("PN %d:",num);
}
void commandPF() {
@@ -60,7 +60,7 @@ void commandPF() {
sysVar[0] = nact->waitcancel_key; break;
}
DEBUG_COMMAND("PF %d,%d,%d:", p1, num, cancel_enabled);
TRACE("PF %d,%d,%d:", p1, num, cancel_enabled);
}
void commandPW() {
@@ -88,7 +88,7 @@ void commandPW() {
sysVar[0] = nact->waitcancel_key; break;
}
DEBUG_COMMAND("PW %d,%d,%d:", p1, num, cancel_enabled);
TRACE("PW %d,%d,%d:", p1, num, cancel_enabled);
}
void commandPS() {
@@ -101,7 +101,7 @@ void commandPS() {
ags_setPalette(Plane, Red, Green, Blue);
ags_setPaletteToSystem(Plane, 1);
DEBUG_COMMAND("PS %d,%d,%d,%d:", Plane, Red, Green, Blue);
TRACE("PS %d,%d,%d,%d:", Plane, Red, Green, Blue);
}
void commandPG() { /* T2 */
@@ -116,7 +116,7 @@ void commandPG() { /* T2 */
*var++ = nact->ags.pal[num1 + i].g;
*var++ = nact->ags.pal[num1 + i].b;
}
DEBUG_COMMAND("PG %p,%d,%d:", var, num1, num2);
TRACE("PG %p,%d,%d:", var, num1, num2);
}
void commandPP() { /* T2 */
@@ -130,7 +130,7 @@ void commandPP() { /* T2 */
ags_setPalette(num1 + i, *var, *(var +1), *(var +2)); var+=3;
}
ags_setPaletteToSystem(num1, num2);
DEBUG_COMMAND("PP %p,%d,%d:", var, num1, num2);
TRACE("PP %p,%d,%d:", var, num1, num2);
}
void commandPC() {
@@ -139,7 +139,7 @@ void commandPC() {
cg_fflg = num;
DEBUG_COMMAND("PC %d:",num);
TRACE("PC %d:",num);
}
void commandPD() {
@@ -148,7 +148,7 @@ void commandPD() {
cg_brightness = num;
DEBUG_COMMAND("PD %d:",num);
TRACE("PD %d:",num);
}
void commandPT0() {
@@ -161,7 +161,7 @@ void commandPT0() {
ags_getPixel(x, y, &cell);
*var = cell.pixel;
DEBUG_COMMAND("PT0 %p,%d,%d:", var, x, y);
TRACE("PT0 %p,%d,%d:", var, x, y);
}
void commandPT1() {
@@ -178,7 +178,7 @@ void commandPT1() {
*g_var = cell.g;
*b_var = cell.b;
DEBUG_COMMAND("PT1 %p,%p,%p,%d,%d:", r_var, g_var, b_var, x, y);
TRACE("PT1 %p,%p,%p,%d,%d:", r_var, g_var, b_var, x, y);
}
void commandPT2() {
@@ -200,5 +200,5 @@ void commandPT2() {
*hi_var = pic >> 8;
*low_var = pic & 0xff;
DEBUG_COMMAND("PT2 %p,%p,%d,%d:", hi_var, low_var, x, y);
TRACE("PT2 %p,%p,%d,%d:", hi_var, low_var, x, y);
}
+4 -4
View File
@@ -42,7 +42,7 @@ void commandQD() {
if (sysVar[0] > 200) WARNING("Failed to save (%d)", sysVar[0]);
DEBUG_COMMAND("QD %d:",num);
TRACE("QD %d:",num);
}
void commandQP() {
@@ -60,7 +60,7 @@ void commandQP() {
if (sysVar[0] > 200) WARNING("Failed to save (%d)", sysVar[0]);
DEBUG_COMMAND("QP %d,%d,%d:", num, point.var, cnt);
TRACE("QP %d,%d,%d:", num, point.var, cnt);
}
void commandQC() {
@@ -76,7 +76,7 @@ void commandQC() {
if (sysVar[0] > 200) WARNING("Failed to save (%d)", sysVar[0]);
DEBUG_COMMAND("QC %d,%d:",num1,num2);
TRACE("QC %d,%d:",num1,num2);
}
void commandQE() {
@@ -107,5 +107,5 @@ void commandQE() {
free(fname_utf8);
if (sysVar[0] > 200) WARNING("Failed to save (%d)", sysVar[0]);
DEBUG_COMMAND("QE %d,%s,%d,%d:", type, filename, var, cnt);
TRACE("QE %d,%s,%d,%d:", type, filename, var, cnt);
}
+27 -27
View File
@@ -37,7 +37,7 @@ void commandSS() {
/* 音楽演奏を開始する(CDのみ)*/
int num = getCaliValue();
DEBUG_COMMAND("SS %d:",num);
TRACE("SS %d:",num);
if (num == 0) {
muscd_stop();
@@ -65,7 +65,7 @@ void commandSC() {
*var++ = 999;
}
DEBUG_COMMAND("SC %p:",var);
TRACE("SC %p:",var);
}
void commandSD() {
@@ -73,7 +73,7 @@ void commandSD() {
int num1 = getCaliValue();
int num2 = getCaliValue();
DEBUG_COMMAND_YET("SD %d,%d:",num1,num2);
TRACE_UNIMPLEMENTED("SD %d,%d:",num1,num2);
}
void commandSR() {
@@ -112,7 +112,7 @@ void commandSR() {
*var = st.play_no;
}
DEBUG_COMMAND("SR %d,%p:",num, var);
TRACE("SR %d,%p:",num, var);
}
void commandSL() {
@@ -121,7 +121,7 @@ void commandSL() {
next_cdrom_loopcnt = num;
DEBUG_COMMAND("SL %d:",num);
TRACE("SL %d:",num);
}
void commandSI() {
@@ -137,7 +137,7 @@ void commandSI() {
*var = muscd_is_available() ? 1 : 0;
}
DEBUG_COMMAND("SI %d,%d:",type,*var);
TRACE("SI %d,%d:",type,*var);
}
void commandSG() {
@@ -152,7 +152,7 @@ void commandSG() {
/* 演奏中のMIDIを停止する */
num = getCaliValue();
mus_midi_stop();
DEBUG_COMMAND("SG0 %d:", num);
TRACE("SG0 %d:", num);
break;
case 1:
/* MIDIを演奏する */
@@ -162,14 +162,14 @@ void commandSG() {
} else {
mus_midi_start(num, loopcnt);
}
DEBUG_COMMAND("SG1 %d:", num);
TRACE("SG1 %d:", num);
break;
case 2:
/* MIDI演奏位置を1/100秒単位で取得する */
var = getCaliVariable();
mus_midi_get_playposition(&st);
*var = st.loc_ms / 10;
DEBUG_COMMAND("SG2 %p:", var);
TRACE("SG2 %p:", var);
break;
case 3:
num = getCaliValue();
@@ -180,40 +180,40 @@ void commandSG() {
/* 一時停止中のMIDIの一時停止を解除する */
mus_midi_unpause();
}
DEBUG_COMMAND("SG3 %d:", num);
TRACE("SG3 %d:", num);
break;
case 4:
num = getCaliValue();
/* 次のSG1コマンドでのMIDI演奏の繰り返し回数指定 */
loopcnt = num;
DEBUG_COMMAND("SG4 %d:", num);
TRACE("SG4 %d:", num);
break;
case 5:
fnum = getCaliValue() & 0x7f;
num = getCaliValue();
mus_midi_set_flag(0, fnum, num);
DEBUG_COMMAND("SG5 %d,%d:", fnum, num);
TRACE("SG5 %d,%d:", fnum, num);
break;
case 6:
fnum = getCaliValue() & 0x7f;
num = getCaliValue();
mus_midi_set_flag(1, fnum, num);
DEBUG_COMMAND("SG6 %d,%d:", fnum, num);
TRACE("SG6 %d,%d:", fnum, num);
break;
case 7:
fnum = getCaliValue() & 0x7f;
var = getCaliVariable();
*var = mus_midi_get_flag(0, fnum);
DEBUG_COMMAND("SG7 %d,%d:", fnum, *var);
TRACE("SG7 %d,%d:", fnum, *var);
break;
case 8: {
fnum = getCaliValue() & 0x7f;
var = getCaliVariable();
*var = mus_midi_get_flag(1, fnum);
DEBUG_COMMAND("SG8 %d,%p:", fnum, var);
TRACE("SG8 %d,%p:", fnum, var);
break;
}
default:
@@ -227,7 +227,7 @@ void commandSP() {
int no = getCaliValue();
int loop = getCaliValue();
DEBUG_COMMAND("SP %d,%d:",no,loop);
TRACE("SP %d,%d:",no,loop);
if (!mus_pcm_get_state()) {
dummy_pcm_in_play = TRUE;
@@ -245,7 +245,7 @@ void commandST() {
/* PCMデータの演奏を停止する。 */
int time = getCaliValue();
DEBUG_COMMAND("ST %d:",time);
TRACE("ST %d:",time);
if (!mus_pcm_get_state()) {
dummy_pcm_in_play = FALSE;
@@ -277,7 +277,7 @@ void commandSU() {
*var1 = *var2 = 0;
}
DEBUG_COMMAND("SU %d,%d:",*var1, *var2);
TRACE("SU %d,%d:",*var1, *var2);
}
void commandSV() {
@@ -286,7 +286,7 @@ void commandSV() {
int volume = getCaliValue();
mus_mixer_set_level(device, volume);
DEBUG_COMMAND("SV %d,%d", device, volume);
TRACE("SV %d,%d", device, volume);
}
void commandSQ() {
@@ -295,7 +295,7 @@ void commandSQ() {
int noR = getCaliValue();
int loop = getCaliValue();
DEBUG_COMMAND("SQ %d,%d,%d:", noL, noR, loop);
TRACE("SQ %d,%d,%d:", noL, noR, loop);
if (!mus_pcm_get_state()) {
dummy_pcm_in_play = TRUE;
@@ -313,7 +313,7 @@ void commandSO() {
// PCMデバイスのサポート情報を取得
int *var = getCaliVariable();
DEBUG_COMMAND_YET("SO %p:",var);
TRACE_UNIMPLEMENTED("SO %p:",var);
}
void commandSW() {
@@ -338,13 +338,13 @@ void commandSW() {
*var = 0;
}
DEBUG_COMMAND("SW %p,%d,%d,%d:",var, channel, Srate, bit);
TRACE("SW %p,%d,%d,%d:",var, channel, Srate, bit);
}
void commandSM() {
/* PCMデータをメモリ上に乗せる。*/
int no = getCaliValue();
DEBUG_COMMAND("SM %d:",no);
TRACE("SM %d:",no);
mus_pcm_load(no);
}
@@ -360,7 +360,7 @@ void commandSX() {
int volume = getCaliValue();
int stop = getCaliValue();
mus_mixer_fadeout_start(device, time, volume, stop);
DEBUG_COMMAND("SX %d,%d,%d,%d,%d:", device, sw, time, volume, stop);
TRACE("SX %d,%d,%d,%d,%d:", device, sw, time, volume, stop);
break;
}
case 2: {
@@ -369,20 +369,20 @@ void commandSX() {
boolean st;
st = mus_mixer_fadeout_get_state(device);
*var = (st ? 0 : 1);
DEBUG_COMMAND("SX %d,%d:", device, sw);
TRACE("SX %d,%d:", device, sw);
break;
}
case 3: {
/* フェード強制終了 */
mus_mixer_fadeout_stop(device);
DEBUG_COMMAND("SX %d,%d:", device, sw);
TRACE("SX %d,%d:", device, sw);
break;
}
case 4: {
/* ボリューム取得 */
int *var = getCaliVariable();
*var = mus_mixer_get_level(device);
DEBUG_COMMAND("SX %d,%d:", device, sw);
TRACE("SX %d,%d:", device, sw);
break;
}
default:
+1 -1
View File
@@ -33,5 +33,5 @@ void commandT() {
int y = getCaliValue();
msg_setMessageLocation(x, y);
DEBUG_COMMAND("T %d,%d:",x,y);
TRACE("T %d,%d:",x,y);
}
+8 -8
View File
@@ -45,7 +45,7 @@ void commandUC() { /* 王道勇者 */
sl_clearStack(false);
break;
}
DEBUG_COMMAND("UC %d,%d:",mode,num);
TRACE("UC %d,%d:",mode,num);
}
void commandUD() {
@@ -60,7 +60,7 @@ void commandUD() {
WARNING("UnKnown UD command %d", mode);
}
DEBUG_COMMAND("UD %d:",mode);
TRACE("UD %d:",mode);
}
void commandUR() {
@@ -76,7 +76,7 @@ void commandUR() {
var[4] = info.label_calls_after_page_call;
var[5] = info.var_pushes_after_call;
DEBUG_COMMAND("UR %p:",var);
TRACE("UR %p:",var);
}
void commandUS() {
@@ -86,7 +86,7 @@ void commandUS() {
int cnt = getCaliValue();
sl_pushVar(&vref, cnt);
DEBUG_COMMAND("US %d,%d:", vref.var, cnt);
TRACE("US %d,%d:", vref.var, cnt);
}
void commandUG() {
@@ -96,7 +96,7 @@ void commandUG() {
int cnt = getCaliValue();
sl_popVar(&vref, cnt);
DEBUG_COMMAND("UG %p,%d:", vref.var, cnt);
TRACE("UG %p,%d:", vref.var, cnt);
}
void commandUP0() {
@@ -104,7 +104,7 @@ void commandUP0() {
int no = getCaliValue();
int mode = getCaliValue();
DEBUG_COMMAND_YET("UP0 %d,%d:",no,mode);
TRACE_UNIMPLEMENTED("UP0 %d,%d:",no,mode);
}
void commandUP1() {
@@ -112,7 +112,7 @@ void commandUP1() {
const char *str = sl_getString(':');
int mode = getCaliValue();
DEBUG_COMMAND_YET("UP1 %s,%d:",str,mode);
TRACE_UNIMPLEMENTED("UP1 %s,%d:",str,mode);
}
void commandUP3() {
@@ -120,5 +120,5 @@ void commandUP3() {
const char *str1 = sl_getString(':');
const char *str2 = sl_getString(':');
DEBUG_COMMAND_YET("UP3 %s,%s:",str1,str2);
TRACE_UNIMPLEMENTED("UP3 %s,%s:",str1,str2);
}
+22 -36
View File
@@ -28,6 +28,7 @@
#include <sys/time.h>
#include "portab.h"
#include "sdl_core.h"
#include "scheduler.h"
#include "xsystem35.h"
#include "scenario.h"
#include "ags.h"
@@ -110,9 +111,6 @@ static UnitMapSrcImg *srcimg;
#define VACMD_MAX 20 /* Panyoで18まで */
static VaParam VAcmd[VACMD_MAX];
static boolean inAnimation = FALSE; /* 画面更新中 */
#ifdef __EMSCRIPTEN__
static int status_check_count;
#endif
/* UnitMap 各種マクロ */
#define MAPSIZE_PER_ATTRIB (cxMap * cyMap)
@@ -148,7 +146,7 @@ void commandVC() { /* from Rance4 */
cxUnit = getCaliValue();
cyUnit = getCaliValue();
DEBUG_COMMAND("VC %d,%d,%d,%d,%d,%d,%d:",nPageNum, x0Map, y0Map, cxMap, cyMap, cxUnit, cyUnit);
TRACE("VC %d,%d,%d,%d,%d,%d,%d:",nPageNum, x0Map, y0Map, cxMap, cyMap, cxUnit, cyUnit);
if (NULL != UnitMap ) {
free(UnitMap);
@@ -186,7 +184,7 @@ void commandVP() { /* from T2 */
int nyUnit = getCaliValue();
int bSpCol = getCaliValue();
DEBUG_COMMAND("VP %d,%d,%d,%d,%d,%d:",nPage, x0Unit, y0Unit, nxUnit, nyUnit, bSpCol);
TRACE("VP %d,%d,%d,%d,%d,%d:",nPage, x0Unit, y0Unit, nxUnit, nyUnit, bSpCol);
if (nPage >= nPageNum) {
WARNING("VP nPage too large %d", nPage);
@@ -209,7 +207,7 @@ void commandVS() { /* from Rance4 */
int y = getCaliValue();
int wData = getCaliValue();
DEBUG_COMMAND("VS %d,%d,%d,%d,%d:",nPage, nType, x, y, wData);
TRACE("VS %d,%d,%d,%d,%d:",nPage, nType, x, y, wData);
if (nPage >= nPageNum) {
WARNING("VS nPage too large %d", nPage);
@@ -259,7 +257,7 @@ void commandVG() { /* from Rance4 */
int x = getCaliValue();
int y = getCaliValue();
DEBUG_COMMAND("VG %d,%d,%d,%d:",nPage, nType, x, y);
TRACE("VG %d,%d,%d,%d:",nPage, nType, x, y);
if (nPage >= nPageNum) {
WARNING("VG nPage too large %d", nPage);
@@ -303,7 +301,7 @@ void commandVH() { /* from Rance4 */
int xx, yy, i, n;
int maxfoot, lmtx, lmty, lmtw, lmth;
DEBUG_COMMAND("VH %d,%d,%d,%d,%d,%d:",nPage, x, y, width, height, _max);
TRACE("VH %d,%d,%d,%d,%d,%d:",nPage, x, y, width, height, _max);
if (nPage >= nPageNum) {
WARNING("VH nPage too large %d", nPage);
@@ -445,14 +443,14 @@ void commandVF() { /* from Panyo */
}
ags_updateArea(x0Map, y0Map, cxMap * cxUnit, cyMap * cyUnit);
DEBUG_COMMAND("VF:");
TRACE("VF:");
}
void commandVV() { /* from T2 */
int nPage = getCaliValue();
int fEnable = getCaliValue();
DEBUG_COMMAND("VV %d,%d:",nPage, fEnable);
TRACE("VV %d,%d:",nPage, fEnable);
srcimg[nPage].fEnable = (fEnable == 1 ? TRUE : FALSE);
}
@@ -463,7 +461,7 @@ void commandVR() { /* from Rance4 */
int *var = getCaliVariable();
int *dst;
DEBUG_COMMAND("VR %d,%d,%p:",nPage, nType, var);
TRACE("VR %d,%d,%p:",nPage, nType, var);
if (nPage >= nPageNum) {
WARNING("VR nPage too large %d", nPage);
@@ -493,7 +491,7 @@ void commandVW() { /* from Rance4 */
int *var = getCaliVariable();
int *src;
DEBUG_COMMAND("VW %d,%d,%p:",nPage, nType, var);
TRACE("VW %d,%d,%p:",nPage, nType, var);
if (nPage >= nPageNum) {
WARNING("VW nPage too large %d", nPage);
@@ -528,7 +526,7 @@ void commandVE() { /* from T2 */
int unit, unit_x, unit_y;
UnitMapSrcImg *img;
DEBUG_COMMAND("VE %d,%d,%d,%d,%d,%d:", x, y, width, height, out_ptn, flag);
TRACE("VE %d,%d,%d,%d,%d,%d:", x, y, width, height, out_ptn, flag);
if (flag == 1) {
WARNING("VE flag1 is not yet");
}
@@ -567,7 +565,7 @@ void commandVZ() { /* from T2 */
int p2 = getCaliValue();
int p3 = getCaliValue();
DEBUG_COMMAND("VZ %d,%d,%d:", p1, p2, p3);
TRACE("VZ %d,%d,%d:", p1, p2, p3);
switch(p1) {
case 0:
@@ -593,7 +591,7 @@ void commandVX() { /* from T2 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND("VX %d,%d,%d,%d:", p1, p2, p3, p4);
TRACE("VX %d,%d,%d,%d:", p1, p2, p3, p4);
switch(p1) {
case 0:
@@ -653,7 +651,7 @@ void commandVT() { /* from Panyo */
}
}
DEBUG_COMMAND("VT %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", sp, sa, sx, sy, width, height, dp, da, dx, dy);
TRACE("VT %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", sp, sa, sx, sy, width, height, dp, da, dx, dy);
}
void commandVB() {
@@ -665,7 +663,7 @@ void commandVB() {
int y_size = getCaliValue();
int data = getCaliValue();
DEBUG_COMMAND_YET("VB %d,%d,%d,%d,%d,%d,%d:", page, type, x_pos, y_pos, x_size, y_size, data);
TRACE_UNIMPLEMENTED("VB %d,%d,%d,%d,%d,%d,%d:", page, type, x_pos, y_pos, x_size, y_size, data);
}
void commandVIC() { /* from Panyo */
@@ -677,7 +675,7 @@ void commandVIC() { /* from Panyo */
int x, y, i;
UnitMapSrcImg *img;
DEBUG_COMMAND("VIC %d,%d,%d,%d:", sx, sy, width, height);
TRACE("VIC %d,%d,%d,%d:", sx, sy, width, height);
for (i = 0; i < nPageNum; i++) {
img = &srcimg[i];
@@ -706,7 +704,7 @@ void commandVIP() {
int width = getCaliValue();
int height = getCaliValue();
DEBUG_COMMAND_YET("VIP %d,%d,%d,%d:", x, y, width, height);
TRACE_UNIMPLEMENTED("VIP %d,%d,%d,%d:", x, y, width, height);
}
void commandVJ() {
@@ -716,16 +714,7 @@ void commandVJ() {
int y = getCaliValue();
int max = getCaliValue();
DEBUG_COMMAND_YET("VJ %d,%d,%d,%d:", page, x, y, max);
}
static void throttle() {
#ifdef __EMSCRIPTEN__
if (++status_check_count > 1) {
status_check_count = 0;
nact->wait_vsync = TRUE;
}
#endif
TRACE_UNIMPLEMENTED("VJ %d,%d,%d,%d:", page, x, y, max);
}
void commandVA() { /* from Panyo */
@@ -737,11 +726,11 @@ void commandVA() { /* from Panyo */
if (no >= 10) {
var1 = getCaliVariable();
var2 = getCaliVariable();
DEBUG_COMMAND("VA %d,%d,%p,%p:", no, p1, var1, var2);
TRACE("VA %d,%d,%p,%p:", no, p1, var1, var2);
} else {
p2 = getCaliValue();
p3 = getCaliValue();
DEBUG_COMMAND("VA %d,%d,%d,%d:", no, p1, p2, p3);
TRACE("VA %d,%d,%d,%d:", no, p1, p2, p3);
}
if (p1 > VACMD_MAX) {
@@ -852,13 +841,13 @@ void commandVA() { /* from Panyo */
/* 状態取得(var1=0:停止1:動,var2=番号) */
*var1 = VAcmd[p1].state == 0 ? 0 : 1;
*var2 = VAcmd[p1].elaspCut;
throttle();
scheduler_on_event(SCHEDULER_EVENT_VA_STATUS_CHECK);
break;
case 11:
/* 位置取得 */
*var1 = VAcmd[p1].curX;
*var2 = VAcmd[p1].curY;
throttle();
scheduler_on_event(SCHEDULER_EVENT_VA_STATUS_CHECK);
break;
default:
WARNING("Unknown VA command %d", no);
@@ -1046,9 +1035,6 @@ static void va_update() {
if (!proceeding) {
nact->is_va_animation = FALSE;
}
#ifdef __EMSCRIPTEN__
status_check_count = 0;
#endif
}
void va_reset(void) {
+4 -4
View File
@@ -35,7 +35,7 @@ void commandWW() {
ags_setWorldSize(x_size, y_size, color);
DEBUG_COMMAND("WW %d,%d,%d:",x_size, y_size, color);
TRACE("WW %d,%d,%d:",x_size, y_size, color);
}
void commandWV() {
@@ -48,7 +48,7 @@ void commandWV() {
ags_setViewArea(start_x, start_y, size_x, size_y);
ags_updateFull();
DEBUG_COMMAND("WV %d,%d,%d,%d:",start_x,start_y,size_x, size_y);
TRACE("WV %d,%d,%d,%d:",start_x,start_y,size_x, size_y);
}
void commandWZ() {
@@ -70,7 +70,7 @@ void commandWZ() {
default:
break;
}
DEBUG_COMMAND("WZ %d,%d:", p1, sw);
TRACE("WZ %d,%d:", p1, sw);
}
void commandWX() {
@@ -83,5 +83,5 @@ void commandWX() {
ags_setExposeSwitch(TRUE);
ags_updateArea(x0, y0, cx, cy);
DEBUG_COMMAND("WX %d,%d,%d,%d:", x0, y0, cx, cy);
TRACE("WX %d,%d,%d,%d:", x0, y0, cx, cy);
}
+3 -2
View File
@@ -32,6 +32,7 @@
#include "scenario.h"
#include "cmd_check.h"
#include "sdl_core.h"
#include "scheduler.h"
#include "music_cdrom.h"
#include "hacks.h"
@@ -79,7 +80,7 @@ static void rance4_Y3_IM_hack() {
}
commandIM();
if (button_pressed && ++count & 15)
nact->wait_vsync = FALSE;
cancel_yield();
}
void commandY() {
@@ -155,5 +156,5 @@ void commandY() {
WARNING("Y undefined command %d", p1);
break;
}
DEBUG_COMMAND("Y %d,%d:",p1,p2);
TRACE("Y %d,%d:",p1,p2);
}
+47 -52
View File
@@ -28,6 +28,7 @@
#include "portab.h"
#include "xsystem35.h"
#include "sdl_core.h"
#include "scheduler.h"
#include "ags.h"
#include "scenario.h"
#include "randMT.h"
@@ -48,17 +49,7 @@ static void reset_counter(int num, int divisor, int offset) {
}
static uint32_t get_counter(int num) {
// Allow up to 10 get_counter() calls in single animation frame.
static int frame = -1;
static int count = 0;
if (nact->frame_count == frame) {
if (++count >= 10)
nact->wait_vsync = TRUE;
} else {
frame = nact->frame_count;
count = 0;
}
scheduler_on_event(SCHEDULER_EVENT_TIMER_CHECK);
return sdl_getTicks() - counters[num].base;
}
@@ -85,7 +76,7 @@ void commandZC() {
WARNING("commandZC(): Unknown Command (%d)", m); break;
}
DEBUG_COMMAND("ZC %d,%d:",m,n);
TRACE("ZC %d,%d:",m,n);
}
void commandZM() {
@@ -99,7 +90,7 @@ void commandZM() {
nact->msg.MsgFontSize = size;
DEBUG_COMMAND("ZM %d:",size);
TRACE("ZM %d:",size);
}
void commandZS() {
@@ -108,7 +99,7 @@ void commandZS() {
nact->sel.MsgFontSize = size;
DEBUG_COMMAND("ZS %d:",size);
TRACE("ZS %d:",size);
}
void commandZB() {
@@ -118,7 +109,7 @@ void commandZB() {
if (nact->ags.enable_zb)
nact->ags.font_weight = weight;
DEBUG_COMMAND("ZB %d:", weight);
TRACE("ZB %d:", weight);
}
void commandZH() {
@@ -127,7 +118,7 @@ void commandZH() {
sys_setHankakuMode(sw);
DEBUG_COMMAND("ZH %d:",sw);
TRACE("ZH %d:",sw);
}
void commandZW() {
@@ -142,7 +133,7 @@ void commandZW() {
nact->messagewait_cancel = (sw & 0x200) ? TRUE : FALSE;
}
DEBUG_COMMAND("ZW %d:", sw);
TRACE("ZW %d:", sw);
}
void commandZL() {
@@ -151,7 +142,7 @@ void commandZL() {
nact->msg.LineIncrement = line;
DEBUG_COMMAND("ZL %d:",line);
TRACE("ZL %d:",line);
}
void commandZE() {
@@ -160,7 +151,7 @@ void commandZE() {
nact->sel.ClearMsgWindow = sw == 0 ? FALSE : TRUE;
DEBUG_COMMAND("ZE %d:", sw);
TRACE("ZE %d:", sw);
}
void commandZF() {
@@ -178,13 +169,13 @@ void commandZF() {
nact->sel.WinResizeWidth = TRUE; break;
}
DEBUG_COMMAND("ZF %d:", sw);
TRACE("ZF %d:", sw);
}
void commandZD() {
/* デバッグモード時のデバッグメッセージの出力 ON/OFF/PAUSE */
int c0 = sl_getc();
int sw = 0, *var;
char *msg;
switch(c0) {
case 0:
@@ -193,15 +184,19 @@ void commandZD() {
break;
case 2:
sw = getCaliValue();
DEBUG_MESSAGE("(ZD2)%s\n", svar_get(sw));
msg = toUTF8(svar_get(sw));
sys_message(2, "[DEBUG] %s\n", msg);
free(msg);
break;
case 3:
sw = getCaliValue(); break;
sw = getCaliValue();
sys_message(2, "[DEBUG] %d\n", sw);
break;
case 4:
var = getCaliVariable(); *var = 0; break;
}
DEBUG_COMMAND("ZD %d,%d:", c0, sw);
TRACE("ZD %d,%d:", c0, sw);
}
void commandZT0() {
@@ -232,7 +227,7 @@ void commandZT0() {
*(var + 5) = lc->tm_sec;
*(var + 6) = 1 + lc->tm_wday;
DEBUG_COMMAND("ZT0 %p:", var);
TRACE("ZT0 %p:", var);
}
void commandZT1() {
@@ -241,7 +236,7 @@ void commandZT1() {
reset_counter(0, 1, n);
DEBUG_COMMAND("ZT1 %d:", n);
TRACE("ZT1 %d:", n);
}
void commandZT2() {
@@ -251,7 +246,7 @@ void commandZT2() {
*var = val & 0xffff;
DEBUG_COMMAND("ZT2 %p:", var);
TRACE("ZT2 %p:", var);
}
void commandZT3() {
@@ -261,7 +256,7 @@ void commandZT3() {
*var = val & 0xffff;
DEBUG_COMMAND("ZT3 %p:", var);
TRACE("ZT3 %p:", var);
}
void commandZT4() {
@@ -271,7 +266,7 @@ void commandZT4() {
*var = val & 0xffff;
DEBUG_COMMAND("ZT4 %p:", var);
TRACE("ZT4 %p:", var);
}
void commandZT5() {
@@ -281,7 +276,7 @@ void commandZT5() {
*var = val & 0xffff;
DEBUG_COMMAND("ZT5 %d:", val);
TRACE("ZT5 %d:", val);
}
void commandZT10() {
@@ -299,7 +294,7 @@ void commandZT10() {
reset_counter(num, base, count);
}
DEBUG_COMMAND("ZT10 %d,%d,%d:", num, base, count);
TRACE("ZT10 %d,%d,%d:", num, base, count);
}
void commandZT11() {
@@ -313,7 +308,7 @@ void commandZT11() {
else
*var = (get_counter(num) / divisor) & 0xffff;
DEBUG_COMMAND("ZT11 %d,%d:", num, *var);
TRACE("ZT11 %d,%d:", num, *var);
}
void commandZT20() {
@@ -321,7 +316,7 @@ void commandZT20() {
int p1 = getCaliValue();
sysVar[0] = sys_keywait(p1, KEYWAIT_NONCANCELABLE);
DEBUG_COMMAND("ZT20 %d:",p1);
TRACE("ZT20 %d:",p1);
}
void commandZT21() {
@@ -330,14 +325,14 @@ void commandZT21() {
sysVar[0] = sys_keywait(p1, KEYWAIT_CANCELABLE);
DEBUG_COMMAND("ZT21 %d:",p1);
TRACE("ZT21 %d:",p1);
}
void commandZZ0() {
/* SYSTEM3.5を終了する */
int sw = getCaliValue();
DEBUG_COMMAND("ZZ0 %d:",sw);
TRACE("ZZ0 %d:",sw);
if (sw == 0) {
#ifdef __EMSCRIPTEN__
@@ -363,7 +358,7 @@ void commandZZ1() {
*var = 6;
#endif
#endif
DEBUG_COMMAND("ZZ1 %p:",var);
TRACE("ZZ1 %p:",var);
}
void commandZZ2() {
@@ -388,7 +383,7 @@ void commandZZ2() {
#endif
svar_set(num, str);
DEBUG_COMMAND("ZZ2 %d:",num);
TRACE("ZZ2 %d:",num);
}
void commandZZ3() {
@@ -401,7 +396,7 @@ void commandZZ3() {
*(var + 1) = info.height;
*(var + 2) = info.depth;
DEBUG_COMMAND("ZZ3 %p:",var);
TRACE("ZZ3 %p:",var);
}
void commandZZ4() {
@@ -414,7 +409,7 @@ void commandZZ4() {
*(var + 1) = info.height;
*(var + 2) = info.depth;
DEBUG_COMMAND("ZZ4 %p:",var);
TRACE("ZZ4 %p:",var);
}
void commandZZ5() {
@@ -427,7 +422,7 @@ void commandZZ5() {
*(var + 1) = info.height;
*(var + 2) = info.depth;
DEBUG_COMMAND("ZZ5 %p:",var);
TRACE("ZZ5 %p:",var);
}
void commandZZ7() {
@@ -436,14 +431,14 @@ void commandZZ7() {
*var = 65535;
DEBUG_COMMAND("ZZ7 %p:",var);
TRACE("ZZ7 %p:",var);
}
void commandZZ8() {
// メモリオンバッファの残り容量を得る
int *var = getCaliVariable();
DEBUG_COMMAND_YET("ZZ8 %p:",var);
TRACE_UNIMPLEMENTED("ZZ8 %p:",var);
}
void commandZZ9() {
@@ -456,7 +451,7 @@ void commandZZ9() {
*(var + 1) = info.height;
*(var + 2) = info.depth;
DEBUG_COMMAND("ZZ9 %p:",var);
TRACE("ZZ9 %p:",var);
}
void commandZZ10() {
@@ -465,7 +460,7 @@ void commandZZ10() {
*var = sdl_isFullscreen() ? 1 : 0;
DEBUG_COMMAND("ZZ10 %d:",*var);
TRACE("ZZ10 %d:",*var);
}
void commandZZ13() {
@@ -479,7 +474,7 @@ void commandZZ13() {
#endif
nact->msg.MsgFont = num;
DEBUG_COMMAND("ZZ13 %d:",num);
TRACE("ZZ13 %d:",num);
}
void commandZZ14() {
@@ -495,7 +490,7 @@ void commandZZ14() {
if (no <= 0) return;
svar_set(no, s);
DEBUG_COMMAND("ZZ14 %d:", no);
TRACE("ZZ14 %d:", no);
}
void commandZG() {
@@ -504,7 +499,7 @@ void commandZG() {
cg_loadCountVar = var;
DEBUG_COMMAND("ZG %p:",var);
TRACE("ZG %p:",var);
}
void commandZI() { /* T2 */
@@ -514,7 +509,7 @@ void commandZI() { /* T2 */
set_hak_keymode(key, mode);
DEBUG_COMMAND("ZI %d,%d:", key, mode);
TRACE("ZI %d,%d:", key, mode);
}
void commandZA() { /* T2 */
@@ -534,7 +529,7 @@ void commandZA() { /* T2 */
WARNING("Unknown ZA comannd %d, %d", p1, p2);
}
DEBUG_COMMAND("ZA %d,%d:", p1, p2);
TRACE("ZA %d,%d:", p1, p2);
}
void commandZK() {
@@ -543,7 +538,7 @@ void commandZK() {
int p2 = getCaliValue();
const char *str = sl_getString(':');
DEBUG_COMMAND("ZK %d,%d,%s:", p1, p2, str);
TRACE("ZK %d,%d,%s:", p1, p2, str);
}
void commandZR() {
@@ -557,7 +552,7 @@ void commandZR() {
*var = (int)(genrand() * num) +1;
}
DEBUG_COMMAND("ZR %d,%d:", num, *var);
TRACE("ZR %d,%d:", num, *var);
}
void commandZU() {
@@ -567,7 +562,7 @@ void commandZU() {
if (sw <= CHARACTER_ENCODING_MAX)
sys_setCharacterEncoding(sw);
DEBUG_COMMAND("ZU %d:",sw);
TRACE("ZU %d:",sw);
}
void cmdz_reset(void) {
+1 -1
View File
@@ -216,7 +216,7 @@ struct debug_symbols *dsym_load(const char *path) {
return NULL;
}
if (fread(section_content, section_size - 8, 1, fp) != 1) {
WARNING("%s: I/O error", path, strerror(errno));
WARNING("%s: %s", path, strerror(errno));
fclose(fp);
return NULL;
}
+5 -1
View File
@@ -588,7 +588,11 @@ static int read_command_thread(void *data) {
continue;
}
char *buf = malloc(content_length);
fread(buf, content_length, 1, stdin);
if (fread(buf, content_length, 1, stdin) != 1) {
fprintf(stderr, "Failed to read message\n");
free(buf);
break;
}
sdl_post_debugger_command(buf);
content_length = -1;
} else {
+36 -2
View File
@@ -29,6 +29,7 @@
#include "system.h"
#include "LittleEndian.h"
#include "dri.h"
#include "sdl_core.h"
static bool read_index(int volume, drifiles *d, FILE *fp) {
fseek(fp, 0L, SEEK_END);
@@ -77,7 +78,7 @@ static bool read_index(int volume, drifiles *d, FILE *fp) {
drifiles *dri_init(const char **file, int cnt, boolean use_mmap) {
drifiles *d = calloc(1, sizeof(drifiles));
#ifndef HAVE_MEMORY_MAPPED_FILE
#if !defined(HAVE_MEMORY_MAPPED_FILE) || defined(__EMSCRIPTEN__)
use_mmap = FALSE;
#endif
@@ -114,9 +115,42 @@ drifiles *dri_init(const char **file, int cnt, boolean use_mmap) {
return d;
}
bool dri_is_linked(drifiles *d, int no) {
return no >= 0 && no < d->nr_files && d->link[no * 3];
}
bool dri_exists(drifiles *d, int no) {
return dri_is_linked(d, no) && d->offset[no];
}
static void warn_missing_ald(drifiles *d, int no) {
static bool warned = false;
if (warned) return;
warned = true;
int vol = d->link[no * 3];
char msgbuf[1024];
if (d->fnames[vol - 1]) {
snprintf(msgbuf, sizeof(msgbuf), "Cannot read resource #%d from %s.", no, d->fnames[vol - 1]);
} else if (d->fnames[0]) {
char *fname = strdup(d->fnames[0]);
char *p = strrchr(fname, '.');
if (p && p > fname)
p[-1] = vol - 1 + 'A';
snprintf(msgbuf, sizeof(msgbuf), "%s is not found.\nPlease make sure you have all .ALD files copied from the CD-ROM.", fname);
free(fname);
} else {
snprintf(msgbuf, sizeof(msgbuf), "Cannot read resource #%d.", no);
}
sdl_showMessageBox(MESSAGEBOX_WARNING, "xsystem35", msgbuf);
}
dridata *dri_getdata(drifiles *d, int no) {
if (no < 0 || no >= d->nr_files || !d->link[no * 3] || !d->offset[no])
if (!dri_exists(d, no)) {
if (dri_is_linked(d, no))
warn_missing_ald(d, no);
return NULL;
}
int volume = d->link[no * 3];
uint8_t *data;
+4 -2
View File
@@ -50,7 +50,9 @@ struct _dridata {
};
typedef struct _dridata dridata;
extern drifiles *dri_init(const char **file, int cnt, boolean use_mmap);
extern dridata *dri_getdata(drifiles *d, int no);
drifiles *dri_init(const char **file, int cnt, boolean use_mmap);
bool dri_is_linked(drifiles *d, int no);
bool dri_exists(drifiles *d, int no);
dridata *dri_getdata(drifiles *d, int no);
#endif /* !__DRI__ */
+10
View File
@@ -30,6 +30,8 @@
#define GT_RANCE3 "Rance3"
#define GT_RANCE3_ENG "Rance3"
#define GT_RANCE4_ENG "Rance4 -Legacy of the Sect- For Win95 "
#define GT_AGAKE "俺の下であがけ"
#define GT_PERSIOM "PERSIOM"
/* defined by cmdy.c */
extern boolean Y3waitFlags;
@@ -48,6 +50,10 @@ void enable_hack_by_gameid(const char *gameid) {
game_id = GAME_RANCE4_ENG;
else if (!strcmp(gameid, "rance4_v2"))
game_id = GAME_RANCE4_V2;
else if (!strcmp(gameid, "agake"))
game_id = GAME_AGAKE;
else if (!strcmp(gameid, "persiom"))
game_id = GAME_PERSIOM;
else
sys_error("Unknown game id \"%s\"", gameid);
}
@@ -69,4 +75,8 @@ void enable_hack_by_title(const char *title_utf8) {
game_id = GAME_RANCE3_ENG;
else if (!strcmp(title_utf8, GT_RANCE4_ENG))
game_id = GAME_RANCE4_ENG;
else if (!strcmp(title_utf8, GT_AGAKE))
game_id = GAME_AGAKE;
else if (!strcmp(title_utf8, GT_PERSIOM))
game_id = GAME_PERSIOM;
}
+2
View File
@@ -29,6 +29,8 @@ enum gameId {
GAME_RANCE3_ENG,
GAME_RANCE4_ENG,
GAME_RANCE4_V2,
GAME_AGAKE,
GAME_PERSIOM,
};
extern enum gameId game_id;
+2 -1
View File
@@ -26,6 +26,7 @@
#include "config.h"
#include "input.h"
#include "sdl_core.h"
#include "scheduler.h"
#include "xsystem35.h"
#include "message.h"
#include "texthook.h"
@@ -109,7 +110,7 @@ int sys_keywait(int msec, unsigned flags) {
sdl_wait_vsync();
nact->callback();
key = sys_getInputInfo();
nact->wait_vsync = FALSE; // We just waited!
cancel_yield(); // We just yielded!
if ((flags & KEYWAIT_CANCELABLE) && key) break;
}
-11
View File
@@ -143,16 +143,6 @@ boolean menu_inputnumber(INPUTNUM_PARAM *p) {
return TRUE;
}
void menu_msgbox_open(char *msg) {
if (!menu_initilized) return;
gtk_label_set_text(GTK_LABEL(menu_label_msgbox), msg);
gtk_widget_show(menu_window_msgbox);
g_idle_add((GSourceFunc)sys_getInputInfo, menu_window_msgbox);
gtk_main();
g_idle_remove_by_data(menu_window_msgbox);
}
void menu_init() {
menu_initilized = TRUE;
menu_window_popup = create_menu1();
@@ -161,7 +151,6 @@ void menu_init() {
menu_window_exit = create_window3();
menu_window_about = create_window4();
menu_window_is2 = create_window5();
menu_window_msgbox= create_window6();
}
void menu_gtkmainiteration() {
-1
View File
@@ -51,7 +51,6 @@ extern void menu_resetmenu_open(void);
extern boolean menu_inputstring(INPUTSTRING_PARAM *);
extern boolean menu_inputstring2(INPUTSTRING_PARAM *);
extern boolean menu_inputnumber(INPUTNUM_PARAM *);
extern void menu_msgbox_open(char *);
extern void menu_widgetinit(void);
extern void menu_init();
extern void menu_gtkmainiteration();
-5
View File
@@ -99,11 +99,6 @@ boolean menu_inputnumber(INPUTNUM_PARAM *p) {
return TRUE;
}
void menu_msgbox_open(char *msg) {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION,
nact->game_title_utf8, msg, NULL);
}
void menu_init(void) {
return;
}
-10
View File
@@ -41,7 +41,6 @@ GtkWidget *menu_label_inputstring_maxchar;
GtkWidget *menu_label_inputnum_max;
GtkWidget *menu_label_inputnum_min;
GtkWidget *menu_label_inputnum_def;
GtkWidget *menu_label_msgbox;
GtkWidget *menu_spinbutton;
GtkWidget *menu_textentry;
GtkWidget *menu_textentry2;
@@ -53,7 +52,6 @@ GtkWidget *menu_window_is; /* input string window */
GtkWidget *menu_window_is2; /* input string window no 2*/
GtkWidget *menu_window_in; /* input number window */
GtkWidget *menu_window_about; /* about xsystem35 window */
GtkWidget *menu_window_msgbox;/* message box window */
void
on_window3_destroy (GObject *object,
@@ -244,11 +242,3 @@ on_entry2_activate (GtkEditable *editable,
gtk_widget_hide(menu_window_is2);
gtk_main_quit();
}
void
on_button16_clicked (GtkButton *button,
gpointer user_data)
{
gtk_widget_hide(menu_window_msgbox);
gtk_main_quit();
}
-6
View File
@@ -36,7 +36,6 @@ extern GtkWidget *menu_label_inputstring_maxchar;
extern GtkWidget *menu_label_inputnum_max;
extern GtkWidget *menu_label_inputnum_min;
extern GtkWidget *menu_label_inputnum_def;
extern GtkWidget *menu_label_msgbox;
extern GtkWidget *menu_spinbutton;
extern GtkWidget *menu_textentry;
extern GtkWidget *menu_textentry2;
@@ -48,7 +47,6 @@ extern GtkWidget *menu_window_is; /* input string window */
extern GtkWidget *menu_window_is2; /* input string window no 2*/
extern GtkWidget *menu_window_in; /* input number window */
extern GtkWidget *menu_window_about; /* about xsystem35 window */
extern GtkWidget *menu_window_msgbox;/* message box window */
void
@@ -126,8 +124,4 @@ on_spinbutton1_activate (GtkEditable *editable,
void
on_entry2_activate (GtkEditable *editable,
gpointer user_data);
void
on_button16_clicked (GtkButton *button,
gpointer user_data);
#endif /* !__MENU_CALLBACK__ */
-4
View File
@@ -63,10 +63,6 @@ boolean menu_inputnumber(INPUTNUM_PARAM *p) {
return TRUE;
}
EM_JS(void, menu_msgbox_open, (char *msg), {
window.alert(UTF8ToString(msg));
});
void menu_init(void) {
return;
}
-41
View File
@@ -606,44 +606,3 @@ create_window5 (void)
return window5;
}
GtkWidget*
create_window6 (void)
{
GtkWidget *window6;
GtkWidget *vbox5;
GtkWidget *label51;
GtkWidget *button16;
window6 = menu_window_msgbox = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_object_set_data(G_OBJECT(window6), "window6", window6);
gtk_window_set_title (GTK_WINDOW (window6), _("MessageBox"));
gtk_window_set_position(GTK_WINDOW (window6), GTK_WIN_POS_MOUSE);
vbox5 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
g_object_ref(vbox5);
g_object_set_data_full(G_OBJECT(window6), "vbox5", vbox5,
(GDestroyNotify)g_object_unref);
gtk_widget_show (vbox5);
gtk_container_add (GTK_CONTAINER (window6), vbox5);
label51 = menu_label_msgbox = gtk_label_new (_("Messge"));
g_object_ref(label51);
g_object_set_data_full(G_OBJECT(window6), "label51", label51,
(GDestroyNotify)g_object_unref);
gtk_widget_show (label51);
gtk_box_pack_start (GTK_BOX (vbox5), label51, FALSE, FALSE, 0);
button16 = gtk_button_new_with_label (_("OK"));
g_object_ref(button16);
g_object_set_data_full(G_OBJECT(window6), "button16", button16,
(GDestroyNotify)g_object_unref);
gtk_widget_show (button16);
gtk_box_pack_start (GTK_BOX (vbox5), button16, FALSE, FALSE, 0);
g_signal_connect(button16, "clicked",
G_CALLBACK(on_button16_clicked),
NULL);
return window6;
}
-1
View File
@@ -30,7 +30,6 @@ GtkWidget* create_window2 (void);
GtkWidget* create_window3 (void);
GtkWidget* create_window4 (void);
GtkWidget* create_window5 (void);
GtkWidget* create_window6 (void);
GtkWidget* create_menu1 (void);
#endif /* !__MENU_GUI__ */
-4
View File
@@ -105,10 +105,6 @@ boolean menu_inputnumber(INPUTNUM_PARAM *p) {
#endif
}
void menu_msgbox_open(char *msg) {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, nact->game_title_utf8, msg, sdl_window);
}
void menu_init(void) {
#ifdef _WIN32
win_menu_init();
+1
View File
@@ -28,6 +28,7 @@ extern int muspcm_init(int audio_buffer_size);
extern int muspcm_exit(void);
extern int muspcm_reset(void);
extern int muspcm_load_no(int slot, int no);
extern int muspcm_load_bgm(int slot, int no);
extern int muspcm_load_mixlr(int slot, int noL, int noR);
extern int muspcm_load_data(int slot, uint8_t *buf, uint32_t len);
extern int muspcm_unload(int slot);
+6 -13
View File
@@ -32,6 +32,7 @@
#include "scenario.h"
#include "xsystem35.h"
#include "sdl_core.h"
#include "scheduler.h"
#include "ags.h"
#include "nact.h"
#include "debugger.h"
@@ -90,7 +91,7 @@ void sys_addMsg(const char *str) {
sel_addElement(msg);
} else {
// 通常のメッセージ
DEBUG_MESSAGE("%s", msg);
TRACE_MESSAGE("%s", msg);
if (nact->is_msg_out) {
msg_putMessage(msg);
}
@@ -107,11 +108,6 @@ void sys_addMsg(const char *str) {
EMSCRIPTEN_KEEPALIVE
void nact_main() {
nact->frame_count = 0;
nact->cmd_count = 0;
nact->wait_vsync = FALSE;
int cnt = 0;
while (!nact->is_quit) {
nact->current_page = sl_getPage();
nact->current_addr = sl_getIndex();
@@ -119,15 +115,12 @@ void nact_main() {
dbg_main(0);
exec_command();
nact->cmd_count++;
scheduler_on_command();
if (++cnt >= 10000 || nact->wait_vsync || nact->popupmenu_opened || dbg_trapped()) {
if (is_yield_requested() || nact->popupmenu_opened || dbg_trapped()) {
nact->callback(); // Async in emscripten
sys_getInputInfo();
sdl_wait_vsync();
nact->frame_count++;
nact->wait_vsync = FALSE;
cnt = 0;
scheduler_yield();
}
}
}
@@ -192,7 +185,7 @@ void nact_reset(void) {
void nact_quit(boolean restart) {
nact->is_quit = TRUE;
nact->restart = restart;
nact->wait_vsync = TRUE;
request_yield();
}
#ifdef __EMSCRIPTEN__
-4
View File
@@ -115,10 +115,6 @@ typedef struct {
/* data file names */
GameResource files;
int frame_count;
int cmd_count;
boolean wait_vsync;
/* start address of the command currently being executed */
int current_page;
+4
View File
@@ -40,6 +40,10 @@ EM_ASYNC_JS(int, muspcm_load_no, (int slot, int no), {
return await xsystem35.audio.pcm_load(slot, no);
});
EM_ASYNC_JS(int, muspcm_load_bgm, (int slot, int no), {
return await xsystem35.audio.pcm_load_bgm(slot, no);
});
EM_ASYNC_JS(int, muspcm_load_data, (int slot, uint8_t *buf, uint32_t len), {
return await xsystem35.audio.pcm_load_data(slot, buf, len);
});
+18 -5
View File
@@ -62,8 +62,8 @@ static mmap_t *wai_map;
* 指定の番号の .WAV|.OGG をロードする。
* @param no: DRIファイル番号
*/
static Mix_Chunk *load_asset(int no) {
dridata *dfile = ald_getdata(DRIFILE_WAVE, no -1);
static Mix_Chunk *load_asset(DRIFILETYPE type, int no) {
dridata *dfile = ald_getdata(type, no -1);
if (dfile == NULL) {
WARNING("DRIFILE_WAVE fail to open %d", no -1);
return NULL;
@@ -99,8 +99,8 @@ static int load_chunk(int slot, Mix_Chunk *chunk) {
* @return : 合成後の Mix_Chunk
*/
static Mix_Chunk *pcm_mixlr(int noL, int noR) {
Mix_Chunk *chunkL = load_asset(noL);
Mix_Chunk *chunkR = load_asset(noR);
Mix_Chunk *chunkL = load_asset(DRIFILE_WAVE, noL);
Mix_Chunk *chunkR = load_asset(DRIFILE_WAVE, noR);
if (chunkL == NULL || chunkR == NULL) {
if (chunkL)
Mix_FreeChunk(chunkL);
@@ -163,7 +163,7 @@ int muspcm_load_no(int slot, int no) {
if ((unsigned)slot >= PCM_SLOTS)
return NG;
Mix_Chunk *chunk = load_asset(no);
Mix_Chunk *chunk = load_asset(DRIFILE_WAVE, no);
if (chunk == NULL) {
return NG;
}
@@ -179,6 +179,19 @@ int muspcm_load_no(int slot, int no) {
return load_chunk(slot, chunk);
}
int muspcm_load_bgm(int slot, int no) {
if ((unsigned)slot >= PCM_SLOTS)
return NG;
Mix_Chunk *chunk = load_asset(DRIFILE_BGM, no);
if (chunk == NULL) {
return NG;
}
prv.vol_pcm_sub[slot] = 0;
return load_chunk(slot, chunk);
}
int muspcm_load_mixlr(int slot, int noL, int noR) {
if ((unsigned)slot >= PCM_SLOTS)
return NG;
+7 -1
View File
@@ -21,6 +21,7 @@
*/
/* $Id: s39ain.c,v 1.9 2003/07/21 23:06:47 chikama Exp $ */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -52,7 +53,12 @@ int s39ain_init(const char *path_to_ain, S39AIN *ain) {
len = ftell(fp);
fseek(fp, 0, SEEK_SET);
buf = malloc(len + 4); /* +4 : VARI/MSGI... 拡張のため */
fread(buf, 1, len, fp);
if (fread(buf, len, 1, fp) != 1) {
WARNING("%s: %s", path_to_ain, strerror(errno));
free(buf);
fclose(fp);
return NG;
}
fclose(fp);
p = buf;
+2 -2
View File
@@ -79,9 +79,9 @@ int s39ini_init(void) {
vol[i] = vval[i].vol = 100;
}
} else {
fread(vol, sizeof(int), MAXVOLCH, fp);
int n = fread(vol, sizeof(int), MAXVOLCH, fp);
fclose(fp);
for (i = 0; i < MAXVOLCH; i++) {
for (i = 0; i < n; i++) {
vval[i].vol = vol[i];
}
}
+6 -2
View File
@@ -280,6 +280,7 @@ static void writeAsdFooter(enum save_format format, FILE *fp) {
あとで free(*buf)するのを忘れないように
*/
static void* loadGameData(int no, int *status, int *size) {
void *buf = NULL;
FILE *fp = fopen(nact->files.save_fname[no], "rb");
if (!fp)
goto errexit;
@@ -288,12 +289,13 @@ static void* loadGameData(int no, int *status, int *size) {
if (filesize == 0)
goto errexit;
char *buf = (char *)malloc(filesize);
buf = malloc(filesize);
if (buf == NULL)
goto errexit;
fseek(fp, 0L, SEEK_SET);
fread(buf, filesize, 1, fp);
if (fread(buf, filesize, 1, fp) != 1)
goto errexit;
fclose(fp);
*size = (int)filesize;
@@ -301,6 +303,8 @@ static void* loadGameData(int no, int *status, int *size) {
return buf;
errexit:
if (buf != NULL)
free(buf);
if (fp != NULL)
fclose(fp);
*status = SAVE_LOADERR;
+1 -1
View File
@@ -201,7 +201,7 @@ boolean sl_jmpFar2(int page, int address) {
dfile = ald_getdata(DRIFILE_SCO, page);
if (dfile == NULL) {
DEBUG_MESSAGE("ald_getdata fail\n");
TRACE_MESSAGE("ald_getdata fail\n");
return FALSE;
}
sl_sco = dfile->data;
+8 -8
View File
@@ -100,16 +100,16 @@ static inline int sl_getIndex(void) { return sl_index; }
static inline int sl_getPage(void) { return sl_page; }
static inline int sl_getc(void) { return sl_sco[sl_index++]; }
#define TRACE_UNIMPLEMENTED(fmt, ...) \
sys_message(2, "[UNIMPLEMENTED] " fmt "\n", ##__VA_ARGS__)
#ifdef DEBUG
#define DEBUG_COMMAND_YET(fmt, ...) \
sys_message(2, "%d,%x: " fmt "\n", sl_getPage(), sl_getIndex(), ##__VA_ARGS__)
#define DEBUG_COMMAND(fmt, ...) \
sys_message(5, "%d,%x: " fmt "\n", sl_getPage(), sl_getIndex(), ##__VA_ARGS__)
#define DEBUG_MESSAGE(...) sys_message(6, __VA_ARGS__)
#define TRACE(fmt, ...) \
sys_message(5, "[TRACE] " fmt "\n", ##__VA_ARGS__)
#define TRACE_MESSAGE(...) sys_message(6, __VA_ARGS__)
#else
#define DEBUG_COMMAND(...)
#define DEBUG_COMMAND_YET(...)
#define DEBUG_MESSAGE(...)
#define TRACE(...)
#define TRACE_MESSAGE(...)
#endif
#endif /* !__SCENARIO_ */

Some files were not shown because too many files have changed in this diff Show More