shithub: pt2-clone

Download patch

ref: 6b9845042e4978d995162f95ddd5bc935c9b2010
parent: 63402619f6de96adeb1a45dff7a558d745448a1c
author: Olav Sørensen <olav.sorensen@live.no>
date: Wed Jan 22 11:21:22 EST 2020

Pushed v1.03 code

- Bugfix: The MOD2WAV function would write .wav files with a wrong
  chunk length. Some .wav loaders didn't like this...
- Bugfix: Don't allow toggling scope muting with right mouse button
  while MOD2WAV is ongoing.

--- a/src/pt2_audio.c
+++ b/src/pt2_audio.c
@@ -1023,10 +1023,10 @@
 	wavHeader.numChannels = 2;
 	wavHeader.sampleRate = audio.audioFreq;
 	wavHeader.bitsPerSample = 16;
-	wavHeader.byteRate = wavHeader.sampleRate * wavHeader.numChannels * wavHeader.bitsPerSample / 8;
-	wavHeader.blockAlign = wavHeader.numChannels * wavHeader.bitsPerSample / 8;
+	wavHeader.byteRate = wavHeader.sampleRate * wavHeader.numChannels * (wavHeader.bitsPerSample / 8);
+	wavHeader.blockAlign = wavHeader.numChannels * (wavHeader.bitsPerSample / 8);
 	wavHeader.subchunk2ID = 0x61746164; // "data"
-	wavHeader.subchunk2Size = totalSampleCounter * 4; // 16-bit stereo = * 4
+	wavHeader.subchunk2Size = totalSampleCounter * (wavHeader.bitsPerSample / 8);
 
 	fwrite(&wavHeader, sizeof (wavHeader_t), 1, fOut);
 	fclose(fOut);
--- a/src/pt2_header.h
+++ b/src/pt2_header.h
@@ -13,7 +13,7 @@
 #include <stdint.h>
 #include "pt2_unicode.h"
 
-#define PROG_VER_STR "1.02"
+#define PROG_VER_STR "1.03"
 
 #ifdef _WIN32
 #define DIR_DELIMITER '\\'
--- a/src/pt2_mouse.c
+++ b/src/pt2_mouse.c
@@ -2142,7 +2142,8 @@
 	if (editor.ui.visualizerMode == VISUAL_QUADRASCOPE && input.mouse.y >= 55 && input.mouse.y <= 87)
 	{
 		if (!editor.ui.posEdScreenShown && !editor.ui.editOpScreenShown && !editor.ui.diskOpScreenShown &&
-			!editor.ui.aboutScreenShown && !editor.ui.samplerVolBoxShown && !editor.ui.samplerFiltersBoxShown)
+			!editor.ui.aboutScreenShown && !editor.ui.samplerVolBoxShown &&
+			!editor.ui.samplerFiltersBoxShown && !editor.isWAVRendering)
 		{
 			     if (input.mouse.x > 127 && input.mouse.x <= 167) editor.muted[0] ^= 1;
 			else if (input.mouse.x > 175 && input.mouse.x <= 215) editor.muted[1] ^= 1;