aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ARMJIT.cpp4
-rw-r--r--src/ARMJIT_Internal.h1
-rw-r--r--src/ARMJIT_Memory.cpp3
-rw-r--r--src/DSi.cpp8
-rw-r--r--src/frontend/qt_sdl/CheatsDialog.ui108
5 files changed, 120 insertions, 4 deletions
diff --git a/src/ARMJIT.cpp b/src/ARMJIT.cpp
index 5b827e2..0eb792c 100644
--- a/src/ARMJIT.cpp
+++ b/src/ARMJIT.cpp
@@ -1159,6 +1159,10 @@ void ResetBlockCache()
{
printf("Resetting JIT block cache...\n");
+ // could be replace through a function which only resets
+ // the permissions but we're too lazy
+ ARMJIT_Memory::Reset();
+
InvalidLiterals.Clear();
for (int i = 0; i < ARMJIT_Memory::memregions_Count; i++)
memset(FastBlockLookupRegions[i], 0xFF, CodeRegionSizes[i] * sizeof(u64) / 2);
diff --git a/src/ARMJIT_Internal.h b/src/ARMJIT_Internal.h
index bb6621f..4244470 100644
--- a/src/ARMJIT_Internal.h
+++ b/src/ARMJIT_Internal.h
@@ -114,6 +114,7 @@ struct __attribute__((packed)) TinyVector
void Remove(int index)
{
+ assert(Length > 0);
assert(index >= 0 && index < Length);
Length--;
diff --git a/src/ARMJIT_Memory.cpp b/src/ARMJIT_Memory.cpp
index cc8ad67..f2367f6 100644
--- a/src/ARMJIT_Memory.cpp
+++ b/src/ARMJIT_Memory.cpp
@@ -414,7 +414,7 @@ void RemapDTCM(u32 newBase, u32 newSize)
u32 start = mapping.Addr;
u32 end = mapping.Addr + mapping.Size;
- printf("mapping %d %x %x %x %x\n", region, mapping.Addr, mapping.Size, mapping.Num, mapping.LocalOffset);
+ printf("unmapping %d %x %x %x %x\n", region, mapping.Addr, mapping.Size, mapping.Num, mapping.LocalOffset);
bool oldOverlap = NDS::ARM9->DTCMSize > 0 && !(oldDTCMBase >= end || oldDTCBEnd <= start);
bool newOverlap = newSize > 0 && !(newBase >= end || newEnd <= start);
@@ -773,6 +773,7 @@ bool GetMirrorLocation(int region, u32 num, u32 addr, u32& memoryOffset, u32& mi
{
mirrorStart = addr & ~0xFFFFF;
mirrorSize = 0x100000;
+ return true;
}
return false;
case memregion_VWRAM:
diff --git a/src/DSi.cpp b/src/DSi.cpp
index 56f5356..42541fe 100644
--- a/src/DSi.cpp
+++ b/src/DSi.cpp
@@ -181,15 +181,17 @@ void SoftReset()
// also, BPTWL[0x70] could be abused to quickly boot specific titles
+#ifdef JIT_ENABLED
+ ARMJIT_Memory::Reset();
+ ARMJIT::CheckAndInvalidateITCM();
+#endif
+
NDS::ARM9->Reset();
NDS::ARM7->Reset();
NDS::ARM9->CP15Reset();
memcpy(NDS::ARM9->ITCM, ITCMInit, 0x8000);
-#ifdef JIT_ENABLED
- ARMJIT::CheckAndInvalidateITCM();
-#endif
DSi_AES::Reset();
diff --git a/src/frontend/qt_sdl/CheatsDialog.ui b/src/frontend/qt_sdl/CheatsDialog.ui
new file mode 100644
index 0000000..12e28e2
--- /dev/null
+++ b/src/frontend/qt_sdl/CheatsDialog.ui
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CheatsDialog</class>
+ <widget class="QDialog" name="CheatsDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>609</width>
+ <height>417</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>AR cheat code editor - melonDS</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <item>
+ <widget class="QPushButton" name="btnNewCat">
+ <property name="text">
+ <string>New category</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnNewARCode">
+ <property name="text">
+ <string>New AR code</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnDeleteCode">
+ <property name="text">
+ <string>Delete code</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QTreeView" name="tvCodeList">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPlainTextEdit" name="txtCode">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>3</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>