bahamut/tools/script-encoder.cpp
//this is needed to move the opening credits text down one line
this is needed to move the opening credits text down one line
this is needed to move the opening credits text down one line
auto encodeOpeningCredits() -> void {
  u8 index = 0xfa;
  u32 address = read24(rom, tableChapter + index * 3) - 0xc00000;
  u16 size = 0;
  auto input = decompressLZSS({rom.data() + address, rom.size() - address}, &size);
  input[0x13] = 0x03;  
  for(u32 offset = 0x0402; offset < input.size(); offset++) {
    input[offset] = 0xff;  
  }
  auto output = compressLZSS(input);
  if(output.size() > size) {
    error("Chapter ", hex(index, 2L), ": ", output.size(), " > ", size);
  }
  file::write({pathEN, "binaries/chapters/chapter-", hex(index, 2L), ".bin"}, output);
}
auto encodeOpeningCredits ( ) -> void { u8 index = 0xfa ; u32 address = read24 ( rom , tableChapter + index * 3 ) - 0xc00000 ; u16 size = 0 ; auto input = decompressLZSS ( { rom . data ( ) + address , rom . size ( ) - address } , & size ) ; input [ 0x13 ] = 0x03 ; for ( u32 offset = 0x0402 ; offset < input . size ( ) ; offset ++ ) { input [ offset ] = 0xff ; } auto output = compressLZSS ( input ) ; if ( output . size ( ) > size ) { error ( " " , hex ( index , 2L ) , " " , output . size ( ) , " " , size ) ; } file :: write ( { pathEN , " " , hex ( index , 2L ) , " " } , output ) ; }
this is needed to move the opening credits text down one line
this is needed to move the opening credits text down one line
//Y position for opening credits text strings (was 0x02) //erase the original text for better script file compression