Auto full-combo Koibumi2000 in Taiko no Tatsujin CS5

Dependencies:   fll mbed-rtos mbed

main.cpp

Committer:
amutake
Date:
2015-02-14
Revision:
8:d16a0fcc2735
Parent:
7:61b4825304e2
Child:
9:0d6631edfc32

File content as of revision 8:d16a0fcc2735:

#include "mbed.h"
#include "rtos.h"
#include "fll.h"

#define FRAME 1.0 / 60 // 1 frame (sec)

// [ Up, Right, Down, ... ] 
//     +--- OrFoldFlow ---> [ Up|Circle, Right, Down|Triangle, Up, Right|Circle, ... ]
// [ Circle, none, Triangle, none, ... ]
class OrFoldFlow : public FoldFlow {
    public:
    OrFoldFlow(Producer **srcs, int srcs_size) : FoldFlow(srcs, srcs_size) {}
    virtual button_t fold(button_t *bs, int bs_size) {
        button_t b = 0x00;
        for(int i = 0; i < bs_size; i++) {
            b |= bs[i];
        }
        return b;
    }
};

int main(void)
{
    button_t array0[] = {R1, 0};
    button_t array1[] = {CIRCLE, 0};

    // fll user must make a Producer
    Producer* source0 = new RepeaterSource(array0, sizeof(array0)/sizeof(button_t));
    Producer* source1 = new RepeaterSource(array1, sizeof(array1)/sizeof(button_t));
    Producer* ss[] = {source0, source1};
    Producer* source = new OrFoldFlow(ss, 2);
    
    fll_run(source);
}