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
4 changes: 2 additions & 2 deletions src/RA_Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ static int DoShutdown()
if (pWindowManager.AssetList.IsVisible())
pDesktop.CloseWindow(pWindowManager.AssetList);

if (pWindowManager.CodeNotes.IsVisible())
pDesktop.CloseWindow(pWindowManager.CodeNotes);
if (pWindowManager.MemoryNotes.IsVisible())
pDesktop.CloseWindow(pWindowManager.MemoryNotes);

if (pWindowManager.PointerFinder.IsVisible())
pDesktop.CloseWindow(pWindowManager.PointerFinder);
Expand Down
8 changes: 4 additions & 4 deletions src/RA_Integration.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<ClCompile Include="ui\viewmodels\AssetUploadViewModel.cpp" />
<ClCompile Include="ui\viewmodels\BrokenAchievementsViewModel.cpp" />
<ClCompile Include="ui\viewmodels\ChallengeIndicatorViewModel.cpp" />
<ClCompile Include="ui\viewmodels\CodeNotesViewModel.cpp" />
<ClCompile Include="ui\viewmodels\MemoryNotesViewModel.cpp" />
<ClCompile Include="ui\viewmodels\EmulatorViewModel.cpp" />
<ClCompile Include="ui\viewmodels\FileDialogViewModel.cpp" />
<ClCompile Include="ui\viewmodels\GameChecksumViewModel.cpp" />
Expand Down Expand Up @@ -172,7 +172,7 @@
<ClCompile Include="ui\win32\bindings\MultiLineGridBinding.cpp" />
<ClCompile Include="ui\win32\bindings\WindowBinding.cpp" />
<ClCompile Include="ui\win32\BrokenAchievementsDialog.cpp" />
<ClCompile Include="ui\win32\CodeNotesDialog.cpp" />
<ClCompile Include="ui\win32\MemoryNotesDialog.cpp" />
<ClCompile Include="ui\win32\Desktop.cpp" />
<ClCompile Include="ui\win32\DialogBase.cpp" />
<ClCompile Include="ui\win32\FileDialog.cpp" />
Expand Down Expand Up @@ -301,7 +301,7 @@
<ClInclude Include="ui\viewmodels\AssetUploadViewModel.hh" />
<ClInclude Include="ui\viewmodels\BrokenAchievementsViewModel.hh" />
<ClInclude Include="ui\viewmodels\ChallengeIndicatorViewModel.hh" />
<ClInclude Include="ui\viewmodels\CodeNotesViewModel.hh" />
<ClInclude Include="ui\viewmodels\MemoryNotesViewModel.hh" />
<ClInclude Include="ui\viewmodels\EmulatorViewModel.hh" />
<ClInclude Include="ui\viewmodels\FileDialogViewModel.hh" />
<ClInclude Include="ui\viewmodels\GameChecksumViewModel.hh" />
Expand Down Expand Up @@ -363,7 +363,7 @@
<ClInclude Include="ui\win32\bindings\TextBoxBinding.hh" />
<ClInclude Include="ui\win32\bindings\WindowBinding.hh" />
<ClInclude Include="ui\win32\BrokenAchievementsDialog.hh" />
<ClInclude Include="ui\win32\CodeNotesDialog.hh" />
<ClInclude Include="ui\win32\MemoryNotesDialog.hh" />
<ClInclude Include="ui\win32\Desktop.hh" />
<ClInclude Include="ui\win32\DialogBase.hh" />
<ClInclude Include="ui\win32\FileDialog.hh" />
Expand Down
8 changes: 4 additions & 4 deletions src/RA_Integration.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@
<ClCompile Include="ui\viewmodels\MemoryViewerViewModel.cpp">
<Filter>UI\ViewModels</Filter>
</ClCompile>
<ClCompile Include="ui\viewmodels\CodeNotesViewModel.cpp">
<ClCompile Include="ui\viewmodels\MemoryNotesViewModel.cpp">
<Filter>UI\ViewModels</Filter>
</ClCompile>
<ClCompile Include="ui\win32\CodeNotesDialog.cpp">
<ClCompile Include="ui\win32\MemoryNotesDialog.cpp">
<Filter>UI\Win32</Filter>
</ClCompile>
<ClCompile Include="ui\win32\bindings\MultiLineGridBinding.cpp">
Expand Down Expand Up @@ -737,10 +737,10 @@
<ClInclude Include="ui\viewmodels\MemoryViewerViewModel.hh">
<Filter>UI\ViewModels</Filter>
</ClInclude>
<ClInclude Include="ui\viewmodels\CodeNotesViewModel.hh">
<ClInclude Include="ui\viewmodels\MemoryNotesViewModel.hh">
<Filter>UI\ViewModels</Filter>
</ClInclude>
<ClInclude Include="ui\win32\CodeNotesDialog.hh">
<ClInclude Include="ui\win32\MemoryNotesDialog.hh">
<Filter>UI\Win32</Filter>
</ClInclude>
<ClInclude Include="ui\win32\bindings\MultiLineGridBinding.hh">
Expand Down
4 changes: 2 additions & 2 deletions src/RA_Shared.rc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ BEGIN
PUSHBUTTON "&Export",IDC_RA_RESULTS_EXPORT,8,127,35,14
PUSHBUTTON "&Import",IDC_RA_RESULTS_IMPORT,43,127,35,14
CONTROL "",IDC_RA_RESULTS,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOCOLUMNHEADER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,82,55,242,86
GROUPBOX "Code Notes",IDC_RA_GBX_NOTES,4,145,324,55
GROUPBOX "Memory Notes",IDC_RA_GBX_NOTES,4,145,324,55
LTEXT "&Address:",IDC_STATIC,8,155,32,9
EDITTEXT IDC_RA_ADDRESS,8,166,56,12,ES_AUTOHSCROLL
PUSHBUTTON "...",IDC_RA_VIEW_CODENOTES,65,166,13,12
Expand Down Expand Up @@ -291,7 +291,7 @@ END

IDD_RA_CODENOTES DIALOGEX 0, 0, 287, 230
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "Code Notes"
CAPTION "Memory Notes"
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
LTEXT "Search:",IDC_STATIC,6,6,33,11
Expand Down
6 changes: 3 additions & 3 deletions src/api/impl/ConnectedServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ ResolveHash::Response ConnectedServer::ResolveHash(const ResolveHash::Request& r
return response;
}

static void SetCodeNote(ApiResponseBase& response, const char* sApiName,
static void SetNote(ApiResponseBase& response, const char* sApiName,
unsigned nGameId, ra::data::ByteAddress nAddress, const char* sNote)
{
rc_api_update_code_note_request_t api_params;
Expand Down Expand Up @@ -580,7 +580,7 @@ UpdateCodeNote::Response ConnectedServer::UpdateCodeNote(const UpdateCodeNote::R
UpdateCodeNote::Response response;

const std::string sNote = ra::util::String::Narrow(request.Note);
SetCodeNote(response, UpdateCodeNote::Name(), request.GameId, request.Address, sNote.c_str());
SetNote(response, UpdateCodeNote::Name(), request.GameId, request.Address, sNote.c_str());

return response;
}
Expand All @@ -589,7 +589,7 @@ DeleteCodeNote::Response ConnectedServer::DeleteCodeNote(const DeleteCodeNote::R
{
DeleteCodeNote::Response response;

SetCodeNote(response, DeleteCodeNote::Name(), request.GameId, request.Address, nullptr);
SetNote(response, DeleteCodeNote::Name(), request.GameId, request.Address, nullptr);

return response;
}
Expand Down
4 changes: 2 additions & 2 deletions src/data/context/EmulatorContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ bool EmulatorContext::EnableHardcoreMode(bool bShowWarning)
if (pWindowManager.AssetEditor.IsVisible())
pDesktop.CloseWindow(pWindowManager.AssetEditor);

if (pWindowManager.CodeNotes.IsVisible())
pDesktop.CloseWindow(pWindowManager.CodeNotes);
if (pWindowManager.MemoryNotes.IsVisible())
pDesktop.CloseWindow(pWindowManager.MemoryNotes);

if (pWindowManager.PointerFinder.IsVisible())
pDesktop.CloseWindow(pWindowManager.PointerFinder);
Expand Down
15 changes: 7 additions & 8 deletions src/data/context/GameAssets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ra::data::models::AssetCategory GameAssets::MostPublishedAssetCategory() const
{
// we really only care about published achievements and
// leaderboards. if a set only has published rich presence
// or code notes, don't consider it a published set.
// or memory notes, don't consider it a published set.
switch (pAsset.GetType())
{
case ra::data::models::AssetType::Achievement:
Expand Down Expand Up @@ -264,11 +264,10 @@ void GameAssets::ReloadAssets(const std::vector<ra::data::models::AssetModelBase
case ra::data::models::AssetType::RichPresence:
continue;

// ignore CodeNotes model (it's actually a collection of notes)
case ra::data::models::AssetType::CodeNotes:
// ignore MemoryNotes model (it's actually a collection of notes)
case ra::data::models::AssetType::MemoryNotes:
continue;


// ignore MemoryRegions model (it's actually a collection of regions)
case ra::data::models::AssetType::MemoryRegions:
continue;
Expand Down Expand Up @@ -312,7 +311,7 @@ void GameAssets::ReloadAssets(const std::vector<ra::data::models::AssetModelBase
break;

case 'N':
nType = ra::data::models::AssetType::CodeNotes;
nType = ra::data::models::AssetType::MemoryNotes;
pTokenizer.Consume('N');
break;

Expand Down Expand Up @@ -387,8 +386,8 @@ void GameAssets::ReloadAssets(const std::vector<ra::data::models::AssetModelBase
break;
}

case ra::data::models::AssetType::CodeNotes:
pAsset = FindCodeNotes();
case ra::data::models::AssetType::MemoryNotes:
pAsset = FindMemoryNotes();
if (pAsset)
pAsset->Deserialize(pTokenizer);

Expand Down Expand Up @@ -550,7 +549,7 @@ void GameAssets::SaveAssets(const std::vector<ra::data::models::AssetModelBase*>
pData->Write("L");
break;

case ra::data::models::AssetType::CodeNotes:
case ra::data::models::AssetType::MemoryNotes:
pData->Write("N");
break;

Expand Down
14 changes: 7 additions & 7 deletions src/data/context/GameAssets.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "data\Types.hh"

#include "data\models\AchievementModel.hh"
#include "data\models\CodeNotesModel.hh"
#include "data\models\MemoryNotesModel.hh"
#include "data\models\LeaderboardModel.hh"
#include "data\models\MemoryRegionsModel.hh"
#include "data\models\RichPresenceModel.hh"
Expand Down Expand Up @@ -94,19 +94,19 @@ public:
}

/// <summary>
/// Finds the code notes asset.
/// Finds the memory notes asset.
/// </summary>
ra::data::models::CodeNotesModel* FindCodeNotes()
ra::data::models::MemoryNotesModel* FindMemoryNotes()
{
return dynamic_cast<ra::data::models::CodeNotesModel*>(FindAsset(ra::data::models::AssetType::CodeNotes, 0));
return dynamic_cast<ra::data::models::MemoryNotesModel*>(FindAsset(ra::data::models::AssetType::MemoryNotes, 0));
}

/// <summary>
/// Finds the code notes asset.
/// Finds the memory notes asset.
/// </summary>
const ra::data::models::CodeNotesModel* FindCodeNotes() const
const ra::data::models::MemoryNotesModel* FindMemoryNotes() const
{
return dynamic_cast<const ra::data::models::CodeNotesModel*>(FindAsset(ra::data::models::AssetType::CodeNotes, 0));
return dynamic_cast<const ra::data::models::MemoryNotesModel*>(FindAsset(ra::data::models::AssetType::MemoryNotes, 0));
}

/// <summary>
Expand Down
22 changes: 11 additions & 11 deletions src/data/context/GameContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "data\context\SessionTracker.hh"

#include "data\models\AchievementModel.hh"
#include "data\models\CodeNotesModel.hh"
#include "data\models\MemoryNotesModel.hh"
#include "data\models\LocalBadgesModel.hh"
#include "data\models\RichPresenceModel.hh"

Expand Down Expand Up @@ -255,20 +255,20 @@ void GameContext::EndLoadGame(int nResult, bool bWasPaused, bool bShowSoftcoreWa
{
BeginLoad();

auto pCodeNotes = std::make_unique<ra::data::models::CodeNotesModel>();
pCodeNotes->Refresh(
auto pMemoryNotes = std::make_unique<ra::data::models::MemoryNotesModel>();
pMemoryNotes->Refresh(
m_nGameId,
[this](ra::data::ByteAddress nAddress, const std::wstring& sNewNote) {
OnCodeNoteChanged(nAddress, sNewNote);
OnMemoryNoteChanged(nAddress, sNewNote);
},
[this](ra::data::ByteAddress nOldAddress, ra::data::ByteAddress nNewAddress, const std::wstring sNote) {
OnCodeNoteMoved(nOldAddress, nNewAddress, sNote);
OnMemoryNoteMoved(nOldAddress, nNewAddress, sNote);
},
[this]() {
EndLoad();
});

m_vAssets.Append(std::move(pCodeNotes));
m_vAssets.Append(std::move(pMemoryNotes));

// the old server value (if different from current server value) will be stored as Local modification.
// capture it now. ReloadAssets will load the XXX-Rich.txt file and replace it
Expand Down Expand Up @@ -506,7 +506,7 @@ void GameContext::InitializeSubsets(const rc_api_fetch_game_sets_response_t* gam
std::lock_guard<std::mutex> lock(m_mLoadMutex);
m_vSubsets.clear();

// GameID dictates which game is loaded for purposes of local achievement storage and code notes
// GameID dictates which game is loaded for purposes of local achievement storage and memory notes
m_nGameId = GetRealGameId(game_data_response->id);
// ActiveGameID dictates which game is running for purposes of rich presence and pings
const auto nActiveGameId = GetRealGameId(game_data_response->session_game_id);
Expand Down Expand Up @@ -699,28 +699,28 @@ void GameContext::DoFrame()
pAsset.DoFrame();
}

void GameContext::OnCodeNoteChanged(ra::data::ByteAddress nAddress, const std::wstring& sNewNote)
void GameContext::OnMemoryNoteChanged(ra::data::ByteAddress nAddress, const std::wstring& sNewNote)
{
if (m_vNotifyTargets.LockIfNotEmpty())
{
if (!IsGameLoading())
{
for (auto& target : m_vNotifyTargets.Targets())
target.OnCodeNoteChanged(nAddress, sNewNote);
target.OnMemoryNoteChanged(nAddress, sNewNote);
}

m_vNotifyTargets.Unlock();
}
}

void GameContext::OnCodeNoteMoved(ra::data::ByteAddress nOldAddress, ra::data::ByteAddress nNewAddress, const std::wstring& sNote)
void GameContext::OnMemoryNoteMoved(ra::data::ByteAddress nOldAddress, ra::data::ByteAddress nNewAddress, const std::wstring& sNote)
{
if (m_vNotifyTargets.LockIfNotEmpty())
{
if (!IsGameLoading())
{
for (auto& target : m_vNotifyTargets.Targets())
target.OnCodeNoteMoved(nOldAddress, nNewAddress, sNote);
target.OnMemoryNoteMoved(nOldAddress, nNewAddress, sNote);
}

m_vNotifyTargets.Unlock();
Expand Down
8 changes: 4 additions & 4 deletions src/data/context/GameContext.hh
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public:
virtual void OnActiveGameChanged() noexcept(false) {}
virtual void OnBeginGameLoad() noexcept(false) {}
virtual void OnEndGameLoad() noexcept(false) {}
virtual void OnCodeNoteChanged(ra::data::ByteAddress, const std::wstring&) noexcept(false) {}
virtual void OnCodeNoteMoved(ra::data::ByteAddress, ra::data::ByteAddress, const std::wstring&) noexcept(false) {}
virtual void OnMemoryNoteChanged(ra::data::ByteAddress, const std::wstring&) noexcept(false) {}
virtual void OnMemoryNoteMoved(ra::data::ByteAddress, ra::data::ByteAddress, const std::wstring&) noexcept(false) {}
};

void AddNotifyTarget(NotifyTarget& pTarget) noexcept { m_vNotifyTargets.Add(pTarget); }
Expand Down Expand Up @@ -205,8 +205,8 @@ private:
protected:
void OnBeforeActiveGameChanged();
void OnActiveGameChanged();
void OnCodeNoteChanged(ra::data::ByteAddress nAddress, const std::wstring& sNewNote);
void OnCodeNoteMoved(ra::data::ByteAddress nOldAddress, ra::data::ByteAddress nNewAddress, const std::wstring& sNote);
void OnMemoryNoteChanged(ra::data::ByteAddress nAddress, const std::wstring& sNewNote);
void OnMemoryNoteMoved(ra::data::ByteAddress nOldAddress, ra::data::ByteAddress nNewAddress, const std::wstring& sNote);
void BeginLoad();
void EndLoad();

Expand Down
Loading
Loading