📄 ht83f60_tpl_adpcm_new.hed
字号:
#define SentenceAddress 2304
#define WaveAddress 2448
#define HT86SystemFrequency 8000000
#define ROMSIZE 3
#define VROMENDADDRESS 0100000H
#define Last_Wav_FIle_Num 000009H
#define _Last_Voice_FIle_Num 000009H
#define _Last_Sentence_FIle_Num 000008H
#define _HT83F60_
#define _RAMBank_ 1
#define sentence_0 0
#define sentence_1 1
#define sentence_2 2
#define sentence_3 3
#define sentence_4 4
#define sentence_5 5
#define sentence_6 6
#define sentence_7 7
#define sentence_8 8
#define sentence_9 9
#define sentence_10 10
#define sentence_11 11
#define sentence_12 12
#define sentence_13 13
#define sentence_14 14
#define sentence_15 15
#define sentence_16 16
#define sentence_17 17
#define sentence_18 18
#define sentence_19 19
#define sentence_20 20
#define sentence_21 21
#define sentence_22 22
#define sentence_23 23
#define sentence_24 24
#define sentence_25 25
#define sentence_26 26
#define sentence_27 27
#define sentence_28 28
#define sentence_29 29
#define sentence_30 30
#define sentence_31 31
#define sentence_32 32
#define sentence_33 33
#define sentence_34 34
#define sentence_35 35
#define sentence_36 36
#define sentence_37 37
#define sentence_38 38
#define sentence_39 39
#define sentence_40 40
#define sentence_41 41
#define sentence_42 42
#define sentence_43 43
#define sentence_44 44
#define sentence_45 45
#define sentence_46 46
#define sentence_47 47
#define sentence_48 48
#define sentence_49 49
#define sentence_50 50
#define sentence_51 51
#define sentence_52 52
#define sentence_53 53
#define sentence_54 54
#define sentence_55 55
#define sentence_56 56
#define sentence_57 57
#define sentence_58 58
#define sentence_59 59
#define sentence_60 60
#define sentence_61 61
#define sentence_62 62
#define sentence_63 63
#define sentence_64 64
#define sentence_65 65
#define sentence_66 66
#define sentence_67 67
#define sentence_68 68
#define sentence_69 69
#define sentence_70 70
#define sentence_71 71
#define sentence_72 72
#define sentence_73 73
#define sentence_74 74
#define sentence_75 75
#define sentence_76 76
#define sentence_77 77
#define sentence_78 78
#define sentence_79 79
#define sentence_80 80
#define sentence_81 81
#define sentence_82 82
#define sentence_83 83
#define sentence_84 84
#define sentence_85 85
#define sentence_86 86
#define sentence_87 87
#define sentence_88 88
#define sentence_89 89
#define sentence_90 90
#define sentence_91 91
#define sentence_92 92
#define sentence_93 93
#define sentence_94 94
#define sentence_95 95
#define sentence_96 96
#define sentence_97 97
#define sentence_98 98
#define sentence_99 99
#define sentence_100 100
#define sentence_101 101
#define sentence_102 102
#define sentence_103 103
#define sentence_104 104
#define sentence_105 105
#define sentence_106 106
#define sentence_107 107
#define sentence_108 108
#define sentence_109 109
#define sentence_110 110
#define sentence_111 111
#define sentence_112 112
#define sentence_113 113
#define sentence_114 114
#define sentence_115 115
#define sentence_116 116
#define sentence_117 117
#define sentence_118 118
#define sentence_119 119
#define sentence_120 120
#define sentence_121 121
#define sentence_122 122
#define sentence_123 123
#define sentence_124 124
#define sentence_125 125
#define sentence_126 126
#define sentence_127 127
#define sentence_128 128
#define sentence_129 129
#define sentence_130 130
#define sentence_131 131
#define sentence_132 132
#define sentence_133 133
#define sentence_134 134
#define sentence_135 135
#define sentence_136 136
#define sentence_137 137
#define sentence_138 138
#define sentence_139 139
#define sentence_140 140
#define sentence_141 141
#define sentence_142 142
#define sentence_143 143
#define sentence_144 144
#define sentence_145 145
#define sentence_146 146
#define sentence_147 147
#define sentence_148 148
#define sentence_149 149
#define sentence_150 150
#define sentence_151 151
#define sentence_152 152
#define sentence_153 153
#define sentence_154 154
#define sentence_155 155
#define sentence_156 156
#define sentence_157 157
#define sentence_158 158
#define sentence_159 159
#define sentence_160 160
#define sentence_161 161
#define sentence_162 162
#define sentence_163 163
#define sentence_164 164
#define sentence_165 165
#define sentence_166 166
#define sentence_167 167
#define sentence_168 168
#define sentence_169 169
#define sentence_170 170
#define sentence_171 171
#define sentence_172 172
#define sentence_173 173
#define sentence_174 174
#define sentence_175 175
#define sentence_176 176
#define sentence_177 177
#define sentence_178 178
#define sentence_179 179
#define sentence_180 180
#define sentence_181 181
#define sentence_182 182
#define sentence_183 183
#define sentence_184 184
#define sentence_185 185
#define sentence_186 186
#define sentence_187 187
#define sentence_188 188
#define sentence_189 189
#define sentence_190 190
#define sentence_191 191
#define sentence_192 192
#define sentence_193 193
#define sentence_194 194
#define sentence_195 195
#define sentence_196 196
#define sentence_197 197
#define sentence_198 198
#define sentence_199 199
#define sentence_200 200
#define sentence_201 201
#define sentence_202 202
#define sentence_203 203
#define sentence_204 204
#define sentence_205 205
#define sentence_206 206
#define sentence_207 207
#define sentence_208 208
#define sentence_209 209
#define sentence_210 210
#define sentence_211 211
#define sentence_212 212
#define sentence_213 213
#define sentence_214 214
#define sentence_215 215
#define sentence_216 216
#define sentence_217 217
#define sentence_218 218
#define sentence_219 219
#define sentence_220 220
#define sentence_221 221
#define sentence_222 222
#define sentence_223 223
#define sentence_224 224
#define sentence_225 225
#define sentence_226 226
#define sentence_227 227
#define sentence_228 228
#define sentence_229 229
#define sentence_230 230
#define sentence_231 231
#define sentence_232 232
#define sentence_233 233
#define sentence_234 234
#define sentence_235 235
#define sentence_236 236
#define sentence_237 237
#define sentence_238 238
#define sentence_239 239
#define sentence_240 240
#define sentence_241 241
#define sentence_242 242
#define sentence_243 243
#define sentence_244 244
#define sentence_245 245
#define sentence_246 246
#define sentence_247 247
#define sentence_248 248
#define sentence_249 249
#define sentence_250 250
#define sentence_251 251
#define sentence_252 252
#define sentence_253 253
#define sentence_254 254
#define sentence_255 255
;;
;;#include sysapi.h
;;
IAR0 EQU [00H]
R0 EQU [00H] ;old style declaration, not recommended for use
MP0 EQU [01H]
ACC EQU [05H]
PCL EQU [06H]
TBLP EQU [07H]
TBLH EQU [08H]
WDTS EQU [09H]
STATUS EQU [0AH]
INTC EQU [0BH]
TMR0 EQU [0DH]
TMR0C EQU [0EH]
TMR1 EQU [010H]
TMR1C EQU [011H]
PA EQU [012H]
PAC EQU [013H]
PB EQU [014H]
PBC EQU [015H]
INTCH EQU [01EH]
SIMC0B EQU [020H]
SIMC1B EQU [021H]
SIMDRB EQU [022H]
SIMARB EQU [023H]
SIMC2B EQU [023H]
DAL EQU [024H]
DAH EQU [025H]
PWMCR EQU [026H]
PWML EQU [027H]
PWMH EQU [028H]
VOL EQU [029H]
SIMC0A EQU [02BH]
SIMC1A EQU [02CH]
SIMDRA EQU [02DH]
SIMARA EQU [02EH]
SIMC2A EQU [02EH]
C EQU [0AH].0
AC EQU [0AH].1
Z EQU [0AH].2
OV EQU [0AH].3
PDF EQU [0AH].4
TO EQU [0AH].5
EMI EQU [0BH].0
ETBI EQU [0BH].1
ET0I EQU [0BH].2
ET1I EQU [0BH].3
TBF EQU [0BH].4
T0F EQU [0BH].5
T1F EQU [0BH].6
B0 EQU [0DH].0
B1 EQU [0DH].1
B2 EQU [0DH].2
B3 EQU [0DH].3
B4 EQU [0DH].4
B5 EQU [0DH].5
B6 EQU [0DH].6
B7 EQU [0DH].7
T0PS0 EQU [0EH].0
T0PS1 EQU [0EH].1
T0PS2 EQU [0EH].2
T0E EQU [0EH].3
T0ON EQU [0EH].4
T0M0 EQU [0EH].6
T0M1 EQU [0EH].7
T1PS0 EQU [011H].0
T1PS1 EQU [011H].1
T1PS2 EQU [011H].2
T1E EQU [011H].3
T1ON EQU [011H].4
T1M0 EQU [011H].6
T1M1 EQU [011H].7
PA0 EQU [012H].0
PA1 EQU [012H].1
PA2 EQU [012H].2
PA3 EQU [012H].3
PA4 EQU [012H].4
PA5 EQU [012H].5
PA6 EQU [012H].6
PA7 EQU [012H].7
PAC0 EQU [013H].0
PAC1 EQU [013H].1
PAC2 EQU [013H].2
PAC3 EQU [013H].3
PAC4 EQU [013H].4
PAC5 EQU [013H].5
PAC6 EQU [013H].6
PAC7 EQU [013H].7
PB0 EQU [014H].0
PB1 EQU [014H].1
PB2 EQU [014H].2
PB3 EQU [014H].3
PB4 EQU [014H].4
PB5 EQU [014H].5
PB6 EQU [014H].6
PB7 EQU [014H].7
PBC0 EQU [015H].0
PBC1 EQU [015H].1
PBC2 EQU [015H].2
PBC3 EQU [015H].3
PBC4 EQU [015H].4
PBC5 EQU [015H].5
PBC6 EQU [015H].6
PBC7 EQU [015H].7
ESIAI EQU [01EH].0
ESIBI EQU [01EH].1
SIAF EQU [01EH].4
SIBF EQU [01EH].5
SIMENB EQU [020H].1
SIM0B EQU [020H].5
SIM1B EQU [020H].6
SIM2B EQU [020H].7
RXAKB EQU [021H].0
RNICB EQU [021H].1
SRWB EQU [021H].2
TXAKB EQU [021H].3
HTXB EQU [021H].4
HBBB EQU [021H].5
HAASB EQU [021H].6
HCFB EQU [021H].7
SD0B EQU [022H].0
SD1B EQU [022H].1
SD2B EQU [022H].2
SD3B EQU [022H].3
SD4B EQU [022H].4
SD5B EQU [022H].5
SD6B EQU [022H].6
SD7B EQU [022H].7
SA1B EQU [023H].1
SA2B EQU [023H].2
SA3B EQU [023H].3
SA4B EQU [023H].4
SA5B EQU [023H].5
SA6B EQU [023H].6
SA7B EQU [023H].7
TRFB EQU [023H].0
WCOLB EQU [023H].1
CSENB EQU [023H].2
MLSB EQU [023H].3
CKEGB EQU [023H].4
CKPOLB EQU [023H].5
PWMC EQU [026H].0
DAC EQU [026H].1
LVDF EQU [026H].2
SINGLE_PWM EQU [026H].3
MSB_SIGN EQU [026H].7
VOL0 EQU [029H].0
VOL1 EQU [029H].1
VOL2 EQU [029H].2
V4 EQU [029H].4
V5 EQU [029H].5
V6 EQU [029H].6
V7 EQU [029H].7
SIMENA EQU [02BH].1
SIM0A EQU [02BH].5
SIM1A EQU [02BH].6
SIM2A EQU [02BH].7
RXAKA EQU [02CH].0
RNICA EQU [02CH].1
SRWA EQU [02CH].2
TXAKA EQU [02CH].3
HTXA EQU [02CH].4
HBBA EQU [02CH].5
HAASA EQU [02CH].6
HCFA EQU [02CH].7
SD0A EQU [02DH].0
SD1A EQU [02DH].1
SD2A EQU [02DH].2
SD3A EQU [02DH].3
SD4A EQU [02DH].4
SD5A EQU [02DH].5
SD6A EQU [02DH].6
SD7A EQU [02DH].7
SA1A EQU [02EH].1
SA2A EQU [02EH].2
SA3A EQU [02EH].3
SA4A EQU [02EH].4
SA5A EQU [02EH].5
SA6A EQU [02EH].6
SA7A EQU [02EH].7
TRFA EQU [02EH].0
WCOLA EQU [02EH].1
CSENA EQU [02EH].2
MLSA EQU [02EH].3
CKEGA EQU [02EH].4
CKPOLA EQU [02EH].5
LASTPAGE EQU 0700H
#define CF [0AH].0
#define Carry STATUS.0
#define ZF [0AH].2
#define ZERO [0AH].2
#DEFINE HT83SYSTEMFREQUENCY HT86SYSTEMFREQUENCY
EXTERN _MAIN_VOLUME :BYTE
EXTERN F_C_FUNCTION :BIT
EXTERN _FSTANDBY0 :BIT
EXTERN B_CH0_USER_SR :BIT
EXTERN SAMPLINGRATE0 :BIT ;DBIT ;;CHANNEL NO
EXTERN SAMPLINGRATE1 :BYTE ;DB ? ;;TMRC
EXTERN SAMPLINGRATE2 :BYTE ;DB ? ;;TMR
EXTERN _PLAY_VOICE0 :BYTE ;DB 2 DUP (?) ;;TRACKNO
EXTERN _PLAY_VOICE1 :BIT ;DBIT ;;CHANNEL
EXTERN _PLAY_VOICE2 :BIT ;DBIT ;;FILTER
EXTERN _PLAY_SENTENCE0 :BYTE ;DB 2 DUP (?) ;;SENTENCENO
EXTERN _PLAY_SENTENCE1 :BIT ;DBIT ;;CHANNEL
EXTERN _PLAY_SENTENCE2 :BIT ;DBIT ;;FILTER
EXTERN VOLUME0 :BYTE ;DB ? ;;VOLUME INDEX 0 - 7
EXTERN CUE_CHANNEL :BIT ;DBIT
EXTERN CUE_IN :BIT ;DBIT
EXTERN CUE_CODE :BYTE ;DB ?
EXTERN CUE_NUMBER :BYTE ;DB ?
EXTERN SR0ISR :NEAR
EXTERN __PLAY_VOICE :NEAR
EXTERN __PLAY_SENTENCE :NEAR
EXTERN _DAC_RAMP_UP :NEAR
EXTERN _DAC_RAMP_DOWN :NEAR
EXTERN _SETSTANDBY :NEAR
EXTERN _SET_VOLUME :NEAR
EXTERN _VOLUMEUP :NEAR
EXTERN _VOLUMEDOWN :NEAR
EXTERN _STOPCH0 :NEAR
EXTERN _SYSTEM_INITIALIZATION :NEAR
EXTERN _CLRRAM :NEAR
EXTERN _FUNCCHECKSUM :NEAR
EXTERN _INITTIMEBASE :NEAR
IFNDEF _HOLTEK_C_
_PLAY_VOICE macro t2,t1,CH,volume,filter ;speech1 macro tH,tL,CH,vol,filter
;;
CLR TMR0C
;;1nd parameter
IFNB T2
MOV A,T2
MOV _PLAY_VOICE0[1],A
ENDIF
;;2nd parameter
IFNB T1
MOV A,T1
MOV _PLAY_VOICE0[0],A
ENDIF
;;3nd parameter
IFNB CH
IF CH==0
CLR _PLAY_VOICE1
ELSE
SET _PLAY_VOICE1
ENDIF
ELSE
CLR _PLAY_VOICE1
ENDIF
;;4nd parameter
IFNB VOLUME
MOV A,VOLUME
CALL _SET_VOLUME
ELSE
ENDIF
;;5nd parameter
IFNB FILTER
IF FILTER == 1
SET _PLAY_VOICE2
ELSE
CLR _PLAY_VOICE2
ENDIF
ELSE
CLR _PLAY_VOICE2
ENDIF
CALL __PLAY_VOICE
ENDM
_PLAY_SENTENCE MACRO T2,T1,CH ,VOLUME ,filter ;;SENTENCE macro tH,tL,CH,vol,filter
;;
CLR TMR0C
;;1nd parameter
IFNB T2
MOV A,T2
MOV _PLAY_SENTENCE0[1],A
ENDIF
;;2nd parameter
IFNB T1
MOV A,T1
MOV _PLAY_SENTENCE0[0],A
ENDIF
;;3nd parameter
IFNB CH
IF CH==0
CLR _PLAY_SENTENCE1
ELSE
SET _PLAY_SENTENCE1
ENDIF
ELSE
CLR _PLAY_SENTENCE1
ENDIF
;;4nd parameter
IFNB VOLUME
MOV A,VOLUME
CALL _SET_VOLUME
ELSE
ENDIF
;;5nd parameter
IFNB FILTER
IF FILTER == 1
SET _PLAY_SENTENCE2
ELSE
CLR _PLAY_SENTENCE2
ENDIF
ELSE
CLR _PLAY_SENTENCE2
ENDIF
CALL __PLAY_SENTENCE
ENDM
_VOLUME macro VOLUME0
MOV A,VOLUME0
CALL _SET_VOLUME
ENDM
_SAMPLINGRATE MACRO CHANNEL, M_SR
IF M_SR != 0
IF CHANNEL==0
CLR TMR0C
IF(HT86SYSTEMFREQUENCY/(4*M_SR)<=256)
MOV A,256-HT86SYSTEMFREQUENCY/(4*M_SR)
MOV TMR0,A
MOV A,51H
ELSEIF(HT86SYSTEMFREQUENCY/(8*M_SR)<=256)
MOV A,256-HT86SYSTEMFREQUENCY/(8*M_SR)
MOV TMR0,A
MOV A,52H
ELSEIF(HT86SYSTEMFREQUENCY/(16*M_SR)<=256)
MOV A,256-HT86SYSTEMFREQUENCY/(16*M_SR)
MOV TMR0,A
MOV A,53H
ELSEIF(HT86SYSTEMFREQUENCY/(16*M_SR)<=256*2)
MOV A,256-HT86SYSTEMFREQUENCY/(2*16*M_SR)
MOV TMR0,A
MOV A,54H
ELSEIF(HT86SYSTEMFREQUENCY/(16*M_SR)<=256*4)
MOV A,256-HT86SYSTEMFREQUENCY/(4*16*M_SR)
MOV TMR0,A
MOV A,55H
ELSEIF(HT86SYSTEMFREQUENCY/(16*M_SR)<=256*8)
MOV A,256-HT86SYSTEMFREQUENCY/(8*16*M_SR)
MOV TMR0,A
MOV A,56H
ELSE
MOV A,256-HT86SYSTEMFREQUENCY/(16*16*M_SR)
MOV TMR0,A
MOV A,57H
ENDIF
SET B_CH0_USER_SR
MOV TMR0C,A
ELSE
; if frequency out of range
Message 'ERROR in sampling rate macro -- Sampling rate out of range!'
ENDIF
ENDIF
ENDM
ENDIF
IFDEF _HOLTEK_C_
ENDIF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -