refine quest opcode notes

This commit is contained in:
Martin Michelsen
2024-11-29 23:33:41 -08:00
parent f5ed347734
commit db2bd9d08f
2 changed files with 23 additions and 14 deletions
+1 -1
View File
@@ -4542,7 +4542,7 @@ struct G_ShieldAttack_6x4A {
struct G_HitByEnemy_6x4B_6x4C { struct G_HitByEnemy_6x4B_6x4C {
G_ClientIDHeader header; G_ClientIDHeader header;
le_uint16_t angle = 0; le_uint16_t angle = 0;
le_uint16_t damage = 0; le_uint16_t current_hp = 0;
le_float x_velocity = 0.0f; le_float x_velocity = 0.0f;
le_float z_velocity = 0.0f; le_float z_velocity = 0.0f;
} __packed_ws__(G_HitByEnemy_6x4B_6x4C, 0x10); } __packed_ws__(G_HitByEnemy_6x4B_6x4C, 0x10);
+22 -13
View File
@@ -1547,9 +1547,11 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = {
{0xF850, "ba_meseta_score", "meseta_score", {{REG_SET_FIXED, 3}}, F_V2_V4}, {0xF850, "ba_meseta_score", "meseta_score", {{REG_SET_FIXED, 3}}, F_V2_V4},
// Sets the number of traps players can use in battle mode. regsA[1] is the // Sets the number of traps players can use in battle mode. regsA[1] is the
// amount; regsA[0] is the trap type, remapped as follows (valueA => actual // amount; regsA[0] is the trap type:
// trap type): // 0 = Damage trap (internal type 0)
// 0 => 0 1 => 2 2 => 3 3 => 1 // 1 = Slow trap (internal type 2)
// 2 = Confuse trap (internal type 3)
// 3 = Freeze trap (internal type 1)
{0xF851, "ba_set_trap_count", "ba_set_trap", {{REG_SET_FIXED, 2}}, F_V2_V4}, {0xF851, "ba_set_trap_count", "ba_set_trap", {{REG_SET_FIXED, 2}}, F_V2_V4},
// Enables (0) or disables (1) the targeting reticle in battle // Enables (0) or disables (1) the targeting reticle in battle
@@ -1574,7 +1576,9 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = {
{0xF859, "ba_hide_self_traps", "BA_Hide_Self_Traps", {}, F_V2_V4}, {0xF859, "ba_hide_self_traps", "BA_Hide_Self_Traps", {}, F_V2_V4},
// Creates an item in a player's inventory and equips it. Sends 6x2B // Creates an item in a player's inventory and equips it. Sends 6x2B
// followed by 6x25. // followed by 6x25. It appears Sega did not intend for this to be used on
// BB, since the behavior wasn't changed - normally, item-related functions
// should be done by the server on BB.
// regsA[0] = client ID // regsA[0] = client ID
// regsA[1-3] = item.data1[0-2] // regsA[1-3] = item.data1[0-2]
{0xF85A, "equip_item", "equip_item_v2", {{REG32_SET_FIXED, 4}}, F_V2}, {0xF85A, "equip_item", "equip_item_v2", {{REG32_SET_FIXED, 4}}, F_V2},
@@ -2342,8 +2346,8 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = {
{0xF90E, "fdiv", nullptr, {REG, REG}, F_V3_V4}, {0xF90E, "fdiv", nullptr, {REG, REG}, F_V3_V4},
{0xF90F, "fdivi", nullptr, {REG, FLOAT32}, F_V3_V4}, {0xF90F, "fdivi", nullptr, {REG, FLOAT32}, F_V3_V4},
// Returns the number of times a player has ever died. // Returns the number of times a player has ever died - not just in the
// TODO: Do scape doll revivals count toward this? // current quest/game/session!
// regA = client ID // regA = client ID
// regB = returned death count // regB = returned death count
{0xF910, "get_total_deaths", "get_unknown_count?", {CLIENT_ID, REG}, F_V3_V4 | F_ARGS}, {0xF910, "get_total_deaths", "get_unknown_count?", {CLIENT_ID, REG}, F_V3_V4 | F_ARGS},
@@ -2521,7 +2525,8 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = {
// valueB = Y position on screen // valueB = Y position on screen
// valueC = window width // valueC = window width
// valueD = window height // valueD = window height
// valueE = window style (TODO) // valueE = window style (0 = white window, 1 = chat box, anything else =
// no window, just text)
// strF = initial message // strF = initial message
{0xF930, "chat_box", nullptr, {INT32, INT32, INT32, INT32, INT32, CSTRING}, F_V3_V4 | F_ARGS}, {0xF930, "chat_box", nullptr, {INT32, INT32, INT32, INT32, INT32, CSTRING}, F_V3_V4 | F_ARGS},
@@ -2579,11 +2584,15 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = {
// and a new one is created with the wrapped flag set. The new item has a // and a new one is created with the wrapped flag set. The new item has a
// different item ID, which is not returned. Sends 6x29, then 6x26 if // different item ID, which is not returned. Sends 6x29, then 6x26 if
// deleting the item causes the player's equipped weapon to no longer be // deleting the item causes the player's equipped weapon to no longer be
// usable, then 6x2B. // usable, then 6x2B. It appears Sega did not intend for this to be used on
// BB, since the behavior wasn't changed - normally, item-related functions
// should be done by the server on BB, as the following opcode does.
// valueA = item ID // valueA = item ID
{0xF93B, "wrap_item", "item_packing1", {ITEM_ID}, F_V3_V4 | F_ARGS}, {0xF93B, "wrap_item", "item_packing1", {ITEM_ID}, F_V3_V4 | F_ARGS},
// Like wrap_item, but also sets the present color. Sends 6xD6 on BB. // Like wrap_item, but also sets the present color. On BB, sends 6xD6, and
// the server should respond with the sequence of 6x29, maybe 6x26, then
// 6xBE.
// valueA = item ID // valueA = item ID
// valueB = present color (0-15; high 4 bits are masked out) // valueB = present color (0-15; high 4 bits are masked out)
{0xF93C, "wrap_item_with_color", "item_packing2", {ITEM_ID, INT32}, F_V3_V4 | F_ARGS}, {0xF93C, "wrap_item_with_color", "item_packing2", {ITEM_ID, INT32}, F_V3_V4 | F_ARGS},
@@ -2648,11 +2657,11 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = {
{0xF947, "cos", nullptr, {REG, INT32}, F_V3_V4 | F_ARGS}, {0xF947, "cos", nullptr, {REG, INT32}, F_V3_V4 | F_ARGS},
{0xF948, "tan", nullptr, {REG, INT32}, F_V3_V4 | F_ARGS}, {0xF948, "tan", nullptr, {REG, INT32}, F_V3_V4 | F_ARGS},
// Computes the arctangent of the input ratio. // Computes the arctangent of the input ratio. Equivalent C:
// TODO: Verify the order of valueB/valueC // regA = (int)((atan2(valueB, valueC) * 65536.0) / (2 * M_PI))
// regA = result (integer angle, 0-65535) // regA = result (integer angle, 0-65535)
// valueB = numerator // valueB = numerator as float
// valueC = denominator // valueC = denominator as float
{0xF949, "atan2_int", "atan", {REG, FLOAT32, FLOAT32}, F_V3_V4 | F_ARGS}, {0xF949, "atan2_int", "atan", {REG, FLOAT32, FLOAT32}, F_V3_V4 | F_ARGS},
// Sets regA to 1 if Olga Flow has been defeated, or 0 otherwise. // Sets regA to 1 if Olga Flow has been defeated, or 0 otherwise.