made in 2012-13 by WhiteYoshiEgg
(Thanks to HyperMario for testing the xkas version)
This patch increases SMW's message box size, allowing for far longer messages. SMW's original messages could have at most 96 characters, while with this patch you're able to use a whopping 260 — that's almost twice the original length!
See the instructions section below.
Unfortunately not; it'll entirely replace SMW's message box system. I can't think of any reason why you'd need to have both though.
Yes and no. Nothing in LM will break after applying the patch, but editing the messages with LM will have no effect. To change a message, you will need to edit messages.asm and reapply the patch (see instructions).
Nope — while I was at it, I actually made a more flexible message system that allows you to choose messages on a per-screen basis. I hope I'm right in assuming that everyone will benefit from that.
In the original SMW, you were only allowed two different messages per level, and the message displayed would depend on the message box's X position. With this patch, however, you can have set every single screen to show a different message! That makes 32 messages per level, up to a total of 126.
There are, but they're all rather technical and should usually not pose a problem.
This patch will work with both xkas and Asar. I highly recommend usin Asar though — not only does it have a built-in free space finder, it's also more future-proof in general since it's still actively being developed.
Don't worry about using Asar and xkas on the same ROM, by the way — assemblers aren't mutually incompatible. Even if you're using xkas for the rest of your patches, it won't break anything whatsoever.
Do tell me! The best way to reach me is through a PM on SMW Central.
However, I can't actually promise I'll succeed at fixing the issue, let alone find the time to investigate in the first place.
Alright, here's how to use the patch.
What you'll probably want to do first is write a message. To do so, open messages.asm. This is where all the message texts go, and every time you edit this file, you will have to reapply the patch for the changes to take effect.
You may (and should) get rid of the sample message that's in there. However, take note of the format it has, since that's how all messages need to be written:
All messages must consists of 10 lines with 26 characters each, embedded in double quotes (") and preceded by a db. Here's how a valid message looks like:
When you want to add a message, you can just write one right below another, no problem.
The messages will be treated as numbered from $00 to $7D. Numbering them yourself isn't needed, but it greatly helps you keep track of them.
The next step is to define which message goes where — that is, in which screen a message box must be placed to show a certain message. That's what message_list.asm is for.
Open the file, and you'll notice there's only one sample instruction in there so far. That space is what you can fill with your own instructions.
Here's how the format works: Say you want message 07 to display in screen 0F of level BC. What you'd put in the file is the following:
(to be read as "in level BC, screen 0F, use message 07".)
A longer list might look like this:
You may have noticed that you can only specify one byte of the level number — indeed, that means that the patch makes no distinction between the high bytes. Any message settings you apply to level 005, for example, will also apply to level 105 and vice versa. This likely won't be a great issue in practice, but keep that restriction in mind.
Two more important things to remember:
If you want to, you can also edit the message's properties now. The property byte controls a message's palette, the tile priority as well as the X and Y flipping of each character. For more information on the format, see this SMWiki page.
To change a message's properties, go to the bottom of messagebox.asm and look for a table with a bunch of $39s. Each of these bytes corresponds to one message.
You probably won't need to change the properties at all — it's a feature I needed for my own hack and left in for the public release because why not. You can, however, do neat things with it if you want: if you write your message in reverse and set its property byte to $79, the text will be mirrored!
If you're using Asar, you can skip right to the next step now. (Isn't that great?)
xkas users will have to do a bit of adjusting the first time around — namely, setting the free space. To do so, open messages.asm, look for the defines !FreeSpace1 and !FreeSpace2 near the top, and change them to whatever addresses you have determined as free and big enough. When the comments next to the defines aren't helpful to you, you can play it safe and set the last four digits of both to 8000.
And if you're not familiar with free space finding at all, consider an xkas tutorial like this.
You're now ready to patch messagebox.asm to your ROM.
If you're using xkas, one way to easily do that is the following:
Put xkas.exe in the same folder as the patch and the ROM, open a text editor, create a new document, type in
and save it as a .bat file in the same folder as everything else. (my_rom.smc, of course, being replaced with the name of your ROM.)
Now run that file to apply the patch.
When using Asar, no batch file or anything is needed - all you need to do is put asar.exe in the same folder as the patch and the ROM, open up asar.exe and type the following:
my_rom.smc, of course, being replaced with the name of your ROM.
When you want to add or edit a message, repeat this entire process, including the patching.
(Except for the free space setting if you're using the xkas version.)
And that's it — you're done!
I hope you enjoy your new king-sized messages — and again, if you encounter any problems or have anything else you need to tell me regarding this patch, feel free to send me a PM on SMW Central.