OSDN Git Service

#xxxxx DTXViewerのプロジェクトを追加。
[dtxmania/dtxmania.git] / DTXViewerプロジェクト / @DTXViewerプロジェクト / ソースファイル / CStagePlay.cpp
diff --git a/DTXViewerプロジェクト/@DTXViewerプロジェクト/ソースファイル/CStagePlay.cpp b/DTXViewerプロジェクト/@DTXViewerプロジェクト/ソースファイル/CStagePlay.cpp
new file mode 100644 (file)
index 0000000..5c9e086
--- /dev/null
@@ -0,0 +1,900 @@
+#include "stdafx.h"
+// FDK includes
+#include "Debug.h"
+#include "DTX.h"
+// App includes
+#include "../resource.h"
+#include "DTXViewer.h"
+#include "CStage.h"
+#include "CStagePlay.h"
+#include "ActPlayAVI.h"
+#include "ActPlayBGA.h"
+
+namespace DTXViewer {
+       namespace Stage {
+               namespace Play {
+
+static RECT s_rcChips[28] = {
+       { 640,2,651,5 }, { 651,2,662,5 },                                                                                               // 0:BPM, 1:BPx
+       { 662,2,673,5 }, { 673,2,684,5 }, { 684,2,695,5 }, { 695,2,706,3 },                             // 2:HH, 3:SD, 4:BD, 5:HT
+       { 706,2,717,5 }, { 717,2,728,5 }, { 728,2,739,5 },                                                              // 6:LT, 7:FT, 8;CY
+       { 739,2,746,5 },                                                                                                                                // 9:FI
+       { 746,2,757,5 }, { 757,2,768,5 }, { 768,2,779,5 },                                                              // 10:BGM, 11:BGA, 12:AVI
+       { 779,2,790,5 }, { 790,2,801,5 }, { 801,2,812,5 }, { 812,2,819,3 },                             // 13:R1, 14:G1, 15:B1. 16:W1
+       { 819,2,830,5 }, { 830,2,841,5 }, { 841,2,852,5 }, { 852,2,859,3 },                             // 17:R1, 18:G1, 19:B1. 20:W1
+       { 859,2,870,5 }, { 870,2,881,5 }, { 881,2,892,5 }, { 892,2,903,3 }, { 903,2,914,5 },    // 21\81`25: SE1\81`5
+       { 879,2,914,5 },                                                                                                                                // 26: GuitarOPEN
+       { 914,2,925,5 }                                                                                                                                 // 27: LC
+};
+static RECT s_rcRing  = { 640, 5, 640+12, 5+12 };                                                                      // HHO,RD \82Ì\97Ö
+static RECT s_rcLine  = { 640, 0, 640+244, 1 };                                                                                // \8f¬\90ß\90ü
+static RECT s_rcSubLine  = { 640, 1, 640+244, 2 };                                                                     // \94\8f\90ü
+static RECT s_rcNums[10] = {
+       {   0,   0,  18,  31 }, {  18,   0,  36,  31 }, {  36,   0,  54,  31 }, {  54,   0,  72,  31 }, {  72,   0,  90,  31 },
+       {   0,  31,  18,  62 }, {  18,  31,  36,  62 }, {  36,  31,  54,  62 }, {  54,  31,  72,  62 }, {  72,  31,  90,  62 }
+};
+static const int s_n\83`\83\83\83\93\83l\83\8b0Ato\83\8c\81[\83\9307[10] = { 1,2,3,4,5,7,6,1,7,0 };
+
+CStagePlay::CStagePlay()
+{
+       this->str\83X\83e\81[\83W\96¼ = _T("\89\89\91t\89æ\96Ê");
+       this->stageID = STAGE_PLAY;
+       this->phaseID = PHASE_COMMON_\92Ê\8fí\8fó\91Ô;
+       this->bFirstWork = true;
+       this->bActivate = false;
+}
+//
+bool CStagePlay::Load( LPCTSTR strFileName )
+{
+       this->bLoading\97v\90¿\82 \82è = true;
+       this->strFileName = strFileName;
+
+       return true;
+}
+void CStagePlay::Play( int nPart )
+{
+       this->bPlaying\97v\90¿\82 \82è = true;
+       this->n\8aJ\8en\8f¬\90ß\94Ô\8d\86 = nPart;
+       if( this->n\8aJ\8en\8f¬\90ß\94Ô\8d\86 < 0 ) this->n\8aJ\8en\8f¬\90ß\94Ô\8d\86 = 0;
+}
+void CStagePlay::Stop()
+{
+       this->struct\89\89\91t\8fî\95ñ.b\89\89\91t\92\86 = false;
+
+       g_DTX.StopAllWaves();
+       this->actAVI.Stop();                    // AVI \92â\8e~
+       this->actBGA.Stop();                    // BGA \92â\8e~
+}
+void CStagePlay::SkipStart( double db\8aJ\8en\8e\9e\8d\8fms )
+{
+       DTX::Chip* pChip;
+       for( pChip = g_DTX.pChip; pChip != NULL; pChip = pChip->next )
+       {
+               if( pChip->dbTime >= db\8aJ\8en\8e\9e\8d\8fms )
+                       break;
+
+               this->ProcessCell( pChip, true );
+       }
+       this->struct\89\89\91t\8fî\95ñ.p\8c»\8dÝ\82Ì\83g\83b\83vChip = pChip;
+}
+//
+int     CStagePlay::MainWork()
+{
+       // \96ß\82è\92l: 0=\8cp\91±, 1=\89\89\91t\8fI\97¹, -1=\83A\83v\83\8a\8fI\97¹
+
+       // \94w\8ci\95`\89æ
+       RECT rc = { 0, 0, 640, 480 };
+       this->sfMap.Draw( 0, 0, &rc );
+
+       if( this->bLoading\97v\90¿\82 \82è )
+       {
+               this->bLoading\97v\90¿\82 \82è = false;
+               this->ctNowLoading\95\\8e¦.Start( 0, 50, 1, &g_Timer );
+               this->phaseID = PHASE_PLAY_LOADING1;
+       }
+
+       switch( this->phaseID )
+       {
+       case PHASE_PLAY_IDLE:
+               break;
+
+       case PHASE_PLAY_LOADING1: {
+               RECT rcNowLoading = { 640, 17, 640+229, 17+40 };
+               this->sfMap.Draw( 176-225/2, 180-41/2, &rcNowLoading );
+
+               this->ctNowLoading\95\\8e¦.Step();
+               if( this->ctNowLoading\95\\8e¦.b\8fI\97¹\92l\82É\92B\82µ\82½() )
+                       this->phaseID = PHASE_PLAY_LOADING2;
+               break;
+       }
+       case PHASE_PLAY_LOADING2:
+               if( this->tDTX\83t\83@\83C\83\8b\82Ì\93Ç\82Ý\8d\9e\82Ý() )
+                       this->phaseID = PHASE_PLAY_PLAYING1;
+               else {
+                       this->phaseID = PHASE_PLAY_IDLE;
+                       this->bPlaying\97v\90¿\82 \82è = false;
+               }
+               break;
+
+       case PHASE_PLAY_PLAYING1:
+               if( this->bPlaying\97v\90¿\82 \82è ) {
+                       this->t\8dÄ\90\8aJ\8en();
+                       this->phaseID = PHASE_PLAY_PLAYING2;
+               }
+               break;
+
+       case PHASE_PLAY_PLAYING2:
+               if( this->struct\89\89\91t\8fî\95ñ.b\89\89\91t\92\86 )
+               {
+                       // BGA\97Ì\88æ\82ð\83N\83\8a\83A
+                       {
+                               if( g_DTX.bUseAVI || g_DTX.bUseBMP || g_DTX.bUseBMPTEX )
+                               {
+                                       DDBLTFX ddbfx;
+                                       ZeroMemory( &ddbfx, sizeof( DDBLTFX ) );
+                                       ddbfx.dwSize = sizeof( DDBLTFX );
+                                       ddbfx.dwFillColor = 0xFF000000;
+                                       RECT rc = { BGA_X, BGA_Y, BGA_X+BGA_W, BGA_Y+BGA_H };
+                                       g_App.pddsBackBuffer->Blt( &rc, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbfx );
+                               }
+                       }
+                       //
+                       // \83`\83b\83v\90i\8ds\95`\89æ
+                       {
+                               if( this->struct\89\89\91t\8fî\95ñ.p\8c»\8dÝ\82Ì\83g\83b\83vChip == NULL ) {
+                                       this->Stop();
+                                       this->phaseID = PHASE_PLAY_IDLE;
+                                       return 1;       // \89\89\91t\8fI\97¹
+                               }
+
+                               // \83X\83N\83\8d\81[\83\8b\91¬\93x[dot/ms] \8eZ\8fo
+                               static const double BPM = 150.0;                        // BPM = \82P\8f¬\90ß\82Ì\92·\82³\82ª\81A150 BPM \82Å
+                               static const double LEN = 264.0;                        // LEN = 264 \83h\83b\83g
+                               static const double s_dbScrollSpeed = 2.0;      // \95\88\96Ê\83X\83N\83\8d\81[\83\8b\91¬\93x\81i\8cÅ\92è\81j
+                               double dbDotPerMS_D = ( s_dbScrollSpeed * 0.5       ) * ( BPM / 4.0 ) * LEN / 60000.0;
+                               double dbDotPerMS_G = ( s_dbScrollSpeed * 0.5 * 0.5 ) * ( BPM / 4.0 ) * LEN / 60000.0;
+                               double dbDotPerMS_B = ( s_dbScrollSpeed * 0.5 * 0.5 ) * ( BPM / 4.0 ) * LEN / 60000.0;
+
+                               // \83g\83b\83v\83Z\83\8b\82©\82ç\8f\87\94Ô\82É\81A\89æ\96Ê\82É\93ü\82é\82¾\82¯\95`\89æ\81B
+                               for( DTX::Chip* cell = this->struct\89\89\91t\8fî\95ñ.p\8c»\8dÝ\82Ì\83g\83b\83vChip; cell != NULL; cell = cell->next )
+                               {
+                                       // \83o\81[\82©\82ç\82Ì\8b\97\97£[dot] \8eZ\8fo
+                                       cell->nDotFromBarD = (long)( (cell->dbTime - g_Timer.Get() ) * dbDotPerMS_D );  // \83h\83\89\83\80\8aÖ\8cW\81A\82»\82Ì\91¼
+                                       cell->nDotFromBarG = (long)( (cell->dbTime - g_Timer.Get() ) * dbDotPerMS_G );  // \83M\83^\81[\8aÖ\8cW
+                                       cell->nDotFromBarB = (long)( (cell->dbTime - g_Timer.Get() ) * dbDotPerMS_B );  // \83x\81[\83X\8aÖ\8cW
+                               
+                                       if( MIN( MIN( cell->nDotFromBarD, cell->nDotFromBarG ), cell->nDotFromBarB ) > 480 )
+                                               break;  // \83h\83\89\83\80\81A\83M\83^\81[\81A\83x\81[\83X\82Ì\82¤\82¿\81A\88ê\94Ô\92Z\82¢\8b\97\97£\82ª\89æ\96Ê\95\9d\82æ\82è\91å\82«\82¢\82È\82ç\82»\82±\82Å\8fI\97¹\81B
+                               
+                                       // \83g\83b\83v\83Z\83\8b\93ü\82ê\91Ö\82¦\83`\83F\83b\83N\81G
+                                       // \89æ\96Ê\89º\92[\82æ\82è\89º\82È\82ç\83g\83b\83v\83Z\83\8b\93ü\82ê\91Ö\82¦\81i\83q\83b\83g\82µ\82Ä\96³\82¢\82È\82ç\82Ü\82¾\93ü\82ê\91Ö\82¦\82È\82¢\81j\81B
+                                       // \82 \82é\82¢\82Í\81A\83q\83b\83g\82µ\82Ä\82È\82­\82Ä\82à\81A-400\82ð\92´\82¦\82½\82ç\8b­\90§\93I\82É\93ü\82ê\91Ö\82¦\82é\81i\97\\96h\8dô\81j
+                                       if( cell == this->struct\89\89\91t\8fî\95ñ.p\8c»\8dÝ\82Ì\83g\83b\83vChip )
+                                       {
+                                               if( ( cell->nDotFromBarD < -65 && cell->bHit ) || cell->nDotFromBarD < -400 )           // nDotFromBar \82Í\83h\83\89\83\80\82Å\82à\83M\83^\81[\82Å\82à\82¢\82¢
+                                               {
+                                                       this->struct\89\89\91t\8fî\95ñ.p\8c»\8dÝ\82Ì\83g\83b\83vChip = this->struct\89\89\91t\8fî\95ñ.p\8c»\8dÝ\82Ì\83g\83b\83vChip->next;
+                                                       continue;
+                                               }
+                                       }
+
+                                       // \83`\83\83\83\93\83l\83\8b\82²\82Æ\82É\8f\88\97\9d
+                                       this->ProcessCell( cell, false );
+                               }
+                       }
+                       //
+                       // AVI \90i\8ds\95`\89æ
+                       {
+                               if( g_DTX.bUseAVI )
+                                       this->actAVI.MainWork( BGA_X, BGA_Y );
+                       }
+                       //
+                       // BGA \90i\8ds\95`\89æ
+                       {
+                               if( g_DTX.bUseBMP || g_DTX.bUseBMPTEX )
+                                       this->actBGA.MainWork( BGA_X, BGA_Y );
+                       }
+               }
+               break;
+       }
+
+       if( g_DirectInput.IsKeyPushDown( DIK_ESCAPE ) )
+               return -1;              // \83A\83v\83\8a\8fI\97¹
+
+       return 0;
+}
+bool CStagePlay::tDTX\83t\83@\83C\83\8b\82Ì\93Ç\82Ý\8d\9e\82Ý()
+{
+       this->Stop();
+
+       // \89\89\91t\8fî\95ñ\82ð\8f\89\8aú\89»\82·\82é
+       {
+               this->t\89\89\91t\8fî\95ñ\82ð\8f\89\8aú\89»\82·\82é();
+               g_DTX.Clear();
+       }
+       //
+       // DTX\82Ì\93Ç\82Ý\8d\9e\82Ý
+       {
+               if( ! g_DTX.Load( this->strFileName ) )
+               {
+                       Debug::Out( _T("DTX\83t\83@\83C\83\8b\82Ì\93Ç\82Ý\8d\9e\82Ý\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B(%s)\n"), this->strFileName.c_str() );
+                       return false;
+               }
+               g_DTX.LoadBMP();
+               g_DTX.LoadAVI();
+       }
+       //
+       // \8dÄ\90\91¬\93x\82Ì\90Ý\92è
+       {
+               g_DTX.SetSpeed( g_DTX.fSpeed ); // #DTXVPLAYSPEED: 
+       }
+       //
+       // \83E\83B\83\93\83h\83E\83^\83C\83g\83\8b\82ð\81u\8bÈ\96¼ [\8dì\8eÒ]\81v\82É\95Ï\8dX
+       {
+               TCHAR buf[ 1024 ];
+               _stprintf_s( buf, 1024, _T("%s [%s]"), g_DTX.strTitle.c_str(), g_DTX.strArtist.c_str() );
+               ::SetWindowText( g_App.hWnd, buf );
+       }
+       //
+       return true;
+}
+void CStagePlay::t\8dÄ\90\8aJ\8en()
+{
+       this->Stop();
+
+       // \8f¬\90ß\94Ô\8d\86 nPart \82©\82ç\8dÄ\90\8aJ\8en\8e\9e\8d\8f\82Æ\8dÄ\90\8aJ\8en\83`\83b\83v\82ð\8eZ\8fo;
+       // \8dÄ\90\8aJ\8en\8e\9e\8d\8f\82Í\8f¬\90ß\90ü\82Ì dbTime \82©\82ç\8eæ\93¾\81B\81i\95ª\89ð\94\\82Ì\94{\90\94\82Ì\88Ê\92u\82É\82Í\95K\82¸\83I\83u\83W\83F\83N\83g\81i\8f¬\90ß\90ü\81j\82ª\82 \82é\82Æ\82¢\82¤\91O\92ñ\81j
+       {
+               this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms = INIT_TIME;
+               this->struct\89\89\91t\8fî\95ñ.p\8c»\8dÝ\82Ì\83g\83b\83vChip = NULL;
+
+               for( DTX::Chip* cell = g_DTX.pChip; cell != NULL; cell = cell->next )
+               {
+                       if( cell->dwPosition >= (DWORD)( (this->n\8aJ\8en\8f¬\90ß\94Ô\8d\86+1) * DTX_RESOLVE ) )
+                       {
+                               this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms = cell->dbTime;
+                               break;
+                       }
+               }
+       }
+       //
+       // \89\89\91t\8aJ\8en
+       {
+               if( this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms != INIT_TIME )
+               {
+                       Debug::Out( _T("\89\89\91t\8aJ\8en\8e\9e\8d\8f = %e [ms]\n"), this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms );
+
+                       // \83^\83C\83}\83\8a\83Z\83b\83g\81\95\95`\89æ\8aJ\8en
+                       g_Timer.Reset();
+                       g_Timer.Set( this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms );                               // \8dÄ\90\8aJ\8en\8e\9e\8d\8f\83Z\83b\83g
+                       g_DTX.SkipStart( this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms );                   // \91S\83`\83b\83v\82É\82Â\82¢\82Ä dwStartTime \82É\8dÄ\90\92\86\82©\94Û\82©\92²\8d¸\82µ\81A\8dÄ\90\92\86\82È\82ç\93K\90Ø\82È\8cÂ\8f\8a\82É\8ae\8dÄ\90\83J\81[\83\\83\8b\82ð\88Ú\93®\82µ\82Ä\8dÄ\90
+                       this->actAVI.SkipStart( this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms );    // AVI \82Ì\89\89\91t\8aJ\8en
+                       this->actBGA.SkipStart( this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms );    // BGA \82Ì\89\89\91t\8aJ\8en
+                       this->SkipStart( this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms );                   // \83`\83b\83v\82Ì\89\89\91t\8aJ\8en(actBGA\82æ\82è\8cã\82Å\82 \82é\82±\82Æ; ChangeScope\82Ì\82½\82ß)
+                       this->struct\89\89\91t\8fî\95ñ.b\89\89\91t\92\86 = true;
+
+                       // \82Ü\82¾ Loading \91O\82Ì\89Â\94\\90«\82ª\8d\82\82¢\82Ì\82Å\81A\82±\82±\82Å\82Í this->phaseID \82Í\82¢\82\82ç\82È\82¢\81B
+               }
+       }
+}
+void CStagePlay::ProcessCell( DTX::Chip* pChip, bool bSkip )
+{
+       switch( pChip->nChannel )
+       {
+       // \83o\83b\83N\83R\81[\83\89\83X
+       case 0x01: {
+
+               // \83`\83b\83v\95`\89æ
+               if( ! pChip->bHit && ! bSkip )
+                       this->sfMap.Draw( 146, BAR_Y-pChip->nDotFromBarD-1, &s_rcChips[10] );
+
+               // \94­\90º\82µ\82Ä\82È\82¯\82ê\82Î\94­\90º\82·\82é
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+               {
+                       pChip->bHit = true;
+                       if( ! bSkip )
+                               g_DTX.PlayChip( pChip, 10, DTX_AUTOVOLUME );
+               }
+               break;
+       }
+       // BPM\95Ï\8dX
+       case 0x03: {
+               
+               // \95\\8e¦
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+                       this->sfMap.Draw( 2, BAR_Y-pChip->nDotFromBarD-1, &s_rcChips[0] );
+
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+               {
+                       // \95\\8e¦\97p BPM \82Ì\8dX\90V
+                       this->struct\89\89\91t\8fî\95ñ.db\8c»\8dÝ\82ÌBPM\81E\83f\83o\83b\83O\95\\8e¦\97p = pChip->nParam * g_DTX.fSpeed + g_DTX.dbBaseBPM;
+                       pChip->bHit = true;
+               }
+               break;
+       }
+       // BPM\95Ï\8dX\81i\8ag\92£\81j
+       case 0x08: {
+
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+                       this->sfMap.Draw( 14, BAR_Y-pChip->nDotFromBarD-1, &s_rcChips[1] );
+
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+               {
+                       pChip->bHit = true;
+                       
+                       for( DTX::BPM* bc = g_DTX.pBPMLast; bc != NULL; bc = bc->prev )
+                       {
+                               if( bc->num == pChip->nRealParam )
+                               {
+                                       // \95\\8e¦\97p BPM \82Ì\8dX\90V
+                                       this->struct\89\89\91t\8fî\95ñ.db\8c»\8dÝ\82ÌBPM\81E\83f\83o\83b\83O\95\\8e¦\97p = bc->bpm * g_DTX.fSpeed + g_DTX.dbBaseBPM;
+                                       break;
+                               }
+                       }
+               }
+               break;
+       }
+       // BGA
+       case 0x04: case 0x07: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x60: {
+       
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+                       this->sfMap.Draw( 158, BAR_Y-pChip->nDotFromBarD-1, &s_rcChips[11] );
+
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+               {
+                       pChip->bHit = true;
+                       if( bSkip ) break;
+
+                       switch( pChip->BGAtype )
+                       {
+                       case BGATYPE_BMP: {
+                               
+                               if( pChip->pBMP ) 
+                               {
+                                       // len = 0 \82È\82ç\93]\91\97\8c³\8fî\95ñ\82Ì\82Ý\97L\8cø\81B\81i\93]\91\97\90æ\8fî\95ñ\82Í 0 \82Å\82¢\82¢\81B\81j
+                                       this->actBGA.Start( pChip->nChannel, pChip->pBMP, NULL,
+                                               pChip->pBMP->pSurface->dwWidth, pChip->pBMP->pSurface->dwHeight, 0, 0,
+                                               0, 0, 0, 0,
+                                               0, 0, 0, 0,
+                                               0.0 );
+                               }
+                               break;
+                       }
+                       case BGATYPE_BMPTEX: {
+                               
+                               if( pChip->pBMPTEX )
+                               {
+                                       // len = 0 \82È\82ç\93]\91\97\8c³\8fî\95ñ\82Ì\82Ý\97L\8cø\81B\81i\93]\91\97\90æ\8fî\95ñ\82Í 0 \82Å\82¢\82¢\81B\81j
+                                       this->actBGA.Start( pChip->nChannel, NULL, pChip->pBMPTEX,
+                                               pChip->pBMPTEX->pTexture->dwWidth, pChip->pBMPTEX->pTexture->dwHeight, 0, 0,
+                                               0, 0, 0, 0,
+                                               0, 0, 0, 0,
+                                               0.0 );
+                               }
+                               break;
+                       }
+                       case BGATYPE_BGA: {
+                               
+                               if( pChip->pBGA && ( pChip->pBMP || pChip->pBMPTEX ) )
+                               {
+                                       // len = 0 \82È\82ç\93]\91\97\8c³\8fî\95ñ\82Ì\82Ý\97L\8cø\81B\81i\93]\91\97\90æ\8fî\95ñ\82Í 0 \82Å\82¢\82¢\81B\81j
+                                       this->actBGA.Start( pChip->nChannel, pChip->pBMP, pChip->pBMPTEX,
+                                               pChip->pBGA->x2 - pChip->pBGA->x1, pChip->pBGA->y2 - pChip->pBGA->y1, 0, 0, 
+                                               pChip->pBGA->x1, pChip->pBGA->y1, 0, 0,
+                                               pChip->pBGA->ox, pChip->pBGA->oy, 0, 0,
+                                               0.0 );
+                               }
+                               break;
+                       }
+                       case BGATYPE_BGAPAN: {
+                               
+                               if( pChip->pBGAPan && ( pChip->pBMP || pChip->pBMPTEX ) )
+                               {
+                                       this->actBGA.Start( pChip->nChannel, pChip->pBMP, pChip->pBMPTEX,
+                                               pChip->pBGAPan->sw, pChip->pBGAPan->sh, pChip->pBGAPan->ew, pChip->pBGAPan->eh,
+                                               pChip->pBGAPan->ssx, pChip->pBGAPan->ssy, pChip->pBGAPan->sex, pChip->pBGAPan->sey,
+                                               pChip->pBGAPan->dsx, pChip->pBGAPan->dsy, pChip->pBGAPan->dex, pChip->pBGAPan->dey,
+                                               pChip->dbLong );
+                }
+                               break;
+                       }
+                       }
+               }
+               break;
+       }
+       // BGA\83X\83R\81[\83v\89æ\91\9c\90Ø\82è\91Ö\82¦
+       case 0xC4: case 0xC7: case 0xD5: case 0xD6: case 0xD7: case 0xD8: case 0xD9: case 0xE0: {
+
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+                       this->sfMap.Draw( 158, BAR_Y-pChip->nDotFromBarD-1, &s_rcChips[11] );
+
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+               {
+                       pChip->bHit = true;
+
+                       if( pChip->BGAtype == BGATYPE_BMP || pChip->BGAtype == BGATYPE_BMPTEX )
+                       {
+                               static const int nCh[2][8] = {
+                                       { 0xC4, 0xC7, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xE0 },
+                                       { 0x04, 0x07, 0x55, 0x56, 0x57, 0x58, 0x59, 0x60 }
+                               };
+                               for( int i = 0; i < 8; i++)
+                                       if( nCh[0][i] == pChip->nChannel )
+                                               this->actBGA.ChangeScope( nCh[1][i], pChip->pBMP, pChip->pBMPTEX );
+                       }
+               }
+               break;
+       }
+       // \83h\83\89\83\80\83`\83b\83v
+       case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1A: {
+
+               int l = s_n\83`\83\83\83\93\83l\83\8b0Ato\83\8c\81[\83\9307[ pChip->nChannel - 0x11 ];
+
+               // \94­\90º\82µ\82Ä\82È\82¯\82ê\82Î\94­\90º\82·\82é
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) ) {
+                       if( ! bSkip )
+                               this->t\83T\83E\83\93\83h\8dÄ\90¶( pChip, PLAYPART_DRUMS, DTX_AUTOVOLUME );
+                       pChip->bHit   = true;
+               }
+
+               // \83`\83b\83v\82Ì\95`\89æ
+               if( ! pChip->bHit && ! bSkip && pChip->bVisible )
+               {
+                       // \83`\83b\83v\95`\89æ
+                       this->sfMap.Draw( 33+12*l, BAR_Y-pChip->nDotFromBarD-1, &s_rcChips[ (pChip->nChannel!=0x1A)? 1+l : 27 ] );
+
+                       // HHO,RD\82Í\83\8a\83\93\83O\82à\95`\89æ
+                       if( pChip->nChannel == 0x18 || pChip->nChannel == 0x19 )
+                               this->sfMap.Draw( 33+12*l, BAR_Y-pChip->nDotFromBarD-5, &s_rcRing );
+               }
+               break;
+       }
+       // \83h\83\89\83\80\83`\83b\83v\81i\95s\89Â\8e\8b\81j
+       case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: case 0x3A: {
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+                       pChip->bHit = true;             // \89½\82à\82µ\82È\82¢
+               break;
+       }
+       // \83h\83\89\83\80\83`\83b\83v\81i\8bó\82¤\82¿\8ew\92è\81j
+       case 0xB1: case 0xB2: case 0xB3: case 0xB4: case 0xB5: case 0xB6: case 0xB7: case 0xB8: case 0xB9: case 0xBC: {
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+                       pChip->bHit = true;             // \89½\82à\82µ\82È\82¢
+               break;
+       }
+       // \83M\83^\81[\83`\83b\83v
+       case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: {
+
+               // \94­\90º\82µ\82Ä\82È\82¯\82ê\82Î\94­\90º\82·\82é
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarG < 0 ) )
+               {
+                       if( ! bSkip )
+                               this->t\83T\83E\83\93\83h\8dÄ\90¶( pChip, PLAYPART_GUITAR, DTX_AUTOVOLUME );
+                       pChip->bHit = true;
+               }
+
+               // \83`\83b\83v\82Ì\95`\89æ
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+               {
+                       int y = 38 + pChip->nDotFromBarG-1;
+                       if( y >= 0 && y < 480 )
+                       {
+                               if( pChip->nChannel == 0x20 )   // OPEN
+                                       this->sfMap.Draw( 188, y, &s_rcChips[26] );
+                               else
+                               {                                                               // RGB
+                                       if( pChip->nChannel & 0x04 ) this->sfMap.Draw( 188,      y, &s_rcChips[13] );
+                                       if( pChip->nChannel & 0x02 ) this->sfMap.Draw( 188+12,   y, &s_rcChips[14] );
+                                       if( pChip->nChannel & 0x01 ) this->sfMap.Draw( 188+12*2, y, &s_rcChips[15] );
+                               }
+                       }
+               }
+               break;
+       }                  
+       // \83M\83^\81[\83`\83b\83v\81i\8bó\82¤\82¿\8ew\92è\81j
+       case 0xBA: {
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarG < 0 ) )
+                       pChip->bHit = true;             // \89½\82à\82µ\82È\82¢
+               break;
+       }
+       // \83x\81[\83X\83`\83b\83v
+       case 0xA0: case 0xA1: case 0xA2: case 0xA3: case 0xA4: case 0xA5: case 0xA6: case 0xA7: {
+
+               // \94­\90º\82µ\82Ä\82È\82¯\82ê\82Î\94­\90º\82·\82é
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarB < 0 ) )
+               {
+                       if( ! bSkip )
+                               this->t\83T\83E\83\93\83h\8dÄ\90¶( pChip, PLAYPART_BASS, DTX_AUTOVOLUME );
+                       pChip->bHit = true;
+               }
+
+               // \83`\83b\83v\82Ì\95`\89æ
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+               {
+                       int y = 38 + pChip->nDotFromBarB-1;
+                       if( y >= 0 && y < 480 )
+                       {
+                               if( pChip->nChannel == 0xA0 )   // OPEN
+                                       this->sfMap.Draw( 234, y, &s_rcChips[26] );
+                               else
+                               {                                                               // RGB
+                                       if( pChip->nChannel & 0x04 ) this->sfMap.Draw( 234,      y, &s_rcChips[17] );
+                                       if( pChip->nChannel & 0x02 ) this->sfMap.Draw( 234+12,   y, &s_rcChips[18] );
+                                       if( pChip->nChannel & 0x01 ) this->sfMap.Draw( 234+12*2, y, &s_rcChips[19] );
+                               }
+                       }
+               }
+               break;
+       }
+       // \83x\81[\83X\83`\83b\83v\81i\8bó\82¤\82¿\8ew\92è\81j
+       case 0xBB: {
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarB < 0 ) )
+                       pChip->bHit = true;             // \89½\82à\82µ\82È\82¢
+               break;
+       }
+       // \83M\83^\81[Wiling
+       case 0x28: {
+               // \83q\83b\83g\82µ\82Ä\82¢\82È\82¯\82ê\82Î\83q\83b\83g\8f\88\97\9d\82·\82é
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarG < 0 ) )
+                       pChip->bHit = true;
+
+               // \83`\83b\83v\95`\89æ
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+                       this->sfMap.Draw( 224, 38+pChip->nDotFromBarG, &s_rcChips[16] );
+               break;
+       }
+       // \83x\81[\83XWiling
+       case 0xA8: {
+               // \83q\83b\83g\82µ\82Ä\82¢\82È\82¯\82ê\82Î\83q\83b\83g\8f\88\97\9d\82·\82é
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarB < 0 ) )
+                       pChip->bHit = true;
+
+               // \83`\83b\83v\95`\89æ
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+                       this->sfMap.Draw( 270, 38+pChip->nDotFromBarB, &s_rcChips[20] );
+               break;
+       }
+       // BGM
+       case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x70:
+       case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x80:
+       case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: case 0x90:
+       case 0x91: case 0x92: {
+
+               // \83`\83b\83v\95`\89æ\81i0x61\81`0x65\82Ü\82Å\82¾\82¯\81j
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible && pChip->nChannel >= 0x61 && pChip->nChannel <= 0x65 )
+                       this->sfMap.Draw( 290+(pChip->nChannel-0x61)*12, BAR_Y-pChip->nDotFromBarD-1, &s_rcChips[21+pChip->nChannel-0x61] );
+
+               // \94­\90º\82µ\82Ä\82È\82¯\82ê\82Î\94­\90º\82·\82é
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+               {
+                       if( ! bSkip ) {
+                               g_DTX.StopWave( this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½BGM\82Ì\8eÀWAV\94Ô\8d\86[ pChip->nChannel-0x61 ], 10 );
+                               g_DTX.PlayChip( pChip, 10, DTX_AUTOVOLUME );
+                               this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½BGM\82Ì\8eÀWAV\94Ô\8d\86[ pChip->nChannel-0x61 ] = pChip->nRealParam;
+                       }
+                       pChip->bHit = true;
+               }
+               break;
+       }
+       // \8f¬\90ß\90ü
+       case 0x50: {
+                       
+               // part = \8f¬\90ß\94Ô\8d\86(\95\\8e¦\82·\82é\94Ô\8d\86+1)
+               int part = (int)( pChip->dwPosition / 384 );
+
+               // \83q\83b\83g\8f\88\97\9d\82µ\82Ä\82È\82¯\82ê\82Î\82·\82é
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+               {
+                       pChip->bHit = true;
+
+                       // \95\\8e¦\97p\8f¬\90ß\94Ô\8d\86\82Ì\8dX\90V
+                       this->struct\89\89\91t\8fî\95ñ.n\8c»\8dÝ\82Ì\8f¬\90ß\94Ô\8d\86\81E\83f\83o\83b\83O\95\\8e¦\97p = part - 1;
+
+                       // Wave\8dÄ\90\88Ê\92u\8e©\93®\95â\90³
+                       if( ! bSkip )
+                               g_DTX.AdjustWaves();
+               }
+               // \8f¬\90ß\90ü\95\\8e¦
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+               {
+                       // BPM/BPx \83\8c\81[\83\93\8f¬\90ß\90ü\95\\8e¦
+                       RECT rc;
+                       SetRect( &rc, s_rcLine.left, s_rcLine.top, s_rcLine.left + 23, s_rcLine.top + 1 );
+                       this->sfMap.Draw( 2, BAR_Y-pChip->nDotFromBarD, &rc );
+
+                       // \83h\83\89\83\80\83\8c\81[\83\93\8f¬\90ß\90ü\95\\8e¦
+                       SetRect( &rc, s_rcLine.left, s_rcLine.top, s_rcLine.left + 103, s_rcLine.top + 1 );
+                       this->sfMap.Draw( 33, BAR_Y-pChip->nDotFromBarD, &rc );
+
+                       // BGM/BGA/AVI \83\8c\81[\83\93\8f¬\90ß\90ü\95\\8e¦
+                       SetRect( &rc, s_rcLine.left, s_rcLine.top, s_rcLine.left + 34, s_rcLine.top + 1 );
+                       this->sfMap.Draw( 146, BAR_Y-pChip->nDotFromBarD, &rc );
+
+                       // \83M\83^\81[\83\8c\81[\83\93\8f¬\90ß\90ü\95\\8e¦
+                       SetRect( &rc, s_rcLine.left, s_rcLine.top, s_rcLine.left + 45, s_rcLine.top + 1 );
+                       this->sfMap.Draw( 187, 38+pChip->nDotFromBarG, &rc );
+
+                       // \83x\81[\83X\83\8c\81[\83\93\8f¬\90ß\90ü\95\\8e¦
+                       SetRect( &rc, s_rcLine.left, s_rcLine.top, s_rcLine.left + 45, s_rcLine.top + 1 );
+                       this->sfMap.Draw( 233, 38+pChip->nDotFromBarB, &rc );
+
+                       // SE1-5 \83\8c\81[\83\93\8f¬\90ß\90ü\95\\8e¦
+                       SetRect( &rc, s_rcLine.left, s_rcLine.top, s_rcLine.left + 61, s_rcLine.top + 1 );
+                       this->sfMap.Draw( 289, BAR_Y-pChip->nDotFromBarD, &rc );
+               }
+               // \8f¬\90ß\94Ô\8d\86\95\\8e¦
+               if( ! bSkip && ! pChip->bHit ) 
+               {
+                       this->txNumbers.SetScale( 0.5f, 0.5f );
+                       this->t\90\94\8e\9a\95`\89æ( 125, BAR_Y-pChip->nDotFromBarD, part-1 );      // \8f¬\90ß\90ü\82Ì\89¡
+                       
+                       this->txNumbers.SetScale( 1.0f, 1.0f );
+                       this->t\90\94\8e\9a\95`\89æ( 640, 480, this->struct\89\89\91t\8fî\95ñ.n\8c»\8dÝ\82Ì\8f¬\90ß\94Ô\8d\86\81E\83f\83o\83b\83O\95\\8e¦\97p );      // \89æ\96Ê\89E\89º\82Ì\82Å\82©\82¢\82Ì
+               }
+               break;
+       }
+       // \94\8f\90ü
+       case 0x51: {
+               
+               // \83q\83b\83g\8f\88\97\9d\82µ\82Ä\82È\82¯\82ê\82Î\82·\82é
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+                       pChip->bHit = true;
+
+               // \83\8c\81[\83\93\94\8f\90ü\95\\8e¦
+               if( ! bSkip && ! pChip->bHit && pChip->bVisible )
+               {
+                       // BPM/BPx \83\8c\81[\83\93\94\8f\90ü\95\\8e¦
+                       RECT rc;
+                       SetRect( &rc, s_rcSubLine.left, s_rcSubLine.top, s_rcSubLine.left + 23, s_rcSubLine.top + 1 );
+                       this->sfMap.Draw( 2, BAR_Y-pChip->nDotFromBarD, &rc );
+
+                       // \83h\83\89\83\80\83\8c\81[\83\93\94\8f\90ü\95\\8e¦
+                       SetRect( &rc, s_rcSubLine.left, s_rcSubLine.top, s_rcSubLine.left + 103, s_rcSubLine.top + 1 );
+                       this->sfMap.Draw( 33, BAR_Y-pChip->nDotFromBarD, &rc );
+
+                       // BGM/BGA/AVI \83\8c\81[\83\93\94\8f\90ü\95\\8e¦
+                       SetRect( &rc, s_rcSubLine.left, s_rcSubLine.top, s_rcSubLine.left + 34, s_rcSubLine.top + 1 );
+                       this->sfMap.Draw( 146, BAR_Y-pChip->nDotFromBarD, &rc );
+
+                       // SE1-5 \83\8c\81[\83\93\94\8f\90ü\95\\8e¦
+                       SetRect( &rc, s_rcSubLine.left, s_rcSubLine.top, s_rcSubLine.left + 61, s_rcSubLine.top + 1 );
+                       this->sfMap.Draw( 289, BAR_Y-pChip->nDotFromBarD, &rc );
+               }
+               break;
+       }
+       // MIDI \83h\83\89\83\80\83R\81[\83\89\83X
+       case 0x52: {
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+                       pChip->bHit = true;             // \89½\82à\82µ\82È\82¢
+               break;
+       }
+       // \83t\83B\83\8b\83C\83\93
+       case 0x53: {
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+                       pChip->bHit = true;             // \89½\82à\82µ\82È\82¢
+               break;
+       }
+       // AVI
+       case 0x54: {
+               
+               if( ! pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+               {
+                       pChip->bHit = true;
+
+                       switch( pChip->AVItype )
+                       {
+                       case AVITYPE_AVI:
+                               if( pChip->pAVI )
+                               {
+                                       // len = 0 \82È\82ç\93]\91\97\8c³\8fî\95ñ\82Ì\82Ý\97L\8cø
+                                       this->actAVI.Start( pChip->nChannel, pChip->pAVI,
+                                               BGA_W, BGA_H, 0, 0,                     // sw, sh, ew, eh               ; \97Ì\88æ   \8f\89\8aú\83T\83C\83Y\81A\8fI\97¹\83T\83C\83Y
+                                               0, 0, 0, 0,                                     // ssx, ssy, sex, sey   ; \89æ\91\9c\91¤ \8f\89\8aú\88Ê\92u\81A\8dÅ\8fI\88Ê\92u
+                                               0, 0, 0, 0,                                     // dsx, dsy, dex, dey   ; \95\\8e¦\91¤ \8f\89\8aú\88Ê\92u\81A\8dÅ\8fI\88Ê\92u
+                                               0, pChip->dbTime );                     // len, start
+                               }
+                               break;
+
+                       case AVITYPE_AVIPAN:
+                               if( pChip->pAVIPan )
+                               {
+                                       this->actAVI.Start( pChip->nChannel, pChip->pAVI,
+                                               pChip->pAVIPan->sw, pChip->pAVIPan->sh, pChip->pAVIPan->ew, pChip->pAVIPan->eh,         // \97Ì\88æ   \8f\89\8aú\83T\83C\83Y\81A\8fI\97¹\83T\83C\83Y
+                                               pChip->pAVIPan->ssx, pChip->pAVIPan->ssy, pChip->pAVIPan->sex, pChip->pAVIPan->sey,     // \89æ\91\9c\91¤ \8f\89\8aú\88Ê\92u\81A\8dÅ\8fI\88Ê\92u
+                                               pChip->pAVIPan->dsx, pChip->pAVIPan->dsy, pChip->pAVIPan->dex, pChip->pAVIPan->dey,     // \95\\8e¦\91¤ \8f\89\8aú\88Ê\92u\81A\8dÅ\8fI\88Ê\92u
+                                               pChip->dbLong, pChip->dbTime );                                                                                                 // len, start
+                               }
+                               break;
+                       }
+               }
+               break;
+       }
+       // \96¢\92m
+       default: {
+               if( pChip->bHit && ( bSkip || pChip->nDotFromBarD < 0 ) )
+                       pChip->bHit = true;
+               break;
+       }
+       }
+}
+void CStagePlay::t\83T\83E\83\93\83h\8dÄ\90¶( DTX::Chip* pChip, EPlayPart part, long l\89¹\97Ê )
+{
+       if( ! pChip )
+               return;
+
+       switch( part )
+       {
+
+       // \83h\83\89\83\80\81F
+       // HHC, HHO \82É\82Â\82¢\82Ä\82Í\81A\91O\82É\94­\90\82µ\82½\89¹\82ð\92â\8e~\82µ\82Ä\82©\82ç\8dÄ\90\82·\82é\81BLC \82Ì\8fê\8d\87\82Í\96³\8aÖ\8cW\81B
+       // \82½\82¾\82µ\81A\91O\82Ì\89¹\82Æ\8d¡\89ñ\82Ì\89¹\82ª\97¼\95û\82Æ\82à HHO \82Ì\8fê\8d\87\82Í\92â\8e~\82µ\82È\82¢\81B(HHO\83\8d\81[\83\8b\91Î\8dô\81j
+       case PLAYPART_DRUMS:
+               if( pChip->nChannel >= 0x11 && pChip->nChannel <= 0x1A )
+               {
+                       int nLane = s_n\83`\83\83\83\93\83l\83\8b0Ato\83\8c\81[\83\9307[ pChip->nChannel - 0x11 ];
+
+                       if( nLane == 1 && ( pChip->nChannel == 0x11 || ( pChip->nChannel == 0x18 && this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½HH\82Ì\83`\83\83\83\93\83l\83\8b\94Ô\8d\86 != 0x18 ) ) )
+                       {
+                               g_DTX.StopWave( this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½HH\82ÌWAV\94Ô\8d\86, nLane );
+                               this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½HH\82ÌWAV\94Ô\8d\86                 = pChip->nRealParam;
+                               this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½HH\82Ì\83`\83\83\83\93\83l\83\8b\94Ô\8d\86  = pChip->nChannel;
+                       }
+                       g_DTX.PlayChip( pChip, nLane, l\89¹\97Ê );
+               }
+               break;
+
+       // \83M\83^\81[\81F
+       // \91O\82Ì\89¹\82ð\92â\8e~\82µ\82Ä\82©\82ç\94­\90º
+       case PLAYPART_GUITAR:
+               g_DTX.StopWave( this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½\83M\83^\81[\82ÌWAV\94Ô\8d\86, 8 );
+               g_DTX.PlayChip( pChip, 8, l\89¹\97Ê );
+               this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½\83M\83^\81[\82ÌWAV\94Ô\8d\86 = pChip->nRealParam;
+               break;
+
+       // \83x\81[\83X\81F
+       // \91O\82Ì\89¹\82ð\92â\8e~\82µ\82Ä\82©\82ç\94­\90º
+       case PLAYPART_BASS:
+               g_DTX.StopWave( this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½\83x\81[\83X\82ÌWAV\94Ô\8d\86, 9 );
+               g_DTX.PlayChip( pChip, 9, l\89¹\97Ê );
+               this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½\83x\81[\83X\82ÌWAV\94Ô\8d\86 = pChip->nRealParam;
+               break;
+       }
+}
+void CStagePlay::t\90\94\8e\9a\95`\89æ( int rx, int by, int num )
+{
+       // \95\89\90\94\82Í\95\\8e¦\82µ\82È\82¢
+       if( num < 0 ) return;
+
+       // \90\94\92l\82ð\8c\85\82²\82Æ\82É\95ª\89ð\81i\82U\8c\85\82Ü\82Å\81G\82»\82ê\88È\8fã\82Í\96³\8e\8b\81j
+       int pn[ 6 ];
+       for( int i = 0; i < 6; i++ )
+       {
+               int n = num % 10;
+               num = (num - n) / 10;
+               pn[ 5-i ] = n;
+       }
+
+       // \89æ\91\9c\82Ì\8d\87\8cv\83T\83C\83Y\82Ì\8eZ\8fo
+       int w = 0;
+       int h = 0;
+       float fw, fh;
+       bool bf = true;         // \8dÅ\8f\89\82Ì\82O\82Í\96³\8e\8b
+
+       this->txNumbers.GetScale( &fw, &fh );
+       
+       for( int i = 0; i < 6; i++ )
+       {
+               if( pn[i] == 0 && bf && i < 5 ) continue;
+               w += (int)( (s_rcNums[ pn[i] ].right - s_rcNums[ pn[i] ].left) * fw );
+               h = (int)( MAX( h, (s_rcNums[ pn[i] ].bottom - s_rcNums[ pn[i] ].top) ) * (fh+0.2f) );
+               bf = false;
+       }
+
+       // \95`\89æ
+       int x = rx - w;
+       int y = by - h;
+       bf = true;
+       for( int i = 0; i < 6; i++ )
+       {
+               if( pn[i] == 0 && bf && i < 5 ) continue;
+               this->txNumbers.Draw( x, y, &s_rcNums[ pn[i] ] );
+               x += (int)( (s_rcNums[ pn[i] ].right - s_rcNums[ pn[i] ].left) * fw );
+               bf = false;
+       }
+}
+void CStagePlay::t\89\89\91t\8fî\95ñ\82ð\8f\89\8aú\89»\82·\82é()
+{
+       this->struct\89\89\91t\8fî\95ñ.b\89\89\91t\92\86 = false;
+       this->struct\89\89\91t\8fî\95ñ.p\8c»\8dÝ\82Ì\83g\83b\83vChip = NULL;
+       this->struct\89\89\91t\8fî\95ñ.n\8c»\8dÝ\82Ì\8f¬\90ß\94Ô\8d\86\81E\83f\83o\83b\83O\95\\8e¦\97p = 0;
+       this->struct\89\89\91t\8fî\95ñ.db\8c»\8dÝ\82ÌBPM\81E\83f\83o\83b\83O\95\\8e¦\97p = 0.0;
+       this->struct\89\89\91t\8fî\95ñ.db\8aJ\8en\8e\9e\8d\8fms = INIT_TIME;
+       for( int i = 0; i < 50; i++ )
+               this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½BGM\82Ì\8eÀWAV\94Ô\8d\86[i] = -1;
+       this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½HH\82ÌWAV\94Ô\8d\86                 = -1;
+       this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½HH\82Ì\83`\83\83\83\93\83l\83\8b\94Ô\8d\86  = 0;
+       this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½\83M\83^\81[\82ÌWAV\94Ô\8d\86             = -1;
+       this->struct\89\89\91t\8fî\95ñ.n\8dÅ\8cã\82É\8dÄ\90\82µ\82½\83x\81[\83X\82ÌWAV\94Ô\8d\86             = -1;
+}
+//
+bool CStagePlay::MyOneTimeSceneInit()
+{
+       // \82±\82±\82É\83R\81[\83h\82ð\8bL\8fq\82·\82é\81BAddChild() \82È\82Ç\81B
+       AddChild( &this->sfMap );
+       AddChild( &this->txNumbers );
+       AddChild( &g_DTX );
+       AddChild( &this->actAVI );
+
+       g_DTX.bDTXV = true;
+       g_DTX.SetTimer( &g_Timer );
+
+       return CStage::MyOneTimeSceneInit();
+}
+bool CStagePlay::MyFinalCleanup()
+{
+       // \82±\82±\82É\83R\81[\83h\82ð\8bL\8fq\82·\82é\81B
+
+       return CStage::MyFinalCleanup();
+}
+bool CStagePlay::MyInitDeviceObjects()
+{
+       // \82±\82±\82É\83R\81[\83h\82ð\8bL\8fq\82·\82é\81BCTexture/CSurface::InitDeviceObjects() \82È\82Ç\81B
+       this->sfMap.InitDeviceObjectsFromResource( _T("\83}\83b\83v"), MAKEINTRESOURCE(IDR_PNG_MAP), _T("PNG") );
+       this->sfMap.ColorKeyEnable();
+       this->txNumbers.InitDeviceObjectsFromResource( _T("\90\94\8e\9a"), MAKEINTRESOURCE(IDR_PNG_NUMBERS), _T("PNG") );
+
+       return CStage::MyInitDeviceObjects();
+}
+bool CStagePlay::MyDeleteDeviceObjects()
+{
+       // \82±\82±\82É\83R\81[\83h\82ð\8bL\8fq\82·\82é\81B
+
+       // \8e\9f\82Ì CStage::MyDeleteDeviceObjects() \82Å\82Í\81A\8eq\83e\83N\83X\83`\83\83\81E\8eq\83T\81[\83t\83F\83C\83X\82Ì Delete (CTexture/CSurface::Delete) \82ª\8ds\82í\82ê\82é\81B
+       return CStage::MyDeleteDeviceObjects();
+}
+bool CStagePlay::MyActivate()
+{
+       this->bFirstWork = true;
+       // \82±\82±\82É\83R\81[\83h\82ð\8bL\8fq\82·\82é\81B
+       this->t\89\89\91t\8fî\95ñ\82ð\8f\89\8aú\89»\82·\82é();
+
+       this->phaseID = PHASE_PLAY_IDLE;
+       this->bLoading\97v\90¿\82 \82è = false;
+       this->bPlaying\97v\90¿\82 \82è = false;
+       this->n\8aJ\8en\8f¬\90ß\94Ô\8d\86 = 0;
+
+       // \8e\9f\82Ì CStage::MyActivate() \82Å\82Í\81Athis->bActivity \82Ì\83Z\83b\83g\82È\82ç\82Ñ\82É\8eq\83T\81[\83t\83F\83C\83X\81E\8eq\83e\83N\83X\83`\83\83\82Ì Restore (MyRestoreDeviceTexture/Surface) \82ª\8ds\82í\82ê\82é\81B
+       // \82È\82¨\81A\8eq Activity \82Ì\8a\88\90«\89»\82Í\8ds\82í\82ê\82È\82¢\81B\81i\82±\82Ì\83\81\83\\83b\83h\82ð\94²\82¯\82Ä\82©\82ç\8ds\82í\82ê\82é\81B\81j
+       return CStage::MyActivate();
+}
+bool CStagePlay::MyUnActivate()
+{
+       // \82±\82±\82É\83R\81[\83h\82ð\8bL\8fq\82·\82é\81B
+
+       // \8e\9f\82Ì CStage::MyUnActivate() \82Å\82Í\81Athis->bActivity \82Ì\83\8a\83Z\83b\83g\82È\82ç\82Ñ\82É\8eq\83T\81[\83t\83F\83C\83X\81E\8eq\83e\83N\83X\83`\83\83\82Ì Invalidate (MyInvalidateDeviceObjects) \82ª\8ds\82í\82ê\82é\81B
+       // \82È\82¨\81A\8eqActivity \82Ì\94ñ\8a\88\90«\89»\82Í\8ds\82í\82ê\82È\82¢\81B\81i\82±\82Ì\83\81\83\\83b\83h\82ð\94²\82¯\82Ä\82©\82ç\8ds\82í\82ê\82é\81B\81j
+       return CStage::MyUnActivate();
+}
+bool CStagePlay::MyRestoreDeviceTextures()
+{
+       // \82±\82±\82É\83R\81[\83h\82ð\8bL\8fq\82·\82é\81B
+
+       // \8e\9f\82Ì CStage::MyRestoreDeviceTextures() \82Å\82Í\81A\8eq\83e\83N\83X\83`\83\83\82Ì Restore (CTexture::Restore) \82ª\8ds\82í\82ê\82é\81B
+       return CStage::MyRestoreDeviceTextures();
+}
+bool CStagePlay::MyRestoreDeviceSurfaces()
+{
+       // \82±\82±\82É\83R\81[\83h\82ð\8bL\8fq\82·\82é\81B
+
+       // \8e\9f\82Ì CStage::MyRestoreDeviceSurfaces() \82Å\82Í\81A\8eq\83T\81[\83t\83F\83C\83X\82Ì Restore (CSurface::Restore) \82ª\8ds\82í\82ê\82é\81B
+       return CStage::MyRestoreDeviceSurfaces();
+}
+bool CStagePlay::MyInvalidateDeviceObjects()
+{
+       // \82±\82±\82É\83R\81[\83h\82ð\8bL\8fq\82·\82é\81B
+
+       // \8e\9f\82Ì CStage::MyInvalidateDeviceObjects() \82Å\82Í\81A\8eq\83e\83N\83X\83`\83\83\81E\8eq\83T\81[\83t\83F\83C\83X\82Ì Invalidate (CTexture/CSurface::Invalidate) \82ª\8ds\82í\82ê\82é\81B
+       return CStage::MyRestoreDeviceSurfaces();
+}
+               }//Play
+       }//Stage
+}//DTXViewer