Suite-NES 101

Since it seems like this project is never going to get finished, I’m going to release what I have so far. Maybe input from others will help me focus and get things done. Worst case, if I never finish the project, at least I’ll have released something. So, here’s a quick guide to Suite-NES.

Keep in mind that this project is incomplete. Comments, suggestions, and criticism are appreciated.

1. Projects

SuiteNES doesn’t work with plain ol’ ROMs. SuiteNES works with projects. A project consists of a ROM, project settings, and project files. But… if you’re doing something simple and don’t want to bother with a project, things are set up so you can basically ignore the whole project aspect of the program.

When you open a ROM, SuiteNES will create a new temporary project for you. You can use the various editors, modify the ROM, and save back to the ROM file without saving the whole project to disk. On the other hand, when you save your project, SuiteNES will remember which editors you have open and their settings. This means that when you open the project back up, it will remember how you had tiles organized in the arranger, how you had the table set up in the hex editor, and so on.

You can open more than one project at a time. Each project opens in its own window (MDI), and each project’s editors are shown within a tabbed interface. This can be handy for copying and pasting tiles or hex between two ROMs, or comparing them side-by-side. Rather than using a “Window” menu, when more than one project is opened, a document list appears at the bottom of the window.

2. Help

To see basic help for the active editor click SuiteNES->Editor Help in the menu. This menu option will be grayed out if help is not available for the current editor.

3. Files

Besides the ROM, a project can contain additional files. On the left side of a project window is a file manager with the files shown on top, and the properties of the selected file shown beneath. Click on the divider bar to collapse the file browser, and click again to show the file manager.

SuiteNES currently only has built-in support for editing and processing .ASM (assembly) and .GFX (graphic tile) files, but any file can be included in the project.

4. Building

SuiteNES uses a build system. Each time you build the project, SuiteNES will process your project files and patch them into a copy of your ROM (found in the \bin directory of the project).

.GFX and .BIN files are patched directly to the ROM. For the file properties, Action should be set to Embed, and Patch offset specifies where the data will be patched (in the 0x00000 hex format).

.ASM files are assembled and patched to the ROM. For assemblers, SuiteNES comes with ASM6 and snarfblASM built-in. To specify which assembler you would like to use, go to the file’s properties and specify ASM6 or snarfblasm as the Command.

External Programs

You can also use an external program to build a file. Suppose you prefer the Foobaz assembler over ASM6. Outside SuiteNES you would run Foobaz with the command Foobaz myfile.asm which will produce a file called myfile.bin.

To configure SuiteNES to use Foobaz to build the file, go to the file’s properties and change Action from Native build to Command line. Set Command appropriately to run Foobaz. For example: Foobaz %FILE%. (You will need to type the full path to Foobaz unless you add the directory that contains Foobaz.exe to the PATH includes in SuiteNES settings.) Build output file should be the name of the output file that Foobaz creates: %FILENAME%.bin. Patch offset specifies the location in the ROM to patch the assembled file (in hex).

5. Debugging

When you build and launch for project (Project->Launch in the menu, or F5), the result ROM is written in the \BIN folder, and then launched with the default .NES file launcher. If you use snarfblASM as your assembler, it will output files for FCEUX’s symbolic debugging. That means code like this:

; Save map data
; -------------
.PATCH 02:B000
SaveMapData:

    JSR PrepLoadSaveIndexers

*   LDA MapRam,X
    STA MapSaveRam,Y

    DEY
    DEX
    BPL -

    JMP SaveHijackReturn

; Load map data
; -------------
LoadMapData:
    JSR PrepLoadSaveIndexers

*   LDA MapSaveRam,Y
    STA MapRam,X

    DEY
    DEX
    BPL -

    JMP LoadHijackReturn

    ; Delete routines
; ---------------
DeleteMap_RegisterName:
    JSR DeleteMap
    JMP $A764       ; Return from hijack

DeleteMap_SecondQuest:
    JSR DeleteMap
    JMP $AF5A       ; Return from hijack

will look like this in the debugger:

02:B000:20 37 B0  JSR PrepLoadSaveIndexers
02:B003:BD 50 7F  LDA MapRam,X @ $804F = #$8D
02:B006:99 60 7F  STA MapSaveRam,Y @ $7F61 = #$FF
02:B009:88        DEY
02:B00A:CA        DEX
02:B00B:10 F6     BPL $B003
02:B00D:4C 2A 9D  JMP $9D2A
02:B010:20 37 B0  JSR PrepLoadSaveIndexers
02:B013:B9 60 7F  LDA MapSaveRam,Y @ $7F61 = #$FF
02:B016:9D 50 7F  STA MapRam,X @ $804F = #$8D
02:B019:88        DEY
02:B01A:CA        DEX
02:B01B:10 F6     BPL $B013
02:B01D:4C 25 E6  JMP $E625
02:B020:20 2C B0  JSR DeleteMap
02:B023:4C 64 A7  JMP $A764
02:B026:20 2C B0  JSR DeleteMap
02:B029:4C 5A AF  JMP $AF5A

 6. Plugins

The plugin system is not complete, and there really aren’t any plugins to use with the plugin system. The eventual goal of the plugin system is to allow new file editors and ROM data editors to be integrated into SuiteNES as well as file builders such as assemblers, text inserters, and anything else you can think of. Most of the plumbing is in place. What really needs work is the plugin managing part of the program.

7. Revisions

Ignore this.

Leave a Reply

Your email address will not be published.


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">