📄 audio.lst
字号:
278 1
279 1 mspdata[0] = 0x12;
280 1 mspdata[1] = 0x00;
281 1 mspdata[2] = 0x13; // SCART switch
282 1 mspdata[3] = 0x00;
283 1 mspdata[4] = 0x00;
284 1 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
285 1
286 1 mspdata[0] = 0x12;
287 1 mspdata[1] = 0x00;
288 1 mspdata[2] = 0x08; // source select
289 1 mspdata[3] = 0x02; // SCART input
290 1 mspdata[4] = 0x20; // stereo(transparent)
291 1 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
292 1
293 1 mspdata[0] = 0x12;
294 1 mspdata[1] = 0x00;
295 1 mspdata[2] = 0x0d; // SCART input prescale
296 1 mspdata[3] = 0x50;
297 1 mspdata[4] = 0x00;
298 1 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
299 1 ret = AudioAutoStdDetection();
300 1
301 1 #ifdef DEBUG_AUDIO
if( !ret ) {
Puts("\r\n--Fail to Audio AutoDetect");
C51 COMPILER V7.50 AUDIO 08/20/2007 10:23:29 PAGE 6
}
#endif
306 1 AudioOn(); //SetMSPVol();
307 1 }
308
309 #ifdef SUPPORT_PC
310 void PCAudio(void)
311 {
312 1 BYTE mspdata[5], loop=0;
313 1 WORD ret;
314 1
315 1 AudioOff();
316 1
317 1 mspdata[0] = 0x10;
318 1 mspdata[1] = 0x00;
319 1 mspdata[2] = 0x30; // MODUS register: Automatic-on
320 1 mspdata[3] = 0x20;
321 1 mspdata[4] = 0x03;
322 1 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
323 1
324 1 mspdata[0] = 0x12;
325 1 mspdata[1] = 0x00;
326 1 mspdata[2] = 0x13; // SCART switch
327 1 mspdata[3] = 0x02; // SCART2->DSP
328 1 mspdata[4] = 0x00;
329 1 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
330 1
331 1 mspdata[0] = 0x12;
332 1 mspdata[1] = 0x00;
333 1 mspdata[2] = 0x08; // source select
334 1 mspdata[3] = 0x02; // SCART input
335 1 mspdata[4] = 0x20; // stereo(transparent)
336 1 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
337 1
338 1 mspdata[0] = 0x12;
339 1 mspdata[1] = 0x00;
340 1 mspdata[2] = 0x0d; // SCART input prescale
341 1 mspdata[3] = 0x50;
342 1 mspdata[4] = 0x00;
343 1 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
344 1
345 1 ret = AudioAutoStdDetection();
346 1
347 1 #ifdef DEBUG_AUDIO
if( !ret ) {
Puts("\r\n--Fail to Audio AutoDetect");
}
#endif
352 1 AudioOn(); //SetMSPVol();
353 1 }
354 #endif
355
356 BYTE GetAudioVol(void)
357 {
358 1 return AudioVol;
359 1 }
360
361 BYTE ChangeVol(char amount)
362 {
363 1 BYTE chg=0;
364 1
365 1 CheckAndClearMuteOn();
C51 COMPILER V7.50 AUDIO 08/20/2007 10:23:29 PAGE 7
366 1
367 1 if( amount>0 ) {
368 2 if( ((AudioVol+amount) <= UserRange.Max) )
369 2 chg=1;
370 2 }
371 1 else {
372 2 if( AudioVol>UserRange.Min )
373 2 chg=1;
374 2 }
375 1
376 1 if( chg ) {
377 2 AudioVol += amount;
378 2 SetAudioVolEE( AudioVol );
379 2 SetMSPVol();
380 2 }
381 1
382 1 return AudioVol;
383 1 }
384
385 BYTE GetAudioBalance(void)
386 {
387 1 return AudioBalance;
388 1 }
389
390 BYTE ChangeBalance(char amount)
391 {
392 1 BYTE chg=0;
393 1
394 1 if( amount>0 ) {
395 2 if( ((AudioBalance+amount) <= UserRange.Max) ) {
396 3 chg=1;
397 3 }
398 2 }
399 1 else {
400 2 if( AudioBalance>UserRange.Min ) {
401 3 chg=1;
402 3 }
403 2 }
404 1
405 1 if( chg ) {
406 2 AudioBalance += amount;
407 2 SetAudioBalanceEE( AudioBalance );
408 2 SetMSPBalance();
409 2 }
410 1
411 1 return AudioBalance;
412 1 }
413
414 BYTE GetAudioBass(void)
415 {
416 1 return AudioBass;
417 1 }
418
419 BYTE ChangeBass(char amount)
420 {
421 1 BYTE chg=0;
422 1
423 1 if( amount>0 ) {
424 2 if( ((AudioBass+amount) <= UserRange.Max) ) {
425 3 chg = 1;
426 3 }
427 2 }
C51 COMPILER V7.50 AUDIO 08/20/2007 10:23:29 PAGE 8
428 1 else {
429 2 if( AudioBass>UserRange.Min ) {
430 3 chg = 1;
431 3 }
432 2 }
433 1
434 1 if( chg ) {
435 2 AudioBass += amount;
436 2 SetAudioBassEE( AudioBass );
437 2 SetMSPBass();
438 2 }
439 1
440 1 return AudioBass;
441 1 }
442
443 BYTE GetAudioTreble(void)
444 {
445 1 return AudioTreble;
446 1 }
447
448 BYTE ChangeTreble(char amount)
449 {
450 1 BYTE chg=0;
451 1
452 1 if( amount>0 ) {
453 2 if( ((AudioTreble+amount) <= UserRange.Max) ) {
454 3 chg = 1;
455 3 }
456 2 }
457 1 else {
458 2 if( AudioTreble>UserRange.Min ) {
459 3 chg = 1;
460 3 }
461 2 }
462 1
463 1 if( chg ) {
464 2 AudioTreble += amount;
465 2 SetAudioTrebleEE( AudioTreble );
466 2 SetMSPTreble();
467 2 }
468 1
469 1 return AudioTreble;
470 1 }
471
472 /*
473
474 BYTE GetAudioEffect(void)
475 {
476 return AudioEffect;
477 }
478
479 BYTE ChangeAudioEffect(char amount)
480 {
481 BYTE valdata[5];
482
483 amount = 0; //ignore
484 AudioEffect = 0xff - AudioEffect;
485
486 valdata[0] = 0x12;
487 valdata[1] = 0;
488 valdata[2] = 5;
489 valdata[3] = AudioEffect;
C51 COMPILER V7.50 AUDIO 08/20/2007 10:23:29 PAGE 9
490 valdata[4] = 0;
491 WriteI2Cn_(MSPI2CAddress, valdata, 5);
492
493 SetAudioEffectEE( AudioEffect );
494 return AudioEffect;
495 }
496 */
497 void ToggleAudioMute(void)
498 {
499 1 if( AudioMuteOn ) {
500 2 AudioOn(); //SetMSPVol();
501 2 AudioMuteOn = 0;
502 2 }
503 1 else {
504 2 AudioOff();
505 2 AudioMuteOn = 1;
506 2 }
507 1 }
508
509 void CheckAndClearMuteOn(void)
510 {
511 1 if( AudioMuteOn ) {
512 2 AudioOn(); //SetMSPVol();
513 2 AudioMuteOn = 0;
514 2 ClearMuteInfo();
515 2 }
516 1 }
517
518 /*void SetAudioMute(BYTE on )
519 {
520 AudioMuteOn = on;
521 }
522 */
523 BYTE IsAudioMuteOn(void)
524 {
525 1 return (BYTE)AudioMuteOn;
526 1 }
527
528 #ifdef SUPPORT_TV
void ChangeMTS(BYTE type)
{
switch( type ) {
case MTS_STEREO: break;
case MTS_MONO: break;
}
}
#endif
537
538 void ResetAudioValue()
539 {
540 1 SetAudioVolEE( 50 );
541 1 SetAudioBalanceEE( 50 );
542 1 SetAudioBassEE( 50 );
543 1 SetAudioTrebleEE( 50 );
544 1 // SetAudioEffectEE( 0 );
545 1
546 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1047 ----
CONSTANT SIZE = 24 ----
C51 COMPILER V7.50 AUDIO 08/20/2007 10:23:29 PAGE 10
XDATA SIZE = ---- ----
PDATA SIZE = ---- 62
DATA SIZE = ---- ----
IDATA SIZE = 4 ----
BIT SIZE = 2 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -