HOPKINS: Implemented lots more of the remaining stubbed methods

This commit is contained in:
Paul Gilbert 2012-10-05 00:55:25 +10:00
parent 549e046f27
commit 52166834d5
11 changed files with 1266 additions and 140 deletions

View File

@ -100,15 +100,15 @@ void AnimationManager::PLAY_ANM(const Common::String &filename, uint32 rate1, ui
if (_vm->_graphicsManager.Winbpp == 2) {
if (doneFlag)
_vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, 640, 480, 0, 0);
_vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(screenP, 0, 0, 640, 480, 0, 0);
_vm->_graphicsManager.m_scroll16(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (doneFlag)
_vm->_graphicsManager.m_scroll2A(screenCopy, 0, 0, 640, 480, 0, 0);
_vm->_graphicsManager.m_scroll2A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll2(screenP, 0, 0, 640, 480, 0, 0);
_vm->_graphicsManager.m_scroll2(screenP, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.DD_VBL();
@ -169,7 +169,7 @@ void AnimationManager::PLAY_ANM(const Common::String &filename, uint32 rate1, ui
#endif
_vm->_eventsManager.CONTROLE_MES();
_vm->_soundManager.VERIF_SOUND();
_vm->_soundManager._vm->_soundManager.VERIF_SOUND();
} while (_vm->_eventsManager.lItCounter < rate2 && !_vm->shouldQuit());
}
@ -194,7 +194,7 @@ void AnimationManager::PLAY_ANM(const Common::String &filename, uint32 rate1, ui
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.DD_VBL();
_vm->_soundManager.VERIF_SOUND();
_vm->_soundManager._vm->_soundManager.VERIF_SOUND();
}
} while (!doneFlag && !_vm->shouldQuit());
@ -224,11 +224,11 @@ REDRAW_ANIM:
#endif
_vm->_eventsManager.CONTROLE_MES();
_vm->_soundManager.VERIF_SOUND();
_vm->_soundManager._vm->_soundManager.VERIF_SOUND();
} while (_vm->_eventsManager.lItCounter < rate3 && !_vm->shouldQuit());
_vm->_eventsManager.lItCounter = 0;
_vm->_soundManager.VERIF_SOUND();
_vm->_soundManager._vm->_soundManager.VERIF_SOUND();
break;
}
@ -285,8 +285,432 @@ FINISH:
_vm->_graphicsManager.NOLOCK = false;
}
void AnimationManager::PLAY_ANM2(const Common::String &filename, int a2, int a3, int a4) {
warning("TODO: PLAY_ANM2");
void AnimationManager::PLAY_ANM2(const Common::String &filename, uint32 a2, uint32 a3, uint32 a4) {
byte *v4;
int v5;
int v6;
int v8;
byte *ptr;
byte *ptra;
int v11;
byte *v12;
byte *v13;
int v15;
int v16;
int v17;
int v18;
int v19;
int v20;
char v21;
size_t nbytes;
byte buf[6];
char v25;
Common::File f;
v8 = 0;
while (1) {
v17 = 0;
v16 = 0;
v19 = 0;
v18 = 0;
v20 = 1;
memcpy(_vm->_graphicsManager.OLD_PAL, _vm->_graphicsManager.Palette, 0x301u);
FileManager::CONSTRUIT_LINUX("TEMP.SCR");
if (_vm->_graphicsManager.nbrligne == SCREEN_WIDTH)
FileManager::SAUVE_FICHIER(_vm->_globals.NFICHIER, _vm->_graphicsManager.VESA_SCREEN, 0x4B000u);
if (_vm->_graphicsManager.nbrligne == 1280)
FileManager::SAUVE_FICHIER(_vm->_globals.NFICHIER, _vm->_graphicsManager.VESA_SCREEN, 0x96000u);
if (!_vm->_graphicsManager.nbrligne)
_vm->_graphicsManager.ofscroll = 0;
v12 = _vm->_graphicsManager.VESA_SCREEN;
v13 = _vm->_globals.dos_malloc2(0x14u);
FileManager::CONSTRUIT_FICHIER(_vm->_globals.HOPANM, filename);
if (!f.open(_vm->_globals.NFICHIER))
error("Error opening file - %s");
f.read(&buf, 6);
f.read(_vm->_graphicsManager.Palette, 0x320u);
f.read(&buf, 4);
nbytes = f.readUint32LE();
v21 = f.readUint32LE();
v20 = f.readUint16LE();
v19 = f.readUint16LE();
v18 = f.readUint16LE();
v17 = f.readUint16LE();
v16 = f.readUint16LE();
f.read(v12, nbytes);
_vm->_graphicsManager.Cls_Pal();
v11 = _vm->_graphicsManager.SCROLL;
_vm->_graphicsManager.SCANLINE(SCREEN_WIDTH * 2);
_vm->_graphicsManager.SCROLL_ECRAN(0);
_vm->_graphicsManager.DD_Lock();
_vm->_graphicsManager.Cls_Video();
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.max_x = SCREEN_WIDTH;
if (_vm->_graphicsManager.WinScan / _vm->_graphicsManager.Winbpp > SCREEN_WIDTH) {
v8 = 1;
ptr = _vm->_globals.dos_malloc2(0x4B000u);
memcpy(ptr, v12, 0x4B000u);
}
if (_vm->_animationManager.NO_SEQ) {
if (v8 == 1)
memcpy(ptr, _vm->_graphicsManager.VESA_BUFFER, 0x4B000u);
_vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager.Palette);
} else {
_vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager.Palette);
_vm->_graphicsManager.DD_Lock();
if (_vm->_graphicsManager.Winbpp == 2) {
if (v8)
_vm->_graphicsManager.m_scroll16A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(v12, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (v8)
_vm->_graphicsManager.m_scroll2A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll2(v12, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.DD_VBL();
}
_vm->_eventsManager.lItCounter = 0;
_vm->_eventsManager.ESC_KEY = 0;
_vm->_soundManager.LOAD_ANM_SOUND();
if (_vm->_globals.iRegul != 1)
break;
while (1) {
if (_vm->_eventsManager.ESC_KEY == 1)
goto LABEL_114;
if (REDRAW_ANIM() == 1)
break;
_vm->_eventsManager.CONTROLE_MES();
if (_vm->_eventsManager.lItCounter >= a2)
goto LABEL_48;
}
if (_vm->_graphicsManager.NOLOCK == 1)
goto LABEL_114;
if (v8 == 1)
ptr = _vm->_globals.dos_free2(ptr);
_vm->_globals.dos_free2(v13);
f.close();
FileManager::CONSTRUIT_LINUX("TEMP.SCR");
FileManager::bload(_vm->_globals.NFICHIER, _vm->_graphicsManager.VESA_SCREEN);
memcpy(_vm->_graphicsManager.Palette, _vm->_graphicsManager.OLD_PAL, 0x301u);
v4 = &_vm->_graphicsManager.Palette[769];
_vm->_graphicsManager.Cls_Pal();
_vm->_graphicsManager.DD_Lock();
_vm->_graphicsManager.Cls_Video();
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.SCROLL = v11;
_vm->_graphicsManager.SCROLL_ECRAN(v11);
if (_vm->_graphicsManager.DOUBLE_ECRAN == 1) {
_vm->_graphicsManager.SCANLINE(0x500u);
_vm->_graphicsManager.max_x = 1280;
_vm->_graphicsManager.DD_Lock();
if (_vm->_graphicsManager.Winbpp == 2) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
} else {
_vm->_eventsManager.souris_max();
_vm->_graphicsManager.SCANLINE(SCREEN_WIDTH * 2);
_vm->_graphicsManager.max_x = SCREEN_WIDTH;
_vm->_graphicsManager.DD_Lock();
_vm->_graphicsManager.Cls_Video();
if (_vm->_graphicsManager.Winbpp == 2) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (_vm->_graphicsManager.SDL_ECHELLE)
LABEL_111:
_vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
}
LABEL_112:
_vm->_graphicsManager.DD_Unlock();
_vm->_eventsManager.VBL();
_vm->_graphicsManager.FADE_INS();
}
LABEL_48:
_vm->_eventsManager.lItCounter = 0;
v5 = 0;
v15 = 0;
while (1) {
++v15;
_vm->_soundManager.PLAY_ANM_SOUND(v15);
memset(&buf, 0, 6u);
memset(v13, 0, 0x13u);
if (f.read(v13, 0x10) != 0x10)
v5 = -1;
v25 = 0;
if (strncmp((const char *)v13, "IMAGE=", 6))
v5 = -1;
if (v5)
goto LABEL_88;
f.read(v12, READ_LE_UINT32(v13 + 2));
if (_vm->_globals.iRegul == 1)
break;
LABEL_77:
_vm->_eventsManager.lItCounter = 0;
_vm->_graphicsManager.DD_Lock();
if (v8) {
if (*v12 != -4) {
_vm->_graphicsManager.Copy_WinScan_Vbe3(v12, ptr);
if (_vm->_graphicsManager.Winbpp == 2)
_vm->_graphicsManager.m_scroll16A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll2A(ptr, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
} else if (*v12 != -4) {
if (_vm->_graphicsManager.Winbpp == 1)
_vm->_graphicsManager.Copy_Video_Vbe3(v12);
if (_vm->_graphicsManager.Winbpp == 2)
_vm->_graphicsManager.Copy_Video_Vbe16(v12);
}
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.DD_VBL();
_vm->_soundManager.VERIF_SOUND();
LABEL_88:
if (v5 == -1) {
if (_vm->_globals.iRegul == 1) {
while (_vm->_eventsManager.ESC_KEY != 1) {
if (REDRAW_ANIM() == 1) {
if (_vm->_graphicsManager.NOLOCK == 1)
goto LABEL_114;
if (v8 == 1)
ptr = _vm->_globals.dos_free2(ptr);
_vm->_globals.dos_free2(v13);
f.close();
FileManager::CONSTRUIT_LINUX("TEMP.SCR");
FileManager::bload(_vm->_globals.NFICHIER, _vm->_graphicsManager.VESA_SCREEN);
memcpy(_vm->_graphicsManager.Palette, _vm->_graphicsManager.OLD_PAL, 0x301u);
v4 = &_vm->_graphicsManager.Palette[769];
_vm->_graphicsManager.Cls_Pal();
_vm->_graphicsManager.DD_Lock();
_vm->_graphicsManager.Cls_Video();
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.SCROLL = v11;
_vm->_graphicsManager.SCROLL_ECRAN(v11);
if (_vm->_graphicsManager.DOUBLE_ECRAN == 1) {
_vm->_graphicsManager.SCANLINE(0x500u);
_vm->_graphicsManager.max_x = 1280;
_vm->_graphicsManager.DD_Lock();
if (_vm->_graphicsManager.Winbpp == 2) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
} else {
_vm->_eventsManager.souris_max();
_vm->_graphicsManager.SCANLINE(SCREEN_WIDTH * 2);
_vm->_graphicsManager.max_x = SCREEN_WIDTH;
_vm->_graphicsManager.DD_Lock();
_vm->_graphicsManager.Cls_Video();
if (_vm->_graphicsManager.Winbpp == 2) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (_vm->_graphicsManager.SDL_ECHELLE)
goto LABEL_111;
_vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
}
goto LABEL_112;
}
_vm->_eventsManager.CONTROLE_MES();
_vm->_soundManager.VERIF_SOUND();
if (_vm->_eventsManager.lItCounter >= a4)
goto LABEL_114;
}
}
goto LABEL_114;
}
}
while (_vm->_eventsManager.ESC_KEY != 1) {
if (REDRAW_ANIM() == 1) {
if (_vm->_graphicsManager.NOLOCK == 1)
break;
if (v8 == 1)
ptr = _vm->_globals.dos_free2(ptr);
_vm->_globals.dos_free2(v13);
f.close();
FileManager::CONSTRUIT_LINUX("TEMP.SCR");
FileManager::bload(_vm->_globals.NFICHIER, _vm->_graphicsManager.VESA_SCREEN);
memcpy(_vm->_graphicsManager.Palette, _vm->_graphicsManager.OLD_PAL, 0x301u);
v4 = &_vm->_graphicsManager.Palette[769];
_vm->_graphicsManager.Cls_Pal();
_vm->_graphicsManager.DD_Lock();
_vm->_graphicsManager.Cls_Video();
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.SCROLL = v11;
_vm->_graphicsManager.SCROLL_ECRAN(v11);
if (_vm->_graphicsManager.DOUBLE_ECRAN == 1) {
_vm->_graphicsManager.SCANLINE(0x500u);
_vm->_graphicsManager.max_x = 1280;
_vm->_graphicsManager.DD_Lock();
if (_vm->_graphicsManager.Winbpp == 2) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
} else {
_vm->_eventsManager.souris_max();
_vm->_graphicsManager.SCANLINE(SCREEN_WIDTH * 2);
_vm->_graphicsManager.max_x = SCREEN_WIDTH;
_vm->_graphicsManager.DD_Lock();
_vm->_graphicsManager.Cls_Video();
if (_vm->_graphicsManager.Winbpp == 2) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (_vm->_graphicsManager.SDL_ECHELLE)
goto LABEL_111;
_vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
}
goto LABEL_112;
}
_vm->_eventsManager.CONTROLE_MES();
_vm->_soundManager.VERIF_SOUND();
if (_vm->_eventsManager.lItCounter >= a3)
goto LABEL_77;
}
LABEL_114:
_vm->_graphicsManager.NOLOCK = 0;
f.close();
if (_vm->_graphicsManager.FADE_LINUX == 2 && !v8) {
ptra = _vm->_globals.dos_malloc2(0x4B000u);
f.seek(0);
f.read(&buf, 6);
f.read(_vm->_graphicsManager.Palette, 0x320u);
f.read(&buf, 4u);
nbytes = f.readUint32LE();
v21 = f.readUint32LE();
v20 = f.readUint16LE();
v19 = f.readUint16LE();
v18 = f.readUint16LE();
v17 = f.readUint16LE();
v16 = f.readUint16LE();
f.read(v12, nbytes);
memcpy(ptra, v12, 0x4B000u);
v6 = 0;
do {
memset(&buf, 0, 6u);
memset(v13, 0, 0x13u);
if (f.read(v13, 16) != 16)
v6 = -1;
if (strncmp((const char *)v13, "IMAGE=", 7))
v6 = -1;
if (!v6) {
f.read(v12, READ_LE_UINT32(v13 + 8));
if (*v12 != -4)
_vm->_graphicsManager.Copy_WinScan_Vbe3(v12, ptra);
}
} while (v6 != -1);
_vm->_graphicsManager.FADE_OUTW_LINUX(ptra);
ptr = _vm->_globals.dos_free2(ptra);
}
if (v8 == 1) {
if (_vm->_graphicsManager.FADE_LINUX == 2)
_vm->_graphicsManager.FADE_OUTW_LINUX(ptr);
_vm->_globals.dos_free2(ptr);
}
_vm->_graphicsManager.FADE_LINUX = 0;
_vm->_globals.dos_free2(v13);
FileManager::CONSTRUIT_LINUX("TEMP.SCR");
FileManager::bload(_vm->_globals.NFICHIER, _vm->_graphicsManager.VESA_SCREEN);
memcpy(_vm->_graphicsManager.Palette, _vm->_graphicsManager.OLD_PAL, 0x301u);
_vm->_graphicsManager.Cls_Pal();
_vm->_graphicsManager.DD_Lock();
_vm->_graphicsManager.Cls_Video();
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.SCROLL = v11;
_vm->_graphicsManager.SCROLL_ECRAN(v11);
if (_vm->_graphicsManager.DOUBLE_ECRAN == 1) {
_vm->_graphicsManager.SCANLINE(0x500u);
_vm->_graphicsManager.max_x = 1280;
_vm->_graphicsManager.DD_Lock();
if (_vm->_graphicsManager.Winbpp == 2) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
} else {
_vm->_eventsManager.souris_max();
_vm->_graphicsManager.SCANLINE(SCREEN_WIDTH * 2);
_vm->_graphicsManager.max_x = SCREEN_WIDTH;
_vm->_graphicsManager.DD_Lock();
_vm->_graphicsManager.Cls_Video();
if (_vm->_graphicsManager.Winbpp == 2) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
if (_vm->_graphicsManager.Winbpp == 1) {
if (_vm->_graphicsManager.SDL_ECHELLE)
_vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
else
_vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
}
}
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.FADE_INS();
_vm->_graphicsManager.DD_VBL();
}
bool AnimationManager::REDRAW_ANIM() {

View File

@ -44,7 +44,7 @@ public:
void setParent(HopkinsEngine *vm) { _vm = vm; }
void PLAY_ANM(const Common::String &filename, uint32 rate, uint32 rate2, uint32 rate3);
void PLAY_ANM2(const Common::String &filename, int a2, int a3, int a4);
void PLAY_ANM2(const Common::String &filename, uint32 a2, uint32 a3, uint32 a4);
bool REDRAW_ANIM();
void CHARGE_ANIM(const Common::String &animName);
void CLEAR_ANIM();

View File

@ -247,6 +247,9 @@ enum SauvegardeOffset {
, svField231
, svField261
, svField270
, svField300
, svField318
, svField320
, svField333
, svField338
, svField339
@ -423,8 +426,10 @@ public:
int Compteur;
int ACTION_SENS;
int SegmentEnCours;
int STOP_BUG;
bool NO_OFFSET;
int MAX_COMPTE;
int force_to_data_0;
int oldzone_46;

View File

@ -2407,4 +2407,8 @@ void GraphicsManager::SHOW_PALETTE() {
setpal_vga256(Palette);
}
void GraphicsManager::videkey() {
// Empty in original
}
} // End of namespace Hopkins

View File

@ -178,6 +178,7 @@ public:
void OPTI_INI(const Common::String &file, int a2);
void NB_SCREEN();
void SHOW_PALETTE();
void videkey();
};
} // End of namespace Hopkins

View File

@ -148,7 +148,7 @@ LABEL_13:
_globals.Max_Ligne_Long = 40;
_globals.Max_Propre_Gen = 20;
_globals.Max_Perso_Y = 435;
PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 1);
_objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 1);
}
if (GLOBALS.SORTIE != 3)
@ -191,7 +191,7 @@ LABEL_13:
_globals.Max_Propre_Gen = 5;
_globals.Max_Perso_Y = 450;
GLOBALS.NOSPRECRAN = 1;
PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2);
_objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2);
}
if (GLOBALS.SORTIE != 4)
@ -211,9 +211,9 @@ LABEL_13:
byte v1 = *((byte *)GLOBALS.SAUVEGARDE + 80);
if (v1) {
if (v1 == 1)
PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3);
_objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3);
} else {
PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3);
_objectsManager.PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3);
}
GLOBALS.NOSPRECRAN = 0;
@ -226,7 +226,7 @@ LABEL_13:
_globals.Max_Ligne_Long = 15;
_globals.Max_Propre_Gen = 10;
_globals.Max_Perso_Y = 450;
PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2);
_objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2);
}
if (GLOBALS.SORTIE != 6)
@ -235,15 +235,15 @@ LABEL_13:
_globals.Max_Ligne_Long = 20;
_globals.Max_Propre_Gen = 10;
_globals.Max_Perso_Y = 460;
PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2);
_objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2);
}
if (GLOBALS.SORTIE != 7)
break;
if (*((byte *)GLOBALS.SAUVEGARDE + 220))
PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2);
_objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2);
else
PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2);
_objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2);
}
if (GLOBALS.SORTIE == 9) {
@ -254,11 +254,11 @@ LABEL_13:
if (!*((byte *)GLOBALS.SAUVEGARDE + 225))
goto LABEL_109;
PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10);
_objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10);
} else {
if (GLOBALS.SORTIE == 10) {
GLOBALS.NOSPRECRAN = 1;
PERSONAGE("IM10", "IM10", "ANIM10", "IM10", 9);
_objectsManager.PERSONAGE("IM10", "IM10", "ANIM10", "IM10", 9);
goto LABEL_124;
}
@ -268,7 +268,7 @@ LABEL_13:
_globals.Max_Ligne_Long = 20;
_globals.Max_Propre_Gen = 10;
_globals.Max_Perso_Y = 450;
PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2);
_objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2);
goto LABEL_124;
}
@ -280,7 +280,7 @@ LABEL_13:
_globals.Max_Perso_Y = 450;
if (*((byte *)GLOBALS.SAUVEGARDE + 225)) {
GLOBALS.NOSPRECRAN = 1;
PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1);
_objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1);
} else {
LABEL_109:
BOOM();
@ -291,19 +291,19 @@ LABEL_109:
_globals.Max_Ligne_Long = 40;
_globals.Max_Propre_Gen = 20;
_globals.Max_Perso_Y = 440;
PERSONAGE2("IM13", "IM13", "ANIM13", "IM13", 1);
_objectsManager.PERSONAGE2("IM13", "IM13", "ANIM13", "IM13", 1);
break;
case 14:
_globals.Max_Propre = 50;
_globals.Max_Ligne_Long = 40;
_globals.Max_Propre_Gen = 20;
_globals.Max_Perso_Y = 440;
PERSONAGE2("IM14", "IM14", "ANIM14", "IM14", 1);
_objectsManager.PERSONAGE2("IM14", "IM14", "ANIM14", "IM14", 1);
break;
default:
if (GLOBALS.SORTIE == 15) {
GLOBALS.NOSPRECRAN = 1;
PERSONAGE("IM15", "IM15", "ANIM15", "IM15", 29);
_objectsManager.PERSONAGE("IM15", "IM15", "ANIM15", "IM15", 29);
goto LABEL_124;
}
if (GLOBALS.SORTIE == 16) {
@ -314,9 +314,9 @@ LABEL_109:
byte v2 = *((byte *)GLOBALS.SAUVEGARDE + 113);
if (v2 == 1) {
PERSONAGE2("IM16", "IM16A", "ANIM16", "IM16", 7);
_objectsManager.PERSONAGE2("IM16", "IM16A", "ANIM16", "IM16", 7);
} else if (!v2) {
PERSONAGE2("IM16", "IM16", "ANIM16", "IM16", 7);
_objectsManager.PERSONAGE2("IM16", "IM16", "ANIM16", "IM16", 7);
}
} else {
if (GLOBALS.SORTIE == 17)
@ -328,11 +328,11 @@ LABEL_109:
_globals.Max_Ligne_Long = 20;
_globals.Max_Propre_Gen = 10;
_globals.Max_Perso_Y = 445;
PERSONAGE2("IM25", "IM25", "ANIM25", "IM25", 30);
_objectsManager.PERSONAGE2("IM25", "IM25", "ANIM25", "IM25", 30);
} else {
if (GLOBALS.SORTIE == 33) {
GLOBALS.NOSPRECRAN = 1;
PERSONAGE("IM33", "IM33", "ANIM33", "IM33", 8);
_objectsManager.PERSONAGE("IM33", "IM33", "ANIM33", "IM33", 8);
goto LABEL_124;
}
@ -341,7 +341,7 @@ LABEL_109:
_globals.Max_Ligne_Long = 40;
_globals.Max_Propre_Gen = 20;
_globals.Max_Perso_Y = 435;
PERSONAGE2("IM26", "IM26", "ANIM26", "IM26", 30);
_objectsManager.PERSONAGE2("IM26", "IM26", "ANIM26", "IM26", 30);
} else {
if (GLOBALS.SORTIE == 27)
PASS();
@ -364,13 +364,13 @@ LABEL_109:
PASS();
if (GLOBALS.SORTIE == 111) {
GLOBALS.NOSPRECRAN = 1;
PERSONAGE("IM111", "IM111", "ANIM111", "IM111", 10);
_objectsManager.PERSONAGE("IM111", "IM111", "ANIM111", "IM111", 10);
goto LABEL_124;
}
if (GLOBALS.SORTIE == 112) {
GLOBALS.NOSPRECRAN = 1;
PERSONAGE("IM112", "IM112", "ANIM112", "IM112", 10);
_objectsManager.PERSONAGE("IM112", "IM112", "ANIM112", "IM112", 10);
LABEL_124:
GLOBALS.NOSPRECRAN = 0;
} else if (GLOBALS.SORTIE == 113) {
@ -379,7 +379,7 @@ LABEL_124:
*((byte *)GLOBALS.SAUVEGARDE + 6) = _globals.ECRAN;
_globals.ECRAN = 113;
*((byte *)GLOBALS.SAUVEGARDE + 5) = 113;
COMPUT_HOPKINS(1);
_menuManager.COMPUT_HOPKINS(1);
_graphicsManager.DD_Lock();
_graphicsManager.Cls_Video();
@ -396,7 +396,7 @@ LABEL_124:
*((byte *)GLOBALS.SAUVEGARDE + 6) = _globals.ECRAN;
_globals.ECRAN = 114;
*((byte *)GLOBALS.SAUVEGARDE + 5) = 114;
COMPUT_HOPKINS(2);
_menuManager.COMPUT_HOPKINS(2);
goto LABEL_128;
}
if (GLOBALS.SORTIE == 115) {
@ -405,7 +405,7 @@ LABEL_124:
*((byte *)GLOBALS.SAUVEGARDE + 6) = _globals.ECRAN;
_globals.ECRAN = 115;
*((byte *)GLOBALS.SAUVEGARDE + 5) = 115;
COMPUT_HOPKINS(3);
_menuManager.COMPUT_HOPKINS(3);
LABEL_128:
_graphicsManager.DD_Lock();
@ -910,16 +910,6 @@ void HopkinsEngine::BOOM() {
_globals.SORTIE = 151;
}
void HopkinsEngine::PERSONAGE(const Common::String &s1, const Common::String &s2, const Common::String &s3,
const Common::String &s4, int v) {
warning("TODO: PERSONAGE2");
}
void HopkinsEngine::PERSONAGE2(const Common::String &s1, const Common::String &s2, const Common::String &s3,
const Common::String &s4, int v) {
warning("TODO: PERSONAGE2");
}
void HopkinsEngine::REST_SYSTEM() {
quitGame();
_eventsManager.CONTROLE_MES();
@ -958,8 +948,4 @@ void HopkinsEngine::PUBQUIT() {
_graphicsManager.FADE_OUTW();
}
void HopkinsEngine::COMPUT_HOPKINS(int a1) {
warning("TODO: COMPUT_HOPKINS");
}
} // End of namespace Hopkins

View File

@ -83,12 +83,7 @@ private:
void PASS();
void REST_SYSTEM();
void PERSONAGE(const Common::String &s1, const Common::String &s2, const Common::String &s3,
const Common::String &s4, int v);
void PERSONAGE2(const Common::String &s1, const Common::String &s2, const Common::String &s3,
const Common::String &s4, int v);
void PUBQUIT();
void COMPUT_HOPKINS(int a1);
void ENDEMO();
void BOOM();
protected:

View File

@ -240,4 +240,201 @@ void MenuManager::SAUVE_PARTIE() {
warning("SAUVE_PARTIE");
}
void MenuManager::COMPUT_HOPKINS(int idx) {
// This is a text mode display?
warning("TODO: COMPUT_HOPKINS");
/*
int v2;
char *v3;
int v4;
char v5;
char *v6;
int v7;
char v8;
char *v9;
int v10;
char v11;
int v12;
Common::String s;
Common::String s2;
_vm->_eventsManager.ESC_KEY = 0;
v2 = 0;
_vm->_graphicsManager.RESET_SEGMENT_VESA();
setvideomode();
settextcolor(4);
_vm->_graphicsManager.videkey();
settextposition(2, 4);
if (idx == 1)
outtext((const char *)&MenuText[10]);
if (idx == 2)
outtext((const char *)&MenuText[0xDE]);
if (idx == 3)
outtext((const char *)&MenuText[0x1B2]);
settextcolor(1);
if (idx == 3) {
settextposition(10, 8);
outtext((const char *)&MenuText[0x286]);
}
settextposition(12, 28);
outtext((const char *)&MenuText[0x35A]);
settextposition(14, 35);
v3 = &s;
memset(&s, 0, 8u);
TXT4(280, 224, 8);
s = Sup_string;
if (idx == 1) {
s2 = "HOPKINS";
v4 = 8;
v5 = 1;
do {
if (!v4)
break;
v5 = *v3++ == *s2++;
--v4;
} while (v5);
if (v5)
v2 = 1;
}
if (idx == 2) {
v6 = &s;
s2 = "328MHZA";
v7 = 8;
v8 = 1;
do {
if (!v7)
break;
v8 = *v6++ == *s2++;
--v7;
} while (v8);
if (v8)
v2 = 1;
}
if (idx == 3) {
v9 = &s;
s2 = "ALLFREE";
v10 = 8;
v11 = 1;
do {
if (!v10)
break;
v11 = *v9++ == *s2++;
--v10;
} while (v11);
if (v11)
v2 = 1;
}
if (v2) {
while (1) {
ESC_KEY = 0;
_vm->_graphicsManager.videkey();
clearscreen();
settextcolor(4);
settextposition(2, 4);
if (idx == 1)
outtext((const char *)&MenuText[10]);
if (idx == 2)
outtext((const char *)&MenuText[0xDE]);
if (idx == 3)
outtext((const char *)&MenuText[0x1B2]);
settextcolor(15);
settextposition(8, 25);
settextcolor(15);
outtext2((const char *)&MenuText[0x502]);
settextposition(20, 25);
outtext2((const char *)&MenuText[0x5D6]);
if (idx == 1) {
settextposition(10, 25);
outtext2((const char *)&MenuText[0x6AA]);
settextposition(12, 25);
outtext2((const char *)&MenuText[0x77E]);
settextposition(14, 25);
outtext2((const char *)&MenuText[0x852]);
settextposition(16, 25);
outtext2((const char *)&MenuText[0x926]);
}
if (idx == 2) {
_vm->_graphicsManager.videkey();
settextposition(10, 25);
outtext2((const char *)&MenuText[0x95A]);
settextposition(12, 25);
outtext2((const char *)&MenuText[0xACE]);
settextposition(14, 25);
outtext2((const char *)&MenuText[0xBA2]);
settextposition(16, 25);
outtext2((const char *)&MenuText[0xC76]);
settextposition(18, 25);
outtext2((const char *)&MenuText[0xD4A]);
}
do {
v12 = (unsigned __int8)keywin(v2, s2);
v2 = 0;
if ((uint16)(v12 - 48) <= 8u)
v2 = 1;
} while (v2 != 1);
if (v12 == 48)
break;
if (v12 == 49) {
GAMES(s2);
} else if (idx == 1) {
_vm->_graphicsManager.videkey();
clearscreen();
settextcolor(4);
settextposition(2, 4);
outtext((const char *)&MenuText[10]);
settextcolor(15);
if (v12 == 50)
LIT_TEXTE(1);
if (v12 == 51)
LIT_TEXTE(2);
if (v12 == 52)
LIT_TEXTE(3);
if (v12 == 53)
LIT_TEXTE(4);
} else if (idx == 2) {
clearscreen();
settextcolor(4);
settextposition(2, 4);
outtext((const char *)&MenuText[0xDE]);
settextcolor(15);
if (v12 == 50)
LIT_TEXTE(6);
if (v12 == 51)
LIT_TEXTE(7);
if (v12 == 52)
LIT_TEXTE(8);
if (v12 == 53)
LIT_TEXTE(9);
if (v12 == 54) {
LIT_TEXTE(10);
_vm->_globals.SAUVEGARDE->data[svField270] = 4;
}
}
}
_vm->_graphicsManager.DD_Lock();
Cls_Video();
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.DD_VBL();
RESTORE_POLICE();
} else {
settextcolor(4);
settextposition(16, 25);
outtext((const char *)&MenuText[0x42E]);
_vm->_eventsManager.VBL();
memset(_vm->_graphicsManager.VESA_BUFFER, 0, 0x4AFFFu);
_vm->_graphicsManager.DD_Lock();
Cls_Video();
_vm->_graphicsManager.DD_Unlock();
_vm->_graphicsManager.DD_VBL();
RESTORE_POLICE();
_vm->_eventsManager.MOUSE_OFF();
}
if (idx == 1)
_vm->_globals.SORTIE = 13;
if ((uint16)(idx - 2) <= 1u)
_vm->_globals.SORTIE = 14;
return _vm->_graphicsManager.RESET_SEGMENT_VESA();
*/
}
} // End of namespace Hopkins

View File

@ -34,12 +34,15 @@ class HopkinsEngine;
class MenuManager {
private:
HopkinsEngine *_vm;
byte MenuTxt[10600];
public:
void setParent(HopkinsEngine *vm);
int MENU();
void CHARGE_PARTIE();
void SAUVE_PARTIE();
void COMPUT_HOPKINS(int a1);
};
} // End of namespace Hopkins

File diff suppressed because it is too large Load Diff

View File

@ -75,6 +75,7 @@ public:
byte *SL_SPR;
byte *SL_SPR2;
byte *sprite_ptr;
const byte *S_old_spr;
bool PERSO_ON;
bool SL_FLAG;
bool FLAG_VISIBLE;
@ -121,6 +122,8 @@ public:
int OBSSEUL;
int NVVERBE;
int NVZONE;
int S_old_ani;
int S_old_ret;
public:
ObjectsManager();
void setParent(HopkinsEngine *vm);
@ -195,6 +198,7 @@ public:
void PARADISE();
void CLEAR_ECRAN();
void TEST_INVENT();
void INVENT();
void CHANGE_TETE(int a1, int a2);
void VERIFTAILLE();
@ -232,6 +236,7 @@ public:
int BOBA(int idx);
void INILINK(const Common::String &file);
void SPECIAL_INI(const Common::String &a1);
void OPTI_BOBON(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
void SCI_OPTI_ONE(int a1, int a2, int a3, int a4);
int Control_Goto(const byte *dataP);
@ -247,6 +252,10 @@ public:
void SPACTION1(byte *a1, const Common::String &a2, int a3, int a4, int a5);
void TEST_FORET(int a1, int a2, int a3, int a4, int a5, int a6);
void BLOQUE_ANIMX(int idx, int a2);
void PERSONAGE(const Common::String &s1, const Common::String &s2, const Common::String &s3,
const Common::String &s4, int v);
void PERSONAGE2(const Common::String &s1, const Common::String &s2, const Common::String &s3,
const Common::String &s4, int v);
};
} // End of namespace Hopkins