aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/stubs.cpp
diff options
context:
space:
mode:
authorBertrand Augereau2011-11-22 11:56:54 +0100
committerBertrand Augereau2011-11-22 15:36:46 +0100
commitab41e41b0f5aed647cc7b4fc9727711b260e978f (patch)
tree75d84e02b24593b393e8a98efadc353579fd8945 /engines/dreamweb/stubs.cpp
parent0599145ecf92aeabf5bd4221a91761237f970323 (diff)
downloadscummvm-rg350-ab41e41b0f5aed647cc7b4fc9727711b260e978f.tar.gz
scummvm-rg350-ab41e41b0f5aed647cc7b4fc9727711b260e978f.tar.bz2
scummvm-rg350-ab41e41b0f5aed647cc7b4fc9727711b260e978f.zip
DREAMWEB: 'playchannel0' and 'playchannel1' ported to C++
Diffstat (limited to 'engines/dreamweb/stubs.cpp')
-rw-r--r--engines/dreamweb/stubs.cpp56
1 files changed, 51 insertions, 5 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 5ee27e1878..668e388453 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2203,14 +2203,60 @@ Frame * DreamGenContext::tempGraphics3() {
return (Frame *)segRef(data.word(kTempgraphics3)).ptr(0, 0);
}
-void DreamGenContext::playchannel0(uint8 index) {
- al = index;
- playchannel0();
+void DreamGenContext::playchannel0(uint8 index, uint8 repeat) {
+ if (data.byte(kSoundint) == 255)
+ return;
+ push(es);
+ push(bx);
+ data.byte(kCh0playing) = index;
+ if (index >= 12) {
+ es = data.word(kSounddata2);
+ index -= 12;
+ } else
+ es = data.word(kSounddata);
+
+ data.byte(kCh0repeat) = repeat;
+ bx = index * 6;
+ data.word(kCh0emmpage) = es.byte(bx);
+ data.word(kCh0offset) = es.word(bx+1);
+ data.word(kCh0blockstocopy) = es.word(bx+3);
+ if (repeat) {
+ data.word(kCh0oldemmpage) = data.word(kCh0emmpage);
+ data.word(kCh0oldoffset) = data.word(kCh0offset);
+ data.word(kCh0oldblockstocopy) = data.word(kCh0blockstocopy);
+ }
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::playchannel0() {
+ playchannel0(al, ah);
}
void DreamGenContext::playchannel1(uint8 index) {
- al = index;
- playchannel1();
+ if (data.byte(kSoundint) == 255)
+ return;
+ if (data.byte(kCh1playing) == 7)
+ return;
+ push(es);
+ push(bx);
+ data.byte(kCh1playing) = index;
+ if (index >= 12) {
+ es = data.word(kSounddata2);
+ index -= 12;
+ } else
+ es = data.word(kSounddata);
+
+ bx = index * 6;
+ data.word(kCh1emmpage) = es.byte(bx);
+ data.word(kCh1offset) = es.word(bx+1);
+ data.word(kCh1blockstocopy) = es.word(bx+3);
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::playchannel1() {
+ playchannel1(al);
}
} /*namespace dreamgen */