diff options
author | Jamieson Christian | 2003-07-30 09:36:48 +0000 |
---|---|---|
committer | Jamieson Christian | 2003-07-30 09:36:48 +0000 |
commit | 269757dabce941f87afd871c0eab19bb53ce358c (patch) | |
tree | ae2a0cb95ad780d58ad0319a78b423ed0a805857 /simon | |
parent | 20d06e2c3dc09085c218620e61c384dc0514fabf (diff) | |
download | scummvm-rg350-269757dabce941f87afd871c0eab19bb53ce358c.tar.gz scummvm-rg350-269757dabce941f87afd871c0eab19bb53ce358c.tar.bz2 scummvm-rg350-269757dabce941f87afd871c0eab19bb53ce358c.zip |
vc_10_no_depack_swap implementation
svn-id: r9289
Diffstat (limited to 'simon')
-rw-r--r-- | simon/simon.cpp | 1 | ||||
-rw-r--r-- | simon/simon.h | 2 | ||||
-rw-r--r-- | simon/vga.cpp | 31 |
3 files changed, 26 insertions, 8 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp index a2ad3b6f56..f5a8f0e8af 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -438,6 +438,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) _sdl_buf = 0; _sdl_buf_attached = 0; + _vc_10_base_ptr_old = 0; // Setup midi driver if (!driver) diff --git a/simon/simon.h b/simon/simon.h index 3c73a9d521..234bbe7802 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -350,6 +350,7 @@ protected: RandomSource _rnd; + byte *_vc_10_base_ptr_old; public: SimonEngine(GameDetector *detector, OSystem *syst); @@ -752,6 +753,7 @@ protected: void shutdown(); byte *vc_10_depack_swap(byte *src, uint w, uint h); + byte *vc_10_no_depack_swap(byte *src, uint w, uint h); Item *getNextItemPtrStrange(); diff --git a/simon/vga.cpp b/simon/vga.cpp index 27c417a775..4972fe9c6e 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -511,10 +511,26 @@ byte *SimonEngine::vc_10_depack_swap(byte *src, uint w, uint h) { return _video_buf_1; } -byte *vc_10_no_depack_swap(byte *src) { - // TODO Add vc_10_no_depack_swap support, should be very similar to - // vc_10_depack_swap but without the depacking - return NULL; +byte *SimonEngine::vc_10_no_depack_swap(byte *src, uint w, uint h) { + if (src == _vc_10_base_ptr_old) + return _video_buf_1; + + _vc_10_base_ptr_old = src; + h *= 8; + byte *dst = _video_buf_1 + h - 1; + + // loc_40F57F + uint h_cur = h; + do { + do { + *dst = *src << 4; + (*dst--) |= (*src++) >> 4; + } while (--h_cur != 0); + h_cur = h; + dst += h * 2; + } while (--w != 0); + + return _video_buf_1; } /* must not be const */ @@ -656,10 +672,9 @@ void SimonEngine::vc_10_draw() { if (state.e & 0x10) { state.depack_src = vc_10_depack_swap(state.depack_src, width, height); } else if (state.e & 1) { - // FIXME: vc_10_no_depack_swap should be called but is currently not supported - //state.depack_src = vc_10_no_depack_swap(state.depack_src); - debug(5,"vc_10_no_depack_swap unimpl"); - state.depack_src = vc_10_depack_swap(state.depack_src, width, height); + state.depack_src = vc_10_no_depack_swap(state.depack_src, width, height); +// debug(5,"vc_10_no_depack_swap unimpl"); +// state.depack_src = vc_10_depack_swap(state.depack_src, width, height); } vlut = &_video_windows[_video_palette_mode * 4]; |