Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dolphilia committed Sep 18, 2024
1 parent 2fdcd1d commit d556506
Show file tree
Hide file tree
Showing 3,534 changed files with 1,368,571 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
206 changes: 206 additions & 0 deletions hsp-editor-lite/.idea/workspace.xml

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions hsp3/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

588 changes: 588 additions & 0 deletions hsp3/.idea/editor.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions hsp3/.idea/hsp3.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions hsp3/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions hsp3/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions hsp3/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions hsp3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.0)
project(hsp3)

# ソースファイルの設定
set(SOURCES
hsp3.cpp
hsp3code.cpp
hsp3debug.cpp
hsp3int.cpp
hspvar_core.cpp
hspvar_double.cpp
hspvar_int.cpp
hsp3crypt.cpp
hsp3utfcnv.cpp
filepack.cpp
hspvar_label.cpp
hspvar_str.cpp
hspvar_struct.cpp
stack.cpp
strbuf.cpp
strnote.cpp
dpmread.cpp
linux/main.cpp
linux/supio_linux.cpp
linux/hsp3cl.cpp
linux/hsp3ext_linux.cpp
linux/hsp3gr_linux.cpp
linux/hsp3ext_sock.cpp
)

# 実行ファイルの生成
add_executable(hsp3 ${SOURCES})

# コンパイル定義の設定
target_compile_definitions(hsp3 PRIVATE HSPLINUX $<$<CONFIG:Debug>:HSPDEBUG>)
target_compile_options(hsp3 PRIVATE -UDEVCTRL_IO)

# コンパイルオプションの設定
#target_compile_options(hsp3 PRIVATE -Wall --input-charset=utf-8 --exec-charset=cp932)

# リンクオプションの設定(リリースビルドで-stripオプションを追加)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.13")
target_link_options(hsp3 PRIVATE $<$<CONFIG:Release>:-s>)
else()
set_target_properties(hsp3 PROPERTIES LINK_FLAGS "$<$<CONFIG:Release>:-s>")
endif()

# リンクライブラリの設定
target_link_libraries(hsp3 m stdc++)
115 changes: 115 additions & 0 deletions hsp3/call_extfunc64.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
; 64-bit 'CallFunc'
;
; LICENCE: Public domain

OPTION CASEMAP: NONE

PUBLIC CallFunc64

.CODE

; [CallFunc64]
;
; The 'CallFunc64' function calls the sppecified function with the specified array as arguments.
;
; [Syntax]
;
; INT_PTR CallFunc64(INT_PTR const *arguments, FARPROC external_function, int number_Of_arguments);
; INT32 CallFunc64(INT_PTR const *arguments, FARPROC external_function, int number_Of_arguments);
; double CallFunc64(INT_PTR const *arguments, FARPROC external_function, int number_of_arguments);
;
; [Parameters]
;
; INT_PTR const *arguments [in, optional]
; Points to the array used as arguments to the function of 'externalFunction'. If 'numberOfArguments' is set to a negative value or zero, the function makes no use of the parameter.
;
; FARPROC external_function [in]
; Points to the function to call with the array of 'arguments' as arguments.
;
; int number_of_arguments [in]
; Represents the number of elements in the array of 'arguments'.
;
; [Return value]
;
; The return value is directly from the function of 'externalFunction'.
;
; [Remarks]
;
; If 'numberOfParameters' is set to a negative value, the behavior is the same as when the parameter is set to zero; the function of 'externalFunction' is then assumed not to receive any parameter.
; The behavior is undefined if the array of 'arguments' is not proper as arguments for the function of 'externalFunction'.

CallFunc64 PROC FRAME

mov rax, rdx ; Save the value of 'external_function' to rax

; Directly go to the function of 'external_function' if it does not receive any parameter

mov edx, r8d
test edx, edx
jg short @has_args

jmp rax

@has_args:

push rbp
.PUSHREG rbp

mov rbp, rsp
.SETFRAME rbp, 0

.ENDPROLOG

sal edx, 3 ; edx = number_of_arguments * sizeof(INT_PTR)

; Align the stack to 16 bytes and allocate at least 32 bytes

sub edx, 8 * 4
@if00:
jge short @else00

neg edx
jmp short @end_if00

@else00:

and edx, 8

@end_if00:

sub rsp, rdx

; Prepare arguments

@do00:

dec r8d
push qword ptr [rcx + r8 * 8]

jg @do00

@until00:

pop rcx
pop rdx
pop r8
pop r9

movd xmm0, rcx
movd xmm1, rdx
movd xmm2, r8
movd xmm3, r9

; cmp rsp, rbp

; Call the function of 'external_function'

sub rsp, 8 * 4
call rax

leave
ret

CallFunc64 ENDP

END
Empty file.
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit d556506

Please sign in to comment.