1
0
mirror of https://github.com/blawar/ooot.git synced 2024-06-30 16:29:55 +00:00

Merge branch 'master' of github.com:blawar/ooot

This commit is contained in:
DaMarkov 2022-02-19 20:09:31 +01:00
commit 7955a093d4
53 changed files with 476 additions and 707 deletions

37
.github/workflows/msbuild.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Build
on:
push:
branches: [ master ]
env:
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Debug
jobs:
build:
runs-on: self-hosted
steps:
- name: Cleanup
run: Remove-Item ooot-master -Recurse -Force -ErrorAction SilentlyContinue
- name: Clone OOT
run: git clone --recursive https://github.com/blawar/ooot.git ooot-master
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Copy roms Folder
run: cd ooot-master ; Remove-Item roms -Recurse -Force -ErrorAction SilentlyContinue ; cp -r ../roms .
- name: Extract Assets
run: cd ooot-master ; python setup.py -b EUR_MQD
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: cd ooot-master ; msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} vs/OOT.sln

View File

@ -16,11 +16,7 @@ While it is playable in it's current state, if you are not interested in contrib
wait until the project is further along before playing it. This is a development branch. We need help
finding bugs and PR's for bug fixes and enhancements.
Only Visual Studio Debug 32-bit is currently supported.
Though most of the work for 64-bit is done, 32-bit is being buttoned up first.
32-bit Release works, but is buggy due to optimizations breaking many assumptions.
```
**Note: This repository does not include any of the assets necessary to build the ROM. A prior copy of the game is required to extract the needed assets.**
@ -36,13 +32,7 @@ The current main contributers of this project are [blawar](https://github.com/bl
### Windows
**Visual Studio 2019+ is the only currently supported build environment, and only the 32-bit X86 Debug build**
**Visual Studio 2019+ is the only currently supported build environment, and only the 32-bit X86 Debug build**
**Visual Studio 2019+ is the only currently supported build environment, and only the 32-bit X86 Debug build**
**Visual Studio 2019+ is the only currently supported build environment, and only the 32-bit X86 Debug build**
**Visual Studio 2019+ is the only currently supported build environment, and only the 32-bit X86/WIN32 build**
You must use the ZAPD that is included with this repository, and not the main branch as it is modified.
@ -62,7 +52,7 @@ Run this command to extract the assets from the rom (baserom_original.z64 must e
setup.py -b EUR_MQD
```
Open vs/OOT.sln, make sure **Debug - Win32** is selected, then hit build.
Open vs/OOT.sln, make sure **Debug - Win32** or **Release - Win32** is selected, then hit build.
Once the build completes, press F5 to start it.

View File

@ -4,7 +4,7 @@
struct struct_801664F0 {
/* 0x00 */ u32 type;
/* 0x04 */ u32 setScissor;
/* 0x08 */ Color_RGBA8_u32 color;
/* 0x0C */ Color_RGBA8_u32 envColor;
/* 0x08 */ Color_RGBA8 color;
/* 0x0C */ Color_RGBA8 envColor;
}; // size = 0x10

View File

@ -1,21 +1,21 @@
#pragma once
#include "macros.h"
struct Color_RGB8 {
u8 r, g, b;
};
struct Color_RGBA8 {
Color_RGBA8() = default;
Color_RGBA8(u8 r_, u8 g_, u8 b_, u8 a_) : r(r_), g(g_), b(b_), a(a_) {}
explicit operator u32 () {
return BE32(RGBA8(r, g, b, a));
}
u8 r, g, b, a;
};
// only use when necessary for alignment purposes
typedef union {
struct {
u8 r, g, b, a;
};
u32 rgba;
} Color_RGBA8_u32;
struct Color_RGBAf {
f32 r, g, b, a;
};

View File

@ -7,6 +7,6 @@ void GfxPrint_Init(GfxPrint* pthis);
void GfxPrint_Open(GfxPrint* pthis, Gfx* dList);
s32 GfxPrint_Printf(GfxPrint* pthis, const char* fmt, ...);
void GfxPrint_SetBasePosPx(GfxPrint* pthis, s32 x, s32 y);
void GfxPrint_SetColor(GfxPrint* pthis, u32 r, u32 g, u32 b, u32 a);
void GfxPrint_SetColor(GfxPrint* pthis, u8 r, u8 g, u8 b, u8 a);
void GfxPrint_SetPos(GfxPrint* pthis, s32 x, s32 y);
void GfxPrint_SetPosPx(GfxPrint* pthis, s32 x, s32 y);

View File

@ -4,7 +4,7 @@ void TransitionFade_Destroy(void* pthis);
void TransitionFade_Draw(void* pthis, Gfx** gfxP);
void* TransitionFade_Init(void* pthis);
s32 TransitionFade_IsDone(void* pthis);
void TransitionFade_SetColor(void* pthis, u32 color);
void TransitionFade_SetColor(void* pthis, Color_RGBA8 color);
void TransitionFade_SetType(void* pthis, s32 type);
void TransitionFade_Start(void* pthis);
void TransitionFade_Update(void* pthis, s32 updateRate);

View File

@ -4,7 +4,7 @@ void TransitionWipe_Destroy(void* pthis);
void TransitionWipe_Draw(void* pthis, Gfx** gfxP);
void* TransitionWipe_Init(void* pthis);
s32 TransitionWipe_IsDone(void* pthis);
void TransitionWipe_SetColor(void* pthis, u32 color);
void TransitionWipe_SetColor(void* pthis, Color_RGBA8 color);
void TransitionWipe_SetType(void* pthis, s32 type);
void TransitionWipe_Start(void* pthis);
void TransitionWipe_Update(void* pthis, s32 updateRate);

View File

@ -8,7 +8,7 @@ struct Player;
struct Actor;
extern void* D_8012D1F0;
extern Color_RGBA8_u32 D_801614B0;
extern Color_RGBA8 D_801614B0;
extern s32 gTrnsnUnkState;
s32 FrameAdvance_IsEnabled(GlobalContext* globalCtx);

View File

@ -78,10 +78,16 @@ struct Frame
{
}
constexpr Frame(const T& n) : m_counter(n * (FRAMERATE_MAX / 20))
explicit constexpr Frame(const T& n) : m_counter(n * (FRAMERATE_MAX / 20))
{
}
Frame<T> operator=(const T& n)
{
m_counter = n * (FRAMERATE_MAX / 20);
return *this;
}
template<class S>
constexpr Frame(const Frame<S>& n) : m_counter(n.m_counter)
{
@ -323,14 +329,98 @@ struct Frame
return (float)whole() + ((float)fraction() / ((float)FRAMERATE_MAX / 20.0f));
}
s8 toS8() const
{
return (s8)whole();
}
s16 toS16() const
{
return (s16)whole();
}
s16 toU16() const
s32 toS32() const
{
return (s32)whole();
}
s64 toS64() const
{
return (s64)whole();
}
u8 toU8() const
{
return (u8)whole();
}
u16 toU16() const
{
return (u16)whole();
}
u32 toU32() const
{
return (u32)whole();
}
u64 toU64() const
{
return (u64)whole();
}
explicit operator u8() const
{
return toU8();
}
explicit operator u16() const
{
return toU16();
}
explicit operator u32() const
{
return toU32();
}
explicit operator u64() const
{
return toU64();
}
explicit operator s8() const
{
return toS8();
}
explicit operator s16() const
{
return toS16();
}
explicit operator s32() const
{
return toS32();
}
explicit operator s64() const
{
return toS64();
}
explicit operator float() const
{
return toFloat();
}
Frame<T>& dec()
{
if(m_counter)
{
m_counter--;
}
return *this;
}
const T& get() const
@ -338,6 +428,12 @@ struct Frame
return m_counter;
}
Frame<T>& operator^=(long n)
{
m_counter ^= n;
return *this;
}
T& get()
{
return m_counter;
@ -371,24 +467,106 @@ typedef Frame<s64> Timer;
typedef Frame<s64> Rotation;
typedef Frame<s64> Counter;
template <class T> bool operator<(u16 a, Frame<T> b)
template <class T> bool operator<(T a, Frame<T> b)
{
return b >= a;
return b.operator>=(a);
}
template <class T> bool operator<=(u16 a, Frame<T> b)
template <class T> bool operator<=(T a, Frame<T> b)
{
return b > a;
return b.operator>(a);
}
template <class T> bool operator>(u16 a, Frame<T> b)
template <class T> bool operator>(T a, Frame<T> b)
{
return b <= a;
return b.operator<=(a);
}
template <class T> bool operator>=(u16 a, Frame<T> b)
template <class T> bool operator>=(T a, Frame<T> b)
{
return b < a;
return b.operator<(a);
}
template <class T> bool operator==(T a, Frame<T> b)
{
return b.operator==(a);
}
template <class T> bool operator!=(T a, Frame<T> b)
{
return b.operator!=(a);
}
template <class T> Frame<T> operator*(T a, Frame<T> b)
{
return b.operator*(a);
}
template <class T> Frame<T> operator/(T a, Frame<T> b)
{
return Frame<T>(a).operator/(b);
}
template <class T> Frame<T> operator+(T a, Frame<T> b)
{
return b.operator+(a);
}
template <class T> Frame<T> operator-(T a, Frame<T> b)
{
return Frame<T>(a).operator-(b);
}
static bool operator<(s32 a, Timer b)
{
return b.operator>=(a);
}
static bool operator<=(s32 a, Timer b)
{
return b.operator>(a);
}
static bool operator>(s32 a, Timer b)
{
return b.operator<=(a);
}
static bool operator>=(s32 a, Timer b)
{
return b.operator<(a);
}
static bool operator==(s32 a, Timer b)
{
return b.operator==(a);
}
static bool operator!=(s32 a, Timer b)
{
return b.operator!=(a);
}
static Timer operator*(s32 a, Timer b)
{
return b.operator*(a);
}
static Timer operator/(s32 a, Timer b)
{
return Timer(a).operator/(b);
}
static Timer operator+(s32 a, Timer b)
{
return b.operator+(a);
}
static Timer operator-(s32 a, Timer b)
{
return Timer(a).operator-(b);
}

View File

@ -78,7 +78,7 @@ struct GfxPrint {
/* 0x0C */ u16 baseX;
/* 0x0E */ u8 baseY;
/* 0x0F */ u8 flags;
/* 0x10 */ Color_RGBA8_u32 color;
/* 0x10 */ Color_RGBA8 color;
/* 0x14 */ char unk_14[0x1C]; // unused
}; // size = 0x30

View File

@ -2,6 +2,7 @@
extern "C" {
u64 gfx_width();
u64 gfx_height();
float gfx_ar();
float gfx_ar_ratio();
}
#define GFX_DIMENSIONS_ASPECT_RATIO ((float)gfx_width() / (float)gfx_height())

View File

@ -18,6 +18,7 @@
#define SQ(x) ((x)*(x))
#define ABS(x) ((x) >= 0 ? (x) : -(x))
#define DECR(x) ((x) == 0 ? 0 : --(x))
#define DECRT(x) (x.dec())
#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))
#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))

View File

@ -37,8 +37,8 @@ typedef struct {
/* 0x238 */ void (*draw)(void* transition, Gfx** gfxP);
/* 0x23C */ void (*start)(void* transition);
/* 0x240 */ void (*setType)(void* transition, s32 type);
/* 0x244 */ void (*setColor)(void* transition, u32 color);
/* 0x248 */ void (*setEnvColor)(void* transition, u32 color);
/* 0x244 */ void (*setColor)(void* transition, Color_RGBA8 color);
/* 0x248 */ void (*setEnvColor)(void* transition, Color_RGBA8 color);
/* 0x24C */ s32 (*isDone)(void* transition);
} TransitionContext; // size = 0x250

View File

@ -24,8 +24,8 @@ struct TransitionUnk {
}; // size = 0xE0
struct TransitionWipe {
/* 0x000 */ Color_RGBA8_u32 color;
/* 0x004 */ Color_RGBA8_u32 envColor;
/* 0x000 */ Color_RGBA8 color;
/* 0x004 */ Color_RGBA8 envColor;
/* 0x008 */ u8 direction;
/* 0x009 */ u8 frame;
/* 0x00A */ u8 isDone;
@ -41,13 +41,13 @@ struct TransitionFade {
/* 0x000 */ u8 fadeType;
/* 0x001 */ u8 isDone;
/* 0x002 */ u8 fadeDirection;
/* 0x004 */ Color_RGBA8_u32 fadeColor;
/* 0x004 */ Color_RGBA8 fadeColor;
/* 0x008 */ u16 fadeTimer;
}; // size = 0xC
struct TransitionCircle {
/* 0x000 */ Color_RGBA8_u32 color;
/* 0x004 */ Color_RGBA8_u32 envColor;
/* 0x000 */ Color_RGBA8 color;
/* 0x004 */ Color_RGBA8 envColor;
/* 0x008 */ s32 texX;
/* 0x00C */ s32 texY;
/* 0x010 */ s32 step;
@ -65,7 +65,7 @@ struct TransitionCircle {
}; // size = 0x228;
struct TransitionTriforce {
/* 0x000 */ Color_RGBA8_u32 color;
/* 0x000 */ Color_RGBA8 color;
/* 0x004 */ f32 transPos;
/* 0x008 */ f32 step;
/* 0x00C */ s32 state;

View File

@ -8,14 +8,14 @@ void TransitionCircle_Update(void* thissx, s32 updateRate);
void TransitionCircle_Draw(void* thissx, Gfx** gfxP);
s32 TransitionCircle_IsDone(void* thissx);
void TransitionCircle_SetType(void* thissx, s32 type);
void TransitionCircle_SetColor(void* thissx, u32 color);
void TransitionCircle_SetEnvColor(void* thissx, u32 color);
void TransitionCircle_SetColor(void* thissx, Color_RGBA8 color);
void TransitionCircle_SetEnvColor(void* thissx, Color_RGBA8 color);
void TransitionTriforce_Start(void* thiss);
void* TransitionTriforce_Init(void* thiss);
void TransitionTriforce_Destroy(void* thiss);
void TransitionTriforce_Update(void* thiss, s32 updateRate);
void TransitionTriforce_SetColor(void* thiss, u32 color);
void TransitionTriforce_SetColor(void* thiss, Color_RGBA8 color);
void TransitionTriforce_SetType(void* thiss, s32 type);
void TransitionTriforce_Draw(void* thiss, Gfx** gfxP);
s32 TransitionTriforce_IsDone(void* thiss);
@ -27,7 +27,7 @@ void TransitionWipe_Update(void* thiss, s32 updateRate);
void TransitionWipe_Draw(void* thiss, Gfx** gfxP);
s32 TransitionWipe_IsDone(void* thiss);
void TransitionWipe_SetType(void* thiss, s32 type);
void TransitionWipe_SetColor(void* thiss, u32 color);
void TransitionWipe_SetColor(void* thiss, Color_RGBA8 color);
void TransitionFade_Start(void* thiss);
void* TransitionFade_Init(void* thiss);
@ -35,5 +35,5 @@ void TransitionFade_Destroy(void* thiss);
void TransitionFade_Update(void* thiss, s32 updateRate);
void TransitionFade_Draw(void* thiss, Gfx** gfxP);
s32 TransitionFade_IsDone(void* thiss);
void TransitionFade_SetColor(void* thiss, u32 color);
void TransitionFade_SetColor(void* thiss, Color_RGBA8 color);
void TransitionFade_SetType(void* thiss, s32 type);

View File

@ -4,5 +4,5 @@
extern void* D_8012D1F0;
extern s32 gScreenWidth;
extern s32 gScreenHeight;
extern Color_RGBA8_u32 D_801614B0;
extern Color_RGBA8 D_801614B0;

View File

@ -6,8 +6,8 @@
struct VisMono {
/* 0x00 */ u32 unk_00;
/* 0x04 */ u32 setScissor;
/* 0x08 */ Color_RGBA8_u32 primColor;
/* 0x0C */ Color_RGBA8_u32 envColor;
/* 0x08 */ Color_RGBA8 primColor;
/* 0x0C */ Color_RGBA8 envColor;
/* 0x10 */ u16* tlut;
/* 0x14 */ Gfx* monoDl;
}; // size = 0x18
@ -15,6 +15,6 @@ struct VisMono {
struct struct_80166500 {
/* 0x00 */ u32 useRgba;
/* 0x04 */ u32 setScissor;
/* 0x08 */ Color_RGBA8_u32 primColor;
/* 0x08 */ Color_RGBA8_u32 envColor;
/* 0x08 */ Color_RGBA8 primColor;
/* 0x08 */ Color_RGBA8 envColor;
}; // size = 0x10

View File

@ -1,5 +1,6 @@
<Root>
<File Name="hairal_niwa_scene" Segment="2">
<Path Name="hairal_niwa_scenePathway_000268" NumPaths="8" Offset="0x268"/>
<Scene Name="hairal_niwa_scene" Offset="0x0"/>
</File>
<File Name="hairal_niwa_room_0" Segment="3">

View File

@ -1 +1 @@
8012DB20 gMtxClear
800FCD00 gMtxClear

View File

@ -72,7 +72,7 @@ def main():
with open('vs/oot.props.src', 'r') as f:
buffer = f.read()
buffer = re.sub(r'<buildrom>.*</buildrom>', r'<buildrom>%s</buildrom>' % buildRom(), buffer)
buffer = buffer.replace('#BUILD_ROM#', buildRom())
defines = []
defines.append('ENABLE_%sFPS' % args.framerate)
@ -83,8 +83,9 @@ def main():
defines.append('RETAIL')
defines.append(re.sub(r'[^A-Z0-9_]+', '', buildRom()))
defines.append('NATIVE')
defines.append('%(PreprocessorDefinitions)')
buffer = re.sub(r'<PreprocessorDefinitions>.*</PreprocessorDefinitions>', r'<PreprocessorDefinitions>%s</PreprocessorDefinitions>' % ';'.join(defines), buffer)
#buffer = re.sub(r'<PreprocessorDefinitions>.*</PreprocessorDefinitions>', r'<PreprocessorDefinitions>%s</PreprocessorDefinitions>' % ';'.join(defines), buffer)
buffer = buffer.replace('#DEFINES#', ';'.join(defines))
with open('vs/oot.props', 'w') as f:
f.write(buffer)

View File

@ -83,15 +83,15 @@ void func_800ACE98(struct_801664F0* pthis, Gfx** gfxp) {
gSPDisplayList(gfx++, D_8012AC40);
break;
case 2:
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->color.rgba);
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->color. r, pthis->color.g, pthis->color.b, pthis->color.a);
gSPDisplayList(gfx++, D_8012AC58);
break;
case 3:
gDPSetColor(gfx++, G_SETBLENDCOLOR, pthis->color.rgba);
gDPSetColor(gfx++, G_SETBLENDCOLOR, pthis->color.r, pthis->color.g, pthis->color.b, pthis->color.a);
gSPDisplayList(gfx++, D_8012AC00);
break;
case 4:
gDPSetColor(gfx++, G_SETFOGCOLOR, pthis->color.rgba);
gDPSetColor(gfx++, G_SETFOGCOLOR, pthis->color.r, pthis->color.g, pthis->color.b, pthis->color.a);
gSPDisplayList(gfx++, D_8012AC28);
break;
}

View File

@ -47,8 +47,8 @@ void func_800AD958(struct_80166500* pthis, Gfx** gfxp) {
gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT);
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->primColor.rgba);
gDPSetColor(gfx++, G_SETENVCOLOR, pthis->envColor.rgba);
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->primColor.r, pthis->primColor.g, pthis->primColor.b, pthis->primColor.a);
gDPSetColor(gfx++, G_SETENVCOLOR, pthis->envColor.r, pthis->envColor.g, pthis->envColor.b, pthis->envColor.a);
for (y = 0; y <= SCREEN_HEIGHT - height; y += height) {
gDPLoadTextureBlock(gfx++, tex, fmt, G_IM_SIZ_16b, SCREEN_WIDTH, height, 0, G_TX_NOMIRROR | G_TX_CLAMP,

View File

@ -9,117 +9,47 @@
#define LOG_SEVERITY_VERBOSE 3
s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR;
#ifndef USE_NATIVE_MALLOC
Arena sDebugArena;
#endif
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
#ifndef USE_NATIVE_MALLOC
if (ptr == NULL) {
if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) {
// "%s: %u bytes %s failed\n"
osSyncPrintf("%s: %u bytes %s failed\n", name, size, action);
__osDisplayArena(&sDebugArena);
return;
}
} else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
// "%s: %u bytes %s succeeded\n"
osSyncPrintf("%s: %u bytes %s succeeded\n", name, size, action);
}
#endif
}
void* DebugArena_Malloc(u32 size) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMalloc(&sDebugArena, size);
DebugArena_CheckPointer(ptr, size, "debug_malloc", "Secure"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* DebugArena_MallocDebug(u32 size, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMallocDebug(&sDebugArena, size, file, line);
DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "Secure"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* DebugArena_MallocR(u32 size) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMallocR(&sDebugArena, size);
DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "Secure"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMallocRDebug(&sDebugArena, size, file, line);
DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "Secure"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* DebugArena_Realloc(void* ptr, u32 newSize) {
#ifndef USE_NATIVE_MALLOC
ptr = __osRealloc(&sDebugArena, ptr, newSize);
DebugArena_CheckPointer(ptr, newSize, "debug_realloc", "Re-securing"); // "Re-securing"
return ptr;
#else
return realloc(ptr, newSize);
#endif
}
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line);
DebugArena_CheckPointer(ptr, newSize, "debug_realloc_DEBUG", "Re-securing"); // "Re-securing"
return ptr;
#else
return realloc(ptr, newSize);
#endif
}
void DebugArena_Free(void* ptr) {
#ifndef USE_NATIVE_MALLOC
__osFree(&sDebugArena, ptr);
#else
free(ptr);
#endif
}
void DebugArena_FreeDebug(void* ptr, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
__osFreeDebug(&sDebugArena, ptr, file, line);
#else
free(ptr);
#endif
}
void* DebugArena_Calloc(u32 num, u32 size) {
void* ret;
u32 n = num * size;
#ifndef USE_NATIVE_MALLOC
ret = __osMalloc(&sDebugArena, n);
DebugArena_CheckPointer(ret, n, "debug_calloc", "Secure");
#else
ret = malloc(n);
#endif
if (ret != NULL) {
bzero(ret, n);
}
@ -127,47 +57,23 @@ void* DebugArena_Calloc(u32 num, u32 size) {
}
void DebugArena_Display(void) {
#ifndef USE_NATIVE_MALLOC
// "Zelda heap display" ("Zelda" should probably have been changed to "Debug")
osSyncPrintf("Debug heap display\n");
__osDisplayArena(&sDebugArena);
#endif
}
void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
#ifndef USE_NATIVE_MALLOC
ArenaImpl_GetSizes(&sDebugArena, outMaxFree, outFree, outAlloc);
#else
*outFree = (u32)-1;
*outMaxFree = (u32)-1;
*outAlloc = 0;
#endif
}
void DebugArena_Check(void) {
#ifndef USE_NATIVE_MALLOC
__osCheckArena(&sDebugArena);
#endif
}
void DebugArena_Init(void* start, u32 size) {
#ifndef USE_NATIVE_MALLOC
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocInit(&sDebugArena, start, size);
#endif
}
void DebugArena_Cleanup(void) {
#ifndef USE_NATIVE_MALLOC
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocCleanup(&sDebugArena);
#endif
}
u8 DebugArena_IsInitalized(void) {
#ifndef USE_NATIVE_MALLOC
return __osMallocIsInitalized(&sDebugArena);
#else
return 0;
#endif
}

View File

@ -62,10 +62,9 @@ u32 framerate_get()
void framerate_set_profile(FramerateProfile profile)
{
u64 i = 1 * REG_PER_GROUP + 30;
auto x = &gGameInfo->data[i];
auto& y = gGameInfo->data[i];
g_profile = profile;
R_UPDATE_RATE = g_profileRates[g_profile];
WREG(5) = 3 / FRAMERATE_SCALER;
}
FramerateProfile framerate_get_profile()

View File

@ -149,11 +149,6 @@ void func_800C4344(GameState* gameState) {
s32 hexDumpSize;
u16 hReg82;
#ifndef USE_NATIVE_MALLOC
if (HREG(80) == 0x14) {
__osMalloc_FreeBlockTest_Enable = HREG(82);
}
#endif
if (HREG(80) == 0xC) {
selectedInput = &gameState->input[(u32)HREG(81) < 4U ? HREG(81) : 0];

View File

@ -161,7 +161,7 @@ void GfxPrint_Setup(GfxPrint* pthis) {
gDPSetTileSize(pthis->dList++, i * 2, 0, 0, 60, 1020);
}
gDPSetColor(pthis->dList++, G_SETPRIMCOLOR, pthis->color.rgba);
gDPSetColor(pthis->dList++, G_SETPRIMCOLOR, pthis->color);
gDPLoadMultiTile_4b(pthis->dList++, sGfxPrintRainbowData, 0, 1, G_IM_FMT_CI, 2, 8, 0, 0, 1, 7, 4,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 1, 3, G_TX_NOLOD, G_TX_NOLOD);
@ -175,13 +175,13 @@ void GfxPrint_Setup(GfxPrint* pthis) {
}
}
void GfxPrint_SetColor(GfxPrint* pthis, u32 r, u32 g, u32 b, u32 a) {
void GfxPrint_SetColor(GfxPrint* pthis, u8 r, u8 g, u8 b, u8 a) {
pthis->color.r = r;
pthis->color.g = g;
pthis->color.b = b;
pthis->color.a = a;
gDPPipeSync(pthis->dList++);
gDPSetColor(pthis->dList++, G_SETPRIMCOLOR, pthis->color.rgba);
gDPSetColor(pthis->dList++, G_SETPRIMCOLOR, pthis->color);
}
void GfxPrint_SetPosPx(GfxPrint* pthis, s32 x, s32 y) {
@ -230,7 +230,7 @@ void GfxPrint_PrintCharImpl(GfxPrint* pthis, u8 c) {
tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 10, 1 << 10);
}
gDPSetColor(pthis->dList++, G_SETPRIMCOLOR, pthis->color.rgba);
gDPSetColor(pthis->dList++, G_SETPRIMCOLOR, pthis->color);
}
if (pthis->flags & GFXP_FLAG_ENLARGE) {
@ -328,7 +328,7 @@ void GfxPrint_Init(GfxPrint* pthis) {
pthis->posY = 0;
pthis->baseX = 0;
pthis->baseY = 0;
pthis->color.rgba = 0;
pthis->color = Color_RGBA8(0, 0, 0, 0);
pthis->flags &= ~GFXP_FLAG_HIRAGANA;
pthis->flags &= ~GFXP_FLAG_RAINBOW;

View File

@ -11,115 +11,47 @@
s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
#ifndef USE_NATIVE_MALLOC
Arena gSystemArena;
#endif
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
#ifndef USE_NATIVE_MALLOC
if (ptr == NULL) {
if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) {
// "%s: %u bytes %s failed\n"
osSyncPrintf("%s: %u bytes %s failed\n", name, size, action);
__osDisplayArena(&gSystemArena);
return;
}
} else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
// "%s: %u bytes %s succeeded\n"
osSyncPrintf("%s: %u bytes %s succeeded\n", name, size, action);
}
#endif
}
void* SystemArena_Malloc(u32 size) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMalloc(&gSystemArena, size);
SystemArena_CheckPointer(ptr, size, "malloc", "Secure"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* SystemArena_MallocDebug(u32 size, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMallocDebug(&gSystemArena, size, file, line);
SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "Secure"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* SystemArena_MallocR(u32 size) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMallocR(&gSystemArena, size);
SystemArena_CheckPointer(ptr, size, "malloc_r", "Secure"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMallocRDebug(&gSystemArena, size, file, line);
SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "Secure"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* SystemArena_Realloc(void* ptr, u32 newSize) {
#ifndef USE_NATIVE_MALLOC
ptr = __osRealloc(&gSystemArena, ptr, newSize);
SystemArena_CheckPointer(ptr, newSize, "realloc", "Re-securing"); // "Re-securing"
return ptr;
#else
return realloc(ptr, newSize);
#endif
}
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
ptr = __osReallocDebug(&gSystemArena, ptr, newSize, file, line);
SystemArena_CheckPointer(ptr, newSize, "realloc_DEBUG", "Re-securing"); // "Re-securing"
return ptr;
#else
return realloc(ptr, newSize);
#endif
}
void SystemArena_Free(void* ptr) {
#ifndef USE_NATIVE_MALLOC
__osFree(&gSystemArena, ptr);
#else
free(ptr);
#endif
}
void SystemArena_FreeDebug(void* ptr, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
__osFreeDebug(&gSystemArena, ptr, file, line);
#else
free(ptr);
#endif
}
void* SystemArena_Calloc(u32 num, u32 size) {
void* ret;
u32 n = num * size;
#ifndef USE_NATIVE_MALLOC
ret = __osMalloc(&gSystemArena, n);
#else
ret = malloc(n);
#endif
if (ret != NULL) {
bzero(ret, n);
@ -130,48 +62,24 @@ void* SystemArena_Calloc(u32 num, u32 size) {
}
void SystemArena_Display(void) {
#ifndef USE_NATIVE_MALLOC
osSyncPrintf("システムヒープ表示\n"); // "System heap display"
__osDisplayArena(&gSystemArena);
#endif
}
void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
#ifndef USE_NATIVE_MALLOC
ArenaImpl_GetSizes(&gSystemArena, outMaxFree, outFree, outAlloc);
#else
*outFree = (u32)-1;
*outMaxFree = (u32)-1;
*outAlloc = 0;
#endif
}
void SystemArena_Check(void) {
#ifndef USE_NATIVE_MALLOC
__osCheckArena(&gSystemArena);
#endif
}
void SystemArena_Init(void* start, u32 size) {
#ifndef USE_NATIVE_MALLOC
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocInit(&gSystemArena, start, size);
#else
return;
#endif
}
void SystemArena_Cleanup(void) {
#ifndef USE_NATIVE_MALLOC
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocCleanup(&gSystemArena);
#endif
}
u8 SystemArena_IsInitalized(void) {
#ifndef USE_NATIVE_MALLOC
return __osMallocIsInitalized(&gSystemArena);
#else
return 1;
#endif
}

View File

@ -4,6 +4,7 @@
#include "z64transition.h"
#include "z64audio.h"
#include "sfx.h"
#include "gfx_align.h"
// unused
Gfx sCircleNullDList[] = {
@ -30,7 +31,7 @@ Gfx sCircleDList[] = {
G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsDPSetCombineMode(G_CC_BLENDPEDECALA, G_CC_BLENDPEDECALA),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPLoadTextureBlock(0x08000000, G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
gsDPLoadTextureBlock(SEGMENT_ADDRESS(0x08000000), G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_CLAMP, 4, 6, G_TX_NOLOD, G_TX_NOLOD),
gsSPDisplayListSEG(SEGMENT_ADDRESS(0x09000000)),
gsSPVertex(sCircleWipeVtx, 32, 0),
@ -74,9 +75,9 @@ void TransitionCircle_Start(void* thisx) {
}
if (pthis->typeColor == 0) {
pthis->color.rgba = RGBA8(0, 0, 0, 255);
pthis->color = Color_RGBA8(0, 0, 0, 255);
} else if (pthis->typeColor == 1) {
pthis->color.rgba = RGBA8(160, 160, 160, 255);
pthis->color = Color_RGBA8(160, 160, 160, 255);
} else if (pthis->typeColor == 2) {
// yes, really.
pthis->color.r = 100;
@ -85,7 +86,7 @@ void TransitionCircle_Start(void* thisx) {
pthis->color.a = 255;
} else {
pthis->step = 0x28;
pthis->color.rgba = pthis->effect == 1 ? RGBA8(0, 0, 0, 255) : RGBA8(160, 160, 160, 255);
pthis->color = pthis->effect == 1 ? Color_RGBA8(0, 0, 0, 255) : Color_RGBA8(160, 160, 160, 255);
}
if (pthis->unk_14 != 0) {
pthis->texY = 0;
@ -152,7 +153,8 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxP) {
// These variables are a best guess based on the other transition types.
f32 tPos = 0.0f;
f32 rot = 0.0f;
f32 scale = 14.8f;
const float correction_factor = (gfx_width() * 3.0f) / (gfx_height() * 4.0f); // Should be 1 on a 4:3 display
f32 scale = 14.8f * correction_factor;
modelView = pthis->modelView[pthis->frame];
@ -161,8 +163,8 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxP) {
texScroll = Gfx_BranchTexScroll(&gfx, pthis->texX, pthis->texY, 0x10, 0x40);
gSPSegment(gfx++, 9, texScroll);
gSPSegment(gfx++, 8, pthis->texture);
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->color.rgba);
gDPSetColor(gfx++, G_SETENVCOLOR, pthis->color.rgba);
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->color.r, pthis->color.g, pthis->color.b, pthis->color.a);
gDPSetColor(gfx++, G_SETENVCOLOR, pthis->color.r, pthis->color.g, pthis->color.b, pthis->color.a);
gSPMatrix(gfx++, &pthis->projection, G_MTX_PROJECTION | G_MTX_LOAD);
gSPPerspNormalize(gfx++, pthis->normal);
gSPMatrix(gfx++, &pthis->lookAt, G_MTX_PROJECTION | G_MTX_NOPUSH | G_MTX_MUL);
@ -207,14 +209,14 @@ void TransitionCircle_SetType(void* thisx, s32 type) {
}
}
void TransitionCircle_SetColor(void* thisx, u32 color) {
void TransitionCircle_SetColor(void* thisx, Color_RGBA8 color) {
TransitionCircle* pthis = (TransitionCircle*)thisx;
pthis->color.rgba = color;
pthis->color = color;
}
void TransitionCircle_SetEnvColor(void* thisx, u32 envColor) {
void TransitionCircle_SetEnvColor(void* thisx, Color_RGBA8 envColor) {
TransitionCircle* pthis = (TransitionCircle*)thisx;
pthis->envColor.rgba = envColor;
pthis->envColor = envColor;
}

View File

@ -96,7 +96,7 @@ void TransitionFade_Update(void* pthisx, s32 updateRate) {
void TransitionFade_Draw(void* pthisx, Gfx** gfxP) {
TransitionFade* pthis = (TransitionFade*)pthisx;
Gfx* gfx;
Color_RGBA8_u32* color = &pthis->fadeColor;
Color_RGBA8* color = &pthis->fadeColor;
if (color->a > 0) {
gfx = *gfxP;
@ -114,10 +114,10 @@ s32 TransitionFade_IsDone(void* pthisx) {
return pthis->isDone;
}
void TransitionFade_SetColor(void* pthisx, u32 color) {
void TransitionFade_SetColor(void* pthisx, Color_RGBA8 color) {
TransitionFade* pthis = (TransitionFade*)pthisx;
pthis->fadeColor.rgba = color;
pthis->fadeColor = color;
}
void TransitionFade_SetType(void* pthisx, s32 type) {

View File

@ -53,10 +53,10 @@ void TransitionTriforce_Update(void* pthisx, s32 updateRate) {
}
}
void TransitionTriforce_SetColor(void* pthisx, u32 color) {
void TransitionTriforce_SetColor(void* pthisx, Color_RGBA8 color) {
TransitionTriforce* pthis = (TransitionTriforce*)pthisx;
pthis->color.rgba = color;
pthis->color = color;
}
void TransitionTriforce_SetType(void* pthisx, s32 type) {
@ -89,7 +89,7 @@ void TransitionTriforce_Draw(void* pthisx, Gfx** gfxP) {
guTranslate(&modelView[2], 0.0f, 0.0f, 0.0f);
gDPPipeSync(gfx++);
gSPDisplayList(gfx++, sTriforceWipeDL);
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->color.rgba);
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->color.r, pthis->color.g, pthis->color.b, pthis->color.a);
gDPSetCombineMode(gfx++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
gSPMatrix(gfx++, &pthis->projection, G_MTX_LOAD | G_MTX_PROJECTION);
gSPMatrix(gfx++, &modelView[0], G_MTX_LOAD);

View File

@ -142,14 +142,14 @@ void TransitionWipe_SetType(void* pthisx, s32 type) {
}
}
void TransitionWipe_SetColor(void* pthisx, u32 color) {
void TransitionWipe_SetColor(void* pthisx, Color_RGBA8 color) {
TransitionWipe* pthis = (TransitionWipe*)pthisx;
pthis->color.rgba = color;
pthis->color = color;
}
void TransitionWipe_SetEnvColor(void* pthisx, u32 color) {
void TransitionWipe_SetEnvColor(void* pthisx, Color_RGBA8 color) {
TransitionWipe* pthis = (TransitionWipe*)pthisx;
pthis->envColor.rgba = color;
pthis->envColor = color;
}

View File

@ -10,118 +10,51 @@
#define LOG_SEVERITY_VERBOSE 3
s32 gZeldaArenaLogSeverity = LOG_SEVERITY_ERROR;
#ifndef USE_NATIVE_MALLOC
Arena sZeldaArena;
#endif
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
#ifndef USE_NATIVE_MALLOC
if (ptr == NULL) {
if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) {
// "%s: %u bytes %s failed\n"
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
__osDisplayArena(&sZeldaArena);
}
} else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
// "%s: %u bytes %s succeeded\n"
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
}
#endif
}
void* ZeldaArena_Malloc(u32 size) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMalloc(&sZeldaArena, size);
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc", "確保"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMallocDebug(&sZeldaArena, size, file, line);
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_DEBUG", "確保"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* ZeldaArena_MallocR(u32 size) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMallocR(&sZeldaArena, size);
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r", "確保"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
void* ptr = __osMallocRDebug(&sZeldaArena, size, file, line);
ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r_DEBUG", "確保"); // "Secure"
return ptr;
#else
return malloc(size);
#endif
}
void* ZeldaArena_Realloc(void* ptr, u32 newSize) {
#ifndef USE_NATIVE_MALLOC
ptr = __osRealloc(&sZeldaArena, ptr, newSize);
ZeldaArena_CheckPointer(ptr, newSize, "zelda_realloc", "再確保"); // "Re-securing"
return ptr;
#else
return realloc(ptr, newSize);
#endif
}
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line);
ZeldaArena_CheckPointer(ptr, newSize, "zelda_realloc_DEBUG", "再確保"); // "Re-securing"
return ptr;
#else
return realloc(ptr, newSize);
#endif
}
void ZeldaArena_Free(void* ptr) {
#ifndef USE_NATIVE_MALLOC
__osFree(&sZeldaArena, ptr);
#else
return free(ptr);
#endif
}
void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line) {
#ifndef USE_NATIVE_MALLOC
__osFreeDebug(&sZeldaArena, ptr, file, line);
#else
if((uintptr_t)ptr == 1)
{
return;
}
free(ptr);
#endif
}
void* ZeldaArena_Calloc(u32 num, u32 size) {
void* ret;
u32 n = num * size;
#ifndef USE_NATIVE_MALLOC
ret = __osMalloc(&sZeldaArena, n);
#else
ret = malloc(n);
#endif
if (ret != NULL) {
bzero(ret, n);
@ -132,48 +65,24 @@ void* ZeldaArena_Calloc(u32 num, u32 size) {
}
void ZeldaArena_Display() {
#ifndef USE_NATIVE_MALLOC
osSyncPrintf("ゼルダヒープ表示\n"); // "Zelda heap display"
__osDisplayArena(&sZeldaArena);
#endif
}
void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
#ifndef USE_NATIVE_MALLOC
ArenaImpl_GetSizes(&sZeldaArena, outMaxFree, outFree, outAlloc);
#else
*outFree = (u32)-1;
*outMaxFree = (u32)-1;
*outAlloc = 0;
#endif
}
void ZeldaArena_Check() {
#ifndef USE_NATIVE_MALLOC
__osCheckArena(&sZeldaArena);
#endif
}
void ZeldaArena_Init(void* start, u32 size) {
#ifndef USE_NATIVE_MALLOC
gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocInit(&sZeldaArena, start, size);
#else
return;
#endif
}
void ZeldaArena_Cleanup() {
#ifndef USE_NATIVE_MALLOC
gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocCleanup(&sZeldaArena);
#endif
}
u8 ZeldaArena_IsInitalized() {
#ifndef USE_NATIVE_MALLOC
return __osMallocIsInitalized(&sZeldaArena);
#else
return 0;
#endif
}

View File

@ -159,7 +159,7 @@ static s16 sHBAScoreTier = 0;
static u16 sHBAScoreDigits[] = { 0, 0, 0, 0 };
static u16 sCUpInvisible = 0;
static u16 sCUpTimer = 0;
static Timer sCUpTimer;
s16 gSpoilingItems[] = { ITEM_ODD_MUSHROOM, ITEM_FROG, ITEM_EYEDROPS };
s16 gSpoilingItemReverts[] = { ITEM_COJIRO, ITEM_PRESCRIPTION, ITEM_PRESCRIPTION };
@ -3282,7 +3282,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
Matrix_Translate(0.0f, 0.0f, WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f * FRAMERATE_SCALER, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3701),
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0);

View File

@ -90,7 +90,7 @@ Input* D_8012D1F8 = NULL;
TransitionUnk sTrnsnUnk;
s32 gTrnsnUnkState;
VisMono D_80161498;
Color_RGBA8_u32 D_801614B0;
Color_RGBA8 D_801614B0;
FaultClient D_801614B8;
s16 D_801614C8;
u64 D_801614D0[0xA00];
@ -267,11 +267,6 @@ void Gameplay_Destroy(GameState* thisx) {
void Gameplay_Init(GameState* thisx) {
GlobalContext* globalCtx = (GlobalContext*)thisx;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
#ifndef USE_NATIVE_MALLOC
uintptr_t zAlloc;
uintptr_t zAllocAligned;
size_t zAllocSize;
#endif
Player* player;
s32 playerStartCamId;
s32 i;
@ -442,22 +437,12 @@ void Gameplay_Init(GameState* thisx) {
ShrinkWindow_Init();
TransitionFade_Init(&globalCtx->transitionFade);
TransitionFade_SetType(&globalCtx->transitionFade, 3);
TransitionFade_SetColor(&globalCtx->transitionFade, RGBA8(160, 160, 160, 255));
TransitionFade_SetColor(&globalCtx->transitionFade, Color_RGBA8(160, 160, 160, 255));
TransitionFade_Start(&globalCtx->transitionFade);
VisMono_Init(&D_80161498);
D_801614B0.a = 0;
Flags_UnsetAllEnv(globalCtx);
#ifndef USE_NATIVE_MALLOC
osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetSize(&globalCtx->state.tha));
zAllocSize = THA_GetSize(&globalCtx->state.tha);
zAlloc = GameState_Alloc(&globalCtx->state, zAllocSize, "../z_play.c", 2918);
zAllocAligned = (zAlloc + 8) & ~0xF;
ZeldaArena_Init(zAllocAligned, zAllocSize - zAllocAligned + zAlloc);
// "Zelda Heap"
osSyncPrintf("ゼルダヒープ %08x-%08x\n", zAllocAligned,
(s32)(zAllocAligned + zAllocSize) - (s32)(zAllocAligned - zAlloc));
#endif
Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL);
func_800304DC(globalCtx, &globalCtx->actorCtx, globalCtx->linkActorEntry);
@ -629,27 +614,27 @@ void Gameplay_Update(GlobalContext* globalCtx) {
(globalCtx->transitionCtx.transitionType == 7) ||
(globalCtx->transitionCtx.transitionType == 13) ||
(globalCtx->transitionCtx.transitionType == 17)) {
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(160, 160, 160, 255));
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, Color_RGBA8(160, 160, 160, 255));
if (globalCtx->transitionCtx.setEnvColor != NULL) {
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
RGBA8(160, 160, 160, 255));
Color_RGBA8(160, 160, 160, 255));
}
} else if (globalCtx->transitionCtx.transitionType == 18) {
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(140, 140, 100, 255));
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, Color_RGBA8(140, 140, 100, 255));
if (globalCtx->transitionCtx.setEnvColor != NULL) {
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
RGBA8(140, 140, 100, 255));
Color_RGBA8(140, 140, 100, 255));
}
} else if (globalCtx->transitionCtx.transitionType == 19) {
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(70, 100, 110, 255));
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, Color_RGBA8(70, 100, 110, 255));
if (globalCtx->transitionCtx.setEnvColor != NULL) {
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
RGBA8(70, 100, 110, 255));
Color_RGBA8(70, 100, 110, 255));
}
} else {
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(0, 0, 0, 0));
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, Color_RGBA8(0, 0, 0, 0));
if (globalCtx->transitionCtx.setEnvColor != NULL) {
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data, RGBA8(0, 0, 0, 0));
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data, Color_RGBA8(0, 0, 0, 0));
}
}
@ -1228,7 +1213,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
TransitionFade_Draw(&globalCtx->transitionFade, &gfxP);
if (D_801614B0.a > 0) {
D_80161498.primColor.rgba = D_801614B0.rgba;
D_80161498.primColor = D_801614B0;
VisMono_Draw(&D_80161498, &gfxP);
}

View File

@ -103,8 +103,8 @@ void VisMono_Draw(VisMono* pthis, Gfx** gfxp) {
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
}
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->primColor.rgba);
gDPSetColor(gfx++, G_SETENVCOLOR, pthis->envColor.rgba);
gDPSetColor(gfx++, G_SETPRIMCOLOR, pthis->primColor.r, pthis->primColor.g, pthis->primColor.b, pthis->primColor.a);
gDPSetColor(gfx++, G_SETENVCOLOR, pthis->envColor.r, pthis->envColor.g, pthis->envColor.b, pthis->envColor.a);
gDPLoadTLUT_pal256(gfx++, tlut);

View File

@ -7,15 +7,16 @@
#include "def/sys_matrix.h"
#include "def/z_rcp.h"
#include "def/z_vr_box_draw.h"
#include "framerate.h"
Mtx* sSkyboxDrawMatrix;
Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) {
Matrix_Translate(x, y, z, MTXMODE_NEW);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateX(skyboxCtx->rot.x, MTXMODE_APPLY);
Matrix_RotateY(skyboxCtx->rot.y, MTXMODE_APPLY);
Matrix_RotateZ(skyboxCtx->rot.z, MTXMODE_APPLY);
Matrix_RotateX(skyboxCtx->rot.x * FRAMERATE_SCALER, MTXMODE_APPLY);
Matrix_RotateY(skyboxCtx->rot.y * FRAMERATE_SCALER, MTXMODE_APPLY);
Matrix_RotateZ(skyboxCtx->rot.z * FRAMERATE_SCALER, MTXMODE_APPLY);
return Matrix_ToMtx(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 42);
}
@ -35,9 +36,9 @@ void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyb
Matrix_Translate(x, y, z, MTXMODE_NEW);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateX(skyboxCtx->rot.x, MTXMODE_APPLY);
Matrix_RotateY(skyboxCtx->rot.y, MTXMODE_APPLY);
Matrix_RotateZ(skyboxCtx->rot.z, MTXMODE_APPLY);
Matrix_RotateX(skyboxCtx->rot.x * FRAMERATE_SCALER, MTXMODE_APPLY);
Matrix_RotateY(skyboxCtx->rot.y * FRAMERATE_SCALER, MTXMODE_APPLY);
Matrix_RotateZ(skyboxCtx->rot.z * FRAMERATE_SCALER, MTXMODE_APPLY);
Matrix_ToMtx(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 76);
gSPMatrix(POLY_OPA_DISP++, sSkyboxDrawMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -198,7 +198,7 @@ void ArmsHook_Shoot(ArmsHook* pthis, GlobalContext* globalCtx) {
pthis->timer = 0;
Audio_PlaySoundGeneral(NA_SE_IT_ARROW_STICK_CRE, &pthis->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
} else if (DECR(pthis->timer) == 0) {
} else if (DECRT(pthis->timer) == 0) {
grabbed = pthis->grabbed;
if (grabbed != NULL) {
if ((grabbed->update == NULL) || !CHECK_FLAG_ALL(grabbed->flags, ACTOR_FLAG_13)) {

View File

@ -303,7 +303,7 @@ s32 EnSsh_Damaged(EnSsh* pthis) {
if ((pthis->stunTimer == 120) && (pthis->stateFlags & SSH_STATE_STUNNED)) {
Actor_SetColorFilter(&pthis->actor, 0, 0xC8, 0, pthis->stunTimer.whole());
}
if (DECR(pthis->stunTimer) != 0) {
if (DECRT(pthis->stunTimer) != 0) {
Math_SmoothStepToS(&pthis->maxTurnRate, 0x2710, 0xA, 0x3E8, 1);
return false;
} else {
@ -323,7 +323,7 @@ void EnSsh_Turn(EnSsh* pthis, GlobalContext* globalCtx) {
if (pthis->hitTimer != 0) {
pthis->hitTimer--;
}
if (DECR(pthis->spinTimer) != 0) {
if (DECRT(pthis->spinTimer) != 0) {
pthis->actor.world.rot.y += 10000.0f * FRAMERATE_SCALER * (pthis->spinTimer.toFloat() / 30.0f);
} else if ((pthis->swayTimer == 0) && (pthis->stunTimer == 0)) {
Math_SmoothStepToS(&pthis->actor.world.rot.y, pthis->actor.yawTowardsPlayer, 4, 0x2710, 1);
@ -606,7 +606,7 @@ void EnSsh_SetColliders(EnSsh* pthis, GlobalContext* globalCtx) {
if (pthis->hitTimer == 0) {
EnSsh_SetCylinderOC(pthis, globalCtx);
}
if (DECR(pthis->invincibilityTimer) == 0) {
if (DECRT(pthis->invincibilityTimer) == 0) {
EnSsh_SetBodyCylinderAC(pthis, globalCtx);
EnSsh_SetLegsCylinderAC(pthis, globalCtx);
}
@ -688,17 +688,17 @@ void EnSsh_Idle(EnSsh* pthis, GlobalContext* globalCtx) {
gSaveContext.infTable[25] |= 0x80;
}
} else {
if ((pthis->unkTimer != 0) && (DECR(pthis->unkTimer) == 0)) {
if ((pthis->unkTimer != 0) && (DECRT(pthis->unkTimer) == 0)) {
EnSsh_SetAnimation(pthis, SSH_ANIM_WAIT);
}
if ((pthis->animTimer != 0) && (DECR(pthis->animTimer) == 0)) {
if ((pthis->animTimer != 0) && (DECRT(pthis->animTimer) == 0)) {
EnSsh_SetAnimation(pthis, SSH_ANIM_WAIT);
}
if (!EnSsh_IsCloseToLink(pthis, globalCtx)) {
EnSsh_SetReturnAnimation(pthis);
EnSsh_SetupAction(pthis, EnSsh_Return);
} else {
if (DECR(pthis->sfxTimer) == 0) {
if (DECRT(pthis->sfxTimer) == 0) {
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_STALTU_LAUGH);
pthis->sfxTimer = 64;
}
@ -733,10 +733,10 @@ void EnSsh_Idle(EnSsh* pthis, GlobalContext* globalCtx) {
}
void EnSsh_Land(EnSsh* pthis, GlobalContext* globalCtx) {
if ((pthis->unkTimer != 0) && (DECR(pthis->unkTimer) == 0)) {
if ((pthis->unkTimer != 0) && (DECRT(pthis->unkTimer) == 0)) {
EnSsh_SetAnimation(pthis, SSH_ANIM_WAIT);
}
if ((pthis->animTimer != 0) && (DECR(pthis->animTimer) == 0)) {
if ((pthis->animTimer != 0) && (DECRT(pthis->animTimer) == 0)) {
EnSsh_SetAnimation(pthis, SSH_ANIM_WAIT);
}
if ((pthis->actor.floorHeight + pthis->floorHeightOffset) <= pthis->actor.world.pos.y) {
@ -747,7 +747,7 @@ void EnSsh_Land(EnSsh* pthis, GlobalContext* globalCtx) {
}
void EnSsh_Drop(EnSsh* pthis, GlobalContext* globalCtx) {
if ((pthis->unkTimer != 0) && (DECR(pthis->unkTimer) == 0)) {
if ((pthis->unkTimer != 0) && (DECRT(pthis->unkTimer) == 0)) {
EnSsh_SetAnimation(pthis, SSH_ANIM_DROP);
}
if (!EnSsh_IsCloseToLink(pthis, globalCtx)) {
@ -757,7 +757,7 @@ void EnSsh_Drop(EnSsh* pthis, GlobalContext* globalCtx) {
EnSsh_SpawnShockwave(pthis, globalCtx);
EnSsh_SetLandAnimation(pthis);
EnSsh_SetupAction(pthis, EnSsh_Land);
} else if (DECR(pthis->sfxTimer) == 0) {
} else if (DECRT(pthis->sfxTimer) == 0) {
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_STALTU_DOWN);
pthis->sfxTimer = 3;
}

View File

@ -367,12 +367,12 @@ s32 EnSt_SetCylinderOC(EnSt* pthis, GlobalContext* globalCtx) {
void EnSt_UpdateCylinders(EnSt* pthis, GlobalContext* globalCtx) {
if ((pthis->actor.colChkInfo.health != 0) || (pthis->actionFunc == EnSt_FinishBouncing)) {
if (DECR(pthis->gaveDamageSpinTimer) == 0) {
if (DECRT(pthis->gaveDamageSpinTimer) == 0) {
EnSt_SetCylinderOC(pthis, globalCtx);
}
DECR(pthis->invulnerableTimer);
DECR(pthis->takeDamageSpinTimer);
DECRT(pthis->invulnerableTimer);
DECRT(pthis->takeDamageSpinTimer);
if (pthis->invulnerableTimer == 0 && pthis->takeDamageSpinTimer == 0) {
EnSt_SetBodyCylinderAC(pthis, globalCtx);
@ -566,7 +566,7 @@ float EnSt_DecrStunTimer(EnSt* pthis) {
}
float r = pthis->stunTimer.toFloat();
DECR(pthis->stunTimer);
DECRT(pthis->stunTimer);
return r;
}
@ -610,14 +610,14 @@ void EnSt_UpdateYaw(EnSt* pthis, GlobalContext* globalCtx) {
if (pthis->rotAwayTimer != 0) {
// turn away from the player
DECR(pthis->rotAwayTimer);
DECRT(pthis->rotAwayTimer);
if (pthis->rotAwayTimer == 0) {
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_STALTU_ROLL);
pthis->rotTowardsTimer = 30;
}
} else if (pthis->rotTowardsTimer != 0) {
// turn towards the player
DECR(pthis->rotTowardsTimer);
DECRT(pthis->rotTowardsTimer);
if (pthis->rotTowardsTimer == 0) {
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_STALTU_ROLL);
pthis->rotAwayTimer = 30;
@ -751,7 +751,7 @@ void EnSt_Sway(EnSt* pthis) {
if (pthis->swayTimer != 0) {
pthis->swayAngle += 0xA28;
DECR(pthis->swayTimer);
DECRT(pthis->swayTimer);
if (pthis->swayTimer == 0) {
pthis->swayAngle = 0;
@ -836,7 +836,7 @@ void EnSt_WaitOnCeiling(EnSt* pthis, GlobalContext* globalCtx) {
*/
void EnSt_WaitOnGround(EnSt* pthis, GlobalContext* globalCtx) {
if (pthis->takeDamageSpinTimer != 0) {
DECR(pthis->takeDamageSpinTimer);
DECRT(pthis->takeDamageSpinTimer);
if (pthis->takeDamageSpinTimer == 0) {
func_80034EC0(&pthis->skelAnime, sAnimations, 3);
}
@ -856,7 +856,7 @@ void EnSt_WaitOnGround(EnSt* pthis, GlobalContext* globalCtx) {
return;
}
if (DECR(pthis->sfxTimer) == 0) {
if (DECRT(pthis->sfxTimer) == 0) {
// play the "laugh" sfx every 64 frames.
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_STALTU_LAUGH);
pthis->sfxTimer = 64;
@ -875,7 +875,7 @@ void EnSt_LandOnGround(EnSt* pthis, GlobalContext* globalCtx) {
}
if (pthis->takeDamageSpinTimer != 0) {
DECR(pthis->takeDamageSpinTimer);
DECRT(pthis->takeDamageSpinTimer);
if (pthis->takeDamageSpinTimer == 0) {
func_80034EC0(&pthis->skelAnime, sAnimations, 3);
}
@ -898,7 +898,7 @@ void EnSt_LandOnGround(EnSt* pthis, GlobalContext* globalCtx) {
void EnSt_MoveToGround(EnSt* pthis, GlobalContext* globalCtx) {
if (pthis->takeDamageSpinTimer != 0) {
DECR(pthis->takeDamageSpinTimer);
DECRT(pthis->takeDamageSpinTimer);
if (pthis->takeDamageSpinTimer == 0) {
func_80034EC0(&pthis->skelAnime, sAnimations, 5);
}
@ -913,7 +913,7 @@ void EnSt_MoveToGround(EnSt* pthis, GlobalContext* globalCtx) {
EnSt_SpawnBlastEffect(pthis, globalCtx);
EnSt_SetLandAnimation(pthis);
EnSt_SetupAction(pthis, EnSt_LandOnGround);
} else if (DECR(pthis->sfxTimer) == 0) {
} else if (DECRT(pthis->sfxTimer) == 0) {
Audio_PlayActorSound2(&pthis->actor, NA_SE_EN_STALTU_DOWN);
pthis->sfxTimer = 3;
}
@ -965,14 +965,14 @@ void EnSt_BounceAround(EnSt* pthis, GlobalContext* globalCtx) {
void EnSt_FinishBouncing(EnSt* pthis, GlobalContext* globalCtx) {
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
if (DECR(pthis->deathTimer) == 0) {
if (DECRT(pthis->deathTimer) == 0) {
pthis->actor.velocity = zeroVec;
pthis->finishDeathTimer = 8;
EnSt_SetupAction(pthis, EnSt_Die);
return;
}
if (DECR(pthis->setTargetYawTimer) == 0) {
if (DECRT(pthis->setTargetYawTimer) == 0) {
pthis->deathYawTarget = Math_Vec3f_Yaw(&pthis->actor.world.pos, &pthis->actor.home.pos);
pthis->setTargetYawTimer = 8;
}
@ -992,7 +992,7 @@ void EnSt_FinishBouncing(EnSt* pthis, GlobalContext* globalCtx) {
* Spawn the enemy dying effects, and drop a random item
*/
void EnSt_Die(EnSt* pthis, GlobalContext* globalCtx) {
if (DECR(pthis->finishDeathTimer) != 0) {
if (DECRT(pthis->finishDeathTimer) != 0) {
EnSt_SpawnDeadEffect(pthis, globalCtx);
} else {
Item_DropCollectibleRandom(globalCtx, NULL, &pthis->actor.world.pos, 0xE0);

View File

@ -219,7 +219,7 @@ static s16 sTimer = 0;
void EnViewer_UpdateImpl(EnViewer* pthis, GlobalContext* globalCtx) {
u8 type = pthis->actor.params >> 8;
FrameU16 csFrames;
Counter csFrames;
s32 animationEnded;
if (type == ENVIEWER_TYPE_2_ZELDA) {
@ -548,7 +548,7 @@ void EnViewer_GanondorfPostLimbDrawUpdateCapeVec(GlobalContext* globalCtx, s32 l
}
void EnViewer_DrawGanondorf(EnViewer* pthis, GlobalContext* globalCtx) {
FrameU16 frames = 0;
Counter frames;
s16 type;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_viewer.c", 1405);

View File

@ -492,7 +492,7 @@ s16 func_80B61298(GlobalContext* globalCtx, Actor* thisx) {
}
void EnZo_Blink(EnZo* pthis) {
if (DECR(pthis->blinkTimer) == 0) {
if (DECRT(pthis->blinkTimer) == 0) {
pthis->eyeTexture++;
if (pthis->eyeTexture >= 3) {
pthis->blinkTimer = (float)Rand_S16Offset(30, 30);
@ -663,7 +663,7 @@ void EnZo_TreadWater(EnZo* pthis, GlobalContext* globalCtx) {
Math_ApproachF(&pthis->actor.velocity.y, pthis->actor.yDistToWater < 54.0f ? -0.6f : 0.6f, 0.3f, 0.2f);
if (pthis->rippleTimer > 0.0f) {
DECR(pthis->rippleTimer);
DECRT(pthis->rippleTimer);
if ((pthis->rippleTimer == 3) || (pthis->rippleTimer == 6)) {
EnZo_TreadWaterRipples(pthis, 0.2f, 1.0f, 200);
}
@ -674,7 +674,7 @@ void EnZo_TreadWater(EnZo* pthis, GlobalContext* globalCtx) {
if (EnZo_PlayerInProximity(pthis, globalCtx) != 0) {
pthis->timeToDive = Rand_S16Offset(40, 40);
} else if (DECR(pthis->timeToDive) == 0) {
} else if (DECRT(pthis->timeToDive) == 0) {
f32 startFrame;
func_80034EC0(&pthis->skelAnime, sAnimations, 4);
pthis->canSpeak = false;

View File

@ -15,6 +15,7 @@
#include "def/z_lib.h"
#include "def/z_parameter.h"
#include "def/z_rcp.h"
#include "gfx_align.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_25)
@ -103,7 +104,8 @@ void OceffWipe2_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D84(globalCtx->state.gfxCtx);
Matrix_Translate(eye.x + vec.x, eye.y + vec.y, eye.z + vec.z, MTXMODE_NEW);
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
const float correction_factor = (gfx_width() * 3.0f) / (gfx_height() * 4.0f); // Should be 1 on a 4:3 display
Matrix_Scale(0.1f * correction_factor, 0.1f, 0.1f, MTXMODE_APPLY);
func_800D1FD4(&globalCtx->billboardMtxF);
Matrix_Translate(0.0f, 0.0f, -z, MTXMODE_APPLY);

View File

@ -15,6 +15,7 @@
#include "def/z_lib.h"
#include "def/z_parameter.h"
#include "def/z_rcp.h"
#include "gfx_align.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_25)
@ -104,7 +105,8 @@ void OceffWipe3_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D84(globalCtx->state.gfxCtx);
Matrix_Translate(eye.x + vec.x, eye.y + vec.y, eye.z + vec.z, MTXMODE_NEW);
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
const float correction_factor = (gfx_width() * 3.0f) / (gfx_height() * 4.0f); // Should be 1 on a 4:3 display
Matrix_Scale(0.1f * correction_factor, 0.1f, 0.1f, MTXMODE_APPLY);
func_800D1FD4(&globalCtx->billboardMtxF);
Matrix_Translate(0.0f, 0.0f, -z, MTXMODE_APPLY);

View File

@ -2,6 +2,7 @@
#include "actor_common.h"
#include "z_kaleido_scope.h"
#include "textures/parameter_static/parameter_static.h"
#include "gfx_align.h"
#include "def/inventory.h"
#include "def/audio_bank.h"
#include "def/z_common_data.h"
@ -14,8 +15,8 @@ u8 gAmmoItems[] = {
};
static s16 sEquipState = 0;
static s16 sEquipAnimTimer = 0;
static s16 sEquipMoveTimer = 10;
static Timer sEquipAnimTimer(0);
static Timer sEquipMoveTimer(10);
static s16 sAmmoVtxOffset[] = {
0, 2, 4, 6, 99, 99, 8, 99, 99, 10, 99, 99, 99, 99, 99, 99, 12,
@ -529,11 +530,11 @@ void KaleidoScope_UpdateItemEquip(GlobalContext* globalCtx) {
if (sEquipState == 1) {
bowItemVtx = &pauseCtx->itemVtx[12];
offsetX = ABS(pauseCtx->equipAnimX - bowItemVtx->v.ob[0] * 10) / sEquipMoveTimer;
offsetY = ABS(pauseCtx->equipAnimY - bowItemVtx->v.ob[1] * 10) / sEquipMoveTimer;
offsetX = (u16)(ABS((s16)pauseCtx->equipAnimX - bowItemVtx->v.ob[0] * 10) / sEquipMoveTimer);
offsetY = (u16)(ABS((s16)pauseCtx->equipAnimY - bowItemVtx->v.ob[1] * 10) / sEquipMoveTimer);
} else {
offsetX = ABS(pauseCtx->equipAnimX - sCButtonPosX[pauseCtx->equipTargetCBtn]) / sEquipMoveTimer;
offsetY = ABS(pauseCtx->equipAnimY - sCButtonPosY[pauseCtx->equipTargetCBtn]) / sEquipMoveTimer;
offsetX = (u16)(ABS((s16)pauseCtx->equipAnimX - (sCButtonPosX[pauseCtx->equipTargetCBtn] * gfx_ar_ratio())) / sEquipMoveTimer);
offsetY = (u16)(ABS((s16)pauseCtx->equipAnimY - (sCButtonPosY[pauseCtx->equipTargetCBtn])) / sEquipMoveTimer);
}
if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipAnimAlpha < 254)) {
@ -546,11 +547,11 @@ void KaleidoScope_UpdateItemEquip(GlobalContext* globalCtx) {
}
if (sEquipAnimTimer == 0) {
WREG(90) -= WREG(87) / sEquipMoveTimer;
WREG(87) -= WREG(87) / sEquipMoveTimer;
WREG(90) -= (s16)(WREG(87) / sEquipMoveTimer);
WREG(87) -= (s16)(WREG(87) / sEquipMoveTimer);
if (sEquipState == 1) {
if (pauseCtx->equipAnimX >= (pauseCtx->itemVtx[12].v.ob[0] * 10)) {
if (pauseCtx->equipAnimX >= (pauseCtx->itemVtx[12].v.ob[0] * 10) * gfx_ar_ratio()) {
pauseCtx->equipAnimX -= offsetX;
} else {
pauseCtx->equipAnimX += offsetX;
@ -562,7 +563,7 @@ void KaleidoScope_UpdateItemEquip(GlobalContext* globalCtx) {
pauseCtx->equipAnimY += offsetY;
}
} else {
if (pauseCtx->equipAnimX >= sCButtonPosX[pauseCtx->equipTargetCBtn]) {
if (pauseCtx->equipAnimX >= sCButtonPosX[pauseCtx->equipTargetCBtn] * gfx_ar_ratio()) {
pauseCtx->equipAnimX -= offsetX;
} else {
pauseCtx->equipAnimX += offsetX;

View File

@ -157,15 +157,8 @@ void ParseCommandLineArguments(const std::vector<std::string>& commands)
}
}
int main(int argc, char** argv) {
std::vector<std::string> commands;
for (int i = 1; i < argc; i++)
commands.push_back(argv[i]);
ParseCommandLineArguments(commands);
void run()
{
s16* msg;
@ -185,15 +178,19 @@ int main(int argc, char** argv) {
AudioMgr_Init(&gAudioMgr, NULL, NULL, 0xA, NULL, NULL);
/*StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack + sizeof(sGraphStack), 0, 0x100, "graph");
osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg, sGraphStack + sizeof(sGraphStack), Z_PRIORITY_GRAPH);
osStartThread(&sGraphThread);
osSetThreadPri(0, Z_PRIORITY_SCHED);*/
main_func();
}
int main(int argc, char** argv)
{
std::vector<std::string> commands;
for(int i = 1; i < argc; i++)
commands.push_back(argv[i]);
ParseCommandLineArguments(commands);
run();
}
#include <string.h>
void bzero(void* __s, size_t __n)

View File

@ -19,48 +19,6 @@ static std::unique_ptr<platform::window::Base> gWindow;
#include "def/graph.h"
extern OSViMode osViModeNtscLan1;
u64 frameRateDivisor();
/*struct OSViMode
{
u8 type;
OSViCommonRegs comRegs;
OSViFieldRegs fldRegs[2];
}; // size = 0x4C
/*static OSViMode osViMode = {
2, // type
{
// comRegs
0x311E, // ctrl
SCREEN_WIDTH, // width
0x3E52239, // burst
0x20D, // vSync
0xC15, // hSync
0xC150C15, // leap
0x6C02EC, // hStart
0x200, // xScale
0, // vCurrent
},
{ // fldRegs
{
// [0]
0x280, // origin
0x400, // yScale
0x2501FF, // vStart
0xE0204, // vBurst
2, // vIntr
},
{
// [1]
0x280, // origin
0x400, // yScale
0x2501FF, // vStart
0xE0204, // vBurst
2, // vIntr
} },
};*/
#include <stdlib.h>
//#include "gfx/fast64.h"
@ -382,11 +340,12 @@ bool SetDPIAwarness(PROCESS_DPI_AWARENESS Awarness)
}
return false;
}
void run();
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, int nCmdShow)
{
SetDPIAwarness(PROCESS_SYSTEM_DPI_AWARE);
main_func();
run();
return 0;
}
#else
@ -443,6 +402,15 @@ extern "C" {
return 1.0f;
}
float gfx_ar()
{
if(gWindow)
{
return gWindow->ar();
}
return 1.0f;
}
void set_fullscreen(bool value)
{
gWindow->set_fullscreen(value, false);

View File

@ -26,32 +26,10 @@
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PropertyGroup Label="Configuration">
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
@ -60,127 +38,31 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="oot.props" />
<Import Project="oot.debug.props" />
<Import Project="oot.x86.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="oot.props" />
<Import Project="oot.release.props" />
<Import Project="oot.x86.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="oot.props" />
<Import Project="oot.debug.props" />
<Import Project="oot.x64.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="oot.props" />
<Import Project="oot.release.props" />
<Import Project="oot.x64.props" />
</ImportGroup>
<PropertyGroup>
<IntDir>$(Configuration)\$(PlatformShortName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<ObjectFileName>$(IntDir)</ObjectFileName>
<DisableSpecificWarnings>4146</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../include;../src;../assets/$(buildrom)/;../build;../;../external/include</IncludePath>
<LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);..\external\Win32</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../include;../src;../assets/$(buildrom)/;../build;../;../external/include</IncludePath>
<LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);..\external\Win32</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../include;../src;../assets/$(buildrom)/;../build;../;../external/include;../GLideN64;../GLideN64/osal</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);..\external\x64</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../include;../src;../assets/$(buildrom)/;../build;../;../external/include</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);..\external\x64</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;ENABLE_JSON;ENABLE_MOUSE;USE_NATIVE_MALLOC;_CONSOLE;_LANGUAGE_C;ENABLE_OPENGL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<DisableSpecificWarnings>4146</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>GLideN64d.lib;opengl32.lib;libGLideNHQd.lib;osald.lib;freetype253MT.lib;SDL2-static.lib;winmm.lib;setupapi.lib;version.lib;imm32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;WIN32;ENABLE_JSON;ENABLE_MOUSE;USE_NATIVE_MALLOC;_CONSOLE;_LANGUAGE_C;ENABLE_OPENGL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>4146</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>GLideN64.lib;libGLideNHQ.lib;osal.lib;freetype253MT.lib;SDL2-static.lib;winmm.lib;setupapi.lib;version.lib;imm32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CONSOLE;OS_WINDOWS;_LANGUAGE_C;ENABLE_OPENGL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>4146</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>SDL2-static.lib;winmm.lib;setupapi.lib;version.lib;imm32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shcore.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;SDL2.lib;SDL2_image.lib;SDL2_ttf.lib;SDL2_mixer.lib;opengl32.lib;glu32.lib;glew32s.lib;libzstd_staticd.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;_LANGUAGE_C;ENABLE_OPENGL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>4146</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>SDL2-static.lib;winmm.lib;setupapi.lib;version.lib;imm32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shcore.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;SDL2.lib;SDL2_image.lib;SDL2_ttf.lib;SDL2_mixer.lib;opengl32.lib;glu32.lib;glew32s.lib;libzstd_staticd.lib;core.lib;output.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\assets\$(buildrom)\misc\link_animetion\link_animetion.cpp" />
<ClCompile Include="..\assets\$(buildrom)\objects\gameplay_dangeon_keep\gameplay_dangeon_keep.cpp" />

View File

@ -5082,72 +5082,6 @@
<ClCompile Include="..\roms\$(buildrom)\text\staff_message_data_static.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\indoors\hairal_niwa2\hairal_niwa2_room_0.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\indoors\hairal_niwa2\hairal_niwa2_scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\besitu\besitu_room_0.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\besitu\besitu_scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\depth_test\depth_test_room_0.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\depth_test\depth_test_scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\sasatest\sasatest_room_0.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\sasatest\sasatest_scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\sutaru\sutaru_room_0.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\sutaru\sutaru_scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\syotes2\syotes2_room_0.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\syotes2\syotes2_scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\syotes\syotes_room_0.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\syotes\syotes_scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\test01\test01_room_0.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\test01\test01_scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\testroom\testroom_room_0.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\testroom\testroom_room_1.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\testroom\testroom_room_2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\testroom\testroom_room_3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\testroom\testroom_room_4.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\assets\$(buildrom)\scenes\test_levels\testroom\testroom_scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\segment_symbols.h">

18
vs/oot.debug.props Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>GLideN64d.lib;opengl32.lib;libGLideNHQd.lib;osald.lib;freetype253MT.lib;SDL2-static.lib;winmm.lib;setupapi.lib;version.lib;imm32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
</Project>

View File

@ -2,12 +2,25 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<buildrom>PAL_1.0</buildrom>
<buildrom>#BUILD_ROM#</buildrom>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../include;../src;../assets/$(buildrom)/;../build;../;../external/include;%(IncludePath)</IncludePath>
<LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);../external/Win32;%(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>ENABLE_20FPS;ENABLE_MOUSE;RETAIL;PAL_10;NATIVE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<PreprocessorDefinitions>#DEFINES#;OS_WINDOWS;_LANGUAGE_C;ENABLE_OPENGL;USE_NATIVE_MALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<ObjectFileName>$(IntDir)</ObjectFileName>
<DisableSpecificWarnings>4146</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<SDLCheck>false</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>

24
vs/oot.release.props Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>GLideN64.lib;opengl32.lib;libGLideNHQ.lib;osald.lib;freetype253MT.lib;SDL2-static.lib;winmm.lib;setupapi.lib;version.lib;imm32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
</Project>

7
vs/oot.x64.props Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="Configuration">
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);../external/x64</LibraryPath>
</PropertyGroup>
</Project>

7
vs/oot.x86.props Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="Configuration">
<LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);../external/Win32</LibraryPath>
</PropertyGroup>
</Project>