[Scummvm-cvs-logs] SF.net SVN: scummvm:[33927] scummvm/branches/gsoc2008-tfmx
marwanhilmi at users.sourceforge.net
marwanhilmi at users.sourceforge.net
Sat Aug 16 07:56:03 CEST 2008
Revision: 33927
http://scummvm.svn.sourceforge.net/scummvm/?rev=33927&view=rev
Author: marwanhilmi
Date: 2008-08-16 05:56:02 +0000 (Sat, 16 Aug 2008)
Log Message:
-----------
Fixed bug with keyUp/looping. Fixed bug with vibrato. Fixed STUPID bug with periods!
Modified Paths:
--------------
scummvm/branches/gsoc2008-tfmx/base/main.cpp
scummvm/branches/gsoc2008-tfmx/sound/mods/tfmx.cpp
scummvm/branches/gsoc2008-tfmx/sound/mods/tfmx.h
Modified: scummvm/branches/gsoc2008-tfmx/base/main.cpp
===================================================================
--- scummvm/branches/gsoc2008-tfmx/base/main.cpp 2008-08-16 05:40:37 UTC (rev 33926)
+++ scummvm/branches/gsoc2008-tfmx/base/main.cpp 2008-08-16 05:56:02 UTC (rev 33927)
@@ -300,15 +300,15 @@
/*
if (_aTfmx.loadSong(0)) {
- _aTfmx.testPattern(0x0C);
+ _aTfmx.testPattern(0x08);
}
//*/
- ///*
- //if (_aTfmx.loadSong(0)) {
- // _aTfmx.testMacro(0x17);
- //}
- //*/
+ /*
+ if (_aTfmx.loadSong(0)) {
+ _aTfmx.testMacro(0x17);
+ }
+ */
system.getMixer()->playInputStream( Audio::Mixer::kMusicSoundType, &_handle, &_aTfmx, -1, 255, 0, false);
system.delayMillis( 999999 );
Modified: scummvm/branches/gsoc2008-tfmx/sound/mods/tfmx.cpp
===================================================================
--- scummvm/branches/gsoc2008-tfmx/sound/mods/tfmx.cpp 2008-08-16 05:40:37 UTC (rev 33926)
+++ scummvm/branches/gsoc2008-tfmx/sound/mods/tfmx.cpp 2008-08-16 05:56:02 UTC (rev 33927)
@@ -329,7 +329,9 @@
switch (byte1) {
case 0xF0: //end pattern + advance track
//end pattern? also needs to know the track this is playing on
- _tracks[trackNumber].patternOn = false;
+ if (!_tracks[trackNumber].activeMacro.keyWaitOn) {
+ _tracks[trackNumber].patternOn = false;
+ }
//_trackAdvance = true;
break;
case 0xF1: //repeat block/loop
@@ -349,8 +351,10 @@
break;
case 0xF4: //kills track until new pointer is loaded
//need to know track this pattern is on, then needs to stop reading proceeding cmds
- _tracks[trackNumber].patternOn = false;
- _tracks[trackNumber].trackOn = false;
+ if (!_tracks[trackNumber].activeMacro.keyWaitOn) {
+ _tracks[trackNumber].patternOn = false;
+ _tracks[trackNumber].trackOn = false;
+ }
break;
case 0xF5: //Key up
_channels[(byte3 & 0x0F)].keyUp = true;
@@ -439,7 +443,9 @@
}
//IF THE END IS REACHED, TURN PATTERN OFF
if (_tracks[trackNumber].activePattern.patternCount == _tracks[trackNumber].activePattern.patternLength) {
+ if (!_tracks[trackNumber].activeMacro.keyWaitOn) {
_tracks[trackNumber].patternOn = false;
+ }
}
}
void Tfmx::loadMacro(uint8 trackNumber, uint8 macroNumber){
@@ -486,6 +492,7 @@
_channels[currentChannel].sampleLength = 0;
_channels[currentChannel].envelopeOn = false;
_channels[currentChannel].vibratoOn = false;
+ //_tracks[trackNumber].activeMacro.macroWait = 1;
break;
case 0x01:
_channels[currentChannel].sampleOn = true;
@@ -575,6 +582,7 @@
_channels[currentChannel].vibratoRate = byte4;
_channels[currentChannel].vibratoSpeed = byte2 * 2;
_channels[currentChannel].vibratoCount = 0;
+ _channels[currentChannel].vibratoDirection = false; //vibrato down first
break;
case 0x14://wait for key-up
_tracks[trackNumber].activeMacro.keyWaitOn = true;
@@ -784,10 +792,12 @@
//vibrato up
if (_channels[channelNumber].vibratoDirection) { //true = up
_channels[channelNumber].period += _channels[channelNumber].vibratoRate;
+ _channels[channelNumber].vibratoDirection = false;
}
//vibrato down
- if (!_channels[channelNumber].vibratoDirection) { //false = down
- _channels[channelNumber].period += _channels[channelNumber].vibratoRate;
+ else if (!_channels[channelNumber].vibratoDirection) { //false = down
+ _channels[channelNumber].period -= _channels[channelNumber].vibratoRate;
+ _channels[channelNumber].vibratoDirection = true;
}
//reset count
_channels[channelNumber].vibratoCount = 0;
Modified: scummvm/branches/gsoc2008-tfmx/sound/mods/tfmx.h
===================================================================
--- scummvm/branches/gsoc2008-tfmx/sound/mods/tfmx.h 2008-08-16 05:40:37 UTC (rev 33926)
+++ scummvm/branches/gsoc2008-tfmx/sound/mods/tfmx.h 2008-08-16 05:56:02 UTC (rev 33927)
@@ -147,7 +147,7 @@
//Channel structure
struct Channel {
- uint8 period;
+ uint16 period;
int8 volume;
uint32 sampleOffset;
uint32 sampleLength;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list