Open Px-Ch opened 6 months ago
Hmm that wiki page doesn't look entirely accurate (for some of the misc text at least), just repointing won't be enough in this case. That being said, this script should increase the max. length of the text speed options up to 15 characters + a null byte ([00]).
import asm65816
// Repoint to new text.
ROM[0xC1EF7E] = ASMLoadAddress06(text_speed_text)
ROM[0xC1F3E4] = ASMLoadAddress06(text_speed_text)
// Change maximum length of new strings.
ROM[0xC1F421] = LDA_i(16) // Length.
ROM[0xC1F450] = LDA_i(32) // Length x 2.
// Make this thing multiply by 16 instead of 7.
ROM[0xC1EF92] = {ASL NOP ASL ASL NOP}
///////////////////////////////////////////////////////
// Text of length 16, fill the rest with [00] (total amount of bytes should add up to 16).
text_speed_text:
"Random text[00][00][00][00][00]"
"More random[00][00][00][00][00]"
"Another speed[00][00][00]"
In general, there isn't a single way to change the max. length of these specific strings, as the game itself handles them in some different ways.
It works! Thank you! I think in this case I'll have to ask for some more of these scripts. So I'll keep it opened for a while.
Here is the solution I used in my translation to move and expand some original texts in the file menu (thanks to Vittorioux's help and ShadowOne333's works):
import asm65816
import jsl_rts
////////////////OFFSETS////////////////
// Saveslot offsets:
ROM[0xC1EEB6] = LDA_i(8) // "Level:". Originally 9.
ROM[0xC1EF19] = LDA_i(13) // (level number). Originally 13.
ROM[0xC1EFAC] = LDA_i(15) // "Text speed:". Originally 16.
// Save interaction offsets:
ROM[0xC1F0DC] = LDX_i (8) // "Copy". Originally 6
ROM[0xC1F117] = LDX_i (13) // "Delete". Originally 10
ROM[0xC1F135] = LDX_i (19) // "Set Up". Originally 15
// Delete window:
ROM[0xC1F31F] = LDA_i(8) // Offset for "Level:". Originally 8.
ROM[0xC1F339] = LDA_i(13) // Offset for the level number. Originally 12.
////////////////LENGTHS////////////////
// "Level:"
ROM[0xC1EE9B] = ASMLoadAddress12 (Level) // Savestate window
ROM[0xC1F326] = ASMLoadAddress0E (Level) // Delete window
ROM[0xC1EEA5] = LDA_i(8) // "Level:" lenght. (Savestate window)
ROM[0xC1F330] = LDA_i(8) // "Level:" lenght. (Delete window)
ROM[0xC1EEAE] = STZ_a(0x9CA7) // Clear tempTextBuffer[8] (0x9CF9 + new length).
Level:
"[85][29][27][9A][9D][26][3A]:"
// Max length for the 3 text-speed words.
ROM[0xC1EFA2] = LDA_i(15)
// This changes the max length for the "Copy to where?" text.
ROM[0xC1F193] = { JSL(copy_to_where_repoint) BRA(0) } // Repoints "Copy to where?" text.
ROM[0xC1F212] = { JSL(copy_to_where_repoint) BRA(0) } // Repoints "Copy to where?" text.
copy_to_where_repoint:
ASMLoadAddress0E(copy_to_where_text)
LDA_i(16) // New length here
JSL_RTS_C1(0xC10EFC)
RTL
copy_to_where_text:
"[7C][27][28][21][29][27][9A][98][30][3A] [23][31][9C][98]?"
Hey, I'm kind of new to CoilSnake, so I wanted to ask about text_misc.yml I'm translating the game into my language, and I've encountered a problem that my text-speed-selection strings are too long so the compilation crashes. On this page I've read that we can create additional scripts that replace pointers for particular strings. In the list of scripts, only
Bash
andRow Front
are available.So how can I make such scripts for
Text Speed Fast
,Text Speed Medium
, andText Speed Slow
? And I think I'll have to do some more in the future, so generally: How can I find pointers and make additional scripts for such strings by myself?