diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1746e326 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bin +obj diff --git a/NDS.cpp b/NDS.cpp new file mode 100644 index 00000000..f9922975 --- /dev/null +++ b/NDS.cpp @@ -0,0 +1,42 @@ +#include +#include "NDS.h" + + +namespace NDS +{ + +// + + +void Init() +{ + Reset(); +} + +void Reset() +{ + FILE* f; + + f = fopen("bios9.bin", "rb"); + if (!f) + printf("ARM9 BIOS not found\n"); + else + { + // load BIOS here + + fclose(f); + } +} + + +template T Read(u32 addr) +{ + return (T)0; +} + +template void Write(u32 addr, T val) +{ + // +} + +} diff --git a/NDS.h b/NDS.h new file mode 100644 index 00000000..3e051b88 --- /dev/null +++ b/NDS.h @@ -0,0 +1,18 @@ + +#ifndef NDS_H +#define NDS_H + +#include "types.h" + +namespace NDS +{ + +void Init(); +void Reset(); + +template T Read(u32 addr); +template void Write(u32 addr, T val); + +} + +#endif // NDS_H diff --git a/main.cpp b/main.cpp index b4392ec5..fee895c3 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,12 @@ -#include +#include +#include "NDS.h" -using namespace std; int main() { - cout << "Hello world!" << endl; + printf("melonDS version uh... 0.1??\n"); + + NDS::Init(); + return 0; } diff --git a/types.h b/types.h new file mode 100644 index 00000000..4b4a408a --- /dev/null +++ b/types.h @@ -0,0 +1,15 @@ +// types, common crap + +#ifndef TYPES_H +#define TYPES_H + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long int u64; +typedef signed char s8; +typedef signed short s16; +typedef signed int s32; +typedef signed long int s64; + +#endif // TYPES_H