Edits to sfall_ver_* script functions

* they take no arguments and only return constants, simpler structure
in ASM is enough.
This commit is contained in:
NovaRain
2022-12-26 08:43:40 +08:00
parent 33e6cb0cb8
commit 48e2a63cdf
4 changed files with 23 additions and 14 deletions
+2 -2
View File
@@ -233,7 +233,7 @@ GEM
jekyll-seo-tag (~> 2.1)
minitest (5.15.0)
multipart-post (2.1.1)
nokogiri (1.13.9)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
octokit (4.22.0)
@@ -242,7 +242,7 @@ GEM
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
racc (1.6.0)
racc (1.6.1)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
+15 -6
View File
@@ -216,16 +216,25 @@ void mf_remove_timer_event(OpcodeContext& ctx) {
}
}
void op_sfall_ver_major(OpcodeContext& ctx) {
ctx.setReturn(VERSION_MAJOR);
void __declspec(naked) op_sfall_ver_major() {
__asm {
mov edx, VERSION_MAJOR;
_J_RET_VAL_TYPE(VAR_TYPE_INT);
}
}
void op_sfall_ver_minor(OpcodeContext& ctx) {
ctx.setReturn(VERSION_MINOR);
void __declspec(naked) op_sfall_ver_minor() {
__asm {
mov edx, VERSION_MINOR;
_J_RET_VAL_TYPE(VAR_TYPE_INT);
}
}
void op_sfall_ver_build(OpcodeContext& ctx) {
ctx.setReturn(VERSION_BUILD);
void __declspec(naked) op_sfall_ver_build() {
__asm {
mov edx, VERSION_BUILD;
_J_RET_VAL_TYPE(VAR_TYPE_INT);
}
}
}
+3 -3
View File
@@ -64,11 +64,11 @@ void mf_add_g_timer_event(OpcodeContext&);
void mf_remove_timer_event(OpcodeContext&);
void op_sfall_ver_major(OpcodeContext&);
void __declspec() op_sfall_ver_major();
void op_sfall_ver_minor(OpcodeContext&);
void __declspec() op_sfall_ver_minor();
void op_sfall_ver_build(OpcodeContext&);
void __declspec() op_sfall_ver_build();
}
}
+3 -3
View File
@@ -150,9 +150,6 @@ static SfallOpcodeInfo opcodeInfoArray[] = {
{0x20d, "list_begin", op_list_begin, 1, true, 0, {ARG_INT}},
{0x20e, "list_next", op_list_next, 1, true, 0, {ARG_INT}},
{0x20f, "list_end", op_list_end, 1, false, 0, {ARG_INT}},
{0x210, "sfall_ver_major", op_sfall_ver_major, 0, true},
{0x211, "sfall_ver_minor", op_sfall_ver_minor, 0, true},
{0x212, "sfall_ver_build", op_sfall_ver_build, 0, true},
{0x216, "set_critter_burst_disable", op_set_critter_burst_disable, 2, false, 0, {ARG_OBJECT, ARG_INT}},
{0x217, "get_weapon_ammo_pid", op_get_weapon_ammo_pid, 1, true, -1, {ARG_OBJECT}},
{0x218, "set_weapon_ammo_pid", op_set_weapon_ammo_pid, 2, false, 0, {ARG_OBJECT, ARG_INT}},
@@ -391,6 +388,9 @@ void Opcodes::InitNew() {
opcodes[0x1f6] = op_nb_create_char;
opcodes[0x206] = op_set_self;
opcodes[0x210] = op_sfall_ver_major;
opcodes[0x211] = op_sfall_ver_minor;
opcodes[0x212] = op_sfall_ver_build;
opcodes[0x213] = op_hero_select_win;
opcodes[0x214] = op_set_hero_race;
opcodes[0x215] = op_set_hero_style;