Skip to content

Commit

Permalink
DREAMWEB: Move 'soundOnReels' out of dreamgen
Browse files Browse the repository at this point in the history
  • Loading branch information
wjp committed Dec 3, 2011
1 parent 4595b75 commit c6b113c
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 46 deletions.
1 change: 1 addition & 0 deletions devtools/tasmrecover/tasm-recover
Expand Up @@ -420,6 +420,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'showword',
'singlekey',
'sortoutmap',
'soundonreels',
'sparky',
'sparkydrip',
'splitintolines',
Expand Down
45 changes: 0 additions & 45 deletions engines/dreamweb/dreamgen.cpp
Expand Up @@ -1909,51 +1909,6 @@ void DreamGenContext::liftNoise() {
playChannel1();
}

void DreamGenContext::soundOnReels() {
STACK_CHECK;
bl = data.byte(kReallocation);
_add(bl, bl);
_xor(bh, bh);
_add(bx, 991);
si = cs.word(bx);
reelsoundloop:
al = cs.byte(si);
_cmp(al, 255);
if (flags.z())
goto endreelsound;
ax = cs.word(si+1);
_cmp(ax, data.word(kReelpointer));
if (!flags.z())
goto skipreelsound;
_cmp(ax, data.word(kLastsoundreel));
if (flags.z())
goto skipreelsound;
data.word(kLastsoundreel) = ax;
al = cs.byte(si);
_cmp(al, 64);
if (flags.c())
{ playChannel1(); return; };
_cmp(al, 128);
if (flags.c())
goto channel0once;
_and(al, 63);
ah = 255;
{ playChannel0(); return; };
channel0once:
_and(al, 63);
ah = 0;
{ playChannel0(); return; };
skipreelsound:
_add(si, 3);
goto reelsoundloop;
endreelsound:
ax = data.word(kLastsoundreel);
_cmp(ax, data.word(kReelpointer));
if (flags.z())
return /* (nochange2) */;
data.word(kLastsoundreel) = -1;
}

void DreamGenContext::delEverything() {
STACK_CHECK;
al = data.byte(kMapysize);
Expand Down
1 change: 0 additions & 1 deletion engines/dreamweb/dreamgen.h
Expand Up @@ -895,7 +895,6 @@ class DreamGenContext : public Context {
void selectOpenOb();
void security();
void showSlots();
void soundOnReels();
void useGun();
void autoAppear();
void openRyan();
Expand Down
45 changes: 45 additions & 0 deletions engines/dreamweb/sprite.cpp
Expand Up @@ -869,5 +869,50 @@ void DreamGenContext::reconstruct() {
data.byte(kHavedoneobs) = 0;
}

void DreamGenContext::soundOnReels() {
STACK_CHECK;
bl = data.byte(kReallocation);
_add(bl, bl);
_xor(bh, bh);
_add(bx, 991);
si = cs.word(bx);
reelsoundloop:
al = cs.byte(si);
_cmp(al, 255);
if (flags.z())
goto endreelsound;
ax = cs.word(si+1);
_cmp(ax, data.word(kReelpointer));
if (!flags.z())
goto skipreelsound;
_cmp(ax, data.word(kLastsoundreel));
if (flags.z())
goto skipreelsound;
data.word(kLastsoundreel) = ax;
al = cs.byte(si);
_cmp(al, 64);
if (flags.c())
{ playChannel1(); return; };
_cmp(al, 128);
if (flags.c())
goto channel0once;
_and(al, 63);
ah = 255;
{ playChannel0(); return; };
channel0once:
_and(al, 63);
ah = 0;
{ playChannel0(); return; };
skipreelsound:
_add(si, 3);
goto reelsoundloop;
endreelsound:
ax = data.word(kLastsoundreel);
_cmp(ax, data.word(kReelpointer));
if (flags.z())
return /* (nochange2) */;
data.word(kLastsoundreel) = -1;
}

} /*namespace dreamgen */

1 change: 1 addition & 0 deletions engines/dreamweb/stubs.h
Expand Up @@ -429,4 +429,5 @@
void loadPersonal();
void loadNews();
void loadCart();
void soundOnReels();

0 comments on commit c6b113c

Please sign in to comment.