# HG changeset patch # User nkeynes # Date 1264926504 -36000 # Node ID a8b798030464bd69b6a5f09fe1a89472af319eaa # Parent d2324eb6722375bcfde884cfe5c6f5d5f2ebc317 Move bootstrap structure and defines into bootstrap.h --- a/src/bootstrap.c Mon Dec 21 08:23:54 2009 +1000 +++ b/src/bootstrap.c Sun Jan 31 18:28:24 2010 +1000 @@ -19,26 +19,6 @@ #include "dream.h" #include "bootstrap.h" -/** - * Bootstrap header structure - */ -typedef struct dc_bootstrap_head { - char hardware_id[16]; /* must be "SEGA SEGAKATANA " */ - char maker_id[16]; /* ditto, "SEGA ENTERPRISES" */ - char crc[4]; - char padding; /* normally ascii space */ - char gdrom_id[6]; - char disc_no[5]; - char regions[8]; - char peripherals[8]; - char product_id[10]; - char product_ver[6]; - char product_date[16]; - char boot_file[16]; - char vendor_id[16]; - char product_name[128]; -} *dc_bootstrap_head_t; - static uint32_t compute_crc16( dc_bootstrap_head_t h ) { /* Note: Algorithm taken from http://mc.pp.se/dc/ip0000.bin.html */ --- a/src/bootstrap.h Mon Dec 21 08:23:54 2009 +1000 +++ b/src/bootstrap.h Sun Jan 31 18:28:24 2010 +1000 @@ -28,6 +28,31 @@ extern "C" { #endif +#define BOOTSTRAP_LOAD_ADDR 0x8C008000 +#define BOOTSTRAP_SIZE 32768 +#define BOOTSTRAP_MAGIC "SEGA SEGAKATANA SEGA ENTERPRISES" + +#define BINARY_LOAD_ADDR 0x8C010000 + +/** + * Bootstrap header structure + */ +typedef struct dc_bootstrap_head { + char magic[32]; + char crc[4]; + char padding; /* normally ascii space */ + char gdrom_id[6]; + char disc_no[5]; + char regions[8]; + char peripherals[8]; + char product_id[10]; + char product_ver[6]; + char product_date[16]; + char boot_file[16]; + char vendor_id[16]; + char product_name[128]; +} *dc_bootstrap_head_t; + /** * Dump the bootstrap info to the output log for infomational/debugging * purposes. --- a/src/loader.c Mon Dec 21 08:23:54 2009 +1000 +++ b/src/loader.c Sun Jan 31 18:28:24 2010 +1000 @@ -38,11 +38,6 @@ { "bin", "SH4 Bin file" }, { NULL, NULL } }; -#define BOOTSTRAP_LOAD_ADDR 0x8C008000 -#define BOOTSTRAP_SIZE 32768 - -#define BINARY_LOAD_ADDR 0x8C010000 - #define CDI_V2 0x80000004 #define CDI_V3 0x80000005