Initial CALLHLL and Math.dll implementation

HLL libraries are compiled into the executable rather than dynamically
loaded as in early versions of System 4. These days AliceSoft does the
same thing.
This commit is contained in:
Nunuhara Cabbage
2019-11-04 20:35:42 -08:00
parent cb236965d8
commit edffc0ad76
21 changed files with 457 additions and 22 deletions
+12
View File
@@ -0,0 +1,12 @@
SystemSource = {
"HLL\Math.hll", "Math",
}
CopyToRun = {
"SACT_DLL.inc",
}
CopyToDLL = {
"DLL\Math.dll",
}
+50
View File
@@ -0,0 +1,50 @@
////////////////////////////////////////////////////////////
// Math.hll
////////////////////////////////////////////////////////////
// 数学
float Cos(float fDeg); // コサイン(角度)
float Sin(float fDeg); // サイン(角度)
float Sqrt(float fValue); // 平方根
float Atan(float x); // アークタンジェント
float Atan2(float y, float x); // アークタンジェント y/x
int Abs(int nValue); // 絶対値を得る
float AbsF(float fValue); // 絶対値float
float Pow(float fBase, float fExponent); // fBaseのfExponet乗を返します
////////////////////////////////////////////////////////////
// 乱数
void SetSeed(int nSeed); // 乱数の種セット
void SetRandMode(int nMode); // 乱数のモードをセット(0:標準(default) 1:正規分布 2:1/f分布)
int Rand(void); // 0~0x7FFFFFFFの範囲で乱数生成
float RandF(void); // 0~1の範囲で乱数生成
// テーブルを作成して、その中身をシャッフルすることで
// ランダムを取り出す関数、使う前に、SetSeedは必要。
void RandTableInit(int nNum, int nSize); // nSize個のランダムテーブルを作成、0~nSize-1 までの数値が入る
int RandTable(int nNum); // テーブルの数値を取得 nNumはテーブル番号
// ランダムテーブル、VM内の配列を使う版 ※配列の要素数が、そのままテーブルの大きさになります。
// pArrayはテーブル配列を指定(Allocはスクリプトで確保すること)
void RandTable2Init(int nNum, array@int pArray);
// テーブルの数値を取得 nNumはテーブル番号
int RandTable2(int nNum);
////////////////////////////////////////////////////////////
// その他
int Min(int x, int y);
float MinF(float x, float y);
int Max(int x, int y);
float MaxF(float x, float y);
void Swap(intp x, intp y); // 入れ替え
void SwapF(floatp x, floatp y);
+3
View File
@@ -0,0 +1,3 @@
LoadDLL = {
"Math.dll",
}
+18
View File
@@ -0,0 +1,18 @@
Note
----
I am not 100% sure about the legality of distributing System40.exe and related
DLLs here, so I've left them out. They can be found in the System 4 SDK, which
which you'll want to have anyways to compile these tests.
Once you've copied the files, this directory should contain the following:
Etc/DLL/Math.dll (not included)
Etc/HLL/Math.hll
Etc/Etc.inc
Etc/SACT_DLL.inc
System42/DLL/Sys42VM.dll (not included)
System42/System40.exe (not included)
System42/System40.ini
System42/System42.inc
System.inc
+1
View File
@@ -1,3 +1,4 @@
Source = {
"System42\System42.inc",
"Etc\Etc.inc",
}
-12
View File
@@ -1,12 +0,0 @@
Note
----
I am not 100% sure about the legality of distributing System40.exe and
Sys42VM.dll here, so I've left them out. They can be found in the System 4 SDK,
which you'll want to have anyways to compile these tests.
Once you've copied the files, this directory should contain the following:
System40.exe
System40.ini
DLL\Sys42VM.dll
+5
View File
@@ -26,6 +26,11 @@ SaveFolder = "SaveData"
; DLLフォルダ設定
DLL = "DLL"
; DLLファイル設定
LoadDLL = {
"SACT_DLL.inc",
}
; スキップ名設定
MsgSkipName = "既読スキップ"
+1 -1
View File
@@ -1,7 +1,7 @@
CopyToRun = {
"System40.exe",
"System40.ini"
"System40.ini",
}
CopyToDLL = {