Search
lxdream.org :: lxdream/src/bootstrap.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/bootstrap.c
changeset 167:71c0cc416a64
prev35:21a4be098304
next422:61a0598e07ff
author nkeynes
date Wed Jan 03 09:00:17 2007 +0000 (17 years ago)
permissions -rw-r--r--
last change Adjust timers when they're read rather than waiting until the next time
slice. Also temporarily cut the CPU time by 4.
Initialize the FRQCR register to 0x0E0A for convenience
file annotate diff log raw
1.1 --- a/src/bootstrap.c Mon Dec 26 03:54:55 2005 +0000
1.2 +++ b/src/bootstrap.c Wed Jan 03 09:00:17 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: bootstrap.c,v 1.5 2005-12-26 03:54:52 nkeynes Exp $
1.6 + * $Id: bootstrap.c,v 1.6 2006-06-19 11:00:40 nkeynes Exp $
1.7 *
1.8 * CD Bootstrap header parsing. Mostly for informational purposes.
1.9 *
1.10 @@ -103,8 +103,10 @@
1.11 /**
1.12 * Dump the bootstrap info to the output log for infomational/debugging
1.13 * purposes.
1.14 + * @param detail true to include a ful information dump, false for just
1.15 + * the facts, maam.
1.16 */
1.17 -void bootstrap_dump( char *data )
1.18 +void bootstrap_dump( char *data, gboolean detail )
1.19 {
1.20 struct dc_bootstrap_head *head;
1.21 int i, got, periph, crc, hcrc;
1.22 @@ -118,42 +120,39 @@
1.23 for( i=127; i>0 && buf[i] == ' '; i-- );
1.24 buf[i] = '\0';
1.25 periph = strtol( head->peripherals, NULL, 16 );
1.26 - INFO( "Bootstrap Name: %s Author: %-16.16s",
1.27 + INFO( "Name: %s Author: %-16.16s",
1.28 buf, head->vendor_id );
1.29 sprintf( buf, "%4.4s", head->crc );
1.30 crc = compute_crc16(head);
1.31 hcrc = strtol( buf, NULL, 16 );
1.32 - emit( NULL, crc == hcrc ? EMIT_INFO : EMIT_WARN, "File",
1.33 - " Header CRC: %04X (Computed %04X)", hcrc, crc );
1.34 - INFO( " Boot File: %-16.16s", head->boot_file );
1.35 INFO( " Product ID: %-10.10s Product Ver: %-6.6s Date: %-8.8s",
1.36 head->product_id, head->product_ver, head->product_date );
1.37 - INFO( " Disc ID: %-11.11s Regions: %-8.8s Peripherals: %07X",
1.38 - head->gdrom_id, head->regions, periph );
1.39 - strcpy( buf, " Supports: " );
1.40 - got = 0;
1.41 - for( i=0; i<28; i++ ) {
1.42 - if( periph & (1<<i) ){
1.43 - if( got ) strcat( buf, ", " );
1.44 - strcat( buf, dc_peripherals[i] );
1.45 - got = 1;
1.46 - }
1.47 - if( i == 11 ) i = 23; /* Skip 8-23 */
1.48 + if( detail ) {
1.49 + emit( NULL, crc == hcrc ? EMIT_INFO : EMIT_WARN, "File",
1.50 + " Header CRC: %04X (Computed %04X)", hcrc, crc );
1.51 + INFO( " Boot File: %-16.16s", head->boot_file );
1.52 + INFO( " Disc ID: %-11.11s Regions: %-8.8s Peripherals: %07X",
1.53 + head->gdrom_id, head->regions, periph );
1.54 + strcpy( buf, " Supports: " );
1.55 + got = 0;
1.56 + for( i=0; i<28; i++ ) {
1.57 + if( periph & (1<<i) ){
1.58 + if( got ) strcat( buf, ", " );
1.59 + strcat( buf, dc_peripherals[i] );
1.60 + got = 1;
1.61 + }
1.62 + if( i == 11 ) i = 23; /* Skip 8-23 */
1.63 + }
1.64 + INFO( buf, NULL );
1.65 + strcpy( buf, " Requires: " );
1.66 + got = 0;
1.67 + for( i=12; i<24; i++ ) {
1.68 + if( periph & (1<<i) ) {
1.69 + if( got ) strcat( buf, ", " );
1.70 + strcat( buf, dc_peripherals[i] );
1.71 + got = 1;
1.72 + }
1.73 + }
1.74 + INFO( buf, NULL );
1.75 }
1.76 - INFO( buf, NULL );
1.77 - strcpy( buf, " Requires: " );
1.78 - got = 0;
1.79 - for( i=12; i<24; i++ ) {
1.80 - if( periph & (1<<i) ) {
1.81 - if( got ) strcat( buf, ", " );
1.82 - strcat( buf, dc_peripherals[i] );
1.83 - got = 1;
1.84 - }
1.85 - }
1.86 - INFO( buf, NULL );
1.87 -#if 0
1.88 - INFO( " Area protection symbols:", NULL );
1.89 - for( i=0; i<8; i++ )
1.90 - INFO( " %d: %28.28s", i, &prot_symbols[(i*32)+4] );
1.91 -#endif
1.92 }
.