cleanup testsuite a bit and add simple test of wii RTC (it's off about 8yrs 4 days)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2103 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-02-04 04:34:31 +00:00
parent 2d5c0a509c
commit 701d4146b6
12 changed files with 276 additions and 149 deletions

View File

@ -16,27 +16,6 @@
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="build"
IntermediateDirectory="build"
ConfigurationType="0"
BuildLogFile="build\BuildLog.htm"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
ReBuildCommandLine="make clean &amp;&amp; make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
CleanCommandLine="make clean"
Output="dolphintest_aram.dol"
PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath="$(ProjectDir)\include;C:\devkitPro\libogc\include"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="build"

View File

@ -16,27 +16,6 @@
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="build"
IntermediateDirectory="build"
ConfigurationType="0"
BuildLogFile="build\BuildLog.htm"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
ReBuildCommandLine="make clean &amp;&amp; make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
CleanCommandLine="make clean"
Output="dolphintest_ax.dol"
PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath="$(ProjectDir)\include;C:\devkitPro\libogc\include"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="build"

View File

@ -16,27 +16,6 @@
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="build"
IntermediateDirectory="build"
ConfigurationType="0"
BuildLogFile="build\BuildLog.htm"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
ReBuildCommandLine="make clean &amp;&amp; make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
CleanCommandLine="make clean"
Output="dolphintest_gx.dol"
PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath="$(ProjectDir)\include;C:\devkitPro\libogc\include"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="build"

View File

@ -16,27 +16,6 @@
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="build"
IntermediateDirectory="build"
ConfigurationType="0"
BuildLogFile="build\BuildLog.htm"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
ReBuildCommandLine="make clean &amp;&amp; make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
CleanCommandLine="make clean"
Output="dolphintest_pad.dol"
PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath="$(ProjectDir)\include;C:\devkitPro\libogc\include"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="build"

View File

@ -16,27 +16,6 @@
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="build"
IntermediateDirectory="build"
ConfigurationType="0"
BuildLogFile="build\BuildLog.htm"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
ReBuildCommandLine="make clean &amp;&amp; make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
CleanCommandLine="make clean"
Output="dolphintest_rtc.dol"
PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath="$(ProjectDir)\include;C:\devkitPro\libogc\include"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="build"

View File

@ -30,7 +30,7 @@ int main()
while(1)
{
gc_time = time(NULL);
std::cout<<"\x1b[10;0HRTC time is"<<ctime(&gc_time);
std::cout<<"\x1b[10;0HGC RTC time is"<<ctime(&gc_time);
VIDEO_WaitVSync();
}

View File

@ -16,27 +16,6 @@
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="build"
IntermediateDirectory="build"
ConfigurationType="0"
BuildLogFile="build\BuildLog.htm"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
ReBuildCommandLine="make clean &amp;&amp; make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
CleanCommandLine="make clean"
Output="dolphintest_si.dol"
PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath="$(ProjectDir)\include;C:\devkitPro\libogc\include"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="build"

View File

@ -17,6 +17,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ARAM", "ARAM\ARAM.vcproj",
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WPAD", "WPAD\WPAD.vcproj", "{BB88F4D5-EB0D-4429-94C3-93B0191BD3DD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WRTC", "WRTC\WRTC.vcproj", "{F75021E3-73BF-425C-BA57-3FE7E2F6E02C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
@ -38,6 +40,8 @@ Global
{E50732C5-038A-42F7-8C95-8C02A4E2ADA6}.Release|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}.Release|Win32.ActiveCfg = Release|Win32
{F75021E3-73BF-425C-BA57-3FE7E2F6E02C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -16,27 +16,6 @@
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="build"
IntermediateDirectory="build"
ConfigurationType="0"
BuildLogFile="build\BuildLog.htm"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
ReBuildCommandLine="make clean &amp;&amp; make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
CleanCommandLine="make clean"
Output="dolphintest_si.dol"
PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath="$(ProjectDir)\include;C:\devkitPro\libogc\include"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="build"
@ -49,7 +28,7 @@
BuildCommandLine="make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
ReBuildCommandLine="make clean &amp;&amp; make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
CleanCommandLine="make clean"
Output="dolphintest_si.dol"
Output="dolphintest_wpad.dol"
PreprocessorDefinitions="WIN32;NDEBUG"
IncludeSearchPath="$(ProjectDir)\include;C:\devkitPro\libogc\include"
ForcedIncludes=""

View File

@ -0,0 +1,135 @@
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>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
#---------------------------------------------------------------------------------

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="WRTC"
ProjectGUID="{F75021E3-73BF-425C-BA57-3FE7E2F6E02C}"
RootNamespace="TestSuite"
Keyword="MakeFileProj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="build"
IntermediateDirectory="build"
ConfigurationType="0"
BuildLogFile="build\BuildLog.htm"
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
ReBuildCommandLine="make clean &amp;&amp; make -r 2&gt;&amp;1 | sed -e &apos;s/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/"
CleanCommandLine="make clean"
Output="dolphintest_wrtc.dol"
PreprocessorDefinitions="WIN32;NDEBUG"
IncludeSearchPath="$(ProjectDir)\include;C:\devkitPro\libogc\include"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\source\dolphintest_wrtc.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,72 @@
#include <gccore.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <ogcsys.h>
#include <time.h>
#include <sys/time.h>
#include <iostream>
#include <debug.h>
#include <math.h>
static void *xfb = NULL;
u32 first_frame = 1;
GXRModeObj *rmode;
void Initialise();
int main()
{
Initialise();
time_t wii_time;
wii_time = time(NULL);
srand(wii_time);
while(1)
{
wii_time = time(NULL);
std::cout<<"\x1b[10;0HWii RTC time is"<<ctime(&wii_time);
VIDEO_WaitVSync();
}
}
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();
}