Skip to content

Commit

Permalink
Update MSSB free mem ranges
Browse files Browse the repository at this point in the history
Also slightly changed the format of the code for easier use
  • Loading branch information
LittleCoaks committed Apr 11, 2024
1 parent 58ec018 commit 164f930
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Source/Core/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1830,11 +1830,12 @@ bool GameSupportsTagSets()
return false;
}

std::optional<u32> getGameFreeMemory()
std::optional<std::pair<u32,u32>> getGameFreeMemory()
{
switch (mGameBeingPlayed) {
case GameName::MarioBaseball:
return 0x802ed200;
//return std::make_pair(0x802ED200, 0x802EE764);
return std::make_pair(0x802D5100, 0x802D9500);
case GameName::ToadstoolTour:
return std::nullopt;
case GameName::UnknownGame:
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ std::optional<std::vector<std::string>> GetTagSetGeckoString();
bool GameSupportsTagSets();

// Helper function for the Gecko loader expansion
std::optional<u32> getGameFreeMemory();
std::optional<std::pair<u32,u32>> getGameFreeMemory();

static const u32 aOpponentPort = 0x802EBF92;
static const u32 aFielderPort = 0x802EBF94;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/GeckoCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ static Installation InstallCodeHandlerLocked(const Core::CPUThreadGuard& guard)
if (use_free_memory)
{
// Move Gecko code handler to the free mem region
codelist_base_address = free_memory_base_address.value();
codelist_end_address = codelist_base_address + 0xA700;
codelist_base_address = free_memory_base_address.value().first;
codelist_end_address = free_memory_base_address.value().second;
PowerPC::MMU::HostWrite_U32(guard, ((codelist_base_address & 0xFFFF0000) >> 16 ) + 0x3DE00000, 0x80001904);
PowerPC::MMU::HostWrite_U32(guard, (codelist_base_address & 0x0000FFFF) + 0x61EF0000, 0x80001908);
}
Expand Down

0 comments on commit 164f930

Please sign in to comment.