From cd2bb0264b8cb5f635881717d5728934a5d9eafd Mon Sep 17 00:00:00 2001 From: yosiokat Date: Wed, 21 May 2008 13:56:28 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=BBUTL=E3=83=A9=E3=82=A4=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=83=AA=E3=81=ABPM=E3=83=A9=E3=82=A4=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=83=AA=E6=94=B9=E3=82=92=E7=94=A8=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=83=90=E3=83=83=E3=82=AF=E3=83=A9=E3=82=A4=E3=83=88=E8=BC=9D?= =?UTF-8?q?=E5=BA=A6=E8=AA=BF=E6=95=B4=E3=83=BB=E5=8F=96=E5=BE=97=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82=20=E3=80=80u32=20?= =?UTF-8?q?UTL=5FSetBacklightBrightness(=20u8=20brightness=20)=20=E3=80=80?= =?UTF-8?q?u32=20UTL=5FGetBacklightBrightness(=20u8=20*pBrightness=20)=20?= =?UTF-8?q?=E3=83=BBhyena=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC=E3=83=8D?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92PM=E3=83=A9=E3=82=A4=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=83=AA=E6=94=B9=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E5=A4=89=E6=9B=B4=E3=80=82=20?= =?UTF-8?q?=E3=83=BBPM=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA?= =?UTF-8?q?=E6=94=B9=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=99=E3=82=8Barmadillo?= =?UTF-8?q?2=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC=E3=83=8D=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82=20=E3=83=BB?= =?UTF-8?q?=E6=9C=AC=E4=BD=93=E8=A8=AD=E5=AE=9A=E3=82=92armadillo2?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC=E3=83=8D=E3=83=B3=E3=83=88?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E3=81=AB=E5=A4=89=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@1446 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/components/Makefile | 3 +- build/components/armadillo2.TWL/Makefile | 84 ++++++++++++++++++ .../components/armadillo2.TWL/armadillo2.lsf | 85 +++++++++++++++++++ build/components/hyena.TWL/Makefile | 4 +- build/components/hyena.TWL/hyena.lsf | 2 +- .../sharedFont/ARM9/Makefile | 2 - .../sysmenu/ARM9/src/device.c | 6 +- .../libraries_sysmenu/util/ARM9/src/device.c | 6 +- build/libraries_sysmenu/util/ARM9/src/util.c | 30 +++++++ .../Launcher/ARM9/src/launcher.c | 16 ++-- build/systemMenu_RED/Launcher/ARM9/src/main.c | 2 +- .../MachineSettings/ARM9/Makefile | 2 +- 12 files changed, 221 insertions(+), 21 deletions(-) create mode 100644 build/components/armadillo2.TWL/Makefile create mode 100644 build/components/armadillo2.TWL/armadillo2.lsf diff --git a/build/components/Makefile b/build/components/Makefile index bfd7acf1..e488da4d 100644 --- a/build/components/Makefile +++ b/build/components/Makefile @@ -22,7 +22,8 @@ include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs #---------------------------------------------------------------------------- SUBDIRS = \ - hyena.TWL + hyena.TWL \ + armadillo2.TWL #---------------------------------------------------------------------------- diff --git a/build/components/armadillo2.TWL/Makefile b/build/components/armadillo2.TWL/Makefile new file mode 100644 index 00000000..feee0510 --- /dev/null +++ b/build/components/armadillo2.TWL/Makefile @@ -0,0 +1,84 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - components - armadillo.TWL +# File: Makefile +# +# Copyright 2008 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. +# +# $Date:: $ +# $Rev$ +# $Author$ +#---------------------------------------------------------------------------- + +TARGET_FIRM = SYSTEMMENU +override TARGET_PLATFORM = TWL +override TWL_PROC = ARM7 +override TWL_ARCHGEN = LIMITED +override TWL_PLATFORM = TS +TWL_NO_STD_PCHDR = True +TWL_CODEGEN ?= ALL + +#---------------------------------------------------------------------------- + +COMPONENT_DIR = $(ROOT)/build/components/armadillo.TWL +SRCDIR = $(COMPONENT_DIR)/src +SRCS = main.c overwriteRtc.c + +TARGET_NAME = armadillo2 + +TARGET_NEF = $(TARGET_NAME).tef +LCFILE_SPEC = armadillo2.lsf +LCFILE_TEMPLATE = $(COMPONENT_DIR)/armadillo.lcf.template +LDRES_TEMPLATE = $(COMPONENT_DIR)/armadillo.response.template + +CRT0_O = crt0.SCR.TWL.o + +# スタック不足防止の為、インライン展開せずにコンパイルする +CCFLAGS_OPT = -O4 -inline off + +#---------------------------------------------------------------------------- +include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs + +MACRO_FLAGS += -DSDK_ARM7COMP_LTD -DSDK_SEA + +MAKELCF_FLAGS += -DISDBG_LIBS_TWL='$(if $(ISDBG_LIBS_TWL),$(ISDBG_LIBS_TWL),libstubsistd_sp$(TWL_LIBSUFFIX).a)' \ + -DISDBG_LIBS_NITRO='libstubsisd_sp$(TWL_LIBSUFFIX).a' + +#-------------------------------- +# install target +#-------------------------------- +INSTALL_TARGETS = $(BINDIR)/$(TARGET_NAME).tef \ + $(BINDIR)/$(TARGET_NAME).TWL.FLX.sbin \ + $(BINDIR)/$(TARGET_NAME)_defs.TWL.FLX.sbin \ + $(BINDIR)/$(TARGET_NAME).TWL.LTD.sbin \ + $(BINDIR)/$(TARGET_NAME)_defs.TWL.LTD.sbin + +INSTALL_DIR = $(TWL_INSTALL_COMPONENTSDIR)/$(TARGET_NAME)/$(TWL_BUILDTYPE) + +LINCLUDES = $(ROOT)/build/libraries/spi/ARM7/include + +LLIBRARIES += libwl_sp$(TWL_LIBSUFFIX).a \ + libsdio_sp$(TWL_LIBSUFFIX).a \ + libathdrv_sp$(TWL_LIBSUFFIX).a \ + libwpa_sp$(TWL_LIBSUFFIX).a \ + libsea_sp$(TWL_LIBSUFFIX).a \ + +LLIBRARIES += libpm_mset_sp$(TWL_LIBSUFFIX).a +GLIBRARIES := $(filter-out libpm_sp$(TWL_LIBSUFFIX).a,$(GLIBRARIES)) + +LDEPENDS_NEF = $(TWL_LIBS) $(LLIBRARIES) + +do-build: $(TARGETS) + +#---------------------------------------------------------------------------- +include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules + +#---------------------------------------------------------------------------- + +#===== End of Makefile ===== diff --git a/build/components/armadillo2.TWL/armadillo2.lsf b/build/components/armadillo2.TWL/armadillo2.lsf new file mode 100644 index 00000000..98ba2522 --- /dev/null +++ b/build/components/armadillo2.TWL/armadillo2.lsf @@ -0,0 +1,85 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - components - armadillo.TWL +# File: armadillo.lsf +# +# Copyright 2008 Nintendo. All rights reserved. +# +# These coded insructions, 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. +# +# $Date:: $ +# $Rev$ +# $Author$ +#---------------------------------------------------------------------------- +# +# Nitro LCF SPEC FILE +# +#-------- +Static $(TARGET_NAME) +{ + Address 0x02380000 + StackSize 1024 1024 + + Library $(CRT0_O) +} + +#-------- +Ltdautoload SCRWRAM +{ + Address 0x03740000 + + Library libsubpsyscall.a + Library libsyscall_sp.twl.a + Library $(CW_LIBS) + Library $(ISDBG_LIBS_TWL) + Library $(ISDBG_LIBS_NITRO) + + Object * (.etable) + Object $(OBJDIR)/main.o + Object $(OBJDIR)/overwriteRtc.o + + Library libsea_sp$(LIBSUFFIX).a + Library libcrypto_sp$(LIBSUFFIX).a + + Library libos_sp$(LIBSUFFIX).a + Library libmi_sp$(LIBSUFFIX).a + Library libstd_sp$(LIBSUFFIX).a + Library libmath_sp$(LIBSUFFIX).a + Library libpxi_sp$(LIBSUFFIX).a + Library libexi_sp$(LIBSUFFIX).a + Library libi2c_sp$(LIBSUFFIX).a + Library libsdio_sp$(LIBSUFFIX).a + Library libpad_sp$(LIBSUFFIX).a + Library libscfg_sp$(LIBSUFFIX).a + Library libmcu_sp$(LIBSUFFIX).a + Library libcdc_sp$(LIBSUFFIX).a + Library libsnd_sp$(LIBSUFFIX).a + Library libsndex_sp$(LIBSUFFIX).a + Library libspi_sp$(LIBSUFFIX).a + Library libpm_mset_sp$(LIBSUFFIX).a + Library libtp_sp$(LIBSUFFIX).a + Library libtpex_sp$(LIBSUFFIX).a + Library libmic_sp$(LIBSUFFIX).a + Library libmicex_sp$(LIBSUFFIX).a + Library libnvram_sp$(LIBSUFFIX).a + Library librtc_sp$(LIBSUFFIX).a + Library libfatfs_sp$(LIBSUFFIX).a + Library libwm_sp$(LIBSUFFIX).a + Library libnwm_sp$(LIBSUFFIX).a + Library libwvr_sp$(LIBSUFFIX).a + Library libwl_sp$(LIBSUFFIX).a + Library libwpa_sp$(LIBSUFFIX).a + Library libathdrv_sp$(LIBSUFFIX).a +# Library libfs_sp$(LIBSUFFIX).a +# Library libcard_sp$(LIBSUFFIX).a +# Library libcamera_sp$(LIBSUFFIX).a + + Object * (.wram) + Object * (.ltdwram) + Object * (.rsvwram) + Object * (.main) + Object * (.ltdmain) +} diff --git a/build/components/hyena.TWL/Makefile b/build/components/hyena.TWL/Makefile index ef64f473..1d5b2073 100644 --- a/build/components/hyena.TWL/Makefile +++ b/build/components/hyena.TWL/Makefile @@ -48,7 +48,8 @@ CCFLAGS_OPT = -O4 -inline off #---------------------------------------------------------------------------- include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs -GLIBRARIES := $(filter-out $(CRT0_O),$(GLIBRARIES)) +# crt0.o と libpm_sp は、ローカルでビルドしたものを使用するので、除外する。 +GLIBRARIES := $(filter-out $(CRT0_O) libpm_sp$(TWL_LIBSUFFIX).a,$(GLIBRARIES)) ifdef TWLSDK_NOCRYPTO CCFLAGS += -DSDK_NOCRYPTO @@ -101,6 +102,7 @@ SYSMENU_LIBS = \ libds_sp$(TWL_LIBSUFFIX).a \ libhotsw_sp$(TWL_LIBSUFFIX).a \ libdht_sp$(TWL_LIBSUFFIX).a \ + libpm_mset_sp$(TWL_LIBSUFFIX).a SDK_APPEND_LIBS = \ libwl_sp.TWL.LTD.a \ diff --git a/build/components/hyena.TWL/hyena.lsf b/build/components/hyena.TWL/hyena.lsf index f2f2308a..2d6b3a80 100644 --- a/build/components/hyena.TWL/hyena.lsf +++ b/build/components/hyena.TWL/hyena.lsf @@ -42,7 +42,7 @@ Autoload WRAM libexi_sp$(LIBSUFFIX).a \ libsnd_sp$(LIBSUFFIX).a \ libspi_sp$(LIBSUFFIX).a \ - libpm_sp$(LIBSUFFIX).a \ + libpm_mset_sp$(LIBSUFFIX).a \ libmath_sp$(LIBSUFFIX).a \ libscfg_sp$(LIBSUFFIX).a \ libtp_sp$(LIBSUFFIX).a \ diff --git a/build/libraries_sysmenu/sharedFont/ARM9/Makefile b/build/libraries_sysmenu/sharedFont/ARM9/Makefile index 9dfc02a6..58f7aea1 100644 --- a/build/libraries_sysmenu/sharedFont/ARM9/Makefile +++ b/build/libraries_sysmenu/sharedFont/ARM9/Makefile @@ -38,8 +38,6 @@ MACRO_FLAGS += -DUSE_FONT_WRAM_LOAD INSTALL_TARGETS = $(TARGETS) INSTALL_DIR = $(SYSMENU_INSTALL_LIBDIR) -LDIRT_CLEAN = $(REVISION_SRC) - #---------------------------------------------------------------------------- do-build: $(TARGETS) diff --git a/build/libraries_sysmenu/sysmenu/ARM9/src/device.c b/build/libraries_sysmenu/sysmenu/ARM9/src/device.c index 161d5ff3..c278273c 100644 --- a/build/libraries_sysmenu/sysmenu/ARM9/src/device.c +++ b/build/libraries_sysmenu/sysmenu/ARM9/src/device.c @@ -83,9 +83,9 @@ u8 SYSM_GetBackLightBlightness( void ) // バックライト輝度調整 void SYSM_SetBackLightBrightness( u8 brightness ) { - if( brightness > LCFG_TWL_BACKLIGHT_LEVEL_MAX ) { - OS_TPrintf( "Backlight brightness over! Change brightenss forcibly : %d -> %d\n", brightness, LCFG_TWL_BACKLIGHT_LEVEL_MAX ); - brightness = LCFG_TWL_BACKLIGHT_LEVEL_MAX; + if( brightness > BACKLIGHT_BRIGHTNESS_MAX ) { + OS_TPrintf( "Backlight brightness over! Change brightenss forcibly : %d -> %d\n", brightness, BACKLIGHT_BRIGHTNESS_MAX ); + brightness = BACKLIGHT_BRIGHTNESS_MAX; } #ifdef SDK_SUPPORT_PMIC_2 if ( SYSMi_GetMcuVersion() <= 1 ) diff --git a/build/libraries_sysmenu/util/ARM9/src/device.c b/build/libraries_sysmenu/util/ARM9/src/device.c index 3793936a..5e123c6d 100644 --- a/build/libraries_sysmenu/util/ARM9/src/device.c +++ b/build/libraries_sysmenu/util/ARM9/src/device.c @@ -83,9 +83,9 @@ u8 SYSM_GetBackLightBlightness( void ) // バックライト輝度調整 void SYSM_SetBackLightBrightness( u8 brightness ) { - if( brightness > LCFG_TWL_BACKLIGHT_LEVEL_MAX ) { - OS_TPrintf( "Backlight brightness over! Change brightenss forcibly : %d -> %d\n", brightness, LCFG_TWL_BACKLIGHT_LEVEL_MAX ); - brightness = LCFG_TWL_BACKLIGHT_LEVEL_MAX; + if( brightness > BACKLIGHT_BRIGHTNESS_MAX ) { + OS_TPrintf( "Backlight brightness over! Change brightenss forcibly : %d -> %d\n", brightness, BACKLIGHT_BRIGHTNESS_MAX ); + brightness = BACKLIGHT_BRIGHTNESS_MAX; } #ifdef SDK_SUPPORT_PMIC_2 if ( SYSMi_GetMcuVersion() <= 1 ) diff --git a/build/libraries_sysmenu/util/ARM9/src/util.c b/build/libraries_sysmenu/util/ARM9/src/util.c index bd90a81d..e3f6ccdc 100644 --- a/build/libraries_sysmenu/util/ARM9/src/util.c +++ b/build/libraries_sysmenu/util/ARM9/src/util.c @@ -28,6 +28,36 @@ static s64 UTLi_CalcRTCSecOffset( RTCDate *datep, RTCTime *timep ); // const data ----------------------------------------- // function's description------------------------------- + +//====================================================================== +// バックライト +//====================================================================== + +// バックライト輝度セット +u32 UTL_SetBacklightBrightness( u8 brightness ) +{ + brightness %= ( BACKLIGHT_BRIGHTNESS_MAX + 1 ); + return PM_SendUtilityCommand( PMi_UTIL_SET_BACKLIGHT_BRIGHTNESS, (u16)brightness, NULL ); +} + + +// バックライト輝度 +u32 UTL_GetBacklightBrightness( u8 *pBrightness ) +{ + u16 status; + u32 result = PM_SendUtilityCommand( PM_UTIL_GET_STATUS, PMi_UTIL_GET_BACKLIGHT_BRIGHTNESS, &status); + + if ( result == PM_RESULT_SUCCESS ) + { + if (pBrightness) + { + *pBrightness = (u8)status; + } + } + return result; +} + + //====================================================================== // タッチパネル //====================================================================== diff --git a/build/systemMenu_RED/Launcher/ARM9/src/launcher.c b/build/systemMenu_RED/Launcher/ARM9/src/launcher.c index c8ce1d22..6269f238 100644 --- a/build/systemMenu_RED/Launcher/ARM9/src/launcher.c +++ b/build/systemMenu_RED/Launcher/ARM9/src/launcher.c @@ -516,7 +516,7 @@ static void ProcessBackLightPads( void ) static BOOL dw_bl_bak = FALSE; BOOL up_bl_trg = FALSE; BOOL dw_bl_trg = FALSE; - int brightness; + u8 brightness = 0; if(tpd.disp.touch) { BOOL up_bl = WithinRangeTP( B_LIGHT_UP_BUTTON_TOP_X, B_LIGHT_UP_BUTTON_TOP_Y, @@ -533,18 +533,18 @@ static void ProcessBackLightPads( void ) } if( (pad.trg & PAD_KEY_UP) || up_bl_trg ) { - brightness = SYSM_GetBackLightBlightness() + 1; - if( brightness > LCFG_TWL_BACKLIGHT_LEVEL_MAX ) { - brightness = LCFG_TWL_BACKLIGHT_LEVEL_MAX; + (void)UTL_GetBacklightBrightness( &brightness ); + if( ++brightness > BACKLIGHT_BRIGHTNESS_MAX ) { + brightness = BACKLIGHT_BRIGHTNESS_MAX; } - SYSM_SetBackLightBrightness( (u8)brightness ); + (void)UTL_SetBacklightBrightness( brightness ); } if( ( pad.trg & PAD_KEY_DOWN) || dw_bl_trg ) { - brightness = SYSM_GetBackLightBlightness() - 1; - if( brightness < 0 ) { + (void)UTL_GetBacklightBrightness( &brightness ); + if( --brightness < 0 ) { brightness = 0; } - SYSM_SetBackLightBrightness( (u8)brightness ); + (void)UTL_SetBacklightBrightness( brightness ); } } diff --git a/build/systemMenu_RED/Launcher/ARM9/src/main.c b/build/systemMenu_RED/Launcher/ARM9/src/main.c index c5afe66e..7a5bad9b 100644 --- a/build/systemMenu_RED/Launcher/ARM9/src/main.c +++ b/build/systemMenu_RED/Launcher/ARM9/src/main.c @@ -26,7 +26,7 @@ // extern data----------------------------------------------------------------- // define data----------------------------------------------------------------- - +#define DISABLE_WLFIRM_LOAD // function's prototype------------------------------------------------------- static void INTR_VBlank( void ); static void deleteTmp(); diff --git a/build/systemMenu_RED/MachineSettings/ARM9/Makefile b/build/systemMenu_RED/MachineSettings/ARM9/Makefile index e1230060..e48ae424 100644 --- a/build/systemMenu_RED/MachineSettings/ARM9/Makefile +++ b/build/systemMenu_RED/MachineSettings/ARM9/Makefile @@ -100,7 +100,7 @@ ifeq ($(ENABLE_AES),TRUE) MAKEROM_FLAGS += -a endif -MAKEROM_ARM7_BASE = $(TWL_COMPONENTSDIR)/armadillo/$(TWL_BUILDTYPE_ARM7)/armadillo +MAKEROM_ARM7_BASE = $(TWL_COMPONENTSDIR)/armadillo2/$(TWL_BUILDTYPE_ARM7)/armadillo2 MAKEROM_ARM7 = $(MAKEROM_ARM7_BASE).$(TWL_ELF_EXT) MAKEROM = $(TWL_TOOLSDIR)/bin/makerom.TWL.secure.exe