#include "src\eng_comm.h"\r
#include <iostream>\r
- int xxxx = 0;\r
- int yyyy = 0;\r
- int qing = 4;\r
\r
namespace engine {\r
\r
- /*engine_message do_communication()\r
- {\r
+ engine_message do_communication()\r
+ /*{\r
//communication here\r
//==== std::cout << "COMMUNICATION HERE" << std::endl;\r
int msg;\r
//==== std::cout << "COMMUNICATION HERE" << std::endl;\r
return input['e'] == true ? ENGINE_QUIT : ENGINE_RUN;\r
}*/\r
- engine_message do_communication(byte input)\r
+ //engine_message do_communication(byte input)\r
{\r
//communication here\r
//==== std::cout << "COMMUNICATION HERE" << std::endl;\r
- if(input == 44){\r
- FMKeyOn(0, 0x106, 4);\r
- }else if(input == 172) FMKeyOff(0);\r
- if(input == KEY_X){\r
- sound(440);\r
- delay(100);\r
- nosound();\r
- //delay(50);\r
- }else if(input == KEY_X+128) nosound();\r
- if(12 >= input && input >= 2) qing = input - 1;\r
- if(input == 57) qing = 0;
- \r
- if(qing > 0){\r
- ding(qing);\r
- }else{\r
- if(keyp(KEY_UP) || keyp(KEY_DOWN) || keyp(KEY_LEFT) || keyp(KEY_RIGHT)) etesuto(xxxx, yyyy);\r
- if(keyp(KEY_UP)){\r
- if(--yyyy < 0) yyyy = 0;\r
- }else if(keyp(KEY_DOWN)){\r
- if(++yyyy >= SH) yyyy = SH - 1;\r
- }\r
- if(keyp(KEY_LEFT)){\r
- if(--xxxx < 0) xxxx = 0;\r
- }\r
- if(keyp(KEY_RIGHT)){\r
- if(++xxxx >= SW) xxxx = SW - 1;\r
- }\r
- qtesuto(xxxx, yyyy, 14);\r
- }\r
//if(input) printf("%03d\n", input);
- return input == 1 ? ENGINE_QUIT : ENGINE_RUN;\r
+ return keyp(1) == 1 ? ENGINE_QUIT : ENGINE_RUN;\r
}\r
\r
-}\r
+}
\ No newline at end of file