diff --git a/include/Famicom/famicomInternal.h b/include/Famicom/famicomInternal.hpp similarity index 100% rename from include/Famicom/famicomInternal.h rename to include/Famicom/famicomInternal.hpp diff --git a/include/JSystem/J2D/J2DGXColorS10.h b/include/JSystem/J2D/J2DGXColorS10.h index a8cb3a72..58992784 100644 --- a/include/JSystem/J2D/J2DGXColorS10.h +++ b/include/JSystem/J2D/J2DGXColorS10.h @@ -5,6 +5,7 @@ #include "dolphin/gx.h" #include "JSystem/JUtility/TColor.h" +#ifdef __cplusplus /** * Everything is fabricated here except for the default ctor. * Copied from J3DGXColorS10. @@ -44,5 +45,6 @@ struct J2DGXColorS10 : public GXColorS10 inline operator JUtility::TColor() const { return toTColor(); } inline JUtility::TColor toTColor() const { return JUtility::TColor(r, g, b, a); } }; +#endif #endif diff --git a/include/JSystem/J2D/J2DGrafContext.h b/include/JSystem/J2D/J2DGrafContext.h index 490cf3d5..563b2194 100644 --- a/include/JSystem/J2D/J2DGrafContext.h +++ b/include/JSystem/J2D/J2DGrafContext.h @@ -22,6 +22,7 @@ struct J2DGrafBlend { u8 mDestFactor; // _02 }; +#ifdef __cplusplus struct J2DGrafContext { J2DGrafContext(f32, f32, f32, f32); @@ -130,5 +131,6 @@ void J2DDrawFrame(f32 param_0, f32 param_1, f32 param_2, f32 param_3, JUtility:: void J2DDrawFrame(JGeometry::TBox2f const& param_0, JUtility::TColor param_1, u8 param_2); void J2DDrawLine(f32, f32, f32, f32, JUtility::TColor, int); +#endif -#endif \ No newline at end of file +#endif diff --git a/include/JSystem/J2D/J2DIndBlock.h b/include/JSystem/J2D/J2DIndBlock.h index 833f69d7..d78749e4 100644 --- a/include/JSystem/J2D/J2DIndBlock.h +++ b/include/JSystem/J2D/J2DIndBlock.h @@ -5,6 +5,7 @@ #include "JSystem/J3D/J3DTypes.h" #include "dolphin/gx.h" +#ifdef __cplusplus typedef float Mtx23[2][3]; struct J2DIndTexCoordScaleInfo @@ -122,5 +123,6 @@ struct J2DIndBlockFull : public J2DIndBlock J2DIndTexMtx mTexMtxes[3]; // _10 J2DIndTexCoordScale mTexCoordScales[4]; // _64 }; +#endif #endif diff --git a/include/JSystem/J2D/J2DTypes.h b/include/JSystem/J2D/J2DTypes.h index 5a28d7bc..b2572ea5 100644 --- a/include/JSystem/J2D/J2DTypes.h +++ b/include/JSystem/J2D/J2DTypes.h @@ -10,6 +10,7 @@ #include "JSystem/JUtility/TColor.h" #include "types.h" +#ifdef __cplusplus struct JUTTexture; enum J2DBinding @@ -385,5 +386,5 @@ enum J2DTextBoxVBinding }; // extern const J2DTexCoordInfo j2dDefaultTexCoordInfo[8]; - +#endif #endif diff --git a/include/JSystem/J3D/J3DTypes.h b/include/JSystem/J3D/J3DTypes.h index a7152ded..35b62165 100644 --- a/include/JSystem/J3D/J3DTypes.h +++ b/include/JSystem/J3D/J3DTypes.h @@ -3,6 +3,7 @@ #include "types.h" +#ifdef __cplusplus enum JBlockType { JBT_ColorAmbientOn = 'CLAB', JBT_ColorNull = 'CLNL', @@ -28,5 +29,6 @@ enum JBlockType { JBT_TevNull = 'TVNL', JBT_TevPatched = 'TVPT' }; +#endif #endif diff --git a/include/JSystem/JGadget/define.h b/include/JSystem/JGadget/define.h index 883ed4e7..9efdcd66 100644 --- a/include/JSystem/JGadget/define.h +++ b/include/JSystem/JGadget/define.h @@ -5,7 +5,6 @@ #ifdef __cplusplus extern "C" { -#endif class JGadget_outMessage { public: @@ -44,7 +43,6 @@ private: #endif -#ifdef __cplusplus } #endif diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h index d375d04c..acf64a7c 100644 --- a/include/JSystem/JGadget/linklist.h +++ b/include/JSystem/JGadget/linklist.h @@ -6,6 +6,7 @@ #include "JSystem/JUtility/JUTAssertion.h" #include "JSystem/JGadget/define.h" +#ifdef __cplusplus namespace JGadget { #define NEGATIVE_OFFSETOF(TYPE, MEMBER) (-static_cast(offsetof(TYPE, MEMBER))) @@ -301,5 +302,6 @@ public: #pragma pop } +#endif #endif diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 3965f69e..e24f4d10 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -3,6 +3,7 @@ #include "types.h" +#ifdef __cplusplus inline f32 fsqrt_step(f32 mag) { f32 root = __frsqrte(mag); @@ -359,5 +360,6 @@ typedef TBox2 TBox2f; typedef TBox3 TBox3f; } // namespace JGeometry +#endif #endif \ No newline at end of file diff --git a/include/JSystem/JKernel/JKRAram.h b/include/JSystem/JKernel/JKRAram.h index 84ebbd62..0f50d9e9 100644 --- a/include/JSystem/JKernel/JKRAram.h +++ b/include/JSystem/JKernel/JKRAram.h @@ -11,6 +11,7 @@ #include "JSystem/JSupport/JSUList.h" #include "JSystem/JSupport/JSUStream.h" +#ifdef __cplusplus #define ARAM_GROUP_ID_ALL 0 #define ARAM_GROUP_ID_DEFAULT 0xFF @@ -312,3 +313,4 @@ inline void JKRAramPcs_SendCommand(JKRAMCommand* cmd) } #endif +#endif diff --git a/include/JSystem/JKernel/JKRArchive.h b/include/JSystem/JKernel/JKRArchive.h index 652c4f68..0028b253 100644 --- a/include/JSystem/JKernel/JKRArchive.h +++ b/include/JSystem/JKernel/JKRArchive.h @@ -6,6 +6,7 @@ #include "JSystem/JKernel/JKRHeap.h" #include "types.h" +#ifdef __cplusplus // NOTE: Vtable offsets are off #define JKRARCHIVE_ATTR_COMPRESSION 0x04 @@ -340,3 +341,4 @@ inline JKRArchive* JKRMountArchive(void* inBuf, JKRHeap* heap, JKRArchive::EMoun } #endif +#endif diff --git a/include/JSystem/JKernel/JKRDecomp.h b/include/JSystem/JKernel/JKRDecomp.h index e35c908b..8a3e6497 100644 --- a/include/JSystem/JKernel/JKRDecomp.h +++ b/include/JSystem/JKernel/JKRDecomp.h @@ -8,6 +8,7 @@ #include "JSystem/JKernel/JKRAram.h" #include "JSystem/JKernel/JKREnum.h" +#ifdef __cplusplus #define JKRDECOMP_MSG_BUF_COUNT 4 #define JKRDECOMP_STACK_SIZE 0x4000 #define JKRDECOMP_THREAD_MSG_BUF_COUNT 16 @@ -105,3 +106,4 @@ int JKRDecompressFromDVDToAram(JKRDvdFile* srcFile, u32 address, u32 fileSize, u int JKRDecompressFromAramToMainRam(u32 srcAddress, void* dst, u32 fileSize, u32 maxDest, u32 fileOffset); #endif +#endif diff --git a/include/JSystem/JKernel/JKRDisposer.h b/include/JSystem/JKernel/JKRDisposer.h index daea8dcc..d7ac2894 100644 --- a/include/JSystem/JKernel/JKRDisposer.h +++ b/include/JSystem/JKernel/JKRDisposer.h @@ -6,7 +6,6 @@ #ifdef __cplusplus extern "C" { -#endif class JKRHeap; @@ -21,7 +20,6 @@ public: JSULink mPointerLinks; // _8 }; -#ifdef __cplusplus } #endif diff --git a/include/JSystem/JKernel/JKRDvdAramRipper.h b/include/JSystem/JKernel/JKRDvdAramRipper.h index a535c84a..d9cead77 100644 --- a/include/JSystem/JKernel/JKRDvdAramRipper.h +++ b/include/JSystem/JKernel/JKRDvdAramRipper.h @@ -6,6 +6,7 @@ #include "JSystem/JSupport/JSUList.h" #include "types.h" +#ifdef __cplusplus class JKRADCommand { public: @@ -60,3 +61,4 @@ inline JKRAramBlock* JKRDvdToAram(s32 entrynum, u32 p2, JKRExpandSwitch expSwitc } #endif +#endif diff --git a/include/JSystem/JKernel/JKRDvdFile.h b/include/JSystem/JKernel/JKRDvdFile.h index 9db570e5..d086a9c9 100644 --- a/include/JSystem/JKernel/JKRDvdFile.h +++ b/include/JSystem/JKernel/JKRDvdFile.h @@ -5,6 +5,7 @@ #include "JSystem/JKernel/JKRFile.h" #include "JSystem/JSupport/JSUStream.h" +#ifdef __cplusplus class JKRDvdFile; struct JKRDvdFileInfo : public DVDFileInfo { @@ -76,5 +77,6 @@ public: JSULink mLink; OSThread* mDvdThread; }; +#endif #endif diff --git a/include/JSystem/JKernel/JKRDvdRipper.h b/include/JSystem/JKernel/JKRDvdRipper.h index 4bd0453d..8699bc5e 100644 --- a/include/JSystem/JKernel/JKRDvdRipper.h +++ b/include/JSystem/JKernel/JKRDvdRipper.h @@ -5,6 +5,8 @@ #include "JSystem/JKernel/JKREnum.h" #include "JSystem/JKernel/JKRDvdFile.h" +#ifdef __cplusplus + #define SZP_BUFFERSIZE 1024 #define REF_BUFFERSIZE 0x1120 #define DMA_BUFFERSIZE 0x100 @@ -54,3 +56,4 @@ inline void* JKRDvdToMainRam(const char* path, u8* dst, JKRExpandSwitch expandSw } #endif +#endif diff --git a/include/JSystem/JKernel/JKRExpHeap.h b/include/JSystem/JKernel/JKRExpHeap.h index d9c8c548..7f550387 100644 --- a/include/JSystem/JKernel/JKRExpHeap.h +++ b/include/JSystem/JKernel/JKRExpHeap.h @@ -4,6 +4,7 @@ #include "JSystem/JKernel/JKRHeap.h" #include "types.h" +#ifdef __cplusplus class JKRExpHeap : public JKRHeap { public: @@ -103,5 +104,6 @@ inline JKRExpHeap* JKRCreateExpHeap(u32 size, JKRHeap* parent, bool errorFlag) { return JKRExpHeap::create(size, parent, errorFlag); } +#endif #endif /* JKREXPHEAP_H */ diff --git a/include/JSystem/JKernel/JKRFile.h b/include/JSystem/JKernel/JKRFile.h index 8da98098..caf7a06f 100644 --- a/include/JSystem/JKernel/JKRFile.h +++ b/include/JSystem/JKernel/JKRFile.h @@ -8,6 +8,7 @@ #include "JSystem/JKernel/JKRDisposer.h" #include "JSystem/JKernel/JKRMacro.h" +#ifdef __cplusplus class JKRFile : public JKRDisposer { public: inline JKRFile() @@ -29,5 +30,6 @@ public: protected: bool mFileOpen; }; +#endif #endif diff --git a/include/JSystem/JKernel/JKRFileFinder.h b/include/JSystem/JKernel/JKRFileFinder.h index 736fa25b..0e87b12b 100644 --- a/include/JSystem/JKernel/JKRFileFinder.h +++ b/include/JSystem/JKernel/JKRFileFinder.h @@ -5,6 +5,7 @@ #include #include "types.h" +#ifdef __cplusplus class JKRArchive; struct JKRFileFinderBase @@ -76,3 +77,4 @@ public: }; #endif +#endif diff --git a/include/JSystem/JKernel/JKRFileLoader.h b/include/JSystem/JKernel/JKRFileLoader.h index 33646664..aa69b0dc 100644 --- a/include/JSystem/JKernel/JKRFileLoader.h +++ b/include/JSystem/JKernel/JKRFileLoader.h @@ -5,6 +5,7 @@ #include "JSystem/JKernel/JKRDisposer.h" #include "JSystem/JSupport/JSUList.h" +#ifdef __cplusplus class JKRFileFinder; class JKRFileLoader : public JKRDisposer { @@ -60,3 +61,4 @@ protected: }; #endif +#endif diff --git a/include/JSystem/JKernel/JKRHeap.h b/include/JSystem/JKernel/JKRHeap.h index dbfd6255..a890657c 100644 --- a/include/JSystem/JKernel/JKRHeap.h +++ b/include/JSystem/JKernel/JKRHeap.h @@ -6,6 +6,7 @@ #include "types.h" +#ifdef __cplusplus typedef void JKRHeapErrorHandler(void*, u32, int); class JKRHeap : public JKRDisposer @@ -316,4 +317,5 @@ void* operator new[](size_t, JKRHeap*, int); void operator delete(void*); void operator delete[](void*); +#endif #endif // !JKRHEAP_H diff --git a/include/JSystem/JKernel/JKRMacro.h b/include/JSystem/JKernel/JKRMacro.h index 597d5830..aab0dd47 100644 --- a/include/JSystem/JKernel/JKRMacro.h +++ b/include/JSystem/JKernel/JKRMacro.h @@ -1,6 +1,7 @@ #ifndef JKRMARCO_H #define JKRMACRO_H +#ifdef __cplusplus #define JKR_ISALIGNED(addr, alignment) ((((u32)addr) & (((u32)alignment)-1)) == 0) #define JKR_ISALIGNED32(addr) (JKR_ISALIGNED(addr, 32)) @@ -9,5 +10,6 @@ #define JKR_ALIGN(addr, alignment) (((u32)addr) & (~(((u32)alignment)-1))) #define JKR_ALIGN32(addr) (JKR_ALIGN(addr, 32)) +#endif #endif diff --git a/include/JSystem/JKernel/JKRThread.h b/include/JSystem/JKernel/JKRThread.h index bf750e82..05f1beff 100644 --- a/include/JSystem/JKernel/JKRThread.h +++ b/include/JSystem/JKernel/JKRThread.h @@ -10,6 +10,7 @@ #include "JSystem/JKernel/JKRDisposer.h" #include "JSystem/JUtility/JUTConsole.h" +#ifdef __cplusplus struct JKRThread; //class JUTConsole; @@ -177,3 +178,4 @@ struct JKRIdleThread : public JKRThread }; #endif +#endif diff --git a/include/JSystem/JSupport/JSUFileInputStream.h b/include/JSystem/JSupport/JSUFileInputStream.h index 8fc085e5..254cd086 100644 --- a/include/JSystem/JSupport/JSUFileInputStream.h +++ b/include/JSystem/JSupport/JSUFileInputStream.h @@ -5,6 +5,7 @@ #include "JSystem/JKernel/JKRFile.h" #include "JSystem/JSupport/JSURandomInputStream.h" +#ifdef __cplusplus class JSUFileInputStream : public JSURandomInputStream { public: JSUFileInputStream(JKRFile* file); @@ -22,5 +23,6 @@ protected: const void* mObject; s32 mPosition; }; +#endif #endif diff --git a/include/JSystem/JSupport/JSUInputStream.h b/include/JSystem/JSupport/JSUInputStream.h index 39c20e25..5a0da358 100644 --- a/include/JSystem/JSupport/JSUInputStream.h +++ b/include/JSystem/JSupport/JSUInputStream.h @@ -4,6 +4,7 @@ #include "types.h" #include "JSystem/JSupport/JSUIosBase.h" +#ifdef __cplusplus class JSUInputStream : public JSUIosBase { public: virtual ~JSUInputStream(); @@ -106,5 +107,6 @@ public: return *this; } }; +#endif #endif diff --git a/include/JSystem/JSupport/JSUIosBase.h b/include/JSystem/JSupport/JSUIosBase.h index 480bd54f..e1b01231 100644 --- a/include/JSystem/JSupport/JSUIosBase.h +++ b/include/JSystem/JSupport/JSUIosBase.h @@ -4,6 +4,7 @@ #include "types.h" #include "JSystem/JSupport/JSUStreamEnum.h" +#ifdef __cplusplus class JSUIosBase { public: inline JSUIosBase() : mState(GOOD) { } @@ -16,6 +17,6 @@ public: u8 mState; }; - +#endif #endif diff --git a/include/JSystem/JSupport/JSUList.h b/include/JSystem/JSupport/JSUList.h index ff3ef113..58bd0aca 100644 --- a/include/JSystem/JSupport/JSUList.h +++ b/include/JSystem/JSupport/JSUList.h @@ -5,7 +5,6 @@ #ifdef __cplusplus extern "C" { -#endif class JSUPtrLink; @@ -224,7 +223,6 @@ private: JSUTree *mTree; }; -#ifdef __cplusplus } #endif diff --git a/include/JSystem/JSupport/JSURandomInputStream.h b/include/JSystem/JSupport/JSURandomInputStream.h index a9252c08..94ca235b 100644 --- a/include/JSystem/JSupport/JSURandomInputStream.h +++ b/include/JSystem/JSupport/JSURandomInputStream.h @@ -5,6 +5,7 @@ #include "JSystem/JKernel/JKRFile.h" #include "JSystem/JSupport/JSUInputStream.h" +#ifdef __cplusplus class JSURandomInputStream : public JSUInputStream { public: virtual ~JSURandomInputStream() { } @@ -20,5 +21,6 @@ public: int peek(void* buf, s32 len); int seek(s32 offset, JSUStreamSeekFrom from); }; +#endif #endif diff --git a/include/JSystem/JUtility/JUTAssertion.h b/include/JSystem/JUtility/JUTAssertion.h index 041769c4..7dff4264 100644 --- a/include/JSystem/JUtility/JUTAssertion.h +++ b/include/JSystem/JUtility/JUTAssertion.h @@ -7,7 +7,6 @@ #ifdef __cplusplus extern "C" { -#endif namespace JUTAssertion { @@ -62,7 +61,6 @@ namespace JUTAssertion } #endif -#ifdef __cplusplus } #endif diff --git a/include/JSystem/JUtility/JUTConsole.h b/include/JSystem/JUtility/JUTConsole.h index bd7e77c0..eaa3b83a 100644 --- a/include/JSystem/JUtility/JUTConsole.h +++ b/include/JSystem/JUtility/JUTConsole.h @@ -6,6 +6,7 @@ #include "JSystem/JKernel/JKRHeap.h" #include "JSystem/JUtility/JUTFont.h" +#ifdef __cplusplus inline s32 colorCheck(s32 diff, s32 t) { s32 ret = diff - t; @@ -166,3 +167,5 @@ void JUTWarningConsole_f_va(const char*, va_list); }; #endif + +#endif diff --git a/include/JSystem/JUtility/JUTDirectPrint.h b/include/JSystem/JUtility/JUTDirectPrint.h index a8a3ee60..fb938c14 100644 --- a/include/JSystem/JUtility/JUTDirectPrint.h +++ b/include/JSystem/JUtility/JUTDirectPrint.h @@ -5,6 +5,7 @@ #include "va_args.h" #include "JSystem/JUtility/TColor.h" +#ifdef __cplusplus class JUTDirectPrint { private: @@ -58,5 +59,6 @@ inline void JUTChangeFrameBuffer(void *buffer, u16 height, u16 width) { JUTDirectPrint::getManager()->changeFrameBuffer(buffer, width, height); } +#endif #endif diff --git a/include/JSystem/JUtility/JUTFont.h b/include/JSystem/JUtility/JUTFont.h index 12b898ce..431735ac 100644 --- a/include/JSystem/JUtility/JUTFont.h +++ b/include/JSystem/JUtility/JUTFont.h @@ -7,6 +7,7 @@ #include "dolphin/os.h" #include "JSystem/JUtility/TColor.h" +#ifdef __cplusplus struct JKRAramBlock; struct JKRHeap; @@ -365,5 +366,6 @@ struct JUTCacheFont : public JUTResFont }; extern const ResFONT JUTResFONT_Ascfont_fix12; +#endif #endif diff --git a/include/JSystem/JUtility/JUTGamePad.h b/include/JSystem/JUtility/JUTGamePad.h index 5c37dc2b..aea09c29 100644 --- a/include/JSystem/JUtility/JUTGamePad.h +++ b/include/JSystem/JUtility/JUTGamePad.h @@ -10,7 +10,6 @@ #ifdef __cplusplus extern "C" { -#endif class JUTGamePadRecordBase { @@ -357,7 +356,6 @@ public: OSTime mResetTime; // _A0 }; -#ifdef __cplusplus } #endif diff --git a/include/JSystem/JUtility/JUTProcBar.h b/include/JSystem/JUtility/JUTProcBar.h index 291d2dd8..42e04a31 100644 --- a/include/JSystem/JUtility/JUTProcBar.h +++ b/include/JSystem/JUtility/JUTProcBar.h @@ -8,6 +8,7 @@ #include "types.h" +#ifdef __cplusplus class JUTProcBar { public: @@ -152,5 +153,6 @@ private: JKRHeap* mWatchHeap; // _12C bool mHeapBarVisible; // _130 }; // 0x134 size +#endif #endif diff --git a/include/JSystem/JUtility/JUTVideo.h b/include/JSystem/JUtility/JUTVideo.h index 089636af..f5617392 100644 --- a/include/JSystem/JUtility/JUTVideo.h +++ b/include/JSystem/JUtility/JUTVideo.h @@ -7,6 +7,7 @@ #include "dolphin/gx.h" #include "dolphin/vi.h" +#ifdef __cplusplus /** * @size{0x58} */ @@ -80,5 +81,6 @@ inline JUTVideo *JUTGetVideoManager() { } extern bool sDrawWaiting; +#endif #endif diff --git a/include/JSystem/JUtility/TColor.h b/include/JSystem/JUtility/TColor.h index 8c917a01..3e6d334a 100644 --- a/include/JSystem/JUtility/TColor.h +++ b/include/JSystem/JUtility/TColor.h @@ -3,7 +3,6 @@ #ifdef __cplusplus extern "C" { -#endif #include "types.h" #include @@ -69,7 +68,6 @@ namespace JUtility { }; } // namespace JUtility -#ifdef __cplusplus } #endif diff --git a/include/JSystem/ResTIMG.h b/include/JSystem/ResTIMG.h index a070bec5..407c1e74 100644 --- a/include/JSystem/ResTIMG.h +++ b/include/JSystem/ResTIMG.h @@ -4,6 +4,8 @@ #include "dolphin/gx.h" #include "types.h" +#ifdef __cplusplus + #ifndef _JUTTransparency typedef u8 _JUTTransparency; #endif @@ -52,5 +54,5 @@ struct ResTIMGPair { ResTIMG _00; ResTIMG _20; }; - +#endif #endif \ No newline at end of file diff --git a/include/MSL_CPP/algorithm.h b/include/MSL_CPP/algorithm.h index 2856cb97..39e683a5 100644 --- a/include/MSL_CPP/algorithm.h +++ b/include/MSL_CPP/algorithm.h @@ -3,6 +3,7 @@ #include "types.h" +#ifdef __cplusplus namespace std { template @@ -15,5 +16,5 @@ find_if(InputIterator first, InputIterator last, Predicate pred) { } } // namespace std - +#endif #endif diff --git a/include/MSL_CPP/iterator.h b/include/MSL_CPP/iterator.h index 88998d2d..2fd07014 100644 --- a/include/MSL_CPP/iterator.h +++ b/include/MSL_CPP/iterator.h @@ -3,6 +3,7 @@ #include "types.h" +#ifdef __cplusplus namespace std { /* TODO: these should be properly implemented */ @@ -28,5 +29,6 @@ distance(InputIterator first, InputIterator last) { } } // namespace std +#endif #endif diff --git a/include/TRK/serpoll.h b/include/TRK/serpoll.h index 401b8714..698374c6 100644 --- a/include/TRK/serpoll.h +++ b/include/TRK/serpoll.h @@ -1,6 +1,7 @@ #ifndef TRK_SERPOLL #define TRK_SERPOLL #include "types.h" +#include "TRK/trk.h" #ifdef __cplusplus extern "C" { #endif diff --git a/include/dolphin/dsp/dsp.h b/include/dolphin/dsp/dsp.h index f7ad97c3..5fcd394b 100644 --- a/include/dolphin/dsp/dsp.h +++ b/include/dolphin/dsp/dsp.h @@ -1,5 +1,5 @@ -#ifndef DSP_H -#define DSP_H +#ifndef DSP_DSP_H +#define DSP_DSP_H #include "types.h" @@ -7,7 +7,7 @@ extern "C"{ #endif -extern volatile u16 __DSPRegs[] : 0XCC005000; +extern volatile u16 __DSPRegs[] AT_ADDRESS(0xCC005000); #ifdef __cplusplus } diff --git a/include/dolphin/os/OSError.h b/include/dolphin/os/OSError.h index 4ed0f207..df6f7132 100644 --- a/include/dolphin/os/OSError.h +++ b/include/dolphin/os/OSError.h @@ -25,8 +25,8 @@ typedef enum { OS_ERR_PROTECTION, OS_ERR_FP_EXCEPTION, OS_ERR_MAX, -} -#ifdef __cplusplus }; +#ifdef __cplusplus +} #endif #endif diff --git a/include/dolphin/os/OSMemory.h b/include/dolphin/os/OSMemory.h index fd33a7fc..601cf2cc 100644 --- a/include/dolphin/os/OSMemory.h +++ b/include/dolphin/os/OSMemory.h @@ -7,8 +7,8 @@ extern "C" { #endif #define SIM_MEM *(u32 *)0x800000f0 -static asm void Config24MB(); -static asm void Config48MB(); +static void Config24MB(); +static void Config48MB(); u32 OSGetConsoleSimulatedMemSize(void); #ifdef __cplusplus diff --git a/include/jaudio_NES/audiothread.h b/include/jaudio_NES/audiothread.h index afdbf0c5..55a368c9 100644 --- a/include/jaudio_NES/audiothread.h +++ b/include/jaudio_NES/audiothread.h @@ -3,8 +3,14 @@ #include "types.h" - extern "C"{ - void StartAudioThread(void*, u32, u32, u32); - } +#ifdef __cplusplus +extern "C" { +#endif + +void StartAudioThread(void*, u32, u32, u32); + +#ifdef __cplusplus +} +#endif #endif \ No newline at end of file diff --git a/include/jaudio_NES/cmdstack.h b/include/jaudio_NES/cmdstack.h index f61614ee..7e378757 100644 --- a/include/jaudio_NES/cmdstack.h +++ b/include/jaudio_NES/cmdstack.h @@ -1,8 +1,15 @@ #ifndef CMDSTACK_H #define CMDSTACK_H #include "types.h" -extern "C"{ - void Jac_Portcmd_Init(void); + +#ifdef __cplusplus +extern "C" { +#endif + +void Jac_Portcmd_Init(void); + +#ifdef __cplusplus } +#endif #endif \ No newline at end of file diff --git a/include/jaudio_NES/dummyprobe.h b/include/jaudio_NES/dummyprobe.h index 95cb07b8..6b155fef 100644 --- a/include/jaudio_NES/dummyprobe.h +++ b/include/jaudio_NES/dummyprobe.h @@ -3,9 +3,15 @@ #include "types.h" -extern "C"{ +#ifdef __cplusplus +extern "C" { +#endif + void Probe_Start(void); void Probe_Finish(void); + +#ifdef __cplusplus } +#endif #endif \ No newline at end of file diff --git a/include/jaudio_NES/jammain.h b/include/jaudio_NES/jammain.h index 5b17886a..14fe49b5 100644 --- a/include/jaudio_NES/jammain.h +++ b/include/jaudio_NES/jammain.h @@ -3,8 +3,14 @@ #include "types.h" -extern "C"{ +#ifdef __cplusplus +extern "C" { +#endif + void Jam_InitRegistTrack(void); + +#ifdef __cplusplus } +#endif #endif \ No newline at end of file diff --git a/include/jaudio_NES/kappa.h b/include/jaudio_NES/kappa.h index 44b659bc..b38ae147 100644 --- a/include/jaudio_NES/kappa.h +++ b/include/jaudio_NES/kappa.h @@ -4,13 +4,13 @@ #include "types.h" #ifdef __cplusplus - extern "C" { +extern "C" { #endif extern void Na_GetRadioCounter(void*); #ifdef __cplusplus - } +} #endif diff --git a/include/jaudio_NES/melody.h b/include/jaudio_NES/melody.h index 284d8464..05b84497 100644 --- a/include/jaudio_NES/melody.h +++ b/include/jaudio_NES/melody.h @@ -4,7 +4,7 @@ #include "types.h" #ifdef __cplusplus - extern "C"{ +extern "C" { #endif extern void Na_Inst(u16, u8*); @@ -14,7 +14,7 @@ extern int Na_InstCountGet(); #ifdef __cplusplus - } +} #endif #endif \ No newline at end of file diff --git a/include/jaudio_NES/radio.h b/include/jaudio_NES/radio.h index f31850a0..c2f878ff 100644 --- a/include/jaudio_NES/radio.h +++ b/include/jaudio_NES/radio.h @@ -4,13 +4,13 @@ #include "types.h" #ifdef __cplusplus - extern "C" { +extern "C" { #endif extern void Na_GetKappaCounter(void*); #ifdef __cplusplus - } +} #endif diff --git a/include/jaudio_NES/rhythm.h b/include/jaudio_NES/rhythm.h index 662826eb..b7fb3b79 100644 --- a/include/jaudio_NES/rhythm.h +++ b/include/jaudio_NES/rhythm.h @@ -4,7 +4,7 @@ #include "types.h" #ifdef __cplusplus - extern "C" +extern "C" { #endif extern void Na_RhythmStart(void*, u8,u8); @@ -15,4 +15,8 @@ extern f32 Na_GetRhythmDelay(void*); extern f32 Na_GetRhythmInfo(void*); extern void Na_SetRhythmInfo(f32); +#ifdef __cplusplus +} +#endif + #endif \ No newline at end of file diff --git a/include/jaudio_NES/seqsetup.h b/include/jaudio_NES/seqsetup.h index b0f93f5c..f8ea8ad2 100644 --- a/include/jaudio_NES/seqsetup.h +++ b/include/jaudio_NES/seqsetup.h @@ -12,7 +12,7 @@ void Jaq_Reset(void); void Jaq_SetSeqData(seqp* seqp, u8* param_2, u32 param_3, int param_4); #ifdef __cplusplus -}; +} #endif #endif \ No newline at end of file diff --git a/include/jaudio_NES/staff.h b/include/jaudio_NES/staff.h index d03ddaeb..8eea37fc 100644 --- a/include/jaudio_NES/staff.h +++ b/include/jaudio_NES/staff.h @@ -4,7 +4,7 @@ #include "types.h" #ifdef __cplusplus - extern "C" { +extern "C" { #endif typedef struct staff_roll_info_s{ @@ -16,7 +16,7 @@ typedef struct staff_roll_info_s{ extern void Na_GetStaffRollInfo(void*); #ifdef __cplusplus - } +} #endif diff --git a/include/jsyswrap_cpp.h b/include/jsyswrap_cpp.h index 10f87afb..873efb49 100644 --- a/include/jsyswrap_cpp.h +++ b/include/jsyswrap_cpp.h @@ -7,11 +7,7 @@ #ifdef __cplusplus extern "C" { -#endif - -extern JUTGamePad gamePad[]; - -#ifdef __cplusplus + extern JUTGamePad gamePad[]; } #endif diff --git a/include/libforest/batconfig.h b/include/libforest/batconfig.h index 13c5b37b..d1bed333 100644 --- a/include/libforest/batconfig.h +++ b/include/libforest/batconfig.h @@ -10,8 +10,8 @@ extern "C" { #endif -asm void Config24MB(); -asm void Config48MB(); +void Config24MB(); +void Config48MB(); void ReconfigBATs(); diff --git a/include/libforest/emu64/texture_cache.h b/include/libforest/emu64/texture_cache.h index 06eb132b..a056d4f9 100644 --- a/include/libforest/emu64/texture_cache.h +++ b/include/libforest/emu64/texture_cache.h @@ -6,7 +6,6 @@ #ifdef __cplusplus extern "C" { -#endif #define TEX_CACHE_ALIGNMENT (32-1) /* 32 byte alignment */ #define NUM_TEXTURE_CACHE_DATA 10 @@ -74,10 +73,8 @@ int texture_cache_data_entry(void* original, void* converted); #define TEX_BUFFER_DATA_SIZE 0xC000 #define TEX_BUFFER_BSS_SIZE 0x1000 -extern "C" void emu64_texture_cache_data_entry_set(void* begin, void* end); extern texture_cache_t* texture_cache_select(void* address); -#ifdef __cplusplus } #endif diff --git a/include/m_collision_obj.h b/include/m_collision_obj.h index af9b96ab..55539fcc 100644 --- a/include/m_collision_obj.h +++ b/include/m_collision_obj.h @@ -24,8 +24,8 @@ enum weight{ MASS_NORMAL }; -#define MASSTYPE_IMMOVABLE 0XFF -#define MASSTYPE_HEAVY 0XFE +#define MASSTYPE_IMMOVABLE 0xFF +#define MASSTYPE_HEAVY 0xFE typedef struct collision_obj_s { ACTOR* owner_actor; // actor which owns this collision object diff --git a/include/m_music_ovl.h b/include/m_music_ovl.h index 75fc764e..ec30c545 100644 --- a/include/m_music_ovl.h +++ b/include/m_music_ovl.h @@ -9,9 +9,7 @@ extern "C" { #endif -struct music_ovl_s { - -}; +struct music_ovl_s; extern void mMU_music_ovl_set_proc(Submenu* submenu); extern void mMU_music_ovl_construct(Submenu* submenu); diff --git a/include/m_titledemo.h b/include/m_titledemo.h index d6a90579..96222bf6 100644 --- a/include/m_titledemo.h +++ b/include/m_titledemo.h @@ -2,6 +2,7 @@ #define M_TITLEDEMO_H #include "types.h" +#include "m_play_h.h" #ifdef __cplusplus extern "C" { diff --git a/include/types.h b/include/types.h index 9c7b972c..7b9b5ae9 100644 --- a/include/types.h +++ b/include/types.h @@ -121,4 +121,9 @@ typedef u32 unknown; #define BSS_ORDER_ITEM(v) #endif +#ifndef __cplusplus +// Some definitions rely on wchar_t being defined +typedef short wchar_t; +#endif + #endif \ No newline at end of file diff --git a/src/static/Famicom/famicom.cpp b/src/static/Famicom/famicom.cpp index ddfa5fb2..e34f137f 100644 --- a/src/static/Famicom/famicom.cpp +++ b/src/static/Famicom/famicom.cpp @@ -1,5 +1,5 @@ #include "Famicom/famicom.h" -#include "Famicom/famicomInternal.h" +#include "Famicom/famicomInternal.hpp" #include "dolphin/string.h" #include "dolphin/gx.h"