Skip to content

Commit

Permalink
HOPKINS: Add some translated comments to function names
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Oct 20, 2012
1 parent 6aa3201 commit b4247f6
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 2 deletions.
5 changes: 5 additions & 0 deletions engines/hopkins/anim.cpp
Expand Up @@ -38,6 +38,7 @@ AnimationManager::AnimationManager() {
NO_SEQ = false;
}

// Play Anim
void AnimationManager::PLAY_ANM(const Common::String &filename, uint32 rate1, uint32 rate2, uint32 rate3) {
signed __int16 v4;
signed __int16 v5;
Expand Down Expand Up @@ -239,6 +240,7 @@ void AnimationManager::PLAY_ANM(const Common::String &filename, uint32 rate1, ui
_vm->_graphicsManager.NOLOCK = 0;
}

// Play Anim 2
void AnimationManager::PLAY_ANM2(const Common::String &filename, uint32 a2, uint32 a3, uint32 a4) {
byte *v4;
int v5;
Expand Down Expand Up @@ -671,6 +673,7 @@ bool AnimationManager::REDRAW_ANIM() {
return false;
}

// Load Anim
void AnimationManager::CHARGE_ANIM(const Common::String &animName) {
byte v20[15];
char header[10];
Expand Down Expand Up @@ -746,6 +749,7 @@ void AnimationManager::CLEAR_ANIM() {
}
}

// Load Sprite Bank 1
int AnimationManager::CHARGE_BANK_SPRITE1(int idx, const Common::String &filename) {
byte *v3;
byte *v4;
Expand Down Expand Up @@ -843,6 +847,7 @@ int AnimationManager::CHARGE_BANK_SPRITE1(int idx, const Common::String &filenam
return result;
}

// Search Anim
void AnimationManager::RECHERCHE_ANIM(const byte *data, int animIndex, int count) {
int v3;
const byte *v5;
Expand Down
11 changes: 11 additions & 0 deletions engines/hopkins/events.cpp
Expand Up @@ -54,10 +54,12 @@ void EventsManager::setParent(HopkinsEngine *vm) {
_vm = vm;
}

// Install Mouse
void EventsManager::INSTALL_SOURIS() {
// No implementation in original
}

// Mouse On
void EventsManager::souris_on() {
souris_flag = true;

Expand All @@ -78,44 +80,52 @@ void EventsManager::souris_on() {
souris_xy(150, 100);
}

// Set Mouse position
void EventsManager::souris_xy(int xp, int yp) {
g_system->warpMouse(xp, yp);
}

// Mouse Max
void EventsManager::souris_max() {
// No implementation in original
}

// Get Mouse X
int EventsManager::XMOUSE() {
souris_x = start_x + g_system->getEventManager()->getMousePos().x;
souris_y = g_system->getEventManager()->getMousePos().y;

return souris_x + ofset_souris_x;
}

// Get Mouse Y
int EventsManager::YMOUSE() {
souris_x = start_x + g_system->getEventManager()->getMousePos().x;
souris_y = g_system->getEventManager()->getMousePos().y;

return souris_y + ofset_souris_y;
}

// Get Mouse Button
int EventsManager::BMOUSE() {
CONTROLE_MES();
return souris_bb;
}

// Mouse Off
void EventsManager::MOUSE_OFF() {
souris_flag = false;
g_system->showMouse(false);
}

// Mouse On
void EventsManager::MOUSE_ON() {
souris_on();
souris_flag = true;
g_system->showMouse(true);
}

// Change Mouse Cursor
void EventsManager::CHANGE_MOUSE(int id) {
int cursorId = id;

Expand Down Expand Up @@ -182,6 +192,7 @@ void EventsManager::CHANGE_MOUSE(int id) {
}
}

// Check Events
void EventsManager::CONTROLE_MES() {
pollEvents();
}
Expand Down
13 changes: 13 additions & 0 deletions engines/hopkins/files.cpp
Expand Up @@ -46,6 +46,7 @@ void FileManager::initSaves() {
SAUVE_FICHIER(dataFilename, data, 100);
}

// Save File
bool FileManager::SAUVE_FICHIER(const Common::String &file, const void *buf, size_t n) {
return bsave(file, buf, n);
}
Expand All @@ -63,6 +64,7 @@ bool FileManager::bsave(const Common::String &file, const void *buf, size_t n) {
return false;
}

// Load INI File
void FileManager::Chage_Inifile(Common::StringMap &iniParams) {
char *iniData = (char *)CHARGE_FICHIER("config.ini");
char *ptr = iniData;
Expand Down Expand Up @@ -105,6 +107,7 @@ void FileManager::Chage_Inifile(Common::StringMap &iniParams) {
free(iniData);
}

// Load File
byte *FileManager::CHARGE_FICHIER(const Common::String &file) {
DMESS1();

Expand All @@ -124,6 +127,7 @@ byte *FileManager::CHARGE_FICHIER(const Common::String &file) {
return data;
}

// Load File 2
void FileManager::CHARGE_FICHIER2(const Common::String &file, byte *buf) {
Common::File f;
size_t filesize;
Expand All @@ -137,10 +141,12 @@ void FileManager::CHARGE_FICHIER2(const Common::String &file, byte *buf) {
f.close();
}

// Guess: Debug Message
void FileManager::DMESS() {
// No implementation in original
}

// Guess: Debug Message 1
void FileManager::DMESS1() {
// No implementation in original
}
Expand All @@ -158,6 +164,7 @@ int FileManager::bload_it(Common::ReadStream &stream, void *buf, size_t nbytes)
return stream.read(buf, nbytes);
}

// Censorship
void FileManager::F_Censure() {
_vm->_globals.CENSURE = false;

Expand All @@ -176,11 +183,13 @@ void FileManager::F_Censure() {
free(data);
}

// Build System
int FileManager::CONSTRUIT_SYSTEM(const Common::String &file) {
_vm->_globals.NFICHIER = Common::String::format("system/%s", file.c_str());
return _vm->_globals.NFICHIER.size();
}

// Build File
void FileManager::CONSTRUIT_FICHIER(const Common::String &hop, const Common::String &file) {
// At this point, the original program did a big switch statement to determine
// whether to preprend the CD or installed directory path into REPJEU
Expand All @@ -192,11 +201,13 @@ void FileManager::CONSTRUIT_FICHIER(const Common::String &hop, const Common::Str
_vm->_globals.NFICHIER = Common::String::format("%s/%s", hop.c_str(), file.c_str());
}

// Free File
byte *FileManager::LIBERE_FICHIER(byte *ptr) {
free(ptr);
return g_PTRNUL;
}

// Search Cat
byte *FileManager::RECHERCHE_CAT(const Common::String &file, int a2) {
byte *ptr = NULL;
Common::File f;
Expand Down Expand Up @@ -344,6 +355,7 @@ byte *FileManager::RECHERCHE_CAT(const Common::String &file, int a2) {
return result;
}

// File Size
uint32 FileManager::FLONG(const Common::String &filename) {
Common::File f;
uint32 size;
Expand All @@ -357,6 +369,7 @@ uint32 FileManager::FLONG(const Common::String &filename) {
return size;
}

// Build Linux
Common::String FileManager::CONSTRUIT_LINUX(const Common::String &file) {
return file;
}
Expand Down
7 changes: 6 additions & 1 deletion engines/hopkins/font.cpp
Expand Up @@ -51,6 +51,7 @@ void FontManager::clearAll() {
}
}

// Text On
void FontManager::TEXTE_ON(int idx) {
if ((idx - 5) > 11)
error("Attempted to display text > MAX_TEXT.");
Expand All @@ -65,7 +66,7 @@ void FontManager::TEXTE_ON(int idx) {
}
}


// Text Off
void FontManager::TEXTE_OFF(int idx) {
if ((idx - 5) > 11)
error("Attempted to display text > MAX_TEXT.");
Expand All @@ -80,17 +81,20 @@ void FontManager::TEXTE_OFF(int idx) {
}
}

// Text Color
void FontManager::COUL_TXT(int idx, byte colByte) {
Txt[idx - 5].colour = colByte;
}

// Text Optimal Color
void FontManager::OPTI_COUL_TXT(int idx1, int idx2, int idx3, int idx4) {
COUL_TXT(idx1, 255);
COUL_TXT(idx2, 255);
COUL_TXT(idx3, 255);
COUL_TXT(idx4, 253);
}

//
void FontManager::DOS_TEXT(int idx, int messageId, const Common::String &filename, int xp, int yp, int a6, int a7, int a8, int a9, int colour) {
if ((idx - 5) > 11)
error("Attempted to display text > MAX_TEXT.");
Expand All @@ -108,6 +112,7 @@ void FontManager::DOS_TEXT(int idx, int messageId, const Common::String &filenam
txt.colour = colour;
}

// Box
void FontManager::BOITE(int idx, int messageId, const Common::String &filename, int xp, int yp) {
int filesize;
byte *v9;
Expand Down
5 changes: 5 additions & 0 deletions engines/hopkins/globals.cpp
Expand Up @@ -443,6 +443,7 @@ void Globals::CLEAR_VBOB() {
}
}

// Load Object
void Globals::CHARGE_OBJET() {
_vm->_fileManager.CONSTRUIT_SYSTEM("OBJET.DAT");
byte *data = _vm->_fileManager.CHARGE_FICHIER(NFICHIER);
Expand Down Expand Up @@ -475,11 +476,13 @@ byte *Globals::dos_free2(byte *p) {
return g_PTRNUL;
}

// Free File
byte *Globals::LIBERE_FICHIER(byte *p) {
dos_free2(p);
return g_PTRNUL;
}

// Reset Cache
void Globals::RESET_CACHE() {
byte *dataP;

Expand Down Expand Up @@ -509,6 +512,7 @@ void Globals::RESET_CACHE() {
void Globals::CACHE_ON() {
CACHEFLAG = 1;
}

// TODO: Find why some calls have a parameter value
void Globals::CACHE_OFF(int v1) {
CACHEFLAG = 0;
Expand All @@ -522,6 +526,7 @@ void Globals::CACHE_ADD(int idx) {
Cache[idx].fieldA = 1;
}

// Load Cache
void Globals::CHARGE_CACHE(const Common::String &file) {
byte *v2 = g_PTRNUL;
int v4;
Expand Down
13 changes: 13 additions & 0 deletions engines/hopkins/graphics.cpp
Expand Up @@ -158,6 +158,7 @@ void GraphicsManager::DD_Unlock() {
}
}

// Clear Screen
void GraphicsManager::Cls_Video() {
assert(VideoPtr);

Expand All @@ -170,6 +171,7 @@ void GraphicsManager::LOAD_IMAGE(const Common::String &file) {
INIT_TABLE(165, 170, Palette);
}

// Load Screen
void GraphicsManager::CHARGE_ECRAN(const Common::String &file) {
bool flag;
Common::File f;
Expand Down Expand Up @@ -259,6 +261,7 @@ void GraphicsManager::INIT_TABLE(int a1, int a2, byte *palette) {
TABLE_COUL[0] = 1;
}

// Scroll Screen
int GraphicsManager::SCROLL_ECRAN(int amount) {
int result = CLIP(amount, 0, SCREEN_WIDTH);
_vm->_eventsManager.start_x = result;
Expand Down Expand Up @@ -483,6 +486,7 @@ void GraphicsManager::A_PCX640_480(byte *surface, const Common::String &file, by
_vm->_globals.dos_free2(ptr);
}

// Clear Palette
void GraphicsManager::Cls_Pal() {
Common::fill(&cmap[0], &cmap[PALETTE_BLOCK_SIZE], 0);
SD_PIXELS[0] = 0;
Expand All @@ -492,6 +496,7 @@ void GraphicsManager::Cls_Pal() {
}
}

// TODO: Check if it's normal it's defined two times (also in events).
void GraphicsManager::souris_max() {
// Original has no implementation
}
Expand Down Expand Up @@ -1495,6 +1500,7 @@ void GraphicsManager::RESET_SEGMENT_VESA() {
}
}

// Add VESA Segment
void GraphicsManager::Ajoute_Segment_Vesa(int x1, int y1, int x2, int y2) {
int v4;
int v5;
Expand Down Expand Up @@ -1553,6 +1559,7 @@ int GraphicsManager::Magic_Number(signed int v) {
return result;
}

// Display VESA Segment
void GraphicsManager::Affiche_Segment_Vesa() {
if (_vm->_globals.NBBLOC == 0)
return;
Expand Down Expand Up @@ -1748,6 +1755,7 @@ int GraphicsManager::Asm_Reduc(int v, int percentage) {
return v;
}

// Display 'Perfect?'
void GraphicsManager::Affiche_Perfect(byte *surface, const byte *srcData, int xp300, int yp300, int spriteIndex, int a6, int a7, int a8) {
const byte *v8;
int i;
Expand Down Expand Up @@ -2165,6 +2173,7 @@ void GraphicsManager::Affiche_Perfect(byte *surface, const byte *srcData, int xp
}
}

// Display Speed
void GraphicsManager::AFFICHE_SPEED(const byte *spriteData, int xp, int yp, int spriteIndex) {
int width, height;

Expand Down Expand Up @@ -2242,6 +2251,7 @@ void GraphicsManager::Copy_Mem(const byte *srcSurface, int x1, int y1, unsigned
} while (yCurrent != 1);
}

// Display Font
void GraphicsManager::Affiche_Fonte(byte *surface, const byte *spriteData, int xp, int yp,
int characterIndex, int colour) {
const byte *v6;
Expand Down Expand Up @@ -2291,10 +2301,12 @@ void GraphicsManager::Affiche_Fonte(byte *surface, const byte *spriteData, int x
} while (v16 != 1);
}

// Init Screen
void GraphicsManager::INI_ECRAN(const Common::String &file) {
OPTI_INI(file, 0);
}

// Init Screen 2
void GraphicsManager::INI_ECRAN2(const Common::String &file) {
OPTI_INI(file, 2);
}
Expand Down Expand Up @@ -2483,6 +2495,7 @@ 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;
Expand Down

0 comments on commit b4247f6

Please sign in to comment.