summaryrefslogtreecommitdiff
path: root/Database/internals
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-09-21 03:37:45 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-09-21 03:37:45 +0200
commit14d90c9e1171655b864316c9c4aa34033fdd3a45 (patch)
tree3c297e80f774b4a6452331ff840fe6c415875e11 /Database/internals
parent8c9c24358cca81cdb15462cb74afc5f173966c79 (diff)
Very first bit towards a Mips/PSX disassembler
Diffstat (limited to 'Database/internals')
-rw-r--r--Database/internals/database-internal.cpp8
-rw-r--r--Database/internals/database-internal.h4
-rw-r--r--Database/internals/database-segment.h1
3 files changed, 8 insertions, 5 deletions
diff --git a/Database/internals/database-internal.cpp b/Database/internals/database-internal.cpp
index e564c01..ce54f44 100644
--- a/Database/internals/database-internal.cpp
+++ b/Database/internals/database-internal.cpp
@@ -1,14 +1,16 @@
#include "database-internal.h"
#include "database.h"
-DatabaseCell::DatabaseCell(Cpu * cpu, Uint64 cpu_base, absolute_ptr origin, Uint32 size, Uint32 extra_size, DatabaseCell * prev, Database * parent) : cpu(cpu), next(0), prev(prev), parent(parent) {
- prev->next = this;
+DatabaseCell::DatabaseCell(Database * parent, Cpu * cpu, Uint64 cpu_base, absolute_ptr origin, Uint32 size, Uint32 extra_size, const Byte * data) : cpu(cpu), next(0), parent(parent) {
+ prev = parent->getEnd();
+ if (prev)
+ prev->next = this;
parent->setEnd(this);
if (origin.raw_ptr) {
Segment * origin_seg = parent->getSegment(SEGID(origin));
segment = new Segment(size, cpu_base, parent->GetNextSegId(), extra_size, origin_seg->getPristineMemory() + SEGOFFSET(origin));
} else {
- segment = new Segment(size, cpu_base, parent->GetNextSegId(), extra_size);
+ segment = new Segment(size, cpu_base, parent->GetNextSegId(), extra_size, data);
}
}
diff --git a/Database/internals/database-internal.h b/Database/internals/database-internal.h
index 173eb62..4616d8c 100644
--- a/Database/internals/database-internal.h
+++ b/Database/internals/database-internal.h
@@ -17,9 +17,9 @@ class DatabaseCell : public Base {
public:
/** The constructor of a DatabaseCell. Note that if you specify the origin parameter,
* it'll create a sub-segment based on the first one. Note also that this doesn't support
- * the patching system, yet.
+ * the patching system, yet. data and origin are mutually exclusive.
*/
- DatabaseCell(Cpu * cpu, Uint64 cpu_base, absolute_ptr origin, Uint32 size, Uint32 extra_size, DatabaseCell * prev, Database * parent);
+ DatabaseCell(Database * parent, Cpu * cpu, Uint64 cpu_base, absolute_ptr origin, Uint32 size, Uint32 extra_size = 0, const Byte * data = 0);
~DatabaseCell();
Uint32 getId() { return segment->getId(); }
void LoadMemory(Handle * src) { segment->LoadMemory(src); }
diff --git a/Database/internals/database-segment.h b/Database/internals/database-segment.h
index f01ac38..dc4d157 100644
--- a/Database/internals/database-segment.h
+++ b/Database/internals/database-segment.h
@@ -44,6 +44,7 @@ class Segment : public Base {
* @return the memory block of the segment.
*/
const Byte * getPristineMemory() { return plainmemory; }
+ const memory_tags_t * getMemoryTags() { return tags; }
void Patch(Uint32 ptr, Byte val);
void Restore(Uint32 ptr);
bool IsPatched(Uint32 ptr);