This commit is contained in:
lzwdgc 2024-02-03 05:51:36 +03:00
parent 83b052ba43
commit 5c641bcc04
2 changed files with 13 additions and 10 deletions

View file

@ -349,3 +349,14 @@ struct pak {
uint32_t unk1;
};
#pragma pack(pop)
#pragma pack(push, 1)
struct script {
static constexpr uint32_t default_block_size = 16000;
uint32_t file_size;
uint32_t unk0{default_block_size}; // stack size? always 16000? // section bits?
uint32_t raw_text_size;
uint32_t nlines;
};
#pragma pack(pop)

View file

@ -17,6 +17,7 @@
*/
#include <mmap.h>
#include <types.h>
#include <primitives/sw/main.h>
#include <primitives/sw/settings.h>
@ -24,15 +25,6 @@
#include <fstream>
#pragma pack(push, 1)
struct script {
uint32_t file_size;
uint32_t unk0; // stack size? always 16000? // section bits?
uint32_t raw_text_size;
uint32_t nlines;
};
#pragma pack(pop)
int main(int argc, char *argv[]) {
cl::opt<path> p(cl::Positional, cl::desc("<script.scr or scripts dir>"), cl::Required);
@ -52,7 +44,7 @@ int main(int argc, char *argv[]) {
{
filename += ".txt";
if (std::ofstream ofile(filename); ofile) {
std::string indent, space = " "s;
std::string indent, space = " "s;
auto inc = [&]() {
indent += space;
};