diff options
author | Bertrand Augereau | 2011-08-10 17:12:26 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-08-10 17:12:26 +0200 |
commit | 78e337203d35000ac0f4b7fe653db230d50beec3 (patch) | |
tree | a88492f9b0e15bdc5b974c07d25b43295c0c8a63 | |
parent | d8cbea02f9aa9d2795ccc683c02ab9a20479b067 (diff) | |
download | scummvm-rg350-78e337203d35000ac0f4b7fe653db230d50beec3.tar.gz scummvm-rg350-78e337203d35000ac0f4b7fe653db230d50beec3.tar.bz2 scummvm-rg350-78e337203d35000ac0f4b7fe653db230d50beec3.zip |
DREAMWEB: Improvement of 'printdirect' signature and register usage
-rw-r--r-- | engines/dreamweb/print.cpp | 16 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 3 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 2 |
3 files changed, 13 insertions, 8 deletions
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp index 36cfc7695d..5859722633 100644 --- a/engines/dreamweb/print.cpp +++ b/engines/dreamweb/print.cpp @@ -161,22 +161,26 @@ uint8 DreamGenContext::printslow(uint16 x, uint16 y, uint8 maxWidth, bool center void DreamGenContext::printdirect() { uint16 y = bx; - printdirect(di, &y, dl, (bool)(dl & 1)); + uint16 initialSi = si; + const uint8 *initialString = es.ptr(si, 0); + const uint8 *string = initialString; + printdirect(&string, di, &y, dl, (bool)(dl & 1)); + si = initialSi + (string - initialString); bx = y; } -void DreamGenContext::printdirect(uint16 x, uint16 *y, uint8 maxWidth, bool centered) { +void DreamGenContext::printdirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered) { data.word(kLastxpos) = x; ds = data.word(kCurrentset); const void *src = ds.ptr(0, 0); while (true) { uint16 offset = x; - uint8 charCount = getnumber(es.ptr(si, 0), maxWidth, centered, &offset); + uint8 charCount = getnumber(*string, maxWidth, centered, &offset); uint16 i = offset; do { - uint8 c = es.byte(si); - uint8 nextChar = es.byte(si+1); - ++si; + uint8 c = (*string)[0]; + uint8 nextChar = (*string)[1]; + ++(*string); if ((c == 0) || (c == ':')) { return; } diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index cd6a9d6b4f..4bc631cef0 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -320,8 +320,9 @@ void DreamGenContext::usetimedtext() { es = data.word(kTimedseg); si = data.word(kTimedoffset); + const uint8 *string = es.ptr(si, 0); uint16 y = data.byte(kTimedy); - printdirect(data.byte(kTimedx), &y, 237, true); + printdirect(&string, data.byte(kTimedx), &y, 237, true); data.byte(kNeedtodumptimed) = 1; } diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 10cb6568d2..b0c0370803 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -48,7 +48,7 @@ void printchar(); void printchar(const void *src, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height); void printdirect(); - void printdirect(uint16 x, uint16 *y, uint8 maxWidth, bool centered); + void printdirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered); void usetimedtext(); void getundertimed(); void putundertimed(); |