SM64 Enhanced Text Engine
#1
The sm64 enhanced text engine is a new way to display text in sm64 that allows much more versatility and direct control on how each and every character is displayed including timing, size and location.

To see all the feature of this engine, see this video: https://youtu.be/A-YfaQpm5-A

This is installed as an asm patch, it will take the rom space from 0x1203800 -  0x12052C0. Included is the function itself "print string notes", the keyboard used for user input (simply place the entire file at 0x1204FFC) and an HTML file called "special_text_encode". This is a tool to make creating the strings easier since you can encode the cmds along with the text. The asm file includes two functions for the user to easily activate the text.

Code:
//80405218
//enable dialog with this object
//a0=x
//a1=y
//a2=*string
//everything but this object and mario will freeze, when dialog ends, everything will unfreeze (aka a 7C or a 7B cmd), call every frame while in dialog, 0x90 will be 1 during dialog, 0 when out of dialog
Code:
//display string during gameplay
//80404F40
//a0=x
//a1=y
//a2=*string


To make the strings, you place cmds inside the actual string. Cmds will be bytes unused by the normal sm64 text encoding and will have some parameters following them (ex. 40 00 01 - set text speed to 1 VI per character).

Below is a list of all the cmds included along with some things to keep in mind while using them
Code:
//40 set VIs per character, 2 byte - VIs per new char
//41 play sfx, 2 bytes - sfx arg
//42 set color of following characters, 4 bytes (white by default) - RGBA
//43 display short user string, 1 byte - user string number (each string is 10 bytes and goes from 6f00 to 6FF0, so inputs are 0 to F)
//44 display long user inputted string, up to FF characters
//45 return from user string (automatically generated by 4F cmd)
//46 make rainbow text (characters following cmd will rgb glow, call a new env color to disable) 1 byte - alpha value
//4E re enable user input on re-talk (by default, a user input only works once, then the cmd acts as if it is not there, ofc this does not stay after resetting the game)
//4F allow user input of short string, 1 byte - short user string ID. (This cmd will remove all other input and bring a keyboard up the player can type on. If you are not in time stop mario will move around while typing and it will suck)
//boxes will reset scaling and position and color. The only thing preserved is the character speed, and the blip flags.
//70 end of box, auto go to next box (put a pause before this so your string stays a while)
//71 end of box, goto next box on a press
//72 remove all text for certain number of VIs, 2 bytes - num of VIs with no text (Text will flash back to its previous spot after it is done, so if you had three sentences, it will auto go back to that point once the cmd is done), 0 has no effect
//74 pause - 2 bytes VIs to wait
//76 play small blip sound per character (think like in megaman or any other rpg with text scrolling)
//77 disable blip
//78 change music that plays after message to currently playing music (basically use this so if you switch tracks mid message, the track keeps playing)
//79 play music track, 1 byte - track number (original music will resume when string is done)
//7A disable all music (original music will resume when string is done)
//7B stop displaying string on A press (basically use this as an FF)
//7C stop displaying string after number of VI's (basically use this as an FF) - 2 bytes - num of VI's to wait until string is gone
//7F define background box, 2 bytes x start, 2 bytes y start, 2 bytes x end, 2 bytes y end. 4 bytes env color (coordinates go from the bottom right as the origin and increase)
//84 scale text, 4 bytes x scale float, 4 bytes y scale float (To compensate for large Y scaling, just do several line breaks the text will go farther up, e.g. y scale of 2 will need an empty line above it to not overlap, x will auto align)
//85 enable dialog options, 1 byte, number of options (they will be displayed vertically), the following strings will be the options, to use an user inputted string as an option do this (ex. 43 FF), returns byte of option selected (zero indexed, end each dialog option with an 0xFF)
//86 display following only on returned dialog option, 1 byte return, truncate string with FF, if return value does not match it will skip to following string, if there is no following string it will just display nothing (zero indexed)
//87 display general text (basically anything after this will display no matter what dialog option you choose, if you put another 86 cmd after this, general text will end and it will pass all text until another 87 or a matching 86)
//88 enable screen shake (only in certain levels?)
//89 disable screen shake

I have included two example objects on how you should use this engine. They are located at the very bottom of the asm file so you can read through those to see how simple it is to setup.
You can also find the special text encoder along with other tools I have made here: https://sites.google.com/view/supermario...authuser=0


Attached Files
.html   special_text_encode.html (Size: 17.25 KB / Downloads: 671)
.txt   print string notes.txt (Size: 50.61 KB / Downloads: 604)
.txt   keyboard.txt (Size: 388 bytes / Downloads: 758)
Reply


Messages In This Thread
SM64 Enhanced Text Engine - by jesusyoshi54 - 07-27-2019, 12:29 PM
RE: SM64 Enhanced Text Engine - by jesusyoshi54 - 08-17-2019, 06:27 PM
RE: SM64 Enhanced Text Engine - by jesusyoshi54 - 08-20-2019, 11:14 PM
RE: SM64 Enhanced Text Engine - by jesusyoshi54 - 09-02-2019, 06:25 PM
RE: SM64 Enhanced Text Engine - by jesusyoshi54 - 09-22-2019, 08:13 PM



Users browsing this thread: 2 Guest(s)