X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Feng_comm.cpp;h=02d90812771bca5f118e4e7154691bfa5365a441;hb=2153ae506cd9faaea1e62cfdde4deb4fc97a384e;hp=9d8a6d1ecd09d54a6e06698ec99c7c73821790d4;hpb=d92413cac0c6a49fdc2d68051914c970c8b1715b;p=16.git diff --git a/src/eng_comm.cpp b/src/eng_comm.cpp index 9d8a6d1e..02d90812 100644 --- a/src/eng_comm.cpp +++ b/src/eng_comm.cpp @@ -1,13 +1,10 @@ #include "src\eng_comm.h" #include - int xxxx = 0; - int yyyy = 0; - int qing = 4; namespace engine { - /*engine_message do_communication() - { + engine_message do_communication() + /*{ //communication here //==== std::cout << "COMMUNICATION HERE" << std::endl; int msg; @@ -21,41 +18,12 @@ namespace engine { //==== std::cout << "COMMUNICATION HERE" << std::endl; return input['e'] == true ? ENGINE_QUIT : ENGINE_RUN; }*/ - engine_message do_communication(byte input) + //engine_message do_communication(byte input) { //communication here //==== std::cout << "COMMUNICATION HERE" << std::endl; - if(input == 44){ - FMKeyOn(0, 0x106, 4); - }else if(input == 172) FMKeyOff(0); - if(input == KEY_X){ - sound(440); - delay(100); - nosound(); - //delay(50); - }else if(input == KEY_X+128) nosound(); - if(12 >= input && input >= 2) qing = input - 1; - if(input == 57) qing = 0; - - if(qing > 0){ - ding(qing); - }else{ - if(keyp(KEY_UP) || keyp(KEY_DOWN) || keyp(KEY_LEFT) || keyp(KEY_RIGHT)) etesuto(xxxx, yyyy); - if(keyp(KEY_UP)){ - if(--yyyy < 0) yyyy = 0; - }else if(keyp(KEY_DOWN)){ - if(++yyyy >= SH) yyyy = SH - 1; - } - if(keyp(KEY_LEFT)){ - if(--xxxx < 0) xxxx = 0; - } - if(keyp(KEY_RIGHT)){ - if(++xxxx >= SW) xxxx = SW - 1; - } - qtesuto(xxxx, yyyy, 14); - } //if(input) printf("%03d\n", input); - return input == 1 ? ENGINE_QUIT : ENGINE_RUN; + return keyp(1) == 1 ? ENGINE_QUIT : ENGINE_RUN; } -} +} \ No newline at end of file