mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
systemMenuにてバナーのロードと表示テスト
座標128,128に一つだけバナーを表示 git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@86 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
7e34d9629d
commit
8c5114c3a1
@ -143,5 +143,5 @@ RomSpec
|
|||||||
Segment ALL
|
Segment ALL
|
||||||
HostRoot ../../data
|
HostRoot ../../data
|
||||||
Root /data
|
Root /data
|
||||||
File NTR_IPL_font_m.NFTR
|
File NTR_IPL_font_m.NFTR myGameBanner.bnr
|
||||||
}
|
}
|
||||||
@ -106,6 +106,54 @@ static const u16 *const str_backlight[] = {
|
|||||||
// ランチャー
|
// ランチャー
|
||||||
//======================================================
|
//======================================================
|
||||||
|
|
||||||
|
// きめうちバナー
|
||||||
|
#define DBGBNR
|
||||||
|
#ifdef DBGBNR
|
||||||
|
|
||||||
|
#define MAX_TITLE_PROPERTY 40
|
||||||
|
static BannerFile *banner;
|
||||||
|
static TitleProperty tp[MAX_TITLE_PROPERTY];
|
||||||
|
static GXOamAttr banner_oam_attr;
|
||||||
|
|
||||||
|
// バナー画像のロード及びOBJ関係初期化
|
||||||
|
static void BannerInit()
|
||||||
|
{
|
||||||
|
int l;
|
||||||
|
u32 size = CMN_LoadFile( (void **)&banner, "data/myGameBanner.bnr", &g_allocator);
|
||||||
|
NNS_G2D_ASSERT( size > 0 );
|
||||||
|
|
||||||
|
GX_SetVisiblePlane(GX_PLANEMASK_OBJ | GX_PLANEMASK_BG0); // display only OBJ&BG0
|
||||||
|
GX_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_32K); // 2D mapping mode
|
||||||
|
GX_LoadOBJPltt( banner->v1.pltt, 0, BNR_PLTT_SIZE );
|
||||||
|
GX_LoadOBJ(banner->v1.image, 0x20, BNR_IMAGE_SIZE);
|
||||||
|
G2_SetOBJAttr( &banner_oam_attr, // OAM pointer
|
||||||
|
128, // X position
|
||||||
|
128, // Y position
|
||||||
|
0, // Priority
|
||||||
|
GX_OAM_MODE_NORMAL, // Bitmap mode
|
||||||
|
FALSE, // mosaic off
|
||||||
|
GX_OAM_EFFECT_NONE, // affine off
|
||||||
|
GX_OAM_SHAPE_32x32, // 32x32 size
|
||||||
|
GX_OAM_COLOR_16, // 16 color
|
||||||
|
1, // charactor
|
||||||
|
0, // palette
|
||||||
|
0); // affine
|
||||||
|
DC_FlushRange(&banner_oam_attr, sizeof(banner_oam_attr));
|
||||||
|
for(l=0;l<MAX_TITLE_PROPERTY;l++)
|
||||||
|
{
|
||||||
|
tp[l].titleID = 0;
|
||||||
|
tp[l].pBanner = banner;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void BannerDraw()
|
||||||
|
{
|
||||||
|
GX_LoadOAM(&banner_oam_attr, 0, sizeof(banner_oam_attr));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //DBGBNR
|
||||||
|
|
||||||
|
|
||||||
// ランチャーの初期化
|
// ランチャーの初期化
|
||||||
void LauncherInit( TitleProperty *pTitleList )
|
void LauncherInit( TitleProperty *pTitleList )
|
||||||
{
|
{
|
||||||
@ -138,6 +186,10 @@ void LauncherInit( TitleProperty *pTitleList )
|
|||||||
GX_SetVisiblePlane( GX_PLANEMASK_BG0 );
|
GX_SetVisiblePlane( GX_PLANEMASK_BG0 );
|
||||||
GX_DispOn();
|
GX_DispOn();
|
||||||
GXS_DispOn();
|
GXS_DispOn();
|
||||||
|
|
||||||
|
#ifdef DBGBNR
|
||||||
|
BannerInit();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -191,6 +243,10 @@ TitleProperty *LauncherMain( TitleProperty *pTitleList )
|
|||||||
|
|
||||||
DrawMenu( s_csr, &s_launcherParam );
|
DrawMenu( s_csr, &s_launcherParam );
|
||||||
|
|
||||||
|
#ifdef DBGBNR
|
||||||
|
BannerDraw();
|
||||||
|
#endif
|
||||||
|
|
||||||
if( ( pad.trg & PAD_BUTTON_A ) || ( tp_select ) ) { // メニュー項目への分岐
|
if( ( pad.trg & PAD_BUTTON_A ) || ( tp_select ) ) { // メニュー項目への分岐
|
||||||
if( s_launcherPos[ 0 ].enable ) {
|
if( s_launcherPos[ 0 ].enable ) {
|
||||||
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_WHITE );
|
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_WHITE );
|
||||||
@ -238,4 +294,3 @@ static void DrawBackLightSwitch(void)
|
|||||||
str_backlight[ GetNCDWork()->option.backLightOffFlag ] );
|
str_backlight[ GetNCDWork()->option.backLightOffFlag ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
build/systemMenu_RED/data/myGameBanner.bnr
Normal file
BIN
build/systemMenu_RED/data/myGameBanner.bnr
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user