<< How To Use the Profiler >>

  This is the Guide of the profiling with the sample 
program"NInjaX".


1. Build the program

makefile: ninjax.mak
command

>nmake /f ninjax.mak


2. Make th GD image

Opration
(1) Invoke the GD-Workshop
(2) Create the "ninjax.cpj"
(3) Add the image files in the directory 
  "data"and "bmp"  into Level3 of GD-Workshop.
(4) Add the "dummy.dat" into the Level2 of 
   GD-Workshop.

3. Execute "NinjaX" program.
(1) Confirm the GD door of the GD-emulator 
   is closed.
(2) Load the "exe\ninjax.elf" to the Codescape.
(3) Run the "NinjaX".  (Press F9)
(4) Stop the program. (Press F9)

4. Use the profiler.
(1) Open the C source file "snMain.c".
   - Open the new window on the Codescape
   - Set the window type "source"
   - Right click on the "source window", select 
    "Goto source file", and chose the "snMain.c"
    (You can see the "snMain.c" source file on 
     the "source window")

(2) Set the break point at the syncronized point.   
   - Set the break point on the line the function 
    "njWaitVSync()" is called.
   
    *** snMain.c ***********************************
      void main(void)
      {
           KDS_PORT* pt;
	   
           sxInit();
           UserInit();
           while (UserMain()==0) {

               sxGetPeripheral();
               pt = kdGetPortStatus(3);
               if (pt->lmon) nwExecute();

   !<here>     njWaitVSync();
           }
           UserExit();
    ************************************************

(3) Run the program again and the confirm the program 
   is break at the break point.
(4) Invoke the propfiler
   - Chose the TOOLS->PROFILER on the Codescape menu.
   - Select the Item setup
      (Right click on the Profiler window and select 
       "setup".)
   - Set the Item "Counter1" and "Counter2".
(5) Set the Profiling on!
   - Click the Profiling switch.
     (Confirm the botton clolor is changed ret to green.)

(6) Profiling
   - Run the program (press F9)
   - Confirm the program is break at the break point.
   - If you need to get several frame's data, 
    repeat "Run" and "Break".

(7) Stop the profiling
   - Click the Profiling switch and the profiling off.

(8) Save profile data.
   - Right click on the profile window and select 
    "FILE->SAVE"

4. Use the "PRFDUMP.EXE"
   Use the "PRFDUMP.EXE", if you want to  get more 
   information from the profiling data.


Thanks!
