BASIC compiler/interpreter for PIC32MX/MZ-80K (suspended)
| Revision | 146 (tree) |
|---|---|
| Time | 2016-08-01 08:28:40 |
| Author | kmorimatsu |
Same tempo of MUSIC/SOUND in graphic mode as in text mode.
| @@ -138,10 +138,8 @@ | ||
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | static const char bastext[]= |
| 141 | -"CLS\r\n" | |
| 142 | -"\r\n" | |
| 143 | -"DATA 100"; | |
| 144 | -//"\r\n"; | |
| 141 | +"CLS\n" | |
| 142 | +"\n"; | |
| 145 | 143 | |
| 146 | 144 | /* |
| 147 | 145 | Test function for constructing assemblies from C codes. |
| @@ -520,6 +520,8 @@ | ||
| 520 | 520 | // Stop GRAPHIC if used |
| 521 | 521 | set_graphmode(0); |
| 522 | 522 | g_use_graphic=0; |
| 523 | + // Set timer4 for tempo | |
| 524 | + PR4=59473; // 3632*262/16-1 | |
| 523 | 525 | } else { |
| 524 | 526 | // Prepare GRAPHIC area if not used and not allcated. |
| 525 | 527 | allocate_graphic_area(); |
| @@ -538,6 +540,8 @@ | ||
| 538 | 540 | if (mode !=3 && !g_use_graphic){ |
| 539 | 541 | set_graphmode(1); |
| 540 | 542 | g_use_graphic=1; |
| 543 | + // Set timer4 for tempo | |
| 544 | + PR4=55756; // ~=3405*262/16-1(55755.875) | |
| 541 | 545 | } |
| 542 | 546 | break; |
| 543 | 547 | } |
| @@ -166,8 +166,8 @@ | ||
| 166 | 166 | T3CON=0x0050; // Prescaller: 1:32 (1.8 MHz), not yet started |
| 167 | 167 | |
| 168 | 168 | // Timer4 is used to intterupt every 1/60 sec, just after NTSC view. |
| 169 | - T4CON=0x0050; // Prescaller: 1:32 | |
| 170 | - PR4=29736; // 3632*262/32-1 | |
| 169 | + T4CON=0x0040; // Prescaller: 1:16 | |
| 170 | + PR4=59473; // 3632*262/16-1 | |
| 171 | 171 | // Timer 4 interruption, IPL3 |
| 172 | 172 | IPC4bits.T4IP=3; |
| 173 | 173 | IPC4bits.T4IS=0; |