From 1f7ca9fd3964481318bbaddfb39acc5de8c7d65d Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 20 Sep 2009 23:10:31 +0200 Subject: Basic makefile structure; making the project at least compilable. --- Database/internals/database-segment.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Database/internals/database-segment.cpp') diff --git a/Database/internals/database-segment.cpp b/Database/internals/database-segment.cpp index 55689f8..8ee5b4b 100644 --- a/Database/internals/database-segment.cpp +++ b/Database/internals/database-segment.cpp @@ -1,6 +1,10 @@ +#include + +#include +#include #include "database-segment.h" -Segment::Segment(Uint32 size, Uint32 id, Uint64 cpu_base, Uint32 extra_size, const Byte * data) : patches(0), plainmemory(0), size(size), extra_size(extra_size), id(id), cpu_base(cpu_base) { +Segment::Segment(Uint32 size, Uint32 id, Uint64 cpu_base, Uint32 extra_size, const Byte * data) : plainmemory(0), patches(0), size(size), extra_size(extra_size), id(id), cpu_base(cpu_base) { Uint64 fullsize = size + extra_size; assert(size); @@ -8,7 +12,7 @@ Segment::Segment(Uint32 size, Uint32 id, Uint64 cpu_base, Uint32 extra_size, con if (data) { plainmemory = (Byte *) data; loaded = true; - allocated = false + allocated = false; } else { plainmemory = Allocator::alloc(size); loaded = false; @@ -23,7 +27,7 @@ Segment::~Segment() { Allocator::free(plainmemory); if (patches) Allocator::free(patches); - if (patchesmemory) + if (patchesmap) Allocator::free(patchesmap); Allocator::free(tags); Allocator::free(refData); @@ -82,10 +86,10 @@ void Segment::LoadMemory(Handle * src) { return; } - src->Read(plainmemory, size); + src->read(plainmemory, size); } -void setTag(Uint32 ptr, memory_tags_t tag) { +void Segment::setTag(Uint32 ptr, memory_tags_t tag) { if (ptr >= (size + extra_size)) { LOG(CONSOLE, ERROR, "Out of bound setTag attempt in segment %i at %08X\n", id, ptr); return; @@ -93,7 +97,7 @@ void setTag(Uint32 ptr, memory_tags_t tag) { tags[ptr] = tag; } -memory_tags_t getTag(Uint32 ptr) { +memory_tags_t Segment::getTag(Uint32 ptr) { if (ptr >= (size + extra_size)) { memory_tags_t z = { 0, 0 }; LOG(CONSOLE, ERROR, "Out of bound getTag attempt in segment %i at %08X\n", id, ptr); -- cgit v1.2.3