We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

Dynamic X

From SnesLab
Jump to: navigation, search
English Português Español 日本語

Dynamic X is an advanced dynamic load management system whose purpose is to support the transfer of graphics and color palettes to the VRAM and CGRAM respectively. This system would replace Dynamic Z V3.7 which in turn is a replacement for DSX.

Download

Features

  • Load Poses Dynamically: Allows to load poses for Dynamic Sprites from any ASM code.
  • Draw Poses: Allows to draw any pose that is registered in the system anywhere on the screen and from any ASM code. The way of drawing is totally optimized for each pose, basically all the poses that have similar characteristics, use the same graphic routine to optimize cycles and to make it as efficient as possible, besides diminishing considerably the amount of ROM used in graphic routines, since, 1 graphic routine can draw hundreds of different poses that belong to different Sprites.
  • Load Graphics to VRAM.
  • Load Color Palettes to the CGRAM.
  • Automatic Palette Assignment: When a Sprite loads a palette, it can ask the system to assign a palette in an automated way, it will look for a free palette and it can be used by the Sprite, in case the palette is already loaded in the loaded CGRAM then it will give the Sprite that palette. The system informs if there are no palettes available, this way, you can avoid that the Sprite tries to work with wrong palettes.
  • Color Palette Effects: You can edit the palettes that are loaded to change attributes such as Hue, Saturation and Brightness, you can weight them with a preset color or de-power certain RGB or HSL channels.
  • Registration of Graphics and Palettes: The system allows you to insert graphics and palettes in the ROM, when you do so, the position in which they were saved in the ROM are available and you can also know the ID with which it was registered in the system, you can use that ID to dynamically load those graphics. Dynamic X will take care of deleting the graphics and palettes previously saved by the system and insert the new graphics and palettes in a free place in the ROM.

Features that may have compatibility issues

  • Custom Player Graphics: Dynamic X allows you to either change the player graphics using an EXGFX similar to GFX32 being limited to use the size and number of poses of the Vanilla game or simply disable completely the dynamic loading of player graphics, yoshi or podoboos to make your own dynamic routine for a custom player without limitations of size or number of poses. This feature allows you to change the graphics at any time, so you could use different players in different levels or in different areas of the same level.
  • Player Custom Palettes: Dynamic X allows you to change the player's color palette freely.
  • Player DMA optimizations: Dynamic X decreases considerably the cycles used by the NMI handler, since, the player graphics, yoshi and podoboos are only loaded in the VRAM when they are required, not always as it happens in the Vanilla game. This also leaves you some extra tiles in SP1 in levels that don't use yoshi or podoboos, even an extra tile in levels that don't use the layer.

Prerequisites

Installation

General Steps

Before installing Dynamic X.

  1. The ROM must have SA-1 Pack installed.
  2. Put all files with ".drawinfo" extension in the "DrawInfo" folder.
  3. Put all files with ".dynamicinfo" extension in the "DynamicInfo" folder.
  4. Put all files with ".paleffect" extension in the "PaletteEffects" folder.
  5. Put all resource files such as GFXs and Color Palettes with ".bin" extension in the "DynamicResources" folder.

Using the Tool Directly

You can install Dynamic X by opening the file "DynamicXTool.exe", it will open a console telling you what to type at any given moment. It will start asking you for the ROM paths, Pixi folder, UberasmTool or GPS (these last 3 are optional) and then it will ask you for the features you want to install, put "y" or "yes" to enable each feature and "n" or "no" to disable that feature. Warning: Features such as Player Features and Status Bar Optimization, may have incompatibilities with other resources, so you should be careful when installing them. Be careful which features you install.

Using the Tool From Console

You must call the command:

DynamicXTool -use-settings

The ROM will install with the default settings if you have never done a previous installation, if you have done a previous installation, then the settings used in that installation will be used.

Settings

In case you want to change the settings manually you must open the settings.json file that will look like this:

{
  "InputROMPath": "",
  "OutputROMPath": "",
  "PixiPath": "",
  "UberasmToolPath": "",
  "GPSPath": "",
  "GraphicChange": true,
  "PaletteChange": true,
  "PaletteEffects": true,
  "DynamicPoses": true,
  "DrawingSystem": true,
  "ControllerOptimization": true,
  "FixedColorOptimization": true,
  "StatusBarOptimization": false,
  "ScrollingOptimization": true,
  "PlayerFeatures": false
}

You must change the parameters according to the settings you want.

Formats

Dynamic Info

Files with extension ".dynamicinfo" are used to insert pose graphics, palettes and other resources into the ROM. They also include the information necessary for the poses to be loaded correctly into the VRAM.

The format of these files is as follows:

PosesGraphics:
	...
Palettes:
	...
Resources:
	...
PosesChunksSizes:
	...
  • PosesGraphics: Below this label goes each graphics file used to load dynamic poses. Example:
PosesGraphics: 
	DKCKlaptrap.bin
  • Palettes: Below this label goes each color palette file used for dynamic poses. Example:
Palettes:
	DKCKlaptrapPal1.bin
	DKCKlaptrapPal2.bin
	DKCKlaptrapPal3.bin
	DKCKlaptrapPal4.bin
	DKCKlaptrapPal5.bin
  • PosesSizes': Below this file goes 2 lines for each pose, the first line is a label describing the pose and the second line is 2 values, each of these values indicates how many 8x8 tiles are used in each chunk, each dynamic pose has 2 chunks of data generally (except some exceptions that may require only 1 chunk), the top chunk and the bottom chunk. The top chunk is all the 8x8 tiles that are before the last 8 pixels high line, while the bottom chunk is the last line. In the following example you can see 3 images, the left one is how the assembled image should look like, the second one is how it would look like in the VRAM and the third one is how it would be saved in the binary file, it would also show how the poses sizes of that pose are, which in this case would be 8 tiles of the top chunk and 8 tiles of the bottom chunk:
diagram1.png
PosesChunksSizes:
Frame0_PoseChunksSizes:
    db $08,$08

Note: For poses whose number of 8x8 tiles is divisible by 32, you can use only the top chunk that has all the tiles and the bottom chunk would be 0.