• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BASIC compiler/interpreter for PIC32MX/MZ-80K (suspended)


Commit MetaInfo

Revision145 (tree)
Time2016-07-31 13:57:49
Authorkmorimatsu

Log Message

Same tone of MUSIC/SOUND in graphic mode as in text mode

Change Summary

Incremental Difference

--- mips/branches/zoea/music.c (revision 144)
+++ mips/branches/zoea/music.c (revision 145)
@@ -357,6 +357,12 @@
357357 sound=data[0]&0x0000FFFF;
358358 data++;
359359 if (len) {
360+ // Shift tone if graphic is used
361+ if (g_use_graphic) {
362+ // MUL_15 instead of MUL_16 for CPU clock.
363+ // sound=sound*15/16
364+ sound-=(sound+7)>>4;
365+ }
360366 g_sound[pos]=sound-1;
361367 g_soundlen[pos]=len;
362368 pos++;
@@ -452,6 +458,12 @@
452458 g_mspos++;
453459 len=len/musicGetNum();
454460 }
461+ // Shift tone if graphic is used
462+ if (g_use_graphic) {
463+ // MUL_15 instead of MUL_16 for CPU clock.
464+ // tone=tone*15/16
465+ tone-=(tone+7)>>4;
466+ }
455467 // Update music value array
456468 IEC0bits.T4IE=0; // Stop interruption, first.
457469 if (g_musicstart==g_musicend) {