From 1fd070e9856c3abb54a7dda9be275dcef96610a6 Mon Sep 17 00:00:00 2001 From: kamikawa Date: Mon, 14 Jul 2008 12:15:56 +0000 Subject: [PATCH] =?UTF-8?q?DS=E3=81=AE=E3=83=9E=E3=82=A4=E3=82=AF=E4=B8=8D?= =?UTF-8?q?=E5=85=B7=E5=90=88=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=83=AA?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=AB=E5=9F=BA=E3=81=A5=E3=81=8D=E3=82=B9?= =?UTF-8?q?=E3=83=94=E3=83=BC=E3=82=AB=E3=83=BC=E9=9F=B3=E9=87=8F=E3=82=92?= =?UTF-8?q?=E5=B0=8F=E3=81=95=E3=81=8F=E3=81=99=E3=82=8B=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82=EF=BC=88=E9=9F=B3=E9=87=8F?= =?UTF-8?q?=E3=81=AF=E6=9A=AB=E5=AE=9A=EF=BC=89=20CDC=5FGoDsMode=E3=81=AE?= =?UTF-8?q?=E5=89=8D=E3=81=ABCDC=5FInit=E3=82=92=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=82=92=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4=EF=BC=88IIR=E3=81=AA?= =?UTF-8?q?=E3=81=A9=E3=81=AE=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=81=8C=E6=B1=9A=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E6=80=A7=E3=81=8C=E3=81=82=E3=82=8B=E3=81=9F=E3=82=81?= =?UTF-8?q?=EF=BC=89?= 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@1881 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../libraries_sysmenu/boot/ARM7/src/bootAPI.c | 15 ++-- build/libraries_sysmenu/ds/ARM7/Makefile | 4 +- .../libraries_sysmenu/ds/ARM7/src/ds_volume.c | 86 +++++++++++++++++++ include/sysmenu/ds/common/ds.h | 2 +- 4 files changed, 99 insertions(+), 8 deletions(-) create mode 100644 build/libraries_sysmenu/ds/ARM7/src/ds_volume.c diff --git a/build/libraries_sysmenu/boot/ARM7/src/bootAPI.c b/build/libraries_sysmenu/boot/ARM7/src/bootAPI.c index 1f8d66cd..4f7dbb6d 100644 --- a/build/libraries_sysmenu/boot/ARM7/src/bootAPI.c +++ b/build/libraries_sysmenu/boot/ARM7/src/bootAPI.c @@ -309,16 +309,19 @@ static void BOOTi_RebootCallback( void** entryp, void* mem_list_v, REBOOTTarget* // I2S停止(MCLKは動作継続) reg_SND_SMX_CNT &= ~REG_SND_SMX_CNT_E_MASK; + // CODEC再初期化 + CDC_Init(); + + // CODEC-DSモードへの遷移 if ( isNtrMode || th->s.exFlags.codec_mode == OS_CODECMODE_NITRO ) { - // (CODEC-DSモード) + // マイク不具合DSタイトルは音量を絞る + if ( *target == REBOOT_TARGET_DS_APP ) + { + DS_CheckSpeakerVolume( dh ); + } CDC_GoDsMode(); } - else - { - // 再初期化(CODEC-TWLモード) - CDC_Init(); - } // I2S再開 // DSサウンド:DSP = 8:0 diff --git a/build/libraries_sysmenu/ds/ARM7/Makefile b/build/libraries_sysmenu/ds/ARM7/Makefile index 65e08736..c959afc0 100644 --- a/build/libraries_sysmenu/ds/ARM7/Makefile +++ b/build/libraries_sysmenu/ds/ARM7/Makefile @@ -26,12 +26,14 @@ TWL_PROC = ARM7 #---------------------------------------------------------------------------- -SRCDIR = ../common/src +SRCDIR = ./src \ + ../common/src INCDIR = ../common/include \ $(ROOT)/build/libraries/mb/common/include \ SRCS = ds_wlpatch.c \ + ds_volume.c TARGET_LIB = libds_sp$(TWL_LIBSUFFIX).a diff --git a/build/libraries_sysmenu/ds/ARM7/src/ds_volume.c b/build/libraries_sysmenu/ds/ARM7/src/ds_volume.c new file mode 100644 index 00000000..7f03806c --- /dev/null +++ b/build/libraries_sysmenu/ds/ARM7/src/ds_volume.c @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL + File: ds_volume.c + + 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$ + *---------------------------------------------------------------------------*/ + +#include +#include +#include +#include + +/*---------------------------------------------------------------------------* + 型宣言 + *---------------------------------------------------------------------------*/ + +typedef struct _DsSpecialSpeakerVolumeTitle +{ + u8 gamecode[6]; // NULL終端兼アライメント用に2バイト大きいサイズを与える + u8 rom_version; + u8 volume; +} DsSpecialSpeakerVolumeTitle; + +/*---------------------------------------------------------------------------* + 静的変数定義 + *---------------------------------------------------------------------------*/ + +static DsSpecialSpeakerVolumeTitle sList[] ATTRIBUTE_ALIGN(32) = +{ + { "AKEJ", 0, 0x40 }, + { "ABXJ", 0, 0x40 }, + { "ALHJ", 0, 0x40 }, + { "YFSJ", 0, 0x40 }, + { "AY8E", 0, 0x40 }, + { "YONJ", 0, 0x40 }, + { "ACCE", 0, 0x40 }, + { "AN9E", 0, 0x40 }, + { "A5HE", 0, 0x40 }, + { "A5IE", 0, 0x40 }, + { "AMHE", 0, 0x40 }, + { "A3TX", 0, 0x40 }, + { "YCQE", 0, 0x40 }, + { "YBOE", 0, 0x40 }, + { "ADAE", 5, 0x40 }, + { "APAE", 5, 0x40 }, + { "ACZY", 0, 0x40 }, + { "APYJ", 0, 0x40 }, + { "AY7P", 0, 0x40 }, + { "AWHP", 0, 0x40 }, + { "AWHE", 0, 0x40 }, + { "AOIJ", 0, 0x40 }, + { "AOIJ", 1, 0x40 }, + { "YO9J", 0, 0x40 }, + { "YYKJ", 0, 0x40 } +}; + +/*---------------------------------------------------------------------------* + グローバル関数定義 + *---------------------------------------------------------------------------*/ + +void DS_CheckSpeakerVolume( void* romHeaderNTR ) +{ + ROM_Header* dh = romHeaderNTR; + int i; + int limit = sizeof(sList)/sizeof(sList[0]); + for (i=0;is.game_code && + sList[i].rom_version == dh->s.rom_version) + { + CDC_WriteSpiRegisterEx( 1, REG_CDC1_SP_ANGVOL_L_ADDR, (u8)(CDC1_ANGVOL_E | sList[i].volume) ); + CDC_WriteSpiRegisterEx( 1, REG_CDC1_SP_ANGVOL_R_ADDR, (u8)(CDC1_ANGVOL_E | sList[i].volume) ); + break; + } + } +} diff --git a/include/sysmenu/ds/common/ds.h b/include/sysmenu/ds/common/ds.h index 479fe350..9081e3ae 100644 --- a/include/sysmenu/ds/common/ds.h +++ b/include/sysmenu/ds/common/ds.h @@ -29,7 +29,7 @@ extern "C" { #define DS_WLPATCH_COPYCODE_SIZE (10*4) void DS_InsertWLPatch( void* romHeaderNTR ); - +void DS_CheckSpeakerVolume( void* romHeaderNTR ); #ifdef __cplusplus } /* extern "C" */