mirror of
https://github.com/rvtr/twl_wrapsdk.git
synced 2025-10-31 06:11:10 -04:00
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@159 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
parent
a8e0930289
commit
8d90b1be66
62
build/libraries/sample_dll/ARM7/Makefile
Normal file
62
build/libraries/sample_dll/ARM7/Makefile
Normal file
@ -0,0 +1,62 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - libraries - dll_sample/ARM7
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2007 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Log: $
|
||||
# $NoKeywords: $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# build ARM & THUMB libraries
|
||||
TWL_CODEGEN_ALL ?= True
|
||||
|
||||
# Codegen for sub processer
|
||||
TWL_PROC = ARM7
|
||||
|
||||
SRCDIR = ../common/src src
|
||||
|
||||
SRCS = \
|
||||
shirait.c \
|
||||
miya.c \
|
||||
|
||||
TARGET_LIB = libsampledll_sp$(TWL_LIBSUFFIX).a
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# DEBUG版ビルドの場合、RELEASE版でビルドして
|
||||
# DEBUG版のライブラリを装います。
|
||||
|
||||
ifdef NITRO_DEBUG
|
||||
NITRO_BUILD_TYPE = RELEASE
|
||||
endif
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
GINCLUDES += $(TWL_INCDIR)/twl/fatfs/ARM7
|
||||
|
||||
INSTALL_TARGETS = $(TARGETS)
|
||||
INSTALL_DIR = ..
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
do-build: $(TARGETS)
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
||||
43
build/libraries/sample_dll/ARM7/src/miya.c
Normal file
43
build/libraries/sample_dll/ARM7/src/miya.c
Normal file
@ -0,0 +1,43 @@
|
||||
#include <twl_sp.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
void global_func( void );
|
||||
static int internal_data = 2;
|
||||
int global_data = 3;
|
||||
extern int no_data;
|
||||
|
||||
extern void g_func( void);
|
||||
|
||||
#define NUM_OF_DATA 0x1
|
||||
|
||||
static int internal_func( void )
|
||||
{
|
||||
int a = 1;
|
||||
int b = 2;
|
||||
int i;
|
||||
int c[NUM_OF_DATA];
|
||||
internal_data = 1;
|
||||
a += b;
|
||||
|
||||
for( i = 0 ; i < NUM_OF_DATA ; i++) {
|
||||
c[i] = i;
|
||||
}
|
||||
|
||||
for( i = 0 ; i < NUM_OF_DATA ; i++) {
|
||||
a += c[i];
|
||||
}
|
||||
|
||||
OS_TPrintf("aho\n");
|
||||
g_func();
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
void global_func( void )
|
||||
{
|
||||
int c;
|
||||
c = internal_func();
|
||||
global_data = 1;
|
||||
no_data = 4;
|
||||
OS_Printf("aho %d\n",c);
|
||||
}
|
||||
7
build/libraries/sample_dll/ARM7/src/miya_object.h
Normal file
7
build/libraries/sample_dll/ARM7/src/miya_object.h
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
#ifndef __MIYA_H__
|
||||
#define __MIYA_H__
|
||||
|
||||
typedef void (*global_func_p)( void);
|
||||
|
||||
#endif /*__MIYA_H__*/
|
||||
62
build/libraries/sample_dll/ARM7/src/shirait.c
Normal file
62
build/libraries/sample_dll/ARM7/src/shirait.c
Normal file
@ -0,0 +1,62 @@
|
||||
#include <twl_sp.h>
|
||||
|
||||
static int a_func( void);
|
||||
static int i_func( void);
|
||||
void g_func( void);
|
||||
|
||||
static u16 i_data = 2;
|
||||
u16 g_data = 3;
|
||||
|
||||
#define D_NUM 0x4
|
||||
|
||||
|
||||
#include <nitro/code32.h>
|
||||
static int a_func( void)
|
||||
{
|
||||
u16 a = 5;
|
||||
u16 b = 7;
|
||||
|
||||
a+= b;
|
||||
if( ((vu16)(g_data)) > 2) {
|
||||
a+= i_func();
|
||||
}
|
||||
|
||||
OS_TPrintf( "arm_a_func\n");
|
||||
return a;
|
||||
}
|
||||
#include <nitro/codereset.h>
|
||||
|
||||
|
||||
|
||||
#include <nitro/code16.h>
|
||||
static int i_func( void)
|
||||
{
|
||||
u16 a = 1;
|
||||
u16 b = 2;
|
||||
u16 i;
|
||||
u16 c[D_NUM];
|
||||
|
||||
i_data = 1;
|
||||
a+= b;
|
||||
|
||||
OS_TPrintf( "thumb_i_func\n");
|
||||
return a;
|
||||
}
|
||||
|
||||
void g_func( void)
|
||||
{
|
||||
u16 c;
|
||||
|
||||
if( ((vu16)(g_data)) > 2) {
|
||||
c = a_func();
|
||||
i_func();
|
||||
}else{
|
||||
c = i_func();
|
||||
a_func();
|
||||
}
|
||||
|
||||
OS_Printf( "t_func %d\n", c);
|
||||
}
|
||||
#include <nitro/codereset.h>
|
||||
|
||||
|
||||
7
build/libraries/sample_dll/ARM7/src/shirait_object.h
Normal file
7
build/libraries/sample_dll/ARM7/src/shirait_object.h
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
#ifndef __SHIRAIT_H__
|
||||
#define __SHIRAIT_H__
|
||||
|
||||
typedef void (*g_func_p)( void);
|
||||
|
||||
#endif /*__SHIRAIT_H__*/
|
||||
34
build/libraries/sample_dll/Makefile
Normal file
34
build/libraries/sample_dll/Makefile
Normal file
@ -0,0 +1,34 @@
|
||||
#! make -f
|
||||
#----------------------------------------------------------------------------
|
||||
# Project: TwlSDK - libraries - aes
|
||||
# File: Makefile
|
||||
#
|
||||
# Copyright 2007 Nintendo. All rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs contain
|
||||
# proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||
# Company Ltd., and are protected by Federal copyright law. They may
|
||||
# not be disclosed to third parties or copied or duplicated in any form,
|
||||
# in whole or in part, without the prior written consent of Nintendo.
|
||||
#
|
||||
# $Log: $
|
||||
# $NoKeywords: $
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/commondefs
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
#SUBDIRS = ARM9
|
||||
|
||||
ifdef TWL_WITH_ARM7
|
||||
SUBDIRS += ARM7
|
||||
endif
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
include $(TWLSDK_ROOT)/build/buildtools/modulerules
|
||||
|
||||
|
||||
#===== End of Makefile =====
|
||||
Loading…
Reference in New Issue
Block a user