diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2009-09-28 17:22:06 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2009-09-28 17:22:06 +0200 |
commit | 2f38d1ad1cdd495da2a4d47530ab7c8b897fb89b (patch) | |
tree | 857e91c6142bca48c4f7bcb7e2f4a827b374b2e4 /Loader | |
parent | 48df755c00a19a71e5583480b15091dc5c1e8df1 (diff) |
Work in progress.
Diffstat (limited to 'Loader')
-rw-r--r-- | Loader/loader-psyq.cpp | 15 |
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-> } }; |