Support 24-bit memory watches / memory searching
This commit is contained in:
parent
0e479a907b
commit
dbbf274110
13 changed files with 190 additions and 3421 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <vector>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "utf8.hpp"
|
||||
#include "int24.hpp"
|
||||
|
||||
/**
|
||||
* Strip trailing CR if any.
|
||||
|
@ -118,6 +119,33 @@ template<typename T> inline T parse_value(const std::string& value) throw(std::b
|
|||
}
|
||||
}
|
||||
|
||||
template<> inline ss_int24_t parse_value(const std::string& value) throw(std::bad_alloc, std::runtime_error)
|
||||
{
|
||||
try {
|
||||
int32_t v = boost::lexical_cast<int32_t>(value);
|
||||
if(v < -8388608 || v > 8388607)
|
||||
throw std::runtime_error("Value out of valid range");
|
||||
return v;
|
||||
} catch(std::exception& e) {
|
||||
throw std::runtime_error("Can't parse value '" + value + "': " + e.what());
|
||||
}
|
||||
}
|
||||
|
||||
template<> inline ss_uint24_t parse_value(const std::string& value) throw(std::bad_alloc, std::runtime_error)
|
||||
{
|
||||
try {
|
||||
if(value.length() && value[0] == '-') {
|
||||
throw std::runtime_error("Unsigned values can't be negative");
|
||||
}
|
||||
uint32_t v = boost::lexical_cast<uint32_t>(value);
|
||||
if(v > 0xFFFFFF)
|
||||
throw std::runtime_error("Value out of valid range");
|
||||
return v;
|
||||
} catch(std::exception& e) {
|
||||
throw std::runtime_error("Can't parse value '" + value + "': " + e.what());
|
||||
}
|
||||
}
|
||||
|
||||
template<> inline std::string parse_value(const std::string& value) throw(std::bad_alloc, std::runtime_error)
|
||||
{
|
||||
return value;
|
||||
|
|
28
lua.lyx
28
lua.lyx
|
@ -2237,7 +2237,7 @@ Writes hostmemory slot with value <value> 0-255.
|
|||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
hostmemory.read{,s}{byte,{,d,q}word}: Read from host memory
|
||||
hostmemory.read{,s}{byte,{,h,d,q}word}: Read from host memory
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
|
@ -2256,6 +2256,14 @@ Syntax: number hostmemory.readword(number address)
|
|||
Syntax: number hostmemory.readsword(number address)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Syntax: number hostmemory.readhword(number address)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Syntax: number hostmemory.readshword(number address)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Syntax: number hostmemory.readdword(number address)
|
||||
\end_layout
|
||||
|
@ -2284,6 +2292,10 @@ byte is 1 element
|
|||
word is 2 elements
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
hword is 3 elements
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
dword is 4 elements
|
||||
\end_layout
|
||||
|
@ -2297,7 +2309,7 @@ The 's' variants do signed read.
|
|||
\end_layout
|
||||
|
||||
\begin_layout Subsection
|
||||
hostmemory.write{,s}{byte,{,d,q}word}: Write to host memory
|
||||
hostmemory.write{,s}{byte,{,h,d,q}word}: Write to host memory
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
|
@ -2316,6 +2328,14 @@ Syntax: number hostmemory.writeword(number address, number value)
|
|||
Syntax: number hostmemory.writesword(number address, number value)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Syntax: number hostmemory.writehword(number address, number value)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Syntax: number hostmemory.writeshword(number address, number value)
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
Syntax: number hostmemory.writedword(number address, number value)
|
||||
\end_layout
|
||||
|
@ -2345,6 +2365,10 @@ byte is 1 element
|
|||
word is 2 elements
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
hword is 3 elements
|
||||
\end_layout
|
||||
|
||||
\begin_layout Itemize
|
||||
dword is 4 elements
|
||||
\end_layout
|
||||
|
|
BIN
lua.pdf
BIN
lua.pdf
Binary file not shown.
2276
manual.lyx
2276
manual.lyx
File diff suppressed because it is too large
Load diff
1148
manual.txt
1148
manual.txt
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,3 @@
|
|||
|
||||
#include "core/command.hpp"
|
||||
#include "core/memorymanip.hpp"
|
||||
#include "core/moviedata.hpp"
|
||||
|
@ -7,6 +6,7 @@
|
|||
#include "core/rrdata.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/int24.hpp"
|
||||
#include "library/minmax.hpp"
|
||||
#include "library/memorysearch.hpp"
|
||||
|
||||
|
@ -255,14 +255,17 @@ namespace
|
|||
|
||||
read_command<uint8_t, &memory_space::read<uint8_t>> ru1("read-byte");
|
||||
read_command<uint16_t, &memory_space::read<uint16_t>> ru2("read-word");
|
||||
read_command<ss_uint24_t, &memory_space::read<ss_uint24_t>> ru3("read-hword");
|
||||
read_command<uint32_t, &memory_space::read<uint32_t>> ru4("read-dword");
|
||||
read_command<uint64_t, &memory_space::read<uint64_t>> ru8("read-qword");
|
||||
read_command<int8_t, &memory_space::read<int8_t>> rs1("read-sbyte");
|
||||
read_command<int16_t, &memory_space::read<int16_t>> rs2("read-sword");
|
||||
read_command<ss_int24_t, &memory_space::read<ss_int24_t>> rs3("read-shword");
|
||||
read_command<int32_t, &memory_space::read<int32_t>> rs4("read-sdword");
|
||||
read_command<int64_t, &memory_space::read<int64_t>> rs8("read-sqword");
|
||||
write_command<uint8_t, -128, 0xFF, &memory_space::write<uint8_t>> w1("write-byte");
|
||||
write_command<uint16_t, -32768, 0xFFFF, &memory_space::write<uint16_t>> w2("write-word");
|
||||
write_command<ss_uint24_t, -8388608, 0xFFFFFF, &memory_space::write<ss_uint24_t>> w3("write-hword");
|
||||
write_command<uint32_t, -2147483648LL, 0xFFFFFFFFULL, &memory_space::write<uint32_t>> w4("write-dword");
|
||||
write_command<uint64_t, -9223372036854775808LL, 0xFFFFFFFFFFFFFFFFULL, &memory_space::write<uint64_t>>
|
||||
w8("write-qword");
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
#include "core/memorywatch.hpp"
|
||||
#include "core/project.hpp"
|
||||
#include "core/window.hpp"
|
||||
#include <library/string.hpp>
|
||||
#include "library/string.hpp"
|
||||
#include "library/int24.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
@ -341,6 +342,12 @@ std::string evaluate_watch(const std::string& expr) throw(std::bad_alloc)
|
|||
case 'W':
|
||||
stack_push<uint16_t>(s, lsnes_memory.read<uint16_t>(stack_pop(s).as_address()));
|
||||
break;
|
||||
case 'o':
|
||||
stack_push<ss_int24_t>(s, lsnes_memory.read<ss_uint24_t>(stack_pop(s).as_address()));
|
||||
break;
|
||||
case 'O':
|
||||
stack_push<ss_uint24_t>(s, lsnes_memory.read<ss_uint24_t>(stack_pop(s).as_address()));
|
||||
break;
|
||||
case 'd':
|
||||
stack_push<int32_t>(s, lsnes_memory.read<uint32_t>(stack_pop(s).as_address()));
|
||||
break;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "memorysearch.hpp"
|
||||
#include "minmax.hpp"
|
||||
#include "serialization.hpp"
|
||||
#include "int24.hpp"
|
||||
#include <iostream>
|
||||
|
||||
memory_search::memory_search(memory_space& space) throw(std::bad_alloc)
|
||||
|
@ -84,7 +85,7 @@ struct search_seqlt
|
|||
{
|
||||
T mask = (T)1 << (sizeof(T) * 8 - 1);
|
||||
T diff = newv - oldv;
|
||||
return ((diff & mask) != 0);
|
||||
return ((diff & mask) != (T)0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -96,7 +97,7 @@ struct search_seqle
|
|||
{
|
||||
T mask = (T)1 << (sizeof(T) * 8 - 1);
|
||||
T diff = newv - oldv;
|
||||
return ((diff & mask) != 0) || (diff == 0);
|
||||
return ((diff & mask) != (T)0) || (diff == (T)0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -108,7 +109,7 @@ struct search_seqge
|
|||
{
|
||||
T mask = (T)1 << (sizeof(T) * 8 - 1);
|
||||
T diff = newv - oldv;
|
||||
return ((diff & mask) == 0);
|
||||
return ((diff & mask) == (T)0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -120,7 +121,7 @@ struct search_seqgt
|
|||
{
|
||||
T mask = (T)1 << (sizeof(T) * 8 - 1);
|
||||
T diff = newv - oldv;
|
||||
return ((diff & mask) == 0) && (diff != 0);
|
||||
return ((diff & mask) == (T)0) && (diff != (T)0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -381,6 +382,8 @@ void memorysearch_pull_all(memory_search& s)
|
|||
memorysearch_pull_type<uint8_t>(s);
|
||||
memorysearch_pull_type<int16_t>(s);
|
||||
memorysearch_pull_type<uint16_t>(s);
|
||||
memorysearch_pull_type<ss_int24_t>(s);
|
||||
memorysearch_pull_type<ss_uint24_t>(s);
|
||||
memorysearch_pull_type<int32_t>(s);
|
||||
memorysearch_pull_type<uint32_t>(s);
|
||||
memorysearch_pull_type<int64_t>(s);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "memoryspace.hpp"
|
||||
#include "minmax.hpp"
|
||||
#include "serialization.hpp"
|
||||
#include "int24.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
namespace
|
||||
|
@ -150,6 +151,8 @@ template<> int8_t MSR (uint64_t address) { return internal_read<int8_t, false>(*
|
|||
template<> uint8_t MSR (uint64_t address) { return internal_read<uint8_t, false>(*this, address); }
|
||||
template<> int16_t MSR (uint64_t address) { return internal_read<int16_t, false>(*this, address); }
|
||||
template<> uint16_t MSR (uint64_t address) { return internal_read<uint16_t, false>(*this, address); }
|
||||
template<> ss_int24_t MSR (uint64_t address) { return internal_read<ss_int24_t, false>(*this, address); }
|
||||
template<> ss_uint24_t MSR (uint64_t address) { return internal_read<ss_uint24_t, false>(*this, address); }
|
||||
template<> int32_t MSR (uint64_t address) { return internal_read<int32_t, false>(*this, address); }
|
||||
template<> uint32_t MSR (uint64_t address) { return internal_read<uint32_t, false>(*this, address); }
|
||||
template<> int64_t MSR (uint64_t address) { return internal_read<int64_t, false>(*this, address); }
|
||||
|
@ -158,6 +161,8 @@ template<> bool MSW (uint64_t a, int8_t v) { return internal_write<int8_t, false
|
|||
template<> bool MSW (uint64_t a, uint8_t v) { return internal_write<uint8_t, false>(*this, a, v); }
|
||||
template<> bool MSW (uint64_t a, int16_t v) { return internal_write<int16_t, false>(*this, a, v); }
|
||||
template<> bool MSW (uint64_t a, uint16_t v) { return internal_write<uint16_t, false>(*this, a, v); }
|
||||
template<> bool MSW (uint64_t a, ss_int24_t v) { return internal_write<ss_int24_t, false>(*this, a, v); }
|
||||
template<> bool MSW (uint64_t a, ss_uint24_t v) { return internal_write<ss_uint24_t, false>(*this, a, v); }
|
||||
template<> bool MSW (uint64_t a, int32_t v) { return internal_write<int32_t, false>(*this, a, v); }
|
||||
template<> bool MSW (uint64_t a, uint32_t v) { return internal_write<uint32_t, false>(*this, a, v); }
|
||||
template<> bool MSW (uint64_t a, int64_t v) { return internal_write<int64_t, false>(*this, a, v); }
|
||||
|
@ -166,6 +171,8 @@ template<> int8_t MSRL (uint64_t address) { return internal_read<int8_t, true>(*
|
|||
template<> uint8_t MSRL (uint64_t address) { return internal_read<uint8_t, true>(*this, address); }
|
||||
template<> int16_t MSRL (uint64_t address) { return internal_read<int16_t, true>(*this, address); }
|
||||
template<> uint16_t MSRL (uint64_t address) { return internal_read<uint16_t, true>(*this, address); }
|
||||
template<> ss_int24_t MSRL (uint64_t address) { return internal_read<ss_int24_t, true>(*this, address); }
|
||||
template<> ss_uint24_t MSRL (uint64_t address) { return internal_read<ss_uint24_t, true>(*this, address); }
|
||||
template<> int32_t MSRL (uint64_t address) { return internal_read<int32_t, true>(*this, address); }
|
||||
template<> uint32_t MSRL (uint64_t address) { return internal_read<uint32_t, true>(*this, address); }
|
||||
template<> int64_t MSRL (uint64_t address) { return internal_read<int64_t, true>(*this, address); }
|
||||
|
@ -174,6 +181,8 @@ template<> bool MSWL (uint64_t a, int8_t v) { return internal_write<int8_t, true
|
|||
template<> bool MSWL (uint64_t a, uint8_t v) { return internal_write<uint8_t, true>(*this, a, v); }
|
||||
template<> bool MSWL (uint64_t a, int16_t v) { return internal_write<int16_t, true>(*this, a, v); }
|
||||
template<> bool MSWL (uint64_t a, uint16_t v) { return internal_write<uint16_t, true>(*this, a, v); }
|
||||
template<> bool MSWL (uint64_t a, ss_int24_t v) { return internal_write<ss_int24_t, true>(*this, a, v); }
|
||||
template<> bool MSWL (uint64_t a, ss_uint24_t v) { return internal_write<ss_uint24_t, true>(*this, a, v); }
|
||||
template<> bool MSWL (uint64_t a, int32_t v) { return internal_write<int32_t, true>(*this, a, v); }
|
||||
template<> bool MSWL (uint64_t a, uint32_t v) { return internal_write<uint32_t, true>(*this, a, v); }
|
||||
template<> bool MSWL (uint64_t a, int64_t v) { return internal_write<int64_t, true>(*this, a, v); }
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "lua/internal.hpp"
|
||||
#include "core/moviedata.hpp"
|
||||
#include "library/serialization.hpp"
|
||||
#include "library/int24.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -79,6 +80,26 @@ namespace
|
|||
return do_write<int16_t>(L, fname);
|
||||
});
|
||||
|
||||
function_ptr_luafun hm_readh(lua_func_misc, "hostmemory.readhword", [](lua_state& L,
|
||||
const std::string& fname) -> int {
|
||||
return do_read<ss_uint24_t>(L, fname);
|
||||
});
|
||||
|
||||
function_ptr_luafun hm_writeh(lua_func_misc, "hostmemory.writehword", [](lua_state& L,
|
||||
const std::string& fname) -> int {
|
||||
return do_write<ss_uint24_t>(L, fname);
|
||||
});
|
||||
|
||||
function_ptr_luafun hm_readsh(lua_func_misc, "hostmemory.readshword", [](lua_state& L,
|
||||
const std::string& fname) -> int {
|
||||
return do_read<ss_int24_t>(L, fname);
|
||||
});
|
||||
|
||||
function_ptr_luafun hm_writesh(lua_func_misc, "hostmemory.writeshword", [](lua_state& L,
|
||||
const std::string& fname) -> int {
|
||||
return do_write<ss_int24_t>(L, fname);
|
||||
});
|
||||
|
||||
function_ptr_luafun hm_readd(lua_func_misc, "hostmemory.readdword", [](lua_state& L,
|
||||
const std::string& fname) -> int {
|
||||
return do_read<uint32_t>(L, fname);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "library/sha256.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/minmax.hpp"
|
||||
#include "library/int24.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -396,18 +397,23 @@ namespace
|
|||
lua_read_memory<int8_t, &memory_space::read<int8_t>> rsb("memory.readsbyte");
|
||||
lua_read_memory<uint16_t, &memory_space::read<uint16_t>> ruw("memory.readword");
|
||||
lua_read_memory<int16_t, &memory_space::read<int16_t>> rsw("memory.readsword");
|
||||
lua_read_memory<ss_uint24_t, &memory_space::read<ss_uint24_t>> ruh("memory.readhword");
|
||||
lua_read_memory<ss_int24_t, &memory_space::read<ss_int24_t>> rsh("memory.readshword");
|
||||
lua_read_memory<uint32_t, &memory_space::read<uint32_t>> rud("memory.readdword");
|
||||
lua_read_memory<int32_t, &memory_space::read<int32_t>> rsd("memory.readsdword");
|
||||
lua_read_memory<uint64_t, &memory_space::read<uint64_t>> ruq("memory.readqword");
|
||||
lua_read_memory<int64_t, &memory_space::read<int64_t>> rsq("memory.readsqword");
|
||||
lua_write_memory<uint8_t, &memory_space::write<uint8_t>> wb("memory.writebyte");
|
||||
lua_write_memory<uint16_t, &memory_space::write<uint16_t>> ww("memory.writeword");
|
||||
lua_write_memory<ss_uint24_t, &memory_space::write<ss_uint24_t>> wh("memory.writehword");
|
||||
lua_write_memory<uint32_t, &memory_space::write<uint32_t>> wd("memory.writedword");
|
||||
lua_write_memory<uint64_t, &memory_space::write<uint64_t>> wq("memory.writeqword");
|
||||
lua_mmap_memory_helper<uint8_t, &memory_space::read<uint8_t>, &memory_space::write<uint8_t>> mhub;
|
||||
lua_mmap_memory_helper<int8_t, &memory_space::read<int8_t>, &memory_space::write<int8_t>> mhsb;
|
||||
lua_mmap_memory_helper<uint16_t, &memory_space::read<uint16_t>, &memory_space::write<uint16_t>> mhuw;
|
||||
lua_mmap_memory_helper<int16_t, &memory_space::read<int16_t>, &memory_space::write<int16_t>> mhsw;
|
||||
lua_mmap_memory_helper<ss_uint24_t, &memory_space::read<ss_uint24_t>, &memory_space::write<ss_uint24_t>> mhuh;
|
||||
lua_mmap_memory_helper<ss_int24_t, &memory_space::read<ss_int24_t>, &memory_space::write<ss_int24_t>> mhsh;
|
||||
lua_mmap_memory_helper<uint32_t, &memory_space::read<uint32_t>, &memory_space::write<uint32_t>> mhud;
|
||||
lua_mmap_memory_helper<int32_t, &memory_space::read<int32_t>, &memory_space::write<int32_t>> mhsd;
|
||||
lua_mmap_memory_helper<uint64_t, &memory_space::read<uint64_t>, &memory_space::write<uint64_t>> mhuq;
|
||||
|
@ -416,11 +422,12 @@ namespace
|
|||
lua_mmap_memory msb("memory.mapsbyte", mhsb);
|
||||
lua_mmap_memory muw("memory.mapword", mhuw);
|
||||
lua_mmap_memory msw("memory.mapsword", mhsw);
|
||||
lua_mmap_memory muh("memory.maphword", mhuh);
|
||||
lua_mmap_memory msh("memory.mapshword", mhsh);
|
||||
lua_mmap_memory mud("memory.mapdword", mhud);
|
||||
lua_mmap_memory msd("memory.mapsdword", mhsd);
|
||||
lua_mmap_memory muq("memory.mapqword", mhuq);
|
||||
lua_mmap_memory msq("memory.mapsqword", mhsq);
|
||||
|
||||
}
|
||||
|
||||
int lua_mmap_struct::map(lua_state& L, const std::string& fname)
|
||||
|
@ -448,6 +455,10 @@ int lua_mmap_struct::map(lua_state& L, const std::string& fname)
|
|||
mappings[name2] = std::make_pair(&mhuw, addr);
|
||||
else if(type2 == "sword")
|
||||
mappings[name2] = std::make_pair(&mhsw, addr);
|
||||
else if(type2 == "hword")
|
||||
mappings[name2] = std::make_pair(&mhuh, addr);
|
||||
else if(type2 == "shword")
|
||||
mappings[name2] = std::make_pair(&mhsh, addr);
|
||||
else if(type2 == "dword")
|
||||
mappings[name2] = std::make_pair(&mhud, addr);
|
||||
else if(type2 == "sdword")
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "library/string.hpp"
|
||||
#include "library/serialization.hpp"
|
||||
#include "library/minmax.hpp"
|
||||
#include "library/int24.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -81,6 +82,8 @@ namespace
|
|||
{"byte", &lua_vma::rw<uint8_t, false>},
|
||||
{"sword", &lua_vma::rw<int16_t, false>},
|
||||
{"word", &lua_vma::rw<uint16_t, false>},
|
||||
{"shword", &lua_vma::rw<ss_int24_t, false>},
|
||||
{"hword", &lua_vma::rw<ss_uint24_t, false>},
|
||||
{"sdword", &lua_vma::rw<int32_t, false>},
|
||||
{"dword", &lua_vma::rw<uint32_t, false>},
|
||||
{"sqword", &lua_vma::rw<int64_t, false>},
|
||||
|
@ -89,6 +92,8 @@ namespace
|
|||
{"ibyte", &lua_vma::rw<uint8_t, true>},
|
||||
{"isword", &lua_vma::rw<int16_t, true>},
|
||||
{"iword", &lua_vma::rw<uint16_t, true>},
|
||||
{"ishword", &lua_vma::rw<ss_int24_t, true>},
|
||||
{"ihword", &lua_vma::rw<ss_uint24_t, true>},
|
||||
{"isdword", &lua_vma::rw<int32_t, true>},
|
||||
{"idword", &lua_vma::rw<uint32_t, true>},
|
||||
{"isqword", &lua_vma::rw<int64_t, true>},
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "core/memorywatch.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/memorysearch.hpp"
|
||||
#include "library/int24.hpp"
|
||||
|
||||
#include "platform/wxwidgets/platform.hpp"
|
||||
#include "platform/wxwidgets/scrollbar.hpp"
|
||||
|
@ -26,7 +27,7 @@
|
|||
#define wxID_DISQUALIFY (wxID_HIGHEST + 8)
|
||||
#define wxID_BUTTONS_BASE (wxID_HIGHEST + 128)
|
||||
|
||||
#define DATATYPES 8
|
||||
#define DATATYPES 10
|
||||
#define CANDIDATE_LIMIT 512
|
||||
|
||||
class wxwindow_memorysearch;
|
||||
|
@ -42,6 +43,8 @@ namespace
|
|||
"unsigned byte",
|
||||
"signed word",
|
||||
"unsigned word",
|
||||
"signed hword",
|
||||
"unsigned hword",
|
||||
"signed dword",
|
||||
"unsigned dword",
|
||||
"signed qword",
|
||||
|
@ -103,6 +106,11 @@ namespace
|
|||
return format_number_signedh(static_cast<int16_t>(val), 4, hex);
|
||||
}
|
||||
|
||||
template<> std::string format_number_signed<ss_uint24_t>(ss_uint24_t val, bool hex)
|
||||
{
|
||||
return format_number_signedh((int32_t)(uint32_t)(val), 6, hex);
|
||||
}
|
||||
|
||||
template<> std::string format_number_signed<uint32_t>(uint32_t val, bool hex)
|
||||
{
|
||||
return format_number_signedh(static_cast<int32_t>(val), 8, hex);
|
||||
|
@ -123,6 +131,11 @@ namespace
|
|||
return format_number_unsignedh(val, 4, hex);
|
||||
}
|
||||
|
||||
template<> std::string format_number_unsigned<ss_uint24_t>(ss_uint24_t val, bool hex)
|
||||
{
|
||||
return format_number_unsignedh(val, 6, hex);
|
||||
}
|
||||
|
||||
template<> std::string format_number_unsigned<uint32_t>(uint32_t val, bool hex)
|
||||
{
|
||||
return format_number_unsignedh(val, 8, hex);
|
||||
|
@ -270,6 +283,10 @@ namespace
|
|||
&memory_search::s_value<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_1<uint16_t, uint16_t,
|
||||
&memory_search::s_value<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_1<ss_int24_t, ss_uint24_t,
|
||||
&memory_search::s_value<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_1<ss_uint24_t, ss_uint24_t,
|
||||
&memory_search::s_value<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_1<int32_t, uint32_t,
|
||||
&memory_search::s_value<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_1<uint32_t, uint32_t,
|
||||
|
@ -289,6 +306,10 @@ namespace
|
|||
&memory_search::s_difference<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_1<uint16_t, uint16_t,
|
||||
&memory_search::s_difference<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_1<ss_int24_t, ss_uint24_t,
|
||||
&memory_search::s_difference<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_1<ss_uint24_t, ss_uint24_t,
|
||||
&memory_search::s_difference<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_1<int32_t, uint32_t,
|
||||
&memory_search::s_difference<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_1<uint32_t, uint32_t,
|
||||
|
@ -304,6 +325,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_lt<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_lt<int16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_lt<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_lt<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_lt<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_lt<int32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_lt<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_lt<int64_t>>,
|
||||
|
@ -315,6 +338,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_le<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_le<int16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_le<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_le<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_le<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_le<int32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_le<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_le<int64_t>>,
|
||||
|
@ -326,6 +351,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_eq<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_eq<int16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_eq<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_eq<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_eq<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_eq<int32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_eq<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_eq<int64_t>>,
|
||||
|
@ -337,6 +364,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_ne<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ne<int16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ne<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ne<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ne<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ne<int32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ne<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ne<int64_t>>,
|
||||
|
@ -348,6 +377,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_ge<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ge<int16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ge<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ge<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ge<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ge<int32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ge<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_ge<int64_t>>,
|
||||
|
@ -359,6 +390,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_gt<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_gt<int16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_gt<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_gt<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_gt<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_gt<int32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_gt<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_gt<int64_t>>,
|
||||
|
@ -370,6 +403,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_seqlt<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqlt<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqlt<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqlt<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqlt<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqlt<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqlt<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqlt<uint64_t>>,
|
||||
|
@ -381,6 +416,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_seqle<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqle<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqle<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqle<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqle<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqle<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqle<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqle<uint64_t>>,
|
||||
|
@ -392,6 +429,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_seqge<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqge<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqge<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqge<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqge<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqge<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqge<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqge<uint64_t>>,
|
||||
|
@ -403,6 +442,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::s_seqgt<uint8_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqgt<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqgt<uint16_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqgt<ss_int24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqgt<ss_uint24_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqgt<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqgt<uint32_t>>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::s_seqgt<uint64_t>>,
|
||||
|
@ -417,6 +458,8 @@ namespace
|
|||
&wxwindow_memorysearch::search_0<&memory_search::update>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::update>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::update>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::update>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::update>,
|
||||
&wxwindow_memorysearch::search_0<&memory_search::update>
|
||||
}
|
||||
}
|
||||
|
@ -549,17 +592,24 @@ void wxwindow_memorysearch::panel::prepare_paint()
|
|||
_parent->hexmode);
|
||||
break;
|
||||
case 4:
|
||||
row += format_number_signed(lsnes_memory.read<uint32_t>(i), _parent->hexmode);
|
||||
row += format_number_signed(lsnes_memory.read<ss_uint24_t>(i), _parent->hexmode);
|
||||
break;
|
||||
case 5:
|
||||
row += format_number_unsigned(lsnes_memory.read<uint32_t>(i),
|
||||
row += format_number_unsigned(lsnes_memory.read<ss_uint24_t>(i),
|
||||
_parent->hexmode);
|
||||
break;
|
||||
case 6:
|
||||
row += format_number_signed(lsnes_memory.read<uint32_t>(i), _parent->hexmode);
|
||||
break;
|
||||
case 7:
|
||||
row += format_number_unsigned(lsnes_memory.read<uint32_t>(i),
|
||||
_parent->hexmode);
|
||||
break;
|
||||
case 8:
|
||||
row += format_number_signed(lsnes_memory.read<uint64_t>(i),
|
||||
_parent->hexmode);
|
||||
break;
|
||||
case 7:
|
||||
case 9:
|
||||
row += format_number_unsigned(lsnes_memory.read<uint64_t>(i),
|
||||
_parent->hexmode);
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue