

                                =-=-=-=-=-=-=
                                NESemu v0.40a
                                =-=-=-=-=-=-=

                                     by:
                                   SnowBro
                            <kentmhan@online.no>

                        Released: September 13, 1998


--------Sections:-------------------------------------------------------------

        1   GENERAL INFO
                1.1 New in this version
                1.2 What's emulated
                1.3 Other features
                1.4 Keys
        2   THE TILE EDITOR
                2.1 How to use it
        3   THE HEX EDITOR
                2.1 How to use it
                2.2 Keys
                2.3 Importing font tables
                2.4 Creating a valid .TBL file
                2.5 The realtime .TBL editor
        4   OTHER STUFF
                3.1 using a Gravis compatible gamepad
                3.2 Thanks to...
                3.3 Bugs


--------GENERAL INFO:---------------------------------------------------------

        1.1 New in this version:
        ------------------------

        - Built-in tile editor added
        - Built-in hex editor w/ font table support added

        This is a pretty major release, at least for those who like to
        hack NES games.


        1.2 What's emulated:
        --------------------

        - CPU
        - PPU
        - Sprites
        - Mappers 0,1,2,3,4,7,8,9,10,15,16,17,19,22,23,24,32,33,34,64,65,66,69
        - Battery backed RAM
        - Joypads
        - Sound (not in public version, too crappy as of yet...)


        1.3 Other features:
        -------------------

        - Built-in tile editor
        - Built-in hex editor w/ font table support
        - Save snapshot (.PCX)
        - Gravis Gamepad support


        1.4 Keys:
        ---------

        Joypad 0                Joypad 1
        --------                --------
        A       - Ctrl          A       - A
        B       - Alt           B       - S
        Up      - Up            Up      - Y
        Down    - Down          Down    - H
        Left    - Left          Left    - G
        Right   - Right         Right   - J
        Start   - Enter         Start   - Q
        Select  - TAB           Select  - W

        F3      - Enter tile editor
        F4      - Enter hex editor
        F11     - Save snapshot (romname.PCX)
        F12     - Reset CPU


--------THE TILE EDITOR:------------------------------------------------------

        The tile editor works almost exactly like the stand-alone version
        of "Tile Layer" (available from my webpage). An explanation of the
        program follows.


--------2.1 How to use it:----------------------------------------------------

        Keys:
        -----
        To enter the tile editor, press F3. Press TAB to select which
        pattern table to edit. The key "1" selects which 4-color palette
        to use.

        Pattern table:
        --------------
        Select a tile from here by clicking LEFT mouse button.
        Click RIGHT mouse button to paste the currently selected tile
        (either a tile selected directly from the pattern table or from
        the clipboard).

        Clipboard:
        ----------
        Paste the tile selected from the pattern table (or from another
        location on the clipboard) by clicking RIGHT mouse button. Select
        tile to edit by clicking left mouse button. The clipboard is mainly
        a place where you can arrange scattered ROM tiles in an order that
        forms a complete picture, so that the editing gets easier.

        Tile edit:
        ----------
        Left mouse button draws currently selected foreground color,
        right mouse button draws currently selected background color.
        Change foreground/background color by clicking left/right
        mouse button on the desired color box to the right of the
        drawing area. Once you're done editing a tile, copy it back
        to the pattern table (by pressing RIGHT mouse button while
        holding the cursor over the tile you want replaced). You have
        to copy it back yourself because when editing a tile, changes
        are NOT written directly to the pattern table. This is to give
        you a second chance if you aren't pleased with the result and
        want to start over with the original tile again. In any case,
        remember to save your work often: there's no telling when
        you'll screw up next (I do it all the time 8-) ).

        Menu:
        -----
        Flip X: flips the selected tile horizontally.
        Flip Y: flips the selected tile vertically.
        Save: saves changes to VROM.
        Quit: throws you back into the emulator.


--------THE HEX EDITOR:-------------------------------------------------------

        I've tried to make the hex editor as self-explanatory
        as possible, and if you've ever used a text editor
        or hex editor before, most of the functions and
        their hot-keys should be familiar. You can press
        Esc to bring up a menu and select the function
        you want from there.

        2.1 How to use it:
        ------------------

        First, to start the hex editor, press F4 while in
        the emulator. To switch between the HEX column and the
        ASCII column, press TAB. A blinking cursor will indicate
        which column is currently selected. When you're standing
        in the ASCII column, you can type in words and sentences
        directly. In the HEX column you type in hex values in the
        range 00h-FFh.

        Note: the starting offset in the ROM (00000000h) is relative
        to the first PRG-ROM bank in the .NES file, NOT the 16-byte
        NES header preceding this bank. This means you don't have to
        account for the header when finding pointers and pointer tables
        (subtracting 10h from all values is a pain, huh?)

        When you make a change to the ROM and save it, you don't
        have to reload the ROM to see the changes. (If you're
        editing a lot of the text in a game, for example, this
        feature can save you time.)

        Use the arrow keys to move from one offset to another.
        PageUp moves the filepointer 256 (100h) bytes upwards,
        PageDown does the same only in the opposite direction.
        Pressing Home will take you to the start of the current
        line, if you're already there then you will be elevated
        to the top of the page currently displayed. The End key
        operates similarly, but in order to keep from insulting
        your intelligence even more, I won't explain it in further
        detail.

        SEARCHING FOR STUFF

        You can search for strings by pressing F2. Simply enter
        the string you want to search for. This string can either
        be a word or a series of hex values (for example, entering
        "0D0A24" will search for both the text "0D0A24" AND the
        hexadecimal string 0D 0A 24.)
        To search for the same string again, press F3.

        MANIPULATING AREAS

        You can highlight areas in the file and copy them, then
        paste them to a new location. To highlight an area, press
        and hold Ctrl, then use the arrow keys to select the proper
        range. You can now copy the contents of the area by pressing
        Ctrl-C (or by selecting "Copy" from the "Edit" menu). Go to
        the offset within the file where you want to have this data
        and press Ctrl-V to paste the data at this location. See
        Section 4 ("KEYS USED") for a list of all editing functions.

        Remember to save your work before quitting.


        2.2 Keys:
        ---------

        This is a list of all the keys used to manipulate a file
        in the editor, and a quick explanation of them:

        ESC             Menu:
                                Brings up a menu of functions.
        F5              Save file:
                                Saves the modified file to disk.
        Ctrl-Q          Quit:
                                Exits to the emulator.
        Ctrl-C          Copy:
                                Copy selected area.
        Ctrl-V          Paste:
                                Paste copied area.
        Ctrl-E          TBL editor:
                                Enters the .TBL editor (the black
                                box in the lower right corner).
        F2              Search:
                                Search for a string.
        F3              Search again:
                                Search again for the same string
                                you searched for using F2.


        2.3 Importing font tables:
        --------------------------

        This section is mainly of interest to those of you who
        want to edit the text in games (ROM hackers, in other
        words).

        The problem when editing the text in a file which does not
        use the standard PC font table should be obvious: you
        aren't able to view the text, because the hex values don't
        call the correct characters.

        OK, here's an example of a typical incident that might
        occur because of this problem:

        Let's say you want to change the text in the NES game
        "The Legend of Zelda". You know that the word "ZELDA" is
        located somewhere inside the ROM, but when you search for
        this word in a "usual" hex editor, you get a message saying
        "Search string not found". What's wrong, you say? Well,
        here's what the word "ZELDA" looks like using Zelda's own
        font table (I'll tell you how I figured out the table later):

        23 0E 15 0D 0A

        But when you searched for "ZELDA" using a standard hex editor
        which does not have the ability to import other font tables,
        you were actually searching for:

        5A 45 4C 44 41

        because those are the ASCII character codes for the word
        "ZELDA". Quite frustrating, huh? Well don't worry; this
        is where the .TBL files kick in.

        By using a table containing the correct character for
        each hex value, the text can be made visible. This enables
        you to type in the new text directly, instead of having to
        change every character by typing in its equivalent hex value
        (which can take a LOT of time).

        Here's what a line in a .TBL file might look like:

        3C f

        "3C" is the hexadecimal value associated with the character,
        "f" is the character itself. This means that whenever you
        type an "f" in the ASCII column of the editor, the byte at
        the current offset will be modified to 3Ch.


        2.4 Creating a valid .TBL file:
        -------------------------------

        The first step in creating a valid .TBL file which you can
        use in the NESemu hex editor, is to figure out the character
        codes for the font. This can be done by using NESemu's
        tile editor.

        The process:

        1) Run the ROM you are going to edit.
        2) Press F3 to enter the tile editor.
        3) You might have to press TAB once if the font
           is located in the second pattern table.
        4) Hold the mouse over each character in the font,
           note down the hexadecimal number displayed to
           the right of the mouse cursor, and the character
           itself.
        5) Repeat for all characters in the font.

        Next, open a text editor (preferably DOS Edit). Now
        place each hexadecimal value you wrote down on its
        own line, followed by the character it represents.
        For example:

        10 A
        11 B
        12 C
        13 D
        14 E
        15 F
        ....
        etc.

        Save the file as <romname>.TBL, where <romname> is the
        name of the ROM the font table is intended for. (For
        example: ZELDA.TBL if the ROM is entitled ZELDA.NES.)
        This way the font table will be loaded automatically
        when you open the ROM in the hex editor (make sure the
        .TBL file is located in the same dir as the ROM!!!).
        Now you can search for words directly by pressing F2
        (try searching for "DANGEROUS" in ZELDA.NES, for
        example.) Note that the search function is
        cASe SeNSiTiVe.

        I included a .TBL for ZELDA.NES in this archive, so
        have a look at it to see an example of a fully working
        font table.

        !!!IMPORTANT NOTE TO HEXPOSURE USERS!!!

        The .TBL file format of Hexposure v0.215 is NOT compatible with
        this format. However, there is only one small difference: you
        don't have to specify the range of characters to display any
        longer, NESemu's hex editor figures out this by itself. So to
        make your Hexposure .TBL files compatible with NESemu, simply
        delete the very first line of all your .TBL files.


        2.5 The realtime .TBL editor:
        -----------------------------

        To enter the .TBL editor, press Ctrl-E. Now you can move around
        with the arrow keys and select which character each value should
        translate to. For example, if you want each occurance of the ASCII
        character "A" to be displayed as "x", move to the position in the
        font table where the "A" is located, then press "x" on your
        keyboard. The changes will take place immediately (watch the
        ASCII column). Press ESC when you're done to return to the
        main hex editor.

        Sorry, but the font tables created with this editor can't be saved
        in this version. This feature still isn't as good as I want it to
        be, but that will change in the next version.


--------OTHER STUFF-----------------------------------------------------------


        Using a gamepad:
        ----------------

        To use your Gravis compatible gamepad, simply press either of
        its four buttons. Only Player 1 can use a gamepad. Note that
        I've only tested it on my own machine, so the timing might be
        off on faster/slower ones. Email me if you are having problems
        with using a gamepad.


        Thanks to the following people (in no particular order):
        --------------------------------------------------------

        - EFX (for his support and ideas)
        - Y0shi (for his NES tech document)
        - \Firebug\ (for his memory mapper document)
        - Adam Seychell (for his DOS extender)
        - Matt Conte (for answering my pathetic questions)
        - Paul Robson (ditto)
        - Loopy (for his lovely NES palette)
        - Reijin (ROM supplier)


        Bugs:
        -----

        Support for some of the "exotic" mappers has not been
        thorougly tested. Beware.

        Please report bugs or strange behaviour to me:
        kentmhan@online.no
