Home What's New Project List Valhalla Rockman 2 Dezaemon Cosmo Genesis Vitae Akumajo Dracula 2 Chaos World Metal Max Phantasy Star Adventure Super Robot Wars 2 Mortum Dragonball Z Fighting Story 3 GundamWing - Endless Duel Clock Tower Jurojin Using Pointers Efficiently NES 16x16 Tile Format Colossus of Rhodes Misc. Downloads Dezaemon Launch Pad Members Frequently Asked Questions Links MIDI List Pantheon Contact Us Disclaimer |
Using Pointers EffectivelyAn Appendix to the MadHacker's Guide to NES PointersBy Gideon Zhi Pointers in ListsLike many Role-Playing Games, Chaos World has numerous monsters, spells, and items. This is where efficient use of pointers can really shine. Say, for instance, you have two spells: Volt and L-Volt. The spell names, plus the message end characters, take up a total of 12 characters in your ROM. That's a lot of space! What if you could reduce that to... say, 6 characters? And what if you could do that with many of your spells and monsters? You can, using pointers! Here's the example. We've got the same two spells: Volt and L-Volt. We also have two pointers pointing at the first character in each. Pointer1 --> Volt Pointer2 --> L-Volt Everything clear so far? Now, as the MadHacker says, "More than 1 pointer can point to the same place in the ROM." Now, from here on, I'm going to be using * as my break character/Empty Space character. So whenever you see * immediately after a string, it's a break character. Any other place and it's empty space. Anyway, our ROM probably looks like this: Volt*L-Volt* Now what we do is we totally omit Volt, replacing it with L-Volt. It'll now look like this: L-Volt****** Now we point Pointer1 (originally for Volt) at the V, like so: L-Volt****** ...and we point Pointer2 (originally for L-Volt) at the L, like so: L-Volt****** They both share the same text and message end characters, but the pointer that goes to Volt points to a part later in the string. We therefore have two spells in one! This works great for monsters, too! Example: Spider and P-Spider: Pointer1, for Spider Pointer2, for P-Spider P-Spider (Empty space omitted) Note that this can be used in a multitude of situations, including dialogue. But with dialogue, you can get into some messy stuff like control codes that can screw everything up... so if it were me, I'd just limit it to lists. All that space saved... and with no ASM modifications! That about wraps it up! Hope this was informative. Thanks go out to the MadHacker for the ultimate document in NES pointers! |