aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-08-03 18:11:19 +0200
committerBertrand Augereau2011-08-03 18:39:24 +0200
commit8ee7ed10664c9c4c6ed944acf489e973be37b327 (patch)
tree3cd3adcbea7f409fecf0b4b3a3d3ced48732055c
parent135efa50a1f96632dae985b593888eb706006d75 (diff)
downloadscummvm-rg350-8ee7ed10664c9c4c6ed944acf489e973be37b327.tar.gz
scummvm-rg350-8ee7ed10664c9c4c6ed944acf489e973be37b327.tar.bz2
scummvm-rg350-8ee7ed10664c9c4c6ed944acf489e973be37b327.zip
DREAMWEB: Less register usage in 'plotreel'
-rw-r--r--engines/dreamweb/structs.h7
-rw-r--r--engines/dreamweb/stubs.cpp24
2 files changed, 11 insertions, 20 deletions
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index a567384c00..48b3f914d0 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -87,9 +87,10 @@ struct Frame {
};
struct Reel {
- uint16 _frame;
- uint16 frame() const { return READ_LE_UINT16(&_frame); }
- void setFrame(uint16 v) { WRITE_LE_UINT16(&_frame, v); }
+ uint8 frame_lo;
+ uint8 frame_hi;
+ uint16 frame() const { return READ_LE_UINT16(&frame_lo); }
+ void setFrame(uint16 v) { WRITE_LE_UINT16(&frame_lo, v); }
uint8 x;
uint8 y;
uint8 b4;
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 12e3905657..c95091a464 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -835,36 +835,26 @@ void DreamGenContext::dealwithspecial() {
void DreamGenContext::plotreel() {
getreelstart();
+ Reel *reel = (Reel *)es.ptr(si, sizeof(Reel));
while (true) {
- push(es);
- push(si);
- ax = es.word(si+2);
+ al = reel->x;
+ ah = reel->y;
if (al < 220)
break;
if (al == 255)
break;
dealwithspecial();
_inc(data.word(kReelpointer));
- si = pop();
- es = pop();
- _add(si, 40);
+ reel += 8;
}
for (size_t i = 0; i < 8; ++i) {
- push(cx);
- push(es);
- push(si);
- ax = es.word(si);
+ ax = reel->frame();
if (ax != 0xffff)
- showreelframe();
- si = pop();
- es = pop();
- cx = pop();
- _add(si, 5);
+ showreelframe(reel);
+ ++reel;
}
soundonreels();
- bx = pop();
- es = pop();
}
void DreamGenContext::crosshair() {