From 9d93fca8d32c5b96e251380babb9af5bf5301d99 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 24 Oct 2012 21:54:54 +1100 Subject: HOPKINS: Manually implemented Reduc_Ecran --- engines/hopkins/graphics.cpp | 64 +++++++++++++++++--------------------------- engines/hopkins/graphics.h | 2 +- engines/hopkins/menu.cpp | 5 ++-- 3 files changed, 29 insertions(+), 42 deletions(-) (limited to 'engines/hopkins') diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 4495698321..64af872727 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -2470,52 +2470,38 @@ Video_Cont_Vbe: } // Reduce Screen -// TODO: Check that v9 doesn't get set anywhere (apart from the current init to zero) -void GraphicsManager::Reduc_Ecran(byte *a1, byte *a2, int a3, int a4, int a5, int a6, int a7) { - byte *v7; - byte *v8; - int v9 = 0; - int v10 = 0; - int v11; - int v12; - byte *v13; - int v14; +void GraphicsManager::Reduc_Ecran(const byte *srcSurface, byte *destSurface, int xp, int yp, int width, int height, int zoom) { + const byte *srcP; + byte *destP; + const byte *lineSrcP; - v7 = a3 + nbrligne2 * a4 + a1; - v8 = a2; - Red = a7; - Largeur = a5; + srcP = xp + nbrligne2 * yp + srcSurface; + destP = destSurface; + Red = zoom; + Largeur = width; Red_x = 0; Red_y = 0; - if (a7 < 100) { - Reduc_Ecran_L = Asm_Reduc(a5, Red); - Reduc_Ecran_H = Asm_Reduc(v9, Red); - v11 = Red; - do { - v14 = v10; - v13 = v7; - Red_y += v11; - if ((uint16)Red_y < 0x64u) { + if (zoom < 100) { + Reduc_Ecran_L = Asm_Reduc(width, Red); + Reduc_Ecran_H = Asm_Reduc(height, Red); + + for (int yCtr = 0; yCtr < Reduc_Ecran_H; ++yCtr, Red_y -= 100, srcP += nbrligne2) { + Red_y += Red; + if (Red_y < 100) { Red_x = 0; - v12 = Largeur; - do { - Red_x += v11; - if ((uint16)Red_x < 0x64u) { - *v8++ = *v7++; + lineSrcP = srcP; + + for (int xCtr = 0; xCtr < Largeur; ++xCtr) { + Red_x += Red; + if (Red_x < 100) { + *destP++ = *lineSrcP++; } else { - Red_x = Red_x - 100; - ++v7; + Red_x -= 100; + ++lineSrcP; } - --v12; - } while (v12); - v10 = v14; - v7 = nbrligne2 + v13; - } else { - Red_y = Red_y - 100; - v7 += nbrligne2; + } } - --v10; - } while (v10); + } } } diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index ff589b9061..18f600a184 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -183,7 +183,7 @@ public: void videkey(); void Copy_WinScan_Vbe(const byte *srcP, byte *destP); void Copy_Video_Vbe(const byte *src); - void Reduc_Ecran(byte *a1, byte *a2, int a3, int a4, int a5, int a6, int a7); + void Reduc_Ecran(const byte *srcSruface, byte *destSurface, int xp, int yp, int width, int height, int zoom); void Plot_Hline(byte *surface, int xp, int yp, unsigned int width, byte col); void Plot_Vline(byte *surface, int xp, int yp, int height, char col); }; diff --git a/engines/hopkins/menu.cpp b/engines/hopkins/menu.cpp index 8b3010fc02..a6460f0b5a 100644 --- a/engines/hopkins/menu.cpp +++ b/engines/hopkins/menu.cpp @@ -321,7 +321,8 @@ void MenuManager::SAUVE_PARTIE() { _vm->_eventsManager.VBL(); v1 = _vm->_globals.dos_malloc2(0x2DB4u); - _vm->_graphicsManager.Reduc_Ecran(_vm->_graphicsManager.VESA_BUFFER, v1, _vm->_eventsManager.start_x, 20, SCREEN_WIDTH * 2, 440, 0x50u); + _vm->_graphicsManager.Reduc_Ecran(_vm->_graphicsManager.VESA_BUFFER, v1, _vm->_eventsManager.start_x, 20, + SCREEN_WIDTH, SCREEN_HEIGHT - 40, 80); _vm->_graphicsManager.INIT_TABLE(45, 80, _vm->_graphicsManager.Palette); _vm->_graphicsManager.Trans_bloc2(v1, _vm->_graphicsManager.TABLE_COUL, 11136); LOAD_SAUVE(1); @@ -529,7 +530,7 @@ void MenuManager::COMPUT_HOPKINS(int idx) { LIT_TEXTE(8); if (v12 == 53) LIT_TEXTE(9); - if (v12 == 54) { + if (v12ii == 54) { LIT_TEXTE(10); _vm->_globals.SAUVEGARDE->data[svField270] = 4; } -- cgit v1.2.3