mirror of
https://github.com/open-goal/jak-project
synced 2026-06-23 09:29:56 -04:00
8daf33492e
Less than 100 instructions left to implement, with the vast vast majority being load-and-stores. These will likely be knocked out quickly but they require a more involved implementation than just simply translating the instructions (several need multiple instructions, others may need reserved registers (x16 or x17 are common for this purpose)) This is a good milestone to get something pushed to master.
37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
#include "FileInfo.h"
|
|
|
|
#include <chrono>
|
|
|
|
#include "common/versions/versions.h"
|
|
|
|
#include "goalc/data_compiler/DataObjectGenerator.h"
|
|
|
|
#include "fmt/chrono.h"
|
|
|
|
std::string get_current_time_and_date() {
|
|
auto const now = std::chrono::floor<std::chrono::seconds>(std::chrono::system_clock::now());
|
|
std::time_t const t = std::chrono::system_clock::to_time_t(now);
|
|
std::tm tm{};
|
|
#if defined(_WIN32)
|
|
localtime_s(&tm, &t);
|
|
#else
|
|
localtime_r(&t, &tm);
|
|
#endif
|
|
return fmt::format("{:%a %b %d %H:%M:%S %Y}", tm);
|
|
}
|
|
|
|
size_t FileInfo::add_to_object_file(DataObjectGenerator& gen) const {
|
|
gen.align_to_basic();
|
|
gen.add_type_tag("file-info");
|
|
size_t offset = gen.current_offset_bytes();
|
|
gen.add_type_tag(file_type);
|
|
gen.add_ref_to_string_in_pool(file_name);
|
|
gen.add_word(major_version);
|
|
gen.add_word(minor_version);
|
|
gen.add_ref_to_string_in_pool(maya_file_name);
|
|
gen.add_ref_to_string_in_pool(tool_debug + " " + get_current_time_and_date() + "\n");
|
|
gen.add_ref_to_string_in_pool(mdb_file_name);
|
|
|
|
return offset;
|
|
}
|