From 93d12069cb7fa6c5c956c8eacf269c48ca02a936 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Fri, 16 Jan 2009 21:57:19 +0000 Subject: [PATCH] reorganize the TestSuite and add VS support git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1881 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/TestSuite/ARAM/ARAM.vcproj | 84 +++++++++ .../TestSuite/{Audio/Test1 => ARAM}/Makefile | 0 .../source/dolphintest_aram.cpp} | 4 +- Source/TestSuite/AX/AX.vcproj | 84 +++++++++ Source/TestSuite/{Misc/Aram => AX}/Makefile | 0 .../source/dolphintest_ax.cpp} | 2 + Source/TestSuite/Audio/Makefile | 8 - Source/TestSuite/Audio/Test1/template.pnproj | 1 - Source/TestSuite/Audio/Test1/template.pnps | 1 - Source/TestSuite/CPU/Makefile | 8 - Source/TestSuite/CPU/Test1/Main.cpp | 4 - Source/TestSuite/CPU/template.pnproj | 1 - Source/TestSuite/CPU/template.pnps | 1 - .../Devices/Controllers/GC/template.pnproj | 1 - .../Devices/Controllers/GC/template.pnps | 1 - Source/TestSuite/Devices/Controllers/Makefile | 8 - Source/TestSuite/Devices/Makefile | 8 - .../TestSuite/Devices/MemCard/template.pnproj | 1 - .../TestSuite/Devices/MemCard/template.pnps | 1 - Source/TestSuite/Devices/template.pnproj | 1 - Source/TestSuite/Devices/template.pnps | 1 - Source/TestSuite/EXI/EXI.vcproj | 84 +++++++++ .../{Devices/Controllers/GC => EXI}/Makefile | 0 .../source/dolphintest_exi.cpp} | 156 +++++++-------- Source/TestSuite/GX/GX.vcproj | 84 +++++++++ .../{Devices/MemCard => GX}/Makefile | 0 .../Cube.cpp => GX/source/dolphintest_gx.cpp} | 177 +++++++++--------- Source/TestSuite/Graphics/GX/Makefile | 8 - Source/TestSuite/Graphics/GX/template.pnproj | 1 - Source/TestSuite/Graphics/GX/template.pnps | 1 - Source/TestSuite/Graphics/Makefile | 8 - Source/TestSuite/Makefile | 1 + Source/TestSuite/Misc/Aram/template.pnproj | 1 - Source/TestSuite/Misc/Aram/template.pnps | 1 - Source/TestSuite/Misc/Makefile | 8 - Source/TestSuite/Misc/Time/template.pnproj | 1 - Source/TestSuite/Misc/Time/template.pnps | 1 - .../{Graphics/GX/Cube => PAD}/Makefile | 0 Source/TestSuite/PAD/PAD.vcproj | 84 +++++++++ .../GC.cpp => PAD/source/dolphintest_pad.cpp} | 2 +- Source/TestSuite/{Misc/Time => RTC}/Makefile | 0 Source/TestSuite/RTC/RTC.vcproj | 84 +++++++++ .../source/dolphintest_rtc.cpp} | 110 +++++------ Source/TestSuite/SI/Makefile | 138 +++++++++++++- Source/TestSuite/SI/SI.vcproj | 84 +++++++++ Source/TestSuite/SI/Test1/Makefile | 130 ------------- Source/TestSuite/SI/Test1/template.pnproj | 1 - Source/TestSuite/SI/Test1/template.pnps | 1 - .../Test1.cpp => source/dolphintest_si.cpp} | 4 +- Source/TestSuite/TestSuite.sln | 41 ++++ Source/TestSuite/{Scripts => }/d.supp | 0 Source/TestSuite/{Scripts => }/grind.sh | 0 52 files changed, 989 insertions(+), 442 deletions(-) create mode 100644 Source/TestSuite/ARAM/ARAM.vcproj rename Source/TestSuite/{Audio/Test1 => ARAM}/Makefile (100%) rename Source/TestSuite/{Misc/Aram/source/Aram.cpp => ARAM/source/dolphintest_aram.cpp} (98%) create mode 100644 Source/TestSuite/AX/AX.vcproj rename Source/TestSuite/{Misc/Aram => AX}/Makefile (100%) rename Source/TestSuite/{Audio/Test1/source/Test1.cpp => AX/source/dolphintest_ax.cpp} (99%) delete mode 100644 Source/TestSuite/Audio/Makefile delete mode 100644 Source/TestSuite/Audio/Test1/template.pnproj delete mode 100644 Source/TestSuite/Audio/Test1/template.pnps delete mode 100644 Source/TestSuite/CPU/Makefile delete mode 100644 Source/TestSuite/CPU/Test1/Main.cpp delete mode 100644 Source/TestSuite/CPU/template.pnproj delete mode 100644 Source/TestSuite/CPU/template.pnps delete mode 100644 Source/TestSuite/Devices/Controllers/GC/template.pnproj delete mode 100644 Source/TestSuite/Devices/Controllers/GC/template.pnps delete mode 100644 Source/TestSuite/Devices/Controllers/Makefile delete mode 100644 Source/TestSuite/Devices/Makefile delete mode 100644 Source/TestSuite/Devices/MemCard/template.pnproj delete mode 100644 Source/TestSuite/Devices/MemCard/template.pnps delete mode 100644 Source/TestSuite/Devices/template.pnproj delete mode 100644 Source/TestSuite/Devices/template.pnps create mode 100644 Source/TestSuite/EXI/EXI.vcproj rename Source/TestSuite/{Devices/Controllers/GC => EXI}/Makefile (100%) rename Source/TestSuite/{Devices/MemCard/source/First.cpp => EXI/source/dolphintest_exi.cpp} (95%) create mode 100644 Source/TestSuite/GX/GX.vcproj rename Source/TestSuite/{Devices/MemCard => GX}/Makefile (100%) rename Source/TestSuite/{Graphics/GX/Cube/source/Cube.cpp => GX/source/dolphintest_gx.cpp} (84%) delete mode 100644 Source/TestSuite/Graphics/GX/Makefile delete mode 100644 Source/TestSuite/Graphics/GX/template.pnproj delete mode 100644 Source/TestSuite/Graphics/GX/template.pnps delete mode 100644 Source/TestSuite/Graphics/Makefile delete mode 100644 Source/TestSuite/Misc/Aram/template.pnproj delete mode 100644 Source/TestSuite/Misc/Aram/template.pnps delete mode 100644 Source/TestSuite/Misc/Makefile delete mode 100644 Source/TestSuite/Misc/Time/template.pnproj delete mode 100644 Source/TestSuite/Misc/Time/template.pnps rename Source/TestSuite/{Graphics/GX/Cube => PAD}/Makefile (100%) create mode 100644 Source/TestSuite/PAD/PAD.vcproj rename Source/TestSuite/{Devices/Controllers/GC/source/GC.cpp => PAD/source/dolphintest_pad.cpp} (98%) rename Source/TestSuite/{Misc/Time => RTC}/Makefile (100%) create mode 100644 Source/TestSuite/RTC/RTC.vcproj rename Source/TestSuite/{Misc/Time/source/Time.cpp => RTC/source/dolphintest_rtc.cpp} (93%) create mode 100644 Source/TestSuite/SI/SI.vcproj delete mode 100644 Source/TestSuite/SI/Test1/Makefile delete mode 100644 Source/TestSuite/SI/Test1/template.pnproj delete mode 100644 Source/TestSuite/SI/Test1/template.pnps rename Source/TestSuite/SI/{Test1/source/Test1.cpp => source/dolphintest_si.cpp} (99%) create mode 100644 Source/TestSuite/TestSuite.sln rename Source/TestSuite/{Scripts => }/d.supp (100%) rename Source/TestSuite/{Scripts => }/grind.sh (100%) diff --git a/Source/TestSuite/ARAM/ARAM.vcproj b/Source/TestSuite/ARAM/ARAM.vcproj new file mode 100644 index 0000000000..5f52d00cb5 --- /dev/null +++ b/Source/TestSuite/ARAM/ARAM.vcproj @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/TestSuite/Audio/Test1/Makefile b/Source/TestSuite/ARAM/Makefile similarity index 100% rename from Source/TestSuite/Audio/Test1/Makefile rename to Source/TestSuite/ARAM/Makefile diff --git a/Source/TestSuite/Misc/Aram/source/Aram.cpp b/Source/TestSuite/ARAM/source/dolphintest_aram.cpp similarity index 98% rename from Source/TestSuite/Misc/Aram/source/Aram.cpp rename to Source/TestSuite/ARAM/source/dolphintest_aram.cpp index 7933168998..dd6622a7f6 100644 --- a/Source/TestSuite/Misc/Aram/source/Aram.cpp +++ b/Source/TestSuite/ARAM/source/dolphintest_aram.cpp @@ -15,6 +15,8 @@ void *Initialise(); #define NUM_BLOCKS 10 u32 aram_blocks[NUM_BLOCKS]; u32 start_addr = -1; + + int main(int argc, char **argv) { xfb = Initialise(); @@ -23,7 +25,7 @@ int main(int argc, char **argv) { PAD_ScanPads(); VIDEO_ClearFrameBuffer(rmode, xfb, 0); - std::cout << "Aram is " << (AR_GetDMAStatus() ? "In Progress" : "Idle") << std::endl; + std::cout << "Aram is " << (AR_GetDMAStatus() ? "In Progress" : "Idle") << std::endl; std::cout << "Aram Start is 0x" << std::setbase(16) << start_addr << ", Allocated 0x" << AR_GetSize() << " Of memory" << std::setbase(10) << std::endl; std::cout << "Internal Size is 0x" << std::setbase(16) << AR_GetInternalSize() << std::setbase(10) << std::endl; VIDEO_WaitVSync(); diff --git a/Source/TestSuite/AX/AX.vcproj b/Source/TestSuite/AX/AX.vcproj new file mode 100644 index 0000000000..8f4e4a7c1a --- /dev/null +++ b/Source/TestSuite/AX/AX.vcproj @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/TestSuite/Misc/Aram/Makefile b/Source/TestSuite/AX/Makefile similarity index 100% rename from Source/TestSuite/Misc/Aram/Makefile rename to Source/TestSuite/AX/Makefile diff --git a/Source/TestSuite/Audio/Test1/source/Test1.cpp b/Source/TestSuite/AX/source/dolphintest_ax.cpp similarity index 99% rename from Source/TestSuite/Audio/Test1/source/Test1.cpp rename to Source/TestSuite/AX/source/dolphintest_ax.cpp index 15f5e4376b..0b4b4152bb 100644 --- a/Source/TestSuite/Audio/Test1/source/Test1.cpp +++ b/Source/TestSuite/AX/source/dolphintest_ax.cpp @@ -11,6 +11,8 @@ static void *xfb = NULL; static GXRModeObj *rmode = NULL; void *Initialise(); + + int main(int argc, char **argv) { xfb = Initialise(); diff --git a/Source/TestSuite/Audio/Makefile b/Source/TestSuite/Audio/Makefile deleted file mode 100644 index 3a6fe744eb..0000000000 --- a/Source/TestSuite/Audio/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS:= `ls | egrep -v '^(CVS)$$'` - -all: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; - -clean: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; - diff --git a/Source/TestSuite/Audio/Test1/template.pnproj b/Source/TestSuite/Audio/Test1/template.pnproj deleted file mode 100644 index c22af0293b..0000000000 --- a/Source/TestSuite/Audio/Test1/template.pnproj +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Audio/Test1/template.pnps b/Source/TestSuite/Audio/Test1/template.pnps deleted file mode 100644 index 6450388d77..0000000000 --- a/Source/TestSuite/Audio/Test1/template.pnps +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/CPU/Makefile b/Source/TestSuite/CPU/Makefile deleted file mode 100644 index 3a6fe744eb..0000000000 --- a/Source/TestSuite/CPU/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS:= `ls | egrep -v '^(CVS)$$'` - -all: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; - -clean: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; - diff --git a/Source/TestSuite/CPU/Test1/Main.cpp b/Source/TestSuite/CPU/Test1/Main.cpp deleted file mode 100644 index 58512a38c4..0000000000 --- a/Source/TestSuite/CPU/Test1/Main.cpp +++ /dev/null @@ -1,4 +0,0 @@ -int main() -{ - -}; diff --git a/Source/TestSuite/CPU/template.pnproj b/Source/TestSuite/CPU/template.pnproj deleted file mode 100644 index c22af0293b..0000000000 --- a/Source/TestSuite/CPU/template.pnproj +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/CPU/template.pnps b/Source/TestSuite/CPU/template.pnps deleted file mode 100644 index 6450388d77..0000000000 --- a/Source/TestSuite/CPU/template.pnps +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Devices/Controllers/GC/template.pnproj b/Source/TestSuite/Devices/Controllers/GC/template.pnproj deleted file mode 100644 index c22af0293b..0000000000 --- a/Source/TestSuite/Devices/Controllers/GC/template.pnproj +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Devices/Controllers/GC/template.pnps b/Source/TestSuite/Devices/Controllers/GC/template.pnps deleted file mode 100644 index 6450388d77..0000000000 --- a/Source/TestSuite/Devices/Controllers/GC/template.pnps +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Devices/Controllers/Makefile b/Source/TestSuite/Devices/Controllers/Makefile deleted file mode 100644 index 3a6fe744eb..0000000000 --- a/Source/TestSuite/Devices/Controllers/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS:= `ls | egrep -v '^(CVS)$$'` - -all: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; - -clean: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; - diff --git a/Source/TestSuite/Devices/Makefile b/Source/TestSuite/Devices/Makefile deleted file mode 100644 index 3a6fe744eb..0000000000 --- a/Source/TestSuite/Devices/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS:= `ls | egrep -v '^(CVS)$$'` - -all: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; - -clean: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; - diff --git a/Source/TestSuite/Devices/MemCard/template.pnproj b/Source/TestSuite/Devices/MemCard/template.pnproj deleted file mode 100644 index c22af0293b..0000000000 --- a/Source/TestSuite/Devices/MemCard/template.pnproj +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Devices/MemCard/template.pnps b/Source/TestSuite/Devices/MemCard/template.pnps deleted file mode 100644 index 6450388d77..0000000000 --- a/Source/TestSuite/Devices/MemCard/template.pnps +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Devices/template.pnproj b/Source/TestSuite/Devices/template.pnproj deleted file mode 100644 index c22af0293b..0000000000 --- a/Source/TestSuite/Devices/template.pnproj +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Devices/template.pnps b/Source/TestSuite/Devices/template.pnps deleted file mode 100644 index 6450388d77..0000000000 --- a/Source/TestSuite/Devices/template.pnps +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/EXI/EXI.vcproj b/Source/TestSuite/EXI/EXI.vcproj new file mode 100644 index 0000000000..15935d7919 --- /dev/null +++ b/Source/TestSuite/EXI/EXI.vcproj @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/TestSuite/Devices/Controllers/GC/Makefile b/Source/TestSuite/EXI/Makefile similarity index 100% rename from Source/TestSuite/Devices/Controllers/GC/Makefile rename to Source/TestSuite/EXI/Makefile diff --git a/Source/TestSuite/Devices/MemCard/source/First.cpp b/Source/TestSuite/EXI/source/dolphintest_exi.cpp similarity index 95% rename from Source/TestSuite/Devices/MemCard/source/First.cpp rename to Source/TestSuite/EXI/source/dolphintest_exi.cpp index a591c625b8..b93867f709 100644 --- a/Source/TestSuite/Devices/MemCard/source/First.cpp +++ b/Source/TestSuite/EXI/source/dolphintest_exi.cpp @@ -1,78 +1,78 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -static void *xfb = NULL; -u32 first_frame = 1; -GXRModeObj *rmode; - -int main() -{ - VIDEO_Init(); - - rmode = VIDEO_GetPreferredMode(NULL); - - PAD_Init(); - - - xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - - VIDEO_Configure(rmode); - - VIDEO_SetNextFramebuffer(xfb); - - VIDEO_SetBlack(FALSE); - VIDEO_Flush(); - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); - - - console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*2); - - - time_t gc_time; - gc_time = time(NULL); - - srand(gc_time); - while(1) - { - s32 Size; - s32 SSize; - u32 ID; - s32 error; - VIDEO_ClearFrameBuffer(rmode, xfb, 0); - - EXI_GetID(0, 0, &ID); - error = CARD_ProbeEx(0, &Size, &SSize); - // Can't use printf since Dolphin overrides it - if(error >= 0) // All is good - std::cout << "Card A has a size of " << Size << " and a Sector Size of " << SSize; - else if( error == -2) // Device isn't Memory card - std::cout << "Device isn't Mem card in Slot A"; - else - std::cout << "Got an error of " << error << " with slot A"; - std::cout << " ID of 0x" << std::setbase(16) << ID << std::endl; - - std::cout << std::setbase(10); - EXI_GetID(1, 0, &ID); - error = CARD_ProbeEx(1, &Size, &SSize); - if(error >= 0) // All is good - std::cout << "Card B has a size of " << Size << " and a Sector Size of " << SSize; - else if( error == -2) // Device isn't Memory card - std::cout << "Device isn't Mem card in Slot B"; - else - std::cout << "Got an error of " << error << " with slot B"; - std::cout << " ID of 0x" << std::setbase(16) << ID << std::endl; - VIDEO_WaitVSync(); - } - return 0; -} +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static void *xfb = NULL; +u32 first_frame = 1; +GXRModeObj *rmode; + +int main() +{ + VIDEO_Init(); + + rmode = VIDEO_GetPreferredMode(NULL); + + PAD_Init(); + + + xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); + + VIDEO_Configure(rmode); + + VIDEO_SetNextFramebuffer(xfb); + + VIDEO_SetBlack(FALSE); + VIDEO_Flush(); + VIDEO_WaitVSync(); + if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); + + + console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*2); + + + time_t gc_time; + gc_time = time(NULL); + + srand(gc_time); + while(1) + { + s32 Size; + s32 SSize; + u32 ID; + s32 error; + VIDEO_ClearFrameBuffer(rmode, xfb, 0); + + EXI_GetID(0, 0, &ID); + error = CARD_ProbeEx(0, &Size, &SSize); + // Can't use printf since Dolphin overrides it + if(error >= 0) // All is good + std::cout << "Card A has a size of " << Size << " and a Sector Size of " << SSize; + else if( error == -2) // Device isn't Memory card + std::cout << "Device isn't Mem card in Slot A"; + else + std::cout << "Got an error of " << error << " with slot A"; + std::cout << " ID of 0x" << std::setbase(16) << ID << std::endl; + + std::cout << std::setbase(10); + EXI_GetID(1, 0, &ID); + error = CARD_ProbeEx(1, &Size, &SSize); + if(error >= 0) // All is good + std::cout << "Card B has a size of " << Size << " and a Sector Size of " << SSize; + else if( error == -2) // Device isn't Memory card + std::cout << "Device isn't Mem card in Slot B"; + else + std::cout << "Got an error of " << error << " with slot B"; + std::cout << " ID of 0x" << std::setbase(16) << ID << std::endl; + VIDEO_WaitVSync(); + } + return 0; +} diff --git a/Source/TestSuite/GX/GX.vcproj b/Source/TestSuite/GX/GX.vcproj new file mode 100644 index 0000000000..bcd2a2fd43 --- /dev/null +++ b/Source/TestSuite/GX/GX.vcproj @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/TestSuite/Devices/MemCard/Makefile b/Source/TestSuite/GX/Makefile similarity index 100% rename from Source/TestSuite/Devices/MemCard/Makefile rename to Source/TestSuite/GX/Makefile diff --git a/Source/TestSuite/Graphics/GX/Cube/source/Cube.cpp b/Source/TestSuite/GX/source/dolphintest_gx.cpp similarity index 84% rename from Source/TestSuite/Graphics/GX/Cube/source/Cube.cpp rename to Source/TestSuite/GX/source/dolphintest_gx.cpp index 128472320e..8901e583e2 100644 --- a/Source/TestSuite/Graphics/GX/Cube/source/Cube.cpp +++ b/Source/TestSuite/GX/source/dolphintest_gx.cpp @@ -1,9 +1,6 @@ /*--------------------------------------------------------------------------------- - - a simple rotating cube demo by tkcne - +a simple rotating cube demo by tkcne ---------------------------------------------------------------------------------*/ - #include #include #include @@ -13,24 +10,23 @@ #include #include #include - + #define DEFAULT_FIFO_SIZE (256*1024) //GX_FIFO_MINSIZE - + //--------------------------------------------------------------------------------- // cube vertex data //--------------------------------------------------------------------------------- s16 cube[] ATTRIBUTE_ALIGN(32) = { // x y z -15, 15, -15, // 0 - 15, 15, -15, // 1 - 15, 15, 15, // 2 + 15, 15, -15, // 1 + 15, 15, 15, // 2 -15, 15, 15, // 3 - 15, -15, -15, // 4 - 15, -15, 15, // 5 + 15, -15, -15, // 4 + 15, -15, 15, // 5 -15, -15, 15, // 6 -15, -15, -15, // 7 }; - //--------------------------------------------------------------------------------- // color data @@ -41,36 +37,37 @@ u8 colors[] ATTRIBUTE_ALIGN(32) = { 240, 0, 0, 255, // 1 red 255, 180, 0, 255, // 2 orange 255, 255, 0, 255, // 3 yellow - 10, 120, 40, 255, // 4 green - 0, 20, 100, 255 // 5 blue + 10, 120, 40, 255, // 4 green + 0, 20, 100, 255 // 5 blue }; - - u32 + +u32 CvtRGB (u8 r1, u8 g1, u8 b1, u8 r2, u8 g2, u8 b2) { - int y1, cb1, cr1, y2, cb2, cr2, cb, cr; - - y1 = (299 * r1 + 587 * g1 + 114 * b1) / 1000; - cb1 = (-16874 * r1 - 33126 * g1 + 50000 * b1 + 12800000) / 100000; - cr1 = (50000 * r1 - 41869 * g1 - 8131 * b1 + 12800000) / 100000; - - y2 = (299 * r2 + 587 * g2 + 114 * b2) / 1000; - cb2 = (-16874 * r2 - 33126 * g2 + 50000 * b2 + 12800000) / 100000; - cr2 = (50000 * r2 - 41869 * g2 - 8131 * b2 + 12800000) / 100000; - - cb = (cb1 + cb2) >> 1; - cr = (cr1 + cr2) >> 1; - - return (y1 << 24) | (cb << 16) | (y2 << 8) | cr; + int y1, cb1, cr1, y2, cb2, cr2, cb, cr; + + y1 = (299 * r1 + 587 * g1 + 114 * b1) / 1000; + cb1 = (-16874 * r1 - 33126 * g1 + 50000 * b1 + 12800000) / 100000; + cr1 = (50000 * r1 - 41869 * g1 - 8131 * b1 + 12800000) / 100000; + + y2 = (299 * r2 + 587 * g2 + 114 * b2) / 1000; + cb2 = (-16874 * r2 - 33126 * g2 + 50000 * b2 + 12800000) / 100000; + cr2 = (50000 * r2 - 41869 * g2 - 8131 * b2 + 12800000) / 100000; + + cb = (cb1 + cb2) >> 1; + cr = (cr1 + cr2) >> 1; + + return (y1 << 24) | (cb << 16) | (y2 << 8) | cr; } + static u32 curr_fb = 0; static u32 first_frame = 1; static u32 *xfb[2] = {NULL,NULL}; GXRModeObj *rmode; - + void draw_init(); void draw_cube(Mtx v); - + //--------------------------------------------------------------------------------- int main( int argc, char **argv ){ //--------------------------------------------------------------------------------- @@ -80,25 +77,25 @@ int main( int argc, char **argv ){ Mtx v,p; // view and perspective matrices int CP = 0; GXColor background = {0, 0, 0, 0xff}; - int startx, starty; - int directionx, directiony; - + int startx, starty; + int directionx, directiony; + // init the vi. setup frame buffer and set the retrace callback // to copy the efb to xfb VIDEO_Init(); PAD_Init(); - + rmode = VIDEO_GetPreferredMode(NULL); - - + + curr_fb = 0; first_frame = 0; - + // setup the fifo and then init the flipper void *gp_fifo = NULL; gp_fifo = memalign(32,DEFAULT_FIFO_SIZE); memset(gp_fifo,0,DEFAULT_FIFO_SIZE); - + xfb[0] = (u32 *) MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); xfb[1] = (u32 *) MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); @@ -109,14 +106,14 @@ int main( int argc, char **argv ){ VIDEO_WaitVSync(); if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); console_init(xfb[curr_fb],20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - + //curr_fb ^= 1; - + GX_Init(gp_fifo,DEFAULT_FIFO_SIZE); - + // clears the bg to color and clears the z buffer GX_SetCopyClear(background, 0x00ffffff); - + // other gx setup GX_SetViewport(0,0,rmode->fbWidth,rmode->efbHeight,0,1); yscale = GX_GetYScaleFactor(rmode->efbHeight,rmode->xfbHeight); @@ -126,37 +123,37 @@ int main( int argc, char **argv ){ GX_SetDispCopyDst(rmode->fbWidth,xfbHeight); GX_SetCopyFilter(rmode->aa,rmode->sample_pattern,GX_TRUE,rmode->vfilter); GX_SetFieldMode(rmode->field_rendering,((rmode->viHeight==2*rmode->xfbHeight)?GX_ENABLE:GX_DISABLE)); - + // cull none because other values produce weird results GX_SetCullMode(GX_CULL_NONE); GX_CopyDisp(xfb[curr_fb],GX_TRUE); GX_SetDispCopyGamma(GX_GM_1_0); - + // setup our camera at the origin // looking down the -z axis with y up Vector cam = {0.0F, 0.0F, 0.0F}, - up = {0.0F, 1.0F, 0.0F}, - look = {0.0F, 0.0F, -1.0F}; + up = {0.0F, 1.0F, 0.0F}, + look = {0.0F, 0.0F, -1.0F}; guLookAt(v, &cam, &up, &look); - + // setup our projection matrix // this creates a perspective matrix with a view angle of 60, // an aspect ratio of 4/3 (i'm not sure if that's the right // way to do it but i just went by what made a square on my screen) // and z near and far distances - f32 w = rmode->viWidth; - f32 h = rmode->viHeight; + f32 w = rmode->viWidth; + f32 h = rmode->viHeight; guPerspective(p, 60, (f32)w/h, 10.0F, 300.0F); GX_LoadProjectionMtx(p, GX_PERSPECTIVE); - - GXColor Test = { 192, 255, 0, 255 }; - GX_SetFog(GX_FOG_EXP2, 1, 2, 3, 4, Test); - GXFogAdjTbl bum; + + GXColor Test = { 192, 255, 0, 255 }; + GX_SetFog(GX_FOG_EXP2, 1, 2, 3, 4, Test); + GXFogAdjTbl bum; GX_SetFogRangeAdj(GX_ENABLE, 255, &bum); // setup vertexes draw_init(); - colour1 = CvtRGB (0xff, 0xff, 0xff, 0xff, 0xff, 0xff); + colour1 = CvtRGB (0xff, 0xff, 0xff, 0xff, 0xff, 0xff); // main loop while(1) { @@ -173,64 +170,64 @@ int main( int argc, char **argv ){ GX_InvalidateTexAll(); GX_SetScissor(640 , 480,680 , 560); GX_SetScissorBoxOffset(-80, -80); - + // draw our cube draw_cube(v); - + GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); GX_SetColorUpdate(GX_TRUE); GX_CopyDisp(xfb[curr_fb],GX_TRUE); - + // do this stuff after drawing GX_DrawDone(); - /*** Draw Bouncing Square ***/ + /*** Draw Bouncing Square ***/ if (directionx) startx -= 4; else startx += 4; - + if (directiony) starty -= 2; else starty += 2; - + if (startx >= 576) directionx = 1; - + if (starty >= (rmode->xfbHeight - 64)) directiony = 1; - + if (startx < 0) { startx = 0; directionx = 0; } - + if (starty < 0) { starty = 0; directiony = 0; } - + CP = (starty * 320) + (startx >> 1); - for (int rows = 0; rows < 64; rows++) { + for (int rows = 0; rows < 64; rows++) { for (int cols = 0; cols < 32; cols++) xfb[curr_fb][CP + cols] = colour1; - + CP += 320; } VIDEO_SetNextFramebuffer(xfb[curr_fb]); - + if(first_frame) { first_frame = 0; VIDEO_SetBlack(FALSE); - } + } VIDEO_Flush(); VIDEO_WaitVSync(); curr_fb ^= 1; - + } return 0; } - - + + //--------------------------------------------------------------------------------- void draw_init() { //--------------------------------------------------------------------------------- @@ -240,7 +237,7 @@ void draw_init() { GX_ClearVtxDesc(); GX_SetVtxDesc(GX_VA_POS, GX_INDEX8); GX_SetVtxDesc(GX_VA_CLR0, GX_INDEX8); - + // setup the vertex attribute table // describes the data // args: vat location 0-7, type of data, data format, size, scale @@ -249,14 +246,14 @@ void draw_init() { // bits for non float data. GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0); GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); - + // tells gx where our position and color data is // args: type of data, pointer, array stride GX_SetArray(GX_VA_POS, cube, 3*sizeof(s16)); GX_SetArray(GX_VA_CLR0, colors, 4*sizeof(u8)); DCFlushRange(cube,sizeof(cube)); DCFlushRange(colors,sizeof(colors)); - + // no idea...sets to no textures // i don't know anything about textures or lighting yet :| GX_SetNumChans(1); @@ -264,8 +261,8 @@ void draw_init() { GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORDNULL, GX_TEXMAP_NULL, GX_COLOR0A0); GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR); } - - + + //--------------------------------------------------------------------------------- // draws a quad from 4 vertex idx and one color idx //--------------------------------------------------------------------------------- @@ -282,8 +279,8 @@ void draw_quad(u8 v0, u8 v1, u8 v2, u8 v3, u8 c) { GX_Position1x8(v3); GX_Color1x8(c); } - - + + //--------------------------------------------------------------------------------- void draw_cube(Mtx v) { //--------------------------------------------------------------------------------- @@ -291,9 +288,9 @@ void draw_cube(Mtx v) { Mtx mv; // modelview matrix. Vector axis = {-1,1,0}; static float rotateby = 0; - + rotateby ++; - + // move the cube out in front of us and rotate it guMtxIdentity(m); guMtxRotAxisDeg(m, &axis, rotateby); @@ -301,19 +298,19 @@ void draw_cube(Mtx v) { guMtxConcat(v,m,mv); // load the modelview matrix into matrix memory GX_LoadPosMtxImm(mv, GX_PNMTX0); - + // drawing begins! // tells the flipper what type of primitive we will be drawing // which descriptor in the VAT to use and the number of vertices // to expect. 24 since we will draw 6 quads with 4 verts each. GX_Begin(GX_QUADS, GX_VTXFMT0, 24); - - draw_quad(0, 3, 2, 1, 0); - draw_quad(0, 7, 6, 3, 1); - draw_quad(0, 1, 4, 7, 2); - draw_quad(1, 2, 5, 4, 3); - draw_quad(2, 3, 6, 5, 4); - draw_quad(4, 7, 6, 5, 5); - + + draw_quad(0, 3, 2, 1, 0); + draw_quad(0, 7, 6, 3, 1); + draw_quad(0, 1, 4, 7, 2); + draw_quad(1, 2, 5, 4, 3); + draw_quad(2, 3, 6, 5, 4); + draw_quad(4, 7, 6, 5, 5); + GX_End(); } diff --git a/Source/TestSuite/Graphics/GX/Makefile b/Source/TestSuite/Graphics/GX/Makefile deleted file mode 100644 index 3a6fe744eb..0000000000 --- a/Source/TestSuite/Graphics/GX/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS:= `ls | egrep -v '^(CVS)$$'` - -all: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; - -clean: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; - diff --git a/Source/TestSuite/Graphics/GX/template.pnproj b/Source/TestSuite/Graphics/GX/template.pnproj deleted file mode 100644 index c22af0293b..0000000000 --- a/Source/TestSuite/Graphics/GX/template.pnproj +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Graphics/GX/template.pnps b/Source/TestSuite/Graphics/GX/template.pnps deleted file mode 100644 index 6450388d77..0000000000 --- a/Source/TestSuite/Graphics/GX/template.pnps +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Graphics/Makefile b/Source/TestSuite/Graphics/Makefile deleted file mode 100644 index 3a6fe744eb..0000000000 --- a/Source/TestSuite/Graphics/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS:= `ls | egrep -v '^(CVS)$$'` - -all: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; - -clean: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; - diff --git a/Source/TestSuite/Makefile b/Source/TestSuite/Makefile index 3a6fe744eb..2ec4b42e78 100644 --- a/Source/TestSuite/Makefile +++ b/Source/TestSuite/Makefile @@ -1,3 +1,4 @@ +#Someone who would use this, please fix it :) SUBDIRS:= `ls | egrep -v '^(CVS)$$'` all: diff --git a/Source/TestSuite/Misc/Aram/template.pnproj b/Source/TestSuite/Misc/Aram/template.pnproj deleted file mode 100644 index c22af0293b..0000000000 --- a/Source/TestSuite/Misc/Aram/template.pnproj +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Misc/Aram/template.pnps b/Source/TestSuite/Misc/Aram/template.pnps deleted file mode 100644 index 6450388d77..0000000000 --- a/Source/TestSuite/Misc/Aram/template.pnps +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Misc/Makefile b/Source/TestSuite/Misc/Makefile deleted file mode 100644 index 3a6fe744eb..0000000000 --- a/Source/TestSuite/Misc/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS:= `ls | egrep -v '^(CVS)$$'` - -all: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; - -clean: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; - diff --git a/Source/TestSuite/Misc/Time/template.pnproj b/Source/TestSuite/Misc/Time/template.pnproj deleted file mode 100644 index c22af0293b..0000000000 --- a/Source/TestSuite/Misc/Time/template.pnproj +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Misc/Time/template.pnps b/Source/TestSuite/Misc/Time/template.pnps deleted file mode 100644 index 6450388d77..0000000000 --- a/Source/TestSuite/Misc/Time/template.pnps +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/Graphics/GX/Cube/Makefile b/Source/TestSuite/PAD/Makefile similarity index 100% rename from Source/TestSuite/Graphics/GX/Cube/Makefile rename to Source/TestSuite/PAD/Makefile diff --git a/Source/TestSuite/PAD/PAD.vcproj b/Source/TestSuite/PAD/PAD.vcproj new file mode 100644 index 0000000000..1312aa7204 --- /dev/null +++ b/Source/TestSuite/PAD/PAD.vcproj @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/TestSuite/Devices/Controllers/GC/source/GC.cpp b/Source/TestSuite/PAD/source/dolphintest_pad.cpp similarity index 98% rename from Source/TestSuite/Devices/Controllers/GC/source/GC.cpp rename to Source/TestSuite/PAD/source/dolphintest_pad.cpp index 9238900484..adb5beae35 100644 --- a/Source/TestSuite/Devices/Controllers/GC/source/GC.cpp +++ b/Source/TestSuite/PAD/source/dolphintest_pad.cpp @@ -39,7 +39,7 @@ int main() { VIDEO_SetBlack(FALSE); VIDEO_Flush(); VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) + if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); diff --git a/Source/TestSuite/Misc/Time/Makefile b/Source/TestSuite/RTC/Makefile similarity index 100% rename from Source/TestSuite/Misc/Time/Makefile rename to Source/TestSuite/RTC/Makefile diff --git a/Source/TestSuite/RTC/RTC.vcproj b/Source/TestSuite/RTC/RTC.vcproj new file mode 100644 index 0000000000..eb5a4e9fa5 --- /dev/null +++ b/Source/TestSuite/RTC/RTC.vcproj @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/TestSuite/Misc/Time/source/Time.cpp b/Source/TestSuite/RTC/source/dolphintest_rtc.cpp similarity index 93% rename from Source/TestSuite/Misc/Time/source/Time.cpp rename to Source/TestSuite/RTC/source/dolphintest_rtc.cpp index 046fcc6a4c..03b0450036 100644 --- a/Source/TestSuite/Misc/Time/source/Time.cpp +++ b/Source/TestSuite/RTC/source/dolphintest_rtc.cpp @@ -1,55 +1,55 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -static void *xfb = NULL; - -u32 first_frame = 1; -GXRModeObj *rmode; - - -int main() { - - VIDEO_Init(); - - rmode = VIDEO_GetPreferredMode(NULL); - - - xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - - VIDEO_Configure(rmode); - - VIDEO_SetNextFramebuffer(xfb); - - VIDEO_SetBlack(FALSE); - VIDEO_Flush(); - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); - - - console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*2); - - - time_t gc_time; - gc_time = time(NULL); - - srand(gc_time); - - while(1) { - - gc_time = time(NULL); - printf("\x1b[10;0HRTC time is %s ",ctime(&gc_time)); - - VIDEO_WaitVSync(); - } - -} +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +static void *xfb = NULL; + +u32 first_frame = 1; +GXRModeObj *rmode; + + +int main() { + + VIDEO_Init(); + + rmode = VIDEO_GetPreferredMode(NULL); + + + xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); + + VIDEO_Configure(rmode); + + VIDEO_SetNextFramebuffer(xfb); + + VIDEO_SetBlack(FALSE); + VIDEO_Flush(); + VIDEO_WaitVSync(); + if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); + + + console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*2); + + + time_t gc_time; + gc_time = time(NULL); + + srand(gc_time); + + while(1) { + + gc_time = time(NULL); + printf("\x1b[10;0HRTC time is %s ",ctime(&gc_time)); + + VIDEO_WaitVSync(); + } + +} diff --git a/Source/TestSuite/SI/Makefile b/Source/TestSuite/SI/Makefile index 3a6fe744eb..8cde430ac6 100644 --- a/Source/TestSuite/SI/Makefile +++ b/Source/TestSuite/SI/Makefile @@ -1,8 +1,130 @@ -SUBDIRS:= `ls | egrep -v '^(CVS)$$'` - -all: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; - -clean: - @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; - +#--------------------------------------------------------------------------------- +# Clear the implicit built in rules +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- +ifeq ($(strip $(DEVKITPPC)),) +$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") +endif + +include $(DEVKITPPC)/gamecube_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# INCLUDES is a list of directories containing extra header files +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) +BUILD := build +SOURCES := source +DATA := data +INCLUDES := + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- + +CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE) +CXXFLAGS = $(CFLAGS) + +LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map + +#--------------------------------------------------------------------------------- +# any extra libraries we wish to link with the project +#--------------------------------------------------------------------------------- +LIBS := -logc -lm + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := + +#--------------------------------------------------------------------------------- +# no real need to edit anything past this point unless you need to add additional +# rules for different file extensions +#--------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +#--------------------------------------------------------------------------------- +# automatically build a list of object files for our project +#--------------------------------------------------------------------------------- +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) + export LD := $(CC) +else + export LD := $(CXX) +endif + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ + $(sFILES:.s=.o) $(SFILES:.S=.o) + +#--------------------------------------------------------------------------------- +# build a list of include paths +#--------------------------------------------------------------------------------- +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) \ + -I$(LIBOGC_INC) + +#--------------------------------------------------------------------------------- +# build a list of library paths +#--------------------------------------------------------------------------------- +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ + -L$(LIBOGC_LIB) + +export OUTPUT := $(CURDIR)/$(TARGET) +.PHONY: $(BUILD) clean + +#--------------------------------------------------------------------------------- +$(BUILD): + @[ -d $@ ] || mkdir -p $@ + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +$(OUTPUT).dol: $(OUTPUT).elf +$(OUTPUT).elf: $(OFILES) + +#--------------------------------------------------------------------------------- +# This rule links in binary data with the .jpg extension +#--------------------------------------------------------------------------------- +%.jpg.o : %.jpg +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + $(bin2o) + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- diff --git a/Source/TestSuite/SI/SI.vcproj b/Source/TestSuite/SI/SI.vcproj new file mode 100644 index 0000000000..b2e98a0a31 --- /dev/null +++ b/Source/TestSuite/SI/SI.vcproj @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/TestSuite/SI/Test1/Makefile b/Source/TestSuite/SI/Test1/Makefile deleted file mode 100644 index 8cde430ac6..0000000000 --- a/Source/TestSuite/SI/Test1/Makefile +++ /dev/null @@ -1,130 +0,0 @@ -#--------------------------------------------------------------------------------- -# Clear the implicit built in rules -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- -ifeq ($(strip $(DEVKITPPC)),) -$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") -endif - -include $(DEVKITPPC)/gamecube_rules - -#--------------------------------------------------------------------------------- -# TARGET is the name of the output -# BUILD is the directory where object files & intermediate files will be placed -# SOURCES is a list of directories containing source code -# INCLUDES is a list of directories containing extra header files -#--------------------------------------------------------------------------------- -TARGET := $(notdir $(CURDIR)) -BUILD := build -SOURCES := source -DATA := data -INCLUDES := - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- - -CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE) -CXXFLAGS = $(CFLAGS) - -LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project -#--------------------------------------------------------------------------------- -LIBS := -logc -lm - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := - -#--------------------------------------------------------------------------------- -# no real need to edit anything past this point unless you need to add additional -# rules for different file extensions -#--------------------------------------------------------------------------------- -ifneq ($(BUILD),$(notdir $(CURDIR))) -#--------------------------------------------------------------------------------- - -export OUTPUT := $(CURDIR)/$(TARGET) - -export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ - $(foreach dir,$(DATA),$(CURDIR)/$(dir)) - -export DEPSDIR := $(CURDIR)/$(BUILD) - -#--------------------------------------------------------------------------------- -# automatically build a list of object files for our project -#--------------------------------------------------------------------------------- -CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) -sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S))) -BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) - export LD := $(CC) -else - export LD := $(CXX) -endif - -export OFILES := $(addsuffix .o,$(BINFILES)) \ - $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ - $(sFILES:.s=.o) $(SFILES:.S=.o) - -#--------------------------------------------------------------------------------- -# build a list of include paths -#--------------------------------------------------------------------------------- -export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ - $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ - -I$(CURDIR)/$(BUILD) \ - -I$(LIBOGC_INC) - -#--------------------------------------------------------------------------------- -# build a list of library paths -#--------------------------------------------------------------------------------- -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ - -L$(LIBOGC_LIB) - -export OUTPUT := $(CURDIR)/$(TARGET) -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @[ -d $@ ] || mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol - -#--------------------------------------------------------------------------------- -else - -DEPENDS := $(OFILES:.o=.d) - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT).dol: $(OUTPUT).elf -$(OUTPUT).elf: $(OFILES) - -#--------------------------------------------------------------------------------- -# This rule links in binary data with the .jpg extension -#--------------------------------------------------------------------------------- -%.jpg.o : %.jpg -#--------------------------------------------------------------------------------- - @echo $(notdir $<) - $(bin2o) - --include $(DEPENDS) - -#--------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------- diff --git a/Source/TestSuite/SI/Test1/template.pnproj b/Source/TestSuite/SI/Test1/template.pnproj deleted file mode 100644 index c22af0293b..0000000000 --- a/Source/TestSuite/SI/Test1/template.pnproj +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/SI/Test1/template.pnps b/Source/TestSuite/SI/Test1/template.pnps deleted file mode 100644 index 6450388d77..0000000000 --- a/Source/TestSuite/SI/Test1/template.pnps +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Source/TestSuite/SI/Test1/source/Test1.cpp b/Source/TestSuite/SI/source/dolphintest_si.cpp similarity index 99% rename from Source/TestSuite/SI/Test1/source/Test1.cpp rename to Source/TestSuite/SI/source/dolphintest_si.cpp index bf8b1ce9f3..d7940990d4 100644 --- a/Source/TestSuite/SI/Test1/source/Test1.cpp +++ b/Source/TestSuite/SI/source/dolphintest_si.cpp @@ -11,10 +11,12 @@ static void *xfb = NULL; static GXRModeObj *rmode = NULL; void *Initialise(); + + int main(int argc, char **argv) { xfb = Initialise(); - + while(1) { PAD_ScanPads(); VIDEO_ClearFrameBuffer(rmode, xfb, 0); diff --git a/Source/TestSuite/TestSuite.sln b/Source/TestSuite/TestSuite.sln new file mode 100644 index 0000000000..b1cf259448 --- /dev/null +++ b/Source/TestSuite/TestSuite.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GX", "GX\GX.vcproj", "{F45E42B2-939B-4F02-954B-E68251FD4CCF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SI", "SI\SI.vcproj", "{87F20A25-A3F8-46A3-AC32-3C16782494B1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTC", "RTC\RTC.vcproj", "{62989D24-DB3F-4BD1-A11D-26F0487CD9AF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PAD", "PAD\PAD.vcproj", "{D58C9AD5-7200-488A-B1E8-9250E64CDD45}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXI", "EXI\EXI.vcproj", "{AA230C1A-42F2-4BDC-9EB8-4AA6DF587E69}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AX", "AX\AX.vcproj", "{9F053346-A33D-4E4F-874E-CBA1AF809FC3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ARAM", "ARAM\ARAM.vcproj", "{E50732C5-038A-42F7-8C95-8C02A4E2ADA6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F45E42B2-939B-4F02-954B-E68251FD4CCF}.Release|Win32.ActiveCfg = Release|Win32 + {F45E42B2-939B-4F02-954B-E68251FD4CCF}.Release|Win32.Build.0 = Release|Win32 + {87F20A25-A3F8-46A3-AC32-3C16782494B1}.Release|Win32.ActiveCfg = Release|Win32 + {87F20A25-A3F8-46A3-AC32-3C16782494B1}.Release|Win32.Build.0 = Release|Win32 + {62989D24-DB3F-4BD1-A11D-26F0487CD9AF}.Release|Win32.ActiveCfg = Release|Win32 + {62989D24-DB3F-4BD1-A11D-26F0487CD9AF}.Release|Win32.Build.0 = Release|Win32 + {D58C9AD5-7200-488A-B1E8-9250E64CDD45}.Release|Win32.ActiveCfg = Release|Win32 + {D58C9AD5-7200-488A-B1E8-9250E64CDD45}.Release|Win32.Build.0 = Release|Win32 + {AA230C1A-42F2-4BDC-9EB8-4AA6DF587E69}.Release|Win32.ActiveCfg = Release|Win32 + {AA230C1A-42F2-4BDC-9EB8-4AA6DF587E69}.Release|Win32.Build.0 = Release|Win32 + {9F053346-A33D-4E4F-874E-CBA1AF809FC3}.Release|Win32.ActiveCfg = Release|Win32 + {9F053346-A33D-4E4F-874E-CBA1AF809FC3}.Release|Win32.Build.0 = Release|Win32 + {E50732C5-038A-42F7-8C95-8C02A4E2ADA6}.Release|Win32.ActiveCfg = Release|Win32 + {E50732C5-038A-42F7-8C95-8C02A4E2ADA6}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Source/TestSuite/Scripts/d.supp b/Source/TestSuite/d.supp similarity index 100% rename from Source/TestSuite/Scripts/d.supp rename to Source/TestSuite/d.supp diff --git a/Source/TestSuite/Scripts/grind.sh b/Source/TestSuite/grind.sh similarity index 100% rename from Source/TestSuite/Scripts/grind.sh rename to Source/TestSuite/grind.sh