lol its in c
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.4 KiB

2 years ago
  1. #ifndef HUGEDRIVER_H_INCLUDE
  2. #define HUGEDRIVER_H_INCLUDE
  3. #define DN(A, B, C) (unsigned char)(A),(unsigned char)((B << 4) | (C >> 8)),(unsigned char)(C & 0xFF)
  4. #define C_3 0
  5. #define Cs3 1
  6. #define D_3 2
  7. #define Ds3 3
  8. #define E_3 4
  9. #define F_3 5
  10. #define Fs3 6
  11. #define G_3 7
  12. #define Gs3 8
  13. #define A_3 9
  14. #define As3 10
  15. #define B_3 11
  16. #define C_4 12
  17. #define Cs4 13
  18. #define D_4 14
  19. #define Ds4 15
  20. #define E_4 16
  21. #define F_4 17
  22. #define Fs4 18
  23. #define G_4 19
  24. #define Gs4 20
  25. #define A_4 21
  26. #define As4 22
  27. #define B_4 23
  28. #define C_5 24
  29. #define Cs5 25
  30. #define D_5 26
  31. #define Ds5 27
  32. #define E_5 28
  33. #define F_5 29
  34. #define Fs5 30
  35. #define G_5 31
  36. #define Gs5 32
  37. #define A_5 33
  38. #define As5 34
  39. #define B_5 35
  40. #define C_6 36
  41. #define Cs6 37
  42. #define D_6 38
  43. #define Ds6 39
  44. #define E_6 40
  45. #define F_6 41
  46. #define Fs6 42
  47. #define G_6 43
  48. #define Gs6 44
  49. #define A_6 45
  50. #define As6 46
  51. #define B_6 47
  52. #define C_7 48
  53. #define Cs7 49
  54. #define D_7 50
  55. #define Ds7 51
  56. #define E_7 52
  57. #define F_7 53
  58. #define Fs7 54
  59. #define G_7 55
  60. #define Gs7 56
  61. #define A_7 57
  62. #define As7 58
  63. #define B_7 59
  64. #define C_8 60
  65. #define Cs8 61
  66. #define D_8 62
  67. #define Ds8 63
  68. #define E_8 64
  69. #define F_8 65
  70. #define Fs8 66
  71. #define G_8 67
  72. #define Gs8 68
  73. #define A_8 69
  74. #define As8 70
  75. #define B_8 71
  76. #define LAST_NOTE 72
  77. #define ___ 90
  78. typedef void (*hUGERoutine_t)(unsigned char param, unsigned char ch, unsigned char tick);
  79. typedef struct hUGESong_t {
  80. unsigned char tempo;
  81. const unsigned char * order_cnt;
  82. const unsigned char ** order1, ** order2, ** order3, ** order4;
  83. const unsigned char * duty_instruments, * wave_instruments, * noise_instruments;
  84. const hUGERoutine_t ** routines;
  85. const unsigned char * waves;
  86. } hUGESong_t;
  87. // initialize the driver with song data
  88. void hUGE_init(const hUGESong_t * song);
  89. void hUGE_init_banked(const hUGESong_t * song) __banked;
  90. // driver routine
  91. void hUGE_dosound();
  92. void hUGE_dosound_banked() __banked;
  93. enum hUGE_channel_t {HT_CH1 = 0, HT_CH2, HT_CH3, HT_CH4};
  94. enum hUGE_mute_t {HT_CH_PLAY = 0, HT_CH_MUTE};
  95. void hUGE_mute_channel(enum hUGE_channel_t ch, enum hUGE_mute_t mute);
  96. void hUGE_mute_channel_banked(enum hUGE_channel_t ch, enum hUGE_mute_t mute) __banked;
  97. void hUGE_set_position(unsigned char pattern);
  98. void hUGE_set_position_banked(unsigned char pattern) __banked;
  99. extern volatile unsigned char hUGE_current_wave;
  100. #define hUGE_NO_WAVE 100
  101. inline void hUGE_reset_wave() {
  102. hUGE_current_wave = hUGE_NO_WAVE;
  103. }
  104. inline void hUGE_reset_wave_banked() {
  105. hUGE_current_wave = hUGE_NO_WAVE;
  106. }
  107. #endif