This is version 15-March-95 of our SNES debugger (c) M.C.A./ELITE What has been changed or added to the first version ? - When you used Control + G to go to the start of the game , and you had made some changes , they were not saved. - Short branches were adressed wrong. - Big ASCII screen colour is changed to Light green. - DELETE key is Activated in the File-Selector Box. ----------------------------------------------------------------------------- Why is all the effort made to make this a Decend Dissambler for the SNES ? Coz SNASM suxxx to hard.. An Assembler will proberly follow as well , but dont count on it in the next 3 months or so.. Copyright for this program is shafted..then again , a big part of the knowledge that has been added into this program has been worked out by MCA and RADIUM of ELITE , no manual gave us any help there. So try it out, and dump it on all kind of File-Nets ! ----------------------------------------------------------------------------- The Program is written in MASM 6.1 You are now the owner of a very powerful Snes-trainer-searcher. It's very easy to use, very little typing needed, unlike many other debuggers. This program isnt the Final version, plenty of updates are likely to follow. Thats up to you, the user of this program to come up with suggestions and or find bugs that have be dealt with. History ------- I (MCA) wrote this program about 2 years ago, then released one of the first versions in the Atari ST scene. Along with the Snespac (my 65816 assembler) I had everything needed for Battery/Pal/Slow-fixing and making Trainers for the Snes. I decided to keep the next versions private, because we had a lot of competition. And some ST guys used our programs for trainers and claimed, they had written their own stuff... At the end of december 94 I bought myself a 486 and thought.. 'peace of cake' to port my debugger across to the PC. 'Powerful, fast, 4 meg, etc..' NOT! First of all, the fucking Dos is only acting as a 8086 machine! The 4 meg can NOT be addressed directly! The instruction set is VERY limited! I spent about 1 month only to figure out how to use the fucking flat model with 32 bit pointers, no 32 bit os installed, still not working... But It's maybe to soon to start with the Heavy stuff, it will come to that later in time. So this Program is developed for the real mode (8086) and should therefore run on all PC's ? The program on the ST is more powerfull and has more possibilities like a fast Graphics/Sprite viewer, locate,Convert and play PCM samples on the Falcon or Snes, 32 bit various calculation, edit in memory (no segment limits) Set breakpoints and stick a real snes debugger to send along into the Copier to break it down on there. Dissassemble code to disk, most pieces ready to assemble 100% correctly. And a better file/memory structure. Auto load --------- Type SN_DEBUG.EXE FILENAME.SMC and the file will be loaded automaticly. Setting Paths will not work. L (Load file) ------------ This will pop up a simple fileselector with Directory's on Top and no sort whatsoever. ( works like Terminate Commander ) Pick a file by using the arrow keys and press return. Left to go up to the root, right on a directory to enter it. Use Tab & L to load in the left or right window/buffer. When a file is loaded it reserves a $8200 byte buffer for each side. And loads the same amount. The 1st $200 bytes always contain the header (address $xx7e00 or $xxfe00 for hirom) The next $8000 bytes contains the code. If 1 file is loaded, both buffers are filled with the same code. It is possible to load 2 different files of any size. All loaded files stay open until another is loaded or you quit neatly !!!! The code will point to the start of the GAME. The program looks for hirom or lowrom mode (checks header byte 2/3) gets the reset vector and correct bank, and displays code from that point. If a file is openend it's attribute is checked (hidden/system/etc..) It then tries to change it to normal, if not possible (e.g. CD-ROM) then the file will be loaded as READ-ONLY! TAB --- Switches between left and right window. Displays the current filename at the top of screen. Lets you see which window is active, and what file it contains. If 1 file loaded, both have the same name. If 2 files are loaded, they might be different. Use L to load a file in the current buffer. F1 = Help window ------------------ Short info about all functions, general info about vectors,registers and most needed opcodes with their values. Each screen can be aborted back to the monitor by pressing ESC. Other keys will display next screen (1-3). A (Accumulator size toggle) -------------------------- 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.. B (Bank) ------- Enter bank number in hexidecimal. C (Compare 2 files) ------------------ If 2 files are loaded Left & Right, the Compare option is active. Setup the start addresses for comparison and Press C each time. Every time there is a difference, the comparing...text will be replaced by a heximal offset from the start of the header. Also the contents of both windows will be updated. 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'. E (Edit) ------- Edit Bytes, Words, Longs(triple bytes), or Text. Escape to cancel. Enter accepts & updates top active window buffer. If you type 'G','L', and enter a 4 byte string instead of 3, like 12345678 it will write 345678 !! So the 1st byte is masked off. 123456 entered will work 100%. Edit will Not Save it to the file! On increase or decrease bank you will be asked to save the bank. F (Fill) type 1/2/3 ------------------ Fill left window with value, from left window address until right window address, stays within bank. - Type 1 : enter byte value - Type 2 : byte,skip,byte,skip (wipe attributes) - Type 3 : add byte values (if 'offset' found) G (Get or search for) -------------------- Esc will be checked at every bank change and cancels the search. If the string isn't found it will display 'end of file reached and return to address $00.8000 or $80.0000 (beginning of file+header) B = byte W = word (2 bytes) L = triple bytes (3 bytes) T = text (case sensitive choice) I = instruction S = special O = Offset Instruction search: Dissassembles each address and checks. Example: jml #$1 #$1ff 8] Special search: When searching for 5c??c0 1st one needs to be a BYTE then insert no more as 25 ?'s each ? stands for a byte, last one also must be a BYTE. So 5c??c0 means look for jml(5c) and the 4rth must be c0 (bank number) this will find EVERY long jump to bank \192 also 8d???????22 ok, 1st must be 8d and the 9th must be 22 also 8d?42 nice to find all sta dma registers. or 9c?21 to find all stz audio registers. 1234??56 is not ok! keep 1st and last at byte length. Offset search: (4 letter entry !) find hidden text stuff like a=0 b=1 c=2 d=3 etc.. Example: Type STAR this finds all 53.54.41.52 strings but ALSO 12.13.0.11 or 24.25.12.23 you name it ! Use your imagination. H (Hex offset) ------------- Displays current offset from headerstart to top active window in hex. M (Modify window adress) ----------------------- This changes all typed number/symbols into fake SEGMENTED adresses. Type any adres in range of $xx8000-$xxFFFF. for lowrom games. and range $xx0000-$xxffff for hirom. H is used as a filestart symbol. If you type H it'll show adresses $xx7e00 or $xxfe00 and show the header bytes. Also very handy if you have hex offset adresses and want to know where they are... So then type H+9c334 or whatever. It'll bring you to the right adress. N (Next search) -------------- Last entered string of 'G' option stays in buffer. This will be searched for again. Auto Increase banks. 'N' works always in Sample mode. O = various (16 bit) calculation -------------------------------- Enter any value or operator.(recursive) \ = decimal $ = heximal (not needed is standard) + = plus - = minus * = times / = divide also () h = this symbol is used for the actual filestart. I will update this to 32 bit calculation soon. P (Printer port settings) ------------------------ Default LPT 1, gets port values from the bios variable field. Set at 1-4. If 2-4 is used set BEFORE sending! R (action Replay) ----------------- Toggle on/off, first enter value with control-R. Changes code in other buffer on send. S (Send & Run file) ------------------ Be sure to save the changed bytes first, because it uses a different $2000 byte buffer to send the game. Send active window (whole file) to snes and run it. Use joined files to work with. Be sure to set the right type of copier for hirom games. Also be sure to set the right LPT port. Esc cancels the sending. The patching for Action replay will be done in this $2000 buffer. Q - Toggle cop/brk instructions to 1 or 2 bytes in length. Some games change the cop/brk size each time called. (Actraiser)... 2 bytes is default. X (indeX size toggle) --------------------- X = toggle x and y (indexed) immedi...
con369