過去ログ

                                Page     530
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   通常モードに戻る  ┃  INDEX  ┃  ≪前へ  │  次へ≫   
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ▼Gyromite Robot Simulation  Feather 03/11/9(日) 3:09
   ┗TXEvl XSS tZSS  kWvRnufDJq 15/3/15(日) 3:28

 ───────────────────────────────────────
 ■題名 : Gyromite Robot Simulation
 ■名前 : Feather
 ■日付 : 03/11/9(日) 3:09
 -------------------------------------------------------------------------
   Info:
Patches 0.86a to add Gyromite robot.
Decodes TV signals properly.
Stack-Up uses the robot differently and doesn't work with this robot.

Usage:
Game A: Start,B = Raise/lower red gate
    Start,A = Raise/lower blue gate
Game B: B = Raise/lower red gate
    A = Raise/lower blue gate

Patch:

[EXPAD_Gyromite.cpp]

//////////////////////////////////////////////////////////////////////////
// Gyromite
//////////////////////////////////////////////////////////////////////////
INT    EXPAD_Gyromite::CheckSignal( INT vline )
{
    // check for a black or green screen
    // note: checking every 5 pixels is sufficient
    INT color = DirectDraw.GetPixel( vline,10 );
    for( INT i=10+5; i<DirectDraw.GetScreenHeight()-10; i+=5 ) {
        // reject non-solid screens
        if( color != DirectDraw.GetPixel( vline,i ) )
            return 0xF00;
    }
    return( color > 0x10 ) ? 1:0;
}

void    EXPAD_Gyromite::Reset()
{
    bits = 0;
    arms = 0;
    spot = 0;

    // Initialize light on/off sequences
    code[0] = 0x0EE8;    // Open arm
    code[1] = 0x0FA8;    // Close arm
    code[2] = 0x1AE8;    // Test robot
    code[3] = 0x0AAA;    // Unused
    code[4] = 0x1BA8;    // Raise arm
    code[5] = 0x1BE8;    // Lower arm
    code[6] = 0x0BA8;    // Turn left
    code[7] = 0x0AE8;    // Turn right
}

void    EXPAD_Gyromite::Strobe()
{
    nes->pad->pad2bit &= ~0xFF;
    nes->pad->pad2bit |= arms;
}

void    EXPAD_Gyromite::Sync()
{
    INT signal = CheckSignal( 129 );

    // build our message
    if( signal > 0xFF ) {
        bits = 0;
        spot = 0;
    }
    else {
        bits |= (signal << spot);
        spot++;

        // Check for a test message: BBBBBB[test]
        if( spot==6 && bits==0 ) {
            spot = 0;
        }
    }

    // decode message
    if( spot==13 ) {
        for( INT i=0; i<8; i++ ) {
            if( bits == code[i] ) {
                arms ^= (1<<i);
            }
        }
        spot = 0;
        bits = 0;
    }
}

void    EXPAD_Gyromite::SetSyncData( INT type, LONG data )
{
    arms = data;
}

LONG    EXPAD_Gyromite::GetSyncData( INT type )
{
    return    arms;
}

--------------------------------------------------------------------------

[EXPAD_Gyromite.h]

//////////////////////////////////////////////////////////////////////////
// Gyromite                               //
//////////////////////////////////////////////////////////////////////////
class    EXPAD_Gyromite : public EXPAD
{
public:
    EXPAD_Gyromite( NES* parent ) : EXPAD( parent ) {}

    void    Reset();
    void    Strobe();

    void    Sync();
    void    SetSyncData( INT type, LONG data );
    LONG    GetSyncData( INT type );

protected:
    INT    CheckSignal( INT vline );

    // TV Light signals
    WORD    code[8];
    
    WORD    bits;
    BYTE    arms;
    BYTE    spot;

private:
};

--------------------------------------------------------------------------

[Pad.cpp]

(line 173)
    if( crc == 0x21b099f3 ) {    // Gyromite (JUE)
        SetExController( EXCONTROLLER_Gyromite );
    }

(line 244)
        case    EXCONTROLLER_Gyromite:
            expad = new EXPAD_Gyromite( nes );
            break;

--------------------------------------------------------------------------

[DirectDraw.cpp]

BYTE    CDirectDraw::GetPixel(int x, int y)
{
    if( x >= 0 && x < SCREEN_WIDTH && y >= 0 && y < SCREEN_HEIGHT ) {
        BYTE    c = m_lpRender[8+(x)+RENDER_WIDTH*y];
        return c;
    }

    return 0x00;
}
 ───────────────────────────────────────  ■題名 : TXEvl XSS tZSS  ■名前 : kWvRnufDJq <Helsey37490@gmail.com>  ■日付 : 15/3/15(日) 3:28  ■Web : https://www.facebook.com/hookuponlineusa  -------------------------------------------------------------------------
   online dating site 100 free mobile phone dating sites - high school senior girl dating freshman boy
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━    通常モードに戻る  ┃  INDEX  ┃  ≪前へ  │  次へ≫    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━                                 Page 530