Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Exports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#include "api\IServer.hh"
#include "api\impl\OfflineServer.hh"

#include "context\IConsoleContext.hh"
#include "context\IRcClient.hh"
#include "context\impl\ConsoleContext.hh"

#include "data\context\ConsoleContext.hh"
#include "data\context\EmulatorContext.hh"
#include "data\context\GameContext.hh"
#include "data\context\SessionTracker.hh"
Expand Down Expand Up @@ -411,9 +412,9 @@ API const char* CCONV _RA_UserName()

API void CCONV _RA_SetConsoleID(unsigned int nConsoleId)
{
auto pContext = std::make_unique<ra::data::context::ConsoleContext>(ra::itoe<ConsoleID>(nConsoleId));
auto pContext = std::make_unique<ra::context::impl::ConsoleContext>(ra::itoe<ConsoleID>(nConsoleId));
RA_LOG_INFO("Console set to %u (%s)", pContext->Id(), pContext->Name());
ra::services::ServiceLocator::Provide<ra::data::context::ConsoleContext>(std::move(pContext));
ra::services::ServiceLocator::Provide<ra::context::IConsoleContext>(std::move(pContext));

if (IsExternalRcheevosClient())
ResetEmulatorMemoryRegionsForRcheevosClient();
Expand Down
2 changes: 0 additions & 2 deletions src/RA_Integration.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="data\context\ConsoleContext.cpp" />
<ClCompile Include="data\context\GameAssets.cpp" />
<ClCompile Include="api\ApiCall.cpp" />
<ClCompile Include="api\impl\ConnectedServer.cpp" />
Expand Down Expand Up @@ -220,7 +219,6 @@
<ClInclude Include="api\UpdateLeaderboard.hh" />
<ClInclude Include="api\UpdateRichPresence.hh" />
<ClInclude Include="api\UploadBadge.hh" />
<ClInclude Include="data\context\ConsoleContext.hh" />
<ClInclude Include="data\context\EmulatorContext.hh" />
<ClInclude Include="data\context\GameAssets.hh" />
<ClInclude Include="data\context\GameContext.hh" />
Expand Down
6 changes: 0 additions & 6 deletions src/RA_Integration.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,6 @@
<ClCompile Include="services\impl\OfflineRcClient.cpp">
<Filter>Services\Impl</Filter>
</ClCompile>
<ClCompile Include="data\context\ConsoleContext.cpp">
<Filter>Data\Context</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="RA_Resource.h">
Expand Down Expand Up @@ -1037,9 +1034,6 @@
<ClInclude Include="services\impl\OfflineRcClient.hh">
<Filter>Services\Impl</Filter>
</ClInclude>
<ClInclude Include="data\context\ConsoleContext.hh">
<Filter>Data\Context</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="RA_Shared.rc">
Expand Down
137 changes: 0 additions & 137 deletions src/data/context/ConsoleContext.hh

This file was deleted.

4 changes: 2 additions & 2 deletions src/data/context/GameContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include "util\Log.hh"
#include "util\Strings.hh"

#include "context\IConsoleContext.hh"
#include "context\IRcClient.hh"

#include "data\context\ConsoleContext.hh"
#include "data\context\EmulatorContext.hh"
#include "data\context\SessionTracker.hh"
#include "data\context\UserContext.hh"
Expand Down Expand Up @@ -44,7 +44,7 @@ namespace context {

static bool ValidateConsole(int nServerConsoleId)
{
const auto& pConsoleContext = ra::services::ServiceLocator::Get<ra::data::context::ConsoleContext>();
const auto& pConsoleContext = ra::services::ServiceLocator::Get<ra::context::IConsoleContext>();
if (ra::etoi(pConsoleContext.Id()) != nServerConsoleId)
{
switch (nServerConsoleId)
Expand Down
7 changes: 4 additions & 3 deletions src/data/models/CodeNoteModel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "CodeNoteModel.hh"

#include "data\context\ConsoleContext.hh"
#include "context\IConsoleContext.hh"

#include "data\context\EmulatorContext.hh"

#include "services\ServiceLocator.hh"
Expand Down Expand Up @@ -83,7 +84,7 @@ bool CodeNoteModel::HasNestedPointers() const noexcept

static ra::data::ByteAddress ConvertPointer(ra::data::ByteAddress nAddress)
{
const auto& pConsoleContext = ra::services::ServiceLocator::Get<ra::data::context::ConsoleContext>();
const auto& pConsoleContext = ra::services::ServiceLocator::Get<ra::context::IConsoleContext>();
const auto nConvertedAddress = pConsoleContext.ByteAddressFromRealAddress(nAddress);
if (nConvertedAddress != 0xFFFFFFFF)
nAddress = nConvertedAddress;
Expand Down Expand Up @@ -580,7 +581,7 @@ void CodeNoteModel::SetNote(const std::wstring& sNote, bool bImpliedPointer)

Memory::Size CodeNoteModel::GetImpliedPointerSize()
{
const auto& pConsoleContext = ra::services::ServiceLocator::Get<ra::data::context::ConsoleContext>();
const auto& pConsoleContext = ra::services::ServiceLocator::Get<ra::context::IConsoleContext>();

Memory::Size nSize;
uint32_t nMask;
Expand Down
1 change: 0 additions & 1 deletion src/data/models/CodeNotesModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "api\FetchCodeNotes.hh"
#include "api\UpdateCodeNote.hh"

#include "data\context\ConsoleContext.hh"
#include "data\context\EmulatorContext.hh"
#include "data\context\UserContext.hh"

Expand Down
13 changes: 4 additions & 9 deletions src/data/models/MemoryRegionsModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ void MemoryRegionsModel::Serialize(ra::services::TextWriter& pWriter) const
pWriter.Write("M0:");
}

pWriter.Write(ra::ByteAddressToString(pIter.nStartAddress));
pWriter.Write(ra::ByteAddressToString(pIter.GetStartAddress()));
pWriter.Write("-");
pWriter.Write(ra::ByteAddressToString(pIter.nEndAddress));
WriteQuoted(pWriter, pIter.sLabel);
pWriter.Write(ra::ByteAddressToString(pIter.GetEndAddress()));
WriteQuoted(pWriter, pIter.GetDescription());
}
}

Expand All @@ -61,12 +61,7 @@ bool MemoryRegionsModel::Deserialize(ra::Tokenizer& pTokenizer)

void MemoryRegionsModel::AddCustomRegion(ra::data::ByteAddress nStartAddress, ra::data::ByteAddress nEndAddress, const std::wstring& sLabel)
{
MemoryRegion pRegion;
pRegion.sLabel = sLabel;
pRegion.nStartAddress = nStartAddress;
pRegion.nEndAddress = nEndAddress;

m_vRegions.push_back(pRegion);
m_vRegions.emplace_back(nStartAddress, nEndAddress, sLabel);

// setting changes to Unpublished forces a write without attempting to consolidate modifications
SetValue(ChangesProperty, ra::etoi(AssetChanges::Unpublished));
Expand Down
9 changes: 1 addition & 8 deletions src/data/models/MemoryRegionsModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "AssetModelBase.hh"

#include "data/Memory.hh"
#include "data/MemoryRegion.hh"

namespace ra {
namespace data {
Expand All @@ -25,13 +25,6 @@ public:
void Serialize(ra::services::TextWriter&) const override;
bool Deserialize(ra::Tokenizer&) override;

struct MemoryRegion
{
std::wstring sLabel;
ra::data::ByteAddress nStartAddress = 0;
ra::data::ByteAddress nEndAddress = 0;
};

const std::vector<MemoryRegion>& CustomRegions() const noexcept { return m_vRegions; }

void ResetCustomRegions();
Expand Down
14 changes: 8 additions & 6 deletions src/data/models/TriggerValidation.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#include "TriggerValidation.hh"

#include "util\Strings.hh"
#include "context/IConsoleContext.hh"

#include "services/ServiceLocator.hh"

#include "util/Strings.hh"

#include "RA_Defs.h"

#include "data/context/ConsoleContext.hh"
#include "data/context/GameContext.hh"
#include "data/context/EmulatorContext.hh"

#include "services/ServiceLocator.hh"

#include <rcheevos/src/rcheevos/rc_validate.h>
#include <rcheevos/src/rcheevos/rc_internal.h>

Expand Down Expand Up @@ -225,9 +227,9 @@ bool TriggerValidation::Validate(const std::string& sTrigger, std::wstring& sErr
char sErrorBuffer[256] = "";
int nResult = 1;

if (ra::services::ServiceLocator::Exists<ra::data::context::ConsoleContext>())
if (ra::services::ServiceLocator::Exists<ra::context::IConsoleContext>())
{
const auto& pConsoleContext = ra::services::ServiceLocator::Get<ra::data::context::ConsoleContext>();
const auto& pConsoleContext = ra::services::ServiceLocator::Get<ra::context::IConsoleContext>();
unsigned nMaxAddress = pConsoleContext.MaxAddress();

if (nMaxAddress == 0)
Expand Down
4 changes: 4 additions & 0 deletions src/devkit/RADevKit.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="context\impl\ConsoleContext.cpp" />
<ClCompile Include="context\impl\RcClient.cpp" />
<ClCompile Include="data\DataModelBase.cpp" />
<ClCompile Include="data\DataModelCollection.cpp" />
Expand All @@ -68,12 +69,15 @@
<ClCompile Include="services\Http.cpp" />
<ClCompile Include="util\GSL.cpp" />
<ClCompile Include="util\Strings.cpp" />
<ClInclude Include="context\IConsoleContext.hh" />
<ClInclude Include="context\impl\ConsoleContext.hh" />
<ClInclude Include="context\impl\RcClient.hh" />
<ClInclude Include="context\IRcClient.hh" />
<ClInclude Include="data\AsyncObject.hh" />
<ClInclude Include="data\DataModelBase.hh" />
<ClInclude Include="data\DataModelCollection.hh" />
<ClInclude Include="data\Memory.hh" />
<ClInclude Include="data\MemoryRegion.hh" />
<ClInclude Include="data\ModelBase.hh" />
<ClInclude Include="data\ModelCollectionBase.hh" />
<ClInclude Include="data\ModelProperty.hh" />
Expand Down
12 changes: 12 additions & 0 deletions src/devkit/RADevKit.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@
<ClInclude Include="data\Memory.hh">
<Filter>data</Filter>
</ClInclude>
<ClInclude Include="context\IConsoleContext.hh">
<Filter>context</Filter>
</ClInclude>
<ClInclude Include="context\impl\ConsoleContext.hh">
<Filter>context\impl</Filter>
</ClInclude>
<ClInclude Include="data\MemoryRegion.hh">
<Filter>data</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="util\GSL.cpp">
Expand Down Expand Up @@ -152,5 +161,8 @@
<ClCompile Include="data\Memory.cpp">
<Filter>data</Filter>
</ClCompile>
<ClCompile Include="context\impl\ConsoleContext.cpp">
<Filter>context\impl</Filter>
</ClCompile>
</ItemGroup>
</Project>
Loading
Loading