Skip to content

Commit

Permalink
HOPKINS: Manually implemented Reduc_Ecran
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Oct 24, 2012
1 parent 39bc683 commit 9d93fca
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 42 deletions.
64 changes: 25 additions & 39 deletions engines/hopkins/graphics.cpp
Expand Up @@ -2470,52 +2470,38 @@ void GraphicsManager::Copy_Video_Vbe(const byte *src) {
}

// 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);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion engines/hopkins/graphics.h
Expand Up @@ -183,7 +183,7 @@ class GraphicsManager {
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);
};
Expand Down
5 changes: 3 additions & 2 deletions engines/hopkins/menu.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 9d93fca

Please sign in to comment.