From 1aca2cd07f459a42fd71f0716de6164a940cde93 Mon Sep 17 00:00:00 2001 From: zurachu Date: Sun, 16 Jul 2017 22:34:55 +0900 Subject: [PATCH 1/4] =?UTF-8?q?msgView=20=E3=81=AF=20BOOL=20=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=81=AA=E3=81=8F=20int=20=E3=81=A0=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=80=81=20TRUE/FALSE=20=E3=82=92=201/0=20?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 1e2c612..3f20761 100644 --- a/main.c +++ b/main.c @@ -316,7 +316,7 @@ void pceth2_waitKey() play.gameMode = GM_SCRIPT; } else if (pcePadGet() & TRG_B) { if (!pceth2_isCalenderMode()) { // ƒJƒŒƒ“ƒ_[‚ΜŽž‚͏Α‚Ή‚Θ‚’ - msgView = FALSE; + msgView = 0; Ldirect_VBuffView(FALSE); // •ΆŽšΑ‹Ž Ldirect_Update(); } @@ -325,7 +325,7 @@ void pceth2_waitKey() else // ƒƒbƒZ[ƒW”ρ•\Ž¦σ‘Τ { if (pcePadGet() & (TRG_A | TRG_B)) { - msgView = TRUE; + msgView = 1; Ldirect_VBuffView(TRUE); // ƒƒbƒZ[ƒW•\Ž¦ Ldirect_Update(); } From 1c6990a3147758dcda16cff724a6f28d6cf5da0b Mon Sep 17 00:00:00 2001 From: zurachu Date: Sun, 16 Jul 2017 22:58:36 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E3=82=AD=E3=83=BC=E5=BE=85=E3=81=A1?= =?UTF-8?q?=E6=99=82=E3=81=ABB=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92?= =?UTF-8?q?=E6=8A=BC=E3=81=97=E3=81=9F=E6=99=82=E3=80=813=E7=A7=92?= =?UTF-8?q?=E9=96=93=E8=BC=9D=E5=BA=A6=E3=80=81=E9=9F=B3=E9=87=8F=E3=82=92?= =?UTF-8?q?=E7=94=BB=E9=9D=A2=E4=B8=8A=E9=83=A8=E3=81=AB=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit δΈŠδΈ‹ε·¦ε³γƒœγ‚Ώγƒ³γ§θΌεΊ¦γ€ιŸ³ι‡γ‚’ζ“δ½œγ—γŸγ‚‰ε†θ‘¨η€Ίγ™γ‚‹γ€‚ --- main.c | 57 ++++++++++++++++++++++++++++++++++++++++++---------- pceth2_sav.c | 1 - 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/main.c b/main.c index 3f20761..26bb76e 100644 --- a/main.c +++ b/main.c @@ -55,12 +55,14 @@ BOOL file_load = FALSE; // ƒtƒ@ƒCƒ‹‚πŠJ‚―‚½‚©‚Η‚€‚© int speed, wait, msgView; +static int bButtonMenuTime = 0; static PrecisionTimer s_frame_timer; static unsigned long s_frame_us, s_proc_us; int pceth2_readScript(SCRIPT_DATA *s); void pceth2_waitKey(); +void pceth2_drawBMenu(); //============================================================================= //============================================================================= @@ -91,6 +93,7 @@ void pceAppInit(void) { return; } + Ldirect_VBuffView(TRUE); pceLCDDispStop(); FontProxy_Hook_Set(); @@ -317,34 +320,66 @@ void pceth2_waitKey() } else if (pcePadGet() & TRG_B) { if (!pceth2_isCalenderMode()) { // ƒJƒŒƒ“ƒ_[‚ΜŽž‚͏Α‚Ή‚Θ‚’ msgView = 0; - Ldirect_VBuffView(FALSE); // •ΆŽšΑ‹Ž - Ldirect_Update(); + Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); + pceth2_drawBMenu(); } } } else // ƒƒbƒZ[ƒW”ρ•\Ž¦σ‘Τ { + if(bButtonMenuTime > 0) { + if(--bButtonMenuTime == 0) { + Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); + } + } if (pcePadGet() & (TRG_A | TRG_B)) { msgView = 1; - Ldirect_VBuffView(TRUE); // ƒƒbƒZ[ƒW•\Ž¦ + Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); + FontFuchi_SetPos(MSG_X_MIN, MSG_Y_MIN); + FontFuchi_PutStr(play.msg); // ƒƒbƒZ[ƒW Ldirect_Update(); } // {γ‰ΊΆ‰E‚ΕƒRƒ“ƒgƒ‰ƒXƒgA‰Ή—Κ‚Μ’²ί - if (pcePadGet() & TRG_LF && global.bright > 0) { - pceLCDSetBright(--global.bright); + if (pcePadGet() & TRG_LF) { + if(global.bright > 0) { + pceLCDSetBright(--global.bright); + } + pceth2_drawBMenu(); } - if (pcePadGet() & TRG_RI && global.bright < 63) { - pceLCDSetBright(++global.bright); + if (pcePadGet() & TRG_RI) { + if(global.bright < 63) { + pceLCDSetBright(++global.bright); + } + pceth2_drawBMenu(); } - if (pcePadGet() & TRG_DN && global.masteratt < 127) { - pceWaveSetMasterAtt(++global.masteratt); + if (pcePadGet() & TRG_DN) { + if(global.masteratt < 127) { + pceWaveSetMasterAtt(++global.masteratt); + } + pceth2_drawBMenu(); } - if (pcePadGet() & TRG_UP && global.masteratt > 0) { - pceWaveSetMasterAtt(--global.masteratt); + if (pcePadGet() & TRG_UP) { + if(global.masteratt > 0) { + pceWaveSetMasterAtt(--global.masteratt); + } + pceth2_drawBMenu(); } } } +void pceth2_drawBMenu() +{ + pceLCDPaint(0, 0, 0, DISP_X, 6); + pceFontSetType(2); + pceFontSetPos(0, 0); + pceFontSetTxColor(3); + pceFontSetBkColor(FC_SPRITE); + pceFontPrintf("<>BRIGHT:%2d ^VOL:%3d", global.bright, 127 - global.masteratt); + pceFontPut(48, 1, 'v'); + Ldirect_Update(); + bButtonMenuTime = 3 * 1000 / PROC_PERIOD; +} + /* * ƒXƒNƒŠƒvƒg‚π“Η‚ή * return 1‚ΜŠΤpceAppProc()‚©‚ηŒJ‚θ•Τ‚΅‚ΔŒΔ‚Ρo‚³‚κ‚ι diff --git a/pceth2_sav.c b/pceth2_sav.c index f467058..1e49ca6 100644 --- a/pceth2_sav.c +++ b/pceth2_sav.c @@ -166,7 +166,6 @@ void pceth2_TitleInit() FontFuchi_PutStr("‚‚«‚©‚η"); FontFuchi_Put(28, 56 + index * 12, '>'); FontFuchi_Put(28 + 65, 56 + index * 12, '<'); - Ldirect_VBuffView(TRUE); Ldirect_Update(); play.gameMode = GM_TITLE; From 1b095354a03579d24c083d82a1b5727c9ea51a91 Mon Sep 17 00:00:00 2001 From: zurachu Date: Sun, 16 Jul 2017 23:27:22 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E9=9D=9E=E8=A1=A8=E7=A4=BA=E7=8A=B6=E6=85=8B=E3=81=8B?= =?UTF-8?q?=E3=82=89=E3=81=AE=E5=BE=A9=E5=B8=B0=E3=81=A8=E3=82=BB=E3=83=BC?= =?UTF-8?q?=E3=83=96=E3=83=BB=E3=83=AD=E3=83=BC=E3=83=89=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=81=8B=E3=82=89=E3=81=AE=E5=BE=A9=E5=B8=B0=E3=81=A7=E3=81=AE?= =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=82=92=E5=85=B1=E9=80=9A=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 6 +----- pceth2_msg.c | 17 +++++++++++++++++ pceth2_msg.h | 1 + pceth2_sav.c | 13 ++----------- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/main.c b/main.c index 26bb76e..86faa4b 100644 --- a/main.c +++ b/main.c @@ -333,11 +333,7 @@ void pceth2_waitKey() } } if (pcePadGet() & (TRG_A | TRG_B)) { - msgView = 1; - Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); - FontFuchi_SetPos(MSG_X_MIN, MSG_Y_MIN); - FontFuchi_PutStr(play.msg); // ƒƒbƒZ[ƒW - Ldirect_Update(); + pceth2_comeBackMessage(); } // {γ‰ΊΆ‰E‚ΕƒRƒ“ƒgƒ‰ƒXƒgA‰Ή—Κ‚Μ’²ί if (pcePadGet() & TRG_LF) { diff --git a/pceth2_msg.c b/pceth2_msg.c index 5cb4212..cacd28c 100644 --- a/pceth2_msg.c +++ b/pceth2_msg.c @@ -19,6 +19,7 @@ #include "pceth2_msg.h" #include "pceth2_sys.h" #include "pceth2_str.h" +#include "pceth2_sel.h" //============================================================================= // •ΆŽš•`‰ζ @@ -64,6 +65,22 @@ void pceth2_clearMessage(void) play.msglen = 0; } +/* + * ƒƒbƒZ[ƒW‚π•œ‹A + */ +void pceth2_comeBackMessage(void) +{ + Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); + FontFuchi_SetPos(MSG_X_MIN, MSG_Y_MIN); + FontFuchi_PutStr(play.msg); + + if (play.gameMode == GM_SELECT || play.gameMode == GM_MAPSELECT) { // ‘I‘𒆂Ȃη–ξˆσ•`‰ζ + pceth2_drawSelArrow(); + } + msgView = 1; + Ldirect_Update(); +} + /* * 2ƒoƒCƒg•ΆŽš‚π•`‚’‚āAƒƒbƒZ[ƒWƒoƒbƒtƒ@‚Ι‚ΰ“ό‚κ‚ι */ diff --git a/pceth2_msg.h b/pceth2_msg.h index c6d97a4..5c143ad 100644 --- a/pceth2_msg.h +++ b/pceth2_msg.h @@ -15,6 +15,7 @@ BOOL pceth2_isPageTop(); void pceth2_setPageTop(); void pceth2_clearMessage(void); +void pceth2_comeBackMessage(void); void pceth2_putKanji(const char *str); void pceth2_putCR(void); diff --git a/pceth2_sav.c b/pceth2_sav.c index 1e49ca6..67c0ab7 100644 --- a/pceth2_sav.c +++ b/pceth2_sav.c @@ -15,7 +15,6 @@ #include "pceth2_grp.h" #include "pceth2_snd.h" #include "pceth2_cal.h" -#include "pceth2_sel.h" #include "pceth2_msg.h" #include "pceth2_arc.h" @@ -374,14 +373,6 @@ static void pceth2_comeBack(int musplay_flag) play.evData.data = fpk_getEntryData(play.evData.name, &play.evData.size, NULL); // EV play.scData.data = fpk_getEntryData(play.scData.name, &play.scData.size, NULL); // ƒXƒNƒŠƒvƒg - FontFuchi_PutStr("\n"); // ‚Θ‚ρ‚©’m‚η‚ρ‚―‚Η–³‘Κ‰όs“ό‚κ‚Δ‚¨‚©‚Θ‚’‚ΖƒƒbƒZ[ƒW‚ΜŒγ‚λ‚Ι‰όs‚ͺ“ό‚ι - Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); - FontFuchi_SetPos(MSG_X_MIN, MSG_Y_MIN); - FontFuchi_PutStr(play.msg); // ƒƒbƒZ[ƒW - - if (play.gameMode == GM_SELECT || play.gameMode == GM_MAPSELECT) { // ‘I‘𒆂Ȃη–ξˆσ•`‰ζ - pceth2_drawSelArrow(); - } - msgView = 1; - Ldirect_Update(); + pceth2_comeBackMessage(); } + From a4c917674277c177162a31ed55b711bef86f0aec Mon Sep 17 00:00:00 2001 From: zurachu Date: Sun, 16 Jul 2017 23:39:49 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=E9=81=B8=E6=8A=9E=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=80=81=E3=83=9E=E3=83=83=E3=83=97=E9=81=B8=E6=8A=9E=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E3=81=A7=E3=82=82B=E3=83=9C=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E3=81=A7=E9=81=B8=E6=8A=9E=E8=82=A2=E3=82=92=E9=9D=9E=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=AB=E3=81=97=E3=81=A6=E3=80=81=E8=BC=9D=E5=BA=A6?= =?UTF-8?q?=E3=80=81=E9=9F=B3=E9=87=8F=E8=AA=BF=E6=95=B4=E3=81=8C=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.h | 2 ++ main.c | 71 ++++++++++++++++++++++++++++------------------------ pceth2_sel.c | 53 +++++++++++++++++++++++---------------- 3 files changed, 72 insertions(+), 54 deletions(-) diff --git a/common.h b/common.h index aac3de6..d9fea13 100644 --- a/common.h +++ b/common.h @@ -88,5 +88,7 @@ extern unsigned short reg[]; extern int msgView, speed, wait; void pceth2_Init(); +void pceth2_bButtonMenu(); +void pceth2_drawBButtonMenu(); #endif diff --git a/main.c b/main.c index 86faa4b..abd25cd 100644 --- a/main.c +++ b/main.c @@ -62,7 +62,7 @@ static unsigned long s_frame_us, s_proc_us; int pceth2_readScript(SCRIPT_DATA *s); void pceth2_waitKey(); -void pceth2_drawBMenu(); +void pceth2_drawBButtonMenu(); //============================================================================= //============================================================================= @@ -319,52 +319,57 @@ void pceth2_waitKey() play.gameMode = GM_SCRIPT; } else if (pcePadGet() & TRG_B) { if (!pceth2_isCalenderMode()) { // ƒJƒŒƒ“ƒ_[‚ΜŽž‚͏Α‚Ή‚Θ‚’ - msgView = 0; - Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); - pceth2_drawBMenu(); + pceth2_drawBButtonMenu(); } } } else // ƒƒbƒZ[ƒW”ρ•\Ž¦σ‘Τ { - if(bButtonMenuTime > 0) { - if(--bButtonMenuTime == 0) { - Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); - } - } - if (pcePadGet() & (TRG_A | TRG_B)) { - pceth2_comeBackMessage(); + pceth2_bButtonMenu(); + } +} + +void pceth2_bButtonMenu() +{ + if(bButtonMenuTime > 0) { + if(--bButtonMenuTime == 0) { + Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); } - // {γ‰ΊΆ‰E‚ΕƒRƒ“ƒgƒ‰ƒXƒgA‰Ή—Κ‚Μ’²ί - if (pcePadGet() & TRG_LF) { - if(global.bright > 0) { - pceLCDSetBright(--global.bright); - } - pceth2_drawBMenu(); + } + if (pcePadGet() & (TRG_A | TRG_B)) { + pceth2_comeBackMessage(); + } + // {γ‰ΊΆ‰E‚ΕƒRƒ“ƒgƒ‰ƒXƒgA‰Ή—Κ‚Μ’²ί + if (pcePadGet() & TRG_LF) { + if(global.bright > 0) { + pceLCDSetBright(--global.bright); } - if (pcePadGet() & TRG_RI) { - if(global.bright < 63) { - pceLCDSetBright(++global.bright); - } - pceth2_drawBMenu(); + pceth2_drawBButtonMenu(); + } + if (pcePadGet() & TRG_RI) { + if(global.bright < 63) { + pceLCDSetBright(++global.bright); } - if (pcePadGet() & TRG_DN) { - if(global.masteratt < 127) { - pceWaveSetMasterAtt(++global.masteratt); - } - pceth2_drawBMenu(); + pceth2_drawBButtonMenu(); + } + if (pcePadGet() & TRG_DN) { + if(global.masteratt < 127) { + pceWaveSetMasterAtt(++global.masteratt); } - if (pcePadGet() & TRG_UP) { - if(global.masteratt > 0) { - pceWaveSetMasterAtt(--global.masteratt); - } - pceth2_drawBMenu(); + pceth2_drawBButtonMenu(); + } + if (pcePadGet() & TRG_UP) { + if(global.masteratt > 0) { + pceWaveSetMasterAtt(--global.masteratt); } + pceth2_drawBButtonMenu(); } } -void pceth2_drawBMenu() +void pceth2_drawBButtonMenu() { + msgView = 0; + Ldirect_VBuffClear(0, 0, DISP_X, DISP_Y); pceLCDPaint(0, 0, 0, DISP_X, 6); pceFontSetType(2); pceFontSetPos(0, 0); diff --git a/pceth2_sel.c b/pceth2_sel.c index cc5d47e..3d8b706 100644 --- a/pceth2_sel.c +++ b/pceth2_sel.c @@ -47,33 +47,44 @@ void pceth2_drawSelArrow() int pceth2_SelectEx(int amount) { - static BOOL LCDUpdate = FALSE; + BOOL LCDUpdate = FALSE; - if (pcePadGet() & TRG_UP) { // ͺ - play.selIndex = (play.selIndex + amount - 1) % amount; - LCDUpdate = TRUE; - } - if (pcePadGet() & TRG_DN) { // « - play.selIndex = (play.selIndex + 1) % amount; - LCDUpdate = TRUE; - } + if (msgView) // ƒƒbƒZ[ƒW•\Ž¦σ‘Τ + { + if (pcePadGet() & TRG_UP) { // ͺ + play.selIndex = (play.selIndex + amount - 1) % amount; + LCDUpdate = TRUE; + } + if (pcePadGet() & TRG_DN) { // « + play.selIndex = (play.selIndex + 1) % amount; + LCDUpdate = TRUE; + } - if (LCDUpdate) { - if (play.gameMode == GM_MAPSELECT) { // ƒ}ƒbƒv‘I‘π‚Ν - pceth2_loadMapChipChara(); // ƒ`ƒbƒvƒLƒƒƒ‰‚ΰ•`‚«‘Φ‚¦ + if (LCDUpdate) { + if (play.gameMode == GM_MAPSELECT) { // ƒ}ƒbƒv‘I‘π‚Ν + pceth2_loadMapChipChara(); // ƒ`ƒbƒvƒLƒƒƒ‰‚ΰ•`‚«‘Φ‚¦ + } + pceth2_drawSelArrow(); // –ξˆσ + Ldirect_Update(); + LCDUpdate = FALSE; } - pceth2_drawSelArrow(); // –ξˆσ - Ldirect_Update(); - LCDUpdate = FALSE; - } - if (pcePadGet() & TRG_A) { // A - pceth2_setPageTop(); - pceth2_clearMessage(); - Ldirect_Update(); + if (pcePadGet() & TRG_A) { // A + pceth2_setPageTop(); + pceth2_clearMessage(); + Ldirect_Update(); - return play.selIndex; + return play.selIndex; + } else if (pcePadGet() & TRG_B) { + pceth2_drawBButtonMenu(); + } + } + else // ƒƒbƒZ[ƒW”ρ•\Ž¦σ‘Τ + { + pceth2_bButtonMenu(); } + + return NO_SELECT; }