DREAMWEB: Convert volumeAdjust

This commit is contained in:
Max Horn 2011-12-07 11:43:07 +01:00
parent f37b748676
commit 3056c39a75
6 changed files with 18 additions and 25 deletions

View File

@ -647,6 +647,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'usewinch',
'usewindow',
'viewfolder',
'volumeadjust',
'waitframes',
'walkandexamine',
'walking',
@ -1130,7 +1131,6 @@ generator = cpp(context, "DreamGen", blacklist = [
'intromusic' : 'introMusic',
'quitkey' : 'quitKey',
'processtrigger' : 'processTrigger',
'volumeadjust' : 'volumeAdjust',
'randomnum2' : 'randomNum2',
'loadsecondsample' : 'loadSecondSample',
'transfercontoex' : 'transferConToEx',

View File

@ -57,6 +57,9 @@ public:
uint8 getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16 *offset);
uint8 kernChars(uint8 firstChar, uint8 secondChar, uint8 width);
// from stubs.cpp
void volumeAdjust();
// from vgagrafx.cpp
void printUnderMon();
void cls();

View File

@ -7141,27 +7141,6 @@ tensc:
cs.byte(di+7) = al;
}
void DreamGenContext::volumeAdjust() {
STACK_CHECK;
al = data.byte(kVolumedirection);
_cmp(al, 0);
if (flags.z())
return /* (volok) */;
al = data.byte(kVolume);
_cmp(al, data.byte(kVolumeto));
if (flags.z())
goto volfinish;
_add(data.byte(kVolumecount), 64);
if (!flags.z())
return /* (volok) */;
al = data.byte(kVolume);
_add(al, data.byte(kVolumedirection));
data.byte(kVolume) = al;
return;
volfinish:
data.byte(kVolumedirection) = 0;
}
void DreamGenContext::entryTexts() {
STACK_CHECK;
_cmp(data.byte(kLocation), 21);

View File

@ -766,7 +766,6 @@ public:
void alleyBarkSound();
void quitKey();
void processTrigger();
void volumeAdjust();
void transferConToEx();
void adjustDown();
void withWhat();

View File

@ -463,9 +463,7 @@ bool DreamWebEngine::loadSpeech(const Common::String &filename) {
void DreamWebEngine::soundHandler() {
_context.data.byte(DreamGen::kSubtitles) = ConfMan.getBool("subtitles");
_context.push(_context.ax);
_context.volumeAdjust();
_context.ax = _context.pop();
uint volume = _context.data.byte(DreamGen::kVolume);
//.vol file loaded into soundbuf:0x4000

View File

@ -1135,6 +1135,7 @@ void DreamGenContext::fadeDOS() {
}
}
void DreamGenContext::eraseOldObs() {
if (data.byte(kNewobs) == 0)
return;
@ -2453,6 +2454,19 @@ Frame * DreamGenContext::tempGraphics3() {
return (Frame *)getSegment(data.word(kTempgraphics3)).ptr(0, 0);
}
void DreamBase::volumeAdjust() {
if (data.byte(kVolumedirection) == 0)
return;
if (data.byte(kVolume) != data.byte(kVolumeto)) {
data.byte(kVolumecount) += 64;
// Only modify the volume every 256/64 = 4th time around
if (data.byte(kVolumecount) == 0)
data.byte(kVolume) += data.byte(kVolumedirection);
} else {
data.byte(kVolumedirection) = 0;
}
}
void DreamGenContext::playChannel0(uint8 index, uint8 repeat) {
if (data.byte(kSoundint) == 255)
return;