Skip to content

Commit

Permalink
exe_constants: Added some battle related constants for rm2k3 v1.08
Browse files Browse the repository at this point in the history
  • Loading branch information
florianessl committed Feb 19, 2025
1 parent b58ff3f commit 1278152
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions src/exe_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ namespace ExeConstants {
using code_address_map = std::array<code_address, static_cast<size_t>(Player::GameConstantType::LAST)>;

#define ADD_EAX_ESI 0x03, 0xC6
#define MOV_EBX 0xB9
#define ADD_EDX_ESI 0x03, 0xD6
#define MOV_EAX 0xB8
#define MOV_ECX 0xB9
#define MOV_EDX 0xBA
#define SUB_EDX_EBX 0x2B, 0xD3
#define CMP_DWORD_ESP 0x81, 0x7C, 0x24
#define CMP_ESI 0x81, 0xFE

#define DEPENDS_ON_PREVIOUS { 0xFF, 0xFF, 0x00, 0xFF }

Expand Down Expand Up @@ -94,9 +96,9 @@ namespace ExeConstants::RT_2K {
map<T::MaxVarLimit> ( 999999, 0x085636, CMP_DWORD_ESP, 0x10),

map<T::TitleX> ( 160, 0x06CC39, MOV_EDX),
map<T::TitleY> ( 148, 0x06CC40, SUB_EDX_EBX, MOV_EBX),
map<T::TitleY> ( 148, 0x06CC40, SUB_EDX_EBX, MOV_ECX),
map<T::TitleHiddenX> ( 160, 0x06CC5B, MOV_EDX),
map<T::TitleHiddenY> ( 88, 0x06CC62, SUB_EDX_EBX, MOV_EBX),
map<T::TitleHiddenY> ( 88, 0x06CC62, SUB_EDX_EBX, MOV_ECX),

not_def<T::MaxActorHP>(),
not_def<T::MaxActorSP>(),
Expand Down Expand Up @@ -126,9 +128,9 @@ namespace ExeConstants::RT_2K {
map<T::MaxVarLimit> ( 999999, 0x0842D2, CMP_DWORD_ESP, 0x10),

map<T::TitleX> ( 160, 0x06E091, MOV_EDX),
map<T::TitleY> ( 148, 0x06E098, SUB_EDX_EBX, MOV_EBX),
map<T::TitleY> ( 148, 0x06E098, SUB_EDX_EBX, MOV_ECX),
map<T::TitleHiddenX> ( 160, 0x06E0B3, MOV_EDX),
map<T::TitleHiddenY> ( 88, 0x06CC62, SUB_EDX_EBX, MOV_EBX),
map<T::TitleHiddenY> ( 88, 0x06CC62, SUB_EDX_EBX, MOV_ECX),

not_def<T::MaxActorHP>(),
not_def<T::MaxActorSP>(),
Expand Down Expand Up @@ -158,9 +160,9 @@ namespace ExeConstants::RT_2K {
map<T::MaxVarLimit> ( 999999, 0x0859A2, CMP_DWORD_ESP, 0x10),

map<T::TitleX> ( 160, 0x06D1B9, MOV_EDX),
map<T::TitleY> ( 148, 0x06D1C0, SUB_EDX_EBX, MOV_EBX),
map<T::TitleY> ( 148, 0x06D1C0, SUB_EDX_EBX, MOV_ECX),
map<T::TitleHiddenX> ( 160, 0x06D1DB, MOV_EDX),
map<T::TitleHiddenY> ( 88, 0x06D1E2, SUB_EDX_EBX, MOV_EBX),
map<T::TitleHiddenY> ( 88, 0x06D1E2, SUB_EDX_EBX, MOV_ECX),

not_def<T::MaxActorHP>(),
not_def<T::MaxActorSP>(),
Expand Down Expand Up @@ -195,9 +197,9 @@ namespace ExeConstants::RT_2K3 {
map<T::MaxVarLimit> ( 9999999, 0x0A5CDD, CMP_DWORD_ESP, 0x10),

map<T::TitleX> ( 160, 0x08A849, MOV_EDX),
map<T::TitleY> ( 148, 0x08A850, SUB_EDX_EBX, MOV_EBX),
map<T::TitleY> ( 148, 0x08A850, SUB_EDX_EBX, MOV_ECX),
map<T::TitleHiddenX> ( 160, 0x08A86B, MOV_EDX),
map<T::TitleHiddenY> ( 88, 0x08A872, SUB_EDX_EBX, MOV_EBX),
map<T::TitleHiddenY> ( 88, 0x08A872, SUB_EDX_EBX, MOV_ECX),

not_def<T::MaxActorHP>(),
not_def<T::MaxActorSP>(),
Expand Down Expand Up @@ -227,9 +229,9 @@ namespace ExeConstants::RT_2K3 {
map<T::MaxVarLimit> ( 9999999, 0x0AC121, CMP_DWORD_ESP, 0x10),

map<T::TitleX> ( 160, 0x08F76D, MOV_EDX),
map<T::TitleY> ( 148, 0x08F774, SUB_EDX_EBX, MOV_EBX),
map<T::TitleY> ( 148, 0x08F774, SUB_EDX_EBX, MOV_ECX),
map<T::TitleHiddenX> ( 160, 0x08F78F, MOV_EDX),
map<T::TitleHiddenY> ( 88, 0x08F796, SUB_EDX_EBX, MOV_EBX),
map<T::TitleHiddenY> ( 88, 0x08F796, SUB_EDX_EBX, MOV_ECX),

not_def<T::MaxActorHP>(),
not_def<T::MaxActorSP>(),
Expand Down Expand Up @@ -259,29 +261,29 @@ namespace ExeConstants::RT_2K3 {
map<T::MaxVarLimit> ( 9999999, 0x0AC395, CMP_DWORD_ESP, 0x10),

map<T::TitleX> ( 160, 0x08F821, MOV_EDX),
map<T::TitleY> ( 148, 0x08F828, SUB_EDX_EBX, MOV_EBX),
map<T::TitleY> ( 148, 0x08F828, SUB_EDX_EBX, MOV_ECX),
map<T::TitleHiddenX> ( 160, 0x08F843, MOV_EDX),
map<T::TitleHiddenY> ( 88, 0x08F84A, SUB_EDX_EBX, MOV_EBX),
map<T::TitleHiddenY> ( 88, 0x08F84A, SUB_EDX_EBX, MOV_ECX),

not_def<T::MaxActorHP>(),
not_def<T::MaxActorSP>(),
map<T::MaxActorHP> ( 9999, 0x0B612B, MOV_ECX), /* 0x0B818B */
map<T::MaxActorSP> ( 999, 0x0B619D, MOV_ECX), /* 0x0B81AD */
not_def<T::MaxEnemyHP>(),
not_def<T::MaxEnemySP>(),

not_def<T::MaxAtkBaseValue>(),
not_def<T::MaxDefBaseValue>(),
not_def<T::MaxSpiBaseValue>(),
not_def<T::MaxAgiBaseValue>(),

not_def<T::MaxAtkBattleValue>(),
not_def<T::MaxDefBattleValue>(),
not_def<T::MaxSpiBattleValue>(),
not_def<T::MaxAgiBattleValue>(),

not_def<T::MaxDamageValue>(),
not_def<T::MaxExpValue>(),
map<T::MaxAtkBaseValue> ( 999, 0x0B6236, MOV_ECX), /* 0xB81CC */
map<T::MaxDefBaseValue> ( 999, 0x0B649C, MOV_ECX), /* 0xB81EB */
map<T::MaxSpiBaseValue> ( 999, 0x0B654C, MOV_ECX), /* 0xB820A */
map<T::MaxAgiBaseValue> ( 999, 0x0B65F2, MOV_ECX), /* 0xB8229 */
map<T::MaxAtkBattleValue> ( 9999, 0x0BEB3C, MOV_ECX),
map<T::MaxDefBattleValue> ( 9999, 0x0BEC08, MOV_ECX),
map<T::MaxSpiBattleValue> ( 9999, 0x0BECD1, MOV_ECX),
map<T::MaxAgiBattleValue> ( 9999, 0x0BED6D, MOV_ECX),

map<T::MaxDamageValue> ( 9999, 0x9C03C, MOV_EAX),
map<T::MaxExpValue> ( 9999999, 0x0B5CC3, CMP_ESI),
not_def<T::MaxLevel>(),
not_def<T::MaxGoldValue>(),
map<T::MaxGoldValue> ( 999999, 0x0A5754, ADD_EDX_ESI, MOV_EAX),
not_def<T::MaxItemCount>(),
not_def<T::MaxSaveFiles>()
}};
Expand Down

0 comments on commit 1278152

Please sign in to comment.