filename | src/bootstrap.h |
changeset | 1109:700c5ab26a63 |
prev | 1100:50e702af9373 |
author | nkeynes |
date | Fri Dec 02 18:18:04 2011 +1000 (12 years ago) |
permissions | -rw-r--r-- |
last change | SH4 shadow-mode tweaks - Fix exceptions generated by the translator to account for the excepting instruction(s) in the cycle counts. - Compare floating point regs bitwise rather than with FP comparisons (otherwise can fail due to nan != nan) - Dump the translated block when we abort with an inconsistency |
file | annotate | diff | log | raw |
nkeynes@26 | 1 | /** |
nkeynes@561 | 2 | * $Id$ |
nkeynes@26 | 3 | * |
nkeynes@26 | 4 | * CD Bootstrap header parsing. Mostly for informational purposes. |
nkeynes@26 | 5 | * |
nkeynes@26 | 6 | * Copyright (c) 2005 Nathan Keynes. |
nkeynes@26 | 7 | * |
nkeynes@26 | 8 | * This program is free software; you can redistribute it and/or modify |
nkeynes@26 | 9 | * it under the terms of the GNU General Public License as published by |
nkeynes@26 | 10 | * the Free Software Foundation; either version 2 of the License, or |
nkeynes@26 | 11 | * (at your option) any later version. |
nkeynes@26 | 12 | * |
nkeynes@26 | 13 | * This program is distributed in the hope that it will be useful, |
nkeynes@26 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
nkeynes@26 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
nkeynes@26 | 16 | * GNU General Public License for more details. |
nkeynes@26 | 17 | */ |
nkeynes@26 | 18 | |
nkeynes@1 | 19 | /* |
nkeynes@1 | 20 | * IP.BIN related code. Ref: http://mc.pp.se/dc/ip0000.bin.html |
nkeynes@1 | 21 | */ |
nkeynes@736 | 22 | #ifndef lxdream_bootstrap_H |
nkeynes@736 | 23 | #define lxdream_bootstrap_H 1 |
nkeynes@736 | 24 | |
nkeynes@736 | 25 | #include "lxdream.h" |
nkeynes@1 | 26 | |
nkeynes@1 | 27 | #ifdef __cplusplus |
nkeynes@1 | 28 | extern "C" { |
nkeynes@1 | 29 | #endif |
nkeynes@1 | 30 | |
nkeynes@1095 | 31 | #define BOOTSTRAP_LOAD_ADDR 0x8C008000 |
nkeynes@1100 | 32 | #define BOOTSTRAP_ENTRY_ADDR 0x8c008300 |
nkeynes@1095 | 33 | #define BOOTSTRAP_SIZE 32768 |
nkeynes@1095 | 34 | #define BOOTSTRAP_MAGIC "SEGA SEGAKATANA SEGA ENTERPRISES" |
nkeynes@1099 | 35 | #define BOOTSTRAP_MAGIC_SIZE 32 |
nkeynes@1095 | 36 | |
nkeynes@1095 | 37 | #define BINARY_LOAD_ADDR 0x8C010000 |
nkeynes@1109 | 38 | #define BINARY_MAX_SIZE (0x8D000000 - BINARY_LOAD_ADDR) |
nkeynes@1095 | 39 | |
nkeynes@1095 | 40 | /** |
nkeynes@1095 | 41 | * Bootstrap header structure |
nkeynes@1095 | 42 | */ |
nkeynes@1095 | 43 | typedef struct dc_bootstrap_head { |
nkeynes@1095 | 44 | char magic[32]; |
nkeynes@1095 | 45 | char crc[4]; |
nkeynes@1095 | 46 | char padding; /* normally ascii space */ |
nkeynes@1095 | 47 | char gdrom_id[6]; |
nkeynes@1095 | 48 | char disc_no[5]; |
nkeynes@1095 | 49 | char regions[8]; |
nkeynes@1095 | 50 | char peripherals[8]; |
nkeynes@1095 | 51 | char product_id[10]; |
nkeynes@1095 | 52 | char product_ver[6]; |
nkeynes@1095 | 53 | char product_date[16]; |
nkeynes@1095 | 54 | char boot_file[16]; |
nkeynes@1095 | 55 | char vendor_id[16]; |
nkeynes@1095 | 56 | char product_name[128]; |
nkeynes@1095 | 57 | } *dc_bootstrap_head_t; |
nkeynes@1095 | 58 | |
nkeynes@26 | 59 | /** |
nkeynes@26 | 60 | * Dump the bootstrap info to the output log for infomational/debugging |
nkeynes@26 | 61 | * purposes. |
nkeynes@26 | 62 | */ |
nkeynes@502 | 63 | void bootstrap_dump(void *data, gboolean detail); |
nkeynes@1 | 64 | |
nkeynes@1099 | 65 | void bootprogram_scramble( unsigned char *dest, unsigned char *src, size_t length ); |
nkeynes@1099 | 66 | void bootprogram_unscramble( unsigned char *dest, unsigned char *src, size_t length ); |
nkeynes@1 | 67 | #ifdef __cplusplus |
nkeynes@1 | 68 | } |
nkeynes@1 | 69 | #endif |
nkeynes@736 | 70 | |
nkeynes@736 | 71 | #endif /* !lxdream_bootstrap_H */ |
.