Merge pull request #307 from kichikuou/pascha3

Miscellaneous changes for Pastel Chime 3
This commit is contained in:
Nunuhara Cabbage
2026-03-07 07:46:04 -08:00
committed by GitHub
14 changed files with 51 additions and 9 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ issues, please let me know or open a pull request to update this table.
| ランス・クエスト | Supported | |
| ランス・クエスト マグナム | Supported | |
| 母娘乱館 | Unknown | |
| パステルチャイム3 バインドシーカー | Unsupported | |
| パステルチャイム3 バインドシーカー | Supported | |
| どらぺこ! ~おねだりドラゴンとおっぱい勇者~ | Unsupported | |
| ランス01 光をもとめて | Supported | |
| Rance 01 - Quest for Hikari (EN) | Supported | |
+2
View File
@@ -78,6 +78,8 @@ int wav_get_volume(int id);
int bgm_get_volume(int id);
int wav_get_time_length(int id);
int bgm_get_time_length(int id);
int wav_get_data_length(int no);
int bgm_get_data_length(int no);
int wav_get_group_num(int id);
//int bgm_get_group_num(int id);
int wav_prepare_from_file(int id, char *filename);
+2
View File
@@ -118,6 +118,8 @@ bool sact_DX_GetUsePower2Texture(void);
void sact_DX_SetUsePower2Texture(bool use);
extern struct text_style text_sprite_ts;
int StoatSpriteEngine_SP_SetDrawMethod(int sp_no, int method);
int StoatSpriteEngine_SP_GetDrawMethod(int sp_no);
bool StoatSpriteEngine_SP_SetTextSprite(int sp_no, struct string *text);
void StoatSpriteEngine_SP_SetTextSpriteType(int type);
void StoatSpriteEngine_SP_SetTextSpriteSize(int size);
+12
View File
@@ -361,6 +361,18 @@ static int audio_get_time_length(struct id_pool *pool, int id)
int wav_get_time_length(int id) { return audio_get_time_length(&wav, id); }
int bgm_get_time_length(int id) { return audio_get_time_length(&bgm, id); }
static int audio_get_data_length(enum asset_type type, int no) {
struct channel *ch = channel_open(type, no);
if (!ch)
return 0;
int len = channel_get_time_length(ch);
channel_close(ch);
return len;
}
int wav_get_data_length(int no) { return audio_get_data_length(ASSET_SOUND, no); }
int bgm_get_data_length(int no) { return audio_get_data_length(ASSET_BGM, no); }
static int audio_get_data_no(struct id_pool *pool, int id)
{
struct channel *ch = id_pool_get(pool, id);
+2 -2
View File
@@ -314,7 +314,7 @@ HLL_LIBRARY(ChipmunkSpriteEngine,
HLL_EXPORT(SP_SetMultipleColor, ChipmunkSpriteEngine_SP_SetMultipleColor),
HLL_EXPORT(SP_SetAddColor, ChipmunkSpriteEngine_SP_SetAddColor),
HLL_EXPORT(SP_SetShow, sact_SP_SetShow),
HLL_EXPORT(SP_SetDrawMethod, sact_SP_SetDrawMethod),
HLL_EXPORT(SP_SetDrawMethod, StoatSpriteEngine_SP_SetDrawMethod),
HLL_EXPORT(SP_SetSurfaceArea, ChipmunkSpriteEngine_SP_SetSurfaceArea),
HLL_EXPORT(SP_GetSurfaceArea, ChipmunkSpriteEngine_SP_GetSurfaceArea),
HLL_EXPORT(SP_SetSpriteTransformMode, ChipmunkSpriteEngine_SP_SetSpriteTransformMode),
@@ -330,7 +330,7 @@ HLL_LIBRARY(ChipmunkSpriteEngine,
HLL_EXPORT(SP_GetZ, sact_SP_GetZ),
HLL_EXPORT(SP_GetBlendRate, sact_SP_GetBlendRate),
HLL_EXPORT(SP_GetShow, sact_SP_GetShow),
HLL_EXPORT(SP_GetDrawMethod, sact_SP_GetDrawMethod),
HLL_EXPORT(SP_GetDrawMethod, StoatSpriteEngine_SP_GetDrawMethod),
HLL_EXPORT(SP_RenderView, ChipmunkSpriteEngine_SP_RenderView),
HLL_EXPORT(SP_IsPtIn, sact_SP_IsPtIn),
HLL_EXPORT(SP_IsPtInRect, sact_SP_IsPtInRect),
+1 -2
View File
@@ -23,7 +23,6 @@ HLL_WARN_UNIMPLEMENTED( , void, KiwiSoundEngine, SetGlobalFocus, possibly_unused
//int KiwiSoundEngine_Sound_GetGroupNum(int nCh);
//static bool KiwiSoundEngine_Sound_PrepareFromFile(int ch, struct string *filename);
//static int KiwiSoundEngine_Sound_GetDataLength(int data_number);
static int KiwiSoundEngine_GetMasterGroup(void)
{
@@ -93,7 +92,7 @@ HLL_LIBRARY(KiwiSoundEngine,
HLL_TODO_EXPORT(Sound_GetGroupNum, KiwiSoundEngine_Sound_GetGroupNum),
HLL_EXPORT(Sound_GetGroupNumFromDataNum, wav_get_group_num_from_data_num),
HLL_TODO_EXPORT(Sound_PrepareFromFile, KiwiSoundEngine_Sound_PrepareFromFile),
HLL_TODO_EXPORT(Sound_GetDataLength, KiwiSoundEngine_Sound_GetDataLength),
HLL_EXPORT(Sound_GetDataLength, wav_get_data_length),
HLL_EXPORT(GetMasterGroup, KiwiSoundEngine_GetMasterGroup),
HLL_EXPORT(GetBGMGroup, KiwiSoundEngine_GetBGMGroup),
HLL_EXPORT(GetSEGroup, KiwiSoundEngine_GetSEGroup),
+2 -2
View File
@@ -45,7 +45,7 @@ HLL_WARN_UNIMPLEMENTED( , void, StoatSpriteEngine, SetVolumeMixerMasterGroupNum,
HLL_WARN_UNIMPLEMENTED( , void, StoatSpriteEngine, SetVolumeMixerSEGroupNum, int n);
HLL_WARN_UNIMPLEMENTED( , void, StoatSpriteEngine, SetVolumeMixerBGMGroupNum, int n);
static int StoatSpriteEngine_SP_SetDrawMethod(int sp_no, int method)
int StoatSpriteEngine_SP_SetDrawMethod(int sp_no, int method)
{
struct sact_sprite *sp = sact_get_sprite(sp_no);
if (!sp) return 0;
@@ -59,7 +59,7 @@ static int StoatSpriteEngine_SP_SetDrawMethod(int sp_no, int method)
}
}
static int StoatSpriteEngine_SP_GetDrawMethod(int sp_no)
int StoatSpriteEngine_SP_GetDrawMethod(int sp_no)
{
struct sact_sprite *sp = sact_try_get_sprite(sp_no);
if (!sp) return DRAW_METHOD_NORMAL;
+1 -1
View File
@@ -292,7 +292,7 @@ struct page *alloc_array(int rank, union vm_value *dimensions, enum ain_data_typ
data_type = unref_array_type(data_type);
enum ain_data_type type = array_type(data_type);
struct page *page = alloc_page(ARRAY_PAGE, data_type, dimensions->i);
struct page *page = alloc_page(ARRAY_PAGE, data_type, max(0, dimensions->i));
page->array.struct_type = struct_type;
page->array.rank = rank;
+7 -1
View File
@@ -559,7 +559,13 @@ static void system_call(enum syscall_code code)
case SYS_EXISTS_FILE: { // system.ExistsFile(string szFileName)
int str = stack_pop().i;
char *path = gamedir_path(heap_get_string(str)->text);
stack_push(file_exists(path));
int len = strlen(path);
// Return true for directories, but false if the path ends with a directory separator.
if (len > 0 && (path[len-1] == '/' || path[len-1] == '\\')) {
stack_push(0);
} else {
stack_push(file_exists(path));
}
heap_unref(str);
free(path);
break;
BIN
View File
Binary file not shown.
+8
View File
@@ -292,6 +292,13 @@ void test_array_push_struct_with_ref(void)
// Returning from this function should not double-free i.
}
void test_array_alloc_neg(void)
{
array@int ar;
ar.Alloc(-4);
test_bool("ar.Alloc(-4); ar.Empty()", ar.Empty(), true);
}
void test_arrays(void)
{
test_array_set();
@@ -312,4 +319,5 @@ void test_arrays(void)
test_array_sort_custom_string();
test_array_constructors();
test_array_push_struct_with_ref();
test_array_alloc_neg();
}
+4
View File
@@ -84,6 +84,10 @@ int main(void)
test_arrays();
test_end("arrays");
test_start("system");
test_system();
test_end("system");
test_start("Math.dll");
test_math();
test_end("Math.dll");
+8
View File
@@ -0,0 +1,8 @@
// -*-mode: C; coding: sjis; -*-
void test_system(void)
{
string savedir = system.GetSaveFolderName();
test_equal("system.ExistFile(savedir) == 1", system.ExistFile(savedir), 1);
test_equal("system.ExistFile(savedir + \"\\\\\") == 1", system.ExistFile(savedir + "\\"), 0);
}
+1
View File
@@ -4,6 +4,7 @@ Source = {
"arithmetic.jaf",
"strings.jaf",
"structs.jaf",
"system.jaf",
"arrays.jaf",
"math.jaf"
}