For the Console Curious

You are viewing the old webpage. Newer version => Piken's Pursuits.

This page is simply a place for me to put up my utilities and documents. The small utilities include SpriteView for viewing raw graphics in several formats, TileView for viewing byte/word arrays in a file, and lastly BgMapper for ZSNES savestate scenes. These were all written for myself just to figure out how the SNES, its games, graphics, levels, and anything else all worked, but if somebody else can get some use out of them, here they are. The docs include the ZSNES savestate structure, SNES bitplane graphics, fx chip graphics, levelmap tile tables, how SNES graphic layers are arranged...

2001-10-09 SF Sound Manual
Anyone read the Super Famicom Sound Manual transcribed by Ledi? It's great and very informative, but notice there are a few missing parts? Well, I added them, using my ASCIIfying ability for the diagrams. Of course, if you have the original TIFs scanned in by Antitrack, by additions are unbeneficial. Personally, I find a huge text file more accessible though.

  • Added figure 1.2 System Outline
  • Added figure 1.4 Signal Flow (especially informative)
  • Included section 8 Development Tools
  • Corrected opcode for ASL labs

  • 2001-10-15 I hereby officially decree Win2k = STUPIDITY! (at least when it comes to DOS support). I used a halt instruction in the main loop to reduce CPU usage, and on my computer it works great. You can even hear the fan tone lower because less power is drawn. Windows 95/98 use the HLT instruction as a welcome opportunity to perform extra processing, but Win2k terminates the program with a GPF. Since the program's birth, it has set the fps to 30 for more precision, but instead of Win2k simply intercepting the port write and chaining to my program at the proper periods (a little jitter acceptable), it's stuck at dumb 18.2 ticks per second. Discovered the real reason why Spc2Midi does not work with the college computers is because they have legacy emulation disabled (and of course, I don't administrative privileges to enable them).

    Tried Spc2Midi last night on my 25Mhz 386, and it played the Mario RPG ending in real time! ;-) (albeit at only 11khz)

    Spc2Midi .111

  • Added toggle between wave output and FM by pressing 'f' key
  • Increased timing accuracy by putting Spc2Midi and the real SNES side by side. They should now play in sync for minutes +-1/30 second.
  • Improved DMA resynchronization greatly
  • Added left+right volume averaging instead of only using left channel, as some voices were completely silent because they used right volume only.
  • Set initial key on so that notes playing while saved are played as soon as it starts.
  • No more 'offensive' HLT instruction

    Louis Bontes (author of Naga font editor) site seems to have vanished. I was storing a few of my utilities on there, so the links have been adjusted.

  • 2001-10-09 Had a great summer vacation, visiting with family and friends, programming until the next day's dawn, watching tons of anime, and even playing a few video games. Amazing, no updates in four months and just this week my counter gave 120 hits!?

    Now I'm back looking for a programming job. Currently I'm just tutoring part time in the college lab.

    Spc2Midi .110
    Added a few minor features to Spc2Midi, simple voice emulation (no gain/adsr yet), fast forward, rewind, and for mere amusement, even playing backwards! Temporarily substituted wave output for the FM. Just found out today that it sometimes unexplainably crashes under Win2k (college computers!?) but has been fully compatible with DOS/Win95/Win98. You might want to download it simply to hear familiar songs played the wrong way.

    2001-06-05 Do any of you have that stupid "FoolProof" security system in your school library that limits you from doing anything halfway useful (like previewing your webpage on a floppy disk before blindly uploading it!)? Personally, I'm sick of it, so I made a little page that uses JavaScript to get around some of the annoyances. If I included a certain little Excel macro too, even more could be circumvented (;-). Of course, I'm graduating in a week and a half, so I don't even care about it anymore, but in case some of you do, Back Door. Only a fool believes something to be foolproof.

    Btw, did I mention that I'll be graduating in a week and a half! Reiteration for emphasization. ;-)

    2001-05-22 Minor changes to my page colors. Finally (after wasting several hours!) got it to appear correctly under Netscape too (however, NS still has that stupid bug that changes the font after a table, and of course the nice little menu doesn't appear).

    2001-04-22 ShowTmap - simple tilemap shower
    Just a little test program I wrote over the weekend that displays a scrollable Secret of Mana map.

    'ShowTmap showing 'Secret of Mana'

    2001-03-06 SpriteView .165
  • Added variable sized tile blocking, for viewing nonsequential tile arrangements like individual character frames, which are usually 2x2.
  • Increased maximum wrap width to 1024, hopefully sufficiently large enough for any graphic entity. Also good for scrolling through a huge file really fast.
  • Added anti-thrashing routine now to spare your hard disk an early death when loading huge files.

    'Tales of Phantasia' without 'Tales of Phantasia' with tile blocking 'Kirby Superstar' without 'Kirby Superstar' with tile blocking

  • 2001-03-05 Added a page to show just a few of my drawings.

    Sorry for the line-feed stripped Zelda routine. Apparently Tripod does not correctly serve the ".asm" filetype. So I renamed it to text, and it appears fine.

    2001-02-22 Thanks to Necrosaro, Neil, & Fusoya pointing me in the right direction, I figured out Zelda's graphics compression method last night. I probably should have spread finding/tracing/deciphering/commenting over more than one day though so that I got more than 1-1/2 hours sleep ;) For anyone interested, below is the decompiled source with comments. Zelda isn't only game that uses this format. Mario World also does, and Pokemon Silver&Gold both use a more advanced version (more control codes), which is documented by Necrosaro.

    Zelda Decompression Routine

    2001-01-16 Yay, a new year, a new term, three fun new SNES games...

    2000-12-04 (Just pics, no new release)
    Since TileView already has all the code in for displaying tilemaps with VRAM gfx, it wouldn't be difficult to add GB and NES support. The GB has unusual tilemaps because it uses signed numbers -128 - 127. Adding NES tilemap support only requires adding a new table for the byte arrangement. Unfortunately, unless you know exactly where the tilemap and gfx of each savestate start (out of the countless emulators out there and countless version variations), you only see gfx junk. For the two pictures below, I had to manually find the gfx bases with SpriteView.

    Zelda (NES) Link's Awakening - Mysterious Forest

    2000-11-19 Just a thought (old one actually) on BgMapper... One thing that has always annoyed me is loading a savestate from a game that changes the screen midframe, loading the savestate, and seeing nothing but VRAM static on most of the screen. Well, I would not be able to do anything about games that use horizontal interrupts for effects (without becoming a mini-emulator!) but maybe it would not be too difficult to simulate the HDMA transfers. Then you could see the screen as it was meant to look and simply click on the line at which the screen was how you wanted it.

    2000-10-30 For anyone curious what Peekin looks like, take a look at the About page.

    I've haven't been working on my utilities that much because I have had other programming interests and more than usual coursework. Here are design layouts from one of my very slow-going projects, a better GUI...

    TileView - Tileset Association
    Spc2Midi - Sample List
    TileView - File Position
    Cascading Menu

    2000-08-22 Another webpage style experiment. Hope it's not too purple for you ;) (Netscape really hates my page, so I'd suggest viewing it with IE)

    2000-08-10 TileView .185 - minor
    Added colored backgrounds behind numbers in hexview. It should make correlating what you see in the block mode to the what you see in hex view much easier.
    Fairy Fountain in Zelda

    Spc2Midi .105 - no update
    Oops, case of mixed up OS's. I used a backslash instead of the internet proper forward slash.

    2000-08-03 I wish Windows 95 had a file opener this intuitive. Just a design snapshot, not an actual program screenshot!

    2000-07-30 Found out by surprise that my free space went from 7mb to 46mb! Guess I'll have to fill it all with something :) Just finished texturing this site.

    ChronoTrigger Battle - another MIDI export

    TileView .184 - nothing really

  • Changed the scrolling keys to less awkward. Won't add mouse support until the new GUI is finished.
  • VRAM is now automatically loaded from a savestate.

  • 2000-07-10 After a year and a half, I'm experimenting with different styles. If I had known about stylesheets back then, this little site would be a snap to change. Of course, it's so small, it IS a snap to change anyway ;)

    2000-07-10 Spc2Midi .105
    Very minor changes (still no MIDI exporting or GUI :| )
  • Redid palette colors to make each channel more easily distinguishable (I was always getting channels that were close in color mixed up) and so that color gradients would be possible.
  • Added slight color decay gradient at the beginning of each note to mark where each note actually started when some notes started immediately after the one before just ended.
  • Added little colored "LEDS" to indicate which channels are active.
  • For fun, added cheap hack to change the instrument sound by pressing the up/down keys. I did this because the default patch sounds fine on my computer but stinks on the school computers. Sorry, there is no text telling which FM sound is selected.

    Snapshot of my future GUI. Note this is just a design snapshot, not an actual program screenshot!
    Spc2Midi SpriteView

  • 2000-06-28 UpFront 1.3
    Hard to believe it has been a year already since CyberGoth wrote the UpFront front-end for my utilities, but he has written the one year anniversary version for your grabbing.

    Added an old document on how SNES graphics are stored.

    Updated About page to reflect the four new games I just bought, one of which is Return of the Jedi, completing the Star Wars trilogy for SNES :)

    What do you know, the counter says 4000+ people have seen this little corner of the web. It would probably be a bit larger if I updated more frequently ;)
    2000-05-12 Totally unrelated to emulation - Scanned in an old drawing of a character I planned to one very distant day include in a video game of mine, to display my artistic talent (or need for improvement:)
    2000-04-17 BgMapper .176 - Real update
  • Large scene snapshots (512x512) and VERY large (1024x1024=1Mb). No more cutting and pasting of 15 separate 320x200 snapshots. This should really help with mode 7 and 64x64 tilemap scenes. 512x512 is just right for many areas in Zelda. 1024x1024 is perfect for Mario Kart. Press '0' for the export menu.
  • Bg alignment. In games with 'blocky' levels, like Mario World and Metroid 3, the tiles are distinct and easy to align to. In games like DKC and Super Star Wars though, it is much more difficult to tell just where the seams are. Bg alignment automatically aligns the selected bg to the top left of the screen so that you will be on a whole tile, not half of one. It works especially well for small areas (like one or two screen rooms). Press '9' for the menu.
  • Some games turn off all the bgs at certain times during the frame, which makes it confusing when you start BgMapper and don't see anything, even though you know there should be something there. So if none of the bgs are turned on, it just turns them all on now.

    Secret of Mana (SquareSoft)

  • 2000-04-16 Stylesheets are awesome! Too bad they don't fix Netscape's annoyances...
    It looks like only IE presents this page the way it is supposed to look (according to W3C standards!). Netscape is doing all kinds of screwy things, like changing my body font anytime after a table, changing the size of the text inside...
    2000-04-14 BgMapper .174 - Minor update
  • Added the much needed sides clipping, all four sides, all four tile flip directions, any tile size. I'm surprised that no one ever mentioned it. Clipping is not too difficult with simple bitmaps, but the complexity quadrupled when those bitmaps could flipped any one of four directions.
  • For quite a while I've been wanting to add the option of exporting the entire 1024x1024 bitmap. It would make map-making much quicker, especially for mode 7 screens. I got most of it done yesterday, but it isn't ready quite yet. First the scene renderer needed to be rewritten to handle scenes of any size (not just 320x200), and secondly clipping had to be added. Now for a small rewrite to the image exporter...
  • 2000-03-28 Twas a fun vacation. Now it's back to college, email, and updating this page once every month or so :)

    Spc2Midi Beta .101 (Readme)
    This is just for fun, so don't expect anything more from it than mere amusement. For a glimpse of my small musical project, here is the unrefined, non-gui, harsh on the ears, Spc2Midi beta. Below you can see the musical patterns of the Mario World intro being played. The code also is included for anyone curious.
    'Mario World' note patterns

    2000-03-10 Hbt & Trg Demo Song - Love this short tune.
    ChronoTrigger: Frog's Theme - Let the adventure start
    Mario World: Bonus Level - Short but addictive

    Any MIDI authors out there feel free to take these mere sequences of notes give them some feeling by adding instruments.

    2000-03-03 TileView .181
  • Brr sample mode (switch to by pressing 6). I couldn't wait until Spc2Midi was finished, and it easy enough to just add it to TileView. For samples, look in either a ROM, savestate, or SPC.
  • Display modes can be changed by pressing 1-6 (they can also still be cycled through by pressing 'm').

    Sound sample from a 'Metroid 3' savestate

  • 2000-03-02 Time is given hour/minute/second, program verions are numbered major/minor/revision, and bible scriptures are spoken book/chapter/verse. The eyes and brain are familiar with major then minor, so why not give dates year/month/day!? Guess it would make too much sense...
    SpcTool - Alpha II productions
    If you don't already know about this great SPC player, go try it! SpcTool has excellent sound quality, graphical volume meters, sound samples exporting, MIDI logging... My Spc2Midi is in a state of idleness so this more than fills its place.
    1999-02-15 BgMapper .173
    Added "painting" to graphics viewer. Using the mouse you can select a palette and then paint the tiles with it. See the readme for more info. This was complete two weeks ago, but I didn't upload it ;)
    1999-01-26 BgMapper .172
  • Autosequencing for all exports, whether scene, graphics, or palette. Files are numbered 0-999 (bgimg###.bmp, bgvrm###.bmp, bgimg###.pal)
  • Hex/dec offset in graphics viewer. Toggle by pressing 'h'.
  • 1999-01-24 BgMapper .171
    For Wilma, I finished VRAM auto-formatting. It sections VRAM into 1k parts, which can be 2bpl, 4bpl, 8bpl or Mode 7, and finds all the palettes in the scene. I still want to add manual palette coloring with the mouse, but it's a start. Press "8" to format, "9" to palette, "*" to unformat, and "(" to unpalette.

    Take a look at this:
    'Zelda LTTP' items in single color 'Zelda LTTP' items in intelligent color

    1999-01-23 Games store several types of graphics in VRAM at the same time (up to five different entities, 2bpl, 4bpl, 8bpl, mode 7, and tilemap words), so why be limited to a view of only a single tile format and palette group at a time. I've implemented an intelligent VRAM formatting that scans through the entire scene searching for where each tile of VRAM is used, what format it is, and what palette it is using. It can only work for graphics actually in the scene though. Games often load more graphics than they will use in a particular area of a level, so for all those other elements which are undefined, I'll let you manually select them and set their format and palette. Then exporting will just require one image, rather than several ones in each format and palette. Needless to say, it greatly(!) complicated the image viewer, but it's worth it!
    1999-01-14 "Mario Allstars" game selection 8bpl
    The graphics viewer in BgMapper .170 lets you select different tile formats now (2bpl, 4bpl, 8bpl, mode 7), which means you can also export those graphics to a bitmap. I did not have time to update the readme so use the keys 1-4 to change modes, up/down/left/right to scroll, + - to change the palette, and then 0 to export to a bitmap (bgvrm000.bmp)
    1999-12-14 Tiler
    Check out this map making editor. It lets you design maps manually, or (the handiest) import a map from a savestate. Its closer to what I wanted BgMapper to be.
    1999-12-13 BgMapper .167
    - Added palette inversion for scenes that use subtractive transparency like Torchlight Trouble in DKC. Press "8" in the scene viewer.
    1999-12-06 TileView .171
  • Tile graphics mode. Colors are still shown in the default rainbow palette rather than game colors. Use "-v" in front of the savestate filename to load graphics from.
  • Tile table mode. You must already know where to load a tile table from. Use the "-t" switch to load a table. For example "tmv -v zelda.zst -t 78000,2,2,2 zelda.smc" opens "zelda.zst" for viewing, loads VRAM from it, and loads the 32k tile table from the ROM starting at 78000h, each table entry being 2 tiles heigh and 2 tiles wide, 2 bytes each. Then go to 2000h in the savestate and switch to the tile table mode.
  • Sideways orientation, down then right rather than right then down. Beats looking at the screen sideways for those DKC levels. Press "o" to toggle.
  • Longer key help. There were getting to be more keys than would fit on the screen, so I made the help screen scroll using up/down arrow keys.

    Super Mario World 2, another not worth keeping, but nice to listen to once.

  • 1999-11-22 Lately I've been working on a program to export SNES music to MIDI's, so that they can be played on web pages (believe it or not, not everyone has a SPC plugin), played without a lot of overhead, and edited by MIDI authors (once it is in a MIDI, they could easily transpose it to whatever key they want and select instruments for each part). It won't be an automatic, here is the SPC, out comes a perfect MIDI, due to all kinds of variables like gain, noise, adsr, pitches between the chromatic scale, and pitch slides; but it should at least get the notes out, which MIDI authors can use rather than write them all from scratch. The quality won't be the same at all as the actual SPC, but that is not the point.

    It's actually nowhere close to being done (even though the MIDI's below might have you thinking otherwise) but I wanted to let the source to the emulation part of it (none of the MIDI exporting or SB playing routines are included) be available for anyone interested.

    Spc2Midi emulation source code - this link may not work for some of you due to Tripod.

    1999-11-21 BgMapper .166 - this link may not work for some of you due to Tripod.
    BgMapper now exports raw palettes, directly from CGRAM (256 rgb words), after me wanting a find a palette in a certain game. Also, the info screen (which no one probably used anyway) no longer annoyingly switches to text mode inside the program. This was originally done so that the info could be viewed directly from the command line.
    1999-11-20 DKC Intro
    Another test, another game working, another case of messed up pitch!
    1999-11-09 Been working on an a alternate orientation for games like Zelda which stores its dungeon tilemap pieces sideways and Donkey Kong Country which likes to store its levels as long sideways strips. Also been working on using tilemap tables and getting the correct colors. ;)
    1999-11-08 Colored blocks are nicer than numbers. Actual blocks are even nicer. Soon...
    1999-11-05 Two MIDIs from two familiar games: Mario World, Mario RPG. The pitch in the Mario RPG one does not sound quite right yet. More on where they came from later...
    1999-10-15 Put together this map of all the outside areas in Zelda 64.
    1999-09-28 Thanks Louis and CyBeRGoth for offering to host my utilites since Tripod is not working. Louis Bontes (page) is holding them, so anyone who was having trouble before should be able to get them now. Also, I'm back from vacation and am in my second week of college (fun classes this term :).
    1999-09-03 Why is Tripod giving people trouble in downloading zip files? Sorry for anyone this affects. I tried myself and can't even download my own utilities.
    1999-08-26 SpriteView .161
    - Detects ZSNES savestates, automatically setting the position to VRAM (20C13h) and loading the color palette. Of course you still have to use the command line switch (-p) for viewing a ROM along with a savestate's palette.

    1999-08-23 SpriteView .160
    - Supports VB tiles too.

    See the key help (F1) since the readme isn't ready.

    Found out what those odd level-like pieces were in DKC. It was difficult to tell what they were with just colored blocks, but using actual tiles instead showed quite a different picture.

    1999-08-22 Yay, I did have some time to work on SpriteView .155 while on vacation. Luckily my aunt has internet access, so that you too can enjoy what I added/changed:
    - Window is wider, allowing complete window to be seen.
    - Info is in a bar down on the bottom rather than right side. Filesize is no longer shown.
    - Help was added for key reference (F1).
    - Wrap is now shown in pixels rather than the number of 8x8 tiles.
    - Keys quickly half/double wrap ({ }).
    - Added two N64 graphics modes, 15bit high color and 24bit true color.
    - Added pseudo true color palette for N64 modes. You must change to it manually since it is not automatically set when you change to those modes.
    - Made fx chip graphics linear according to wrap. So it does not now automatically set the wrap to 32 tiles.
    - Added 3 linear graphics modes for 2,4,8 bits.
    - Added goto from command line (-g #)

    Note: The readme for this version is not yet complete. Also, my font editor is 500 miles away, so the help keys do not all look right.

    "Zelda:TOC" items

    1999-08-11 I hoped to release SpriteView with N64 graphics mode (Zelda (C)Nintendo) before going on vacation, but oh well. Finals are over. The 15 page report is over with. I'll be 19 Friday. I have lots of friends to see (physically). Life is happy for the moment. See you Spring term.

    1999-02-5+ Older news...

    If you do not like any of these utilities or docs, please go find some you do like. These were really written for myself, but I thought it would be nice to share :)

    2001 PeekinSoft