Added a new '-t' commandline option to set TEMPO_BASE (note: In decimal, not hex.. should fix).
svn-id: r3641
This commit is contained in:
parent
ddad6760a5
commit
945d81761b
3 changed files with 17 additions and 7 deletions
3
scumm.h
3
scumm.h
|
@ -799,7 +799,8 @@ struct Scumm {
|
||||||
// byte _minorScummVersion;
|
// byte _minorScummVersion;
|
||||||
ScummDebugger *_debugger;
|
ScummDebugger *_debugger;
|
||||||
void *_gui; /* actually a pointer to a Gui */
|
void *_gui; /* actually a pointer to a Gui */
|
||||||
|
|
||||||
|
int _gameTempo;
|
||||||
int _lastLoadedRoom;
|
int _lastLoadedRoom;
|
||||||
int _roomResource;
|
int _roomResource;
|
||||||
byte _encbyte;
|
byte _encbyte;
|
||||||
|
|
|
@ -195,7 +195,8 @@ void Scumm::scummMain(int argc, char **argv) {
|
||||||
_minHeapThreshold = 400000;
|
_minHeapThreshold = 400000;
|
||||||
|
|
||||||
_gameDataPath = NULL;
|
_gameDataPath = NULL;
|
||||||
|
_gameTempo = 0;
|
||||||
|
|
||||||
parseCommandLine(argc, argv);
|
parseCommandLine(argc, argv);
|
||||||
|
|
||||||
if (_exe_name==NULL)
|
if (_exe_name==NULL)
|
||||||
|
@ -208,7 +209,7 @@ void Scumm::scummMain(int argc, char **argv) {
|
||||||
|
|
||||||
if (!_gameDataPath) {
|
if (!_gameDataPath) {
|
||||||
warning("No path was provided. Assuming that data file are in the current directory");
|
warning("No path was provided. Assuming that data file are in the current directory");
|
||||||
_gameDataPath = (char *)malloc(sizeof(char) * 2);
|
_gameDataPath = (char *)malloc(sizeof(char) * 2);
|
||||||
strcpy(_gameDataPath, "");
|
strcpy(_gameDataPath, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,6 +414,9 @@ void Scumm::parseCommandLine(int argc, char **argv) {
|
||||||
case 'p':
|
case 'p':
|
||||||
_gameDataPath = argv[++i];
|
_gameDataPath = argv[++i];
|
||||||
break;
|
break;
|
||||||
|
case 't':
|
||||||
|
_gameTempo = atoi(s+1);
|
||||||
|
goto NextArg;
|
||||||
default:
|
default:
|
||||||
ShowHelpAndExit:;
|
ShowHelpAndExit:;
|
||||||
printf(
|
printf(
|
||||||
|
@ -421,6 +425,7 @@ ShowHelpAndExit:;
|
||||||
"\tscummvm [-b<num>] [-p path] game\n"
|
"\tscummvm [-b<num>] [-p path] game\n"
|
||||||
"Flags:\n"
|
"Flags:\n"
|
||||||
"\tb<num> - start in that room\n"
|
"\tb<num> - start in that room\n"
|
||||||
|
"\tt<num> - Set music tempo. Suggested: 1F0000\n"
|
||||||
"\tf - fullscreen mode\n");
|
"\tf - fullscreen mode\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ bool SoundEngine::start_sound(int sound) {
|
||||||
player = allocate_player(128);
|
player = allocate_player(128);
|
||||||
if (!player)
|
if (!player)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
player->clear();
|
player->clear();
|
||||||
return player->start_sound(sound);
|
return player->start_sound(sound);
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ void SoundEngine::init_players() {
|
||||||
|
|
||||||
for (i=ARRAYSIZE(_players); i!=0; i--, player++) {
|
for (i=ARRAYSIZE(_players); i!=0; i--, player++) {
|
||||||
player->_active = false;
|
player->_active = false;
|
||||||
player->_se = this;
|
player->_se = this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1059,8 +1059,12 @@ int Player::start_seq_sound(int sound) {
|
||||||
|
|
||||||
void Player::set_tempo(uint32 b) {
|
void Player::set_tempo(uint32 b) {
|
||||||
uint32 i,j;
|
uint32 i,j;
|
||||||
|
printf("is: %d\n", _se->_s->_gameTempo);
|
||||||
i = TEMPO_BASE;
|
if (_se->_s->_gameTempo < 1000)
|
||||||
|
i = TEMPO_BASE;
|
||||||
|
else
|
||||||
|
i = _se->_s->_gameTempo;
|
||||||
|
printf("Tempo set to: %d\n", i);
|
||||||
j = _tempo = b;
|
j = _tempo = b;
|
||||||
|
|
||||||
while (i&0xFFFF0000 || j&0xFFFF0000) { i>>=1; j>>=1; }
|
while (i&0xFFFF0000 || j&0xFFFF0000) { i>>=1; j>>=1; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue