logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

pac_dude.h (1658B)


  1. /* Copyright 2020 ademey "MsMustard"
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef DISABLE_TERRAZZO_EFFECT_PAC_DUDE
  17. TERRAZZO_EFFECT(PAC_DUDE)
  18. # ifdef TERRAZZO_EFFECT_IMPLS
  19. static uint8_t pac_frames[3][25] = {
  20. { // up
  21. 0, 0, 0, 0, 0,
  22. 9, 0, 0, 0, 9,
  23. 9, 9, 0, 9, 9,
  24. 9, 9, 9, 9, 9,
  25. 0, 9, 9, 9, 0
  26. },
  27. { // closed
  28. 0, 9, 9, 9, 0,
  29. 9, 9, 9, 9, 9,
  30. 9, 9, 9, 9, 9,
  31. 9, 9, 9, 9, 9,
  32. 0, 9, 9, 9, 0
  33. },
  34. { // down
  35. 0, 9, 9, 9, 0,
  36. 9, 9, 9, 9, 9,
  37. 9, 9, 0, 9, 9,
  38. 9, 0, 0, 0, 9,
  39. 0, 0, 0, 0, 0
  40. }
  41. };
  42. static uint8_t pac_ghost[20] = {
  43. 0, 4, 4, 4, 0,
  44. 4, 0, 4, 0, 4,
  45. 4, 4, 4, 4, 4,
  46. 4, 0, 4, 0, 4
  47. };
  48. void PAC_DUDE(uint8_t i, bool dir) {
  49. led_matrix_set_value_all(0);
  50. if (dir) {
  51. terrazzo_draw_at(1, 4, 5, 5, pac_frames[i % 2]);
  52. terrazzo_set_pixel(3, 0 + i % 3, 5);
  53. terrazzo_set_pixel(3, 3 + i % 3, 5);
  54. } else {
  55. terrazzo_draw_at(1, 4, 5, 5, pac_frames[1 + i % 2]);
  56. terrazzo_draw_at(1, 8 + i % 8, 5, 4, pac_ghost);
  57. }
  58. }
  59. # endif
  60. #endif