Search
lxdream.org :: lxdream :: r1095:a8b798030464
lxdream 0.9.1
released Jun 29
Download Now
changeset1095:a8b798030464
parent1094:d2324eb67223
child1096:3f8f4c5b9ef4
authornkeynes
dateSun Jan 31 18:28:24 2010 +1000 (10 years ago)
Move bootstrap structure and defines into bootstrap.h
src/bootstrap.c
src/bootstrap.h
src/loader.c
1.1 --- a/src/bootstrap.c Mon Dec 21 08:23:54 2009 +1000
1.2 +++ b/src/bootstrap.c Sun Jan 31 18:28:24 2010 +1000
1.3 @@ -19,26 +19,6 @@
1.4 #include "dream.h"
1.5 #include "bootstrap.h"
1.6
1.7 -/**
1.8 - * Bootstrap header structure
1.9 - */
1.10 -typedef struct dc_bootstrap_head {
1.11 - char hardware_id[16]; /* must be "SEGA SEGAKATANA " */
1.12 - char maker_id[16]; /* ditto, "SEGA ENTERPRISES" */
1.13 - char crc[4];
1.14 - char padding; /* normally ascii space */
1.15 - char gdrom_id[6];
1.16 - char disc_no[5];
1.17 - char regions[8];
1.18 - char peripherals[8];
1.19 - char product_id[10];
1.20 - char product_ver[6];
1.21 - char product_date[16];
1.22 - char boot_file[16];
1.23 - char vendor_id[16];
1.24 - char product_name[128];
1.25 -} *dc_bootstrap_head_t;
1.26 -
1.27 static uint32_t compute_crc16( dc_bootstrap_head_t h )
1.28 {
1.29 /* Note: Algorithm taken from http://mc.pp.se/dc/ip0000.bin.html */
2.1 --- a/src/bootstrap.h Mon Dec 21 08:23:54 2009 +1000
2.2 +++ b/src/bootstrap.h Sun Jan 31 18:28:24 2010 +1000
2.3 @@ -28,6 +28,31 @@
2.4 extern "C" {
2.5 #endif
2.6
2.7 +#define BOOTSTRAP_LOAD_ADDR 0x8C008000
2.8 +#define BOOTSTRAP_SIZE 32768
2.9 +#define BOOTSTRAP_MAGIC "SEGA SEGAKATANA SEGA ENTERPRISES"
2.10 +
2.11 +#define BINARY_LOAD_ADDR 0x8C010000
2.12 +
2.13 +/**
2.14 + * Bootstrap header structure
2.15 + */
2.16 +typedef struct dc_bootstrap_head {
2.17 + char magic[32];
2.18 + char crc[4];
2.19 + char padding; /* normally ascii space */
2.20 + char gdrom_id[6];
2.21 + char disc_no[5];
2.22 + char regions[8];
2.23 + char peripherals[8];
2.24 + char product_id[10];
2.25 + char product_ver[6];
2.26 + char product_date[16];
2.27 + char boot_file[16];
2.28 + char vendor_id[16];
2.29 + char product_name[128];
2.30 +} *dc_bootstrap_head_t;
2.31 +
2.32 /**
2.33 * Dump the bootstrap info to the output log for infomational/debugging
2.34 * purposes.
3.1 --- a/src/loader.c Mon Dec 21 08:23:54 2009 +1000
3.2 +++ b/src/loader.c Sun Jan 31 18:28:24 2010 +1000
3.3 @@ -38,11 +38,6 @@
3.4 { "bin", "SH4 Bin file" },
3.5 { NULL, NULL } };
3.6
3.7 -#define BOOTSTRAP_LOAD_ADDR 0x8C008000
3.8 -#define BOOTSTRAP_SIZE 32768
3.9 -
3.10 -#define BINARY_LOAD_ADDR 0x8C010000
3.11 -
3.12 #define CDI_V2 0x80000004
3.13 #define CDI_V3 0x80000005
3.14
.