mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-06-06 22:33:28 +00:00
Merge branch 'master' of ssh://gitlab.axiodl.com:6431/AxioDL/urde
This commit is contained in:
commit
59af54afad
@ -37,17 +37,18 @@ extern "C"
|
|||||||
* of the MIT license. See the LICENSE file for details.
|
* of the MIT license. See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define WINDOWS_BUILD 1
|
|
||||||
#define DEBUG_HZ 0
|
#define DEBUG_HZ 0
|
||||||
#define DEBUG_MAIN_CALLS 0
|
#define DEBUG_MAIN_CALLS 0
|
||||||
#define DEBUG_KEY 0
|
#define DEBUG_KEY 0
|
||||||
#define DEBUG_LOAD_INFO 1
|
#define DEBUG_LOAD_INFO 1
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
std::chrono::steady_clock::time_point s_tp = std::chrono::steady_clock::now();
|
std::chrono::steady_clock::time_point s_tp = std::chrono::steady_clock::now();
|
||||||
static std::chrono::milliseconds::rep GetTickCount()
|
static std::chrono::milliseconds::rep GetTickCount()
|
||||||
{
|
{
|
||||||
return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - s_tp).count();
|
return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - s_tp).count();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char *VERSION_STRING = "fixNES Alpha v1.0.5";
|
static const char *VERSION_STRING = "fixNES Alpha v1.0.5";
|
||||||
static char window_title[256];
|
static char window_title[256];
|
||||||
@ -87,10 +88,6 @@ static bool inResize = false;
|
|||||||
static bool inDiskSwitch = false;
|
static bool inDiskSwitch = false;
|
||||||
static bool inReset = false;
|
static bool inReset = false;
|
||||||
|
|
||||||
#if WINDOWS_BUILD
|
|
||||||
//#include <windows.h>
|
|
||||||
//typedef bool (APIENTRY *PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
|
||||||
//PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
|
|
||||||
#if DEBUG_HZ
|
#if DEBUG_HZ
|
||||||
static int emuFrameStart = 0;
|
static int emuFrameStart = 0;
|
||||||
static int emuTimesCalled = 0;
|
static int emuTimesCalled = 0;
|
||||||
@ -102,7 +99,6 @@ static int emuMainTimesCalled = 0;
|
|||||||
static int emuMainTimesSkipped = 0;
|
static int emuMainTimesSkipped = 0;
|
||||||
static int emuMainTotalElapsed = 0;
|
static int emuMainTotalElapsed = 0;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DOTS 341
|
#define DOTS 341
|
||||||
|
|
||||||
@ -242,14 +238,12 @@ void CNESEmulator::InitializeEmulator()
|
|||||||
sprintf(window_title, "%s NES - %s\n", nesPAL ? "PAL" : "NTSC", VERSION_STRING);
|
sprintf(window_title, "%s NES - %s\n", nesPAL ? "PAL" : "NTSC", VERSION_STRING);
|
||||||
|
|
||||||
sprintf(window_title_pause, "%s (Pause)", window_title);
|
sprintf(window_title_pause, "%s (Pause)", window_title);
|
||||||
#if WINDOWS_BUILD
|
|
||||||
#if DEBUG_HZ
|
#if DEBUG_HZ
|
||||||
emuFrameStart = GetTickCount();
|
emuFrameStart = GetTickCount();
|
||||||
#endif
|
#endif
|
||||||
#if DEBUG_MAIN_CALLS
|
#if DEBUG_MAIN_CALLS
|
||||||
emuMainFrameStart = GetTickCount();
|
emuMainFrameStart = GetTickCount();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
cpuCycleTimer = nesPAL ? 16 : 12;
|
cpuCycleTimer = nesPAL ? 16 : 12;
|
||||||
//do full frame per update loop
|
//do full frame per update loop
|
||||||
ppuCycleTimer = nesPAL ? 5 : 4;
|
ppuCycleTimer = nesPAL ? 5 : 4;
|
||||||
@ -405,7 +399,7 @@ void CNESEmulator::NesEmuMainLoop(bool forceDraw)
|
|||||||
{
|
{
|
||||||
if(emuRenderFrame || nesPause)
|
if(emuRenderFrame || nesPause)
|
||||||
{
|
{
|
||||||
#if (WINDOWS_BUILD && DEBUG_MAIN_CALLS)
|
#if DEBUG_MAIN_CALLS
|
||||||
emuMainTimesSkipped++;
|
emuMainTimesSkipped++;
|
||||||
#endif
|
#endif
|
||||||
//printf("LC RENDER: %d\n", loopCount);
|
//printf("LC RENDER: %d\n", loopCount);
|
||||||
@ -431,7 +425,7 @@ void CNESEmulator::NesEmuMainLoop(bool forceDraw)
|
|||||||
{
|
{
|
||||||
if(!apuCycleURDE() && !forceDraw)
|
if(!apuCycleURDE() && !forceDraw)
|
||||||
{
|
{
|
||||||
#if (WINDOWS_BUILD && DEBUG_MAIN_CALLS)
|
#if DEBUG_MAIN_CALLS
|
||||||
emuMainTimesSkipped++;
|
emuMainTimesSkipped++;
|
||||||
#endif
|
#endif
|
||||||
#if CATCHUP_SKIP
|
#if CATCHUP_SKIP
|
||||||
@ -475,17 +469,17 @@ void CNESEmulator::NesEmuMainLoop(bool forceDraw)
|
|||||||
emuRenderFrame = true;
|
emuRenderFrame = true;
|
||||||
if(fm2playRunning())
|
if(fm2playRunning())
|
||||||
fm2playUpdate();
|
fm2playUpdate();
|
||||||
#if (WINDOWS_BUILD && DEBUG_HZ)
|
#if DEBUG_HZ
|
||||||
emuTimesCalled++;
|
emuTimesCalled++;
|
||||||
int end = GetTickCount();
|
int end = GetTickCount();
|
||||||
emuTotalElapsed += end - emuFrameStart;
|
emuTotalElapsed += end - emuFrameStart;
|
||||||
if(emuTotalElapsed >= 1000)
|
if(emuTotalElapsed >= 1000)
|
||||||
{
|
{
|
||||||
printf("\r%iHz ", emuTimesCalled);
|
printf("\r%iHz ", emuTimesCalled);
|
||||||
emuTimesCalled = 0;
|
emuTimesCalled = 0;
|
||||||
emuTotalElapsed = 0;
|
emuTotalElapsed = 0;
|
||||||
}
|
}
|
||||||
emuFrameStart = end;
|
emuFrameStart = end;
|
||||||
#endif
|
#endif
|
||||||
if(ppuDebugPauseFrame)
|
if(ppuDebugPauseFrame)
|
||||||
{
|
{
|
||||||
@ -530,20 +524,20 @@ void CNESEmulator::NesEmuMainLoop(bool forceDraw)
|
|||||||
printf("%dms %d %d\n", end - start, loopCount, m_procBufs);
|
printf("%dms %d %d\n", end - start, loopCount, m_procBufs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (WINDOWS_BUILD && DEBUG_MAIN_CALLS)
|
#if DEBUG_MAIN_CALLS
|
||||||
emuMainTimesCalled++;
|
emuMainTimesCalled++;
|
||||||
int end = GetTickCount();
|
int end = GetTickCount();
|
||||||
//printf("%dms\n", end - start);
|
//printf("%dms\n", end - start);
|
||||||
emuMainTotalElapsed += end - emuMainFrameStart;
|
emuMainTotalElapsed += end - emuMainFrameStart;
|
||||||
if(emuMainTotalElapsed >= 1000)
|
if(emuMainTotalElapsed >= 1000)
|
||||||
{
|
{
|
||||||
printf("\r%i calls, %i skips ", emuMainTimesCalled, emuMainTimesSkipped);
|
printf("\r%i calls, %i skips ", emuMainTimesCalled, emuMainTimesSkipped);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
emuMainTimesCalled = 0;
|
emuMainTimesCalled = 0;
|
||||||
emuMainTimesSkipped = 0;
|
emuMainTimesSkipped = 0;
|
||||||
emuMainTotalElapsed = 0;
|
emuMainTotalElapsed = 0;
|
||||||
}
|
}
|
||||||
emuMainFrameStart = end;
|
emuMainFrameStart = end;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class IDvdRequest;
|
class IDvdRequest;
|
||||||
|
|
||||||
namespace MP1
|
namespace MP1
|
||||||
|
@ -198,11 +198,11 @@ boo::ObjToken<boo::IShaderDataBinding> CNESShader::BuildShaderDataBinding(boo::I
|
|||||||
boo::ObjToken<boo::IGraphicsBufferD> uniBuf,
|
boo::ObjToken<boo::IGraphicsBufferD> uniBuf,
|
||||||
boo::ObjToken<boo::ITextureD> tex)
|
boo::ObjToken<boo::ITextureD> tex)
|
||||||
{
|
{
|
||||||
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
|
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {uniBuf.get()};
|
||||||
boo::ObjToken<boo::ITexture> texs[] = {filter.m_booTex.get()};
|
boo::ObjToken<boo::ITexture> texs[] = {tex.get()};
|
||||||
return cctx.newShaderDataBinding(SelectPipeline(type, filter.m_gequal), s_VtxFmt,
|
return ctx.newShaderDataBinding(g_Pipeline, g_VtxFmt,
|
||||||
filter.m_vbo.get(), nullptr, nullptr, 1, bufs,
|
vbo.get(), nullptr, nullptr, 1, bufs,
|
||||||
nullptr, nullptr, nullptr, 1, texs, nullptr, nullptr);
|
nullptr, nullptr, nullptr, 1, texs, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -253,12 +253,11 @@ boo::ObjToken<boo::IShaderDataBinding> CNESShader::BuildShaderDataBinding(boo::V
|
|||||||
boo::ObjToken<boo::IGraphicsBufferD> uniBuf,
|
boo::ObjToken<boo::IGraphicsBufferD> uniBuf,
|
||||||
boo::ObjToken<boo::ITextureD> tex)
|
boo::ObjToken<boo::ITextureD> tex)
|
||||||
{
|
{
|
||||||
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
|
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {uniBuf.get()};
|
||||||
boo::ObjToken<boo::ITexture> texs[] = {filter.m_booTex.get()};
|
boo::ObjToken<boo::ITexture> texs[] = {tex.get()};
|
||||||
return cctx.newShaderDataBinding(SelectPipeline(type, filter.m_gequal,
|
return ctx.newShaderDataBinding(g_Pipeline, g_VtxFmt,
|
||||||
filter.m_booTex->type() == boo::TextureType::Render), s_VtxFmt,
|
vbo.get(), nullptr, nullptr, 1, bufs,
|
||||||
filter.m_vbo.get(), nullptr, nullptr, 1, bufs,
|
nullptr, nullptr, nullptr, 1, texs, nullptr, nullptr);
|
||||||
nullptr, nullptr, nullptr, 1, texs, nullptr, nullptr);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 01b5bde49a730eb287b18def7ed5e5f510cda7b5
|
Subproject commit 25527a513dc635fa87014970618fbfb7dfe3e5c6
|
@ -3,8 +3,10 @@
|
|||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#elif _WIN32
|
||||||
|
#include <../ucrt/malloc.h>
|
||||||
#else
|
#else
|
||||||
#include <../include/malloc.h>
|
#include_next <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // URDE_NESEMULATOR_MALLOC_H
|
#endif // URDE_NESEMULATOR_MALLOC_H
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class IWorld;
|
class IWorld;
|
||||||
class CMapWorldInfo;
|
class CMapWorldInfo;
|
||||||
class CStateManager;
|
class CStateManager;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
|
|
||||||
const char* StringForControlOption(int);
|
const char* StringForControlOption(int);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CStateManager;
|
class CStateManager;
|
||||||
|
|
||||||
/** Options presented in UI */
|
/** Options presented in UI */
|
||||||
|
@ -40,7 +40,7 @@ class CActor;
|
|||||||
class CLight;
|
class CLight;
|
||||||
class CDamageInfo;
|
class CDamageInfo;
|
||||||
class CMaterialFilter;
|
class CMaterialFilter;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CPlayer;
|
class CPlayer;
|
||||||
class CWorld;
|
class CWorld;
|
||||||
class CTexture;
|
class CTexture;
|
||||||
|
@ -14,7 +14,7 @@ class CGameCamera;
|
|||||||
class CCameraShakeData;
|
class CCameraShakeData;
|
||||||
class CScriptWater;
|
class CScriptWater;
|
||||||
class CInterpolationCamera;
|
class CInterpolationCamera;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CScriptCameraHint;
|
class CScriptCameraHint;
|
||||||
class CCinematicCamera;
|
class CCinematicCamera;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
|
|
||||||
class CGameCamera : public CActor
|
class CGameCamera : public CActor
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ namespace urde
|
|||||||
|
|
||||||
class CActor;
|
class CActor;
|
||||||
class CAnimPlaybackParms;
|
class CAnimPlaybackParms;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CPASAnimParmData;
|
class CPASAnimParmData;
|
||||||
class CRandom16;
|
class CRandom16;
|
||||||
class CStateManager;
|
class CStateManager;
|
||||||
|
@ -12,7 +12,7 @@ namespace urde
|
|||||||
class CGuiSys;
|
class CGuiSys;
|
||||||
class CLight;
|
class CLight;
|
||||||
class CGuiCamera;
|
class CGuiCamera;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CGuiLight;
|
class CGuiLight;
|
||||||
class CVParamTransfer;
|
class CVParamTransfer;
|
||||||
class CObjectReference;
|
class CObjectReference;
|
||||||
|
@ -9,7 +9,7 @@ namespace urde
|
|||||||
{
|
{
|
||||||
class CGuiFrame;
|
class CGuiFrame;
|
||||||
class CGuiTextSupport;
|
class CGuiTextSupport;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
|
|
||||||
enum class ETraversalMode
|
enum class ETraversalMode
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CGuiFrame;
|
class CGuiFrame;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CStateManager;
|
class CStateManager;
|
||||||
class CGuiCamera;
|
class CGuiCamera;
|
||||||
class CGuiWidget;
|
class CGuiWidget;
|
||||||
|
@ -14,7 +14,7 @@ namespace urde
|
|||||||
class CGuiTextPane;
|
class CGuiTextPane;
|
||||||
class CGuiWidget;
|
class CGuiWidget;
|
||||||
class CGuiModel;
|
class CGuiModel;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CGuiFrame;
|
class CGuiFrame;
|
||||||
class CAuiImagePane;
|
class CAuiImagePane;
|
||||||
class CStringTable;
|
class CStringTable;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
|
|
||||||
class ControlMapper
|
class ControlMapper
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CGuiWidget;
|
class CGuiWidget;
|
||||||
class CGuiTextPane;
|
class CGuiTextPane;
|
||||||
class CGuiModel;
|
class CGuiModel;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CGuiFrame;
|
class CGuiFrame;
|
||||||
class CGuiTableGroup;
|
class CGuiTableGroup;
|
||||||
class CGuiTextPane;
|
class CGuiTextPane;
|
||||||
|
@ -13,7 +13,7 @@ class CTexture;
|
|||||||
class CStringTable;
|
class CStringTable;
|
||||||
class CGuiFrame;
|
class CGuiFrame;
|
||||||
class CSaveWorld;
|
class CSaveWorld;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CGuiTextPane;
|
class CGuiTextPane;
|
||||||
class CGuiTableGroup;
|
class CGuiTableGroup;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
|
|
||||||
class CPlayerGun
|
class CPlayerGun
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@ namespace urde
|
|||||||
class CActorLights;
|
class CActorLights;
|
||||||
class CPlayer;
|
class CPlayer;
|
||||||
class CDamageInfo;
|
class CDamageInfo;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CScriptWater;
|
class CScriptWater;
|
||||||
class CStateManager;
|
class CStateManager;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class CPlayerGun;
|
|||||||
class CDamageInfo;
|
class CDamageInfo;
|
||||||
class CScriptWater;
|
class CScriptWater;
|
||||||
class IVisitor;
|
class IVisitor;
|
||||||
class CFinalInput;
|
struct CFinalInput;
|
||||||
class CPlayerCameraBob;
|
class CPlayerCameraBob;
|
||||||
class CFirstPersonCamera;
|
class CFirstPersonCamera;
|
||||||
class CCollidableSphere;
|
class CCollidableSphere;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user