diff --git a/CMakeLists.txt b/CMakeLists.txt index 10ba7c7560..0a38af9c37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,9 +17,8 @@ option(OPENMP "Enable OpenMP parallelization" ON) option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON) ######################################## # Optional Targets -# TODO: Add DSPSpy and TestSuite. +# TODO: Add DSPSpy option(DSPTOOL "Build dsptool" OFF) -option(UNITTESTS "Build unitests" OFF) # Update compiler before calling project() if (APPLE) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index fcfc1be7b6..458487257d 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -52,11 +52,7 @@ if (DSPTOOL) add_subdirectory(DSPTool) endif() -if (UNITTESTS) - add_subdirectory(UnitTests) -endif() - -# TODO: Add DSPSpy and TestSuite. Preferrably make them option()s and cpack components +# TODO: Add DSPSpy. Preferrably make it option() and cpack component diff --git a/Source/TestSuite/ARAM/ARAM.vcxproj b/Source/TestSuite/ARAM/ARAM.vcxproj deleted file mode 100644 index a1776e97d0..0000000000 --- a/Source/TestSuite/ARAM/ARAM.vcxproj +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Release - Win32 - - - - {E50732C5-038A-42F7-8C95-8C02A4E2ADA6} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_aram.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - C:\devkitPro\libogc\include;C:\devkitPro\libogc\include\ogc;$(IncludePath) - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/ARAM/Makefile b/Source/TestSuite/ARAM/Makefile deleted file mode 100644 index fbdb823cad..0000000000 --- a/Source/TestSuite/ARAM/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/ARAM/source/dolphintest_aram.cpp b/Source/TestSuite/ARAM/source/dolphintest_aram.cpp deleted file mode 100644 index d7b2a66532..0000000000 --- a/Source/TestSuite/ARAM/source/dolphintest_aram.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static void *xfb = NULL; -static GXRModeObj *rmode = NULL; - -void Initialise(); -#define NUM_BLOCKS 10 -u32 aram_blocks[NUM_BLOCKS]; -u32 start_addr = -1; - - -int main(int argc, char **argv) -{ - Initialise(); - start_addr = AR_Init(aram_blocks, NUM_BLOCKS); - while(1) - { - PAD_ScanPads(); - VIDEO_ClearFrameBuffer(rmode, xfb, 0); - std::cout<<"\x1b[2;0H"; // Position the cursor (on 2nd row) - - 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(); - } - - return 0; -} - -void Initialise() -{ - // Initialise the video system - VIDEO_Init(); - - // This function initialises the attached controllers - PAD_Init(); - - // Obtain the preferred video mode from the system - // This will correspond to the settings in the Wii menu - rmode = VIDEO_GetPreferredMode(NULL); - - // Allocate memory for the display in the uncached region - xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - - // Initialise the console, required for printf - console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - // Set up the video registers with the chosen mode - VIDEO_Configure(rmode); - - // Tell the video hardware where our display memory is - VIDEO_SetNextFramebuffer(xfb); - - // Make the display visible - VIDEO_SetBlack(FALSE); - - // Flush the video register changes to the hardware - VIDEO_Flush(); - - // Wait for Video setup to complete - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); -} diff --git a/Source/TestSuite/ASM/ASM.vcxproj b/Source/TestSuite/ASM/ASM.vcxproj deleted file mode 100644 index ca34643633..0000000000 --- a/Source/TestSuite/ASM/ASM.vcxproj +++ /dev/null @@ -1,65 +0,0 @@ - - - - - Release - Win32 - - - - {B0723635-279A-44E0-80A6-FC21DBB7A4B4} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_asm.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/ASM/Makefile b/Source/TestSuite/ASM/Makefile deleted file mode 100644 index 5fe87d1d8f..0000000000 --- a/Source/TestSuite/ASM/Makefile +++ /dev/null @@ -1,135 +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)/wii_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 := -lwiiuse -lbte -lfat -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), -iquote $(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 - -#--------------------------------------------------------------------------------- -run: - wiiload $(TARGET).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/ASM/source/Defines.h b/Source/TestSuite/ASM/source/Defines.h deleted file mode 100644 index 0bfe36f498..0000000000 --- a/Source/TestSuite/ASM/source/Defines.h +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#define u32 unsigned int -#define u16 unsigned short -#define u8 unsigned char -#define s8 signed char -#define s16 signed short -#define s32 signed int diff --git a/Source/TestSuite/ASM/source/Helpers.cpp b/Source/TestSuite/ASM/source/Helpers.cpp deleted file mode 100644 index 9aad445846..0000000000 --- a/Source/TestSuite/ASM/source/Helpers.cpp +++ /dev/null @@ -1,59 +0,0 @@ - -#include "Defines.h" - -u32 GetCR0() -{ - u32 var; - asm( - "mfcr %0" - : "=&r"(var) - ); - return var; -} - -u32 GetCR(u32 num) -{ - u32 var; - if(num == 0) // wtf, silly people - return GetCR0(); - else { - // TODO: Ugly switch is ugly, was failing otherwise - switch (num) { - case 1: - asm("mcrf 0, 1"); - break; - case 2: - asm("mcrf 0, 2"); - break; - case 3: - asm("mcrf 0, 3"); - break; - case 4: - asm("mcrf 0, 4"); - break; - case 5: - asm("mcrf 0, 5"); - break; - case 6: - asm("mcrf 0, 6"); - break; - case 7: - asm("mcrf 0, 7"); - break; - default: - printf("Can this be more than 7?\n"); - break; - } - return GetCR0(); - } -} - -u32 GetXER() -{ - u32 var; - asm( - "mfxer %0" - : "=&r"(var) - ); - return var; -} diff --git a/Source/TestSuite/ASM/source/Helpers.h b/Source/TestSuite/ASM/source/Helpers.h deleted file mode 100644 index 721f33adff..0000000000 --- a/Source/TestSuite/ASM/source/Helpers.h +++ /dev/null @@ -1,5 +0,0 @@ -#include "Defines.h" - -u32 GetCR0(); -u32 GetCR(u32 num); -u32 GetXER(); diff --git a/Source/TestSuite/ASM/source/Init.cpp b/Source/TestSuite/ASM/source/Init.cpp deleted file mode 100644 index 610e7b5bb1..0000000000 --- a/Source/TestSuite/ASM/source/Init.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Init.h" - -static void *xfb = NULL; -static GXRModeObj *rmode = NULL; -void die(char *msg) { - if (f!=NULL) fclose(f); - printf(msg); - sleep(5); - fatUnmount("sd"); - __io_wiisd.shutdown(); - exit(0); -} - -void initialise_fat() { - __io_wiisd.startup(); - if (!fatInitDefault()) - die("Unable to initialise FAT subsystem, exiting.\n"); - fatMountSimple("sd", &__io_wiisd); - DIR_ITER *root = diropen("/"); - if (!root) - die("Cannot open root dir, exiting.\n"); - dirclose(root); - if (chdir("/")) - die("Could not change to root directory, exiting.\n"); -} - -void init_crap() { - VIDEO_Init(); - WPAD_Init(); - PAD_Init(); - - // Obtain the preferred video mode from the system - // This will correspond to the settings in the Wii menu - rmode = VIDEO_GetPreferredMode(NULL); - - // Allocate memory for the display in the uncached region - xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - - // Initialise the console, required for printf - console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - // Set up the video registers with the chosen mode - VIDEO_Configure(rmode); - - // Tell the video hardware where our display memory is - VIDEO_SetNextFramebuffer(xfb); - - // Make the display visible - VIDEO_SetBlack(FALSE); - - // Flush the video register changes to the hardware - VIDEO_Flush(); - - // Wait for Video setup to complete - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); -} - -void end() { - int columns = 0, rows = 0; - CON_GetMetrics(&columns, &rows); - printf("\x1b[%i;0H",rows); - printf("File written... press Home/Start to exit."); - while(1) { - WPAD_ScanPads(); PAD_ScanPads(); - if ((WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) || (PAD_ButtonsDown(0) & PAD_BUTTON_START)) - exit(0); - VIDEO_WaitVSync(); - } -} diff --git a/Source/TestSuite/ASM/source/Init.h b/Source/TestSuite/ASM/source/Init.h deleted file mode 100644 index db818f0dd6..0000000000 --- a/Source/TestSuite/ASM/source/Init.h +++ /dev/null @@ -1,10 +0,0 @@ -extern FILE *f; - - -void die(char *msg); - -void initialise_fat(); - -void init_crap(); - -void end(); diff --git a/Source/TestSuite/ASM/source/Instructions.h b/Source/TestSuite/ASM/source/Instructions.h deleted file mode 100644 index d8f8206574..0000000000 --- a/Source/TestSuite/ASM/source/Instructions.h +++ /dev/null @@ -1,20 +0,0 @@ - -// Integer -void add(u32 *a, u32 *b, u32 *c, u32 *d); -void addRC(u32 *a, u32 *b, u32 *c, u32 *d); - -void subfc(u32 *a, u32 *b, u32 *c, u32 *d); -void subfcRC(u32 *a, u32 *b, u32 *c, u32 *d); - -void divw(u32 *a, u32 *b, u32 *c, u32 *d); -void divwRC(u32 *a, u32 *b, u32 *c, u32 *d); - -void divwo(u32 *a, u32 *b, u32 *c, u32 *d); -void divwoRC(u32 *a, u32 *b, u32 *c, u32 *d); - - -// Float - -void fsqrt(float *a, float *b, float *c, float *d); - -void fsqrtRC(float *a, float *b, float *c, float *d); diff --git a/Source/TestSuite/ASM/source/asm_float.cpp b/Source/TestSuite/ASM/source/asm_float.cpp deleted file mode 100644 index 89693eaf8f..0000000000 --- a/Source/TestSuite/ASM/source/asm_float.cpp +++ /dev/null @@ -1,16 +0,0 @@ - -#include "Defines.h" -void fsqrt(float *a, float *b, float *c, float *d) -{ - /*asm( - "fsqrt fr0,%0" - : "=&r"(*a) - );*/ -} -void fsqrtRC(float *a, float *b, float *c, float *d) -{ - /*asm( - "fsqrt. fr0,%0" - : "=&r"(*a) - );*/ -} diff --git a/Source/TestSuite/ASM/source/asm_integer.cpp b/Source/TestSuite/ASM/source/asm_integer.cpp deleted file mode 100644 index 65f01c0c67..0000000000 --- a/Source/TestSuite/ASM/source/asm_integer.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "asm_tables.h" -#include "Defines.h" - -void add(u32 *a, u32 *b, u32 *c, u32 *d) -{ - asm( - "add %0,%1,%2" - : "=r"(*a) - : "r"(*b), "r"(*c) - ); -} -void addRC(u32 *a, u32 *b, u32 *c, u32 *d) -{ - asm( - "add. %0,%1,%2" - : "=r"(*a) - : "r"(*b), "r"(*c) - : "cc" - ); -} - -void subfc(u32 *a, u32 *b, u32 *c, u32 *d) -{ - asm( - "subfc %0,%1,%2" - : "=r"(*a) - : "r"(*b), "r"(*c) - ); -} -void subfcRC(u32 *a, u32 *b, u32 *c, u32 *d) -{ - asm( - "subfc. %0,%1,%2" - : "=r"(*a) - : "r"(*b), "r"(*c) - : "cc" - ); -} - -void divw(u32 *a, u32 *b, u32 *c, u32 *d) -{ - asm( - "divw %0,%1,%2" - : "=r"(*a) - : "r"(*b), "r"(*c) - ); -} -void divwRC(u32 *a, u32 *b, u32 *c, u32 *d) -{ - asm( - "divw. %0,%1,%2" - : "=r"(*a) - : "r"(*b), "r"(*c) - : "cc" - ); -} - -void divwo(u32 *a, u32 *b, u32 *c, u32 *d) -{ - asm( - "divwo %0,%1,%2" - : "=r"(*a) - : "r"(*b), "r"(*c) - ); -} -void divwoRC(u32 *a, u32 *b, u32 *c, u32 *d) -{ - asm( - "divwo. %0,%1,%2" - : "=r"(*a) - : "r"(*b), "r"(*c) - : "cc" - ); -} diff --git a/Source/TestSuite/ASM/source/asm_tables.cpp b/Source/TestSuite/ASM/source/asm_tables.cpp deleted file mode 100644 index d775b138aa..0000000000 --- a/Source/TestSuite/ASM/source/asm_tables.cpp +++ /dev/null @@ -1,188 +0,0 @@ -#include "asm_tables.h" -#include "Init.h" -#include "Helpers.h" - -// Limited Test, Later have a test that will pass all possible variables -u32 inval_table[][2] = { - {0,0}, - {1,1}, - {300,0}, - {1,0}, - {0xffff,0}, - {0xffffffff,0}, - {0x80000000,0}, - {0x80000000,1}, - {0x80000000,2}, - {0x7fffffff,0}, - {0x7fffffff,1}, - {0x7fffffff,2}, - {0,1}, - {0,0xffff}, - {0,0xffffffff}, - {0,0x80000000}, - {1,0x80000000}, - {2,0x80000000}, - {0,0x7fffffff}, - {1,0x7fffffff}, - {2,0x7fffffff}, - {654321,0}, - {4653321,0}, - {0,300}, - {1024,8}, - {8,1024}, - {0xffff,0xffff}, - {0xffffffff,0xffffffff} -}; -void Print(const char* text) -{ - printf(text); - if(f) - fprintf(f, text); -} -void ShowModifies(u32 inst) -{ - u32 mod = instructions[inst].Modifies; - if(mod == 0) - { - Print("NONE"); - return; - } - if(mod & MOD_CR0) - Print("CR0 "); - if(mod & MOD_CR1) - Print("CR1 "); - if(mod & MOD_SR) - Print("SR "); - if(mod & MOD_XER) - Print("XER "); -} -void RunInstruction(u32 inst) -{ - u32 inval1, inval2, inval3; - - u32 outval = 0; - - // CR0 - u32 cr1 = 0, cr2 = 0; - - //CR1 - u32 cr11 = 0, cr12 = 0; - - //XER - u32 xer1 = 0, xer2 = 0; - - bool modCR0 = instructions[inst].Modifies & MOD_CR0; - bool modCR1 = instructions[inst].Modifies & MOD_CR1; - bool modXER = instructions[inst].Modifies & MOD_XER; - - if(instructions[inst].numInput != 3) - { - Print("Don't support Input not 3 yet~!\n"); - fclose(f); - return; - } - if(instructions[inst].type != TYPE_INTEGER) - { - Print("Types other than TYPE_INTEGER not supported yet!\n"); - fclose(f); - return; - } - char temp[32]; - sprintf(temp, "logs/%s.dolphin.jit.log", instructions[inst].name); - f = fopen(temp, "wb"); - if (!f) - printf("unable to open output file\n"); - - printf("%s: InputNum: %d Modifies(flags): ", instructions[inst].name, instructions[inst].numInput); - if(f) - fprintf(f, "%s: InputNum: %d Modifies(flags): ", instructions[inst].name, instructions[inst].numInput); - ShowModifies(inst); - Print("\n"); - - for (unsigned int i = 0; i < sizeof(inval_table)/(sizeof(int)*2); i++) - { - inval1 = inval_table[i][0]; - inval2 = inval_table[i][1]; - outval = 0; - - // Show our input values and where we are at on the array - printf("\x1b[%i;0H", i); - printf("%07i: %08x,%08x",i, inval1,inval2); - - // Get flags before - if(modCR0) - cr1 = GetCR0(); - if(modCR1) - cr11 = GetCR(1); - if(modXER) - xer1 = GetXER(); - - //Actually call instruction - instructions[inst].Call(&outval, &inval1, &inval2, 0); - - // Get flags after - if(modCR0) - cr2 = GetCR0(); - if(modCR1) - cr12 = GetCR(1); - if(modXER) - xer2 = GetXER(); - - // Print out value - printf(":o=%08x\n\t", outval); - - // show off flag changes - if(modCR0) - printf("CR0:(%08x ~ %08x)", cr1,cr2); - if(modCR1) - printf("CR1:(%08x ~ %08x)", cr11,cr12); - if(modXER) - printf("XER:(%08x ~ %08x)", xer1, xer2); - - - // same in the file - if(f) - { - fprintf(f, ":i=%08x, %08x:o=%08x\n\t", inval1,inval2, outval); - if(modCR0) - fprintf(f, "CR0:(%08x ~ %08x)", cr1,cr2); - if(modCR1) - fprintf(f, "CR1:(%08x ~ %08x)", cr11,cr12); - if(modXER) - fprintf(f, "XER:(%08x ~ %08x)", xer1, xer2); - } - - // see the difference in flags if any - if(modCR0) - { - u32 cr_diff = cr2&~cr1; - if (cr_diff) { - printf(" CR0D:%08x",cr_diff); - if(f) - fprintf(f, " CR0D:%08x",cr_diff); - } - } - if(modCR1) - { - u32 cr1_diff = cr12&~cr11; - if (cr1_diff) { - printf(" CR1D:%08x",cr1_diff); - if(f) - fprintf(f, " CR1D:%08x",cr1_diff); - } - } - if(modXER) - { - u32 xer_diff = xer2&~xer1; - if (xer_diff) { - printf(" XERD:%08x",xer_diff); - if(f) - fprintf(f, " XERD:%08x",xer_diff); - } - } - if(f) - fprintf(f,"\n"); - } - if(f) - fclose(f); -} diff --git a/Source/TestSuite/ASM/source/asm_tables.h b/Source/TestSuite/ASM/source/asm_tables.h deleted file mode 100644 index 62dde85be1..0000000000 --- a/Source/TestSuite/ASM/source/asm_tables.h +++ /dev/null @@ -1,52 +0,0 @@ - -#include "Defines.h" -#include "Instructions.h" - -enum Modify -{ - MOD_CR0 = (1 << 0), - MOD_CR1 = (1 << 1), - MOD_SR = (1 << 2), - MOD_XER = (1 << 3), - MOD_FPSCR = (1 << 4) -}; -enum IOput -{ - IO_ARG1 = (1 << 0), - IO_ARG2 = (1 << 1), - IO_ARG3 = (1 << 2), -}; -enum inst_type -{ - TYPE_INTEGER, - TYPE_FLOAT -}; - -struct inst -{ - char name[16]; - u32 Modifies; // Flag modification - u8 numInput; - u32 Input; - u32 Ouput; - inst_type type; - void (*Call)(u32*, u32*, u32*, u32*); - void (*CallFP)(float*, float*, float*, float*); - -}; - -static inst instructions[] = { - { "add", NULL, 3, IO_ARG1 | IO_ARG2 | IO_ARG3, IO_ARG1,TYPE_INTEGER, add}, - { "add.", MOD_CR0, 3, IO_ARG1 | IO_ARG2 | IO_ARG3, IO_ARG1,TYPE_INTEGER, add}, - { "subfc", NULL, 3, IO_ARG1 | IO_ARG2 | IO_ARG3, IO_ARG1,TYPE_INTEGER, subfc}, - { "subfc.", MOD_CR0, 3, IO_ARG1 | IO_ARG2 | IO_ARG3, IO_ARG1,TYPE_INTEGER, subfcRC}, - { "divw", NULL, 3, IO_ARG1 | IO_ARG2 | IO_ARG3, IO_ARG1, TYPE_INTEGER, divw}, - { "divw.", MOD_CR0, 3, IO_ARG1 | IO_ARG2 | IO_ARG3, IO_ARG1,TYPE_INTEGER, divwRC}, - { "divwo", MOD_XER, 3, IO_ARG1 | IO_ARG2 | IO_ARG3, IO_ARG1,TYPE_INTEGER, divwo}, - { "divwo.", MOD_CR0 | MOD_XER, 3, IO_ARG1 | IO_ARG2 | IO_ARG3, IO_ARG1, TYPE_INTEGER, divwoRC}, - //{ "fsqrt", MOD_FPSCR, 2, IO_ARG1 | IO_ARG2, IO_ARG1,TYPE_FLOAT, NULL, fsqrt}, - //{ "fsqrt.", MOD_CR1 | MOD_FPSCR, 2, IO_ARG1 | IO_ARG2, IO_ARG1,TYPE_FLOAT, NULL, fsqrtRC} -}; - - -void RunInstruction(u32 inst); diff --git a/Source/TestSuite/ASM/source/dolphintest_asm.cpp b/Source/TestSuite/ASM/source/dolphintest_asm.cpp deleted file mode 100644 index 8bedaf0a69..0000000000 --- a/Source/TestSuite/ASM/source/dolphintest_asm.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ - -#include -#include -#include -#include - -#include "Defines.h" -#include "Init.h" -#include "asm_tables.h" -#include "Helpers.h" - -FILE *f = NULL; - -int main(int argc, char **argv) -{ - init_crap(); - initialise_fat(); - - for (uint a = 0; a < sizeof(instructions) / sizeof(inst); ++a) - { - RunInstruction(a); - } - - end(); - - return 0; -} diff --git a/Source/TestSuite/AX/AX.vcxproj b/Source/TestSuite/AX/AX.vcxproj deleted file mode 100644 index 81daa7d0a8..0000000000 --- a/Source/TestSuite/AX/AX.vcxproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Release - Win32 - - - - {9F053346-A33D-4E4F-874E-CBA1AF809FC3} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_ax.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/AX/Makefile b/Source/TestSuite/AX/Makefile deleted file mode 100644 index fbdb823cad..0000000000 --- a/Source/TestSuite/AX/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/AX/source/dolphintest_ax.cpp b/Source/TestSuite/AX/source/dolphintest_ax.cpp deleted file mode 100644 index b97e7e33e6..0000000000 --- a/Source/TestSuite/AX/source/dolphintest_ax.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -static void *xfb = NULL; -static GXRModeObj *rmode = NULL; - -void *Initialise(); - - -int main(int argc, char **argv) { - - xfb = Initialise(); - AUDIO_Init(NULL); - AUDIO_SetStreamVolLeft(0xFF); // Max - AUDIO_SetStreamVolRight(0xFF); // Max - AUDIO_SetStreamSampleRate(AI_SAMPLERATE_48KHZ); - while(1) { - PAD_ScanPads(); - VIDEO_ClearFrameBuffer(rmode, xfb, 0); - - - VIDEO_WaitVSync(); - } - - return 0; -} - -void * Initialise() { - - void *framebuffer; - - VIDEO_Init(); - PAD_Init(); - - rmode = VIDEO_GetPreferredMode(NULL); - - framebuffer = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - console_init(framebuffer,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - VIDEO_Configure(rmode); - VIDEO_SetNextFramebuffer(framebuffer); - VIDEO_SetBlack(FALSE); - VIDEO_Flush(); - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); - - return framebuffer; - -} diff --git a/Source/TestSuite/EXI/EXI.vcxproj b/Source/TestSuite/EXI/EXI.vcxproj deleted file mode 100644 index 39fb475240..0000000000 --- a/Source/TestSuite/EXI/EXI.vcxproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {AA230C1A-42F2-4BDC-9EB8-4AA6DF587E69} - TestSuite - MakeFileProj - - - - Makefile - - - Makefile - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_exi.dol - WIN32;_DEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_exi.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/EXI/Makefile b/Source/TestSuite/EXI/Makefile deleted file mode 100644 index 0d4af23a0b..0000000000 --- a/Source/TestSuite/EXI/Makefile +++ /dev/null @@ -1,131 +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 - -#--------------------------------------------------------------------------------- -# 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/EXI/source/dolphintest_exi.cpp b/Source/TestSuite/EXI/source/dolphintest_exi.cpp deleted file mode 100644 index 3b7fb1c3bc..0000000000 --- a/Source/TestSuite/EXI/source/dolphintest_exi.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -static void *xfb = NULL; -u32 first_frame = 1; -GXRModeObj *rmode; - -void Initialise(); - -int main() -{ - Initialise(); - - while(1) - { - s32 Size; - s32 SSize; - u32 ID; - s32 getIDerr; - s32 CARDerr; - s32 EXIerr; - VIDEO_ClearFrameBuffer(rmode, xfb, 0); - - // Can't use printf since Dolphin overrides it - std::cout<<"\x1b[0;0H"; // Position the cursor (at 0, 0) - for (int channel = 0; channel < EXI_CHANNEL_MAX; ++channel) - for (int device = 0; device < EXI_DEVICE_MAX; ++device) - { - if (getIDerr = EXI_GetID(channel, device, &ID) == 1) - { - std::cout<<"Channel "<= 0) - { - std::cout<<"\tMemcard has a size of "<fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - // Set up the video registers with the chosen mode - VIDEO_Configure(rmode); - - // Tell the video hardware where our display memory is - VIDEO_SetNextFramebuffer(xfb); - - // Make the display visible - VIDEO_SetBlack(FALSE); - - // Flush the video register changes to the hardware - VIDEO_Flush(); - - // Wait for Video setup to complete - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); -} diff --git a/Source/TestSuite/FPU/FPU.vcxproj b/Source/TestSuite/FPU/FPU.vcxproj deleted file mode 100644 index 8609068cc0..0000000000 --- a/Source/TestSuite/FPU/FPU.vcxproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {18373B64-BCAB-4677-A070-7AD45D4C8304} - FPU - - - - Application - MultiByte - true - - - Application - MultiByte - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - true - EnableFastChecks - MultiThreadedDebugDLL - Level3 - EditAndContinue - - - true - MachineX86 - - - - - MaxSpeed - true - MultiThreadedDLL - true - Level3 - ProgramDatabase - - - true - true - true - MachineX86 - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/FPU/Makefile b/Source/TestSuite/FPU/Makefile deleted file mode 100644 index 0f42da56db..0000000000 --- a/Source/TestSuite/FPU/Makefile +++ /dev/null @@ -1,135 +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)/wii_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 := -lwiiuse -lbte -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), -iquote $(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 - -#--------------------------------------------------------------------------------- -run: - wiiload $(TARGET).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/FPU/source/asm.h b/Source/TestSuite/FPU/source/asm.h deleted file mode 100644 index ed28f7895b..0000000000 --- a/Source/TestSuite/FPU/source/asm.h +++ /dev/null @@ -1,338 +0,0 @@ -#ifndef __ASM_H__ -#define __ASM_H__ - -#ifdef _LANGUAGE_ASSEMBLY -/* Condition Register Bit Fields */ - -#define cr0 0 -#define cr1 1 -#define cr2 2 -#define cr3 3 -#define cr4 4 -#define cr5 5 -#define cr6 6 -#define cr7 7 - - -/* General Purpose Registers (GPRs) */ - -#define r0 0 -#define r1 1 -#define sp 1 -#define r2 2 -#define toc 2 -#define r3 3 -#define r4 4 -#define r5 5 -#define r6 6 -#define r7 7 -#define r8 8 -#define r9 9 -#define r10 10 -#define r11 11 -#define r12 12 -#define r13 13 -#define r14 14 -#define r15 15 -#define r16 16 -#define r17 17 -#define r18 18 -#define r19 19 -#define r20 20 -#define r21 21 -#define r22 22 -#define r23 23 -#define r24 24 -#define r25 25 -#define r26 26 -#define r27 27 -#define r28 28 -#define r29 29 -#define r30 30 -#define r31 31 - - -/* Floating Point Registers (FPRs) */ - -#define fr0 0 -#define fr1 1 -#define fr2 2 -#define fr3 3 -#define fr4 4 -#define fr5 5 -#define fr6 6 -#define fr7 7 -#define fr8 8 -#define fr9 9 -#define fr10 10 -#define fr11 11 -#define fr12 12 -#define fr13 13 -#define fr14 14 -#define fr15 15 -#define fr16 16 -#define fr17 17 -#define fr18 18 -#define fr19 19 -#define fr20 20 -#define fr21 21 -#define fr22 22 -#define fr23 23 -#define fr24 24 -#define fr25 25 -#define fr26 26 -#define fr27 27 -#define fr28 28 -#define fr29 29 -#define fr30 30 -#define fr31 31 - -#define vr0 0 -#define vr1 1 -#define vr2 2 -#define vr3 3 -#define vr4 4 -#define vr5 5 -#define vr6 6 -#define vr7 7 -#define vr8 8 -#define vr9 9 -#define vr10 10 -#define vr11 11 -#define vr12 12 -#define vr13 13 -#define vr14 14 -#define vr15 15 -#define vr16 16 -#define vr17 17 -#define vr18 18 -#define vr19 19 -#define vr20 20 -#define vr21 21 -#define vr22 22 -#define vr23 23 -#define vr24 24 -#define vr25 25 -#define vr26 26 -#define vr27 27 -#define vr28 28 -#define vr29 29 -#define vr30 30 -#define vr31 31 - -#endif //_LANGUAGE_ASSEMBLY - -#define SPRG0 272 -#define SPRG1 273 -#define SPRG2 274 -#define SPRG3 275 - -#define PMC1 953 -#define PMC2 954 -#define PMC3 957 -#define PMC4 958 - -#define MMCR0 952 -#define MMCR1 956 - - -#define LINK_REGISTER_CALLEE_UPDATE_ROOM 4 -#define EXCEPTION_NUMBER 8 -#define SRR0_OFFSET 12 -#define SRR1_OFFSET 16 -#define GPR0_OFFSET 20 -#define GPR1_OFFSET 24 -#define GPR2_OFFSET 28 -#define GPR3_OFFSET 32 -#define GPR4_OFFSET 36 -#define GPR5_OFFSET 40 -#define GPR6_OFFSET 44 -#define GPR7_OFFSET 48 -#define GPR8_OFFSET 52 -#define GPR9_OFFSET 56 -#define GPR10_OFFSET 60 -#define GPR11_OFFSET 64 -#define GPR12_OFFSET 68 -#define GPR13_OFFSET 72 -#define GPR14_OFFSET 76 -#define GPR15_OFFSET 80 -#define GPR16_OFFSET 84 -#define GPR17_OFFSET 88 -#define GPR18_OFFSET 92 -#define GPR19_OFFSET 96 -#define GPR20_OFFSET 100 -#define GPR21_OFFSET 104 -#define GPR22_OFFSET 108 -#define GPR23_OFFSET 112 -#define GPR24_OFFSET 116 -#define GPR25_OFFSET 120 -#define GPR26_OFFSET 124 -#define GPR27_OFFSET 128 -#define GPR28_OFFSET 132 -#define GPR29_OFFSET 136 -#define GPR30_OFFSET 140 -#define GPR31_OFFSET 144 - -#define GQR0_OFFSET 148 -#define GQR1_OFFSET 152 -#define GQR2_OFFSET 156 -#define GQR3_OFFSET 160 -#define GQR4_OFFSET 164 -#define GQR5_OFFSET 168 -#define GQR6_OFFSET 172 -#define GQR7_OFFSET 176 - -#define CR_OFFSET 180 -#define LR_OFFSET 184 -#define CTR_OFFSET 188 -#define XER_OFFSET 192 -#define MSR_OFFSET 196 -#define DAR_OFFSET 200 - -#define STATE_OFFSET 204 -#define MODE_OFFSET 206 - -#define FPR0_OFFSET 208 -#define FPR1_OFFSET 216 -#define FPR2_OFFSET 224 -#define FPR3_OFFSET 232 -#define FPR4_OFFSET 240 -#define FPR5_OFFSET 248 -#define FPR6_OFFSET 256 -#define FPR7_OFFSET 264 -#define FPR8_OFFSET 272 -#define FPR9_OFFSET 280 -#define FPR10_OFFSET 288 -#define FPR11_OFFSET 296 -#define FPR12_OFFSET 304 -#define FPR13_OFFSET 312 -#define FPR14_OFFSET 320 -#define FPR15_OFFSET 328 -#define FPR16_OFFSET 336 -#define FPR17_OFFSET 344 -#define FPR18_OFFSET 352 -#define FPR19_OFFSET 360 -#define FPR20_OFFSET 368 -#define FPR21_OFFSET 376 -#define FPR22_OFFSET 384 -#define FPR23_OFFSET 392 -#define FPR24_OFFSET 400 -#define FPR25_OFFSET 408 -#define FPR26_OFFSET 416 -#define FPR27_OFFSET 424 -#define FPR28_OFFSET 432 -#define FPR29_OFFSET 440 -#define FPR30_OFFSET 448 -#define FPR31_OFFSET 456 - -#define FPSCR_OFFSET 464 - -#define PSR0_OFFSET 472 -#define PSR1_OFFSET 480 -#define PSR2_OFFSET 488 -#define PSR3_OFFSET 496 -#define PSR4_OFFSET 504 -#define PSR5_OFFSET 512 -#define PSR6_OFFSET 520 -#define PSR7_OFFSET 528 -#define PSR8_OFFSET 536 -#define PSR9_OFFSET 544 -#define PSR10_OFFSET 552 -#define PSR11_OFFSET 560 -#define PSR12_OFFSET 568 -#define PSR13_OFFSET 576 -#define PSR14_OFFSET 584 -#define PSR15_OFFSET 592 -#define PSR16_OFFSET 600 -#define PSR17_OFFSET 608 -#define PSR18_OFFSET 616 -#define PSR19_OFFSET 624 -#define PSR20_OFFSET 632 -#define PSR21_OFFSET 640 -#define PSR22_OFFSET 648 -#define PSR23_OFFSET 656 -#define PSR24_OFFSET 664 -#define PSR25_OFFSET 672 -#define PSR26_OFFSET 680 -#define PSR27_OFFSET 688 -#define PSR28_OFFSET 696 -#define PSR29_OFFSET 704 -#define PSR30_OFFSET 712 -#define PSR31_OFFSET 720 -/* - * maintain the EABI requested 8 bytes aligment - * As SVR4 ABI requires 16, make it 16 (as some - * exception may need more registers to be processed...) - */ -#define EXCEPTION_FRAME_END 728 - -#define IBAT0U 528 -#define IBAT0L 529 -#define IBAT1U 530 -#define IBAT1L 531 -#define IBAT2U 532 -#define IBAT2L 533 -#define IBAT3U 534 -#define IBAT3L 535 -#define IBAT4U 560 -#define IBAT4L 561 -#define IBAT5U 562 -#define IBAT5L 563 -#define IBAT6U 564 -#define IBAT6L 565 -#define IBAT7U 566 -#define IBAT7L 567 - -#define DBAT0U 536 -#define DBAT0L 537 -#define DBAT1U 538 -#define DBAT1L 539 -#define DBAT2U 540 -#define DBAT2L 541 -#define DBAT3U 542 -#define DBAT3L 543 -#define DBAT4U 568 -#define DBAT4L 569 -#define DBAT5U 570 -#define DBAT5L 571 -#define DBAT6U 572 -#define DBAT6L 573 -#define DBAT7U 574 -#define DBAT7L 575 - -#define HID0 1008 -#define HID1 1009 -#define HID2 920 -#define HID4 1011 - -#define GQR0 912 -#define GQR1 913 -#define GQR2 914 -#define GQR3 915 -#define GQR4 916 -#define GQR5 917 -#define GQR6 918 -#define GQR7 919 - -#define L2CR 1017 - -#define WPAR 921 - -#define DMAU 922 -#define DMAL 923 - -#define MSR_RI 0x00000002 -#define MSR_DR 0x00000010 -#define MSR_IR 0x00000020 -#define MSR_IP 0x00000040 -#define MSR_SE 0x00000400 -#define MSR_ME 0x00001000 -#define MSR_FP 0x00002000 -#define MSR_POW 0x00004000 -#define MSR_EE 0x00008000 - -#define PPC_ALIGNMENT 8 - -#define PPC_CACHE_ALIGNMENT 32 - -#endif //__ASM_H__ diff --git a/Source/TestSuite/FPU/source/dolphintest_fpu.cpp b/Source/TestSuite/FPU/source/dolphintest_fpu.cpp deleted file mode 100644 index d465b0c614..0000000000 --- a/Source/TestSuite/FPU/source/dolphintest_fpu.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Pull in the assembly functions. -extern "C" { -void TestFRES1(u32 *fpscr, float *result, float *result2); -}; - -int doreload=0, dooff=0; -void reload() { doreload=1; } -void shutdown() { dooff=1; } - - -void Compare(const char *a, const char *b) { - if (!strcmp(a, b)) { - printf("SUCCESS - %s\n", a); - } else { - printf("FAIL - %s != \n" - " %s\n", a, b); - } -} - -void TestDivision() { - double a, b, c, d, e; - a = 1.0; - b = 0.0; - c = a / b; - d = b / a; - e = sqrt(-1); - char temp[100]; - sprintf(temp, "%1.1f %1.1f %1.1f %1.1f %1.1f", a, b, c, d, e); - Compare(temp, "1.0 0.0 inf 0.0 nan"); -} - -void TestFres() { - u32 fpscr[2]; - float out, out2; - TestFRES1(fpscr, &out, &out2); - char temp[100]; - sprintf(temp, "%08x %1.1f %1.1f", fpscr[1], out, out2); - Compare(temp, "86002004 inf 0.0"); -} - -void TestNormalize() { - //float a[3] = {2,2,2}; - //d_guVecNormalize(a); - //printf("%f %f %f\n", a[0], a[1], a[2]); -} - - -int main(int argc, char **argv) { - void *xfb[2]; - int fbi = 0; - GXRModeObj *rmode = NULL; - - VIDEO_Init(); - PAD_Init(); - WPAD_Init(); - - rmode = VIDEO_GetPreferredMode(NULL); - - // double buffering, prevents flickering (is it needed for LCD TV? i don't have one to test) - xfb[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - xfb[1] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - - VIDEO_Configure(rmode); - VIDEO_SetNextFramebuffer(xfb[0]); - VIDEO_SetBlack(FALSE); - VIDEO_Flush(); - VIDEO_WaitVSync(); - if (rmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync(); - - SYS_SetResetCallback(reload); - SYS_SetPowerCallback(shutdown); - - WPAD_SetDataFormat(0, WPAD_FMT_BTNS_ACC_IR); - WPAD_SetVRes(0, rmode->fbWidth, rmode->xfbHeight); - - CON_Init(xfb[fbi],0,0,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - printf(" "); - printf("Tests\n\n"); - - TestDivision(); - TestFres(); - - while (!doreload && !dooff) { - WPAD_ScanPads(); - if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) - exit(0); - - VIDEO_SetNextFramebuffer(xfb[fbi]); - VIDEO_Flush(); - VIDEO_WaitVSync(); - } - if(doreload) return 0; - if(dooff) SYS_ResetSystem(SYS_SHUTDOWN,0,0); - - return 0; -} diff --git a/Source/TestSuite/FPU/source/fpu_asm.S b/Source/TestSuite/FPU/source/fpu_asm.S deleted file mode 100644 index 3f5bb57155..0000000000 --- a/Source/TestSuite/FPU/source/fpu_asm.S +++ /dev/null @@ -1,24 +0,0 @@ -#define _LANGUAGE_ASSEMBLY -#include "asm.h" - - //r3 = &fpscr - //r4 = result - .globl TestFRES1 -TestFRES1: - lis r9,Unit01@ha - addi r9,r9,Unit01@l - lfs fr0, 0(r9) - fres fr0, fr0 - stfs fr0, 0(r4) - fres fr0, fr0 - stfs fr0, 0(r5) - mffs fr1 - stfd fr1, 0(r3) - blr - - .section .data - .balign 4 -Unit01: - .float 0.0, 1.0 -NrmData: - .float 0.5, 3.0 diff --git a/Source/TestSuite/GX/GX.vcxproj b/Source/TestSuite/GX/GX.vcxproj deleted file mode 100644 index e334c18427..0000000000 --- a/Source/TestSuite/GX/GX.vcxproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Release - Win32 - - - - {F45E42B2-939B-4F02-954B-E68251FD4CCF} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_gx.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/GX/Makefile b/Source/TestSuite/GX/Makefile deleted file mode 100644 index 0d4af23a0b..0000000000 --- a/Source/TestSuite/GX/Makefile +++ /dev/null @@ -1,131 +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 - -#--------------------------------------------------------------------------------- -# 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/GX/source/dolphintest_gx.cpp b/Source/TestSuite/GX/source/dolphintest_gx.cpp deleted file mode 100644 index 8901e583e2..0000000000 --- a/Source/TestSuite/GX/source/dolphintest_gx.cpp +++ /dev/null @@ -1,316 +0,0 @@ -/*--------------------------------------------------------------------------------- -a simple rotating cube demo by tkcne ----------------------------------------------------------------------------------*/ -#include -#include -#include -#include -#include -#include -#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, // 3 - 15, -15, -15, // 4 - 15, -15, 15, // 5 - -15, -15, 15, // 6 - -15, -15, -15, // 7 -}; - -//--------------------------------------------------------------------------------- -// color data -//--------------------------------------------------------------------------------- -u8 colors[] ATTRIBUTE_ALIGN(32) = { - // r, g, b, a - 100, 10, 100, 255, // 0 purple - 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 -}; - -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; -} - -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 ){ -//--------------------------------------------------------------------------------- - f32 yscale; - u32 xfbHeight; - u32 colour1; - Mtx v,p; // view and perspective matrices - int CP = 0; - GXColor background = {0, 0, 0, 0xff}; - 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)); - - VIDEO_Configure(rmode); - VIDEO_SetNextFramebuffer(xfb[curr_fb]); - if(!first_frame) VIDEO_SetBlack(FALSE); - VIDEO_Flush(); - 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); - xfbHeight = GX_SetDispCopyYScale(yscale); - GX_SetScissor(0,0,rmode->fbWidth,rmode->efbHeight); - GX_SetDispCopySrc(0,0,rmode->fbWidth,rmode->efbHeight); - 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}; - 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; - 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; - GX_SetFogRangeAdj(GX_ENABLE, 255, &bum); - // setup vertexes - draw_init(); - - colour1 = CvtRGB (0xff, 0xff, 0xff, 0xff, 0xff, 0xff); - // main loop - while(1) { - - PAD_ScanPads(); - - if (PAD_ButtonsDown(0) & PAD_BUTTON_START) { - void (*reload)() = (void(*)())0x90000020; - reload(); - } - - // do this before drawing - GX_SetViewport(0,0,rmode->fbWidth,rmode->efbHeight,0,1); - GX_InvVtxCache(); - 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 ***/ - 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 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() { -//--------------------------------------------------------------------------------- - // setup the vertex descriptor - // tells the flipper to expect 8bit indexes for position - // and color data. could also be set to direct. - 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 - // so for ex. in the first call we are sending position data with - // 3 values X,Y,Z of size S16. scale sets the number of fractional - // 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); - GX_SetNumTexGens(0); - 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 -//--------------------------------------------------------------------------------- -void draw_quad(u8 v0, u8 v1, u8 v2, u8 v3, u8 c) { -//--------------------------------------------------------------------------------- - // one 8bit position idx - GX_Position1x8(v0); - // one 8bit color idx - GX_Color1x8(c); - GX_Position1x8(v1); - GX_Color1x8(c); - GX_Position1x8(v2); - GX_Color1x8(c); - GX_Position1x8(v3); - GX_Color1x8(c); -} - - -//--------------------------------------------------------------------------------- -void draw_cube(Mtx v) { -//--------------------------------------------------------------------------------- - Mtx m; // model matrix. - 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); - guMtxTransApply(m, m, -100.0F, -60.0F, -200.0F); - 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); - - GX_End(); -} diff --git a/Source/TestSuite/Makefile b/Source/TestSuite/Makefile deleted file mode 100644 index bc3a2943fc..0000000000 --- a/Source/TestSuite/Makefile +++ /dev/null @@ -1,7 +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/PAD/Makefile b/Source/TestSuite/PAD/Makefile deleted file mode 100644 index 0d4af23a0b..0000000000 --- a/Source/TestSuite/PAD/Makefile +++ /dev/null @@ -1,131 +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 - -#--------------------------------------------------------------------------------- -# 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/PAD/PAD.vcxproj b/Source/TestSuite/PAD/PAD.vcxproj deleted file mode 100644 index 49defb759c..0000000000 --- a/Source/TestSuite/PAD/PAD.vcxproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Release - Win32 - - - - {D58C9AD5-7200-488A-B1E8-9250E64CDD45} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_pad.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/PAD/source/dolphintest_pad.cpp b/Source/TestSuite/PAD/source/dolphintest_pad.cpp deleted file mode 100644 index 1643206b3b..0000000000 --- a/Source/TestSuite/PAD/source/dolphintest_pad.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include -#include - - -static void* xfb = NULL; - -u32 first_frame = 1; -GXRModeObj *rmode; -vu16 oldstate; -vu16 keystate; -vu16 keydown; -vu16 keyup; -PADStatus pad[4]; - -void Initialise(); - - -int main() -{ - Initialise(); - - while(1) - { - VIDEO_WaitVSync(); - - console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - PAD_Read(pad); - - for(int a = 0; a < 4;a ++) - { - if(pad[a].err & PAD_ERR_NO_CONTROLLER) - { - std::cout<<"pad["<fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - // Set up the video registers with the chosen mode - VIDEO_Configure(rmode); - - // Tell the video hardware where our display memory is - VIDEO_SetNextFramebuffer(xfb); - - // Make the display visible - VIDEO_SetBlack(FALSE); - - // Flush the video register changes to the hardware - VIDEO_Flush(); - - // Wait for Video setup to complete - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); -} diff --git a/Source/TestSuite/RTC/Makefile b/Source/TestSuite/RTC/Makefile deleted file mode 100644 index fbdb823cad..0000000000 --- a/Source/TestSuite/RTC/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/RTC/RTC.vcxproj b/Source/TestSuite/RTC/RTC.vcxproj deleted file mode 100644 index c9419371a0..0000000000 --- a/Source/TestSuite/RTC/RTC.vcxproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Release - Win32 - - - - {62989D24-DB3F-4BD1-A11D-26F0487CD9AF} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_rtc.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/RTC/source/dolphintest_rtc.cpp b/Source/TestSuite/RTC/source/dolphintest_rtc.cpp deleted file mode 100644 index bcab3588af..0000000000 --- a/Source/TestSuite/RTC/source/dolphintest_rtc.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -static void *xfb = NULL; - -u32 first_frame = 1; -GXRModeObj *rmode; - -void Initialise(); - - -int main() -{ - Initialise(); - - time_t gc_time; - gc_time = time(NULL); - - srand(gc_time); - - while(1) - { - gc_time = time(NULL); - std::cout<<"\x1b[10;0HGC RTC time is"<fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - // Set up the video registers with the chosen mode - VIDEO_Configure(rmode); - - // Tell the video hardware where our display memory is - VIDEO_SetNextFramebuffer(xfb); - - // Make the display visible - VIDEO_SetBlack(FALSE); - - // Flush the video register changes to the hardware - VIDEO_Flush(); - - // Wait for Video setup to complete - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); -} diff --git a/Source/TestSuite/SI/Makefile b/Source/TestSuite/SI/Makefile deleted file mode 100644 index dab00344c8..0000000000 --- a/Source/TestSuite/SI/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)/wii_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 := -lfat -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.vcxproj b/Source/TestSuite/SI/SI.vcxproj deleted file mode 100644 index 2a7b6142d7..0000000000 --- a/Source/TestSuite/SI/SI.vcxproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Release - Win32 - - - - {87F20A25-A3F8-46A3-AC32-3C16782494B1} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_si.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/SI/source/dolphintest_si.cpp b/Source/TestSuite/SI/source/dolphintest_si.cpp deleted file mode 100644 index f20cab8976..0000000000 --- a/Source/TestSuite/SI/source/dolphintest_si.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HW_RVL -#include -#include -#endif - -static void *xfb; -static GXRModeObj *rmode; - -void Initialise(); -void (*reboot)() = (void(*)())0x80001800; -static u32* const SI_REG = (u32*)0xCD006400; -static bool haveInit = false; -static int counter = 0; -static bool logWritten = false; - -void AppendSDLog() -{ -#ifdef HW_RVL - FILE *f = fopen("sd:/si_log.txt", "a"); - if (f) - { - fprintf(f, "\n-------------------------------------\n"); - for (int i = 0; i < 4; i++) - fprintf(f, "%i\tstatus: %x\t type:%x\n", i, SI_GetStatus(i), SI_GetType(i)); - u32 x = 0; - fprintf(f, "-------------------------------------\n"); - fprintf(f, "SI_CHANNEL_0_OUT\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_0_IN_HI\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_0_IN_LO\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_1_OUT\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_1_IN_HI\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_1_IN_LO\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_2_OUT\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_2_IN_HI\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_2_IN_LO\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_3_OUT\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_3_IN_HI\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_CHANNEL_3_IN_LO\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_POLL\t\t\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_COM_CSR\t\t\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_STATUS_REG\t\t%08x\n", SI_REG[x++]); - fprintf(f, "SI_EXI_CLOCK_COUNT\t%08x\n", SI_REG[x++]); - fprintf(f, "-------------------------------------\n"); - fclose(f); - } -#endif -} - -int main(int argc, char **argv) -{ - Initialise(); - - while(1) { - if (haveInit) PAD_ScanPads(); - - VIDEO_ClearFrameBuffer(rmode, xfb, COLOR_BLACK); - - printf("\x1b[4;0H"); - - for(int Chan = 0; Chan < 4; Chan++) - printf("%i\tstatus: %x\t type:%x\n", Chan, SI_GetStatus(Chan), SI_GetType(Chan)); - - printf("SI Regs: (cc006000)\n"); - for (u32 i = 0; i < 16/*num SI regs*/; ++i) - { - printf("%08x ", SI_REG[i]); - if ((i+1)%8==0) printf("\n"); - } - - if (haveInit) - printf("\nPAD_Init\n"); - - VIDEO_WaitVSync(); - - if (haveInit) - { - if (PAD_ButtonsDown(0) & PAD_BUTTON_START) - { - AppendSDLog(); - #ifdef HW_RVL - fatUnmount("sd"); - __io_wiisd.shutdown(); - #endif - reboot(); - } - } - - counter++; - AppendSDLog(); - if (counter > 5 && !haveInit) - { - PAD_Init(); - haveInit = true; - } - else if (haveInit && !logWritten) - { - logWritten = true; - } - } - - return 0; -} - -void Initialise() -{ - // Initialise the video system - VIDEO_Init(); - - // Obtain the preferred video mode from the system - // This will correspond to the settings in the Wii menu - rmode = VIDEO_GetPreferredMode(NULL); - - // Allocate memory for the display in the uncached region - xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - - // Initialise the console, required for printf - console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - // Set up the video registers with the chosen mode - VIDEO_Configure(rmode); - - // Tell the video hardware where our display memory is - VIDEO_SetNextFramebuffer(xfb); - - // Make the display visible - VIDEO_SetBlack(FALSE); - - // Flush the video register changes to the hardware - VIDEO_Flush(); - - // Wait for Video setup to complete - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); - -#ifdef HW_RVL - // Initialize FAT so we can write to SD. - __io_wiisd.startup(); - fatMountSimple("sd", &__io_wiisd); -#endif -} diff --git a/Source/TestSuite/TestSuite.sln b/Source/TestSuite/TestSuite.sln deleted file mode 100644 index f5463a38d6..0000000000 --- a/Source/TestSuite/TestSuite.sln +++ /dev/null @@ -1,91 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{057B2E90-B8A7-431E-9FA2-68AC8ABABCC5}" - ProjectSection(SolutionItems) = preProject - Makefile = Makefile - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GX", "GX\GX.vcxproj", "{F45E42B2-939B-4F02-954B-E68251FD4CCF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SI", "SI\SI.vcxproj", "{87F20A25-A3F8-46A3-AC32-3C16782494B1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTC", "RTC\RTC.vcxproj", "{62989D24-DB3F-4BD1-A11D-26F0487CD9AF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PAD", "PAD\PAD.vcxproj", "{D58C9AD5-7200-488A-B1E8-9250E64CDD45}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXI", "EXI\EXI.vcxproj", "{AA230C1A-42F2-4BDC-9EB8-4AA6DF587E69}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AX", "AX\AX.vcxproj", "{9F053346-A33D-4E4F-874E-CBA1AF809FC3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ARAM", "ARAM\ARAM.vcxproj", "{E50732C5-038A-42F7-8C95-8C02A4E2ADA6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WPAD", "WPAD\WPAD.vcxproj", "{BB88F4D5-EB0D-4429-94C3-93B0191BD3DD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WRTC", "WRTC\WRTC.vcxproj", "{F75021E3-73BF-425C-BA57-3FE7E2F6E02C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WSD", "WSD\WSD.vcxproj", "{F250A358-225C-4B50-ABAE-5B3D4EC9DC4E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FPU", "FPU\FPU.vcxproj", "{18373B64-BCAB-4677-A070-7AD45D4C8304}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASM", "ASM\ASM.vcxproj", "{B0723635-279A-44E0-80A6-FC21DBB7A4B4}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F45E42B2-939B-4F02-954B-E68251FD4CCF}.Debug|Win32.ActiveCfg = Release|Win32 - {F45E42B2-939B-4F02-954B-E68251FD4CCF}.Debug|Win32.Build.0 = Release|Win32 - {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}.Debug|Win32.ActiveCfg = Release|Win32 - {87F20A25-A3F8-46A3-AC32-3C16782494B1}.Debug|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}.Debug|Win32.ActiveCfg = Release|Win32 - {62989D24-DB3F-4BD1-A11D-26F0487CD9AF}.Debug|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}.Debug|Win32.ActiveCfg = Release|Win32 - {D58C9AD5-7200-488A-B1E8-9250E64CDD45}.Debug|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}.Debug|Win32.ActiveCfg = Debug|Win32 - {AA230C1A-42F2-4BDC-9EB8-4AA6DF587E69}.Debug|Win32.Build.0 = Debug|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}.Debug|Win32.ActiveCfg = Release|Win32 - {9F053346-A33D-4E4F-874E-CBA1AF809FC3}.Debug|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}.Debug|Win32.ActiveCfg = Release|Win32 - {E50732C5-038A-42F7-8C95-8C02A4E2ADA6}.Debug|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 - {BB88F4D5-EB0D-4429-94C3-93B0191BD3DD}.Debug|Win32.ActiveCfg = Release|Win32 - {BB88F4D5-EB0D-4429-94C3-93B0191BD3DD}.Debug|Win32.Build.0 = Release|Win32 - {BB88F4D5-EB0D-4429-94C3-93B0191BD3DD}.Release|Win32.ActiveCfg = Release|Win32 - {BB88F4D5-EB0D-4429-94C3-93B0191BD3DD}.Release|Win32.Build.0 = Release|Win32 - {F75021E3-73BF-425C-BA57-3FE7E2F6E02C}.Debug|Win32.ActiveCfg = Release|Win32 - {F75021E3-73BF-425C-BA57-3FE7E2F6E02C}.Debug|Win32.Build.0 = Release|Win32 - {F75021E3-73BF-425C-BA57-3FE7E2F6E02C}.Release|Win32.ActiveCfg = Release|Win32 - {F75021E3-73BF-425C-BA57-3FE7E2F6E02C}.Release|Win32.Build.0 = Release|Win32 - {F250A358-225C-4B50-ABAE-5B3D4EC9DC4E}.Debug|Win32.ActiveCfg = Release|Win32 - {F250A358-225C-4B50-ABAE-5B3D4EC9DC4E}.Debug|Win32.Build.0 = Release|Win32 - {F250A358-225C-4B50-ABAE-5B3D4EC9DC4E}.Release|Win32.ActiveCfg = Release|Win32 - {F250A358-225C-4B50-ABAE-5B3D4EC9DC4E}.Release|Win32.Build.0 = Release|Win32 - {18373B64-BCAB-4677-A070-7AD45D4C8304}.Debug|Win32.ActiveCfg = Debug|Win32 - {18373B64-BCAB-4677-A070-7AD45D4C8304}.Debug|Win32.Build.0 = Debug|Win32 - {18373B64-BCAB-4677-A070-7AD45D4C8304}.Release|Win32.ActiveCfg = Release|Win32 - {18373B64-BCAB-4677-A070-7AD45D4C8304}.Release|Win32.Build.0 = Release|Win32 - {B0723635-279A-44E0-80A6-FC21DBB7A4B4}.Debug|Win32.ActiveCfg = Release|Win32 - {B0723635-279A-44E0-80A6-FC21DBB7A4B4}.Debug|Win32.Build.0 = Release|Win32 - {B0723635-279A-44E0-80A6-FC21DBB7A4B4}.Release|Win32.ActiveCfg = Release|Win32 - {B0723635-279A-44E0-80A6-FC21DBB7A4B4}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Source/TestSuite/WPAD/Makefile b/Source/TestSuite/WPAD/Makefile deleted file mode 100644 index 0f42da56db..0000000000 --- a/Source/TestSuite/WPAD/Makefile +++ /dev/null @@ -1,135 +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)/wii_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 := -lwiiuse -lbte -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), -iquote $(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 - -#--------------------------------------------------------------------------------- -run: - wiiload $(TARGET).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/WPAD/WPAD.vcxproj b/Source/TestSuite/WPAD/WPAD.vcxproj deleted file mode 100644 index f93a7c88a4..0000000000 --- a/Source/TestSuite/WPAD/WPAD.vcxproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Release - Win32 - - - - {BB88F4D5-EB0D-4429-94C3-93B0191BD3DD} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_wpad.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/WPAD/source/dolphintest_wpad.cpp b/Source/TestSuite/WPAD/source/dolphintest_wpad.cpp deleted file mode 100644 index 88d4472ebb..0000000000 --- a/Source/TestSuite/WPAD/source/dolphintest_wpad.cpp +++ /dev/null @@ -1,216 +0,0 @@ -// This file is from wiibrew.org: http://wiibrew.org/wiki/How_to_use_the_Wiimote - -//code by WinterMute -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static GXRModeObj *rmode = NULL; - -//----------------------------------------------------------------------------------- -//doreload - a flag that tells the program to quit looping and exit the program to the HBChannel. -//dooff - a flag that tells the program to quit looping and properly shutdown the system. -int doreload=0, dooff=0; - -//Calling the function will end the while loop and properly exit the program to the HBChannel. -void reload(void) { - doreload=1; -} - -//Calling the function will end the while loop and properly shutdown the system. -// QUESTION: why calling the shutdown function direcly here halts the console? -void shutdown(void) { - dooff=1; -} - -//Draw a square on the screen (May draw rectangles as well, I am uncertain). -//*xfb - framebuffer -//*rmode - !unsure! -//w - Width of screen (Used as scale factor in converting fx to pixel coordinates) -//h - Height of screen (Used as scale factor in converting fy to pixel coordinates) -//fx - X coordinate to draw on the screen (0-w) -//fy - Y coordinate to draw on the screen (!unsure!-h) -//color - the color of the rectangle (Examples: COLOR_YELLOW, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_BLACK, COLOR_WHITE) -void drawdot(void *xfb, GXRModeObj *rmode, float w, float h, float fx, float fy, u32 color) { - - //*fb - !unsure! - //px - !unsure! - //py - !unsure! - //x - !unsure! - //y - !unsure! - - u32 *fb; - int px,py; - int x,y; - - - fb = (u32*)xfb; - - y = fy * rmode->xfbHeight / h; - x = fx * rmode->fbWidth / w / 2; - - for(py=y-4; py<=(y+4); py++) { - if(py < 0 || py >= rmode->xfbHeight) - continue; - for(px=x-2; px<=(x+2); px++) { - if(px < 0 || px >= rmode->fbWidth/2) - continue; - fb[rmode->fbWidth/VI_DISPLAY_PIX_SZ*py + px] = color; - } - } - -} - -int evctr = 0; -void countevs(int chan, const WPADData *data) { - evctr++; -} - -void print_wiimote_connection_status(int wiimote_connection_status) { - switch(wiimote_connection_status) { - case WPAD_ERR_NO_CONTROLLER: - std::cout<<" Wiimote not connected\n"; - break; - case WPAD_ERR_NOT_READY: - std::cout<<" Wiimote not ready\n"; - break; - case WPAD_ERR_NONE: - std::cout<<" Wiimote ready\n"; - break; - default: - std::cout<<" Unknown Wimote state "<btns_h & WPAD_BUTTON_A) std::cout<<"A "; - if(wd->btns_h & WPAD_BUTTON_B) std::cout<<"B "; - if(wd->btns_h & WPAD_BUTTON_1) std::cout<<"1 "; - if(wd->btns_h & WPAD_BUTTON_2) std::cout<<"2 "; - if(wd->btns_h & WPAD_BUTTON_MINUS) std::cout<<"MINUS "; - if(wd->btns_h & WPAD_BUTTON_HOME) std::cout<<"HOME "; - if(wd->btns_h & WPAD_BUTTON_PLUS) std::cout<<"PLUS "; - std::cout<<"\n "; - if(wd->btns_h & WPAD_BUTTON_LEFT) std::cout<<"LEFT "; - if(wd->btns_h & WPAD_BUTTON_RIGHT) std::cout<<"RIGHT "; - if(wd->btns_h & WPAD_BUTTON_UP) std::cout<<"UP "; - if(wd->btns_h & WPAD_BUTTON_DOWN) std::cout<<"DOWN "; - std::cout<<"\n"; -} - -void print_and_draw_wiimote_data(void *screen_buffer) { - //Makes the var wd point to the data on the wiimote - WPADData *wd = WPAD_Data(0); - std::cout<<" Data->Err: "<err<<"\n"; - std::cout<<" IR Dots:\n"; - int i; - for(i=0; i<4; i++) { - if(wd->ir.dot[i].visible) { - std::cout<<" "<ir.dot[i].rx<<", "<ir.dot[i].ry<<"\n"; - drawdot(screen_buffer, rmode, 1024, 768, wd->ir.dot[i].rx, wd->ir.dot[i].ry, COLOR_YELLOW); - } else { - std::cout<<" None\n"; - } - } - //ir.valid - TRUE is the wiimote is pointing at the screen, else it is false - if(wd->ir.valid) { - float theta = wd->ir.angle / 180.0 * M_PI; - - //ir.x/ir.y - The x/y coordinates that the wiimote is pointing to, relative to the screen. - //ir.angle - how far (in degrees) the wiimote is twisted (based on ir) - std::cout<<" Cursor: "<ir.x<<","<ir.y<<"\n"; - std::cout<<" @ "<ir.angle<<" deg\n"; - - drawdot(screen_buffer, rmode, rmode->fbWidth, rmode->xfbHeight, wd->ir.x, wd->ir.y, COLOR_RED); - drawdot(screen_buffer, rmode, rmode->fbWidth, rmode->xfbHeight, wd->ir.x + 10*sinf(theta), wd->ir.y - 10*cosf(theta), COLOR_BLUE); - } else { - std::cout<<" No Cursor\n\n"; - } - if(wd->ir.raw_valid) { - //ir.z - How far away the wiimote is from the screen in meters - std::cout<<" Distance: "<ir.z<<"m\n"; - //orient.yaw - The left/right angle of the wiimote to the screen - std::cout<<" Yaw: "<orient.yaw<<" deg\n"; - } else { - std::cout<<"\n\n"; - } - std::cout<<" Accel:\n"; - //accel.x/accel.y/accel.z - analog values for the accelleration of the wiimote - //(Note: Gravity pulls downwards, so even if the wiimote is not moving, - //one(or more) axis will have a reading as if it is moving "upwards") - std::cout<<" XYZ: "<accel.x<<","<accel.y<<","<accel.z<<"\n"; - //orient.pitch - how far the wiimote is "tilted" in degrees - std::cout<<" Pitch: "<orient.pitch<<"\n"; - //orient.roll - how far the wiimote is "twisted" in degrees (uses accelerometer) - std::cout<<" Roll: "<orient.roll<<"\n"; - - print_wiimote_buttons(wd); - - if(wd->ir.raw_valid) { - for(i=0; i<2; i++) { - drawdot(screen_buffer, rmode, 4, 4, wd->ir.sensorbar.rot_dots[i].x+2, wd->ir.sensorbar.rot_dots[i].y+2, COLOR_GREEN); - } - } - - if(wd->btns_h & WPAD_BUTTON_1) doreload=1; -} - -int main(int argc, char **argv) { - void *xfb[2]; - u32 type; - int fbi = 0; - - VIDEO_Init(); - PAD_Init(); - WPAD_Init(); - - rmode = VIDEO_GetPreferredMode(NULL); - - // double buffering, prevents flickering (is it needed for LCD TV? i don't have one to test) - xfb[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - xfb[1] = 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(); - - SYS_SetResetCallback(reload); - SYS_SetPowerCallback(shutdown); - - WPAD_SetDataFormat(0, WPAD_FMT_BTNS_ACC_IR); - WPAD_SetVRes(0, rmode->fbWidth, rmode->xfbHeight); - - while(!doreload && !dooff) { - CON_Init(xfb[fbi],0,0,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - //VIDEO_ClearFrameBuffer(rmode,xfb[fbi],COLOR_BLACK); - std::cout<<"\n\n\n"; - WPAD_ReadPending(WPAD_CHAN_ALL, countevs); - int wiimote_connection_status = WPAD_Probe(0, &type); - print_wiimote_connection_status(wiimote_connection_status); - - std::cout<<" Event count: "<devkitPPC") -endif - -include $(DEVKITPPC)/wii_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 := -lwiiuse -lbte -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), -iquote $(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 - -#--------------------------------------------------------------------------------- -run: - wiiload $(TARGET).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/WRTC/WRTC.vcxproj b/Source/TestSuite/WRTC/WRTC.vcxproj deleted file mode 100644 index 25c7c5fd88..0000000000 --- a/Source/TestSuite/WRTC/WRTC.vcxproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Release - Win32 - - - - {F75021E3-73BF-425C-BA57-3FE7E2F6E02C} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_wrtc.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/WRTC/source/dolphintest_wrtc.cpp b/Source/TestSuite/WRTC/source/dolphintest_wrtc.cpp deleted file mode 100644 index fa70d8dc62..0000000000 --- a/Source/TestSuite/WRTC/source/dolphintest_wrtc.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static void *xfb = NULL; - -u32 first_frame = 1; -GXRModeObj *rmode; - -inline void Initialise() -{ - // Initialise the video system - VIDEO_Init(); - - // This function initialises the attached controllers - PAD_Init(); - - // Obtain the preferred video mode from the system - // This will correspond to the settings in the Wii menu - rmode = VIDEO_GetPreferredMode(NULL); - - // Allocate memory for the display in the uncached region - xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - - // Initialise the console, required for printf - console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - - // Set up the video registers with the chosen mode - VIDEO_Configure(rmode); - - // Tell the video hardware where our display memory is - VIDEO_SetNextFramebuffer(xfb); - - // Make the display visible - VIDEO_SetBlack(FALSE); - - // Flush the video register changes to the hardware - VIDEO_Flush(); - - // Wait for Video setup to complete - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); -} - -int main() -{ - Initialise(); - - time_t wii_time; -//settime(secs_to_ticks(time(NULL) - 0x386D4380)); - wii_time = time(NULL); - - std::cout << "\x1b[20;0HWii RTC time is " <devkitPPC") -endif - -include $(DEVKITPPC)/wii_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 := -lwiiuse -lbte -lfat -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), -iquote $(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 - -#--------------------------------------------------------------------------------- -run: - wiiload $(TARGET).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/WSD/WSD.vcxproj b/Source/TestSuite/WSD/WSD.vcxproj deleted file mode 100644 index fd6ac77943..0000000000 --- a/Source/TestSuite/WSD/WSD.vcxproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Release - Win32 - - - - {F250A358-225C-4B50-ABAE-5B3D4EC9DC4E} - TestSuite - MakeFileProj - - - - Makefile - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - build\ - build\ - make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean && make -r 2>&1 | sed -e %27s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’ - make clean - dolphintest_wrtc.dol - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(ProjectDir)\include;C:\devkitPro\libogc\include;$(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - build\BuildLog.htm - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/TestSuite/WSD/source/dolphintest_wsd.cpp b/Source/TestSuite/WSD/source/dolphintest_wsd.cpp deleted file mode 100644 index 52fbe4bbf8..0000000000 --- a/Source/TestSuite/WSD/source/dolphintest_wsd.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// SD card insertion/removal callback demo - -#include -#include -#include -#include -#include -#include - - -#define IOCTL_SDIO_SENDCMD 0x07 - -#define SDIO_CMD_REGINTR 0x40 -#define SDIO_CMD_UNREGINTR 0x41 - -#define SD_INSERT_EVENT 0x01 -#define SD_REMOVE_EVENT 0x02 - -static struct _sdiorequest -{ - u32 cmd; - u32 cmd_type; - u32 rsp_type; - u32 arg; - u32 blk_cnt; - u32 blk_size; - void *dma_addr; - u32 isdma; - u32 pad0; -} sd_req; - -static struct _sdioresponse -{ - u32 rsp_fields[3]; - u32 acmd12_response; -} sd_resp; - -static s32 __sd0_fd = -1; -static const char _sd0_fs[] ATTRIBUTE_ALIGN(32) = "/dev/sdio/slot0"; - -static s32 __sdio_getinterrupt(u32 hook, ipccallback cb) -{ - memset(&sd_req, 0, sizeof(sd_req)); - - sd_req.cmd = SDIO_CMD_REGINTR; - sd_req.arg = hook; - - if (hook==SD_INSERT_EVENT) - printf("Requesting insert event %p %p\n", cb, &sd_resp); - else if (hook==SD_REMOVE_EVENT) - printf("Requesting removal event %p %p\n", cb, &sd_resp); - else - printf("I don't know what I'm requesting here: hook=%u\n", hook); - - if (__sd0_fd<0) - __sd0_fd = IOS_Open(_sd0_fs,1); - - if (__sd0_fd>=0) - return IOS_IoctlAsync(__sd0_fd,IOCTL_SDIO_SENDCMD,&sd_req,sizeof(sd_req),&sd_resp,sizeof(sd_resp),cb,NULL); - - // else return the IOS_Open error code - return __sd0_fd; -} - -static s32 __sdio_releaseinterrupt(void) -{ - if (__sd0_fd<0) - return 0; - - // this command makes the IOS_IoctlAsync call above return a response immediately - - // sd_req.arg is already set to the right value (1 or 2, whatever was used last) - sd_req.cmd = SDIO_CMD_UNREGINTR; - return IOS_Ioctl(__sd0_fd,IOCTL_SDIO_SENDCMD,&sd_req,sizeof(sd_req),&sd_resp,sizeof(sd_resp)); -} - -static void sd_cb(u32 ret, void* unused) -{ - printf("Got an SD interrupt, ret = %08X\n", ret); - printf("Response data: %08X %08X %08X %08X\n", sd_resp.rsp_fields[0], sd_resp.rsp_fields[1], sd_resp.rsp_fields[2], sd_resp.acmd12_response); - - if (ret==SD_INSERT_EVENT) - { - printf("SD card was inserted\n"); - // tell us when it gets removed - __sdio_getinterrupt(SD_REMOVE_EVENT, (ipccallback)sd_cb); - } - else if (ret==SD_REMOVE_EVENT) - { - printf("SD card was removed\n"); - // tell us when something is inserted - __sdio_getinterrupt(SD_INSERT_EVENT, (ipccallback)sd_cb); - } - else - printf("Unknown SD int: %08X\n", ret); -} - - - -static void *xfb = NULL; -static GXRModeObj *rmode = NULL; - -int main(int argc, char **argv) { - VIDEO_Init(); - WPAD_Init(); - rmode = VIDEO_GetPreferredMode(NULL); - xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); - console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); - VIDEO_Configure(rmode); - VIDEO_SetNextFramebuffer(xfb); - VIDEO_SetBlack(FALSE); - VIDEO_Flush(); - VIDEO_WaitVSync(); - if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); - - printf("\x1b[2;0H"); - printf("SD Card insertion/removal demo\n"); - printf("Press HOME at any time to exit\n"); - - __sdio_getinterrupt(SD_INSERT_EVENT, (ipccallback)sd_cb); - - while(1) { - WPAD_ScanPads(); - u32 pressed = WPAD_ButtonsDown(0); - if ( pressed & WPAD_BUTTON_HOME ) break; - VIDEO_WaitVSync(); - } - - printf("SD event release returned %d\n", __sdio_releaseinterrupt()); - IOS_Close(__sd0_fd); - - sleep(4); - - return 0; -} diff --git a/Source/TestSuite/d.supp b/Source/TestSuite/d.supp deleted file mode 100644 index ce6909e7ca..0000000000 --- a/Source/TestSuite/d.supp +++ /dev/null @@ -1,136 +0,0 @@ -{ - - Memcheck:Addr8 - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:* -} -{ - - Memcheck:Addr8 - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libdl-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libdl-2.7.so - fun:dlopen - fun:g_module_open - obj:/usr/lib/libgtk-x11-2.0.so.0.1200.9 - fun:g_type_module_use - fun:gtk_theme_engine_get -} -{ - - Memcheck:Addr8 - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libdl-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libdl-2.7.so - fun:dlopen - fun:g_module_open - obj:/usr/lib/libgtk-x11-2.0.so.0.1200.9 -} -{ - - Memcheck:Addr8 - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libdl-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libdl-2.7.so - fun:dlopen - fun:g_module_open -} -{ - - Memcheck:Addr8 - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libc-2.7.so - obj:/lib/libdl-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libdl-2.7.so - fun:dlsym - fun:g_module_symbol - fun:g_module_open - obj:/usr/lib/libgtk-x11-2.0.so.0.1200.9 -} -{ - - Memcheck:Addr8 - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/ld-2.7.so - obj:/lib/libc-2.7.so - obj:/lib/ld-2.7.so - fun:__libc_dlopen_mode - obj:/lib/libc-2.7.so - obj:/lib/libc-2.7.so - obj:/lib/libc-2.7.so - obj:/lib/libc-2.7.so - obj:/lib/libc-2.7.so -} -{ - - Memcheck:Cond - fun:snd_pcm_direct_shm_create_or_connect - fun:snd_pcm_dmix_open - fun:_snd_pcm_dmix_open - obj:/usr/lib/libasound.so.2.0.0 - obj:/usr/lib/libasound.so.2.0.0 - fun:snd_pcm_open_named_slave - fun:_snd_pcm_softvol_open - obj:/usr/lib/libasound.so.2.0.0 - fun:snd_pcm_open_named_slave - fun:_snd_pcm_plug_open - obj:/usr/lib/libasound.so.2.0.0 - fun:snd_pcm_open_named_slave -} -{ - - Memcheck:Cond - obj:/usr/lib/libGLcore.so.169.12 - obj:/usr/lib/libGLcore.so.169.12 - fun:* -} -{ - - Memcheck:Cond - obj:/usr/lib/libasound.so.2.0.0 - obj:/usr/lib/libasound.so.2.0.0 -} -{ - - Memcheck:Addr8 - fun:snd_pcm_poll_descriptors_revents - fun:snd_pcm_wait_nocheck - fun:snd_pcm_write_areas - obj:/usr/lib/libasound.so.2.0.0 - obj:* -} -{ - - Memcheck:Addr8 - obj:/usr/lib/libasound.so.2.0.0 - fun:snd_pcm_wait_nocheck - fun:snd_pcm_write_areas - obj:/usr/lib/libasound.so.2.0.0 - obj:* -} - diff --git a/Source/TestSuite/grind.sh b/Source/TestSuite/grind.sh deleted file mode 100644 index 1224e52835..0000000000 --- a/Source/TestSuite/grind.sh +++ /dev/null @@ -1,2 +0,0 @@ -valgrind --gen-suppressions=yes --suppressions=d.supp ./Dolphin $1 $2 $3 - diff --git a/Source/UnitTests/AudioJitTests.cpp b/Source/UnitTests/AudioJitTests.cpp deleted file mode 100644 index f078e8541b..0000000000 --- a/Source/UnitTests/AudioJitTests.cpp +++ /dev/null @@ -1,348 +0,0 @@ -#include "DSPJitTester.h" - -void nx_dr() -{ - DSPJitTester tester(0x8000, 0x0004); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.TestAll(); - tester.Report(); -} - -void nx_ir() -{ - DSPJitTester tester(0x8000, 0x0008); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.TestAll(); - tester.Report(); -} - -void nx_nr() -{ - DSPJitTester tester(0x8000, 0x000c); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.AddTestData(DSP_REG_IX0); - tester.TestAll(true); - tester.Report(); -} - -void nx_mv() -{ - DSPJitTester tester(0x8000, 0x0010); - tester.AddTestData(DSP_REG_ACL0); - tester.AddTestData(DSP_REG_AXL0); - tester.TestAll(true); - tester.Report(); -} - -void dar() -{ - DSPJitTester tester(0x0004); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.TestAll(); - tester.Report(); -} -void iar() -{ - DSPJitTester tester(0x0008); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.TestAll(); - tester.Report(); -} -void subarn() -{ - DSPJitTester tester(0x000c); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.AddTestData(DSP_REG_IX0); - tester.TestAll(); - tester.Report(); -} -void addarn() -{ - DSPJitTester tester(0x0010); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.AddTestData(DSP_REG_IX0); - tester.TestAll(); - tester.Report(); -} -void sbclr() -{ - DSPJitTester tester(0x1200); - tester.AddTestData(DSP_REG_SR); - tester.TestAll(); - tester.Report(); -} -void sbset() -{ - DSPJitTester tester(0x1300); - tester.AddTestData(DSP_REG_SR); - tester.TestAll(); - tester.Report(); -} - -void nx_s() -{ - DSPJitTester tester(0x8000, 0x0020); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.AddTestData(DSP_REG_ACL0); - tester.TestAll(true); - tester.Report(); -} - -void nx_sn() -{ - DSPJitTester tester(0x8000, 0x0024); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.AddTestData(DSP_REG_IX0); - tester.AddTestData(DSP_REG_ACL0); - tester.TestAll(true); - tester.Report(); -} - -void nx_l() -{ - - DSPJitTester tester(0x8000, 0x0040); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.AddTestData(DSP_REG_AXL0); - tester.TestAll(true); - tester.Report(); -} - -void set16_l() -{ - - DSPJitTester tester(0x8e00, 0x0070); - tester.AddTestData(DSP_REG_SR, 0); - tester.AddTestData(DSP_REG_SR, SR_40_MODE_BIT); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.AddTestData(DSP_REG_ACM0); - tester.TestAll(true); - tester.Report(); -} - -void nx_ln() -{ - DSPJitTester tester(0x8000, 0x0044); - tester.AddTestData(DSP_REG_AR0); - tester.AddTestData(DSP_REG_WR0); - tester.AddTestData(DSP_REG_IX0); - tester.AddTestData(DSP_REG_AXL0); - tester.TestAll(true); - tester.Report(); -} - -void nx_ls() -{ - DSPJitTester tester1(0x8000, 0x0080); - tester1.AddTestData(DSP_REG_ACM0); - tester1.AddTestData(DSP_REG_AR0); - tester1.AddTestData(DSP_REG_WR0); - tester1.TestAll(true); - tester1.Report(); - - DSPJitTester tester2(0x8000, 0x0080); - tester2.AddTestData(DSP_REG_ACM0); - tester2.AddTestData(DSP_REG_AR3); - tester2.AddTestData(DSP_REG_WR3); - tester2.TestAll(true); - tester2.Report(); -} - -void nx_lsn() -{ - DSPJitTester tester1(0x8000, 0x0084); - tester1.AddTestData(DSP_REG_ACM0); - tester1.AddTestData(DSP_REG_AR0); - tester1.AddTestData(DSP_REG_WR0); - tester1.AddTestData(DSP_REG_IX0); - tester1.TestAll(true); - tester1.Report(); - - DSPJitTester tester2(0x8000, 0x0084); - tester2.AddTestData(DSP_REG_ACM0); - tester2.AddTestData(DSP_REG_AR3); - tester2.AddTestData(DSP_REG_WR3); - tester2.TestAll(true); - tester2.Report(); -} - -void nx_lsm() -{ - DSPJitTester tester1(0x8000, 0x0088); - tester1.AddTestData(DSP_REG_ACM0); - tester1.AddTestData(DSP_REG_AR0); - tester1.AddTestData(DSP_REG_WR0); - tester1.TestAll(true); - tester1.Report(); - - DSPJitTester tester2(0x8000, 0x0088); - tester2.AddTestData(DSP_REG_ACM0); - tester2.AddTestData(DSP_REG_AR3); - tester2.AddTestData(DSP_REG_WR3); - tester2.AddTestData(DSP_REG_IX3); - tester2.TestAll(true); - tester2.Report(); -} - -void nx_lsnm() -{ - DSPJitTester tester1(0x8000, 0x008c); - tester1.AddTestData(DSP_REG_ACM0); - tester1.AddTestData(DSP_REG_AR0); - tester1.AddTestData(DSP_REG_WR0); - tester1.AddTestData(DSP_REG_IX0); - tester1.TestAll(true); - tester1.Report(); - - DSPJitTester tester2(0x8000, 0x008c); - tester2.AddTestData(DSP_REG_ACM0); - tester2.AddTestData(DSP_REG_AR3); - tester2.AddTestData(DSP_REG_WR3); - tester2.AddTestData(DSP_REG_IX3); - tester2.TestAll(true); - tester2.Report(); -} - -void nx_sl() -{ - DSPJitTester tester1(0x8000, 0x0082); - tester1.AddTestData(DSP_REG_ACM0); - tester1.AddTestData(DSP_REG_AR0); - tester1.AddTestData(DSP_REG_WR0); - tester1.TestAll(true); - tester1.Report(); - - DSPJitTester tester2(0x8000, 0x0082); - tester2.AddTestData(DSP_REG_ACM0); - tester2.AddTestData(DSP_REG_AR3); - tester2.AddTestData(DSP_REG_WR3); - tester2.TestAll(true); - tester2.Report(); -} - -void nx_sln() -{ - DSPJitTester tester1(0x8000, 0x0086); - tester1.AddTestData(DSP_REG_ACM0); - tester1.AddTestData(DSP_REG_AR0); - tester1.AddTestData(DSP_REG_WR0); - tester1.AddTestData(DSP_REG_IX0); - tester1.TestAll(true); - tester1.Report(); - - DSPJitTester tester2(0x8000, 0x0086); - tester2.AddTestData(DSP_REG_ACM0); - tester2.AddTestData(DSP_REG_AR3); - tester2.AddTestData(DSP_REG_WR3); - tester2.TestAll(true); - tester2.Report(); -} - -void nx_slm() -{ - DSPJitTester tester1(0x8000, 0x008a); - tester1.AddTestData(DSP_REG_ACM0); - tester1.AddTestData(DSP_REG_AR0); - tester1.AddTestData(DSP_REG_WR0); - tester1.TestAll(true); - tester1.Report(); - - DSPJitTester tester2(0x8000, 0x008a); - tester2.AddTestData(DSP_REG_ACM0); - tester2.AddTestData(DSP_REG_AR3); - tester2.AddTestData(DSP_REG_WR3); - tester2.AddTestData(DSP_REG_IX3); - tester2.TestAll(true); - tester2.Report(); -} - -void nx_slnm() -{ - DSPJitTester tester1(0x8000, 0x008e); - tester1.AddTestData(DSP_REG_ACM0); - tester1.AddTestData(DSP_REG_AR0); - tester1.AddTestData(DSP_REG_WR0); - tester1.AddTestData(DSP_REG_IX0); - tester1.TestAll(true); - tester1.Report(); - - DSPJitTester tester2(0x8000, 0x008e); - tester2.AddTestData(DSP_REG_ACM0); - tester2.AddTestData(DSP_REG_AR3); - tester2.AddTestData(DSP_REG_WR3); - tester2.AddTestData(DSP_REG_IX3); - tester2.TestAll(true); - tester2.Report(); -} - -void nx_ld() -{ - DSPJitTester tester1(0x8000, 0x00c0); - tester1.AddTestData(DSP_REG_AXL0,0xdead); - tester1.AddTestData(DSP_REG_AXL1,0xbeef); - tester1.AddTestData(DSP_REG_AR0); - tester1.AddTestData(DSP_REG_WR0); - tester1.AddTestData(DSP_REG_IX0); - tester1.TestAll(true); - tester1.Report(); - - DSPJitTester tester2(0x8000, 0x00c0); - tester2.AddTestData(DSP_REG_AXL0,0xdead); - tester2.AddTestData(DSP_REG_AXL1,0xbeef); - tester2.AddTestData(DSP_REG_AR3); - tester2.AddTestData(DSP_REG_WR3); - tester2.AddTestData(DSP_REG_IX3); - tester2.TestAll(true); - tester2.Report(); -} - -void AudioJitTests() -{ - DSPJitTester::Initialize(); - dar(); - iar(); - subarn(); - addarn(); - sbclr(); - sbset(); - - nx_ir(); - nx_dr(); - nx_nr(); - nx_mv(); - - set16_l(); - - nx_s(); - nx_sn(); - nx_l(); - nx_ln(); - nx_ls(); - nx_lsn(); - nx_lsm(); - nx_lsnm(); - nx_sl(); - nx_sln(); - nx_slm(); - nx_slnm(); - nx_ld(); -} - -//required to be able to link against DSPCore -void DSPHost_UpdateDebugger() { } -void DSPHost_CodeLoaded(unsigned const char*, int) { } -void DSPHost_InterruptRequest() { } -bool DSPHost_OnThread() { return false; } -void DSPHost_WriteHostMemory(unsigned char, unsigned int) { } -unsigned char DSPHost_ReadHostMemory(unsigned int) { return 0; } diff --git a/Source/UnitTests/CMakeLists.txt b/Source/UnitTests/CMakeLists.txt deleted file mode 100644 index f86742555e..0000000000 --- a/Source/UnitTests/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set(SRCS AudioJitTests.cpp - DSPJitTester.cpp - UnitTests.cpp) - -add_executable(tester ${SRCS}) -target_link_libraries(tester core) diff --git a/Source/UnitTests/DSPJitTester.cpp b/Source/UnitTests/DSPJitTester.cpp deleted file mode 100644 index a0c37057c5..0000000000 --- a/Source/UnitTests/DSPJitTester.cpp +++ /dev/null @@ -1,310 +0,0 @@ -#include "DSPJitTester.h" - -DSPJitTester::DSPJitTester(u16 opcode, u16 opcode_ext, bool verbose, bool only_failed) - : be_verbose(verbose), failed_only(only_failed), run_count(0), fail_count(0) -{ - instruction = opcode | opcode_ext; - opcode_template = GetOpTemplate(instruction); - sprintf(instruction_name, "%s", opcode_template->name); - if (opcode_template->extended) - sprintf(&instruction_name[strlen(instruction_name)], "'%s", - extOpTable[instruction & (((instruction >> 12) == 0x3) ? 0x7F : 0xFF)]->name); -} -bool DSPJitTester::Test(SDSP dsp_settings) -{ - if (be_verbose && !failed_only) - { - printf("Running %s: ", instruction_name); - DumpRegs(dsp_settings); - } - - last_input_dsp = dsp_settings; - last_int_dsp = RunInterpreter(dsp_settings); - last_jit_dsp = RunJit(dsp_settings); - - run_count++; - bool success = AreEqual(last_int_dsp, last_jit_dsp); - if (!success) - fail_count++; - return success; -} -SDSP DSPJitTester::RunInterpreter(SDSP dsp_settings) -{ - ResetInterpreter(); - memcpy(&g_dsp, &dsp_settings, sizeof(SDSP)); - ExecuteInstruction(instruction); - - return g_dsp; -} -SDSP DSPJitTester::RunJit(SDSP dsp_settings) -{ - ResetJit(); - memcpy(&g_dsp, &dsp_settings, sizeof(SDSP)); - const u8* code = jit.GetCodePtr(); - jit.ABI_PushAllCalleeSavedRegsAndAdjustStack(); - jit.EmitInstruction(instruction); - jit.ABI_PopAllCalleeSavedRegsAndAdjustStack(); - jit.RET(); - ((void(*)())code)(); - - return g_dsp; -} -void DSPJitTester::ResetInterpreter() -{ - for (int i=0; i < WRITEBACKLOGSIZE; i++) - writeBackLogIdx[i] = -1; -} -void DSPJitTester::ResetJit() -{ - jit.ClearCodeSpace(); -} - -static u16 GetRegister(SDSP const &dsp, int reg) { - switch(reg) { - case DSP_REG_AR0: - case DSP_REG_AR1: - case DSP_REG_AR2: - case DSP_REG_AR3: - return dsp.r.ar[reg - DSP_REG_AR0]; - case DSP_REG_IX0: - case DSP_REG_IX1: - case DSP_REG_IX2: - case DSP_REG_IX3: - return dsp.r.ix[reg - DSP_REG_IX0]; - case DSP_REG_WR0: - case DSP_REG_WR1: - case DSP_REG_WR2: - case DSP_REG_WR3: - return dsp.r.wr[reg - DSP_REG_WR0]; - case DSP_REG_ST0: - case DSP_REG_ST1: - case DSP_REG_ST2: - case DSP_REG_ST3: - return dsp.r.st[reg - DSP_REG_ST0]; - case DSP_REG_ACH0: - case DSP_REG_ACH1: - return dsp.r.ac[reg - DSP_REG_ACH0].h; - case DSP_REG_CR: return dsp.r.cr; - case DSP_REG_SR: return dsp.r.sr; - case DSP_REG_PRODL: return dsp.r.prod.l; - case DSP_REG_PRODM: return dsp.r.prod.m; - case DSP_REG_PRODH: return dsp.r.prod.h; - case DSP_REG_PRODM2: return dsp.r.prod.m2; - case DSP_REG_AXL0: - case DSP_REG_AXL1: - return dsp.r.ax[reg - DSP_REG_AXL0].l; - case DSP_REG_AXH0: - case DSP_REG_AXH1: - return dsp.r.ax[reg - DSP_REG_AXH0].h; - case DSP_REG_ACL0: - case DSP_REG_ACL1: - return dsp.r.ac[reg - DSP_REG_ACL0].l; - case DSP_REG_ACM0: - case DSP_REG_ACM1: - return dsp.r.ac[reg - DSP_REG_ACM0].m; - default: - _assert_msg_(DSP_CORE, 0, "cannot happen"); - return 0; - } -} - -static void SetRegister(SDSP &dsp, int reg, u16 val) { - switch(reg) { - case DSP_REG_AR0: - case DSP_REG_AR1: - case DSP_REG_AR2: - case DSP_REG_AR3: - dsp.r.ar[reg - DSP_REG_AR0] = val; break; - case DSP_REG_IX0: - case DSP_REG_IX1: - case DSP_REG_IX2: - case DSP_REG_IX3: - dsp.r.ix[reg - DSP_REG_IX0] = val; break; - case DSP_REG_WR0: - case DSP_REG_WR1: - case DSP_REG_WR2: - case DSP_REG_WR3: - dsp.r.wr[reg - DSP_REG_WR0] = val; break; - case DSP_REG_ST0: - case DSP_REG_ST1: - case DSP_REG_ST2: - case DSP_REG_ST3: - dsp.r.st[reg - DSP_REG_ST0] = val; break; - case DSP_REG_ACH0: - case DSP_REG_ACH1: - dsp.r.ac[reg - DSP_REG_ACH0].h = val; break; - case DSP_REG_CR: dsp.r.cr = val; break; - case DSP_REG_SR: dsp.r.sr = val; break; - case DSP_REG_PRODL: dsp.r.prod.l = val; break; - case DSP_REG_PRODM: dsp.r.prod.m = val; break; - case DSP_REG_PRODH: dsp.r.prod.h = val; break; - case DSP_REG_PRODM2: dsp.r.prod.m2 = val; break; - case DSP_REG_AXL0: - case DSP_REG_AXL1: - dsp.r.ax[reg - DSP_REG_AXL0].l = val; break; - case DSP_REG_AXH0: - case DSP_REG_AXH1: - dsp.r.ax[reg - DSP_REG_AXH0].h = val; break; - case DSP_REG_ACL0: - case DSP_REG_ACL1: - dsp.r.ac[reg - DSP_REG_ACL0].l = val; break; - case DSP_REG_ACM0: - case DSP_REG_ACM1: - dsp.r.ac[reg - DSP_REG_ACM0].m = val; break; - default: - _assert_msg_(DSP_CORE, 0, "cannot happen"); - } -} - -bool DSPJitTester::AreEqual(SDSP& int_dsp, SDSP& jit_dsp) -{ - bool equal = true; - for (int i = 0; i < DSP_REG_NUM; i++) - { - if (GetRegister(int_dsp,i) != GetRegister(jit_dsp, i)) - { - if (equal) - { - if (failed_only) - { - printf("%s ", instruction_name); - DumpRegs(last_input_dsp); - } - if (be_verbose || failed_only) - printf("failed\n"); - } - equal = false; - if (be_verbose || failed_only) - printf("\t%s: int = 0x%04x, jit = 0x%04x\n", regnames[i].name, GetRegister(int_dsp,i), GetRegister(jit_dsp, i)); - } - } - - //TODO: more sophisticated checks? - if (!int_dsp.iram || !jit_dsp.iram) - { - if (be_verbose) - printf("(IRAM null)"); - } - else if (memcmp(int_dsp.iram, jit_dsp.iram, DSP_IRAM_BYTE_SIZE)) - { - printf("\tIRAM: different\n"); - equal = false; - } - if (!int_dsp.dram || !jit_dsp.dram) - { - if (be_verbose) - printf("(DRAM null)"); - } - else if (memcmp(int_dsp.dram, jit_dsp.dram, DSP_DRAM_BYTE_SIZE)) - { - printf("\tDRAM: different\n"); - equal = false; - } - - if (equal && be_verbose && !failed_only) - printf("passed\n"); - return equal; -} -void DSPJitTester::Report() -{ - printf("%s (0x%04x): Ran %d times, Failed %d times.\n", instruction_name, instruction, run_count, fail_count); -} -void DSPJitTester::DumpJittedCode() -{ - ResetJit(); - const u8* code = jit.GetCodePtr(); - jit.EmitInstruction(instruction); - size_t code_size = jit.GetCodePtr() - code; - - printf("%s emitted: ", instruction_name); - for (size_t i = 0; i < code_size; i++) - printf("%02x ", code[i]); - printf("\n"); -} -void DSPJitTester::DumpRegs(SDSP& dsp) -{ - for (int i = 0; i < DSP_REG_NUM; i++) - if (GetRegister(dsp,i)) - printf("%s=0x%04x ", regnames[i].name, GetRegister(dsp,i)); -} -void DSPJitTester::Initialize() -{ - //init int - InitInstructionTable(); -} - -int DSPJitTester::TestOne(TestDataIterator it, SDSP& dsp) -{ - int failed = 0; - if (it != test_values.end()) - { - u8 reg = it->first; - TestData& data = it->second; - it++; - for (TestData::size_type i = 0; i < data.size(); i++) - { - SetRegister(dsp, reg, data.at(i)); - failed += TestOne(it, dsp); - } - } - else - { - if (!Test(dsp)) - failed++; - } - return failed; -} -int DSPJitTester::TestAll(bool verbose_fail) -{ - int failed = 0; - - SDSP dsp; - memset(&dsp, 0, sizeof(SDSP)); - //from DSPCore_Init - dsp.irom = (u16*)AllocateMemoryPages(DSP_IROM_BYTE_SIZE); - dsp.iram = (u16*)AllocateMemoryPages(DSP_IRAM_BYTE_SIZE); - dsp.dram = (u16*)AllocateMemoryPages(DSP_DRAM_BYTE_SIZE); - dsp.coef = (u16*)AllocateMemoryPages(DSP_COEF_BYTE_SIZE); - - // Fill roms with distinct patterns. - for (int i = 0; i < DSP_IROM_SIZE; i++) - dsp.irom[i] = (i & 0x3fff) | 0x4000; - for (int i = 0; i < DSP_COEF_SIZE; i++) - dsp.coef[i] = (i & 0x3fff) | 0x8000; - for (int i = 0; i < DSP_DRAM_SIZE; i++) - dsp.dram[i] = (i & 0x3fff) | 0xc000; - // Fill IRAM with HALT opcodes. - for (int i = 0; i < DSP_IRAM_SIZE; i++) - dsp.iram[i] = 0x0021; // HALT opcode - - bool verbose = failed_only; - failed_only = verbose_fail; - failed += TestOne(test_values.begin(), dsp); - failed_only = verbose; - - FreeMemoryPages(dsp.irom, DSP_IROM_BYTE_SIZE); - FreeMemoryPages(dsp.iram, DSP_IRAM_BYTE_SIZE); - FreeMemoryPages(dsp.dram, DSP_DRAM_BYTE_SIZE); - FreeMemoryPages(dsp.coef, DSP_COEF_BYTE_SIZE); - - return failed; -} -void DSPJitTester::AddTestData(u8 reg) -{ - AddTestData(reg, 0); - AddTestData(reg, 1); - AddTestData(reg, 0x1fff); - AddTestData(reg, 0x2000); - AddTestData(reg, 0x2001); - AddTestData(reg, 0x7fff); - AddTestData(reg, 0x8000); - AddTestData(reg, 0x8001); - AddTestData(reg, 0xfffe); - AddTestData(reg, 0xffff); -} -void DSPJitTester::AddTestData(u8 reg, u16 value) -{ - if (reg < DSP_REG_NUM) - test_values[reg].push_back(value); -} - diff --git a/Source/UnitTests/DSPJitTester.h b/Source/UnitTests/DSPJitTester.h deleted file mode 100644 index e507d6dca8..0000000000 --- a/Source/UnitTests/DSPJitTester.h +++ /dev/null @@ -1,115 +0,0 @@ -// How to use the DSPJitTester: -// -// == Before running == -// Make sure to call Initialize to set initial stuff required by int and jit: -// DSPJitTester::Initialize(); -// -// == Creation of a testcase == -// Create a testcase for a normal operation: -// DSPJitTester tester(0x0004); //taken from DSPTables.cpp, opcodes[] -// -// Create a testcase for an extended operation: -// DSPJitTester tester(0x8000, 0x0004); //NX from opcodes, DR from opcodes_ext -// -// By default, no messages are written. -// To log all operations, set verbose to true: -// DSPJitTester tester(0x8000, 0x0004, true); -// -// You can also choose to only print failing tests: -// DSPJitTester tester(0x8000, 0x0004, verbosity_setting, true); -// verbose = true will give the same output as verbose, -// while verbose = false will only (really!) print failing tests. -// -// == Setting up values == -// You can set the tester up with values for each DSP register: -// tester.AddTestData(DSP_REG_ACC0, 1); -// tester.AddTestData(DSP_REG_ACC0, 2); -// tester.AddTestData(DSP_REG_ACC0, 3); -// -// You can also choose to have a few predefined values added for a register: -// tester.AddTestData(DSP_REG_ACC0); //see the method body for the values added -// -// == Running the tests == -// After setup, you can either run JIT against the interpreter -// using all predefined register values, pass your own set of -// registers or run either of the two independently from each other. -// -// int failed_tests = tester.TestAll(); //run jit against int, using values from AddTestData -// int failed_tests = tester.TestAll(true); //override the value for only_failed to show failure -// -// SDSP dsp = GetCustomSetOfRegisters(); -// bool success = tester.Test(dsp); //run jit against int, using a custom set of register values -// -// SDSP result = tester.RunInterpreter(dsp); //run int alone -// SDSP result = tester.RunJit(dsp); //run jit alone -// -// == Examining results == -// When either verbose or only_failed is set to true, the tester will automatically report -// failure to stdout, along with input registers and the differences in output registers. -// -// tester.Report(); //display a small report afterwards -// -// SDSP int = tester.GetLastInterpreterDSP(); //examine the DSP set left after running int -// SDSP jit = tester.GetLastJitDSP(); //same for jit -// -// int tests_run = tester.GetRunCount(); -// int tests_failed = tester.GetFailCount(); -// const char* tested_instruction = tester.GetInstructionName(); -// printf("%s ran %d tests and failed %d times\n", tested_instruction, tests_run, tests_failed); -// -// tester.DumpJittedCode(); //prints the code bytes produced by jit (examine with udcli/udis86 or similar) - -#ifndef __DSP_JIT_TESTER_ -#define __DSP_JIT_TESTER_ - -#include "DSP/DSPCore.h" -#include "DSP/DSPInterpreter.h" -#include -#include - -typedef std::vector TestData; -typedef std::map TestDataList; -typedef TestDataList::iterator TestDataIterator; -#define DSP_REG_NUM 32 - -class DSPJitTester -{ - UDSPInstruction instruction; - const DSPOPCTemplate *opcode_template; - DSPEmitter jit; - SDSP last_int_dsp; - SDSP last_jit_dsp; - SDSP last_input_dsp; - bool be_verbose; - bool failed_only; - int run_count; - int fail_count; - char instruction_name[16]; - TestDataList test_values; - - bool AreEqual(SDSP&, SDSP&); - int TestOne(TestDataIterator, SDSP&); - void DumpRegs(SDSP&); -public: - DSPJitTester(u16 opcode, u16 opcode_ext = 0, bool verbose = false, bool only_failed = false); - bool Test(SDSP); - int TestAll() { return TestAll(failed_only); } - int TestAll(bool verbose_fail); - void AddTestData(u8 reg); - void AddTestData(u8 reg, u16 value); - SDSP RunInterpreter(SDSP); - SDSP RunJit(SDSP); - void ResetInterpreter(); - void ResetJit(); - inline SDSP GetLastInterpreterDSP() { return last_int_dsp; } - inline SDSP GetLastJitDSP() { return last_jit_dsp; } - inline int GetRunCount() { return run_count; } - inline int GetFailCount() { return fail_count; } - inline const char* GetInstructionName() { return instruction_name; } - void Report(); - void DumpJittedCode(); - - static void Initialize(); -}; - -#endif diff --git a/Source/UnitTests/UnitTests.cpp b/Source/UnitTests/UnitTests.cpp deleted file mode 100644 index b77dc2bad5..0000000000 --- a/Source/UnitTests/UnitTests.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ - -#include -#include - -#include "StringUtil.h" -#include "MathUtil.h" -#include "PowerPC/PowerPC.h" -#include "HW/SI_DeviceGCController.h" - -void AudioJitTests(); - -using namespace std; -int fail_count = 0; - -#define EXPECT_TRUE(a) \ - if (!a) { \ - cout << "FAIL (" << __FUNCTION__ << "): " << #a << " is false" << endl; \ - cout << "Value: " << a << endl << "Expected: true" << endl; \ - fail_count++; \ - } - -#define EXPECT_FALSE(a) \ - if (a) { \ - cout << "FAIL (" << __FUNCTION__ << "): " << #a << " is true" << endl; \ - cout << "Value: " << a << endl << "Expected: false" << endl; \ - fail_count++; \ - } - -#define EXPECT_EQ(a, b) \ - if ((a) != (b)) { \ - cout << "FAIL (" << __FUNCTION__ << "): " << #a << " is not equal to " << #b << endl; \ - cout << "Actual: " << a << endl << "Expected: " << b << endl; \ - fail_count++; \ - } - -void CoreTests() -{ -} - -void MathTests() -{ - // Tests that our fp classifier is correct. - EXPECT_EQ(MathUtil::ClassifyDouble(1.0), MathUtil::PPC_FPCLASS_PN); - EXPECT_EQ(MathUtil::ClassifyDouble(-1.0), MathUtil::PPC_FPCLASS_NN); - EXPECT_EQ(MathUtil::ClassifyDouble(1235223.0), MathUtil::PPC_FPCLASS_PN); - EXPECT_EQ(MathUtil::ClassifyDouble(-1263221.0), MathUtil::PPC_FPCLASS_NN); - EXPECT_EQ(MathUtil::ClassifyDouble(1.0E-308), MathUtil::PPC_FPCLASS_PD); - EXPECT_EQ(MathUtil::ClassifyDouble(-1.0E-308), MathUtil::PPC_FPCLASS_ND); - EXPECT_EQ(MathUtil::ClassifyDouble(0.0), MathUtil::PPC_FPCLASS_PZ); - EXPECT_EQ(MathUtil::ClassifyDouble(-0.0), MathUtil::PPC_FPCLASS_NZ); - EXPECT_EQ(MathUtil::ClassifyDouble(HUGE_VAL), MathUtil::PPC_FPCLASS_PINF); // weird #define for infinity - EXPECT_EQ(MathUtil::ClassifyDouble(-HUGE_VAL), MathUtil::PPC_FPCLASS_NINF); - EXPECT_EQ(MathUtil::ClassifyDouble(sqrt(-1.0)), MathUtil::PPC_FPCLASS_QNAN); - - // Float version - EXPECT_EQ(MathUtil::ClassifyFloat(1.0f), MathUtil::PPC_FPCLASS_PN); - EXPECT_EQ(MathUtil::ClassifyFloat(-1.0f), MathUtil::PPC_FPCLASS_NN); - EXPECT_EQ(MathUtil::ClassifyFloat(1235223.0f), MathUtil::PPC_FPCLASS_PN); - EXPECT_EQ(MathUtil::ClassifyFloat(-1263221.0f), MathUtil::PPC_FPCLASS_NN); - EXPECT_EQ(MathUtil::ClassifyFloat(1.0E-43f), MathUtil::PPC_FPCLASS_PD); - EXPECT_EQ(MathUtil::ClassifyFloat(-1.0E-43f), MathUtil::PPC_FPCLASS_ND); - EXPECT_EQ(MathUtil::ClassifyFloat(0.0f), MathUtil::PPC_FPCLASS_PZ); - EXPECT_EQ(MathUtil::ClassifyFloat(-0.0f), MathUtil::PPC_FPCLASS_NZ); - EXPECT_EQ(MathUtil::ClassifyFloat((float)HUGE_VAL), MathUtil::PPC_FPCLASS_PINF); // weird #define for infinity - EXPECT_EQ(MathUtil::ClassifyFloat((float)-HUGE_VAL), MathUtil::PPC_FPCLASS_NINF); - EXPECT_EQ(MathUtil::ClassifyFloat(sqrtf(-1.0f)), MathUtil::PPC_FPCLASS_QNAN); - - EXPECT_FALSE(MathUtil::IsNAN(1.0)); - EXPECT_TRUE(MathUtil::IsNAN(sqrt(-1.0))); - EXPECT_FALSE(MathUtil::IsSNAN(sqrt(-1.0))); - - // EXPECT_TRUE(MathUtil::IsQNAN(sqrt(-1.0))); // Hmm... - EXPECT_EQ(pow2(2.0), 4.0); - EXPECT_EQ(pow2(-2.0), 4.0); -} - -void StringTests() -{ - EXPECT_EQ(StripSpaces(" abc "), "abc"); - - EXPECT_EQ(StripQuotes("\"abc\""), "abc"); - EXPECT_EQ(StripQuotes("\"abc\" "), "\"abc\" "); - - EXPECT_EQ(TabsToSpaces(4, "a\tb"), "a b"); - EXPECT_EQ(ThousandSeparate(1234567, 15), " 1,234,567"); - - int i = 7; - EXPECT_EQ(false, TryParse("FF", &i)); - EXPECT_EQ(7, i); - EXPECT_EQ(true, TryParse("22", &i)); - EXPECT_EQ(22, i); - - std::vector strs; - SplitString("blah,foo,bar", ',', strs); - - EXPECT_EQ(3, strs.size()); - EXPECT_EQ("bar", strs[2]); - - std::string path, fname, ext; - SplitPath("C:/some/path/test.jpg", &path, &fname, &ext); - EXPECT_EQ("C:/some/path/", path); - EXPECT_EQ("test", fname); - EXPECT_EQ(".jpg", ext); - - SplitPath("C:/so.me/path/", &path, &fname, &ext); - EXPECT_EQ("C:/so.me/path/", path); - EXPECT_EQ("", fname); - EXPECT_EQ("", ext); - - SplitPath("test.file.jpg", &path, &fname, &ext); - EXPECT_EQ("", path); - EXPECT_EQ("test.file", fname); - EXPECT_EQ(".jpg", ext); -} - - -int main(int argc, char* argv[]) -{ - AudioJitTests(); - - CoreTests(); - MathTests(); - StringTests(); - if (fail_count == 0) - { - printf("All tests passed.\n"); - } - return 0; -} diff --git a/Source/UnitTests/UnitTests.vcxproj b/Source/UnitTests/UnitTests.vcxproj deleted file mode 100644 index 9a498b9ff2..0000000000 --- a/Source/UnitTests/UnitTests.vcxproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {40C636FA-B5BF-4D67-ABC8-376B524A7551} - UnitTests - Win32Proj - - - - Application - Unicode - false - - - Application - Unicode - - - Application - Unicode - true - - - Application - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - ../Core/Core;../Core/Common;../Core/InputCommon;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - Iphlpapi.lib;winmm.lib;%(AdditionalDependencies) - true - Console - MachineX86 - - - xcopy "$(TargetPath)" "$(SolutionDir)..\Binary\$(Platform)\" /e /s /y /d - - - - - X64 - - - Disabled - ../Core/Core;../Core/Common;../Core/InputCommon;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - Iphlpapi.lib;winmm.lib;%(AdditionalDependencies) - true - Console - MachineX64 - - - xcopy "$(TargetPath)" "$(SolutionDir)..\Binary\$(Platform)\" /e /s /y /d - - - - - MaxSpeed - true - ../Core/Core;../Core/Common;../Core/InputCommon;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;%(PreprocessorDefinitions) - MultiThreaded - true - - - Level3 - ProgramDatabase - - - Iphlpapi.lib;winmm.lib;%(AdditionalDependencies) - true - Console - true - true - MachineX86 - - - xcopy "$(TargetPath)" "$(SolutionDir)..\Binary\$(Platform)\" /e /s /y /d - - - - - X64 - - - /MP %(AdditionalOptions) - MaxSpeed - true - ../Core/Core;../Core/Common;../Core/InputCommon;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;%(PreprocessorDefinitions) - MultiThreaded - true - - - Level3 - ProgramDatabase - - - Iphlpapi.lib;winmm.lib;%(AdditionalDependencies) - true - Console - true - true - MachineX64 - - - xcopy "$(TargetPath)" "$(SolutionDir)..\Binary\$(Platform)\" /e /s /y /d - - - - - - - - - - - - - {cd3d4c3c-1027-4d33-b047-aec7b56d0bf6} - - - {c87a4178-44f6-49b2-b7aa-c79af1b8c534} - - - {8c60e805-0da5-4e25-8f84-038db504bb0d} - - - - - - diff --git a/Source/UnitTests/UnitTests.vcxproj.filters b/Source/UnitTests/UnitTests.vcxproj.filters deleted file mode 100644 index 6741c6e89d..0000000000 --- a/Source/UnitTests/UnitTests.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {cde9a42c-90d9-4bc9-9182-3fcc0cf9f7a4} - - - - - Audio - - - Audio - - - - - - Audio - - - \ No newline at end of file