Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Console/Commands/UpdateBuildRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function handle()
$proc = new Process([
base_path("bin/asar/$system/asar"),
'--fix-checksum=off',
'-DFEATURE_NEW_TEXT=1',
base_path('vendor/z3/randomizer/LTTP_RND_GeneralBugfixes.asm'),
$romFile,
], base_path("vendor/z3/randomizer"));
Expand Down
8 changes: 4 additions & 4 deletions app/Rom.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/
class Rom
{
const BUILD = '2022-02-18';
const HASH = 'b07386f3583b096d696ea1e4ef5023cb';
const BUILD = '2022-11-26';
const HASH = 'a145f73e8400cec6d9a45c57a9076bf1';
const SIZE = 2097152;

private $tmp_file;
Expand Down Expand Up @@ -1920,8 +1920,8 @@ public function setInvertedMode(bool $enable = true): self
$this->text->setString('dark_sanctuary_yes', "{NOTEXT}", false);
$this->text->setString('dark_sanctuary_no', "If you want that healing you're gonna need 20 rupees.");

$this->text->setString('menu_start_2', "{MENU}\n{SPEED0}\n≥@'s house\n Dark Chapel\n{CHOICE3}", false);
$this->text->setString('menu_start_3', "{MENU}\n{SPEED0}\n≥@'s house\n Dark Chapel\n Dark Mountain\n{CHOICE2}", false);
$this->text->setString('menu_start_2', "{MENU}\n{SPEED0}\n≥@'s House\n Dark Chapel\n{CHOICE3}", false);
$this->text->setString('menu_start_3', "{MENU}\n{SPEED0}\n≥@'s House\n Dark Chapel\n Dark Mountain\n{CHOICE2}", false);

$this->text->setString('intro_main', "{INTRO}\n Episode III\n{PAUSE3}\n A Link to\n the Past\n"
. "{PAUSE3}\nInverted\n Randomizer\n{PAUSE3}\nAfter mostly disregarding what happened in the first two games,\n"
Expand Down
18 changes: 11 additions & 7 deletions app/Support/Dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Dialog
public function convertDialog(string $string, $max_bytes = 256)
{
$new_string = [];
$lines = explode("\n", mb_strtoupper($string));
$lines = explode("\n", $string);
$i = 0;
foreach ($lines as $line) {
switch ($i) {
Expand All @@ -34,7 +34,7 @@ public function convertDialog(string $string, $max_bytes = 256)
break;
}

$line_chars = preg_split('//u', mb_substr($line, 0, 14), null, PREG_SPLIT_NO_EMPTY);
$line_chars = preg_split('//u', mb_substr($line, 0, 19), null, PREG_SPLIT_NO_EMPTY);

if ($line_chars === false) {
continue;
Expand Down Expand Up @@ -75,23 +75,23 @@ public function convertDialog(string $string, $max_bytes = 256)
*
* @return array
*/
public function convertDialogCompressed(string $string, $pause = true, $max_bytes = 2046, $wrap = 14)
public function convertDialogCompressed(string $string, $pause = true, $max_bytes = 2046, $wrap = 19)
{
$pad_out = false;
$new_string = [0xFB];
$lines = explode("\n", mb_strtoupper($string));
$lines = explode("\n", $string);
if ($wrap > 0) {
$new_lines = [];
foreach ($lines as $line) {
$new_line = mb_wordwrap($line, $wrap, "\n");
$new_lines = array_merge($new_lines, explode("\n", mb_strtoupper($new_line)));
$new_lines = array_merge($new_lines, explode("\n", $new_line));
}
$lines = $new_lines;
}
$i = 0;
$line_count = (substr((string) end($lines), 0, 1) == '{') ? count($lines) - 1 : count($lines);
foreach ($lines as $line) {
$line_chars = preg_split('//u', mb_substr($line, 0, 14), null, PREG_SPLIT_NO_EMPTY);
$line_chars = preg_split('//u', mb_substr($line, 0, 19), null, PREG_SPLIT_NO_EMPTY);
if ($line_chars === false) {
continue;
}
Expand Down Expand Up @@ -197,7 +197,7 @@ public function convertDialogCompressed(string $string, $pause = true, $max_byte

// the first box needs to fill the full width with spaces as the palette is loaded weird.
if ($pad_out && $i < 3) {
$line_chars = array_pad($line_chars, 14, ' ');
$line_chars = array_pad($line_chars, 19, ' ');
}

foreach ($line_chars as $char) {
Expand Down Expand Up @@ -424,6 +424,10 @@ private function charToHex(string $char): array
return [ord($char) - 65 + 0xAA];
}

if (preg_match('/[a-z]/', $char)) {
return [ord($char) - 49];
}

return self::$characters[$char] ?? [0xFF];
}
}
4 changes: 2 additions & 2 deletions app/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function en()

'kakariko_saharalasa_after_master_sword' => $converter->convertDialogCompressed("Cool sword!\n\n\n…\n\n\n…\n\n\nPlease save us"),

'kakariko_alert_guards' => $converter->convertDialogCompressed("GUARDS! HELP!\nThe creeper\n@ is here!"),
'kakariko_alert_guards' => $converter->convertDialogCompressed("Guards! Help!\nThe creeper\n@ is here!"),
// 0x30
'sahasrahla_quest_have_pendants' => $converter->convertDialogCompressed("{BOTTOM}\nCool beans, but I think you should mosey on over to the Lost Woods."),

Expand Down Expand Up @@ -214,7 +214,7 @@ public function en()

'sign_east_of_castle' => $converter->convertDialogCompressed("→ East Palace\n\n← Castle"),

'sign_north_of_lake' => $converter->convertDialogCompressed("\n Lake Hiriah"),
'sign_north_of_lake' => $converter->convertDialogCompressed("\n Lake Hylia"),

'sign_desert_thief' => $converter->convertDialogCompressed("Don't talk to me or touch my sign!"),

Expand Down