mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-02 03:48:00 +03:00
Two changes from Pastel Chime 3 (likely to make the executables incompatible): - SystemService.XXX function - PartsEngine.Update() has two dummy string parameters
260 lines
13 KiB
C
260 lines
13 KiB
C
/* Copyright (C) 2023 Nunuhara Cabbage <nunuhara@haniwa.technology>
|
|
*
|
|
* 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, see <http://gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <assert.h>
|
|
|
|
#include "system4/ain.h"
|
|
|
|
#include "parts.h"
|
|
#include "hll.h"
|
|
|
|
static void PartsEngine_ModuleInit(void)
|
|
{
|
|
PE_Init();
|
|
}
|
|
|
|
static void PartsEngine_ModuleFini(void)
|
|
{
|
|
PE_Reset();
|
|
}
|
|
|
|
static void PartsEngine_Update(int passed_time, bool is_skip, bool message_window_show)
|
|
{
|
|
PE_Update(passed_time, message_window_show);
|
|
}
|
|
|
|
static void PartsEngine_Update_Pascha3PC(struct string *xxx1, struct string *xxx2, int passed_time, bool is_skip, bool message_window_show)
|
|
{
|
|
PE_Update(passed_time, message_window_show);
|
|
}
|
|
|
|
// Oyako Rankan
|
|
static bool PartsEngine_AddDrawCutCGToPartsConstructionProcess_old(int parts_no,
|
|
struct string *cg_name, int dx, int dy, int sx, int sy, int w, int h,
|
|
int state)
|
|
{
|
|
return PE_AddDrawCutCGToPartsConstructionProcess(parts_no, cg_name, dx, dy, w, h,
|
|
sx, sy, w, h, 0, state);
|
|
}
|
|
|
|
// Oyako Rankan
|
|
static bool PartsEngine_AddCopyCutCGToPartsConstructionProcess_old(int parts_no,
|
|
struct string *cg_name, int dx, int dy, int sx, int sy, int w, int h,
|
|
int state)
|
|
{
|
|
return PE_AddCopyCutCGToPartsConstructionProcess(parts_no, cg_name, dx, dy, w, h,
|
|
sx, sy, w, h, 0, state);
|
|
}
|
|
|
|
static void PartsEngine_PreLink(void);
|
|
|
|
HLL_LIBRARY(PartsEngine,
|
|
HLL_EXPORT(_PreLink, PartsEngine_PreLink),
|
|
// for versions without PartsEngine.Init
|
|
HLL_EXPORT(_ModuleInit, PartsEngine_ModuleInit),
|
|
HLL_EXPORT(_ModuleFini, PartsEngine_ModuleFini),
|
|
// Oyako Rankan
|
|
HLL_EXPORT(Init, PE_Init),
|
|
HLL_EXPORT(Update, PartsEngine_Update),
|
|
HLL_TODO_EXPORT(UpdateGUIController, PartsEngine_UpdateGUIController),
|
|
HLL_EXPORT(GetFreeSystemPartsNumber, PE_GetFreeNumber),
|
|
// FIXME: what is the difference?
|
|
HLL_EXPORT(GetFreeSystemPartsNumberNotSaved, PE_GetFreeNumber),
|
|
HLL_EXPORT(IsExistParts, PE_IsExist),
|
|
HLL_EXPORT(SetPartsCG, PE_SetPartsCG),
|
|
HLL_EXPORT(GetPartsCGName, PE_GetPartsCGName),
|
|
HLL_EXPORT(SetPartsCGSurfaceArea, PE_SetPartsCGSurfaceArea),
|
|
HLL_EXPORT(SetLoopCG, PE_SetLoopCG),
|
|
HLL_EXPORT(SetLoopCGSurfaceArea, PE_SetLoopCGSurfaceArea),
|
|
HLL_EXPORT(SetText, PE_SetText),
|
|
HLL_EXPORT(AddPartsText, PE_AddPartsText),
|
|
HLL_TODO_EXPORT(DeletePartsTopTextLine, PartsEngine_DeletePartsTopTextLine),
|
|
HLL_EXPORT(SetPartsTextSurfaceArea, PE_SetPartsTextSurfaceArea),
|
|
HLL_TODO_EXPORT(SetPartsTextHighlight, PartsEngine_SetPartsTextHighlight),
|
|
HLL_TODO_EXPORT(AddPartsTextHighlight, PartsEngine_AddPartsTextHighlight),
|
|
HLL_TODO_EXPORT(ClearPartsTextHighlight, PartsEngine_ClearPartsTextHighlight),
|
|
HLL_TODO_EXPORT(SetPartsTextCountReturn, PartsEngine_SetPartsTextCountReturn),
|
|
HLL_TODO_EXPORT(GetPartsTextCountReturn, PartsEngine_GetPartsTextCountReturn),
|
|
HLL_EXPORT(SetFont, PE_SetFont),
|
|
HLL_EXPORT(SetPartsFontType, PE_SetPartsFontType),
|
|
HLL_EXPORT(SetPartsFontSize, PE_SetPartsFontSize),
|
|
HLL_EXPORT(SetPartsFontColor, PE_SetPartsFontColor),
|
|
HLL_EXPORT(SetPartsFontBoldWeight, PE_SetPartsFontBoldWeight),
|
|
HLL_EXPORT(SetPartsFontEdgeColor, PE_SetPartsFontEdgeColor),
|
|
HLL_EXPORT(SetPartsFontEdgeWeight, PE_SetPartsFontEdgeWeight),
|
|
HLL_EXPORT(SetTextCharSpace, PE_SetTextCharSpace),
|
|
HLL_EXPORT(SetTextLineSpace, PE_SetTextLineSpace),
|
|
HLL_EXPORT(SetHGaugeCG, PE_SetHGaugeCG),
|
|
HLL_EXPORT(SetHGaugeRate, PE_SetHGaugeRate_int),
|
|
HLL_EXPORT(SetVGaugeCG, PE_SetVGaugeCG),
|
|
HLL_EXPORT(SetVGaugeRate, PE_SetVGaugeRate_int),
|
|
HLL_EXPORT(SetHGaugeSurfaceArea, PE_SetHGaugeSurfaceArea),
|
|
HLL_EXPORT(SetVGaugeSurfaceArea, PE_SetVGaugeSurfaceArea),
|
|
HLL_EXPORT(SetNumeralCG, PE_SetNumeralCG),
|
|
HLL_EXPORT(SetNumeralLinkedCGNumberWidthWidthList, PE_SetNumeralLinkedCGNumberWidthWidthList),
|
|
HLL_TODO_EXPORT(SetNumeralFont, PartsEngine_SetNumeralFont),
|
|
HLL_EXPORT(SetNumeralNumber, PE_SetNumeralNumber),
|
|
HLL_EXPORT(SetNumeralShowComma, PE_SetNumeralShowComma),
|
|
HLL_EXPORT(SetNumeralSpace, PE_SetNumeralSpace),
|
|
HLL_EXPORT(SetNumeralLength, PE_SetNumeralLength),
|
|
HLL_EXPORT(SetNumeralSurfaceArea, PE_SetNumeralSurfaceArea),
|
|
HLL_EXPORT(SetPartsRectangleDetectionSize, PE_SetPartsRectangleDetectionSize),
|
|
HLL_TODO_EXPORT(SetPartsRectangleDetectionSurfaceArea, PartsEngine_SetPartsRectangleDetectionSurfaceArea),
|
|
HLL_EXPORT(SetPartsCGDetectionSize, PE_SetPartsCGDetectionSize),
|
|
HLL_TODO_EXPORT(SetPartsCGDetectionSurfaceArea, PartsEngine_SetPartsCGDetectionSurfaceArea),
|
|
HLL_EXPORT(SetPartsFlash, PE_SetPartsFlash),
|
|
HLL_EXPORT(IsPartsFlashEnd, PE_IsPartsFlashEnd),
|
|
HLL_EXPORT(GetPartsFlashCurrentFrameNumber, PE_GetPartsFlashCurrentFrameNumber),
|
|
HLL_EXPORT(BackPartsFlashBeginFrame, PE_BackPartsFlashBeginFrame),
|
|
HLL_EXPORT(StepPartsFlashFinalFrame, PE_StepPartsFlashFinalFrame),
|
|
HLL_TODO_EXPORT(SetPartsFlashSurfaceArea, PE_SetPartsFlashSurfaceArea),
|
|
HLL_EXPORT(SetPartsFlashAndStop, PE_SetPartsFlashAndStop),
|
|
HLL_EXPORT(StopPartsFlash, PE_StopPartsFlash),
|
|
HLL_EXPORT(StartPartsFlash, PE_StartPartsFlash),
|
|
HLL_EXPORT(GoFramePartsFlash, PE_GoFramePartsFlash),
|
|
HLL_EXPORT(GetPartsFlashEndFrame, PE_GetPartsFlashEndFrame),
|
|
HLL_EXPORT(ExistsFlashFile, PE_ExistsFlashFile),
|
|
HLL_EXPORT(ClearPartsConstructionProcess, PE_ClearPartsConstructionProcess),
|
|
HLL_EXPORT(AddCreateToPartsConstructionProcess, PE_AddCreateToPartsConstructionProcess),
|
|
HLL_EXPORT(AddCreatePixelOnlyToPartsConstructionProcess, PE_AddCreatePixelOnlyToPartsConstructionProcess),
|
|
HLL_EXPORT(AddCreateCGToProcess, PE_AddCreateCGToProcess),
|
|
HLL_EXPORT(AddFillToPartsConstructionProcess, PE_AddFillToPartsConstructionProcess),
|
|
HLL_EXPORT(AddFillAlphaColorToPartsConstructionProcess, PE_AddFillAlphaColorToPartsConstructionProcess),
|
|
HLL_EXPORT(AddFillAMapToPartsConstructionProcess, PE_AddFillAMapToPartsConstructionProcess),
|
|
HLL_TODO_EXPORT(AddFillWithAlphaToPartsConstructionProcess, PartsEngine_AddFillWithAlphaToPartsConstructionProcess),
|
|
HLL_TODO_EXPORT(AddFillGradationHorizonToPartsConstructionProcess, PartsEngine_AddFillGradationHorizonToPartsConstructionProcess),
|
|
HLL_EXPORT(AddDrawRectToPartsConstructionProcess, PE_AddDrawRectToPartsConstructionProcess),
|
|
HLL_EXPORT(AddDrawCutCGToPartsConstructionProcess, PartsEngine_AddDrawCutCGToPartsConstructionProcess_old),
|
|
HLL_EXPORT(AddCopyCutCGToPartsConstructionProcess, PartsEngine_AddCopyCutCGToPartsConstructionProcess_old),
|
|
HLL_EXPORT(AddGrayFilterToPartsConstructionProcess, PE_AddGrayFilterToPartsConstructionProcess),
|
|
HLL_TODO_EXPORT(AddAddFilterToPartsConstructionProcess, PartsEngine_AddAddFilterToPartsConstructionProcess),
|
|
HLL_TODO_EXPORT(AddMulFilterToPartsConstructionProcess, PartsEngine_AddMulFilterToPartsConstructionProcess),
|
|
HLL_EXPORT(BuildPartsConstructionProcess, PE_BuildPartsConstructionProcess),
|
|
HLL_EXPORT(AddDrawTextToPartsConstructionProcess, PE_AddDrawTextToPartsConstructionProcess),
|
|
HLL_EXPORT(AddCopyTextToPartsConstructionProcess, PE_AddCopyTextToPartsConstructionProcess),
|
|
HLL_EXPORT(SetPartsConstructionSurfaceArea, PE_SetPartsConstructionSurfaceArea),
|
|
HLL_EXPORT(ReleaseParts, PE_ReleaseParts),
|
|
HLL_EXPORT(ReleaseAllParts, PE_ReleaseAllParts),
|
|
HLL_EXPORT(ReleaseAllPartsWithoutSystem, PE_ReleaseAllPartsWithoutSystem),
|
|
HLL_EXPORT(SetPos, PE_SetPos),
|
|
HLL_EXPORT(SetZ, PE_SetZ),
|
|
HLL_EXPORT(SetShow, PE_SetShow),
|
|
HLL_EXPORT(SetAlpha, PE_SetAlpha),
|
|
HLL_EXPORT(SetPartsDrawFilter, PE_SetPartsDrawFilter),
|
|
HLL_EXPORT(SetAddColor, PE_SetAddColor),
|
|
HLL_EXPORT(SetMultiplyColor, PE_SetMultiplyColor),
|
|
HLL_EXPORT(SetClickable, PE_SetClickable),
|
|
HLL_EXPORT(SetSpeedupRateByMessageSkip, PE_SetSpeedupRateByMessageSkip),
|
|
HLL_TODO_EXPORT(SetResetTimerByChangeInputStatus, PartsEngine_SetResetTimerByChangeInputStatus),
|
|
HLL_EXPORT(GetPartsX, PE_GetPartsX),
|
|
HLL_EXPORT(GetPartsY, PE_GetPartsY),
|
|
HLL_EXPORT(GetPartsZ, PE_GetPartsZ),
|
|
HLL_EXPORT(GetPartsShow, PE_GetPartsShow),
|
|
HLL_EXPORT(GetPartsAlpha, PE_GetPartsAlpha),
|
|
HLL_TODO_EXPORT(GetAddColor, PartsEngine_GetAddColor),
|
|
HLL_TODO_EXPORT(GetMultiplyColor, PartsEngine_GetMultiplyColor),
|
|
HLL_EXPORT(GetPartsClickable, PE_GetPartsClickable),
|
|
HLL_TODO_EXPORT(GetPartsSpeedupRateByMessageSkip, PartsEngine_GetPartsSpeedupRateByMessageSkip),
|
|
HLL_TODO_EXPORT(GetResetTimerByChangeInputStatus, PartsEngine_GetResetTimerByChangeInputStatus),
|
|
HLL_EXPORT(GetPartsUpperLeftPosX, PE_GetPartsUpperLeftPosX),
|
|
HLL_EXPORT(GetPartsUpperLeftPosY, PE_GetPartsUpperLeftPosY),
|
|
HLL_EXPORT(GetPartsWidth, PE_GetPartsWidth),
|
|
HLL_EXPORT(GetPartsHeight, PE_GetPartsHeight),
|
|
HLL_EXPORT(SetInputState, PE_SetInputState),
|
|
HLL_EXPORT(GetInputState, PE_GetInputState),
|
|
HLL_EXPORT(SetPartsOriginPosMode, PE_SetPartsOriginPosMode),
|
|
HLL_EXPORT(GetPartsOriginPosMode, PE_GetPartsOriginPosMode),
|
|
HLL_EXPORT(SetParentPartsNumber, PE_SetParentPartsNumber),
|
|
HLL_EXPORT(SetPartsGroupNumber, PE_SetPartsGroupNumber),
|
|
HLL_EXPORT(SetPartsGroupDecideOnCursor, PE_SetPartsGroupDecideOnCursor),
|
|
HLL_EXPORT(SetPartsGroupDecideClick, PE_SetPartsGroupDecideClick),
|
|
HLL_EXPORT(SetOnCursorShowLinkPartsNumber, PE_SetOnCursorShowLinkPartsNumber),
|
|
HLL_EXPORT(SetPartsMessageWindowShowLink, PE_SetPartsMessageWindowShowLink),
|
|
HLL_EXPORT(GetPartsMessageWindowShowLink, PE_GetPartsMessageWindowShowLink),
|
|
HLL_EXPORT(AddMotionPos, PE_AddMotionPos_curve),
|
|
HLL_EXPORT(AddMotionAlpha, PE_AddMotionAlpha_curve),
|
|
HLL_TODO_EXPORT(AddMotionCG, PartsEngine_AddMotionCG),
|
|
HLL_EXPORT(AddMotionHGaugeRate, PE_AddMotionHGaugeRate_curve),
|
|
HLL_EXPORT(AddMotionVGaugeRate, PE_AddMotionVGaugeRate_curve),
|
|
HLL_EXPORT(AddMotionNumeralNumber, PE_AddMotionNumeralNumber_curve),
|
|
HLL_EXPORT(AddMotionMagX, PE_AddMotionMagX_curve),
|
|
HLL_EXPORT(AddMotionMagY, PE_AddMotionMagY_curve),
|
|
HLL_EXPORT(AddMotionRotateX, PE_AddMotionRotateX_curve),
|
|
HLL_EXPORT(AddMotionRotateY, PE_AddMotionRotateY_curve),
|
|
HLL_EXPORT(AddMotionRotateZ, PE_AddMotionRotateZ_curve),
|
|
HLL_EXPORT(AddMotionVibrationSize, PE_AddMotionVibrationSize),
|
|
HLL_EXPORT(AddWholeMotionVibrationSize, PE_AddWholeMotionVibrationSize),
|
|
HLL_EXPORT(AddMotionSound, PE_AddMotionSound),
|
|
HLL_TODO_EXPORT(SetSoundNumber, PartsEngine_SetSoundNumber),
|
|
HLL_TODO_EXPORT(GetSoundNumber, PartsEngine_GetSoundNumber),
|
|
HLL_EXPORT(SetClickMissSoundNumber, PE_SetClickMissSoundNumber),
|
|
HLL_TODO_EXPORT(GetClickMissSoundNumber, PartsEngine_GetClickMissSoundNumber),
|
|
HLL_EXPORT(BeginMotion, PE_BeginMotion),
|
|
HLL_EXPORT(EndMotion, PE_EndMotion),
|
|
HLL_EXPORT(IsMotion, PE_IsMotion),
|
|
HLL_EXPORT(SeekEndMotion, PE_SeekEndMotion),
|
|
HLL_EXPORT(UpdateMotionTime, PE_UpdateMotionTime),
|
|
HLL_EXPORT(BeginInput, PE_BeginInput),
|
|
HLL_EXPORT(EndInput, PE_EndInput),
|
|
HLL_EXPORT(GetClickPartsNumber, PE_GetClickPartsNumber),
|
|
HLL_TODO_EXPORT(GetFocusPartsNumber, PartsEngine_GetFocusPartsNumber),
|
|
HLL_TODO_EXPORT(SetFocusPartsNumber, PartsEngine_SetFocusPartsNumber),
|
|
HLL_TODO_EXPORT(PushGUIController, PartsEngine_PushGUIController),
|
|
HLL_TODO_EXPORT(PopGUIController, PartsEngine_PopGUIController),
|
|
HLL_EXPORT(SetPartsMagX, PE_SetPartsMagX),
|
|
HLL_EXPORT(SetPartsMagY, PE_SetPartsMagY),
|
|
HLL_EXPORT(SetPartsRotateX, PE_SetPartsRotateX),
|
|
HLL_EXPORT(SetPartsRotateY, PE_SetPartsRotateY),
|
|
HLL_EXPORT(SetPartsRotateZ, PE_SetPartsRotateZ),
|
|
HLL_EXPORT(SetPartsAlphaClipperPartsNumber, PE_SetPartsAlphaClipperPartsNumber),
|
|
HLL_EXPORT(SetPartsPixelDecide, PE_SetPartsPixelDecide),
|
|
HLL_EXPORT(IsCursorIn, PE_IsCursorIn),
|
|
HLL_EXPORT(SetThumbnailReductionSize, PE_SetThumbnailReductionSize),
|
|
HLL_EXPORT(SetThumbnailMode, PE_SetThumbnailMode),
|
|
HLL_EXPORT(Save, PE_Save),
|
|
HLL_EXPORT(SaveWithoutHideParts, PE_SaveWithoutHideParts),
|
|
HLL_EXPORT(Load, PE_Load)
|
|
);
|
|
|
|
static struct ain_hll_function *get_fun(int libno, const char *name)
|
|
{
|
|
int fno = ain_get_library_function(ain, libno, name);
|
|
return fno >= 0 ? &ain->libraries[libno].functions[fno] : NULL;
|
|
}
|
|
|
|
static void PartsEngine_PreLink(void)
|
|
{
|
|
struct ain_hll_function *fun;
|
|
int libno = ain_get_library(ain, "PartsEngine");
|
|
assert(libno >= 0);
|
|
|
|
fun = get_fun(libno, "AddDrawCutCGToPartsConstructionProcess");
|
|
if (fun && fun->nr_arguments == 12) {
|
|
static_library_replace(&lib_PartsEngine, "AddDrawCutCGToPartsConstructionProcess",
|
|
PE_AddDrawCutCGToPartsConstructionProcess);
|
|
}
|
|
fun = get_fun(libno, "AddCopyCutCGToPartsConstructionProcess");
|
|
if (fun && fun->nr_arguments == 12) {
|
|
static_library_replace(&lib_PartsEngine, "AddCopyCutCGToPartsConstructionProcess",
|
|
PE_AddCopyCutCGToPartsConstructionProcess);
|
|
}
|
|
fun = get_fun(libno, "Update");
|
|
if (fun && fun->nr_arguments == 5) {
|
|
static_library_replace(&lib_PartsEngine, "Update",
|
|
PartsEngine_Update_Pascha3PC);
|
|
}
|
|
}
|