1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>buryarg.TWL</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9<STYLE type="text/css">
10<!--
11.sample_source{
12  background-color : #e8e8e8;
13}
14H3{
15  color : teal;
16}
17.command_list{
18  margin-bottom : 16pt;
19}
20.command_desc{
21  }
22.command_item{
23  margin-top : 16pt;
24  background-color : #e8e8e8;
25}
26.blockquoted_table {
27  border : 1px;
28  width : 80%;
29}
30TD,TH{
31  border-color	: #c0d8d8;
32  padding       : 1pt 4pt 1pt 4pt;
33  border-width  : 1px;
34  border-style  : solid;
35}
36-->
37</STYLE>
38</HEAD>
39<BODY>
40<H1 align="left">buryarg.TWL <IMG src="../image/TWL.gif" align="middle"></H1>
41<H2>Description</H2>
42<P>This command is for TWL ROMs. <B>See <A href="buryarg.html"><CODE>buryarg</CODE></A> for details on NITRO ROMs.</B></P>
43<P>In TWL-SDK, an area for argument data is set up in the ROM image. By rewriting this section before startup, you can pass which parameters are possible to use as C language argc and argv format arguments. The ROM image file can be directly overwritten, so you can test the program under multiple conditions without having to recompile.</P>
44<P><CODE>buryarg.TWL</CODE> is a tool for writing argument data to the argument data area for the specified binary data. This tool is used with TWL ROMs (both NITRO/TWL hybrid ROMs and TWL-exclusive ROMs); use <A href="buryarg.html"><CODE>buryarg</CODE></A> on NITRO ROMs.</P>
45<P>Unlike <A href="buryarg.html"><CODE>buryarg</CODE></A>, the <CODE>buryarg.TWL</CODE> command writes argument data to the ROM header region. With NITRO ROMs, if the argument data is not referenced, the region was not created. With TWL ROMs, on the other hand, <CODE>buryarg.TWL</CODE> can be used because the region exists regardless of whether it is referenced or not.</P>
46<P>However, argument data embedded for TWL hybrid ROM builds cannot be loaded in NITRO mode.</P>
47<H2>Using the Tool</H2>
48<H3>Start Command</H3>
49<P><CODE>% buryarg.TWL [OPTION]... TWLSRLFILE [argument]...</CODE></P>
50<P><CODE>TWLSRLFILE</CODE> is the original ROM file to overwrite. Normally, this is a .srl file. However, if you specify a .tlf file, it will be analyzed, and the operation will be done on the header binary.</P>
51<P>If the <CODE><B>-r</B> or <B>--remain</B></CODE> options are specified, the original file will remain. By default, the original file will be modified. So if you don't want to change the original file, specify this option. The alias filename is the original filename plus <CODE>.argAdded</CODE>. When the output file is selected with <CODE>-o</CODE> option, the original file will not be changed, even when this option is not specified.</P>
52<P>The <B>-o</B> and <B>--output</B> options take arguments. With this option, the output file is specified as in the following: <CODE>-o=dest.srl</CODE> or <CODE>-o dest.srl</CODE>. <B>Do not specify the same file as the original file for the output file.</B> Also, if &quot;<CODE>-</CODE>&quot; (minus) is specified as the output file, output goes to standard output.( Specify as: <CODE>-o-</CODE>. See <CODE>--stdout</CODE>, which is explained below.</P>
53<P><CODE><B>--stdout</B></CODE> is the same as specifying <CODE>-o-</CODE>. It outputs to standard output.</P>
54<P>The <CODE><B>-f</B></CODE> and <CODE><B>--file</B></CODE> options take arguments. These options are for specifying a file as the data to replace. Specify as: <CODE>-f=rep.dat</CODE> or <CODE> -f rep.dat</CODE>.</P>
55
56<P>If the <CODE><B>-q</B></CODE> or <CODE><B>--quiet</B></CODE> option is specified, quiet mode is used, and only error messages will be output. </P>
57<P>If the <B><CODE>-v</CODE></B> or <B><CODE>--verbose</CODE></B> option is specified, detailed operation descriptions are displayed. Because output is made on the standard output, do not specify these options together when writing ROM data to the standard output.</P>
58<P>The <CODE><B>-h</B></CODE> or  <CODE><B>--help</B></CODE> options display simple instructions.</P>
59<P>The <CODE><B>-d</B></CODE> or <CODE><B>--debug</B></CODE> options are for debugging. They dump the data that is to be replaced.</P>
60<P>The <CODE><B>--version</B></CODE> option displays the command version.</P>
61<H3>Argument Data Area</H3>
62<P>As stated earlier, the argument data region for TWL ROMs is located in the ROM header. By overwriting this region, different parameters can be passed to the ROM without having to recompile.<BR>
63</P>
64<P><BR> <BR> <B>Caution:</B> Be careful to avoid the following errors.</P>
65<BLOCKQUOTE>- You specified the same file as the input file with the <CODE>-o</CODE> option. <BR>&amp;rarr; This specification is not required if you want to overwrite the argument data. This is the default behavior.</BLOCKQUOTE>
66<BLOCKQUOTE>- You overwrote the argument data for the SRL file. Then started up from the TLF file. <BR>&amp;rarr; When an application is started from a TLF file, the modules included in the TLF file will be read by the debugger, so even if the SRL file is overwritten, those changes will not be applied. If starting an application from a TLF file, be sure to specify the TLF file with <CODE>buryarg.TWL</CODE> and overwrite the necessary data.</BLOCKQUOTE>
67<BLOCKQUOTE>- You overwrote the argument data for the TLF file. Then started up the SRL file. <BR>&amp;rarr; This is the opposite of the example above. Overwrite the argument data for the SRL file.</BLOCKQUOTE>
68<BLOCKQUOTE>- You tried to overwrite the argument data on a FINALROM build image. <BR>&amp;rarr; Argument data can be written even for FINALROM build images. However, <CODE><A href="../os/argument/OS_GetArgc.html">OS_GetArgc()</A></CODE> will always return 0, and <CODE><A href="../os/argument/OS_GetArgv.html">OS_GetArgv()</A></CODE> will always return <CODE>NULL</CODE>.</FONT></BLOCKQUOTE>
69<BLOCKQUOTE>- You tried to overwrite the argument data on a NITRO mode ROM. <BR><FONT color="#ff0000">&amp;rarr; Only TWL ROMs can be overwritten with this command. </FONT> For NITRO mode ROMs, use the <A href="buryarg.html"><CODE>buryarg</CODE></A> command instead of <CODE>buryarg.TWL</CODE>.</BLOCKQUOTE>
70<H3>FINALROM and Argument Data</H3>
71<P>Argument data cannot be handled with a FINALROM. The <A href="../os/argument/OS_GetArgc.html"><CODE>OS_GetArgc</CODE></A> function always returns 0, and the <A href="../os/argument/OS_GetArgv.html"><CODE>OS_GetArgv</CODE></A> function always returns <CODE>NULL</CODE>. The reason that argument data cannot be handled for FINALROM builds is that a security hole may develop if a program depends on data that can be provided externally. Argument data is embedded as plain text without encryption or other encoding. </P>
72<P>Argument data can be embedded even in the case of FINALROM builds, and the check routine inside programs remains as long as it is not deleted. Attention is required because this data and code is meaningless in the case of FINALROM builds. (For example, for a game with 30 stages, analysis is made of a check routine such as &quot;STAGE = 50&quot; may lead to the assumption that there may be a hidden stage.)</P>
73<H2>Location</H2>
74<P><CODE>$TwlSDK/tools/bin/buryarg.TWL.exe</CODE></P>
75<H2>See Also</H2>
76<P><A href="buryarg.html"><CODE>buryarg</CODE></A><BR> <A href="../os/argument/OS_GetArgc.html"><CODE>OS_GetArgc</CODE></A><BR> <A href="../os/argument/OS_GetArgv.html"><CODE>OS_GetArgv</CODE></A><BR> <A href="../os/argument/OS_GetOpt.html"><CODE>OS_GetOpt*</CODE></A></P>
77<H2>Revision History</H2>
78<P>2008/07/08 Clarified that <A href="buryarg.html"><CODE>buryarg</CODE></A> is used for NITRO.<BR> 2008/06/24 Added the fact that this mechanism cannot be used with TWL.<BR> 2005/08/30 Added the <CODE>OS_GetOpt*</CODE> function to <B>See Also</B>. Added <CODE>--stdout</CODE>. <BR> 2005/07/22 Support for NLF files. <BR> 2005/07/21 Initial version.</P>
79<hr><p>CONFIDENTIAL</p></body>
80</HTML>