wyndchyme • docs


Table of Contents



Introduction


Welcome to the documentation for Modernization MegaPack. This page describes techniques used in Modernization MegaPack and its integration in programs like Cracko298's MegaPack Updater.

This is not an exhaustive list of techniques employed within Modernization MegaPack; rather it serves as documentation for techniques used that may not have been documented in-depth in the past.



Indexing files


The file appConfiguration.info in the root of the romfs directory is an index of all the files present in releases of Modernization MegaPack, and was introduced in version 2.0.0 "Romantic" in order to integrate with Cracko298's MegaPack Updater. As an example, the following syntax is used to list en_US_pocket.blang:

\loc\en_US-pocket.blang, 1

Files are defined using their relative path within the romfs directory. The following is the format to list a file in appConfiguration.info:

\path\to\file.extension, (a)

Refer back to this syntax format when variable a is defined in this documentation.


Defining file version with variable a

The variable a in the syntax format defines the file's version, and should be updated when a file is modified between releases. For a file's first revision, a should be set to 1. If the file is modified, a should be set to 2. If the file is modified again, a should be set to 3 and so on.



Loading images in credits.txt


In the vanilla game's credits.txt, only one texture is called to be displayed as an image, that being Nintendo-Logo.3dst to display the Nintendo logo at the end of the credits sequence immediately prior to the copyright and trademark information. The following syntax is used to call Nintendo-Logo.3dst:

gui/icons/Nintendo-Logo.png| tImage s1 iw128 ih32 iu0 iv0 isu128 isv32

Textures are called by inputting their relative path within the vanilla resource pack's textures directory, and appending it with the required scaling, offset and sizing values. Note that textures are called in the PNG format despite being in the 3DST format in the ROM file system. This only affects the syntax and has no bearing on the texture's appearance in-game. The following is the format to load textures:

path/to/texture.png| tImage s(a) iw(b) ih(c) iu(d) iv(e) isu(f) isv(g)

Refer back to this syntax format when variables a through g are defined in this documentation. Modernization MegaPack makes extensive use of the following techniques to display modder names, profile pictures, and other decorations in credits.txt. An example is shown below.





Defining image scale

Variable a

The variable a in the syntax format defines the image scale; more specifically, it defines the size at which pixels are displayed in credits.txt. Nearest-neighbor scaling is always used for textures.

Setting a to 1 scales the image to 100% of its original size; 1 pixel in the texture corresponds to 1 pixel in the image with 100% scaling. Setting a to 2 scales the image to 200% of its original size. 1 pixel corresponds to 4 pixels in the image with 200% scaling. Setting a to 3 scales the image to 300% of its original size, corresponding to 9 pixels in the image, and so on.

Variables b and c

The variables b and c control horizontal and vertical scaling respectively. They are expressed as a quantity of pixels; setting b to 256 means the image will be stretched to a width of 256 pixels. Since nearest-neighbor scaling is the only scaling option avaliable, it is generally best to leave b and c equal to the width and height of the texture you are attempting to load as an image to prevent scaling artifacts.

Variables b and c are affected by variable a; if c is set to 32 and a is set to 2, then the image will be displayed with a height of 64 pixels. In short, when the image is displayed, the width and height defined by variables b and c are multiplied by the scaling factor defined by a.


Defining image offset

Variables d and e

The variables d and e control the horizontal and vertical offset of a texture when it is loaded as an image into credits.txt. These variables have no bearing on the actual position of an image when displayed in credits.txt; rather they control what parts of a texture are shown when it is displayed as an image. Modernization MegaPack makes extensive use of these offsets to display different parts of an atlas; Shown below is the credits atlas texture as of version 2.0.0 "Romantic".


Offsets' anchor point (when d and e are both set to 0) is the top left corner of an unflipped texture; your offset values should always be set according to your texture's appearance prior to it being flipped upside-down for correct display in-game. Offsets are most useful when used in tandem with variables f and g, which control the cropping of a texture. If you want to display the entire texture, set d and e to 0 to apply no offset.


Defining image size

Variables g and f

The variables g and f control the horizontal and vertical cropping of an image. They are expressed as a quantity of pixels, and like offsets their anchor point is the top left corner of an unflipped texture. If you want to display the entire texture, set g and f to the width and height of your full texture.