This thread is all about the Skyboxes that are in SM64. A Skybox is the background image in a level. Some levels have unique skys, while others levels share the same one. I will keep this first post up to date with all of the information & resources regarding skyboxes.
There are 10 skyboxes in the original Super Mario 64, and they are located at the following addresses:
Ocean (256x256): 0xB35715
Icy Mountains (256x256): 0xB5D855
Sky (256x160): 0xB85995
Fiery Sky (256x192): 0xBA22D5
Underwater City (256x256): 0xBC2C15
Clouds (256x256): 0xBEAD55
Desert (256x256): 0xC12E95
Dark Woods (256x160): 0xC3AFD5
Dark World (256x256): 0xC57915
Purple Sky (256x256): 0xC7FA55
(I came up with the names based off how the images look, they are not official in any way)
But hold on a second... If you try to open these with a program like N64Rip then you will be greeted by a jumbled mess:
This is because the skyboxes are actually made up of 32x32 squares.
These 32x32 squares make up an entire skybox. A 256x256 skybox is made up of 64 of these little squares. The reason why N64Rip can't properly render the entire image is because each square is independent, and so it tries to combine them in the wrong way. Which is why I created my own skybox importer.
Skybox Importer (v1.11):
This is a small side project I made today. It allows the user to view and replace skyboxes. I purposely made the design to be like N64Rip, so if anyone uses that program they already kinda know how it works.
- The first thing you need to do is load up your rom, so press this button and select it in the file explorer.
- Enter in the hexadecimal address of the skybox here.
- This button will bring up a list of the 10 skyboxes I mentioned before, pressing the OK button will setup that image in the editor.
Import PNG Button
- This is used to import a PNG image to replace the skybox at the address.
: The imported texture must not be bigger than 256x256.
: Make backups of your ROM file before using this tool. Because once you import a texture, it is saved to the ROM.
: You can import skyboxes anywhere in the ROM file, but keep in mind that a 256x256 skybox takes up 0x20000 bytes of memory (128 kilobytes).
Export PNG Button
- This button will take that preview image and make it into a .png image file.
- Updates the preview image (For when you change the width/height)
- Saves the ROM with all the current changes you made. When the text is red, then it means that you should press the button.
Shift Image Left ("◄◄")
- Adjusts the order bytes so that the image gets shifted to the left by 1 column.
Shift Image Right ("►►")
- Adjusts the order bytes so that the image gets shifted to the right by 1 column.
Shift Image Up ("▲▲")
- Adjusts the order bytes so that the image gets shifted up by 1 row.
Shift Image Down ("▼▼")
- Adjusts the order bytes so that the image gets shifted down by 1 row.
: When you shift the order bytes, you need to press the "Save" button.
Show Grid ("#")
- Toggles a grid so that you can easily see each 32x32 image.
This program requires at-least Java 7 to run, but I would recommend that you download the latest version of java here: http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
You can download the executable jar file here (Version 1.11): http://bin.smwcentral.net/u/26355/SkyboxImporter.jar
Here is a link to the java source code if you are interested (Version 1.11): https://github.com/DavidSM64/SM64SkyboxImporter/
Recent Changes (v1.11, The queueRAM update):
* Colors should be more accurate now
* Fixed a small issue with the convertTo5551 function.
* Exporting the image shouldn't make the image smaller
Recent Changes (v1.1):
* Added 6 new buttons
* You should be able to use any image now and not have it look weird.
* You can click any of the 32x32 images to change the order bytes for that chunk:
Even though I know where the textures are located in the rom, I don't know how they are loaded in-game.
So if anyone knows how they work, or if anyone knows any tricks with skyboxes, then leave a reply here and I will update this post with the appropriate information.
Originally posted by Kazeshin
0x20140 bytes are loaded to segment 0x0a and the box is placed with geo layout command 19 00 00 0A 80 27 63 D4, "0A" seems different sometimes, but no clue wtf its supposed to do.
last 0x140 bytes of segment 0x0A are pointers to each texture. (to order the BG image in some way?)
at 802D0048 a function related to drawing the background image gets called.