===== Skelux's Documentation ===== //(credit goes to Skelux, original documentation is [[http://origami64.net/showthread.php?tid=517|here]] and [[https://www.youtube.com/watch?v=McfRClqw58I|here ]])//\\ "Below is a collection of my various documentation for hacking SM64DS (EU)." ==== Misc Routines and Offsets ==== ---OBJECT---\\ 02043CE4: main behavior loop\\ 02010e2c: spawn object (r0 actor id, r1 param, r2 spawn coordinates, r3 param)\\ --SOUNDS---\\ 02012328: play sound (1)\\ 02021be0: play sound (2)\\ ---GAME---\\ 0202E348: load new level\\ 020e5148: player current action routine\\ ---VARIABLES---\\ 0209f2f4: player lives\\ 0211117c/02092144: player health\\ 0209f2f8: current level id%%\\ ==== Collision Types ==== Byte 3 Camera Settings:\\ 4 - Camera rotates to match direction\\ 3 - Camera does not rotate to match direction\\ Normal Hard Surface:\\ 196 15 3 0 255 0 0 0\\ 196 15 1 0 255 0 0 0 - higher angle\\ 196 143 5 0 255 0 0 0 - close up, fixed\\ 196 0 4 0 255 0 0 0 - sticks to ff05, indoor camera\\ 5 0 3 0 255 0 0 0 - revolves around ff00, ff01, most others (must be view id 0)\\ Normal Path Surface:\\ 193 15 3 0 255 0 0 0\\ Wood:\\ 197 15 3 0 255 0 0 0\\ Mesh Floor:\\ 204 15 3 0 255 0 0 0\\ Grass:\\ 194 15 3 0 255 0 0 0\\ Sand:\\ 200 15 3 0 255 0 0 0\\ Leaves:\\ 201 15 3 0 255 0 0 0\\ Water:\\ 244 15 0 0 255 0 0 0\\ 35 0 4 0 255 0 0 0\\ Climbable Hill:\\ 196 47 115 0 255 0 0 0; Normal\\ 197 47 115 0 255 0 0 0; Wood\\ Slide:\\ 196 223 3 0 255 0 0 0\\ Unclimbable Hill:\\ 196 63 3 0 255 0 0 0\\ Unclimbable Grass Hill:\\ 194 63 4 0 255 0 0 0\\ Vanish Cap Wall:\\ 76 128 140 1 255 0 0 0 (adding the 1 to anything lets camera pass through)\\ Death Floor:\\ 192 15 32 0 255 0 0 0\\ 192 15 37 0 255 0 0 0; No Drop\\ Death Floor (Wind):\\ 192 15 155 0 255 0 0 0\\ Lethal Lava:\\ 192 143 8 0 255 0 0 0\\ Lethal Ice:\\ 199 15 12 0 255 0 0 0\\ Lethal Zone:\\ 192 15 1 3 255 0 0 0\\ Instant-Death Sand:\\ 8 15 76 0 255 0 0 0\\ No-Death Sand:\\ 8 0 60 0 255 0 0 0\\ Snow:\\ 198 63 4 0 255 0 0 0\\ Peach's Slide Starting Line:\\ 196 223 120 0 255 0 0 0\\ Peach's Slide Finish Line:\\ 196 223 128 0 255 0 0 0\\ Hang From Ceiling (Mesh):\\ 204 15 27 1 255 0 0 0 0\\ Hang From Ceiling (Wood):\\ 197 15 27 0 255 0 0 0 0\\ Normal Wind (Uses paths):\\ 192 143 92 0 1 0 0 0\\ King Bob-Omb Mountain Top:\\ 196 143 3 0 255 0 0 0\\ Level Boundary:\\ 192 63 4 1 255 0 0 0\\ --------CAMERA TYPES--------\\ 104 - fixed point, always face player\\ FF00 - point directly inwards to view\\ FF01 - point away from a point, pans\\ FF02 - normal, lock when entering level\\ FF03 - normal?\\ FF04 - lock and rotate away from set point\\ FF05 - point outwards to player\\ FF06 - distant camera, eg fight with Big Bob-omb\\ FF07 - controls camera position when paused\\ ​ ==== Disable Level Intro Messages ==== **Disable Level Intro Messages.**\\ 020C4728/0xD166C: NOP\\ **Disable Bowser Inside Castle Message.**\\ 0xD41B8: NOP\\ **Disable Star Collect Messages.**\\ 0xD41A4: NOP\\ 0xF6B8C: NOP\\ 0xF6B94: NOP\\ ==== Offsets in info.bin of the SDAT ==== ​all in info.bin\\ 0x40 - main table\\ each entry 0x0C long, ends with 40 00 00 00\\ first word is sseq id\\ byte 4 controls which sound banks are loaded\\ bytes 6 and 7 control which byte 1 and 2 need to be selected in sm64dse\\ MINICLEAR 0x1C0\\ PLAYROOM 0x1CC\\ MINIOTATE 0x1D8\\ JAZZ 0x1F0\\ CASIO 0x1FC\\ MINIMERRY 0x208\\ MINISNOW2(Rolling Star) 0x220\\ CASINOM3 0x22c\\ MINICOIN 0x238\\ MINIMUTEKI 0x244\\ MINIMOTOS 0x25C\\ MINIHANA 0x274\\ ESP 0x280\\ START 0x298\\ KPCLEAR 0x2A4\\ KPCLEARX3 0x2B0\\ SLVSTAR1 0x2BC\\ SLVSTAR2 0x2C8\\ SLVSTAR3 0x2D4\\ SLVSTAR4 0x2E0\\ SLVSTAR5 0x2EC\\ DROPSTAR 0x2F8\\ GOAL 0x304\\ CLEAR 0x328\\ OWLFLY 0x3C4\\ BIG 0x3DC\\ SELECT 0x430\\ SHIRO 0x43C\\ CHIJOU 0x448\\ WATER 0x454\\ SNOW2 0x460\\ OBAKE 0x46C\\ DUNGEON 0x478\\ MOTOS 0x484\\ EXTRA 0x490\\ ARTHETIC 0x49C\\ KAPPA 0x4A8\\ KAPPA3 0x4B4\\ DOLPIC 0x4C0\\ OPENING 0x4E4\\ STAFFROLL 0x4FC\\ Open up info.bin from the sdat and go to 0x40 for a table.\\ First word is the number of entries in the table, each after it is a pointer to details on each sequence and the sseq/sbnk/swar loaded.\\ After going to where one of the entries points, you'll find the first 4 bytes identify the sseq.\\ The next 4 bytes identify the sbnk and swar, also effecting which byte 1 and 2 need to be set in order for the music to play in your\\ level.\\ You can easily copy these from any other sequence to use the same instrument sets multiple times. \\ ==== Object Visible Distance ==== ​02111a3c - possibly clock seed\\ 02111a50(021118a8) - ct mecha 10 rotating\\ 021118cc - store rotation at 0x114 from object\\ +0xb0 - 1a for inactive, 02 for active? (021905a0 in test)\\ 020110fc - disappear object (draw distance stored +0xc from here)\\ 02011128 - appear object\\ 020110ec - unconditional jump to always be visible\\ **Everything always visible**\\ 0x110EC: 0A 00 00 EB\\ 02043cb8 - jump to object visibility handlers, (02010f78 is one were using)\\ 020110d8 - load max range for each object(0xBC r4)\\ 021905AC: 00 00 00 7F, always visible\\ 02010e20/0201160c - writes max range on level entry\\ 0201161c - runs the previous function for each object\\ 0201160c - reads draw distance from object data (BREAK HERE, then search whatever is at R2)\\ 0x247d2c - mecha 11 object in rom\\ +0x14 - draw distance\\ +0x48 - main behavior (02111934)\\ 02108a94 - chuckya window object\\ **Mecha 11 Always Visible**\\ 0x247D40: FF FF FF 7F\\ **Chuckya window always visible**\\ 0x1159eC: FF FF FF 7F\\ **Stars always visible**\\ 0x117998: FF FF FF 7F\\ **Carriage increased view**\\ 0x2D9380: FF FF FF 7F\\ ​ ==== Freeze time in SM64DS (E) ==== 0x02190ae8: 02 00 80 00\\ 0x0209b454: 00 00 80 00\\