tools/baserom
changeset 66 2a78c4ff2eab
parent 42 e81b4e28b3e2
equal deleted inserted replaced
63:6a2083f7eeb8 66:2a78c4ff2eab
   150 
   150 
   151 	open TSHELL_OBY, "<$baseObeyFile" or die "Can't open $baseObeyFile: $!\n";
   151 	open TSHELL_OBY, "<$baseObeyFile" or die "Can't open $baseObeyFile: $!\n";
   152 	open TSHELL_NEW, ">$newObyName" or die "Can't write to $newObyName: $!\n";
   152 	open TSHELL_NEW, ">$newObyName" or die "Can't write to $newObyName: $!\n";
   153 
   153 
   154 	print "Creating tshell_$obyName.oby\n";
   154 	print "Creating tshell_$obyName.oby\n";
       
   155 	
       
   156 	if ($extraInclude) {
       
   157 		print TSHELL_NEW "#include \"$obyName/$extraInclude\"\n";
       
   158 	}
       
   159 
   155 
   160 
   156 	while (my $line = <TSHELL_OBY>) {
   161 	while (my $line = <TSHELL_OBY>) {
   157 		print TSHELL_NEW "$line";
   162 		print TSHELL_NEW "$line";
   158 	}
   163 	}
   159 
   164 
   219 		my $cmd .= "cpp $cppOpts $newIby.noinclude";
   224 		my $cmd .= "cpp $cppOpts $newIby.noinclude";
   220 		print "running: $cmd\n" if ($verbose);
   225 		print "running: $cmd\n" if ($verbose);
   221 		open IBYCPP, "$cmd |" or die "Can't run '$cmd': $!\n";
   226 		open IBYCPP, "$cmd |" or die "Can't run '$cmd': $!\n";
   222 		while (my $line = <IBYCPP>) {
   227 		while (my $line = <IBYCPP>) {
   223 			chomp $line;
   228 			chomp $line;
   224 			#print "TOMSCI: $line\n";
       
   225 			if ($line =~ m/^BASEROMHASHINCLUDE\s+[<"](.*)[>"]/ ) {
   229 			if ($line =~ m/^BASEROMHASHINCLUDE\s+[<"](.*)[>"]/ ) {
   226 				my $iby = $1;
   230 				my $iby = $1;
   227 				if (!$ibysProcessed{lc($iby)}) {
   231 				if (!$ibysProcessed{lc($iby)}) {
   228 					print "Adding $iby to stack\n" if ($verbose);
   232 					print "Adding $iby to stack\n" if ($verbose);
   229 					push @ibyStack, $iby;
   233 					push @ibyStack, $iby;