summaryrefslogtreecommitdiff
path: root/Loader/loader-psyq.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Loader/loader-psyq.cpp')
-rw-r--r--Loader/loader-psyq.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/Loader/loader-psyq.cpp b/Loader/loader-psyq.cpp
index d6d8876..204e3e5 100644
--- a/Loader/loader-psyq.cpp
+++ b/Loader/loader-psyq.cpp
@@ -10,11 +10,24 @@ union psyq_header_t {
Uint8 raw[0x800];
};
+static const Uint32 PSX_MAXMEM = 2 * 1024 * 1024;
+static const Uint32 BASE_PSX = 0x80000000;
+static const Uint32 END_PSX = BASE_PSX + PSX_MAXMEM;
+
class loader_psyq : public Base {
public:
- static void load(Handle * input, Database * database) {
+ static void load(Cpu * cpu, Handle * input, Database * database) {
psyq_header_t head;
+ Segment * bss = 0, * data = 0;
input->read(&head, sizeof(head));
+
+ if (head.t_addr != BASE_PSX)
+ bss = database->CreateSegment(cpu, BASE_PSYQ, ABSNUL, 0, head.t_addr - BASE_PSYQ);
+
+ data = database->CreateSegment(cpu, head.t_addr, ABSNUL, head.t_size, END_PSX - (head.t_addr + head.t_size));
+ data->
+
+ database->
}
};