Begin some work on resources and push a fix for sead

This commit is contained in:
shibbo 2020-12-01 19:33:49 -05:00
parent dddc2463f1
commit 7bb887d894
5 changed files with 20 additions and 19 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@ build
# ignore the actual compiler
compiler
include/nn
# IDA Files
*.id0

View File

@ -13,7 +13,7 @@ optimziation = "-O3"
root = pathlib.Path("compiler")
compilerPath = root / "nx/aarch64/bin/clang++.exe"
compilerCommand = f"{compilerPath} -x c++ -w -std=gnu++14 -fno-exceptions -fno-common -fno-short-enums -ffunction-sections -fdata-sections -fPIC -D{gameVersion} -DNNSDK {optimziation} -fomit-frame-pointer -mcpu=cortex-a57+fp+simd+crypto+crc -g -I include -I include/sead -c "
compilerCommand = f"{compilerPath} -x c++ -w -std=gnu++14 -fno-exceptions -fno-common -fno-short-enums -ffunction-sections -fdata-sections -fPIC -DNN_NINTENDO_SDK -DNN_SDK_BUILD_RELEASE -D{gameVersion} -DNNSDK {optimziation} -fomit-frame-pointer -mcpu=cortex-a57+fp+simd+crypto+crc -g -I include -I include/sead -c "
source_folder = pathlib.Path('source/')
cpp_files = list(source_folder.rglob('*.cpp'))

View File

@ -1,5 +1,6 @@
#pragma once
#include "filedevice/seadArchiveFileDevice.h"
#include "prim/seadSafeString.h"
namespace al
@ -9,5 +10,7 @@ namespace al
public:
Resource(const sead::SafeStringBase<char> &);
unsigned long _0;
sead::ArchiveFileDevice* mDevice; // _8
};
};

View File

@ -17,6 +17,17 @@ public:
static CriticalSection* getParseTextCS_();
static CriticalSection* getInitValueArrayCS_();
static constexpr int countValues(const char* text_all, size_t text_all_len)
{
int count = 1;
for (size_t i = 0; i < text_all_len; ++i)
{
if (text_all[i] == ',')
++count;
}
return count;
}
private:
static void skipToWordEnd_(char** p_ptr, char** p_next);
static void skipToWordStart_(char** p_ptr);
@ -122,15 +133,7 @@ private:
\
static constexpr const char* cTextAll = #__VA_ARGS__; \
static constexpr size_t cTextAllLen = sizeof(#__VA_ARGS__); \
static constexpr int cCount = [] { \
int count = 1; \
for (size_t i = 0; i < cTextAllLen; ++i) \
{ \
if (cTextAll[i] == ',') \
++count; \
} \
return count; \
}(); \
static constexpr int cCount = sead::EnumUtil::countValues(cTextAll, cTextAllLen); \
\
int mIdx; \
};
@ -314,15 +317,7 @@ private:
\
static constexpr const char* cTextAll = #__VA_ARGS__; \
static constexpr size_t cTextAllLen = sizeof(#__VA_ARGS__); \
static constexpr int cCount = [] { \
int count = 1; \
for (int i = 0; i < cTextAllLen; ++i) \
{ \
if (cTextAll[i] == ',') \
++count; \
} \
return count; \
}(); \
static constexpr int cCount = sead::EnumUtil::countValues(cTextAll, cTextAllLen); \
\
int mIdx; \
};

View File

@ -1,5 +1,7 @@
#include "al/actor/LiveActor.h"
#include "al/resource/Resource.h"
namespace al
{
LiveActor::LiveActor(const char *pName)