________      __        __    __________      ________      
                  _/########\_   {##\_     {##}  {##########}   _/########\_    
    __      __   {##/ŻŻŻŻŻŻ\##}  {####\_   {##}  {##}ŻŻŻŻŻŻŻ   {##/ŻŻŻŻŻŻ\##}   
   {##}    {##}  {##\___    ŻŻ   {##}\##}  {##}  {##}_______   {##\___    ŻŻ    
   {##\_  _/##}   Ż\####\___     {##}{##\_ {##}  {##########}   Ż\####\___      
    Ż\##}{##/Ż      ŻŻŻ\####\_   {##} Ż\##}{##}  {##}ŻŻŻŻŻŻŻ      ŻŻŻ\####\_    
     {##\/##}     __    ŻŻŻ\##}  {##}  {##\{##}  {##}           __    ŻŻŻ\##}   
      Ż\##/Ż     {##\______/##}  {##}   Ż\####}  {##}_______   {##\______/##}   
       {##}       Ż\########/Ż   {##}     Ż\##}  {##########}   Ż\########/Ż    
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

version 2.91

 

created by: creaothceann aka illegal eagle
last update: 2006-06-12 15:19
   
zLib library: Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
zLib Pascal translation: Copyright (C) 1998 by Jacques Nomssi Nzali
MemCheck unit: Copyright (C) Vincent Mahon and Jean-Marc Eber
tPNGImage / PNGDelphi: Copyright (C) Gustavo Daud

vSNES uses countless technical SNES info from various sources all around the web (see romhacking.net for a nice selection of documents). For example, the code for analyzing HDMA tables is an almost literal translation from anomie's register doc into code. And of course the emulator sources of ZSNES and SNES9x helped a lot, too.



1. CONTENT

1. Content
2. Disclaimer
3. Preface
4. Requirements
5. Installation
6. De-Installation
7. Interface
  7.01 Global shortcuts
7.02 Preview window
7.03 PalViewer
7.04 MemViewer
7.05 SceneViewer
  7.05.1 Screen rendering
7.05.2 Regular backgrounds
7.05.3 Sprites
7.05.4 Mode7 backgrounds
7.05.5 HDMA
7.05.6 Offset-Per-Tile
7.06 HexEditor
7.07 List Editor
7.08 SPCViewer
7.09 Movie Editor
7.10 CHT Editor
7.11 Options
8. GB cartridges
9. Known limitations
10. Future plans
11. Resources
12. Internal structures
13. Credits
14. Links
15. Version history




2. Disclaimer

I'm not responsible for any damages that result in using this software. It's free, and it is NOT n00b-proof. Give it invalid data, and it will screw up itself, maybe even the OS you're running it on, and maybe the hard drives it has access to - although I don't intent this, I cannot guarantee anything. Just in case you missed the point: USE AT YOUR OWN RISK.

If you don't understand vSNES, or don't like it, then it just isn't made for you. Consider yourself out of the target group. And even if you like it, you should try other tools too.



3. Preface

Now that this is out of the way, some general info.

vSNES represents a SNES console, like an emulator. It simply consists of some memory that holds the status of the hardware. Unlike an emulator, it lacks the ability to execute the code in the RAM or ROM chips, allowing the components to interact. So what good is it?
Well, emulators like Genecyst or MEKA let you view the hardware at work, for example the color palette or the video RAM. ZSNES lacks such features, but the savestates contain all the info. A savestate is like a SNES frozen in time.

vSNES comes with several tools:

  1. The Preview Window shows you the picture that is included in the ZSNES or Super Sleuth savestate file.
  2. The MemViewer allows you to view the content of VRAM, WRAM and the cartridge using the colors selected in the PalViewer.
  3. The SceneViewer shows you the current screen of the SNES and the parts it consists of (i.e. regular backgrounds, sprites, Mode7 backgrounds, HDMA and offset-per-tile info).
  4. The HexEditor shows the content of the larger RAM or ROM arrays as bytes and as text, and allows you to edit them.
  5. The List Editor allows you to edit the values in the main list.
  6. The SPCViewer shows the header, the ID666 tag and the extended ID666 tags of a SPC file. It also loads the data into vSNES, so you can view the variables in the main window's APU list and the arrays in the HexViewer.
  7. The Movie Editor allows the loading, viewing, editing and saving of SMV and ZMV movies. (ZMV support still incomplete.)
  8. With the CHT Editor you can change the binary cheat code files of ZSNES and SNES9x.
  9. The CartViewer has a second page that shows the content of the internal ROM header, just as it is stored in the ROM. It also allows selecting the correct ROM type if the automatic detection fails; this might be required to get correct HDMA table info.

There's lots of potential in vSNES, even an emulator would be possible - but that would be a bit more difficult.



4. Requirements

You need a PC that can run Windows 95, or a compatible OS. The program uses toolbars, so it won't work with Windows NT 3.51 or older versions of Windows NT. The toolbars are designed to be flat, so the version number of your COMCTL32.DLL file should be 4.70 or higher. (Only very few Windows systems have an older version.) The color depth should be at least 16 bits per pixel, and the resolution at least 800x600 pixels. A mouse is required to access most buttons.

Note: The program is designed for the default font and colors.

Savestate files are quite small - only the cartridges, which are loaded entirely into memory so that they can be edited, may take up some space in RAM. (vSNES won't reject any file, even though the largest commercial ROMs are 6 MB.) The internal structures take the most memory - a bit more than 48 MB of free RAM should be enough.

Of course you should have a clue what you're playing with. ;) I won't explain the internals of the SNES in this file.



5. Installation

Install vSNES just by extracting the files into their own directory. The INI and TXT files of the different versions may be incompatible, so using a previous vSNES directory is NOT recommended!



6. De-Installation

Just delete "vSNES.exe" and the files that came with it. No changes to the registry are made, and only the file "vSNES.ini" is created automatically.



7. Interface

You may drop a savestate file onto the "vSNES.exe" file to load it immediately. vSNES won't complain about files that are too small or too big. If the file isn't a compatible savestate file, you'll see only garbage - if you're not lucky and the file contains invalid data, vSNES will crash.

The interface is build of the standard controls that are included in Delphi 5.0, so you shouldn't have problems with the basic usage. Most toolbar buttons are switches and control the visibility of their corresponding window. ESC closes the active window.

1 2 3 4 5 6

The toolbar consists of six parts:

  1. loading, reloading, saving and launching (i.e. executing) savestate files
  2. loading, reloading, saving and launching cartridges
  3. SPC viewer, Movie Editor and CHT Editor
  4. the tool window buttons: Preview, PalViewer, MemViewer, SceneViewer, HexEditor and ListEditor
  5. Options window and Help button
  6. Quit button

The 5th button is for inserting cartridges, i.e. you can link to any file you want, preferably SNES or GB ROMs. Note that only the first file in a ZIP archive is loaded.

In the statusbar you can see:

  1. the slot of the savestate
  2. the savestate name
  3. the cartridge file name
  4. the cartridge ROM size
  5. the cartridge SRAM size, if a SRM file or structure was found

Between the toolbar and the statusbar there's an area with six lists. Basically it's the content of a savestate file minus the arrays, and some comments. It relies on the file "SNES.txt" which must be in the same directory as "vSNES.exe".

ZSNES movie files contain a savestate followed by the keystrokes, so you can use them as well.

The custom "savestate" and "cartridge" dialogs update their lists when vSNES gets the focus. Note that the CartViewer displays only the info in the internal ROM header - it doesn't check them. Use NSRT to detect bad checksums and/or ROMs.



7.01 Global shortcuts

F1 = clicks the help button, which launches the default browser
F2 = clicks the save button
F3 = clicks the open button
F4 = clicks the HexEditor button
F5 = clicks the reload button
F6 = clicks the cartridge button
F8 = toggles "update MemViewer and PalViewer" in options
F9 = clicks the "update the INI file now" button in options
ESC = closes the topmost window
Alt + F4 = clicks the quit button




7.02 Preview window

This window shows the picture that is stored in the last 7 KB of a ZSNES savestate file, or in a Super Sleuth savestate file. You can increase or decrease the zoom level from 1x up to 8x, and save the bitmap via the "middle mouse button" function.

Older ZSNES savestate files may have missing or invalid previews. ZSNES movie files don't have a preview. Files that were saved via the ZSNES GUI show a picture of the GUI instead of the game.

NOTE: The ZSNES preview detection will fail if a ZSNES savestate file contains no preview, but at least 7168 bytes of "custom chip" info. This should be very rare though.



7.03 PalViewer

The PalViewer shows the 256-color table that is used by the SNES graphics system. You can select a color to view the RGB attributes, the HTML string, the group it belongs to and the index.

You can change the color by double-clicking a color or by clicking the panel at the bottom. A color selection dialog will appear, with the 16 colors of the currently selected row as custom colors.

The topmost button inverts all RGB values. This is useful for screens that use the "color subtraction" feature, e.g. in the level "Torchlight Trouble" of DKC.

The two lower buttons allow loading and saving the palettes from and to a palette file. See the options for the format of the files.



7.04 MemViewer

The MemViewer shows the decoded tiles of the VRAM, WRAM or cartridge ROM. You can choose the bit depth, source offset and size of the viewing window. You can also save the window content to a BMP or PNG file (with the used palette part) or copy it to the clipboard (without palette), and set the zoom level of the window.

The colors in the window depend on the selected bit depth and the selected color in the PalViewer. For example, when the MemViewer is in "2-bit" mode, the window has a maximum of 4 colors. Dividing the 256 colors of the palette by 4, you get 64 color groups. The group selected by the PalViewer's selected color is used for coloring the pixels in the window.

Just try it, it should become clear then.



7.05 SceneViewer

This window shows the current screen and the parts it consists of, i.e. the four regular backgrounds, the sprites, the Mode7 backgrounds, the HDMA tables and the offset-per-tile tables. You can use the buttons at the top to switch between the sections.

The info page shows some values from the main window's PPU list in a more readable format.



7.05.1 Screen rendering

The screen rendering is still incomplete, especially the 16-bit mode. I don't know all details of how the SNES renders the screen and there may be bugs in the current implementation, so don't expect the output to be perfect. Anyway, vSNES' primary purpose is to show the raw layers.

On the right side you can toggle the visibility of the layers for the MainScreen and the SubScreen. The first item of the checklist ('sprites priority 3') is the topmost layer in the screen - unless the "BG3 p1 on top" checkbox is checked and BG Mode 1 is selected.
Naturally, the screen rendering time will increase with the number of visible layers.

The "show entire screen" feature from vSNES 1.37 will probably never be implemented into the newer versions.

For the 8-bit screen you can select with the "main and sub" checkbox if you want to see just the MainScreen or the SubScreen, or both. Use the two buttons at the top to select the source when the box is unchecked.

In the "screen configuration" box there's a panel with four buttons. You can use them to quickly activate all backgrounds or sprites, to invert the layering or to reload the original setting.

There're always three buttons in the lower right corner. The left one controls if your mouse buttons will zoom or move the images. You can use the middle mouse button (and the right mouse button in "move" mode) to switch between the modes. (Your middle mouse button must be configured to use the "middle mouse button" function. Some mouse drivers (e.g. Logitech's) allow you to assign a special function to this button, which won't be detected by vSNES.)
If the "update" button (in the center) is down, then the current image will be updated when a new savestate has been loaded. The "save" button (right) allows you to save the current image to a file or to the clipboard.



7.05.2 Regular backgrounds

The four regular backgrounds of the SNES and their attributes can be viewed in the first part of the "layers" section. Each BG display is build on-the-fly, so on ancient systems (such as mine) there may be noticeable delays when you switch to a huge BG. Each tile can have priority 0 or priority 1, and you can select which tiles you want to see. On the right side you can see the currently selected tile and its attributes.

When the "DirectColor" feature is enabled then each tile of the 256-color BGs can select from up to 2048 colors.

The transparency setting controls how the transparent colors of the backgrounds will be treated: "no transparency" shows them, and the other options will set them to palette color 0, the "color constant" or a color of your choice. The color dialog that appears after you clicked the "custom color" panel will have the leftmost palette column as custom colors.

Note: Only the "no transparency" setting will use an unmodified palette for the image. The other settings set the first palette entry of each sub-palette to the selected color.



7.05.3 Sprites

The second page of the "layers" part shows the 128 hardware sprites and their attributes. You can focus the sprite list (e.g. with the TAB key) and use the mouse and the spacebar to hide sprites. Hidden sprites won't react to mouse movements.

If two sprites overlap, then the sprite with the lower index is on top.

The PPU chips of the SNES (PPU = picture processing unit) are not fast enough to handle all possible situations. If the number of sprites on a line exceeds 32, then the sprites with higher indices will disappear. Sprites consist of small 8x8 tiles, and when the number of these tiles per line exceeds 33, then some of them won't be displayed.
Some games rely on these "features" to hide sprites.



7.05.4 Mode7 Backgrounds

The third page of the "layers" part shows the 128x128 8-bit tiles of Mode7. The tiles cannot be mirrored, have no priority of their own and are always 8x8 pixels in size.

BG1 always uses the entire palette. If EXTBG mode is enabled then BG2 can be used, and the palette index of each of its pixel controls if it has priority 1 (index >= 128) or priority 0 (index < 128). You can use the buttons at the bottom to select the pixels you want to see.

Examples for EXTBG mode are Contra 2 (stage 2), the Turrican intro, the Tiny Toons Adventures title screen and Winter Extreme Skiing.

You can see the 256 Mode7 tiles in the MemViewer. Select the "Mode7" and "VRAM" radiobuttons, and set the offset to zero and the window size to 16x16 tiles or more.

When the "DirectColor" feature is enabled then BG1 can use the first 256 colors of the DirectColor table.



7.05.5 HDMA

This page displays the 8 HDMA tables.

Note that the address decoder only works correctly with the standard memory map. It also does not wrap at bank/segment boundaries, though most cartridges should not require it.

Most HDMA tables require the ROM and a correctly set ROM type (LoROM/HiROM).



7.05.6 Offset-Per-Tile

In the BG modes 2, 4 and 6 this page displays the offset-per-tile tables. The active row of values is highligthed.



7.06 HexEditor

The HexEditor can be used to edit the large data arrays that can't be edited in the main window's lists. The section at the top selects the data source. The section in the middle shows the offsets, the bytes and their text representation. The bottom part contains the controls to navigate in the data, and to select the visualization.

The leftmost box selects the source offset, and works almost as its counterpart in the MemViewer. You can choose to jump entire windows or just lines.

The third box shows the numerical values at a memory location. You can select this location by moving the mouse cursor over the data.

The first button in the rightmost box is for toggling the move/edit mode. When the second button is down, editing the data will cause the HexEditor to instantly copy the modified data back to its memory source. The right button shows the search window; it can also be activated via "F7" or "Ctrl+F".

The buttons in the second line are for copying the window data & entire data to the clipboard, and saving the entire data to a file. After copying to the clipboard, the data will be in the CF_TEXT structure, with all zeroes replaced by spaces.



7.07 List Editor

The List Editor allows you to edit the items in the main window's lists.

The "restore" function sets all items back to the values of the last savestate loading. Only the six lists will be restored, not the arrays (e.g. the color palette).



7.08 SPCViewer

The header's signature and version number should not be changed. The "dump date" comboboxes are in the order Year-Month-Day.

The extended ID666 tags can be of several types. Each type has an ID value (0..255) that describes the data format (bits, byte, word etc). You can't change the relationship between ID and data format, but you can change the ID value.



7.09 Movie Editor

The header's signature and version number should not be changed.

The left 's' is the 'Select' key; the right 'S' is the 'Start' key.

ZMV support is still incomplete.



7.10 CHT Editor

The CHT Editor supports CHT files saved by current builds of ZSNES. Older files from ZSNES versions prior 0.900c are not supported.

The description text can be up to 18 characters long. Files saved by SNES9x can have up to 19 characters; the additional character will be removed to follow ZSNES' standards.

Game Genie codes are not supported.



7.11 Options

The options window allows you to change some details of vSNES that wouldn't be accessible otherwise.

The "start maximized" checkbox on the "main" page determines if the main window will be maximized after creating. There is a short delay caused by the way Delphi forms are created.

The first checkbox on the "options" page determines if savestate and cartridge file links in the main window will be checked when vSNES starts. File links that no longer point to an existing file will be removed.

If the second checkbox is not checked, then the bitmaps will be copied (without palette) to the clipboard instead of being saved (with palette) to a BMP or PNG file.

On the "PalViewer" page you can select the format of palette files. The color triplets in saved JASC-formatted files will have leading zeroes. The format is quite self-explanatory and can be used with Paint Shop Pro, Animation Shop and Microangelo.

If the checkbox on the "quit" page is not checked, vSNES will quit immediately instead of waiting for a click onto the "yes" button of the "quit" dialog.

The radio buttons on the left side of the "SceneViewer" page determine when the SceneViewer will use the second sprite base pointer of savestates. In the SNES, the second pointer is used for tile indices > 255. These radio buttons are useful in certain situations, for example in the Single Player race mode of Super Mario Kart.
The second checkbox (in the "misc." section) determines if selecting a tile in the SceneViewer will cause the MemViewer and PalViewer to update their settings accordingly. You can use F8 everywhere to toggle this checkbox.



8. GB cartridges

SNES games use the same tile formats as the Gameboy (1 and 2 bits), so you can view its cartridges in vSNES. Just load the cartridge in the main window and a useable palette in the PalViewer. You can find a palette designed for GB graphics in the vSNES directory.

Support for the tile formats of other systems is not planned.



9. Known limitations



10. Future plans

These are some thoughts about the possible direction for vSNES. It's still completely open what features will be implemented, if any.

vSNES is now mostly a gfx viewer, not an editor. I don't feel like adding any serious gfx or sound editing functions, though I also won't stop you from modifying the source accordingly.



11. Resources



12. Internal structures

The biggest one is the structure that stores the 4 regular BG tilemaps. A tile consists of 32x16 bytes, with 3 padding bytes per pixel for faster CPU access. A regular tilemap consists of 64x64 tiles, so with 4 of them 32 MB are already reached, plus the tile info which adds 640 KB.

The GDI bitmaps also take some MB. The Mode7 bitmap (8-bit) is 1024x1024 pixels in size, the sprite bitmap (8-bit) is 576x320 pixels and the BG bitmap (which is 8-bit, and is shared by the backgrounds) can also reach 1024x1024 pixels. Both screen bitmaps (8-bit and 16-bit) can be 576x478 pixels. Altogether these bitmaps can take ca. 2.96 MB.

One sprite has a bitmap of 64x64 bytes, again with 3 padding bytes per pixel. For 128 of these bitmaps 2 MB are need, and again the info takes 640 KB.

The Mode7 tilemap (128x128) takes only 64 KB, and the 256 tiles the same amount of RAM.



13. Credits

Thanks goes to everybody who helped the emulation scene, and especially to:

Special thanks to Nintendo; without their products our lives would have much less fun and many programmers still a perfectly normal working brain.



14. Links

http://vsnes.aep-emu.de/
mirror for the vSNES part of my homepage

http://www.geocities.com/illegal_eagle_2003/
my homepage

http://board.zsnes.com/phpBB2/profile.php?mode=viewprofile&u=100114
http://board.zsnes.com/phpBB2/profile.php?mode=viewprofile&u=100
my accounts at the ZSNES board

creaothceann@web.de
Hoffmann.Robin@web.de
my email addresses

http://oregonstate.edu/~robinsfr/snes.html
Piken's website, author of BGMAPPER and useful docs

http://www.zsnes.com
homepage of ZSNES, IMO the best SNES emulator around - check out the latest WIP versions

http://www.snes9x.com
Homepage of SNES9x, another good SNES emulator - improve the GUI, guys... ;)

http://www.zophar.net
older site about emulation in general - useful to get an overview

http://romhacking.net/
even better than Zophar's Domain

http://www.alpha-ii.com
homepage of Anti Resonance, creator of SNESAmp (the best SPC plugin for Winamp)

http://www.snesmusic.org
good SPC archive, i.e. full soundtracks with complete use of the ID666 tag

http://byuu.cinnamonpirate.com/
homepage of byuu, author of one of the most accurate SNES emulators


15. Version history

v2.91

v2.9a

v2.9

v2.85

v2.8

v2.7

v2.52

v2.51

v2.5

 

v2.2

 

v2.1

 

v2.05

 

v2.00

 

v1.37

 

1.35

 

v1.34

 

v1.32

 

v1.31

 

v1.30

 

v1.26

 

v1.25

 

v1.20

 

1.10

 

v1.00

 

v1.00 BETA



































































"That is all, Material Defender. Prepare for Descent."
- PTMC