
                           SNES/FAMICOM Debugger v0.99c
                        

Hai you SNES fans,

This is the first release of SNES debugger V0.99c. (c) M.C.A./ELITE

The object of this tool is, to load a snesfile, edit a little, send to snes
and see the effect of your changes as fast as possible.(make trainers)

A real debugger has to be written in SNES code and run on the SNES.
So this is a sort of semi-debugger.

HOW TO USE
----------
FM_DEBUG.PRG is for mono and FC_DEBUG.PRG is for color.

L = Load a file
---------------
After the prompt, type in drive, path, name e.g. C:\SNES\MARIOKART.SMC
this will load the file into the 1st part of free memory.
The header will not be visible, and the start of the code will be on 
adres $8000-$FFFF $018000-$01FFFF and so on.
The maximum length will be $3FFFFF (total of 2 megs,16 mbit)
Then it gets the reset vector (intel format) and sets window 1 to
where it points to. This is the START of the code.
window 2 can now also be used to display file 1.

If loading a 2nd file there will be a prompt asking [L/R]
if you pick the [R] it will be loaded at window 2.
Now window 1 contains file number 1 and window 2 contains file number 2.
no mixing possible, this will also reserve extra space!
This option is made for file comparisons. (see C) 
If 2nd file is loaded at [L] it will overwrite file 1 in memory.

C=Compare 2 files
-----------------
If 2 files are loaded Left & Right, Compare option is active.
Set Left & Right window to $8000 (use tab) and press C
Every time there is a difference, the comparing... will be replaced
by a decimal offset from the start of the header and the decimal contents
of the offset. Also the contents of each window will be updated. 
This i use to easily create BASELINE format trainer files.
Like bluesbrothers legend trainer, i load the legend file left and
the original file to the right, then press C each time and write down
all numbers, until i reach $108000 which is start of the intro.
then i create a file using these numbers, add a few for header,length
etc.. and glue the intro.      
Compare starts at start of left window and start of right window.
If window 1 has reached file 2 it will show 'end of file reached'.

D = Decimal values
------------------
Display active window top adres value offset from start of header.
Same as in compare. Recalculate to hex with O \xxxxx if needed.

H = Help window
---------------
Short info about all functions, general info about vectors,registers,
opcodes with their meaning.
Each screen can be aborted back to the monitor by pressing ESC.
Other keys will display next screen (1-6).


A-X
---
The rep/sep/plp/rti instructions affect the processor status bits 4/5
(Flag X/M),these bits affect the width of various instructions.
In order to get a 100% correct disassembly you need to step through the
code in the same way as the snes would. This is almost impossible.
Therefore i have included the option to set your own width.
A = toggle accumulator immediate instructions between 8 and 16 bit.
affect lda #$12 - lda #$1234  adc/and/cmp/etc..
X = toggle x and y immediate instructions between 8 and 16 bit.
affect all cpx/cpy/ldx/etc..

G = Get or search
-----------------
B = byte
W = word (2 bytes)
L = longword (4 bytes)
T = text (case sensitive choice)
I = instruction

search starts in active window at screen adres start.
ESC cancels search.

N = Next search
---------------

Last string of G option stays in buffer. This will be searched for again.

M = Modify window start
-----------------------
Type any adres in range of $xx8000-$xxFFFF
adresses below $8000 are variable/stack/etc.. area's
they are out of range for this debugger. (what's the use?)
If you enter $408000 it will display $8000
Every thing above segment $3fxxxx will be masked.
So $419314 will display $019314.


O = various calculation
-----------------------
Enter any value or operator.

\ = decimal
$ = heximal (not needed is standard)
+ = plus
- = minus
* = times
/ = divide
! = or
~ = not
% = binary
& = and
^ = eor
> = shift right
< = shift left
also () and []


Alt-E = Edit
------------
Edit bytes, words, longs, or text. Escape to cancel.
Enter accepts & updates window.

Alt-S = Save file
-----------------
Save file in window 1, same length, only input the drive,path.name.

Same as load.

Control-A = Ascii/code toggle
-----------------------------
Switch between code display(default) and ascii display.
Works on both windows.

Control-B = Set or Clear Breakpoint
-----------------------------------
This seems a little strange. Each Breakpoint (10 max) you set will
put a branch to itself at the top of the active window.
So if you run a game it stops at this point, sometimes this can be
handy to find what certain places do. I'd rather had a fast colorcycle
routine at this point, but i know too little about this to implement
this in my program as yet.
If a breakpoint is set on a place which has alreay be set, it will
be cleared.

Control-K = Kill all breakpoints
--------------------------------
Restores all old values to all breakpoints.

Control-C = Quit all
--------------------
Go back to the Desktop.

Control-G = Go to start of file
-------------------------------
This gets the reset vector adres and sets the current window to
that adres.

Control-S = Send & Run file
---------------------------
Send window 1 to snes and run it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All info for this SNES debugger is gathered from info on different
BBS's.
65SC816 info from the dutch book "Het Microprocessor data boek" from
P.Hoogeboom (elektuur). pages 129-138
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want this Tool to be improved , then get in contact with us . 
Were looking for people that are coding on the SNES , or are trying
to write an assembler for the SNES . The more info we get the better 
this program will be . 

So if you have any info on other Hardware adresses , then pass them on 
to us . If its usefull info , you will be credited/rewarded for it !

We could have kept this program to " Elite(ndo) " use only , but we thought
it would be best to give it out , so that more people could play around
with it .

If any Bugs found , or Improvements are wanted . Get in touch through the
bbs numbers below !

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Quick Greetz to : Cynix , Quartex , Baseline , Legend 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         __                             __              ____
   | .  /\ \   __       __ _________   /\_\      .     /  \ \    .     |
  -*-  /  \ \ /\ \  .  /\ \\___  ___\ / / /     _____ / /\ \ \_____ -=o=-     
   |. / /\ \ \\ \ \    \ \ \__/\ \__// /_/_    /     \\ \ \ \ \  _ \ . |  .
      \/_/  \ \\ \ \  __\ \ \ \ \ \  \ \/\_\__/\  ___ \\ \ \ \ \ \\ \    
  .     / /\ \_\\ \ \/\_\\ \_\ \ \ \  \ \/_/\_\ \ \\ \ \\ \ \ \_\ \\ \   .
    .   \/_/ / / \ \/ / / \/_/_ \ \ \  \ \/ / /\ \ \\ \ \\ \/ / /\ \\ \  
          / / /   \  / /    /\_\ \ \_\  \  / /  \ \_\\ \_\\  / /\ \___\  *
          \/_/  .  \/_/     \/_/  \/_/   \/_/    \/_/ \/_/ \/_/  \/____/ 
                                                            ~ LoWLiFe ~
  o~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o

 Famicom/Snes/Famicom/Snes/Famicom/Snes/Famicom/Snes/Famicom/Snes/Famicom/Snes


                               Call Elitendo at :

  Hit & Run       (31) 405 742 36      World Hq    Atari ST/Snes-Famicom
  Risky Business  (44) 513 530 299     U.K. Hq     Atari ST/Snes-Famicom/Amiga
  Outer Region    (1)  303 766 2778    U.S.A. Hq   Atari ST/Snes-Famicom


 Snes/Famicom/Snes/Famicom/Snes/Famicom/Snes/Famicom/Snes/Famicom/Snes/Famicom


