beefviper

Arcade3

Jan 9th, 2017
175
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Name:       Arcade3.ino
  3. Created:    1/7/2017 7:49:54 PM
  4. Author:     beefviper
  5. */
  6.  
  7. #include "Params.h"
  8. #include "Arcade.h"
  9.  
  10. bool HardwareParams::screenEnable   = true;
  11. bool HardwareParams::joystickEnable = true;
  12. bool HardwareParams::speakerEnable  = true;
  13. bool HardwareParams::rngEnable      = true;
  14.  
  15. int ScreenParams::data1Pin   =  8;
  16. int ScreenParams::data2Pin   =  9;
  17. int ScreenParams::data3Pin   = 10;
  18. int ScreenParams::data4Pin   = 12;
  19. int ScreenParams::data5Pin   =  4;
  20. int ScreenParams::data6Pin   =  5;
  21. int ScreenParams::data7Pin   =  6;
  22. int ScreenParams::data8Pin   =  7;
  23. int ScreenParams::enablePin  = 18;
  24. int ScreenParams::commandPin = 17;
  25. int ScreenParams::resetPin   = 15;
  26.  
  27. int JoystickParams::xPin  = 16;
  28. int JoystickParams::yPin  = 19;
  29. int JoystickParams::bPin  =  2;
  30.  
  31. #define SpeakerType SpeakerParams::Type
  32. int         SpeakerParams::sPin   = 11;
  33. SpeakerType SpeakerParams::sType  = SpeakerParams::Passive;
  34.  
  35. int RanNumGenParams::fPin = 14;
  36.  
  37. ScreenParams    HardwareParams::Screen    = ScreenParams();
  38. JoystickParams  HardwareParams::Joystick  = JoystickParams();
  39. SpeakerParams   HardwareParams::Speaker   = SpeakerParams();
  40. RanNumGenParams HardwareParams::RanNumGen = RanNumGenParams();
  41.  
  42. HardwareParams hardwareparams;
  43.  
  44. bool Variables::gameOver = true;
  45. bool Variables::firstGame = true;
  46. int  Variables::score = 0;
  47. int  Variables::frameLimit = Variables::frameSkip;
  48.  
  49. Arcade arcade(hardwareparams);
  50.  
  51. #define LCDScreen U8G2_ST7920_128X64_1_6800
  52. LCDScreen &screen   = arcade.hardware.screen;
  53. RanNumGen &rng      = arcade.hardware.rng;
  54. Joystick  &joystick = arcade.hardware.joystick;
  55. Speaker   &speaker  = arcade.hardware.speaker;
  56.  
  57. // the setup function runs once when you press reset or power the board
  58. void setup() {
  59.     arcade.init();
  60. }
  61.  
  62. // the loop function runs over and over again until power down or reset
  63. void loop() {
  64.     arcade.draw();
  65.     arcade.input();
  66.     arcade.logic();
  67.     arcade.hardware.joystick.print(); // debug
  68. }
RAW Paste Data