diff options
author | Travis Howell | 2005-05-06 11:37:33 +0000 |
---|---|---|
committer | Travis Howell | 2005-05-06 11:37:33 +0000 |
commit | 076e42c302dd463e42d5bbd31eedccf3463f7a61 (patch) | |
tree | 8ff3fc355d85976a5a7dddecc02e48a9092fcf3f /simon | |
parent | d04492a05a39a427ad5f0892a688e5122465ed3d (diff) | |
download | scummvm-rg350-076e42c302dd463e42d5bbd31eedccf3463f7a61.tar.gz scummvm-rg350-076e42c302dd463e42d5bbd31eedccf3463f7a61.tar.bz2 scummvm-rg350-076e42c302dd463e42d5bbd31eedccf3463f7a61.zip |
Use ScummVM code formatting for names.
svn-id: r17930
Diffstat (limited to 'simon')
-rw-r--r-- | simon/charset.cpp | 86 | ||||
-rw-r--r-- | simon/cursor.cpp | 2 | ||||
-rw-r--r-- | simon/debug.cpp | 74 | ||||
-rw-r--r-- | simon/icons.cpp | 32 | ||||
-rw-r--r-- | simon/items.cpp | 308 | ||||
-rw-r--r-- | simon/res.cpp | 24 | ||||
-rw-r--r-- | simon/saveload.cpp | 104 | ||||
-rw-r--r-- | simon/simon.cpp | 1671 | ||||
-rw-r--r-- | simon/simon.h | 291 | ||||
-rw-r--r-- | simon/sound.cpp | 14 | ||||
-rw-r--r-- | simon/sound.h | 4 | ||||
-rw-r--r-- | simon/verb.cpp | 78 | ||||
-rw-r--r-- | simon/vga.cpp | 454 |
13 files changed, 1565 insertions, 1577 deletions
diff --git a/simon/charset.cpp b/simon/charset.cpp index 5996b4ed12..a862f6dd36 100644 --- a/simon/charset.cpp +++ b/simon/charset.cpp @@ -28,15 +28,15 @@ namespace Simon { void SimonEngine::print_char_helper_1(const byte *src, uint len) { uint ind; - if (_fcs_ptr_1 == NULL) + if (_fcsPtr1 == NULL) return; while (len-- != 0) { - if (*src != 12 && _fcs_ptr_1->fcs_data != NULL && - _fcs_data_1[ind = get_fcs_ptr_3_index(_fcs_ptr_1)] != 2) { + if (*src != 12 && _fcsPtr1->fcs_data != NULL && + _fcsData1[ind = get_fcs_ptr_3_index(_fcsPtr1)] != 2) { - _fcs_data_1[ind] = 2; - _fcs_data_2[ind] = 1; + _fcsData1[ind] = 2; + _fcsData2[ind] = 1; } fcs_putchar(*src++); @@ -46,23 +46,23 @@ void SimonEngine::print_char_helper_1(const byte *src, uint len) { void SimonEngine::print_char_helper_5(FillOrCopyStruct *fcs) { uint index = get_fcs_ptr_3_index(fcs); print_char_helper_6(index); - _fcs_data_1[index] = 0; + _fcsData1[index] = 0; } void SimonEngine::print_char_helper_6(uint i) { FillOrCopyStruct *fcs; - if (_fcs_data_2[i]) { + if (_fcsData2[i]) { lock(); - fcs = _fcs_ptr_array_3[i]; + fcs = _fcsPtrArray3[i]; fcs_unk_proc_1(i, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1, fcs->fcs_data->unk2); - _fcs_data_2[i] = 0; + _fcsData2[i] = 0; unlock(); } } void SimonEngine::render_string_amiga(uint vga_sprite_id, uint color, uint width, uint height, const char *txt) { - VgaPointersEntry *vpe = &_vga_buffer_pointers[2]; + VgaPointersEntry *vpe = &_vgaBufferPointers[2]; byte *src, *dst, *dst_org, chr; uint count; @@ -153,7 +153,7 @@ void SimonEngine::render_string_amiga(uint vga_sprite_id, uint color, uint width } void SimonEngine::render_string(uint vga_sprite_id, uint color, uint width, uint height, const char *txt) { - VgaPointersEntry *vpe = &_vga_buffer_pointers[2]; + VgaPointersEntry *vpe = &_vgaBufferPointers[2]; byte *src, *dst, *p, *dst_org, chr; uint count; @@ -226,15 +226,15 @@ void SimonEngine::showMessageFormat(const char *s, ...) { vsnprintf(buf, STRINGBUFLEN, s, va); va_end(va); - if (!_fcs_data_1[_fcs_unk_1]) { + if (!_fcsData1[_fcsUnk1]) { showmessage_helper_2(); - if (!_showmessage_flag) { - _fcs_ptr_array_3[0] = _fcs_ptr_1; - showmessage_helper_3(_fcs_ptr_1->textLength, - _fcs_ptr_1->textMaxLength); + if (!_showMessageFlag) { + _fcsPtrArray3[0] = _fcsPtr1; + showmessage_helper_3(_fcsPtr1->textLength, + _fcsPtr1->textMaxLength); } - _showmessage_flag = true; - _fcs_data_1[_fcs_unk_1] = 1; + _showMessageFlag = true; + _fcsData1[_fcsUnk1] = 1; } for (str = buf; *str; str++) @@ -243,55 +243,55 @@ void SimonEngine::showMessageFormat(const char *s, ...) { void SimonEngine::showmessage_print_char(byte chr) { if (chr == 12) { - _num_letters_to_print = 0; - _print_char_unk_1 = 0; + _numLettersToPrint = 0; + _printCharUnk1 = 0; print_char_helper_1(&chr, 1); - print_char_helper_5(_fcs_ptr_1); + print_char_helper_5(_fcsPtr1); } else if (chr == 0 || chr == ' ' || chr == 10) { - if (_print_char_unk_2 - _print_char_unk_1 >= _num_letters_to_print) { - _print_char_unk_1 += _num_letters_to_print; - print_char_helper_1(_letters_to_print_buf, _num_letters_to_print); + if (_printCharUnk2 - _printCharUnk1 >= _numLettersToPrint) { + _printCharUnk1 += _numLettersToPrint; + print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint); - if (_print_char_unk_1 == _print_char_unk_2) { - _print_char_unk_1 = 0; + if (_printCharUnk1 == _printCharUnk2) { + _printCharUnk1 = 0; } else { if (chr) print_char_helper_1(&chr, 1); if (chr == 10) - _print_char_unk_1 = 0; + _printCharUnk1 = 0; else if (chr != 0) - _print_char_unk_1++; + _printCharUnk1++; } } else { const byte newline_character = 10; - _print_char_unk_1 = _num_letters_to_print; + _printCharUnk1 = _numLettersToPrint; print_char_helper_1(&newline_character, 1); - print_char_helper_1(_letters_to_print_buf, _num_letters_to_print); + print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint); if (chr == ' ') { print_char_helper_1(&chr, 1); - _print_char_unk_1++; + _printCharUnk1++; } else { print_char_helper_1(&chr, 1); - _print_char_unk_1 = 0; + _printCharUnk1 = 0; } } - _num_letters_to_print = 0; + _numLettersToPrint = 0; } else { - _letters_to_print_buf[_num_letters_to_print++] = chr; + _lettersToPrintBuf[_numLettersToPrint++] = chr; } } void SimonEngine::showmessage_helper_2() { - if (_fcs_ptr_1) + if (_fcsPtr1) return; - _fcs_ptr_1 = fcs_alloc(8, 0x90, 0x18, 6, 1, 0, 0xF); + _fcsPtr1 = fcs_alloc(8, 0x90, 0x18, 6, 1, 0, 0xF); } void SimonEngine::showmessage_helper_3(uint a, uint b) { - _print_char_unk_1 = a; - _print_char_unk_2 = b; - _num_letters_to_print = 0; + _printCharUnk1 = a; + _printCharUnk2 = b; + _numLettersToPrint = 0; } void SimonEngine::video_putchar(FillOrCopyStruct *fcs, byte c, byte b) { @@ -1091,10 +1091,10 @@ void SimonEngine::video_putchar_drawchar(FillOrCopyStruct *fcs, uint x, uint y, byte color, *dst; uint h, i; - _lock_word |= 0x8000; + _lockWord |= 0x8000; dst = dx_lock_2(); - dst += y * _dx_surface_pitch + x * 8 + fcs->textColumnOffset; + dst += y * _dxSurfacePitch + x * 8 + fcs->textColumnOffset; if (_language == 21) { src = russian_video_font + (chr - 0x20) * 8; @@ -1122,12 +1122,12 @@ void SimonEngine::video_putchar_drawchar(FillOrCopyStruct *fcs, uint x, uint y, dst[i] = color; b <<= 1; } while (++i != 6); - dst += _dx_surface_pitch; + dst += _dxSurfacePitch; } while (--h); dx_unlock_2(); - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } } // End of namespace Simon diff --git a/simon/cursor.cpp b/simon/cursor.cpp index a8fe272e75..5f3042c22c 100644 --- a/simon/cursor.cpp +++ b/simon/cursor.cpp @@ -224,7 +224,7 @@ static const byte _simon2_cursors[10][256] = { void SimonEngine::draw_mouse_pointer() { if (_game & GF_SIMON2) - _system->setMouseCursor(_simon2_cursors[_mouse_cursor], 16, 16, 7, 7); + _system->setMouseCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7); else _system->setMouseCursor(_simon1_cursor, 16, 16, 0, 0); } diff --git a/simon/debug.cpp b/simon/debug.cpp index 0fe0b219ed..85d61fede6 100644 --- a/simon/debug.cpp +++ b/simon/debug.cpp @@ -52,30 +52,30 @@ const byte *SimonEngine::dumpOpcode(const byte *p) { } while (*st != '|') st++; - fprintf(_dump_file, "%s ", st + 1); + fprintf(_dumpFile, "%s ", st + 1); for (;;) { switch (*s++) { case 'x': - fprintf(_dump_file, "\n"); + fprintf(_dumpFile, "\n"); return NULL; case '|': - fprintf(_dump_file, "\n"); + fprintf(_dumpFile, "\n"); return p; case 'B':{ byte b = *p++; if (b == 255) - fprintf(_dump_file, "[%d] ", *p++); + fprintf(_dumpFile, "[%d] ", *p++); else - fprintf(_dump_file, "%d ", b); + fprintf(_dumpFile, "%d ", b); break; } case 'V':{ byte b = *p++; if (b == 255) - fprintf(_dump_file, "[[%d]] ", *p++); + fprintf(_dumpFile, "[[%d]] ", *p++); else - fprintf(_dump_file, "[%d] ", b); + fprintf(_dumpFile, "[%d] ", b); break; } @@ -83,16 +83,16 @@ const byte *SimonEngine::dumpOpcode(const byte *p) { int n = (int16)((p[0] << 8) | p[1]); p += 2; if (n >= 30000 && n < 30512) - fprintf(_dump_file, "[%d] ", n - 30000); + fprintf(_dumpFile, "[%d] ", n - 30000); else - fprintf(_dump_file, "%d ", n); + fprintf(_dumpFile, "%d ", n); break; } case 'w':{ int n = (int16)((p[0] << 8) | p[1]); p += 2; - fprintf(_dump_file, "%d ", n); + fprintf(_dumpFile, "%d ", n); break; } @@ -100,22 +100,22 @@ const byte *SimonEngine::dumpOpcode(const byte *p) { int n = (int16)((p[0] << 8) | p[1]);; p += 2; if (n == -1) - fprintf(_dump_file, "ITEM_M1 "); + fprintf(_dumpFile, "ITEM_M1 "); else if (n == -3) - fprintf(_dump_file, "ITEM_M3 "); + fprintf(_dumpFile, "ITEM_M3 "); else if (n == -5) - fprintf(_dump_file, "ITEM_1 "); + fprintf(_dumpFile, "ITEM_1 "); else if (n == -7) - fprintf(_dump_file, "ITEM_0 "); + fprintf(_dumpFile, "ITEM_0 "); else if (n == -9) - fprintf(_dump_file, "ITEM_A_PARENT "); + fprintf(_dumpFile, "ITEM_A_PARENT "); else - fprintf(_dump_file, "<%d> ", n); + fprintf(_dumpFile, "<%d> ", n); break; } case 'J':{ - fprintf(_dump_file, "-> "); + fprintf(_dumpFile, "-> "); } break; @@ -123,9 +123,9 @@ const byte *SimonEngine::dumpOpcode(const byte *p) { uint n = ((p[0] << 8) | p[1]); p += 2; if (n != 0xFFFF) - fprintf(_dump_file, "\"%s\"(%d) ", getStringPtrByID(n), n); + fprintf(_dumpFile, "\"%s\"(%d) ", getStringPtrByID(n), n); else - fprintf(_dump_file, "NULL_STRING "); + fprintf(_dumpFile, "NULL_STRING "); } break; } @@ -139,7 +139,7 @@ void SimonEngine::dumpSubroutineLine(SubroutineLine *sl, Subroutine *sub) { p = (byte *)sl + SUBROUTINE_LINE_SMALL_SIZE; if (sub->id == 0) { - fprintf(_dump_file, "; cond_a=%d, cond_b=%d, cond_c=%d\n", sl->cond_a, sl->cond_b, sl->cond_c); + fprintf(_dumpFile, "; cond_a=%d, cond_b=%d, cond_c=%d\n", sl->cond_a, sl->cond_b, sl->cond_c); p = (byte *)sl + SUBROUTINE_LINE_BIG_SIZE; } @@ -153,17 +153,17 @@ void SimonEngine::dumpSubroutineLine(SubroutineLine *sl, Subroutine *sub) { void SimonEngine::dumpSubroutine(Subroutine *sub) { SubroutineLine *sl; - fprintf(_dump_file, "\n******************************************\n;Subroutine, ID=%d:\nSUB_%d:\n", sub->id, sub->id); + fprintf(_dumpFile, "\n******************************************\n;Subroutine, ID=%d:\nSUB_%d:\n", sub->id, sub->id); sl = (SubroutineLine *)((byte *)sub + sub->first); for (; (byte *)sl != (byte *)sub; sl = (SubroutineLine *)((byte *)sub + sl->next)) { dumpSubroutineLine(sl, sub); } - fprintf(_dump_file, "\nEND ******************************************\n"); - fflush(_dump_file); + fprintf(_dumpFile, "\nEND ******************************************\n"); + fflush(_dumpFile); } void SimonEngine::dumpSubroutines() { - Subroutine *sub = _subroutine_list; + Subroutine *sub = _subroutineList; for (; sub; sub = sub->next) { dumpSubroutine(sub); } @@ -194,31 +194,31 @@ void SimonEngine::dump_video_script(const byte *src, bool one_opcode_only) { while (*strn != '|') strn++; - fprintf(_dump_file, "%.2d: %s ", opcode, strn + 1); + fprintf(_dumpFile, "%.2d: %s ", opcode, strn + 1); for (; *str != '|'; str++) { switch (*str) { case 'x': - fprintf(_dump_file, "\n"); + fprintf(_dumpFile, "\n"); return; case 'b': - fprintf(_dump_file, "%d ", *src++); + fprintf(_dumpFile, "%d ", *src++); break; case 'd': - fprintf(_dump_file, "%d ", READ_BE_UINT16(src)); + fprintf(_dumpFile, "%d ", READ_BE_UINT16(src)); src += 2; break; case 'v': - fprintf(_dump_file, "[%d] ", READ_BE_UINT16(src)); + fprintf(_dumpFile, "[%d] ", READ_BE_UINT16(src)); src += 2; break; case 'i': - fprintf(_dump_file, "%d ", (int16)READ_BE_UINT16(src)); + fprintf(_dumpFile, "%d ", (int16)READ_BE_UINT16(src)); src += 2; break; case 'q': while (READ_BE_UINT16(src) != 999) { - fprintf(_dump_file, "(%d,%d) ", READ_BE_UINT16(src), + fprintf(_dumpFile, "(%d,%d) ", READ_BE_UINT16(src), READ_BE_UINT16(src + 2)); src += 4; } @@ -229,7 +229,7 @@ void SimonEngine::dump_video_script(const byte *src, bool one_opcode_only) { } } - fprintf(_dump_file, "\n"); + fprintf(_dumpFile, "\n"); } while (!one_opcode_only); } @@ -422,8 +422,8 @@ void SimonEngine::dump_vga_bitmaps(const byte *vga, byte *vga1, int res) { height = p2[5]; flags = p2[4]; - fprintf(_dump_file, "Image %d. Width=%d, Height=%d, Flags=0x%X\n", i, width, height, flags); - fflush(_dump_file); + fprintf(_dumpFile, "Image %d. Width=%d, Height=%d, Flags=0x%X\n", i, width, height, flags); + fflush(_dumpFile); /* dump bitmap */ { @@ -440,10 +440,10 @@ void SimonEngine::dump_vga_bitmaps(const byte *vga, byte *vga1, int res) { } void SimonEngine::dump_vga_script_always(const byte *ptr, uint res, uint sprite_id) { - fprintf(_dump_file, "; address=%x, vgafile=%d vgasprite=%d\n", - ptr - _vga_buffer_pointers[res].vgaFile1, res, sprite_id); + fprintf(_dumpFile, "; address=%x, vgafile=%d vgasprite=%d\n", + ptr - _vgaBufferPointers[res].vgaFile1, res, sprite_id); dump_video_script(ptr, false); - fprintf(_dump_file, "; end\n"); + fprintf(_dumpFile, "; end\n"); } void SimonEngine::dump_vga_script(const byte *ptr, uint res, uint sprite_id) { diff --git a/simon/icons.cpp b/simon/icons.cpp index ce7a4ac845..9f7bcc7eac 100644 --- a/simon/icons.cpp +++ b/simon/icons.cpp @@ -43,11 +43,11 @@ void SimonEngine::loadIconFile() { size = in.size(); - _icon_file_ptr = (byte *)malloc(size); - if (_icon_file_ptr == NULL) + _iconFilePtr = (byte *)malloc(size); + if (_iconFilePtr == NULL) error("Out of icon memory"); - in.read(_icon_file_ptr, size); + in.read(_iconFilePtr, size); in.close(); } @@ -158,40 +158,40 @@ void SimonEngine::draw_icon_c(FillOrCopyStruct *fcs, uint icon, uint x, uint y) byte *dst; byte *src; - _lock_word |= 0x8000; + _lockWord |= 0x8000; dst = dx_lock_2(); if (!(_game & GF_SIMON2)) { // Simon 1 dst += (x + fcs->x) * 8; - dst += (y * 25 + fcs->y) * _dx_surface_pitch; + dst += (y * 25 + fcs->y) * _dxSurfacePitch; if (_game & GF_AMIGA) { - src = _icon_file_ptr; + src = _iconFilePtr; src += READ_BE_UINT32(&((uint32 *)src)[icon]); - decompress_icon_amiga (dst, src, 0xE0, _dx_surface_pitch); + decompress_icon_amiga (dst, src, 0xE0, _dxSurfacePitch); } else { - src = _icon_file_ptr; + src = _iconFilePtr; src += READ_LE_UINT16(&((uint16 *)src)[icon]); - decompress_icon(dst, src, 24, 12, 0xE0, _dx_surface_pitch); + decompress_icon(dst, src, 24, 12, 0xE0, _dxSurfacePitch); } } else { // Simon 2 dst += 110; dst += x; - dst += (y + fcs->y) * _dx_surface_pitch; + dst += (y + fcs->y) * _dxSurfacePitch; - src = _icon_file_ptr; + src = _iconFilePtr; src += READ_LE_UINT16(&((uint16 *)src)[icon * 2 + 0]); - decompress_icon(dst, src, 20, 10, 0xE0, _dx_surface_pitch); + decompress_icon(dst, src, 20, 10, 0xE0, _dxSurfacePitch); - src = _icon_file_ptr; + src = _iconFilePtr; src += READ_LE_UINT16(&((uint16 *)src)[icon * 2 + 1]); - decompress_icon(dst, src, 20, 10, 0xD0, _dx_surface_pitch); + decompress_icon(dst, src, 20, 10, 0xD0, _dxSurfacePitch); } dx_unlock_2(); - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } uint SimonEngine::setup_icon_hit_area(FillOrCopyStruct *fcs, uint x, uint y, uint icon_number, @@ -222,7 +222,7 @@ uint SimonEngine::setup_icon_hit_area(FillOrCopyStruct *fcs, uint x, uint y, uin ha->unk3 = 0xD0; } - return ha - _hit_areas; + return ha - _hitAreas; } } // End of namespace Simon diff --git a/simon/items.cpp b/simon/items.cpp index 3b0850761d..5543e0359c 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -39,14 +39,14 @@ int SimonEngine::runScript() { bool flag, condition; do { - if (_continous_mainscript) - dumpOpcode(_code_ptr); + if (_continousMainScript) + dumpOpcode(_codePtr); opcode = getByte(); if (opcode == 0xFF) return 0; - if (_run_script_return_1) + if (_runScriptReturn1) return 1; /* Invert condition? */ @@ -360,7 +360,7 @@ int SimonEngine::runScript() { int h = getVarOrWord(); int number = getVarOrByte(); if (number < 20) - addNewHitArea(id, x, y, w, h, (number << 8) + 129, 0xD0, _dummy_item_2); + addNewHitArea(id, x, y, w, h, (number << 8) + 129, 0xD0, _dummyItem2); } break; @@ -368,7 +368,7 @@ int SimonEngine::runScript() { uint var = getVarOrByte(); uint string_id = getNextStringID(); if (var < 20) - _stringid_array_2[var] = string_id; + _stringIdArray2[var] = string_id; } break; @@ -378,12 +378,12 @@ int SimonEngine::runScript() { if (_game & GF_TALKIE) { uint speech_id = getNextWord(); if (var < 20) { - _stringid_array_3[var] = string_id; - _speechid_array_4[var] = speech_id; + _stringIdArray3[var] = string_id; + _speechIdArray4[var] = speech_id; } } else { if (var < 20) { - _stringid_array_3[var] = string_id; + _stringIdArray3[var] = string_id; } } } @@ -399,7 +399,7 @@ int SimonEngine::runScript() { } case 70:{ /* show string from array */ - const char *str = (const char *)getStringPtrByID(_stringid_array_3[getVarOrByte()]); + const char *str = (const char *)getStringPtrByID(_stringIdArray3[getVarOrByte()]); if (_game & GF_SIMON2) { writeVariable(51, strlen(str) / 53 * 8 + 8); @@ -423,12 +423,12 @@ int SimonEngine::runScript() { break; case 77:{ /* has item minus 1 */ - condition = _subject_item != NULL; + condition = _subjectItem != NULL; } break; case 78:{ /* has item minus 3 */ - condition = _object_item != NULL; + condition = _objectItem != NULL; } break; @@ -460,13 +460,13 @@ int SimonEngine::runScript() { } break; - case 88:{ /* or_lock_word */ - _lock_word |= 0x10; + case 88:{ /* or_lockWord */ + _lockWord |= 0x10; } break; case 89:{ /* and lock word */ - _lock_word &= ~0x10; + _lockWord &= ~0x10; } break; @@ -474,10 +474,10 @@ int SimonEngine::runScript() { Item *item = derefItem(getNextItemPtr()->parent); switch (getVarOrByte()) { case 0: - _object_item = item; + _objectItem = item; break; case 1: - _subject_item = item; + _subjectItem = item; break; default: error("set minusitem to parent, invalid subcode"); @@ -489,10 +489,10 @@ int SimonEngine::runScript() { Item *item = derefItem(getNextItemPtr()->sibling); switch (getVarOrByte()) { case 0: - _object_item = item; + _objectItem = item; break; case 1: - _subject_item = item; + _subjectItem = item; break; default: error("set minusitem to sibling, invalid subcode"); @@ -504,10 +504,10 @@ int SimonEngine::runScript() { Item *item = derefItem(getNextItemPtr()->child); switch (getVarOrByte()) { case 0: - _object_item = item; + _objectItem = item; break; case 1: - _subject_item = item; + _subjectItem = item; break; default: error("set minusitem to child, invalid subcode"); @@ -675,11 +675,11 @@ int SimonEngine::runScript() { case 119:{ /* wait vga */ uint var = getVarOrWord(); - _scriptvar_2 = (var == 200); + _scriptVar2 = (var == 200); - if (var != 200 || !_skip_vga_wait) + if (var != 200 || !_skipVgaWait) o_wait_for_vga(var); - _skip_vga_wait = false; + _skipVgaWait = false; } break; @@ -690,7 +690,7 @@ int SimonEngine::runScript() { case 121:{ /* set vga item */ uint slot = getVarOrByte(); - _vc_item_array[slot] = getNextItemPtr(); + _vcItemArray[slot] = getNextItemPtr(); } break; @@ -730,9 +730,9 @@ int SimonEngine::runScript() { uint var = getVarOrByte(); getNextWord(); if (var == 1) - _script_cond_b = getNextWord(); + _scriptCondB = getNextWord(); else - _script_cond_c = getNextWord(); + _scriptCondC = getNextWord(); } break; @@ -752,7 +752,7 @@ int SimonEngine::runScript() { case 134:{ /* dummy opcode? */ midi.stop(); - _last_music_played = -1; + _lastMusicPlayed = -1; } break; @@ -781,9 +781,9 @@ int SimonEngine::runScript() { case 139:{ /* set parent special */ Item *item = getNextItemPtr(); - _no_parent_notify = true; + _noParentNotify = true; setItemParent(item, getNextItemPtr()); - _no_parent_notify = false; + _noParentNotify = false; } break; @@ -797,9 +797,9 @@ int SimonEngine::runScript() { uint which = getVarOrByte(); Item *item = getNextItemPtr(); if (which == 1) { - _subject_item = item; + _subjectItem = item; } else { - _object_item = item; + _objectItem = item; } } break; @@ -822,42 +822,42 @@ int SimonEngine::runScript() { case 151:{ /* set array6 to item */ uint var = getVarOrByte(); Item *item = getNextItemPtr(); - _item_array_6[var] = item; + _itemArray6[var] = item; } break; case 152:{ /* set m1 or m3 to array6 */ - Item *item = _item_array_6[getVarOrByte()]; + Item *item = _itemArray6[getVarOrByte()]; uint var = getVarOrByte(); if (var == 1) { - _subject_item = item; + _subjectItem = item; } else { - _object_item = item; + _objectItem = item; } } break; case 153:{ /* set bit */ uint bit = getVarOrByte(); - _bit_array[bit >> 4] |= 1 << (bit & 15); + _bitArray[bit >> 4] |= 1 << (bit & 15); break; } case 154:{ /* clear bit */ uint bit = getVarOrByte(); - _bit_array[bit >> 4] &= ~(1 << (bit & 15)); + _bitArray[bit >> 4] &= ~(1 << (bit & 15)); break; } case 155:{ /* is bit clear? */ uint bit = getVarOrByte(); - condition = (_bit_array[bit >> 4] & (1 << (bit & 15))) == 0; + condition = (_bitArray[bit >> 4] & (1 << (bit & 15))) == 0; } break; case 156:{ /* is bit set? */ uint bit = getVarOrByte(); - condition = (_bit_array[bit >> 4] & (1 << (bit & 15))) != 0; + condition = (_bitArray[bit >> 4] & (1 << (bit & 15))) != 0; } break; @@ -913,9 +913,9 @@ int SimonEngine::runScript() { break; case 164:{ - _show_preposition = true; + _showPreposition = true; o_setup_cond_c(); - _show_preposition = false; + _showPreposition = false; } break; @@ -927,25 +927,25 @@ int SimonEngine::runScript() { case 166:{ /* set bit2 */ uint bit = getVarOrByte(); - _bit_array[(bit >> 4) + 16] |= 1 << (bit & 15); + _bitArray[(bit >> 4) + 16] |= 1 << (bit & 15); } break; case 167:{ /* clear bit2 */ uint bit = getVarOrByte(); - _bit_array[(bit >> 4) + 16] &= ~(1 << (bit & 15)); + _bitArray[(bit >> 4) + 16] &= ~(1 << (bit & 15)); } break; case 168:{ /* is bit2 clear */ uint bit = getVarOrByte(); - condition = (_bit_array[(bit >> 4) + 16] & (1 << (bit & 15))) == 0; + condition = (_bitArray[(bit >> 4) + 16] & (1 << (bit & 15))) == 0; } break; case 169:{ /* is bit2 set */ uint bit = getVarOrByte(); - condition = (_bit_array[(bit >> 4) + 16] & (1 << (bit & 15))) != 0; + condition = (_bitArray[(bit >> 4) + 16] & (1 << (bit & 15))) != 0; } break; @@ -979,10 +979,10 @@ int SimonEngine::runScript() { uint string_id = getVarOrByte(); uint speech_id = 0; - const char *string_ptr = (const char *)getStringPtrByID(_stringid_array_3[string_id]); + const char *string_ptr = (const char *)getStringPtrByID(_stringIdArray3[string_id]); TextLocation *tl = getTextLocation(vga_sprite_id); if (_game & GF_TALKIE) - speech_id = _speechid_array_4[string_id]; + speech_id = _speechIdArray4[string_id]; if (_speech && speech_id != 0) talk_with_speech(speech_id, vga_sprite_id); @@ -1027,12 +1027,12 @@ int SimonEngine::runScript() { case 185:{ /* midi sfx file number */ if (_game & GF_SIMON2) goto invalid_opcode; - _sound_file_id = getVarOrWord(); + _soundFileId = getVarOrWord(); if (_game == GAME_SIMON1CD32) { char buf[10]; - sprintf(buf, "%d%s", _sound_file_id, "Effects"); + sprintf(buf, "%d%s", _soundFileId, "Effects"); _sound->readSfxFile(buf); - sprintf(buf, "%d%s", _sound_file_id, "simon"); + sprintf(buf, "%d%s", _soundFileId, "simon"); _sound->readVoiceFile(buf); } @@ -1057,14 +1057,14 @@ int SimonEngine::runScript() { { uint i = getVarOrByte(); uint str = getNextStringID(); - condition = (str < 20 && _stringid_array_2[i] == str); + condition = (str < 20 && _stringIdArray2[i] == str); } break; case 189:{ /* clear_op189_flag */ if (!(_game & GF_SIMON2)) goto invalid_opcode; - _op_189_flags = 0; + _op189Flags = 0; } break; @@ -1073,7 +1073,7 @@ int SimonEngine::runScript() { if (!(_game & GF_SIMON2)) goto invalid_opcode; i = getVarOrByte(); - if (!(_op_189_flags & (1 << i))) + if (!(_op189Flags & (1 << i))) o_190_helper(i); } break; @@ -1093,12 +1093,12 @@ int SimonEngine::startSubroutine(Subroutine *sub) { SubroutineLine *sl; const byte *old_code_ptr; - if (_start_mainscript) + if (_startMainScript) dumpSubroutine(sub); - old_code_ptr = _code_ptr; + old_code_ptr = _codePtr; - if (++_recursion_depth > 40) + if (++_recursionDepth > 40) error("Recursion error"); sl = (SubroutineLine *)((byte *)sub + sub->first); @@ -1106,14 +1106,14 @@ int SimonEngine::startSubroutine(Subroutine *sub) { while ((byte *)sl != (byte *)sub) { if (checkIfToRunSubroutineLine(sl, sub)) { result = 0; - _code_ptr = (byte *)sl; + _codePtr = (byte *)sl; if (sub->id) - _code_ptr += 2; + _codePtr += 2; else - _code_ptr += 8; + _codePtr += 8; - if (_continous_mainscript) - fprintf(_dump_file, "; %d\n", sub->id); + if (_continousMainScript) + fprintf(_dumpFile, "; %d\n", sub->id); result = runScript(); if (result != 0) { /* result -10 means restart subroutine */ @@ -1128,9 +1128,9 @@ int SimonEngine::startSubroutine(Subroutine *sub) { sl = (SubroutineLine *)((byte *)sub + sl->next); } - _code_ptr = old_code_ptr; + _codePtr = old_code_ptr; - _recursion_depth--; + _recursionDepth--; return result; } @@ -1142,23 +1142,23 @@ bool SimonEngine::checkIfToRunSubroutineLine(SubroutineLine *sl, Subroutine *sub if (sub->id) return true; - if (sl->cond_a != -1 && sl->cond_a != _script_cond_a && - (sl->cond_a != -2 || _script_cond_a != -1)) + if (sl->cond_a != -1 && sl->cond_a != _scriptCondA && + (sl->cond_a != -2 || _scriptCondA != -1)) return false; - if (sl->cond_b != -1 && sl->cond_b != _script_cond_b && - (sl->cond_b != -2 || _script_cond_b != -1)) + if (sl->cond_b != -1 && sl->cond_b != _scriptCondB && + (sl->cond_b != -2 || _scriptCondB != -1)) return false; - if (sl->cond_c != -1 && sl->cond_c != _script_cond_c && - (sl->cond_c != -2 || _script_cond_c != -1)) + if (sl->cond_c != -1 && sl->cond_c != _scriptCondC && + (sl->cond_c != -2 || _scriptCondC != -1)) return false; return true; } void SimonEngine::o_83_helper() { - if (_exit_cutscene) { + if (_exitCutscene) { if (vc_get_bit(9)) { startSubroutine170(); } @@ -1168,9 +1168,9 @@ void SimonEngine::o_83_helper() { } void SimonEngine::o_190_helper(uint i) { - _exit_cutscene = false; - while (!(_op_189_flags & (1 << i))) { - if (_exit_cutscene) { + _exitCutscene = false; + while (!(_op189Flags & (1 << i))) { + if (_exitCutscene) { if (vc_get_bit(9)) { startSubroutine170(); break; @@ -1191,24 +1191,24 @@ bool SimonEngine::o_unk_23(uint a) { if (a == 100) return 1; - a += _script_unk_1; + a += _scriptUnk1; if (a <= 0) { - _script_unk_1 = 0; + _scriptUnk1 = 0; return 0; } if ((uint)_rnd.getRandomNumber(99) < a) { - if (_script_unk_1 <= 0) - _script_unk_1 -= 5; + if (_scriptUnk1 <= 0) + _scriptUnk1 -= 5; else - _script_unk_1 = 0; + _scriptUnk1 = 0; return 1; } - if (_script_unk_1 >= 0) - _script_unk_1 += 5; + if (_scriptUnk1 >= 0) + _scriptUnk1 += 5; else - _script_unk_1 = 0; + _scriptUnk1 = 0; return 0; } @@ -1303,27 +1303,27 @@ void SimonEngine::o_quit_if_user_presses_y() { delay(1); #ifdef _WIN32_WCE if (isSmartphone()) { - if (_key_pressed) { - if (_key_pressed == 13) + if (_keyPressed) { + if (_keyPressed == 13) shutdown(); else break; } } #endif - if (_key_pressed == 'f' && _language == 20) // Hebrew + if (_keyPressed == 'f' && _language == 20) // Hebrew shutdown(); - if (_key_pressed == 's' && _language == 5) // Spanish + if (_keyPressed == 's' && _language == 5) // Spanish shutdown(); - if (_key_pressed == 's' && _language == 3) // Italian + if (_keyPressed == 's' && _language == 3) // Italian shutdown(); - if (_key_pressed == 'o' && _language == 2) // French + if (_keyPressed == 'o' && _language == 2) // French shutdown(); - if (_key_pressed == 'j' && _language == 1) // German + if (_keyPressed == 'j' && _language == 1) // German shutdown(); - if (_key_pressed == 'y' && _language == 0) // English + if (_keyPressed == 'y' && _language == 0) // English shutdown(); - if (_key_pressed == 'n') + if (_keyPressed == 'n') goto get_out; } get_out:; @@ -1332,63 +1332,63 @@ get_out:; void SimonEngine::o_unk_137(uint fcs_index) { FillOrCopyStruct *fcs; - fcs = _fcs_ptr_array_3[fcs_index & 7]; + fcs = _fcsPtrArray3[fcs_index & 7]; if (fcs->fcs_data == NULL) return; fcs_unk_proc_1(fcs_index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1, fcs->fcs_data->unk2); } void SimonEngine::o_unk_138() { - _vga_buf_start = _vga_buf_free_start; - _vga_file_buf_org = _vga_buf_free_start; + _vgaBufStart = _vgaBufFreeStart; + _vgaFileBufOrg = _vgaBufFreeStart; } void SimonEngine::o_unk_186() { - _vga_buf_free_start = _vga_file_buf_org_2; - _vga_buf_start = _vga_file_buf_org_2; - _vga_file_buf_org = _vga_file_buf_org_2; + _vgaBufFreeStart = _vgaFileBufOrg2; + _vgaBufStart = _vgaFileBufOrg2; + _vgaFileBufOrg = _vgaFileBufOrg2; } void SimonEngine::o_unk_175() { - _vga_buf_start = _vga_buf_free_start; + _vgaBufStart = _vgaBufFreeStart; } void SimonEngine::o_unk_176() { - _vga_buf_free_start = _vga_file_buf_org; - _vga_buf_start = _vga_file_buf_org; + _vgaBufFreeStart = _vgaFileBufOrg; + _vgaBufStart = _vgaFileBufOrg; } int SimonEngine::o_unk_132_helper(bool *b, char *buf) { HitArea *ha; *b = true; - if (!_saveload_flag) { + if (!_saveLoadFlag) { strange_jump:; - _saveload_flag = false; + _saveLoadFlag = false; savegame_dialog(buf); } start_over:; - _key_pressed = 0; + _keyPressed = 0; if (_game == GAME_SIMON1CD32) goto start_over_3; start_over_2:; - _last_hitarea = _last_hitarea_3 = 0; + _lastHitArea = _lastHitArea3 = 0; do { - if (_key_pressed != 0) { - if (_saveload_flag) { + if (_keyPressed != 0) { + if (_saveLoadFlag) { *b = false; - return _key_pressed; + return _keyPressed; } goto start_over; } delay(100); - } while (_last_hitarea_3 == 0); + } while (_lastHitArea3 == 0); - ha = _last_hitarea; + ha = _lastHitArea; if (ha == NULL || ha->id < 205) goto start_over_2; @@ -1397,22 +1397,22 @@ start_over_2:; return ha->id; if (ha->id == 206) { - if (_saveload_row_curpos == 1) + if (_saveLoadRowCurPos == 1) goto start_over_2; - if (_saveload_row_curpos < 7) - _saveload_row_curpos = 1; + if (_saveLoadRowCurPos < 7) + _saveLoadRowCurPos = 1; else - _saveload_row_curpos -= 6; + _saveLoadRowCurPos -= 6; goto strange_jump; } if (ha->id == 207) { - if (!_savedialog_flag) + if (!_saveDialogFlag) goto start_over_2; - _saveload_row_curpos += 6; - if (_saveload_row_curpos >= _num_savegame_rows) - _saveload_row_curpos = _num_savegame_rows; + _saveLoadRowCurPos += 6; + if (_saveLoadRowCurPos >= _numSaveGameRows) + _saveLoadRowCurPos = _numSaveGameRows; goto strange_jump; } @@ -1427,37 +1427,37 @@ start_over_2:; // Down Arrow to move down slots // X to exit start_over_3:; - if (_saveload_flag) { + if (_saveLoadFlag) { *b = false; delay(1); - return _key_pressed; + return _keyPressed; } - if (_key_pressed == 17) { - if (_saveload_row_curpos == 1) + if (_keyPressed == 17) { + if (_saveLoadRowCurPos == 1) goto start_over_3; - if (_saveload_row_curpos < 7) - _saveload_row_curpos = 1; + if (_saveLoadRowCurPos < 7) + _saveLoadRowCurPos = 1; else - _saveload_row_curpos -= 6; + _saveLoadRowCurPos -= 6; goto strange_jump; } - if (_key_pressed == 18) { - if (!_savedialog_flag) + if (_keyPressed == 18) { + if (!_saveDialogFlag) goto start_over_3; - _saveload_row_curpos += 6; - if (_saveload_row_curpos >= _num_savegame_rows) - _saveload_row_curpos = _num_savegame_rows; + _saveLoadRowCurPos += 6; + if (_saveLoadRowCurPos >= _numSaveGameRows) + _saveLoadRowCurPos = _numSaveGameRows; goto strange_jump; } - if (_key_pressed == 120) + if (_keyPressed == 120) return 205; - if (_key_pressed > 48 && _key_pressed < 55) { - return _key_pressed - 49; + if (_keyPressed > 48 && _keyPressed < 55) { + return _keyPressed - 49; } @@ -1509,13 +1509,13 @@ void SimonEngine::o_play_music_resource() { int loop = getVarOrByte(); midi.setLoop (loop != 0); - if (_last_music_played != music) - _next_music_to_play = music; + if (_lastMusicPlayed != music) + _nextMusicToPlay = music; else midi.startTrack (track); } else { - if (music != _last_music_played) { - _last_music_played = music; + if (music != _lastMusicPlayed) { + _lastMusicPlayed = music; loadMusic (music); midi.startTrack (track); } @@ -1525,15 +1525,15 @@ void SimonEngine::o_play_music_resource() { void SimonEngine::o_unk_120(uint a) { uint16 id = TO_BE_16(a); if (_game & GF_SIMON2) { - _lock_word |= 0x8000; - _vc_ptr = (byte *)&id; + _lockWord |= 0x8000; + _vcPtr = (byte *)&id; vc_15_wakeup_id(); - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } else { - _lock_word |= 0x4000; - _vc_ptr = (byte *)&id; + _lockWord |= 0x4000; + _vcPtr = (byte *)&id; vc_15_wakeup_id(); - _lock_word &= ~0x4000; + _lockWord &= ~0x4000; } } @@ -1545,22 +1545,22 @@ void SimonEngine::o_play_sound(uint sound_id) { } void SimonEngine::o_unk_160(uint a) { - fcs_setTextColor(_fcs_ptr_array_3[_fcs_unk_1], a); + fcs_setTextColor(_fcsPtrArray3[_fcsUnk1], a); } void SimonEngine::o_unk_103() { lock(); - fcs_unk1(_fcs_unk_1); + fcs_unk1(_fcsUnk1); showMessageFormat("\x0C"); unlock(); } void SimonEngine::o_kill_sprite_simon1(uint a) { uint16 b = TO_BE_16(a); - _lock_word |= 0x4000; - _vc_ptr = (byte *)&b; + _lockWord |= 0x4000; + _vcPtr = (byte *)&b; vc_60_kill_sprite(); - _lock_word &= ~0x4000; + _lockWord &= ~0x4000; } void SimonEngine::o_kill_sprite_simon2(uint a, uint b) { @@ -1569,24 +1569,24 @@ void SimonEngine::o_kill_sprite_simon2(uint a, uint b) { items[0] = TO_BE_16(a); items[1] = TO_BE_16(b); - _lock_word |= 0x8000; - _vc_ptr = (byte *)&items; + _lockWord |= 0x8000; + _vcPtr = (byte *)&items; vc_60_kill_sprite(); - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } /* OK */ void SimonEngine::o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h) { a &= 7; - if (_fcs_ptr_array_3[a]) + if (_fcsPtrArray3[a]) fcs_delete(a); - _fcs_ptr_array_3[a] = fcs_alloc(b, c, d, e, f, g, h); + _fcsPtrArray3[a] = fcs_alloc(b, c, d, e, f, g, h); - if (a == _fcs_unk_1) { - _fcs_ptr_1 = _fcs_ptr_array_3[a]; - showmessage_helper_3(_fcs_ptr_1->textLength, _fcs_ptr_1->textMaxLength); + if (a == _fcsUnk1) { + _fcsPtr1 = _fcsPtrArray3[a]; + showmessage_helper_3(_fcsPtr1->textLength, _fcsPtr1->textMaxLength); } } diff --git a/simon/res.cpp b/simon/res.cpp index 420fdc7d47..0174a8ba17 100644 --- a/simon/res.cpp +++ b/simon/res.cpp @@ -120,7 +120,7 @@ void SimonEngine::loadGamePcFile(const char *filename) { readGamePcText(&in); for (i = 2; i < num_inited_objects; i++) { - readItemFromGamePc(&in, _itemarray_ptr[i]); + readItemFromGamePc(&in, _itemArrayPtr[i]); } readSubroutineBlock(&in); @@ -137,16 +137,16 @@ void SimonEngine::loadGamePcFile(const char *filename) { file_size = in.size(); - _tbl_list = (byte *)malloc(file_size); - if (_tbl_list == NULL) + _tblList = (byte *)malloc(file_size); + if (_tblList == NULL) error("Out of memory for strip table list"); - in.read(_tbl_list, file_size); + in.read(_tblList, file_size); in.close(); /* Remember the current state */ - _subroutine_list_org = _subroutine_list; - _tablesheap_ptr_org = _tablesheap_ptr; - _tablesheap_curpos_org = _tablesheap_curpos; + _subroutineListOrg = _subroutineList; + _tablesHeapPtrOrg = _tablesHeapPtr; + _tablesHeapCurPosOrg = _tablesHeapCurPos; /* Read list of TEXT resources */ if (_game == GAME_SIMON1ACORN) @@ -157,10 +157,10 @@ void SimonEngine::loadGamePcFile(const char *filename) { error("Can't open text resources file 'STRIPPED.TXT'"); file_size = in.size(); - _stripped_txt_mem = (byte *)malloc(file_size); - if (_stripped_txt_mem == NULL) + _strippedTxtMem = (byte *)malloc(file_size); + if (_strippedTxtMem == NULL) error("Out of memory for strip text list"); - in.read(_stripped_txt_mem, file_size); + in.read(_strippedTxtMem, file_size); in.close(); } @@ -168,14 +168,14 @@ void SimonEngine::readGamePcText(File *in) { uint text_size; byte *text_mem; - _text_size = text_size = in->readUint32BE(); + _textSize = text_size = in->readUint32BE(); text_mem = (byte *)malloc(text_size); if (text_mem == NULL) error("Out of text memory"); in->read(text_mem, text_size); - setupStringTable(text_mem, _stringtab_num); + setupStringTable(text_mem, _stringTabNum); } void SimonEngine::readItemFromGamePc(File *in, Item *item) { diff --git a/simon/saveload.cpp b/simon/saveload.cpp index 658b4c5c6b..0820a2eed5 100644 --- a/simon/saveload.cpp +++ b/simon/saveload.cpp @@ -115,7 +115,7 @@ void SimonEngine::quick_load_or_save() { char buf[50]; char *filename = gen_savename(_saveLoadSlot); - if (_saveLoadFlag == 2) { + if (_saveLoadType == 2) { Subroutine *sub; success = load_game(_saveLoadSlot); if (!success) { @@ -140,14 +140,14 @@ void SimonEngine::quick_load_or_save() { GUI::MessageDialog dialog(buf, "OK"); dialog.runModal(); - } else if (_saveLoadFlag == 1) { + } else if (_saveLoadType == 1) { sprintf(buf, "Successfully saved game state in file:\n\n%s", filename); GUI::TimedMessageDialog dialog(buf, 1500); dialog.runModal(); } - _saveLoadFlag = 0; + _saveLoadType = 0; } void SimonEngine::savegame_dialog(char *buf) { @@ -155,15 +155,15 @@ void SimonEngine::savegame_dialog(char *buf) { o_unk_132_helper_3(); - i = display_savegame_list(_saveload_row_curpos, _save_or_load, buf); + i = display_savegame_list(_saveLoadRowCurPos, _saveOrLoad, buf); - _savedialog_flag = true; + _saveDialogFlag = true; if (i != 7) { i++; - if (!_save_or_load) + if (!_saveOrLoad) i++; - _savedialog_flag = false; + _saveDialogFlag = false; } if (!--i) @@ -185,11 +185,11 @@ void SimonEngine::save_or_load_dialog(bool load) { bool b; char buf[108]; - _save_or_load = load; + _saveOrLoad = load; save_time = time(NULL); - _copy_partial_mode = 1; + _copyPartialMode = 1; number_of_savegames = count_savegames(); if (!load) @@ -198,13 +198,13 @@ void SimonEngine::save_or_load_dialog(bool load) { if (number_of_savegames < 0) number_of_savegames = 0; number_of_savegames++; - _num_savegame_rows = number_of_savegames; + _numSaveGameRows = number_of_savegames; - _saveload_row_curpos = 1; + _saveLoadRowCurPos = 1; if (!load) - _saveload_row_curpos = number_of_savegames; + _saveLoadRowCurPos = number_of_savegames; - _saveload_flag = false; + _saveLoadFlag = false; restart:; do { @@ -223,7 +223,7 @@ restart:; // some code here - fcs = _fcs_ptr_array_3[5]; + fcs = _fcsPtrArray3[5]; fcs->textRow = unk132_result; @@ -272,7 +272,7 @@ restart:; for (;;) { video_putchar(fcs, 0x7f); - _saveload_flag = true; + _saveLoadFlag = true; // do_2 do { @@ -282,22 +282,22 @@ restart:; if (i == 205) goto get_out; clear_hitarea_bit_0x40(0xd0 + unk132_result); - if (_saveload_flag) { - o_clear_character(_fcs_ptr_array_3[5], 8); + if (_saveLoadFlag) { + o_clear_character(_fcsPtrArray3[5], 8); // move code } goto if_1; } // is_not_b - if (!_saveload_flag) { + if (!_saveLoadFlag) { clear_hitarea_bit_0x40(0xd0 + unk132_result); goto restart; } } while (i >= 0x80 || i == 0); // after_do_2 - o_clear_character(_fcs_ptr_array_3[5], 8); + o_clear_character(_fcsPtrArray3[5], 8); if (i == 10 || i == 13) break; if (i == 8) { @@ -316,35 +316,35 @@ restart:; name[name_len] = 0; - o_clear_character(_fcs_ptr_array_3[5], x, m); + o_clear_character(_fcsPtrArray3[5], x, m); } } else if (i >= 32 && name_len != 17) { name[name_len++] = i; - video_putchar(_fcs_ptr_array_3[5], i); + video_putchar(_fcsPtrArray3[5], i); } } // do_save - if (!save_game(_saveload_row_curpos + unk132_result, buf + unk132_result * 18)) - o_file_error(_fcs_ptr_array_3[5], true); + if (!save_game(_saveLoadRowCurPos + unk132_result, buf + unk132_result * 18)) + o_file_error(_fcsPtrArray3[5], true); } else { - if (!load_game(_saveload_row_curpos + i)) - o_file_error(_fcs_ptr_array_3[5], false); + if (!load_game(_saveLoadRowCurPos + i)) + o_file_error(_fcsPtrArray3[5], false); } get_out:; o_unk_132_helper_3(); _base_time = time(NULL) - save_time + _base_time; - _copy_partial_mode = 0; + _copyPartialMode = 0; dx_copy_rgn_from_3_to_2(94, 208, 46, 80); - i = _timer_4; + i = _timer4; do { delay(10); - } while (i == _timer_4); + } while (i == _timer4); g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false); } @@ -385,13 +385,13 @@ void SimonEngine::o_file_error(FillOrCopyStruct *fcs, bool save_error) { ha->layer = 0x3EF; loop:; - _last_hitarea = _last_hitarea_3 = 0; + _lastHitArea = _lastHitArea3 = 0; do { delay(1); - } while (_last_hitarea_3 == 0); + } while (_lastHitArea3 == 0); - ha = _last_hitarea; + ha = _lastHitArea; if (ha == NULL || ha->id != 0x7FFF) goto loop; @@ -404,34 +404,34 @@ bool SimonEngine::save_game(uint slot, char *caption) { uint item_index, num_item, i, j; TimeEvent *te; - _lock_word |= 0x100; + _lockWord |= 0x100; f = _saveFileMan->openForSaving(gen_savename(slot)); if (f == NULL) { - _lock_word &= ~0x100; + _lockWord &= ~0x100; return false; } f->write(caption, 0x12); - f->writeUint32BE(_itemarray_inited - 1); + f->writeUint32BE(_itemArrayInited - 1); f->writeUint32BE(0xFFFFFFFF); f->writeUint32BE(0); f->writeUint32BE(0); i = 0; - for (te = _first_time_struct; te; te = te->next) + for (te = _firstTimeStruct; te; te = te->next) i++; f->writeUint32BE(i); - for (te = _first_time_struct; te; te = te->next) { + for (te = _firstTimeStruct; te; te = te->next) { f->writeUint32BE(te->time + _base_time); f->writeUint16BE(te->subroutine_id); } item_index = 1; - for (num_item = _itemarray_inited - 1; num_item; num_item--) { - Item *item = _itemarray_ptr[item_index++]; + for (num_item = _itemArrayInited - 1; num_item; num_item--) { + Item *item = _itemArrayPtr[item_index++]; f->writeUint16BE(item->parent); f->writeUint16BE(item->sibling); @@ -470,16 +470,16 @@ bool SimonEngine::save_game(uint slot, char *caption) { // write the items in array 6 for (i = 0; i != 10; i++) { - f->writeUint16BE(itemPtrToID(_item_array_6[i])); + f->writeUint16BE(itemPtrToID(_itemArray6[i])); } // Write the bits in array 1 & 2 for (i = 0; i != 32; i++) - f->writeUint16BE(_bit_array[i]); + f->writeUint16BE(_bitArray[i]); delete f; - _lock_word &= ~0x100; + _lockWord &= ~0x100; return true; } @@ -500,11 +500,11 @@ bool SimonEngine::load_game(uint slot) { InSaveFile *f; uint num, item_index, i, j; - _lock_word |= 0x100; + _lockWord |= 0x100; f = _saveFileMan->openForLoading(gen_savename(slot)); if (f == NULL) { - _lock_word &= ~0x100; + _lockWord &= ~0x100; return false; } @@ -512,15 +512,15 @@ bool SimonEngine::load_game(uint slot) { num = f->readUint32BE(); - if (f->readUint32BE() != 0xFFFFFFFF || num != _itemarray_inited - 1) { + if (f->readUint32BE() != 0xFFFFFFFF || num != _itemArrayInited - 1) { delete f; - _lock_word &= ~0x100; + _lockWord &= ~0x100; return false; } f->readUint32BE(); f->readUint32BE(); - _no_parent_notify = true; + _noParentNotify = true; // add all timers @@ -532,8 +532,8 @@ bool SimonEngine::load_game(uint slot) { } item_index = 1; - for (num = _itemarray_inited - 1; num; num--) { - Item *item = _itemarray_ptr[item_index++], *parent_item; + for (num = _itemArrayInited - 1; num; num--) { + Item *item = _itemArrayPtr[item_index++], *parent_item; uint parent = f->readUint16BE(); uint sibling = f->readUint16BE(); @@ -583,12 +583,12 @@ bool SimonEngine::load_game(uint slot) { // write the items in array 6 for (i = 0; i != 10; i++) { - _item_array_6[i] = derefItem(f->readUint16BE()); + _itemArray6[i] = derefItem(f->readUint16BE()); } // Write the bits in array 1 & 2 for (i = 0; i != 32; i++) - _bit_array[i] = f->readUint16BE(); + _bitArray[i] = f->readUint16BE(); if (f->ioFailed()) { error("load failed"); @@ -596,9 +596,9 @@ bool SimonEngine::load_game(uint slot) { delete f; - _no_parent_notify = false; + _noParentNotify = false; - _lock_word &= ~0x100; + _lockWord &= ~0x100; return true; } diff --git a/simon/simon.cpp b/simon/simon.cpp index c569407edd..e3427f89aa 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -261,9 +261,9 @@ static const GameSpecificSettings simon2dos_settings = { SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) : Engine(syst), midi(syst) { - _vc_ptr = 0; + _vcPtr = 0; _vc_get_out_of_code = 0; - _game_offsets_ptr = 0; + _gameOffsetsPtr = 0; const SimonGameSettings *g = simon_settings; while (g->name) { @@ -409,254 +409,248 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) } } - _key_pressed = 0; + _keyPressed = 0; - _game_file = 0; + _gameFile = 0; - _stripped_txt_mem = 0; - _text_size = 0; - _stringtab_num = 0; - _stringtab_pos = 0; + _strippedTxtMem = 0; + _textSize = 0; + _stringTabNum = 0; + _stringTabPos = 0; _stringtab_numalloc = 0; - _stringtab_ptr = 0; + _stringTabPtr = 0; - _itemarray_ptr = 0; - _itemarray_size = 0; - _itemarray_inited = 0; + _itemArrayPtr = 0; + _itemArraySize = 0; + _itemArrayInited = 0; - _itemheap_ptr = 0; - _itemheap_curpos = 0; - _itemheap_size = 0; + _itemHeapPtr = 0; + _itemHeapCurPos = 0; + _itemHeapSize = 0; - _icon_file_ptr = 0; + _iconFilePtr = 0; - _tbl_list = 0; + _tblList = 0; - _code_ptr = 0; + _codePtr = 0; + _localStringtable = 0; + _stringIdLocalMin = 1; + _stringIdLocalMax = 0; - _local_stringtable = 0; - _string_id_local_min = 1; - _string_id_local_max = 0; + _tablesHeapPtr = 0; + _tablesHeapPtrOrg = 0; + _tablesheapPtrNew = 0; + _tablesHeapSize = 0; + _tablesHeapCurPos = 0; + _tablesHeapCurPosOrg = 0; + _tablesHeapCurPosNew = 0; - _tablesheap_ptr = 0; - _tablesheap_ptr_org = 0; - _tablesheap_ptr_new = 0; - _tablesheap_size = 0; - _tablesheap_curpos = 0; - _tablesheap_curpos_org = 0; - _tablesheap_curpos_new = 0; - - _subroutine_list = 0; - _subroutine_list_org = 0; + _subroutineList = 0; + _subroutineListOrg = 0; _subroutine = 0; - _dx_surface_pitch = 0; + _dxSurfacePitch = 0; - _recursion_depth = 0; + _recursionDepth = 0; - _last_vga_tick = 0; + _lastVgaTick = 0; - _op_189_flags = 0; + _op189Flags = 0; - _scriptvar_2 = 0; - _run_script_return_1 = 0; - _skip_vga_wait = 0; - _no_parent_notify = 0; - _vga_res_328_loaded = 0; + _scriptVar2 = 0; + _runScriptReturn1 = 0; + _skipVgaWait = 0; + _noParentNotify = 0; + _vgaRes328Loaded = 0; _hitarea_unk_3 = 0; - _mortal_flag = 0; - _sync_flag_1 = 0; - _video_var_8 = 0; - _use_palette_delay = 0; - _sync_flag_2 = 0; - _in_callback = 0; - _cepe_flag = 0; - _copy_partial_mode = 0; + _mortalFlag = 0; + _videoVar8 = 0; + _usePaletteDelay = 0; + _syncFlag2 = 0; + _inCallBack = 0; + _cepeFlag = 0; + _copyPartialMode = 0; _speed = 1; - _fast_mode = 0; - _dx_use_3_or_4_for_lock = 0; + _fastMode = 0; + _dxUse3Or4ForLock = 0; _debugMode = 0; _pause = 0; - _start_mainscript = 0; - _continous_mainscript = 0; - _start_vgascript = 0; - _continous_vgascript = 0; - _draw_images_debug = 0; - _dump_images = 0; + _startMainScript = 0; + _continousMainScript = 0; + _startVgaScript = 0; + _continousVgaScript = 0; + _drawImagesDebug = 0; + _dumpImages = 0; _speech = true; _subtitles = true; _fade = true; - _mouse_cursor = 0; - _vga_var9 = 0; - _script_unk_1 = 0; - _vga_var6 = 0; - _x_scroll = 0; - _vga_var1 = 0; - _vga_var2 = 0; - _xscroll_step = 0; - _sprite_height = 0; - _vga_var7 = 0; - _vga_var8 = 0; - - _script_cond_a = 0; - _script_cond_b = 0; - _script_cond_c = 0; - - _fcs_unk_1 = 0; - _fcs_ptr_1 = 0; - - _subject_item = 0; - _object_item = 0; - _item_1 = 0; - - _hitarea_object_item = 0; - _last_hitarea = 0; - _last_hitarea_2_ptr = 0; - _last_hitarea_3 = 0; - _left_button_down = 0; - _hitarea_subject_item = 0; - _hitarea_ptr_5 = 0; - _hitarea_ptr_7 = 0; - _need_hitarea_recalc = 0; - _verb_hitarea = 0; - _hitarea_unk_4 = 0; - _lock_counter = 0; - - _video_palette_mode = 0; - - _print_char_unk_1 = 0; - _print_char_unk_2 = 0; - _num_letters_to_print = 0; - - _last_time = 0; - - _first_time_struct = 0; - _pending_delete_time_event = 0; + _mouseCursor = 0; + _vgaVar9 = 0; + _scriptUnk1 = 0; + _vgaVar6 = 0; + _xScroll = 0; + _vgaVar1 = 0; + _vgaVar2 = 0; + _xScrollStep = 0; + _spriteHeight = 0; + _vgaVar7 = 0; + _vgaVar8 = 0; + + _scriptCondA = 0; + _scriptCondB = 0; + _scriptCondC = 0; + + _fcsUnk1 = 0; + _fcsPtr1 = 0; + + _subjectItem = 0; + _objectItem = 0; + _item1 = 0; + + _hitAreaObjectItem = 0; + _lastHitArea = 0; + _lastHitArea2Ptr = 0; + _lastHitArea3 = 0; + _leftButtonDown = 0; + _hitAreaSubjectItem = 0; + _hitAreaPtr5 = 0; + _hitAreaPtr7 = 0; + _needHitAreaRecalc = 0; + _verbHitArea = 0; + _hitAreaUnk4 = 0; + _lockCounter = 0; + + _videoPaletteMode = 0; + + _printCharUnk1 = 0; + _printCharUnk2 = 0; + _numLettersToPrint = 0; + + _lastTime = 0; + + _firstTimeStruct = 0; + _pendingDeleteTimeEvent = 0; _base_time = 0; - _mouse_x = 0; - _mouse_y = 0; - _mouse_x_old = 0; - _mouse_y_old = 0; + _mouseX = 0; + _mouseY = 0; + _mouseXOld = 0; + _mouseYOld = 0; - _dummy_item_1 = new Item(); - _dummy_item_2 = new Item(); - _dummy_item_3 = new Item(); - - _lock_word = 0; - _scroll_up_hit_area = 0; - _scroll_down_hit_area = 0; + _dummyItem1 = new Item(); + _dummyItem2 = new Item(); + _dummyItem3 = new Item(); - _video_var_7 = 0xFFFF; - _palette_color_count = 0; + _lockWord = 0; + _scrollUpHitArea = 0; + _scrollDownHitArea = 0; - _video_var_4 = 0; - _video_var_5 = 0; - _video_var_3 = 0; - _unk_pal_flag = 0; - _exit_cutscene = 0; - _skip_speech = 0; - _video_var_9 = 0; + _videoVar7 = 0xFFFF; + _paletteColorCount = 0; - _sound_file_id = 0; - _last_music_played = -1; - _next_music_to_play = -1; + _videoVar4 = 0; + _videoVar5 = 0; + _videoVar3 = 0; + _unkPalFlag = 0; + _exitCutscene = 0; + _skipSpeech = 0; + _videoVar9 = 0; - _show_preposition = 0; - _showmessage_flag = 0; + _soundFileId = 0; + _lastMusicPlayed = -1; + _nextMusicToPlay = -1; - _video_num_pal_colors = 0; + _showPreposition = 0; + _showMessageFlag = 0; - _invoke_timer_callback = 0; + _videoNumPalColors = 0; - _vga_sprite_changed = 0; + _vgaSpriteChanged = 0; - _vga_buf_free_start = 0; - _vga_buf_end = 0; - _vga_buf_start = 0; - _vga_file_buf_org = 0; - _vga_file_buf_org_2 = 0; + _vgaBufFreeStart = 0; + _vgaBufEnd = 0; + _vgaBufStart = 0; + _vgaFileBufOrg = 0; + _vgaFileBufOrg2 = 0; - _cur_vga_file_1 = 0; - _cur_vga_file_2 = 0; + _curVgaFile1 = 0; + _curVgaFile2 = 0; - _timer_1 = 0; - _timer_5 = 0; - _timer_4 = 0; + _timer1 = 0; + _timer5 = 0; + _timer4 = 0; - _vga_base_delay = 1; + _vgaBaseDelay = 1; - _vga_cur_file_2 = 0; - _vga_wait_for = 0; - _vga_cur_file_id = 0; - _vga_cur_sprite_id = 0; + _vgaCurFile2 = 0; + _vgaWaitFor = 0; + _vgaCurFileId = 0; + _vgaCurSpriteId = 0; - _next_vga_timer_to_process = 0; + _nextVgaTimerToProcess = 0; - memset(_vc_item_array, 0, sizeof(_vc_item_array)); - memset(_item_array_6, 0, sizeof(_item_array_6)); + memset(_vcItemArray, 0, sizeof(_vcItemArray)); + memset(_itemArray6, 0, sizeof(_itemArray6)); - memset(_stringid_array_2, 0, sizeof(_stringid_array_2)); - memset(_stringid_array_3, 0, sizeof(_stringid_array_3)); - memset(_speechid_array_4, 0, sizeof(_speechid_array_4)); + memset(_stringIdArray2, 0, sizeof(_stringIdArray2)); + memset(_stringIdArray3, 0, sizeof(_stringIdArray3)); + memset(_speechIdArray4, 0, sizeof(_speechIdArray4)); - memset(_bit_array, 0, sizeof(_bit_array)); + memset(_bitArray, 0, sizeof(_bitArray)); memset(_variableArray, 0, sizeof(_variableArray)); - memset(_fcs_ptr_array_3, 0, sizeof(_fcs_ptr_array_3)); + memset(_fcsPtrArray3, 0, sizeof(_fcsPtrArray3)); - memset(_fcs_data_1, 0, sizeof(_fcs_data_1)); - memset(_fcs_data_2, 0, sizeof(_fcs_data_2)); + memset(_fcsData1, 0, sizeof(_fcsData1)); + memset(_fcsData2, 0, sizeof(_fcsData2)); - _free_string_slot = 0; + _freeStringSlot = 0; memset(_stringReturnBuffer, 0, sizeof(_stringReturnBuffer)); - memset(_pathfind_array, 0, sizeof(_pathfind_array)); + memset(_pathFindArray, 0, sizeof(_pathFindArray)); - memset(_palette_backup, 0, sizeof(_palette_backup)); + memset(_paletteBackup, 0, sizeof(_paletteBackup)); memset(_palette, 0, sizeof(_palette)); - memset(_video_buf_1, 0, sizeof(_video_buf_1)); + memset(_videoBuf1, 0, sizeof(_videoBuf1)); _fcs_list = new FillOrCopyStruct[16]; - memset(_letters_to_print_buf, 0, sizeof(_letters_to_print_buf)); + memset(_lettersToPrintBuf, 0, sizeof(_lettersToPrintBuf)); - _num_screen_updates = 0; - _vga_tick_counter = 0; + _numScreenUpdates = 0; + _vgaTickCounter = 0; _sound = 0; - _effects_paused = false; - _ambient_paused = false; - _music_paused = false; - - _timer_id = 0; + _effectsPaused = false; + _ambientPaused = false; + _musicPaused = false; - _dump_file = 0; + _dumpFile = 0; - _saveLoadFlag = 0; + _saveLoadType = 0; _saveLoadSlot = 0; memset(_saveLoadName, 0, sizeof(_saveLoadName)); - _saveload_row_curpos = 0; - _num_savegame_rows = 0; - _savedialog_flag = false; - _save_or_load = false; - _saveload_flag = false; + _saveLoadRowCurPos = 0; + _numSaveGameRows = 0; + _saveDialogFlag = false; + _saveOrLoad = false; + _saveLoadFlag = false; - _sdl_mouse_x = 0; - _sdl_mouse_y = 0; + _sdlMouseX = 0; + _sdlMouseY = 0; _sdl_buf_3 = 0; _sdl_buf = 0; _sdl_buf_attached = 0; - _vc_10_base_ptr_old = 0; + _vc10BasePtrOld = 0; memcpy (_hebrew_char_widths, "\x5\x5\x4\x6\x5\x3\x4\x5\x6\x3\x5\x5\x4\x6\x5\x3\x4\x6\x5\x6\x6\x6\x5\x5\x5\x6\x5\x6\x6\x6\x6\x6", 32); } @@ -699,7 +693,7 @@ int SimonEngine::init(GameDetector &detector) { _debugMode = (gDebugLevel >= 0); if (ConfMan.hasKey("music_mute") && ConfMan.getBool("music_mute") == 1) - midi.pause(_music_paused ^= 1); + midi.pause(_musicPaused ^= 1); if ((_game & GF_SIMON2) && ConfMan.hasKey("speech_mute") && ConfMan.getBool("speech_mute") == 1) _speech = 0; @@ -727,21 +721,21 @@ int SimonEngine::init(GameDetector &detector) { } SimonEngine::~SimonEngine() { - delete _game_file; + delete _gameFile; midi.close(); - free(_stringtab_ptr); - free(_itemarray_ptr); - free(_itemheap_ptr - _itemheap_curpos); - free(_tablesheap_ptr - _tablesheap_curpos); - free(_tbl_list); - free(_icon_file_ptr); - free(_game_offsets_ptr); - - delete _dummy_item_1; - delete _dummy_item_2; - delete _dummy_item_3; + free(_stringTabPtr); + free(_itemArrayPtr); + free(_itemHeapPtr - _itemHeapCurPos); + free(_tablesHeapPtr - _tablesHeapCurPos); + free(_tblList); + free(_iconFilePtr); + free(_gameOffsetsPtr); + + delete _dummyItem1; + delete _dummyItem2; + delete _dummyItem3; delete [] _fcs_list; @@ -774,34 +768,34 @@ void palette_fadeout(uint32 *pal_values, uint num) { } byte *SimonEngine::allocateItem(uint size) { - byte *org = _itemheap_ptr; + byte *org = _itemHeapPtr; size = (size + 3) & ~3; - _itemheap_ptr += size; - _itemheap_curpos += size; + _itemHeapPtr += size; + _itemHeapCurPos += size; - if (_itemheap_curpos > _itemheap_size) + if (_itemHeapCurPos > _itemHeapSize) error("Itemheap overflow"); return org; } void SimonEngine::alignTableMem() { - if ((unsigned long)_tablesheap_ptr & 3) { - _tablesheap_ptr += 2; - _tablesheap_curpos += 2; + if ((unsigned long)_tablesHeapPtr & 3) { + _tablesHeapPtr += 2; + _tablesHeapCurPos += 2; } } byte *SimonEngine::allocateTable(uint size) { - byte *org = _tablesheap_ptr; + byte *org = _tablesHeapPtr; size = (size + 1) & ~1; - _tablesheap_ptr += size; - _tablesheap_curpos += size; + _tablesHeapPtr += size; + _tablesHeapCurPos += size; - if (_tablesheap_curpos > _tablesheap_size) + if (_tablesHeapCurPos > _tablesHeapSize) error("Tablesheap overflow"); return org; @@ -823,20 +817,20 @@ int SimonEngine::allocGamePcVars(File *in) { if (version != 0x80) error("Not a runtime database"); - _itemarray_ptr = (Item **)calloc(item_array_size, sizeof(Item *)); - if (_itemarray_ptr == NULL) + _itemArrayPtr = (Item **)calloc(item_array_size, sizeof(Item *)); + if (_itemArrayPtr == NULL) error("Out of memory for Item array"); - _itemarray_size = item_array_size; - _itemarray_inited = item_array_inited; + _itemArraySize = item_array_size; + _itemArrayInited = item_array_inited; for (i = 1; i < item_array_inited; i++) { - _itemarray_ptr[i] = (Item *)allocateItem(sizeof(Item)); + _itemArrayPtr[i] = (Item *)allocateItem(sizeof(Item)); } // The rest is cleared automatically by calloc allocateStringTable(stringtable_num + 10); - _stringtab_num = stringtable_num; + _stringTabNum = stringtable_num; return item_array_inited; } @@ -856,40 +850,40 @@ void SimonEngine::loginPlayerHelper(Item *item, int a, int b) { void SimonEngine::loginPlayer() { Child *child; - _item_1 = _itemarray_ptr[1]; - _item_1->unk2 = -1; - _item_1->unk1 = 10000; + _item1 = _itemArrayPtr[1]; + _item1->unk2 = -1; + _item1->unk1 = 10000; - child = (Child *)allocateChildBlock(_item_1, 3, sizeof(Child)); + child = (Child *)allocateChildBlock(_item1, 3, sizeof(Child)); if (child == NULL) error("player create failure"); - loginPlayerHelper(_item_1, 0, 0); + loginPlayerHelper(_item1, 0, 0); } void SimonEngine::allocateStringTable(int num) { - _stringtab_ptr = (byte **)calloc(num, sizeof(byte *)); - _stringtab_pos = 0; + _stringTabPtr = (byte **)calloc(num, sizeof(byte *)); + _stringTabPos = 0; _stringtab_numalloc = num; } void SimonEngine::setupStringTable(byte *mem, int num) { int i = 0; for (;;) { - _stringtab_ptr[i++] = mem; + _stringTabPtr[i++] = mem; if (--num == 0) break; for (; *mem; mem++); mem++; } - _stringtab_pos = i; + _stringTabPos = i; } void SimonEngine::setupLocalStringTable(byte *mem, int num) { int i = 0; for (;;) { - _local_stringtable[i++] = mem; + _localStringtable[i++] = mem; if (--num == 0) break; for (; *mem; mem++); @@ -967,8 +961,8 @@ Subroutine *SimonEngine::createSubroutine(uint id) { sub = (Subroutine *)allocateTable(sizeof(Subroutine)); sub->id = id; sub->first = 0; - sub->next = _subroutine_list; - _subroutine_list = sub; + sub->next = _subroutineList; + _subroutineList = sub; return sub; } @@ -1014,15 +1008,15 @@ Child *SimonEngine::allocateChildBlock(Item *i, uint type, uint size) { } void SimonEngine::allocItemHeap() { - _itemheap_size = 10000; - _itemheap_curpos = 0; - _itemheap_ptr = (byte *)calloc(10000, 1); + _itemHeapSize = 10000; + _itemHeapCurPos = 0; + _itemHeapPtr = (byte *)calloc(10000, 1); } void SimonEngine::allocTablesHeap() { - _tablesheap_size = TABLES_MEM_SIZE; - _tablesheap_curpos = 0; - _tablesheap_ptr = (byte *)calloc(TABLES_MEM_SIZE, 1); + _tablesHeapSize = TABLES_MEM_SIZE; + _tablesHeapCurPos = 0; + _tablesHeapPtr = (byte *)calloc(TABLES_MEM_SIZE, 1); } void SimonEngine::setItemUnk3(Item *item, int value) { @@ -1030,8 +1024,8 @@ void SimonEngine::setItemUnk3(Item *item, int value) { } int SimonEngine::getNextWord() { - int16 a = (int16)READ_BE_UINT16(_code_ptr); - _code_ptr += 2; + int16 a = (int16)READ_BE_UINT16(_codePtr); + _codePtr += 2; return a; } @@ -1040,15 +1034,15 @@ uint SimonEngine::getNextStringID() { } uint SimonEngine::getVarOrByte() { - uint a = *_code_ptr++; + uint a = *_codePtr++; if (a != 255) return a; - return readVariable(*_code_ptr++); + return readVariable(*_codePtr++); } uint SimonEngine::getVarOrWord() { - uint a = READ_BE_UINT16(_code_ptr); - _code_ptr += 2; + uint a = READ_BE_UINT16(_codePtr); + _codePtr += 2; if (a >= 30000 && a < 30512) return readVariable(a - 30000); return a; @@ -1058,9 +1052,9 @@ Item *SimonEngine::getNextItemPtr() { int a = getNextWord(); switch (a) { case -1: - return _subject_item; + return _subjectItem; case -3: - return _object_item; + return _objectItem; case -5: return getItem1Ptr(); case -7: @@ -1076,15 +1070,15 @@ Item *SimonEngine::getNextItemPtrStrange() { int a = getNextWord(); switch (a) { case -1: - return _subject_item; + return _subjectItem; case -3: - return _object_item; + return _objectItem; case -5: - return _dummy_item_2; + return _dummyItem2; case -7: return NULL; case -9: - return _dummy_item_3; + return _dummyItem3; default: return derefItem(a); } @@ -1094,9 +1088,9 @@ uint SimonEngine::getNextItemID() { int a = getNextWord(); switch (a) { case -1: - return itemPtrToID(_subject_item); + return itemPtrToID(_subjectItem); case -3: - return itemPtrToID(_object_item); + return itemPtrToID(_objectItem); case -5: return getItem1ID(); case -7: @@ -1109,14 +1103,14 @@ uint SimonEngine::getNextItemID() { } Item *SimonEngine::getItem1Ptr() { - if (_item_1) - return _item_1; - return _dummy_item_1; + if (_item1) + return _item1; + return _dummyItem1; } Item *SimonEngine::getItemPtrB() { error("getItemPtrB: is this code ever used?"); - return _dummy_item_1; + return _dummyItem1; } uint SimonEngine::getNextVarContents() { @@ -1157,18 +1151,18 @@ void SimonEngine::itemChildrenChanged(Item *item) { int i; FillOrCopyStruct *fcs; - if (_no_parent_notify) + if (_noParentNotify) return; lock(); for (i = 0; i != 8; i++) { - fcs = _fcs_ptr_array_3[i]; + fcs = _fcsPtrArray3[i]; if (fcs && fcs->fcs_data && fcs->fcs_data->item_ptr == item) { - if (_fcs_data_1[i]) { - _fcs_data_2[i] = true; + if (_fcsData1[i]) { + _fcsData2[i] = true; } else { - _fcs_data_2[i] = false; + _fcsData2[i] = false; fcs_unk_proc_1(i, item, fcs->fcs_data->unk1, fcs->fcs_data->unk2); } } @@ -1234,24 +1228,24 @@ const byte *SimonEngine::getStringPtrByID(uint string_id) { const byte *string_ptr; byte *dst; - _free_string_slot ^= 1; + _freeStringSlot ^= 1; if (string_id < 0x8000) { - string_ptr = _stringtab_ptr[string_id]; + string_ptr = _stringTabPtr[string_id]; } else { string_ptr = getLocalStringByID(string_id); } - dst = _stringReturnBuffer[_free_string_slot]; + dst = _stringReturnBuffer[_freeStringSlot]; strcpy((char *)dst, (const char *)string_ptr); return dst; } const byte *SimonEngine::getLocalStringByID(uint string_id) { - if (string_id < _string_id_local_min || string_id >= _string_id_local_max) { + if (string_id < _stringIdLocalMin || string_id >= _stringIdLocalMax) { loadTextIntoMem(string_id); } - return _local_stringtable[string_id - _string_id_local_min]; + return _localStringtable[string_id - _stringIdLocalMin]; } void SimonEngine::loadTextIntoMem(uint string_id) { @@ -1260,10 +1254,10 @@ void SimonEngine::loadTextIntoMem(uint string_id) { int i; uint base_min = 0x8000, base_max, size; - _tablesheap_ptr = _tablesheap_ptr_new; - _tablesheap_curpos = _tablesheap_curpos_new; + _tablesHeapPtr = _tablesheapPtrNew; + _tablesHeapCurPos = _tablesHeapCurPosNew; - p = _stripped_txt_mem; + p = _strippedTxtMem; // get filename while (*p) { @@ -1276,23 +1270,23 @@ void SimonEngine::loadTextIntoMem(uint string_id) { p += 2; if (string_id < base_max) { - _string_id_local_min = base_min; - _string_id_local_max = base_max; + _stringIdLocalMin = base_min; + _stringIdLocalMax = base_max; - _local_stringtable = (byte **)_tablesheap_ptr; + _localStringtable = (byte **)_tablesHeapPtr; size = (base_max - base_min + 1) * sizeof(byte *); - _tablesheap_ptr += size; - _tablesheap_curpos += size; + _tablesHeapPtr += size; + _tablesHeapCurPos += size; - size = loadTextFile(filename, _tablesheap_ptr); + size = loadTextFile(filename, _tablesHeapPtr); - setupLocalStringTable(_tablesheap_ptr, base_max - base_min + 1); + setupLocalStringTable(_tablesHeapPtr, base_max - base_min + 1); - _tablesheap_ptr += size; - _tablesheap_curpos += size; + _tablesHeapPtr += size; + _tablesHeapCurPos += size; - if (_tablesheap_curpos > _tablesheap_size) { + if (_tablesHeapCurPos > _tablesHeapSize) { error("loadTextIntoMem: Out of table memory"); } return; @@ -1311,7 +1305,7 @@ void SimonEngine::loadTablesIntoMem(uint subr_id) { char filename[30]; File *in; - p = _tbl_list; + p = _tblList; if (p == NULL) return; @@ -1332,18 +1326,18 @@ void SimonEngine::loadTablesIntoMem(uint subr_id) { p += 2; if (subr_id >= min_num && subr_id <= max_num) { - _subroutine_list = _subroutine_list_org; - _tablesheap_ptr = _tablesheap_ptr_org; - _tablesheap_curpos = _tablesheap_curpos_org; - _string_id_local_min = 1; - _string_id_local_max = 0; + _subroutineList = _subroutineListOrg; + _tablesHeapPtr = _tablesHeapPtrOrg; + _tablesHeapCurPos = _tablesHeapCurPosOrg; + _stringIdLocalMin = 1; + _stringIdLocalMax = 0; in = openTablesFile(filename); readSubroutineBlock(in); closeTablesFile(in); if (_game & GF_SIMON2) { - _sound->loadSfxTable(_game_file, _game_offsets_ptr[atoi(filename + 6) - 1 + SOUND_INDEX_BASE]); + _sound->loadSfxTable(_gameFile, _gameOffsetsPtr[atoi(filename + 6) - 1 + SOUND_INDEX_BASE]); } else if (_game & GF_WIN) { memcpy(filename, "SFXXXX", 6); _sound->readSfxFile(filename); @@ -1351,10 +1345,10 @@ void SimonEngine::loadTablesIntoMem(uint subr_id) { alignTableMem(); - _tablesheap_ptr_new = _tablesheap_ptr; - _tablesheap_curpos_new = _tablesheap_curpos; + _tablesheapPtrNew = _tablesHeapPtr; + _tablesHeapCurPosNew = _tablesHeapCurPos; - if (_tablesheap_curpos > _tablesheap_size) + if (_tablesHeapCurPos > _tablesHeapSize) error("loadTablesIntoMem: Out of table memory"); return; } @@ -1373,7 +1367,7 @@ void SimonEngine::playSting(uint a) { File mus_file; uint16 mus_offset; - sprintf(filename, "STINGS%i.MUS", _sound_file_id); + sprintf(filename, "STINGS%i.MUS", _soundFileId); mus_file.open(filename); if (!mus_file.isOpen()) { warning("Can't load sound effect from '%s'", filename); @@ -1395,14 +1389,14 @@ Subroutine *SimonEngine::getSubroutineByID(uint subroutine_id) { _subroutine = subroutine_id; - for (cur = _subroutine_list; cur; cur = cur->next) { + for (cur = _subroutineList; cur; cur = cur->next) { if (cur->id == subroutine_id) return cur; } loadTablesIntoMem(subroutine_id); - for (cur = _subroutine_list; cur; cur = cur->next) { + for (cur = _subroutineList; cur; cur = cur->next) { if (cur->id == subroutine_id) return cur; } @@ -1417,8 +1411,8 @@ uint SimonEngine::loadTextFile_gme(const char *filename, byte *dst) { uint32 size; res = atoi(filename + 4) + TEXT_INDEX_BASE - 1; - offs = _game_offsets_ptr[res]; - size = _game_offsets_ptr[res + 1] - offs; + offs = _gameOffsetsPtr[res]; + size = _gameOffsetsPtr[res + 1] - offs; resfile_read(dst, offs, size); @@ -1430,10 +1424,10 @@ File *SimonEngine::openTablesFile_gme(const char *filename) { uint32 offs; res = atoi(filename + 6) + TABLE_INDEX_BASE - 1; - offs = _game_offsets_ptr[res]; + offs = _gameOffsetsPtr[res]; - _game_file->seek(offs, SEEK_SET); - return _game_file; + _gameFile->seek(offs, SEEK_SET); + return _gameFile; } uint SimonEngine::loadTextFile_simon1(const char *filename, byte *dst) { @@ -1491,7 +1485,7 @@ void SimonEngine::addTimeEvent(uint timeout, uint subroutine_id) { te->time = cur_time + timeout - _base_time; te->subroutine_id = subroutine_id; - first = _first_time_struct; + first = _firstTimeStruct; while (first) { if (te->time <= first->time) { if (last) { @@ -1499,8 +1493,8 @@ void SimonEngine::addTimeEvent(uint timeout, uint subroutine_id) { te->next = first; return; } - te->next = _first_time_struct; - _first_time_struct = te; + te->next = _firstTimeStruct; + _firstTimeStruct = te; return; } @@ -1512,7 +1506,7 @@ void SimonEngine::addTimeEvent(uint timeout, uint subroutine_id) { last->next = te; te->next = NULL; } else { - _first_time_struct = te; + _firstTimeStruct = te; te->next = NULL; } } @@ -1520,16 +1514,16 @@ void SimonEngine::addTimeEvent(uint timeout, uint subroutine_id) { void SimonEngine::delTimeEvent(TimeEvent *te) { TimeEvent *cur; - if (te == _pending_delete_time_event) - _pending_delete_time_event = NULL; + if (te == _pendingDeleteTimeEvent) + _pendingDeleteTimeEvent = NULL; - if (te == _first_time_struct) { - _first_time_struct = te->next; + if (te == _firstTimeStruct) { + _firstTimeStruct = te->next; free(te); return; } - cur = _first_time_struct; + cur = _firstTimeStruct; if (cur == NULL) error("delTimeEvent: none available"); @@ -1548,7 +1542,7 @@ void SimonEngine::delTimeEvent(TimeEvent *te) { void SimonEngine::killAllTimers() { TimeEvent *cur, *next; - for (cur = _first_time_struct; cur; cur = next) { + for (cur = _firstTimeStruct; cur; cur = next) { next = cur->next; delTimeEvent(cur); } @@ -1562,12 +1556,12 @@ bool SimonEngine::kickoffTimeEvents() { time(&cur_time); cur_time -= _base_time; - while ((te = _first_time_struct) != NULL && te->time <= (uint32)cur_time) { + while ((te = _firstTimeStruct) != NULL && te->time <= (uint32)cur_time) { result = true; - _pending_delete_time_event = te; + _pendingDeleteTimeEvent = te; invokeTimeEvent(te); - if (_pending_delete_time_event) { - _pending_delete_time_event = NULL; + if (_pendingDeleteTimeEvent) { + _pendingDeleteTimeEvent = NULL; delTimeEvent(te); } } @@ -1578,31 +1572,31 @@ bool SimonEngine::kickoffTimeEvents() { void SimonEngine::invokeTimeEvent(TimeEvent *te) { Subroutine *sub; - _script_cond_a = 0; - if (_run_script_return_1) + _scriptCondA = 0; + if (_runScriptReturn1) return; sub = getSubroutineByID(te->subroutine_id); if (sub != NULL) startSubroutineEx(sub); - _run_script_return_1 = false; + _runScriptReturn1 = false; } void SimonEngine::o_setup_cond_c() { setup_cond_c_helper(); - _object_item = _hitarea_object_item; + _objectItem = _hitAreaObjectItem; - if (_object_item == _dummy_item_2) - _object_item = getItem1Ptr(); + if (_objectItem == _dummyItem2) + _objectItem = getItem1Ptr(); - if (_object_item == _dummy_item_3) - _object_item = derefItem(getItem1Ptr()->parent); + if (_objectItem == _dummyItem3) + _objectItem = derefItem(getItem1Ptr()->parent); - if (_object_item != NULL) { - _script_cond_c = _object_item->unk1; + if (_objectItem != NULL) { + _scriptCondC = _objectItem->unk1; } else { - _script_cond_c = -1; + _scriptCondC = -1; } } @@ -1610,51 +1604,51 @@ void SimonEngine::setup_cond_c_helper() { HitArea *last; if (_game & GF_SIMON2) { - _mouse_cursor = 0; - if (_hitarea_unk_4 != 999) { - _mouse_cursor = 9; - _need_hitarea_recalc++; - _hitarea_unk_4 = 0; + _mouseCursor = 0; + if (_hitAreaUnk4 != 999) { + _mouseCursor = 9; + _needHitAreaRecalc++; + _hitAreaUnk4 = 0; } } - _last_hitarea = 0; - _hitarea_object_item = NULL; + _lastHitArea = 0; + _hitAreaObjectItem = NULL; - last = _last_hitarea_2_ptr; + last = _lastHitArea2Ptr; defocusHitarea(); - _last_hitarea_2_ptr = last; + _lastHitArea2Ptr = last; for (;;) { - _last_hitarea = NULL; - _last_hitarea_3 = 0; - _left_button_down = 0; + _lastHitArea = NULL; + _lastHitArea3 = 0; + _leftButtonDown = 0; do { - if (_exit_cutscene && (_bit_array[0] & 0x200)) { + if (_exitCutscene && (_bitArray[0] & 0x200)) { startSubroutine170(); goto out_of_here; } delay(100); - } while (_last_hitarea_3 == (HitArea *) 0xFFFFFFFF || _last_hitarea_3 == 0); - - if (_last_hitarea == NULL) { - } else if (_last_hitarea->id == 0x7FFB) { - handle_uparrow_hitarea(_last_hitarea->fcs); - } else if (_last_hitarea->id == 0x7FFC) { - handle_downarrow_hitarea(_last_hitarea->fcs); - } else if (_last_hitarea->item_ptr != NULL) { - _hitarea_object_item = _last_hitarea->item_ptr; - _variableArray[60] = (_last_hitarea->flags & 1) ? (_last_hitarea->flags >> 8) : 0xFFFF; + } while (_lastHitArea3 == (HitArea *) 0xFFFFFFFF || _lastHitArea3 == 0); + + if (_lastHitArea == NULL) { + } else if (_lastHitArea->id == 0x7FFB) { + handle_uparrow_hitarea(_lastHitArea->fcs); + } else if (_lastHitArea->id == 0x7FFC) { + handle_downarrow_hitarea(_lastHitArea->fcs); + } else if (_lastHitArea->item_ptr != NULL) { + _hitAreaObjectItem = _lastHitArea->item_ptr; + _variableArray[60] = (_lastHitArea->flags & 1) ? (_lastHitArea->flags >> 8) : 0xFFFF; break; } } out_of_here: - _last_hitarea_3 = 0; - _last_hitarea = 0; - _last_hitarea_2_ptr = NULL; + _lastHitArea3 = 0; + _lastHitArea = 0; + _lastHitArea2Ptr = NULL; } void SimonEngine::startSubroutine170() { @@ -1666,36 +1660,36 @@ void SimonEngine::startSubroutine170() { if (sub != NULL) startSubroutineEx(sub); - _run_script_return_1 = true; + _runScriptReturn1 = true; } uint SimonEngine::get_fcs_ptr_3_index(FillOrCopyStruct *fcs) { uint i; - for (i = 0; i != ARRAYSIZE(_fcs_ptr_array_3); i++) - if (_fcs_ptr_array_3[i] == fcs) + for (i = 0; i != ARRAYSIZE(_fcsPtrArray3); i++) + if (_fcsPtrArray3[i] == fcs) return i; error("get_fcs_ptr_3_index: not found"); } void SimonEngine::lock() { - _lock_counter++; + _lockCounter++; } void SimonEngine::unlock() { - _lock_word |= 1; + _lockWord |= 1; - if (_lock_counter != 0) - _lock_counter--; + if (_lockCounter != 0) + _lockCounter--; - _lock_word &= ~1; + _lockWord &= ~1; } void SimonEngine::handle_mouse_moved() { uint x; - if (_lock_counter) { + if (_lockCounter) { _system->showMouse(false); return; } @@ -1703,66 +1697,66 @@ void SimonEngine::handle_mouse_moved() { _system->showMouse(true); pollMouseXY(); - if (_mouse_x >= 32768) - _mouse_x = 0; - if (_mouse_x >= 638 / 2) - _mouse_x = 638 / 2; + if (_mouseX >= 32768) + _mouseX = 0; + if (_mouseX >= 638 / 2) + _mouseX = 638 / 2; - if (_mouse_y >= 32768) - _mouse_y = 0; - if (_mouse_y >= 199) - _mouse_y = 199; + if (_mouseY >= 32768) + _mouseY = 0; + if (_mouseY >= 199) + _mouseY = 199; - if (_hitarea_unk_4) { + if (_hitAreaUnk4) { uint id = 101; - if (_mouse_y >= 136) + if (_mouseY >= 136) id = 102; - if (_hitarea_unk_4 != id) + if (_hitAreaUnk4 != id) hitarea_proc_1(); } if (_game & GF_SIMON2) { - if (_bit_array[4] & 0x8000) { - if (!_vga_var9) { - if (_mouse_x >= 630 / 2 || _mouse_x < 9) + if (_bitArray[4] & 0x8000) { + if (!_vgaVar9) { + if (_mouseX >= 630 / 2 || _mouseX < 9) goto get_out2; - _vga_var9 = 1; + _vgaVar9 = 1; } - if (_vga_var2 == 0) { - if (_mouse_x >= 631 / 2) { - if (_x_scroll != _vga_var1) - _xscroll_step = 1; - } else if (_mouse_x < 8) { - if (_x_scroll != 0) - _xscroll_step = -1; + if (_vgaVar2 == 0) { + if (_mouseX >= 631 / 2) { + if (_xScroll != _vgaVar1) + _xScrollStep = 1; + } else if (_mouseX < 8) { + if (_xScroll != 0) + _xScrollStep = -1; } } } else { get_out2:; - _vga_var9 = 0; + _vgaVar9 = 0; } } - if (_mouse_x != _mouse_x_old || _mouse_y != _mouse_y_old) - _need_hitarea_recalc++; + if (_mouseX != _mouseXOld || _mouseY != _mouseYOld) + _needHitAreaRecalc++; x = 0; - if (_last_hitarea_3 == 0 && _left_button_down != 0) { - _left_button_down = 0; + if (_lastHitArea3 == 0 && _leftButtonDown != 0) { + _leftButtonDown = 0; x = 1; } else { - if (_hitarea_unk_3 == 0 && _need_hitarea_recalc == 0) + if (_hitarea_unk_3 == 0 && _needHitAreaRecalc == 0) goto get_out; } - setup_hitarea_from_pos(_mouse_x, _mouse_y, x); - _last_hitarea_3 = _last_hitarea; - if (x == 1 && _last_hitarea == NULL) - _last_hitarea_3 = (HitArea *) - 1; + setup_hitarea_from_pos(_mouseX, _mouseY, x); + _lastHitArea3 = _lastHitArea; + if (x == 1 && _lastHitArea == NULL) + _lastHitArea3 = (HitArea *) - 1; get_out: draw_mouse_pointer(); - _need_hitarea_recalc = 0; + _needHitAreaRecalc = 0; } void SimonEngine::fcs_unk_proc_1(uint fcs_index, Item *item_ptr, int unk1, int unk2) { @@ -1773,7 +1767,7 @@ void SimonEngine::fcs_unk_proc_1(uint fcs_index, Item *item_ptr, int unk1, int u bool item_again; uint x_pos, y_pos; - fcs_ptr = _fcs_ptr_array_3[fcs_index & 7]; + fcs_ptr = _fcsPtrArray3[fcs_index & 7]; if (!(_game & GF_SIMON2)) { width_div_3 = fcs_ptr->width / 3; @@ -1866,15 +1860,15 @@ void SimonEngine::fcs_unk_proc_1(uint fcs_index, Item *item_ptr, int unk1, int u void SimonEngine::fcs_unk_proc_2(FillOrCopyStruct *fcs, uint fcs_index) { setup_hit_areas(fcs, fcs_index); - fcs->fcs_data->unk3 = _scroll_up_hit_area; - fcs->fcs_data->unk4 = _scroll_down_hit_area; + fcs->fcs_data->unk3 = _scrollUpHitArea; + fcs->fcs_data->unk4 = _scrollDownHitArea; } void SimonEngine::setup_hit_areas(FillOrCopyStruct *fcs, uint fcs_index) { HitArea *ha; ha = findEmptyHitArea(); - _scroll_up_hit_area = ha - _hit_areas; + _scrollUpHitArea = ha - _hitAreas; if (!(_game & GF_SIMON2)) { ha->x = 308; ha->y = 149; @@ -1898,7 +1892,7 @@ void SimonEngine::setup_hit_areas(FillOrCopyStruct *fcs, uint fcs_index) { } ha = findEmptyHitArea(); - _scroll_down_hit_area = ha - _hit_areas; + _scrollDownHitArea = ha - _hitAreas; if (!(_game & GF_SIMON2)) { ha->x = 308; @@ -1951,7 +1945,7 @@ void SimonEngine::f10_key() { byte *dst; uint b, color; - _lock_word |= 0x8000; + _lockWord |= 0x8000; if (_game & GF_SIMON2) color = 0xec; @@ -1961,73 +1955,73 @@ void SimonEngine::f10_key() { uint limit = (_game & GF_SIMON2) ? 200 : 134; for (int i = 0; i < 5; i++) { - ha = _hit_areas; - count = ARRAYSIZE(_hit_areas); + ha = _hitAreas; + count = ARRAYSIZE(_hitAreas); timer_vga_sprites(); do { if (ha->id != 0 && ha->flags & 0x20 && !(ha->flags & 0x40)) { - dha = _hit_areas; + dha = _hitAreas; if (ha->flags & 1) { while (dha != ha && dha->flags != ha->flags) ++dha; if (dha != ha && dha->flags == ha->flags) continue; } else { - dha = _hit_areas; + dha = _hitAreas; while (dha != ha && dha->item_ptr != ha->item_ptr) ++dha; if (dha != ha && dha->item_ptr == ha->item_ptr) continue; } - if (ha->y >= limit || ((_game & GF_SIMON2) && ha->y >= _vga_var8)) + if (ha->y >= limit || ((_game & GF_SIMON2) && ha->y >= _vgaVar8)) continue; y_ = (ha->height >> 1) - 4 + ha->y; - x_ = (ha->width >> 1) - 4 + ha->x - (_x_scroll << 3); + x_ = (ha->width >> 1) - 4 + ha->x - (_xScroll << 3); if (x_ >= 0x137) continue; dst = dx_lock_attached(); - dst += (((_dx_surface_pitch >> 2) * y_) << 2) + x_; + dst += (((_dxSurfacePitch >> 2) * y_) << 2) + x_; - b = _dx_surface_pitch; + b = _dxSurfacePitch; dst[4] = color; dst[b+1] = color; dst[b+4] = color; dst[b+7] = color; - b += _dx_surface_pitch; + b += _dxSurfacePitch; dst[b+2] = color; dst[b+4] = color; dst[b+6] = color; - b += _dx_surface_pitch; + b += _dxSurfacePitch; dst[b+3] = color; dst[b+5] = color; - b += _dx_surface_pitch; + b += _dxSurfacePitch; dst[b] = color; dst[b+1] = color; dst[b+2] = color; dst[b+6] = color; dst[b+7] = color; dst[b+8] = color; - b += _dx_surface_pitch; + b += _dxSurfacePitch; dst[b+3] = color; dst[b+5] = color; - b += _dx_surface_pitch; + b += _dxSurfacePitch; dst[b+2] = color; dst[b+4] = color; dst[b+6] = color; - b += _dx_surface_pitch; + b += _dxSurfacePitch; dst[b+1] = color; dst[b+4] = color; dst[b+7] = color; - b += _dx_surface_pitch; + b += _dxSurfacePitch; dst[b+4] = color; dx_unlock_attached(); @@ -2041,39 +2035,39 @@ void SimonEngine::f10_key() { delay(100); } - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } void SimonEngine::hitarea_stuff() { HitArea *ha; uint id; - _left_button_down = 0; - _last_hitarea = 0; - _verb_hitarea = 0; - _hitarea_subject_item = NULL; - _hitarea_object_item = NULL; + _leftButtonDown = 0; + _lastHitArea = 0; + _verbHitArea = 0; + _hitAreaSubjectItem = NULL; + _hitAreaObjectItem = NULL; hitarea_proc_1(); startOver: for (;;) { - _last_hitarea = NULL; - _last_hitarea_3 = NULL; + _lastHitArea = NULL; + _lastHitArea3 = NULL; for (;;) { - if (_key_pressed == 35) + if (_keyPressed == 35) f10_key(); processSpecialKeys(); - if (_last_hitarea_3 == (HitArea *) 0xFFFFFFFF) + if (_lastHitArea3 == (HitArea *) 0xFFFFFFFF) goto startOver; - if (_last_hitarea_3 != 0) + if (_lastHitArea3 != 0) break; hitarea_stuff_helper(); delay(100); } - ha = _last_hitarea; + ha = _lastHitArea; if (ha == NULL) { } else if (ha->id == 0x7FFB) { @@ -2081,20 +2075,20 @@ startOver: } else if (ha->id == 0x7FFC) { handle_downarrow_hitarea(ha->fcs); } else if (ha->id >= 101 && ha->id < 113) { - _verb_hitarea = ha->unk3; + _verbHitArea = ha->unk3; handle_verb_hitarea(ha); - _hitarea_unk_4 = 0; + _hitAreaUnk4 = 0; } else { - if ((_verb_hitarea != 0 || _hitarea_subject_item != ha->item_ptr && ha->flags & 0x80) && + if ((_verbHitArea != 0 || _hitAreaSubjectItem != ha->item_ptr && ha->flags & 0x80) && ha->item_ptr) { if_1:; - _hitarea_subject_item = ha->item_ptr; + _hitAreaSubjectItem = ha->item_ptr; id = 0xFFFF; if (ha->flags & 1) id = ha->flags >> 8; _variableArray[60] = id; new_current_hitarea(ha); - if (_verb_hitarea != 0) + if (_verbHitArea != 0) break; } else { // else 1 @@ -2102,19 +2096,19 @@ startOver: if (ha->item_ptr) goto if_1; } else { - _verb_hitarea = ha->unk3 & 0xBFFF; + _verbHitArea = ha->unk3 & 0xBFFF; if (ha->unk3 & 0x4000) { - _hitarea_subject_item = ha->item_ptr; + _hitAreaSubjectItem = ha->item_ptr; break; } - if (_hitarea_subject_item != NULL) + if (_hitAreaSubjectItem != NULL) break; } } } } - _need_hitarea_recalc++; + _needHitAreaRecalc++; } void SimonEngine::hitarea_stuff_helper() { @@ -2129,7 +2123,7 @@ void SimonEngine::hitarea_stuff_helper() { startUp_helper_2(); } _variableArray[254] = 0; - _run_script_return_1 = false; + _runScriptReturn1 = false; } } else { if (_variableArray[254] || _variableArray[249]) { @@ -2138,8 +2132,8 @@ void SimonEngine::hitarea_stuff_helper() { } time(&cur_time); - if ((uint) cur_time != _last_time) { - _last_time = cur_time; + if ((uint) cur_time != _lastTime) { + _lastTime = cur_time; if (kickoffTimeEvents()) startUp_helper_2(); } @@ -2172,60 +2166,60 @@ void SimonEngine::hitarea_stuff_helper_2() { _variableArray[254] = 0; } - _run_script_return_1 = false; + _runScriptReturn1 = false; } void SimonEngine::startUp_helper_2() { - if (!_mortal_flag) { - _mortal_flag = true; + if (!_mortalFlag) { + _mortalFlag = true; showmessage_print_char(0); - _fcs_unk_1 = 0; - if (_fcs_ptr_array_3[0] != 0) { - _fcs_ptr_1 = _fcs_ptr_array_3[0]; - showmessage_helper_3(_fcs_ptr_1->textLength, _fcs_ptr_1->textMaxLength); + _fcsUnk1 = 0; + if (_fcsPtrArray3[0] != 0) { + _fcsPtr1 = _fcsPtrArray3[0]; + showmessage_helper_3(_fcsPtr1->textLength, _fcsPtr1->textMaxLength); } - _mortal_flag = false; + _mortalFlag = false; } } void SimonEngine::pollMouseXY() { - _mouse_x = _sdl_mouse_x; - _mouse_y = _sdl_mouse_y; + _mouseX = _sdlMouseX; + _mouseY = _sdlMouseY; } void SimonEngine::handle_verb_clicked(uint verb) { Subroutine *sub; int result; - _object_item = _hitarea_object_item; - if (_object_item == _dummy_item_2) { - _object_item = getItem1Ptr(); + _objectItem = _hitAreaObjectItem; + if (_objectItem == _dummyItem2) { + _objectItem = getItem1Ptr(); } - if (_object_item == _dummy_item_3) { - _object_item = derefItem(getItem1Ptr()->parent); + if (_objectItem == _dummyItem3) { + _objectItem = derefItem(getItem1Ptr()->parent); } - _subject_item = _hitarea_subject_item; - if (_subject_item == _dummy_item_2) { - _subject_item = getItem1Ptr(); + _subjectItem = _hitAreaSubjectItem; + if (_subjectItem == _dummyItem2) { + _subjectItem = getItem1Ptr(); } - if (_subject_item == _dummy_item_3) { - _subject_item = derefItem(getItem1Ptr()->parent); + if (_subjectItem == _dummyItem3) { + _subjectItem = derefItem(getItem1Ptr()->parent); } - if (_subject_item) { - _script_cond_b = _subject_item->unk1; + if (_subjectItem) { + _scriptCondB = _subjectItem->unk1; } else { - _script_cond_b = -1; + _scriptCondB = -1; } - if (_object_item) { - _script_cond_c = _object_item->unk1; + if (_objectItem) { + _scriptCondC = _objectItem->unk1; } else { - _script_cond_c = -1; + _scriptCondC = -1; } - _script_cond_a = _verb_hitarea; + _scriptCondA = _verbHitArea; sub = getSubroutineByID(0); if (sub == NULL) @@ -2235,14 +2229,14 @@ void SimonEngine::handle_verb_clicked(uint verb) { if (result == -1) showMessageFormat("I don't understand"); - _run_script_return_1 = false; + _runScriptReturn1 = false; sub = getSubroutineByID(100); if (sub) startSubroutine(sub); if (_game & GF_SIMON2) - _run_script_return_1 = false; + _runScriptReturn1 = false; startUp_helper_2(); } @@ -2250,13 +2244,13 @@ void SimonEngine::handle_verb_clicked(uint verb) { TextLocation *SimonEngine::getTextLocation(uint a) { switch (a) { case 1: - return &_textlocation_1; + return &_textLocation1; case 2: - return &_textlocation_2; + return &_textLocation2; case 101: - return &_textlocation_3; + return &_textLocation3; case 102: - return &_textlocation_4; + return &_textLocation4; default: error("text, invalid value %d", a); } @@ -2289,17 +2283,17 @@ void SimonEngine::o_print_str() { } void SimonEngine::ensureVgaResLoadedC(uint vga_res) { - _lock_word |= 0x80; + _lockWord |= 0x80; ensureVgaResLoaded(vga_res); - _lock_word &= ~0x80; + _lockWord &= ~0x80; } void SimonEngine::ensureVgaResLoaded(uint vga_res) { VgaPointersEntry *vpe; - CHECK_BOUNDS(vga_res, _vga_buffer_pointers); + CHECK_BOUNDS(vga_res, _vgaBufferPointers); - vpe = _vga_buffer_pointers + vga_res; + vpe = _vgaBufferPointers + vga_res; if (vpe->vgaFile1 != NULL) return; @@ -2311,25 +2305,25 @@ void SimonEngine::ensureVgaResLoaded(uint vga_res) { byte *SimonEngine::setup_vga_destination(uint32 size) { byte *dest, *end; - _video_var_4 = 0; + _videoVar4 = 0; for (;;) { - dest = _vga_buf_free_start; + dest = _vgaBufFreeStart; end = dest + size; - if (end >= _vga_buf_end) { - _vga_buf_free_start = _vga_buf_start; + if (end >= _vgaBufEnd) { + _vgaBufFreeStart = _vgaBufStart; } else { - _video_var_5 = false; + _videoVar5 = false; vga_buf_unk_proc3(end); - if (_video_var_5) + if (_videoVar5) continue; vga_buf_unk_proc1(end); - if (_video_var_5) + if (_videoVar5) continue; delete_memptr_range(end); - _vga_buf_free_start = end; + _vgaBufFreeStart = end; return dest; } } @@ -2340,52 +2334,52 @@ void SimonEngine::setup_vga_file_buf_pointers() { alloced = (byte *)malloc(VGA_MEM_SIZE); - _vga_buf_free_start = alloced; - _vga_buf_start = alloced; - _vga_file_buf_org = alloced; - _vga_file_buf_org_2 = alloced; - _vga_buf_end = alloced + VGA_MEM_SIZE; + _vgaBufFreeStart = alloced; + _vgaBufStart = alloced; + _vgaFileBufOrg = alloced; + _vgaFileBufOrg2 = alloced; + _vgaBufEnd = alloced + VGA_MEM_SIZE; } void SimonEngine::vga_buf_unk_proc3(byte *end) { VgaPointersEntry *vpe; - if (_video_var_7 == 0xFFFF) + if (_videoVar7 == 0xFFFF) return; - if (_video_var_4 == 2) - error("vga_buf_unk_proc3: _video_var_4 == 2"); + if (_videoVar4 == 2) + error("vga_buf_unk_proc3: _videoVar4 == 2"); - vpe = &_vga_buffer_pointers[_video_var_7]; + vpe = &_vgaBufferPointers[_videoVar7]; - if (_vga_buf_free_start <= vpe->vgaFile1 && end >= vpe->vgaFile1 || - _vga_buf_free_start <= vpe->vgaFile2 && end >= vpe->vgaFile2) { - _video_var_5 = 1; - _video_var_4++; - _vga_buf_free_start = vpe->vgaFile1 + 0x5000; + if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 || + _vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) { + _videoVar5 = 1; + _videoVar4++; + _vgaBufFreeStart = vpe->vgaFile1 + 0x5000; } else { - _video_var_5 = 0; + _videoVar5 = 0; } } void SimonEngine::vga_buf_unk_proc1(byte *end) { VgaSprite *vsp; - if (_lock_word & 0x20) + if (_lockWord & 0x20) return; - for (vsp = _vga_sprites; vsp->id; vsp++) { + for (vsp = _vgaSprites; vsp->id; vsp++) { vga_buf_unk_proc2(vsp->unk7, end); - if (_video_var_5 == true) + if (_videoVar5 == true) return; } } void SimonEngine::delete_memptr_range(byte *end) { - uint count = ARRAYSIZE(_vga_buffer_pointers); - VgaPointersEntry *vpe = _vga_buffer_pointers; + uint count = ARRAYSIZE(_vgaBufferPointers); + VgaPointersEntry *vpe = _vgaBufferPointers; do { - if (_vga_buf_free_start <= vpe->vgaFile1 && end >= vpe->vgaFile1 || - _vga_buf_free_start <= vpe->vgaFile2 && end >= vpe->vgaFile2) { + if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 || + _vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) { vpe->dd = 0; vpe->vgaFile1 = NULL; vpe->vgaFile2 = NULL; @@ -2397,22 +2391,22 @@ void SimonEngine::delete_memptr_range(byte *end) { void SimonEngine::vga_buf_unk_proc2(uint a, byte *end) { VgaPointersEntry *vpe; - vpe = &_vga_buffer_pointers[a]; + vpe = &_vgaBufferPointers[a]; - if (_vga_buf_free_start <= vpe->vgaFile1 && end >= vpe->vgaFile1 || - _vga_buf_free_start <= vpe->vgaFile2 && end >= vpe->vgaFile2) { - _video_var_5 = true; - _video_var_4++; - _vga_buf_free_start = vpe->vgaFile1 + 0x5000; + if (_vgaBufFreeStart <= vpe->vgaFile1 && end >= vpe->vgaFile1 || + _vgaBufFreeStart <= vpe->vgaFile2 && end >= vpe->vgaFile2) { + _videoVar5 = true; + _videoVar4++; + _vgaBufFreeStart = vpe->vgaFile1 + 0x5000; } else { - _video_var_5 = false; + _videoVar5 = false; } } void SimonEngine::o_clear_vgapointer_entry(uint a) { VgaPointersEntry *vpe; - vpe = &_vga_buffer_pointers[a]; + vpe = &_vgaBufferPointers[a]; vpe->dd = 0; vpe->vgaFile1 = NULL; @@ -2423,8 +2417,8 @@ void SimonEngine::o_set_video_mode(uint mode, uint vga_res) { if (mode == 4) vc_29_stop_all_sounds(); - if (_lock_word & 0x10) - error("o_set_video_mode_ex: _lock_word & 0x10"); + if (_lockWord & 0x10) + error("o_set_video_mode_ex: _lockWord & 0x10"); set_video_mode_internal(mode, vga_res); } @@ -2436,26 +2430,26 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) { uint16 c; const byte *vc_ptr_org; - _video_palette_mode = mode; - _lock_word |= 0x20; + _videoPaletteMode = mode; + _lockWord |= 0x20; if (vga_res_id == 0) { if (!(_game & GF_SIMON2)) { - _unk_pal_flag = true; + _unkPalFlag = true; } else { - _dx_use_3_or_4_for_lock = true; - _vga_var6 = true; + _dxUse3Or4ForLock = true; + _vgaVar6 = true; } } - _vga_cur_file_2 = num = vga_res_id / 100; + _vgaCurFile2 = num = vga_res_id / 100; for (;;) { - vpe = &_vga_buffer_pointers[num]; + vpe = &_vgaBufferPointers[num]; - _cur_vga_file_1 = vpe->vgaFile1; - _cur_vga_file_2 = vpe->vgaFile2; + _curVgaFile1 = vpe->vgaFile1; + _curVgaFile2 = vpe->vgaFile2; if (vpe->vgaFile1 != NULL) break; @@ -2465,7 +2459,7 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) { // ensure flipping complete - bb = _cur_vga_file_1; + bb = _curVgaFile1; b = bb + READ_BE_UINT16(&((VgaFile1Header *) bb)->hdr2_start); c = READ_BE_UINT16(&((VgaFile1Header2 *) b)->unk1); b = bb + READ_BE_UINT16(&((VgaFile1Header2 *) b)->unk2_offs); @@ -2476,54 +2470,54 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) { if (!(_game & GF_SIMON2)) { if (num == 16300) { dx_clear_attached_from_top(134); - _use_palette_delay = true; + _usePaletteDelay = true; } } else { - _x_scroll = 0; - _vga_var1 = 0; - _vga_var2 = 0; - _xscroll_step = 0; - _sprite_height = 134; + _xScroll = 0; + _vgaVar1 = 0; + _vgaVar2 = 0; + _xScrollStep = 0; + _spriteHeight = 134; if (_variableArray[34] != -1) _variableArray[251] = 0; } - vc_ptr_org = _vc_ptr; + vc_ptr_org = _vcPtr; - _vc_ptr = _cur_vga_file_1 + READ_BE_UINT16(&((VgaFile1Struct0x8 *) b)->script_offs); - //dump_vga_script(_vc_ptr, num, vga_res_id); + _vcPtr = _curVgaFile1 + READ_BE_UINT16(&((VgaFile1Struct0x8 *) b)->script_offs); + //dump_vga_script(_vcPtr, num, vga_res_id); run_vga_script(); - _vc_ptr = vc_ptr_org; + _vcPtr = vc_ptr_org; if (_game & GF_SIMON2) { - if (!_dx_use_3_or_4_for_lock) { - num_lines = _video_palette_mode == 4 ? 134 : 200; - _vga_var8 = num_lines; + if (!_dxUse3Or4ForLock) { + num_lines = _videoPaletteMode == 4 ? 134 : 200; + _vgaVar8 = num_lines; dx_copy_from_attached_to_2(0, 0, 320, num_lines); dx_copy_from_attached_to_3(num_lines); - _sync_flag_2 = 1; + _syncFlag2 = 1; } - _dx_use_3_or_4_for_lock = false; + _dxUse3Or4ForLock = false; } else { // Allow one section of Simon the Sorcerer 1 introduction to be displayed // in lower half of screen if (_subroutine == 2923 || _subroutine == 2926) num_lines = 200; else - num_lines = _video_palette_mode == 4 ? 134 : 200; + num_lines = _videoPaletteMode == 4 ? 134 : 200; dx_copy_from_attached_to_2(0, 0, 320, num_lines); dx_copy_from_attached_to_3(num_lines); - _sync_flag_2 = 1; - _timer_5 = 0; + _syncFlag2 = 1; + _timer5 = 0; } - _lock_word &= ~0x20; + _lockWord &= ~0x20; if (!(_game & GF_SIMON2)) { - if (_unk_pal_flag) { - _unk_pal_flag = false; - while (_palette_color_count != 0) { + if (_unkPalFlag) { + _unkPalFlag = false; + while (_paletteColorCount != 0) { delay(10); } } @@ -2533,29 +2527,29 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) { void SimonEngine::o_fade_to_black() { uint i; - memcpy(_video_buf_1, _palette_backup, 256 * sizeof(uint32)); + memcpy(_videoBuf1, _paletteBackup, 256 * sizeof(uint32)); i = NUM_PALETTE_FADEOUT; do { - palette_fadeout((uint32 *)_video_buf_1, 32); - palette_fadeout((uint32 *)_video_buf_1 + 32 + 16, 144); - palette_fadeout((uint32 *)_video_buf_1 + 32 + 16 + 144 + 16, 48); + palette_fadeout((uint32 *)_videoBuf1, 32); + palette_fadeout((uint32 *)_videoBuf1 + 32 + 16, 144); + palette_fadeout((uint32 *)_videoBuf1 + 32 + 16 + 144 + 16, 48); - _system->setPalette(_video_buf_1, 0, 256); + _system->setPalette(_videoBuf1, 0, 256); if (_fade) _system->updateScreen(); delay(5); } while (--i); - memcpy(_palette_backup, _video_buf_1, 256 * sizeof(uint32)); - memcpy(_palette, _video_buf_1, 256 * sizeof(uint32)); + memcpy(_paletteBackup, _videoBuf1, 256 * sizeof(uint32)); + memcpy(_palette, _videoBuf1, 256 * sizeof(uint32)); } void SimonEngine::delete_vga_timer(VgaTimerEntry * vte) { - _lock_word |= 1; + _lockWord |= 1; - if (vte + 1 <= _next_vga_timer_to_process) { - _next_vga_timer_to_process--; + if (vte + 1 <= _nextVgaTimerToProcess) { + _nextVgaTimerToProcess--; } do { @@ -2563,13 +2557,13 @@ void SimonEngine::delete_vga_timer(VgaTimerEntry * vte) { vte++; } while (vte->delay); - _lock_word &= ~1; + _lockWord &= ~1; } void SimonEngine::expire_vga_timers() { - VgaTimerEntry *vte = _vga_timer_list; + VgaTimerEntry *vte = _vgaTimerList; - _vga_tick_counter++; + _vgaTickCounter++; while (vte->delay) { if (!--vte->delay) { @@ -2577,7 +2571,7 @@ void SimonEngine::expire_vga_timers() { uint16 cur_unk = vte->sprite_id; const byte *script_ptr = vte->script_pointer; - _next_vga_timer_to_process = vte + 1; + _nextVgaTimerToProcess = vte + 1; delete_vga_timer(vte); if ((_game & GF_SIMON2) && script_ptr == NULL) { @@ -2586,7 +2580,7 @@ void SimonEngine::expire_vga_timers() { } else { vc_resume_sprite(script_ptr, cur_file, cur_unk); } - vte = _next_vga_timer_to_process; + vte = _nextVgaTimerToProcess; } else { vte++; } @@ -2595,19 +2589,19 @@ void SimonEngine::expire_vga_timers() { // Simon2 specific void SimonEngine::scroll_timeout() { - if (_vga_var2 == 0) + if (_vgaVar2 == 0) return; - if (_vga_var2 < 0) { - if (_xscroll_step != -1) { - _xscroll_step = -1; - if (++_vga_var2 == 0) + if (_vgaVar2 < 0) { + if (_xScrollStep != -1) { + _xScrollStep = -1; + if (++_vgaVar2 == 0) return; } } else { - if (_xscroll_step != 1) { - _xscroll_step = 1; - if (--_vga_var2 == 0) + if (_xScrollStep != 1) { + _xScrollStep = 1; + if (--_vgaVar2 == 0) return; } } @@ -2618,16 +2612,16 @@ void SimonEngine::scroll_timeout() { void SimonEngine::vc_resume_sprite(const byte *code_ptr, uint16 cur_file, uint16 cur_sprite) { VgaPointersEntry *vpe; - _vga_cur_sprite_id = cur_sprite; + _vgaCurSpriteId = cur_sprite; - _vga_cur_file_id = cur_file; - _vga_cur_file_2 = cur_file; - vpe = &_vga_buffer_pointers[cur_file]; + _vgaCurFileId = cur_file; + _vgaCurFile2 = cur_file; + vpe = &_vgaBufferPointers[cur_file]; - _cur_vga_file_1 = vpe->vgaFile1; - _cur_vga_file_2 = vpe->vgaFile2; + _curVgaFile1 = vpe->vgaFile1; + _curVgaFile2 = vpe->vgaFile2; - _vc_ptr = code_ptr; + _vcPtr = code_ptr; run_vga_script(); } @@ -2642,12 +2636,12 @@ void SimonEngine::add_vga_timer(uint num, const byte *code_ptr, uint cur_sprite, // We work around the problem by correcting the code_ptr for sprite // 200 in this scene, if it is wrong. if (!(_game & GF_SIMON2) && (_language == 2) && - (code_ptr - _vga_buffer_pointers[cur_file].vgaFile1 == 4) && (cur_sprite == 200) && (cur_file == 2)) + (code_ptr - _vgaBufferPointers[cur_file].vgaFile1 == 4) && (cur_sprite == 200) && (cur_file == 2)) code_ptr += 0x66; - _lock_word |= 1; + _lockWord |= 1; - for (vte = _vga_timer_list; vte->delay; vte++) { + for (vte = _vgaTimerList; vte->delay; vte++) { } vte->delay = num; @@ -2655,39 +2649,39 @@ void SimonEngine::add_vga_timer(uint num, const byte *code_ptr, uint cur_sprite, vte->sprite_id = cur_sprite; vte->cur_vga_file = cur_file; - _lock_word &= ~1; + _lockWord &= ~1; } void SimonEngine::o_force_unlock() { - if (_game & GF_SIMON2 && _bit_array[4] & 0x8000) - _mouse_cursor = 0; - _lock_counter = 0; + if (_game & GF_SIMON2 && _bitArray[4] & 0x8000) + _mouseCursor = 0; + _lockCounter = 0; } void SimonEngine::o_force_lock() { if (_game & GF_SIMON2) { - _lock_word |= 0x8000; + _lockWord |= 0x8000; vc_34_force_lock(); - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } else { - _lock_word |= 0x4000; + _lockWord |= 0x4000; vc_34_force_lock(); - _lock_word &= ~0x4000; + _lockWord &= ~0x4000; } } void SimonEngine::o_wait_for_vga(uint a) { - _vga_wait_for = a; - _timer_1 = 0; - _exit_cutscene = false; - _skip_speech = false; - while (_vga_wait_for != 0) { - if (_skip_speech && _game & GF_SIMON2) { - if (_vga_wait_for == 200 && !vc_get_bit(14)) { + _vgaWaitFor = a; + _timer1 = 0; + _exitCutscene = false; + _skipSpeech = false; + while (_vgaWaitFor != 0) { + if (_skipSpeech && _game & GF_SIMON2) { + if (_vgaWaitFor == 200 && !vc_get_bit(14)) { skip_speech(); break; } - } else if (_exit_cutscene) { + } else if (_exitCutscene) { if (vc_get_bit(9)) { startSubroutine170(); break; @@ -2699,11 +2693,11 @@ void SimonEngine::o_wait_for_vga(uint a) { delay(10); if (_game & GF_SIMON2) { - if (_timer_1 >= 1000) { + if (_timer1 >= 1000) { warning("wait timed out"); break; } - } else if (_timer_1 >= 500) { + } else if (_timer1 >= 500) { warning("wait timed out"); break; } @@ -2713,8 +2707,8 @@ void SimonEngine::o_wait_for_vga(uint a) { void SimonEngine::skip_speech() { _sound->stopVoice(); - if (!(_bit_array[1] & 0x1000)) { - _bit_array[0] |= 0x4000; + if (!(_bitArray[1] & 0x1000)) { + _bitArray[0] |= 0x4000; _variableArray[100] = 5; start_vga_code(4, 1, 0x1e, 0, 0, 0); o_wait_for_vga(0x82); @@ -2725,26 +2719,26 @@ void SimonEngine::skip_speech() { void SimonEngine::timer_vga_sprites() { VgaSprite *vsp; VgaPointersEntry *vpe; - const byte *vc_ptr_org = _vc_ptr; + const byte *vc_ptr_org = _vcPtr; uint16 params[5]; // parameters to vc_10 - if (_video_var_9 == 2) - _video_var_9 = 1; + if (_videoVar9 == 2) + _videoVar9 = 1; - if (_game & GF_SIMON2 && _xscroll_step) { + if (_game & GF_SIMON2 && _xScrollStep) { timer_vga_sprites_helper(); } - vsp = _vga_sprites; + vsp = _vgaSprites; while (vsp->id != 0) { vsp->paletteMode &= 0x7FFF; - vpe = &_vga_buffer_pointers[vsp->unk7]; - _cur_vga_file_1 = vpe->vgaFile1; - _cur_vga_file_2 = vpe->vgaFile2; - _video_palette_mode = vsp->paletteMode; - _vga_cur_sprite_id = vsp->id; + vpe = &_vgaBufferPointers[vsp->unk7]; + _curVgaFile1 = vpe->vgaFile1; + _curVgaFile2 = vpe->vgaFile2; + _videoPaletteMode = vsp->paletteMode; + _vgaCurSpriteId = vsp->id; params[0] = READ_BE_UINT16(&vsp->image); params[1] = READ_BE_UINT16(&vsp->base_color); @@ -2757,17 +2751,17 @@ void SimonEngine::timer_vga_sprites() { params[4] = READ_BE_UINT16(&vsp->unk4); } - _vc_ptr = (const byte *)params; + _vcPtr = (const byte *)params; vc_10_draw(); vsp++; } - if (_draw_images_debug) + if (_drawImagesDebug) memset(_sdl_buf_attached, 0, 320 * 200); - _video_var_8++; - _vc_ptr = vc_ptr_org; + _videoVar8++; + _vcPtr = vc_ptr_org; } void SimonEngine::timer_vga_sprites_helper() { @@ -2775,130 +2769,129 @@ void SimonEngine::timer_vga_sprites_helper() { const byte *src; uint x; - if (_xscroll_step < 0) { - memmove(dst + 8, dst, 320 * _sprite_height - 8); + if (_xScrollStep < 0) { + memmove(dst + 8, dst, 320 * _spriteHeight - 8); } else { - memmove(dst, dst + 8, 320 * _sprite_height - 8); + memmove(dst, dst + 8, 320 * _spriteHeight - 8); } - x = _x_scroll - 1; + x = _xScroll - 1; - if (_xscroll_step > 0) { + if (_xScrollStep > 0) { dst += 320 - 8; x += 41; } - src = _vga_var7 + x * 4; - decodeStripA(dst, src + READ_BE_UINT32(src), _sprite_height); + src = _vgaVar7 + x * 4; + decodeStripA(dst, src + READ_BE_UINT32(src), _spriteHeight); dx_unlock_2(); memcpy(_sdl_buf_attached, _sdl_buf, 320 * 200); - dx_copy_from_attached_to_3(_sprite_height); + dx_copy_from_attached_to_3(_spriteHeight); - _x_scroll += _xscroll_step; + _xScroll += _xScrollStep; - vc_write_var(0xfB, _x_scroll); + vc_write_var(0xfB, _xScroll); - _xscroll_step = 0; + _xScrollStep = 0; } void SimonEngine::timer_vga_sprites_2() { VgaSprite *vsp; VgaPointersEntry *vpe; - const byte *vc_ptr_org = _vc_ptr; + const byte *vc_ptr_org = _vcPtr; uint16 params[5]; // parameters to vc_10_draw - if (_video_var_9 == 2) - _video_var_9 = 1; + if (_videoVar9 == 2) + _videoVar9 = 1; - vsp = _vga_sprites; + vsp = _vgaSprites; while (vsp->id != 0) { vsp->paletteMode &= 0x7FFF; - vpe = &_vga_buffer_pointers[vsp->unk7]; - _cur_vga_file_1 = vpe->vgaFile1; - _cur_vga_file_2 = vpe->vgaFile2; - _video_palette_mode = vsp->paletteMode; - _vga_cur_sprite_id = vsp->id; + vpe = &_vgaBufferPointers[vsp->unk7]; + _curVgaFile1 = vpe->vgaFile1; + _curVgaFile2 = vpe->vgaFile2; + _videoPaletteMode = vsp->paletteMode; + _vgaCurSpriteId = vsp->id; if (vsp->image) - fprintf(_dump_file, "id:%5d image:%3d base-color:%3d x:%3d y:%3d flags:%x\n", + fprintf(_dumpFile, "id:%5d image:%3d base-color:%3d x:%3d y:%3d flags:%x\n", vsp->id, vsp->image, vsp->base_color, vsp->x, vsp->y, vsp->unk4); params[0] = READ_BE_UINT16(&vsp->image); params[1] = READ_BE_UINT16(&vsp->base_color); params[2] = READ_BE_UINT16(&vsp->x); params[3] = READ_BE_UINT16(&vsp->y); params[4] = READ_BE_UINT16(&vsp->unk4); - _vc_ptr = (const byte *)params; + _vcPtr = (const byte *)params; vc_10_draw(); vsp++; } - _video_var_8++; - _vc_ptr = vc_ptr_org; + _videoVar8++; + _vcPtr = vc_ptr_org; } void SimonEngine::timer_proc1() { - _timer_4++; + _timer4++; if (_game & GF_SIMON2) { - if (_lock_word & 0x80E9 || _lock_word & 2) + if (_lockWord & 0x80E9 || _lockWord & 2) return; } else { - if (_lock_word & 0xC0E9 || _lock_word & 2) + if (_lockWord & 0xC0E9 || _lockWord & 2) return; } - _timer_1++; + _timer1++; - _lock_word |= 2; + _lockWord |= 2; - if (!(_lock_word & 0x10)) { + if (!(_lockWord & 0x10)) { expire_vga_timers(); expire_vga_timers(); - _sync_flag_2 ^= 1; - _cepe_flag ^= 1; - if (!_cepe_flag) + _syncFlag2 ^= 1; + _cepeFlag ^= 1; + if (!_cepeFlag) expire_vga_timers(); - if (_lock_counter != 0 && !_sync_flag_2) { - _lock_word &= ~2; + if (_lockCounter != 0 && !_syncFlag2) { + _lockWord &= ~2; return; } } timer_vga_sprites(); - if (_draw_images_debug) + if (_drawImagesDebug) timer_vga_sprites_2(); - if (_copy_partial_mode == 1) { + if (_copyPartialMode == 1) { dx_copy_from_2_to_attached(80, 46, 208 - 80, 94 - 46); } - if (_copy_partial_mode == 2) { + if (_copyPartialMode == 2) { // copy partial from attached to 2 dx_copy_from_attached_to_2(176, 61, 320 - 176, 134 - 61); - _copy_partial_mode = 0; + _copyPartialMode = 0; } - if (_video_var_8) { + if (_videoVar8) { handle_mouse_moved(); dx_update_screen_and_palette(); - _sync_flag_1 = false; - _video_var_8 = false; + _videoVar8 = false; } - _lock_word &= ~2; + _lockWord &= ~2; } void SimonEngine::timer_callback() { - if (_timer_5 != 0) { - _sync_flag_2 = true; - _timer_5--; + if (_timer5 != 0) { + _syncFlag2 = true; + _timer5--; } else { timer_proc1(); } @@ -2910,22 +2903,22 @@ void SimonEngine::fcs_setTextColor(FillOrCopyStruct *fcs, uint value) { void SimonEngine::o_vga_reset() { if (_game & GF_SIMON2) { - _lock_word |= 0x8000; + _lockWord |= 0x8000; vc_27_reset(); - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } else { - _lock_word |= 0x4000; + _lockWord |= 0x4000; vc_27_reset(); - _lock_word &= ~0x4000; + _lockWord &= ~0x4000; } } bool SimonEngine::itemIsSiblingOf(uint16 a) { Item *item; - CHECK_BOUNDS(a, _vc_item_array); + CHECK_BOUNDS(a, _vcItemArray); - item = _vc_item_array[a]; + item = _vcItemArray[a]; if (item == NULL) return true; @@ -2935,11 +2928,11 @@ bool SimonEngine::itemIsSiblingOf(uint16 a) { bool SimonEngine::itemIsParentOf(uint16 a, uint16 b) { Item *item_a, *item_b; - CHECK_BOUNDS(a, _vc_item_array); - CHECK_BOUNDS(b, _vc_item_array); + CHECK_BOUNDS(a, _vcItemArray); + CHECK_BOUNDS(b, _vcItemArray); - item_a = _vc_item_array[a]; - item_b = _vc_item_array[b]; + item_a = _vcItemArray[a]; + item_b = _vcItemArray[b]; if (item_a == NULL || item_b == NULL) return true; @@ -2950,9 +2943,9 @@ bool SimonEngine::itemIsParentOf(uint16 a, uint16 b) { bool SimonEngine::vc_maybe_skip_proc_1(uint16 a, int16 b) { Item *item; - CHECK_BOUNDS(a, _vc_item_array); + CHECK_BOUNDS(a, _vcItemArray); - item = _vc_item_array[a]; + item = _vcItemArray[a]; if (item == NULL) return true; return item->unk3 == b; @@ -2960,13 +2953,13 @@ bool SimonEngine::vc_maybe_skip_proc_1(uint16 a, int16 b) { // OK void SimonEngine::fcs_delete(uint a) { - if (_fcs_ptr_array_3[a] == NULL) + if (_fcsPtrArray3[a] == NULL) return; fcs_unk1(a); - video_copy_if_flag_0x8_c(_fcs_ptr_array_3[a]); - _fcs_ptr_array_3[a] = NULL; - if (_fcs_unk_1 == a) { - _fcs_ptr_1 = NULL; + video_copy_if_flag_0x8_c(_fcsPtrArray3[a]); + _fcsPtrArray3[a] = NULL; + if (_fcsUnk1 == a) { + _fcsPtr1 = NULL; fcs_unk_2(0); } } @@ -2975,14 +2968,14 @@ void SimonEngine::fcs_delete(uint a) { void SimonEngine::fcs_unk_2(uint a) { a &= 7; - if (_fcs_ptr_array_3[a] == NULL || _fcs_unk_1 == a) + if (_fcsPtrArray3[a] == NULL || _fcsUnk1 == a) return; - _fcs_unk_1 = a; + _fcsUnk1 = a; showmessage_print_char(0); - _fcs_ptr_1 = _fcs_ptr_array_3[a]; + _fcsPtr1 = _fcsPtrArray3[a]; - showmessage_helper_3(_fcs_ptr_1->textLength, _fcs_ptr_1->textMaxLength); + showmessage_helper_3(_fcsPtr1->textLength, _fcsPtr1->textMaxLength); } // OK @@ -3010,15 +3003,15 @@ FillOrCopyStruct *SimonEngine::fcs_alloc(uint x, uint y, uint w, uint h, uint fl } Item *SimonEngine::derefItem(uint item) { - if (item >= _itemarray_size) + if (item >= _itemArraySize) error("derefItem: invalid item %d", item); - return _itemarray_ptr[item]; + return _itemArrayPtr[item]; } uint SimonEngine::itemPtrToID(Item *id) { uint i; - for (i = 0; i != _itemarray_size; i++) - if (_itemarray_ptr[i] == id) + for (i = 0; i != _itemArraySize; i++) + if (_itemArrayPtr[i] == id) return i; error("itemPtrToID: not found"); } @@ -3031,12 +3024,12 @@ void SimonEngine::o_pathfind(int x, int y, uint var_1, uint var_2) { uint best_i = 0, best_j = 0, best_dist = 0xFFFFFFFF; if (_game & GF_SIMON2) { - x += _x_scroll * 8; + x += _xScroll * 8; } prev_i = 21 - _variableArray[12]; for (i = 20; i != 0; --i) { - p = (const uint16 *)_pathfind_array[20 - i]; + p = (const uint16 *)_pathFindArray[20 - i]; if (!p) continue; for (j = 0; READ_BE_UINT16(&p[0]) != 999; j++, p += 2) { // 0xE703 = byteswapped 999 @@ -3067,8 +3060,8 @@ void SimonEngine::fcs_unk1(uint fcs_index) { uint16 fcsunk1; uint16 i; - fcs = _fcs_ptr_array_3[fcs_index & 7]; - fcsunk1 = _fcs_unk_1; + fcs = _fcsPtrArray3[fcs_index & 7]; + fcsunk1 = _fcsUnk1; if (fcs == NULL || fcs->fcs_data == NULL) return; @@ -3094,8 +3087,8 @@ void SimonEngine::fcs_unk1(uint fcs_index) { free(fcs->fcs_data); fcs->fcs_data = NULL; - _fcs_data_1[fcs_index] = 0; - _fcs_data_2[fcs_index] = 0; + _fcsData1[fcs_index] = 0; + _fcsData2[fcs_index] = 0; } // ok @@ -3104,14 +3097,14 @@ void SimonEngine::fcs_unk_5(FillOrCopyStruct *fcs, uint fcs_index) { } void SimonEngine::delete_hitarea_by_index(uint index) { - CHECK_BOUNDS(index, _hit_areas); - _hit_areas[index].flags = 0; + CHECK_BOUNDS(index, _hitAreas); + _hitAreas[index].flags = 0; } // ok void SimonEngine::fcs_putchar(uint a) { - if (_fcs_ptr_1 != _fcs_ptr_array_3[0]) - video_putchar(_fcs_ptr_1, a); + if (_fcsPtr1 != _fcsPtrArray3[0]) + video_putchar(_fcsPtr1, a); } // ok @@ -3129,49 +3122,49 @@ void SimonEngine::video_fill_or_copy_from_3_to_2(FillOrCopyStruct *fcs) { // ok void SimonEngine::copy_img_from_3_to_2(FillOrCopyStruct *fcs) { - _lock_word |= 0x8000; + _lockWord |= 0x8000; if (!(_game & GF_SIMON2)) { - dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8 + ((fcs == _fcs_ptr_array_3[2]) ? 1 : 0), (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8); + dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8 + ((fcs == _fcsPtrArray3[2]) ? 1 : 0), (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8); } else { - if (_vga_var6 && _fcs_ptr_array_3[2] == fcs) { - fcs = _fcs_ptr_array_3[0x18 / 4]; - _vga_var6 = 0; + if (_vgaVar6 && _fcsPtrArray3[2] == fcs) { + fcs = _fcsPtrArray3[0x18 / 4]; + _vgaVar6 = 0; } dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8, (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8); } - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } void SimonEngine::video_erase(FillOrCopyStruct *fcs) { byte *dst; uint h; - _lock_word |= 0x8000; + _lockWord |= 0x8000; dst = dx_lock_2(); - dst += _dx_surface_pitch * fcs->y + fcs->x * 8; + dst += _dxSurfacePitch * fcs->y + fcs->x * 8; h = fcs->height * 8; do { memset(dst, fcs->fill_color, fcs->width * 8); - dst += _dx_surface_pitch; + dst += _dxSurfacePitch; } while (--h); dx_unlock_2(); - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } VgaSprite *SimonEngine::find_cur_sprite() { - VgaSprite *vsp = _vga_sprites; + VgaSprite *vsp = _vgaSprites; while (vsp->id) { if (_game & GF_SIMON2) { - if (vsp->id == _vga_cur_sprite_id && vsp->unk7 == _vga_cur_file_id) + if (vsp->id == _vgaCurSpriteId && vsp->unk7 == _vgaCurFileId) break; } else { - if (vsp->id == _vga_cur_sprite_id) + if (vsp->id == _vgaCurSpriteId) break; } vsp++; @@ -3180,7 +3173,7 @@ VgaSprite *SimonEngine::find_cur_sprite() { } bool SimonEngine::has_vga_sprite_with_id(uint16 id, uint16 file) { - VgaSprite *vsp = _vga_sprites; + VgaSprite *vsp = _vgaSprites; while (vsp->id) { if (_game & GF_SIMON2) { if (vsp->id == id && vsp->unk7 == file) @@ -3195,9 +3188,9 @@ bool SimonEngine::has_vga_sprite_with_id(uint16 id, uint16 file) { } void SimonEngine::processSpecialKeys() { - switch (_key_pressed) { + switch (_keyPressed) { case 27: // escape - _exit_cutscene = true; + _exitCutscene = true; break; case 59: // F1 if (_game & GF_SIMON2) { @@ -3225,7 +3218,7 @@ void SimonEngine::processSpecialKeys() { break; case 63: // F5 if (_game & GF_SIMON2) - _exit_cutscene = true; + _exitCutscene = true; break; case 'p': pause(); @@ -3246,57 +3239,57 @@ void SimonEngine::processSpecialKeys() { midi.set_volume(midi.get_volume() - 16); break; case 'm': - midi.pause(_music_paused ^= 1); + midi.pause(_musicPaused ^= 1); break; case 's': if (_game == GAME_SIMON1DOS) midi._enable_sfx ^= 1; else - _sound->effectsPause(_effects_paused ^= 1); + _sound->effectsPause(_effectsPaused ^= 1); break; case 'b': - _sound->ambientPause(_ambient_paused ^= 1); + _sound->ambientPause(_ambientPaused ^= 1); break; case 'r': if (_debugMode) - _start_mainscript ^= 1; + _startMainScript ^= 1; break; case 'o': if (_debugMode) - _continous_mainscript ^= 1; + _continousMainScript ^= 1; break; case 'a': if (_debugMode) - _start_vgascript ^= 1; + _startVgaScript ^= 1; break; case 'g': if (_debugMode) - _continous_vgascript ^= 1; + _continousVgaScript ^= 1; break; case 'i': if (_debugMode) - _draw_images_debug ^= 1; + _drawImagesDebug ^= 1; break; case 'd': if (_debugMode) - _dump_images ^=1; + _dumpImages ^=1; break; } - _key_pressed = 0; + _keyPressed = 0; } void SimonEngine::pause() { - _key_pressed = 1; + _keyPressed = 1; _pause = 1; - bool ambient_status = _ambient_paused; - bool music_status = _music_paused; + bool ambient_status = _ambientPaused; + bool music_status = _musicPaused; midi.pause(true); _sound->ambientPause(true); while (_pause) { delay(1); - if (_key_pressed == 'p') + if (_keyPressed == 'p') _pause = 0; } midi.pause(music_status); @@ -3308,8 +3301,8 @@ void SimonEngine::video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte byte *src, color; uint w, h, i; - _lock_word |= 0x8000; - src = dx_lock_2() + ha->y * _dx_surface_pitch + ha->x; + _lockWord |= 0x8000; + src = dx_lock_2() + ha->y * _dxSurfacePitch + ha->x; w = ha->width; h = ha->height; @@ -3319,7 +3312,7 @@ void SimonEngine::video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte // often causing the savegame name highlighter to be cut short if (!(h > 0 && w > 0 && ha->x + w <= 320 && ha->y + h <= 200)) { debug(1,"Invalid coordinates in video_toggle_colors (%d,%d,%d,%d)", ha->x, ha->y, ha->width, ha->height); - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; return; } @@ -3334,12 +3327,12 @@ void SimonEngine::video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte src[i] = color; } } - src += _dx_surface_pitch; + src += _dxSurfacePitch; } while (--h); dx_unlock_2(); - _lock_word &= ~0x8000; + _lockWord &= ~0x8000; } void SimonEngine::video_copy_if_flag_0x8_c(FillOrCopyStruct *fcs) { @@ -3354,14 +3347,14 @@ void SimonEngine::start_vga_code(uint b, uint vga_res, uint vga_sprite_id, uint byte *p, *pp; uint count; - _lock_word |= 0x40; + _lockWord |= 0x40; if (has_vga_sprite_with_id(vga_sprite_id, vga_res)) { - _lock_word &= ~0x40; + _lockWord &= ~0x40; return; } - vsp = _vga_sprites; + vsp = _vgaSprites; while (vsp->id != 0) vsp++; @@ -3381,15 +3374,15 @@ void SimonEngine::start_vga_code(uint b, uint vga_res, uint vga_sprite_id, uint for (;;) { - vpe = &_vga_buffer_pointers[vga_res]; - _vga_cur_file_2 = vga_res; - _cur_vga_file_1 = vpe->vgaFile1; + vpe = &_vgaBufferPointers[vga_res]; + _vgaCurFile2 = vga_res; + _curVgaFile1 = vpe->vgaFile1; if (vpe->vgaFile1 != NULL) break; ensureVgaResLoaded(vga_res); } - pp = _cur_vga_file_1; + pp = _curVgaFile1; p = pp + READ_BE_UINT16(&((VgaFile1Header *) pp)->hdr2_start); count = READ_BE_UINT16(&((VgaFile1Header2 *) p)->id_count); @@ -3398,7 +3391,7 @@ void SimonEngine::start_vga_code(uint b, uint vga_res, uint vga_sprite_id, uint for (;;) { if (READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->id) == vga_sprite_id) { - if (_start_vgascript) + if (_startVgaScript) dump_vga_script(pp + READ_BE_UINT16(&((VgaFile1Struct0x6*)p)->script_offs), vga_res, vga_sprite_id); add_vga_timer(VGA_DELAY_BASE, pp + READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->script_offs), vga_sprite_id, vga_res); @@ -3411,7 +3404,7 @@ void SimonEngine::start_vga_code(uint b, uint vga_res, uint vga_sprite_id, uint } } - _lock_word &= ~0x40; + _lockWord &= ~0x40; } void SimonEngine::talk_with_speech(uint speech_id, uint vga_sprite_id) { @@ -3419,15 +3412,15 @@ void SimonEngine::talk_with_speech(uint speech_id, uint vga_sprite_id) { if (speech_id == 9999) { if (_subtitles) return; - if (!(_bit_array[0] & 0x4000) && !(_bit_array[1] & 0x1000)) { - _bit_array[0] |= 0x4000; + if (!(_bitArray[0] & 0x4000) && !(_bitArray[1] & 0x1000)) { + _bitArray[0] |= 0x4000; _variableArray[100] = 0xF; start_vga_code(4, 1, 0x82, 0, 0, 0); o_wait_for_vga(0x82); } - _skip_vga_wait = true; + _skipVgaWait = true; } else { - if (_subtitles && _scriptvar_2) { + if (_subtitles && _scriptVar2) { start_vga_code(4, 2, 204, 0, 0, 0); o_wait_for_vga(204); o_kill_sprite_simon1(204); @@ -3440,18 +3433,18 @@ void SimonEngine::talk_with_speech(uint speech_id, uint vga_sprite_id) { if (speech_id == 0xFFFF) { if (_subtitles) return; - if (!(_bit_array[0] & 0x4000) && !(_bit_array[1] & 0x1000)) { - _bit_array[0] |= 0x4000; + if (!(_bitArray[0] & 0x4000) && !(_bitArray[1] & 0x1000)) { + _bitArray[0] |= 0x4000; _variableArray[100] = 5; start_vga_code(4, 1, 0x1e, 0, 0, 0); o_wait_for_vga(0x82); } - _skip_vga_wait = true; + _skipVgaWait = true; } else { if (_subtitles && _language != 20) { _sound->playVoice(speech_id); return; - } else if (_subtitles && _scriptvar_2) { + } else if (_subtitles && _scriptVar2) { start_vga_code(4, 2, 5, 0, 0, 0); o_wait_for_vga(205); o_kill_sprite_simon2(2,5); @@ -3535,7 +3528,7 @@ void SimonEngine::talk_with_text(uint vga_sprite_id, uint color, const char *str render_string(vga_sprite_id, color, width, height, convertedString); int b = 4; - if (!(_bit_array[8] & 0x20)) + if (!(_bitArray[8] & 0x20)) b = 3; x >>= 3; @@ -3693,18 +3686,18 @@ void SimonEngine::read_vga_from_datfile_1(uint vga_id) { byte *buffer = new byte[size]; if (in.read(buffer, size) != size) error("read_vga_from_datfile_1: read failed"); - decrunch_file_amiga (buffer, _vga_buffer_pointers[11].vgaFile2, size); + decrunch_file_amiga (buffer, _vgaBufferPointers[11].vgaFile2, size); delete [] buffer; } else { - if (in.read(_vga_buffer_pointers[11].vgaFile2, size) != size) + if (in.read(_vgaBufferPointers[11].vgaFile2, size) != size) error("read_vga_from_datfile_1: read failed"); } in.close(); } else { - uint32 offs_a = _game_offsets_ptr[vga_id]; - uint32 size = _game_offsets_ptr[vga_id + 1] - offs_a; + uint32 offs_a = _gameOffsetsPtr[vga_id]; + uint32 size = _gameOffsetsPtr[vga_id + 1] - offs_a; - resfile_read(_vga_buffer_pointers[11].vgaFile2, offs_a, size); + resfile_read(_vgaBufferPointers[11].vgaFile2, offs_a, size); } } @@ -3750,8 +3743,8 @@ byte *SimonEngine::read_vga_from_datfile_2(uint id) { return dst; } else { - uint32 offs_a = _game_offsets_ptr[id]; - uint32 size = _game_offsets_ptr[id + 1] - offs_a; + uint32 offs_a = _gameOffsetsPtr[id]; + uint32 size = _gameOffsetsPtr[id + 1] - offs_a; byte *dst; dst = setup_vga_destination(size + extraBuffer); @@ -3762,29 +3755,29 @@ byte *SimonEngine::read_vga_from_datfile_2(uint id) { } void SimonEngine::resfile_read(void *dst, uint32 offs, uint32 size) { - _game_file->seek(offs, SEEK_SET); - if (_game_file->read(dst, size) != size) + _gameFile->seek(offs, SEEK_SET); + if (_gameFile->read(dst, size) != size) error("resfile_read(%d,%d) read failed", offs, size); } void SimonEngine::openGameFile() { if (!(_game & GF_OLD_BUNDLE)) { - _game_file = new File(); - _game_file->open(gss->gme_filename); + _gameFile = new File(); + _gameFile->open(gss->gme_filename); - if (_game_file->isOpen() == false) + if (_gameFile->isOpen() == false) error("Can't open game file '%s'", gss->gme_filename); - uint32 size = _game_file->readUint32LE(); + uint32 size = _gameFile->readUint32LE(); - _game_offsets_ptr = (uint32 *)malloc(size); - if (_game_offsets_ptr == NULL) + _gameOffsetsPtr = (uint32 *)malloc(size); + if (_gameOffsetsPtr == NULL) error("out of memory, game offsets"); - resfile_read(_game_offsets_ptr, 0, size); + resfile_read(_gameOffsetsPtr, 0, size); #if defined(SCUMM_BIG_ENDIAN) for (uint r = 0; r < size / sizeof(uint32); r++) - _game_offsets_ptr[r] = FROM_LE_32(_game_offsets_ptr[r]); + _gameOffsetsPtr[r] = FROM_LE_32(_gameOffsetsPtr[r]); #endif } @@ -3813,15 +3806,15 @@ void SimonEngine::dx_copy_rgn_from_3_to_2(uint b, uint r, uint y, uint x) { dst = dx_lock_2(); src = _sdl_buf_3; - dst += y * _dx_surface_pitch; - src += y * _dx_surface_pitch; + dst += y * _dxSurfacePitch; + src += y * _dxSurfacePitch; while (y < b) { for (i = x; i < r; i++) dst[i] = src[i]; y++; - dst += _dx_surface_pitch; - src += _dx_surface_pitch; + dst += _dxSurfacePitch; + src += _dxSurfacePitch; } dx_unlock_2(); @@ -3832,7 +3825,7 @@ void SimonEngine::dx_clear_surfaces(uint num_lines) { _system->copyRectToScreen(_sdl_buf_attached, 320, 0, 0, 320, 200); - if (_dx_use_3_or_4_for_lock) { + if (_dxUse3Or4ForLock) { memset(_sdl_buf, 0, num_lines * 320); memset(_sdl_buf_3, 0, num_lines * 320); } @@ -3871,12 +3864,12 @@ void SimonEngine::dx_copy_from_attached_to_3(uint lines) { } void SimonEngine::dx_update_screen_and_palette() { - _num_screen_updates++; + _numScreenUpdates++; - if (_palette_color_count == 0 && _video_var_9 == 1) { - _video_var_9 = 0; - if (memcmp(_palette, _palette_backup, 256 * 4) != 0) { - memcpy(_palette_backup, _palette, 256 * 4); + if (_paletteColorCount == 0 && _videoVar9 == 1) { + _videoVar9 = 0; + if (memcmp(_palette, _paletteBackup, 256 * 4) != 0) { + memcpy(_paletteBackup, _palette, 256 * 4); _system->setPalette(_palette, 0, 256); } } @@ -3886,45 +3879,45 @@ void SimonEngine::dx_update_screen_and_palette() { memcpy(_sdl_buf_attached, _sdl_buf, 320 * 200); - if (_palette_color_count != 0) { - if (!(_game & GF_SIMON2) && _use_palette_delay) { + if (_paletteColorCount != 0) { + if (!(_game & GF_SIMON2) && _usePaletteDelay) { delay(100); - _use_palette_delay = false; + _usePaletteDelay = false; } realizePalette(); } } void SimonEngine::realizePalette() { - _video_var_9 = false; - memcpy(_palette_backup, _palette, 256 * 4); + _videoVar9 = false; + memcpy(_paletteBackup, _palette, 256 * 4); - if (_palette_color_count & 0x8000) { + if (_paletteColorCount & 0x8000) { fadeUpPalette(); } else { - _system->setPalette(_palette, 0, _palette_color_count); + _system->setPalette(_palette, 0, _paletteColorCount); } - _palette_color_count = 0; + _paletteColorCount = 0; } void SimonEngine::fadeUpPalette() { bool done; - _palette_color_count = (_palette_color_count & 0x7fff) / 4; + _paletteColorCount = (_paletteColorCount & 0x7fff) / 4; - memset(_video_buf_1, 0, _palette_color_count * sizeof(uint32)); + memset(_videoBuf1, 0, _paletteColorCount * sizeof(uint32)); // This function is used by Simon 2 when riding the lion to the goblin - // camp. Note that _palette_color_count is not 1024 in this scene, so + // camp. Note that _paletteColorCount is not 1024 in this scene, so // only part of the palette is faded up. But apparently that's enough, // as long as we make sure that the remaining palette colours aren't // completely ignored. - if (_palette_color_count < _video_num_pal_colors) - memcpy(_video_buf_1 + _palette_color_count * sizeof(uint32), - _palette + _palette_color_count * sizeof(uint32), - (_video_num_pal_colors - _palette_color_count) * sizeof(uint32)); + if (_paletteColorCount < _videoNumPalColors) + memcpy(_videoBuf1 + _paletteColorCount * sizeof(uint32), + _palette + _paletteColorCount * sizeof(uint32), + (_videoNumPalColors - _paletteColorCount) * sizeof(uint32)); do { uint8 *src; @@ -3933,9 +3926,9 @@ void SimonEngine::fadeUpPalette() { done = true; src = _palette; - dst = _video_buf_1; + dst = _videoBuf1; - for (i = 0; i < _palette_color_count; i++) { + for (i = 0; i < _paletteColorCount; i++) { if (src[0] > dst[0]) { if (dst[0] > src[0] - 4) dst[0] = src[0]; @@ -3961,14 +3954,14 @@ void SimonEngine::fadeUpPalette() { src += 4; } - _system->setPalette(_video_buf_1, 0, _video_num_pal_colors); + _system->setPalette(_videoBuf1, 0, _videoNumPalColors); delay(5); } while (!done); } int SimonEngine::go() { - if (!_dump_file) - _dump_file = stdout; + if (!_dumpFile) + _dumpFile = stdout; // allocate buffers _sdl_buf_3 = (byte *)calloc(320 * 200, 1); @@ -3987,7 +3980,7 @@ int SimonEngine::go() { if (_game == GAME_SIMON1DOS) midi._enable_sfx ^= 1; else - _sound->effectsPause(_effects_paused ^= 1); + _sound->effectsPause(_effectsPaused ^= 1); } loadGamePcFile(gss->gamepc_filename); @@ -3995,23 +3988,23 @@ int SimonEngine::go() { addTimeEvent(0, 1); openGameFile(); - _last_music_played = -1; - _vga_base_delay = 1; + _lastMusicPlayed = -1; + _vgaBaseDelay = 1; - _start_mainscript = false; - _continous_mainscript = false; - _start_vgascript = false; - _continous_vgascript = false; - _draw_images_debug=false; + _startMainScript = false; + _continousMainScript = false; + _startVgaScript = false; + _continousVgaScript = false; + _drawImagesDebug = false; if (gDebugLevel == 2) - _continous_mainscript = true; + _continousMainScript = true; if (gDebugLevel == 3) - _continous_vgascript = true; + _continousVgaScript = true; if (gDebugLevel == 4) - _start_mainscript = true; + _startMainScript = true; if (gDebugLevel == 5) - _start_vgascript = true; + _startVgaScript = true; if (_game & GF_TALKIE) { // English and German versions of Simon the Sorcerer 1 don't have full subtitles @@ -4023,7 +4016,7 @@ int SimonEngine::go() { while (1) { hitarea_stuff(); - handle_verb_clicked(_verb_hitarea); + handle_verb_clicked(_verbHitArea); delay(100); } @@ -4031,17 +4024,17 @@ int SimonEngine::go() { } void SimonEngine::shutdown() { - delete _game_file; + delete _gameFile; midi.close(); - free(_stringtab_ptr); - free(_itemarray_ptr); - free(_itemheap_ptr - _itemheap_curpos); - free(_tablesheap_ptr - _tablesheap_curpos); - free(_tbl_list); - free(_icon_file_ptr); - free(_game_offsets_ptr); + free(_stringTabPtr); + free(_itemArrayPtr); + free(_itemHeapPtr - _itemHeapCurPos); + free(_tablesHeapPtr - _tablesHeapCurPos); + free(_tblList); + free(_iconFilePtr); + free(_gameOffsetsPtr); _system->quit(); } @@ -4056,7 +4049,7 @@ void SimonEngine::delay(uint amount) { if (_debugger->isAttached()) _debugger->onFrame(); - if (_fast_mode) + if (_fastMode) vga_period = 10; else if (_game & GF_SIMON2) vga_period = 45 * _speed; @@ -4066,16 +4059,16 @@ void SimonEngine::delay(uint amount) { _rnd.getRandomNumber(2); do { - while (!_in_callback && cur >= _last_vga_tick + vga_period && !_pause) { - _last_vga_tick += vga_period; + while (!_inCallBack && cur >= _lastVgaTick + vga_period && !_pause) { + _lastVgaTick += vga_period; // don't get too many frames behind - if (cur >= _last_vga_tick + vga_period * 2) - _last_vga_tick = cur; + if (cur >= _lastVgaTick + vga_period * 2) + _lastVgaTick = cur; - _in_callback = true; + _inCallBack = true; timer_callback(); - _in_callback = false; + _inCallBack = false; } while (_system->pollEvent(event)) { @@ -4091,11 +4084,11 @@ void SimonEngine::delay(uint amount) { _saveLoadSlot = 10; sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot); - _saveLoadFlag = (event.kbd.flags == OSystem::KBD_ALT) ? 1 : 2; + _saveLoadType = (event.kbd.flags == OSystem::KBD_ALT) ? 1 : 2; // We should only allow a load or save when it was possible in original // This stops load/save during copy protection, conversations and cut scenes - if (!_lock_counter && !_show_preposition) + if (!_lockCounter && !_showPreposition) quick_load_or_save(); } else if (event.kbd.flags == OSystem::KBD_CTRL) { if (event.kbd.keycode == 'a') { @@ -4103,32 +4096,32 @@ void SimonEngine::delay(uint amount) { _aboutDialog = new GUI::AboutDialog(); _aboutDialog->runModal(); } else if (event.kbd.keycode == 'f') - _fast_mode ^= 1; + _fastMode ^= 1; else if (event.kbd.keycode == 'd') _debugger->attach(); } // Make sure backspace works right (this fixes a small issue on OS X) if (event.kbd.keycode == 8) - _key_pressed = 8; + _keyPressed = 8; else - _key_pressed = (byte)event.kbd.ascii; + _keyPressed = (byte)event.kbd.ascii; break; case OSystem::EVENT_MOUSEMOVE: - _sdl_mouse_x = event.mouse.x; - _sdl_mouse_y = event.mouse.y; + _sdlMouseX = event.mouse.x; + _sdlMouseY = event.mouse.y; break; case OSystem::EVENT_LBUTTONDOWN: - _left_button_down++; + _leftButtonDown++; #if defined (_WIN32_WCE) || defined(__PALM_OS__) - _sdl_mouse_x = event.mouse.x; - _sdl_mouse_y = event.mouse.y; + _sdlMouseX = event.mouse.x; + _sdlMouseY = event.mouse.y; #endif break; case OSystem::EVENT_RBUTTONDOWN: if (_game & GF_SIMON2) - _skip_speech = true; + _skipSpeech = true; else - _exit_cutscene = true; + _exitCutscene = true; break; case OSystem::EVENT_QUIT: shutdown(); @@ -4143,7 +4136,7 @@ void SimonEngine::delay(uint amount) { break; { - this_delay = _fast_mode ? 1 : 20 * _speed; + this_delay = _fastMode ? 1 : 20 * _speed; if (this_delay > amount) this_delay = amount; _system->delayMillis(this_delay); @@ -4164,18 +4157,18 @@ void SimonEngine::loadMusic (uint music) { debug(5,"playMusic - Load %dtune attempt", music); } else if (_game & GF_SIMON2) { // Simon 2 music midi.stop(); - _game_file->seek(_game_offsets_ptr[MUSIC_INDEX_BASE + music - 1], SEEK_SET); - _game_file->read(buf, 4); + _gameFile->seek(_gameOffsetsPtr[MUSIC_INDEX_BASE + music - 1], SEEK_SET); + _gameFile->read(buf, 4); if (!memcmp(buf, "FORM", 4)) { - _game_file->seek(_game_offsets_ptr[MUSIC_INDEX_BASE + music - 1], SEEK_SET); - midi.loadXMIDI (_game_file); + _gameFile->seek(_gameOffsetsPtr[MUSIC_INDEX_BASE + music - 1], SEEK_SET); + midi.loadXMIDI (_gameFile); } else { - _game_file->seek(_game_offsets_ptr[MUSIC_INDEX_BASE + music - 1], SEEK_SET); - midi.loadMultipleSMF (_game_file); + _gameFile->seek(_gameOffsetsPtr[MUSIC_INDEX_BASE + music - 1], SEEK_SET); + midi.loadMultipleSMF (_gameFile); } - _last_music_played = music; - _next_music_to_play = -1; + _lastMusicPlayed = music; + _nextMusicToPlay = -1; } else if (_game & GF_SIMON1) { // Simon 1 music midi.stop(); midi.setLoop (true); // Must do this BEFORE loading music. (GMF may have its own override.) @@ -4189,14 +4182,14 @@ void SimonEngine::loadMusic (uint music) { if (music == 35) midi.setLoop (false); - _game_file->seek(_game_offsets_ptr[MUSIC_INDEX_BASE + music], SEEK_SET); - _game_file->read(buf, 4); + _gameFile->seek(_gameOffsetsPtr[MUSIC_INDEX_BASE + music], SEEK_SET); + _gameFile->read(buf, 4); if (!memcmp(buf, "GMF\x1", 4)) { - _game_file->seek(_game_offsets_ptr[MUSIC_INDEX_BASE + music], SEEK_SET); - midi.loadSMF (_game_file, music); + _gameFile->seek(_gameOffsetsPtr[MUSIC_INDEX_BASE + music], SEEK_SET); + midi.loadSMF (_gameFile, music); } else { - _game_file->seek(_game_offsets_ptr[MUSIC_INDEX_BASE + music], SEEK_SET); - midi.loadMultipleSMF (_game_file); + _gameFile->seek(_gameOffsetsPtr[MUSIC_INDEX_BASE + music], SEEK_SET); + midi.loadMultipleSMF (_gameFile); } } else { @@ -4219,7 +4212,7 @@ void SimonEngine::loadMusic (uint music) { } byte *SimonEngine::dx_lock_2() { - _dx_surface_pitch = 320; + _dxSurfacePitch = 320; return _sdl_buf; } @@ -4227,8 +4220,8 @@ void SimonEngine::dx_unlock_2() { } byte *SimonEngine::dx_lock_attached() { - _dx_surface_pitch = 320; - return _dx_use_3_or_4_for_lock ? _sdl_buf_3 : _sdl_buf_attached; + _dxSurfacePitch = 320; + return _dxUse3Or4ForLock ? _sdl_buf_3 : _sdl_buf_attached; } void SimonEngine::dx_unlock_attached() { @@ -4239,7 +4232,7 @@ void SimonEngine::set_volume(int volume) { } byte SimonEngine::getByte() { - return *_code_ptr++; + return *_codePtr++; } } // End of namespace Simon diff --git a/simon/simon.h b/simon/simon.h index cfb44229e0..eb1d6f8cc5 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -112,11 +112,11 @@ class SimonEngine : public Engine { protected: void playSting(uint a); - const byte *_vc_ptr; /* video code ptr */ + const byte *_vcPtr; /* video code ptr */ uint16 _vc_get_out_of_code; - uint32 *_game_offsets_ptr; + uint32 *_gameOffsetsPtr; uint VGA_DELAY_BASE; uint TABLE_INDEX_BASE; @@ -129,7 +129,7 @@ protected: const GameSpecificSettings *gss; byte _game; - byte _key_pressed; + byte _keyPressed; typedef enum { FORMAT_NONE, @@ -138,234 +138,229 @@ protected: FORMAT_VOC } SoundFormat; - File *_game_file; + File *_gameFile; - byte *_stripped_txt_mem; - uint _text_size; - uint _stringtab_num, _stringtab_pos, _stringtab_numalloc; - byte **_stringtab_ptr; + byte *_strippedTxtMem; + uint _textSize; + uint _stringTabNum, _stringTabPos, _stringtab_numalloc; + byte **_stringTabPtr; - Item **_itemarray_ptr; - uint _itemarray_size; - uint _itemarray_inited; + Item **_itemArrayPtr; + uint _itemArraySize; + uint _itemArrayInited; - byte *_itemheap_ptr; - uint _itemheap_curpos; - uint _itemheap_size; + byte *_itemHeapPtr; + uint _itemHeapCurPos; + uint _itemHeapSize; - byte *_icon_file_ptr; + byte *_iconFilePtr; - byte *_tbl_list; + byte *_tblList; - const byte *_code_ptr; + const byte *_codePtr; - byte **_local_stringtable; - uint _string_id_local_min, _string_id_local_max; + byte **_localStringtable; + uint _stringIdLocalMin, _stringIdLocalMax; - byte *_tablesheap_ptr, *_tablesheap_ptr_org, *_tablesheap_ptr_new; - uint _tablesheap_size, _tablesheap_curpos, _tablesheap_curpos_org; - uint _tablesheap_curpos_new; + byte *_tablesHeapPtr, *_tablesHeapPtrOrg, *_tablesheapPtrNew; + uint _tablesHeapSize, _tablesHeapCurPos, _tablesHeapCurPosOrg; + uint _tablesHeapCurPosNew; - Subroutine *_subroutine_list, *_subroutine_list_org; + Subroutine *_subroutineList, *_subroutineListOrg; uint _subroutine; - uint _dx_surface_pitch; + uint _dxSurfacePitch; - uint _recursion_depth; + uint _recursionDepth; - uint32 _last_vga_tick; + uint32 _lastVgaTick; - uint16 _op_189_flags; + uint16 _op189Flags; - bool _scriptvar_2; - bool _run_script_return_1; - bool _skip_vga_wait; - bool _no_parent_notify; - bool _vga_res_328_loaded; + bool _scriptVar2; + bool _runScriptReturn1; + bool _skipVgaWait; + bool _noParentNotify; + bool _vgaRes328Loaded; bool _hitarea_unk_3; - bool _mortal_flag; - volatile bool _sync_flag_1; - byte _video_var_8; - bool _use_palette_delay; - bool _sync_flag_2; - bool _in_callback; - bool _cepe_flag; - byte _copy_partial_mode; + bool _mortalFlag; + byte _videoVar8; + bool _usePaletteDelay; + bool _syncFlag2; + bool _inCallBack; + bool _cepeFlag; + byte _copyPartialMode; uint _speed; - bool _fast_mode; - bool _dx_use_3_or_4_for_lock; + bool _fastMode; + bool _dxUse3Or4ForLock; uint16 _debugMode; uint16 _language; bool _pause; - bool _start_mainscript; - bool _continous_mainscript; - bool _start_vgascript; - bool _continous_vgascript; - bool _draw_images_debug; - bool _dump_images; + bool _startMainScript; + bool _continousMainScript; + bool _startVgaScript; + bool _continousVgaScript; + bool _drawImagesDebug; + bool _dumpImages; bool _speech; bool _subtitles; bool _fade; - byte _mouse_cursor; - bool _vga_var9; - int16 _script_unk_1; - bool _vga_var6; - int _x_scroll, _vga_var1, _vga_var2, _xscroll_step, _sprite_height; - const byte *_vga_var7; - byte _vga_var8; + byte _mouseCursor; + bool _vgaVar9; + int16 _scriptUnk1; + bool _vgaVar6; + int _xScroll, _vgaVar1, _vgaVar2, _xScrollStep, _spriteHeight; + const byte *_vgaVar7; + byte _vgaVar8; - int16 _script_cond_a, _script_cond_b, _script_cond_c; + int16 _scriptCondA, _scriptCondB, _scriptCondC; - uint16 _fcs_unk_1; - FillOrCopyStruct *_fcs_ptr_1; + uint16 _fcsUnk1; + FillOrCopyStruct *_fcsPtr1; - Item *_subject_item, *_object_item; - Item *_item_1; + Item *_subjectItem, *_objectItem; + Item *_item1; - Item *_hitarea_object_item; - HitArea *_last_hitarea; - HitArea *_last_hitarea_2_ptr; - HitArea *_last_hitarea_3; - byte _left_button_down; - Item *_hitarea_subject_item; - HitArea *_hitarea_ptr_5, *_hitarea_ptr_7; - uint _need_hitarea_recalc; - uint _verb_hitarea; - uint16 _hitarea_unk_4; - uint _lock_counter; + Item *_hitAreaObjectItem; + HitArea *_lastHitArea; + HitArea *_lastHitArea2Ptr; + HitArea *_lastHitArea3; + byte _leftButtonDown; + Item *_hitAreaSubjectItem; + HitArea *_hitAreaPtr5, *_hitAreaPtr7; + uint _needHitAreaRecalc; + uint _verbHitArea; + uint16 _hitAreaUnk4; + uint _lockCounter; - uint16 _video_palette_mode; + uint16 _videoPaletteMode; - uint _print_char_unk_1, _print_char_unk_2; - uint _num_letters_to_print; + uint _printCharUnk1, _printCharUnk2; + uint _numLettersToPrint; - uint _last_time; + uint _lastTime; - TimeEvent *_first_time_struct, *_pending_delete_time_event; + TimeEvent *_firstTimeStruct, *_pendingDeleteTimeEvent; uint _base_time; - uint _mouse_x, _mouse_y; - uint _mouse_x_old, _mouse_y_old; + uint _mouseX, _mouseY; + uint _mouseXOld, _mouseYOld; - Item *_dummy_item_1; - Item *_dummy_item_2; - Item *_dummy_item_3; + Item *_dummyItem1; + Item *_dummyItem2; + Item *_dummyItem3; - volatile uint16 _lock_word; - uint16 _scroll_up_hit_area; - uint16 _scroll_down_hit_area; + volatile uint16 _lockWord; + uint16 _scrollUpHitArea; + uint16 _scrollDownHitArea; - uint16 _video_var_7; - volatile uint16 _palette_color_count; + uint16 _videoVar7; + volatile uint16 _paletteColorCount; - byte _video_var_4; - bool _video_var_5; - bool _video_var_3; - bool _unk_pal_flag; - bool _exit_cutscene; - bool _skip_speech; - byte _video_var_9; + byte _videoVar4; + bool _videoVar5; + bool _videoVar3; + bool _unkPalFlag; + bool _exitCutscene; + bool _skipSpeech; + byte _videoVar9; - uint _sound_file_id; - int16 _last_music_played; - int16 _next_music_to_play; + uint _soundFileId; + int16 _lastMusicPlayed; + int16 _nextMusicToPlay; - bool _show_preposition; - bool _showmessage_flag; + bool _showPreposition; + bool _showMessageFlag; - uint _video_num_pal_colors; + uint _videoNumPalColors; - uint _invoke_timer_callback; + uint _vgaSpriteChanged; - uint _vga_sprite_changed; + byte *_vgaBufFreeStart, *_vgaBufEnd, *_vgaBufStart; + byte *_vgaFileBufOrg, *_vgaFileBufOrg2; - byte *_vga_buf_free_start, *_vga_buf_end, *_vga_buf_start; - byte *_vga_file_buf_org, *_vga_file_buf_org_2; + byte *_curVgaFile1; + byte *_curVgaFile2; - byte *_cur_vga_file_1; - byte *_cur_vga_file_2; + uint16 _timer1, _timer5, _timer4; - uint16 _timer_1, _timer_5, _timer_4; + uint16 _vgaBaseDelay; - uint16 _vga_base_delay; + uint16 _vgaCurFile2; + uint16 _vgaWaitFor, _vgaCurFileId; + uint16 _vgaCurSpriteId; - uint16 _vga_cur_file_2; - uint16 _vga_wait_for, _vga_cur_file_id; - uint16 _vga_cur_sprite_id; + VgaTimerEntry *_nextVgaTimerToProcess; - VgaTimerEntry *_next_vga_timer_to_process; + Item *_vcItemArray[20]; + Item *_itemArray6[20]; - Item *_vc_item_array[20]; - Item *_item_array_6[20]; + uint16 _stringIdArray2[20]; + uint16 _stringIdArray3[20]; + uint16 _speechIdArray4[20]; - uint16 _stringid_array_2[20]; - uint16 _stringid_array_3[20]; - uint16 _speechid_array_4[20]; - - uint16 _bit_array[32]; + uint16 _bitArray[32]; int16 _variableArray[256]; - FillOrCopyStruct *_fcs_ptr_array_3[8]; + FillOrCopyStruct *_fcsPtrArray3[8]; - byte _fcs_data_1[8]; - bool _fcs_data_2[8]; + byte _fcsData1[8]; + bool _fcsData2[8]; - TextLocation _textlocation_1, _textlocation_2, _textlocation_3, _textlocation_4; + TextLocation _textLocation1, _textLocation2, _textLocation3, _textLocation4; - int _free_string_slot; + int _freeStringSlot; byte _stringReturnBuffer[2][180]; - HitArea _hit_areas[90]; + HitArea _hitAreas[90]; - VgaPointersEntry _vga_buffer_pointers[180]; - VgaSprite _vga_sprites[180]; - VgaSleepStruct _vga_sleep_structs[30]; + VgaPointersEntry _vgaBufferPointers[180]; + VgaSprite _vgaSprites[180]; + VgaSleepStruct _vgaSleepStructs[30]; - const uint16 *_pathfind_array[20]; + const uint16 *_pathFindArray[20]; - uint8 _palette_backup[1024]; + uint8 _paletteBackup[1024]; uint8 _palette[1024]; - byte _video_buf_1[3000]; + byte _videoBuf1[3000]; - VgaTimerEntry _vga_timer_list[95]; + VgaTimerEntry _vgaTimerList[95]; FillOrCopyStruct *_fcs_list; - byte _letters_to_print_buf[80]; + byte _lettersToPrintBuf[80]; MidiPlayer midi; int _midiDriver; - int _num_screen_updates; - int _vga_tick_counter; + int _numScreenUpdates; + int _vgaTickCounter; Sound *_sound; - bool _effects_paused; - bool _ambient_paused; - bool _music_paused; + bool _effectsPaused; + bool _ambientPaused; + bool _musicPaused; Debugger *_debugger; - int _timer_id; - - FILE *_dump_file; + FILE *_dumpFile; - int _saveload_row_curpos; - int _num_savegame_rows; - bool _savedialog_flag; - bool _save_or_load; - bool _saveload_flag; + int _saveLoadRowCurPos; + int _numSaveGameRows; + bool _saveDialogFlag; + bool _saveOrLoad; + bool _saveLoadFlag; - byte _saveLoadFlag, _saveLoadSlot; + byte _saveLoadType, _saveLoadSlot; char _saveLoadName[32]; - int _sdl_mouse_x, _sdl_mouse_y; + int _sdlMouseX, _sdlMouseY; byte *_sdl_buf_3; byte *_sdl_buf; @@ -373,7 +368,7 @@ protected: Common::RandomSource _rnd; - const byte *_vc_10_base_ptr_old; + const byte *_vc10BasePtrOld; byte _hebrew_char_widths[32]; public: diff --git a/simon/sound.cpp b/simon/sound.cpp index 2ccea96f05..1dfbb78b31 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -234,8 +234,8 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer _voice = 0; _effects = 0; - _effects_paused = false; - _ambient_paused = false; + _effectsPaused = false; + _ambientPaused = false; _filenums = 0; _last_voice_file = 0; @@ -455,7 +455,7 @@ void Sound::playEffects(uint sound) { if (!_effects) return; - if (_effects_paused) + if (_effectsPaused) return; _effects->playSound(sound, &_effects_handle, (_game == GAME_SIMON1CD32) ? 0 : SoundMixer::FLAG_UNSIGNED); @@ -470,7 +470,7 @@ void Sound::playAmbient(uint sound) { _ambient_playing = sound; - if (_ambient_paused) + if (_ambientPaused) return; _mixer->stopHandle(_ambient_handle); @@ -491,13 +491,13 @@ void Sound::stopAll() { } void Sound::effectsPause(bool b) { - _effects_paused = b; + _effectsPaused = b; } void Sound::ambientPause(bool b) { - _ambient_paused = b; + _ambientPaused = b; - if (_ambient_paused && _ambient_playing) { + if (_ambientPaused && _ambient_playing) { _mixer->stopHandle(_ambient_handle); } else if (_ambient_playing) { uint tmp = _ambient_playing; diff --git a/simon/sound.h b/simon/sound.h index 28c988d1d3..4e92bff100 100644 --- a/simon/sound.h +++ b/simon/sound.h @@ -37,8 +37,8 @@ private: BaseSound *_voice; BaseSound *_effects; - bool _effects_paused; - bool _ambient_paused; + bool _effectsPaused; + bool _ambientPaused; uint16 *_filenums; uint32 *_offsets; diff --git a/simon/verb.cpp b/simon/verb.cpp index df98558b1c..5dc2eb2118 100644 --- a/simon/verb.cpp +++ b/simon/verb.cpp @@ -192,20 +192,20 @@ void SimonEngine::defocusHitarea() { HitArea *ha; if (_game & GF_SIMON2) { - if (_bit_array[4] & 0x8000) { + if (_bitArray[4] & 0x8000) { o_unk_120(202); - _last_hitarea_2_ptr = NULL; + _lastHitArea2Ptr = NULL; return; } } - last = _hitarea_ptr_5; + last = _hitAreaPtr5; - if (last == _hitarea_ptr_7) + if (last == _hitAreaPtr7) return; hitareaChangedHelper(); - _hitarea_ptr_7 = last; + _hitAreaPtr7 = last; if (last != NULL && (ha = findHitAreaByID(200)) && (ha->flags & 0x40) && !(last->flags & 0x40)) focusVerb(last->id); @@ -219,7 +219,7 @@ void SimonEngine::focusVerb(uint hitarea_id) { hitarea_id -= 101; - if (_show_preposition) { + if (_showPreposition) { switch (_language) { case 21: verb_prep_names = russian_verb_prep_names; break; case 20: verb_prep_names = hebrew_verb_prep_names; break; @@ -251,7 +251,7 @@ void SimonEngine::focusVerb(uint hitarea_id) { void SimonEngine::showActionString(uint x, const byte *string) { FillOrCopyStruct *fcs; - fcs = _fcs_ptr_array_3[1]; + fcs = _fcsPtrArray3[1]; if (fcs == NULL || fcs->text_color == 0) return; @@ -266,21 +266,21 @@ void SimonEngine::hitareaChangedHelper() { FillOrCopyStruct *fcs; if (_game & GF_SIMON2) { - if (_bit_array[4] & 0x8000) + if (_bitArray[4] & 0x8000) return; } - fcs = _fcs_ptr_array_3[1]; + fcs = _fcsPtrArray3[1]; if (fcs != NULL && fcs->text_color != 0) video_fill_or_copy_from_3_to_2(fcs); - _last_hitarea_2_ptr = NULL; - _hitarea_ptr_7 = NULL; + _lastHitArea2Ptr = NULL; + _hitAreaPtr7 = NULL; } HitArea *SimonEngine::findHitAreaByID(uint hitarea_id) { - HitArea *ha = _hit_areas; - uint count = ARRAYSIZE(_hit_areas); + HitArea *ha = _hitAreas; + uint count = ARRAYSIZE(_hitAreas); do { if (ha->id == hitarea_id) @@ -290,8 +290,8 @@ HitArea *SimonEngine::findHitAreaByID(uint hitarea_id) { } HitArea *SimonEngine::findEmptyHitArea() { - HitArea *ha = _hit_areas; - uint count = ARRAYSIZE(_hit_areas); + HitArea *ha = _hitAreas; + uint count = ARRAYSIZE(_hitAreas); do { if (ha->flags == 0) @@ -328,9 +328,9 @@ void SimonEngine::delete_hitarea(uint hitarea) { HitArea *ha = findHitAreaByID(hitarea); if (ha != NULL) { ha->flags = 0; - if (ha == _last_hitarea_2_ptr) + if (ha == _lastHitArea2Ptr) defocusHitarea(); - _need_hitarea_recalc++; + _needHitAreaRecalc++; } } @@ -355,7 +355,7 @@ void SimonEngine::addNewHitArea(int id, int x, int y, int width, int height, int ha->unk3 = unk3; ha->item_ptr = item_ptr; - _need_hitarea_recalc++; + _needHitAreaRecalc++; } void SimonEngine::hitarea_proc_1() { @@ -364,29 +364,29 @@ void SimonEngine::hitarea_proc_1() { if (_game & GF_SIMON2) { id = 2; - if (!(_bit_array[4] & 0x8000)) - id = (_mouse_y >= 136) ? 102 : 101; + if (!(_bitArray[4] & 0x8000)) + id = (_mouseY >= 136) ? 102 : 101; } else { - id = (_mouse_y >= 136) ? 102 : 101; + id = (_mouseY >= 136) ? 102 : 101; } - _hitarea_unk_4 = id; + _hitAreaUnk4 = id; ha = findHitAreaByID(id); if (ha == NULL) return; if (ha->flags & 0x40) { - _hitarea_unk_4 = 999; - _hitarea_ptr_5 = NULL; + _hitAreaUnk4 = 999; + _hitAreaPtr5 = NULL; } else { - _verb_hitarea = ha->unk3; + _verbHitArea = ha->unk3; handle_verb_hitarea(ha); } } void SimonEngine::handle_verb_hitarea(HitArea *ha) { - HitArea *tmp = _hitarea_ptr_5; + HitArea *tmp = _hitAreaPtr5; if (ha == tmp) return; @@ -407,10 +407,10 @@ void SimonEngine::handle_verb_hitarea(HitArea *ha) { } else { if (ha->id < 101) return; - _mouse_cursor = ha->id - 101; - _need_hitarea_recalc++; + _mouseCursor = ha->id - 101; + _needHitAreaRecalc++; } - _hitarea_ptr_5 = ha; + _hitAreaPtr5 = ha; } void SimonEngine::hitarea_leave(HitArea *ha) { @@ -452,15 +452,15 @@ void SimonEngine::handle_downarrow_hitarea(FillOrCopyStruct *fcs) { void SimonEngine::setup_hitarea_from_pos(uint x, uint y, uint mode) { HitArea *best_ha; - HitArea *ha = _hit_areas; - uint count = ARRAYSIZE(_hit_areas); + HitArea *ha = _hitAreas; + uint count = ARRAYSIZE(_hitAreas); uint16 layer = 0; uint16 x_ = x; const uint16 y_ = y; if (_game & GF_SIMON2) { - if (_bit_array[4] & 0x8000 || y < 134) { - x_ += _x_scroll * 8; + if (_bitArray[4] & 0x8000 || y < 134) { + x_ += _xScroll * 8; } } @@ -491,14 +491,14 @@ void SimonEngine::setup_hitarea_from_pos(uint x, uint y, uint mode) { } if (mode != 0 && mode != 3) { - _last_hitarea = best_ha; + _lastHitArea = best_ha; _variableArray[1] = x; _variableArray[2] = y; } if (best_ha->flags & 4) { defocusHitarea(); - } else if (best_ha != _last_hitarea_2_ptr) { + } else if (best_ha != _lastHitArea2Ptr) { new_current_hitarea(best_ha); } @@ -521,7 +521,7 @@ void SimonEngine::new_current_hitarea(HitArea *ha) { } if (result) - _last_hitarea_2_ptr = ha; + _lastHitArea2Ptr = ha; } bool SimonEngine::hitarea_proc_2(uint a) { @@ -529,7 +529,7 @@ bool SimonEngine::hitarea_proc_2(uint a) { const byte *string_ptr; if (_game & GF_SIMON2) { - if (_bit_array[4] & 0x8000) { + if (_bitArray[4] & 0x8000) { Subroutine *sub; _variableArray[84] = a; sub = getSubroutineByID(5003); @@ -542,7 +542,7 @@ bool SimonEngine::hitarea_proc_2(uint a) { if (a >= 20) return false; - string_ptr = getStringPtrByID(_stringid_array_2[a]); + string_ptr = getStringPtrByID(_stringIdArray2[a]); // Arisme : hack for long strings in the French version if ((strlen((const char*)string_ptr) - 1) <= 53) x = (53 - (strlen((const char *)string_ptr) - 1)) * 3; @@ -558,7 +558,7 @@ bool SimonEngine::hitarea_proc_3(Item *item) { uint x; const byte *string_ptr; - if (item == 0 || item == _dummy_item_2 || item == _dummy_item_3) + if (item == 0 || item == _dummyItem2 || item == _dummyItem3) return false; child2 = (Child2 *)findChildOfType(item, 2); diff --git a/simon/vga.cpp b/simon/vga.cpp index 99015475b1..ca9427e63f 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -115,18 +115,18 @@ void SimonEngine::run_vga_script() { for (;;) { uint opcode; - if (_continous_vgascript) { - if (_vc_ptr != (const byte *)&_vc_get_out_of_code) { - fprintf(_dump_file, "%.5d %.5X: %5d %4d ", _vga_tick_counter, _vc_ptr - _cur_vga_file_1, _vga_cur_sprite_id, _vga_cur_file_id); - dump_video_script(_vc_ptr, true); + if (_continousVgaScript) { + if (_vcPtr != (const byte *)&_vc_get_out_of_code) { + fprintf(_dumpFile, "%.5d %.5X: %5d %4d ", _vgaTickCounter, _vcPtr - _curVgaFile1, _vgaCurSpriteId, _vgaCurFileId); + dump_video_script(_vcPtr, true); } } if (!(_game & GF_SIMON2)) { - opcode = READ_BE_UINT16(_vc_ptr); - _vc_ptr += 2; + opcode = READ_BE_UINT16(_vcPtr); + _vcPtr += 2; } else { - opcode = *_vc_ptr++; + opcode = *_vcPtr++; } if (opcode >= NUM_VIDEO_OP_CODES) @@ -147,13 +147,13 @@ int SimonEngine::vc_read_var_or_word() { } uint SimonEngine::vc_read_next_word() { - uint a = READ_BE_UINT16(_vc_ptr); - _vc_ptr += 2; + uint a = READ_BE_UINT16(_vcPtr); + _vcPtr += 2; return a; } uint SimonEngine::vc_read_next_byte() { - return *_vc_ptr++; + return *_vcPtr++; } void SimonEngine::vc_skip_next_instruction() { @@ -183,40 +183,40 @@ void SimonEngine::vc_skip_next_instruction() { if (_game & GF_SIMON2) { uint opcode = vc_read_next_byte(); - _vc_ptr += opcode_param_len_simon2[opcode]; + _vcPtr += opcode_param_len_simon2[opcode]; } else { uint opcode = vc_read_next_word(); - _vc_ptr += opcode_param_len_simon1[opcode]; + _vcPtr += opcode_param_len_simon1[opcode]; } - if (_continous_vgascript) - fprintf(_dump_file, "; skipped\n"); + if (_continousVgaScript) + fprintf(_dumpFile, "; skipped\n"); } void SimonEngine::o_read_vgares_23() { // Simon1 Only - if (_vga_res_328_loaded == true) { - _vga_res_328_loaded = false; - _lock_word |= 0x4000; + if (_vgaRes328Loaded == true) { + _vgaRes328Loaded = false; + _lockWord |= 0x4000; read_vga_from_datfile_1(23); - _lock_word &= ~0x4000; + _lockWord &= ~0x4000; } } void SimonEngine::o_read_vgares_328() { // Simon1 Only - if (_vga_res_328_loaded == false) { - _vga_res_328_loaded = true; - _lock_word |= 0x4000; + if (_vgaRes328Loaded == false) { + _vgaRes328Loaded = true; + _lockWord |= 0x4000; read_vga_from_datfile_1(328); - _lock_word &= ~0x4000; + _lockWord &= ~0x4000; } } // VGA Script commands void SimonEngine::vc_1_dummy_op() { /* dummy opcode */ - _vc_ptr += 6; + _vcPtr += 6; } void SimonEngine::vc_2_call() { @@ -229,43 +229,43 @@ void SimonEngine::vc_2_call() { num = vc_read_var_or_word(); - old_file_1 = _cur_vga_file_1; - old_file_2 = _cur_vga_file_2; + old_file_1 = _curVgaFile1; + old_file_2 = _curVgaFile2; for (;;) { res = num / 100; - vpe = &_vga_buffer_pointers[res]; + vpe = &_vgaBufferPointers[res]; - _cur_vga_file_1 = vpe->vgaFile1; - _cur_vga_file_2 = vpe->vgaFile2; + _curVgaFile1 = vpe->vgaFile1; + _curVgaFile2 = vpe->vgaFile2; if (vpe->vgaFile1 != NULL) break; - if (_vga_cur_file_2 != res) - _video_var_7 = _vga_cur_file_2; + if (_vgaCurFile2 != res) + _videoVar7 = _vgaCurFile2; ensureVgaResLoaded(res); - _video_var_7 = 0xFFFF; + _videoVar7 = 0xFFFF; } - bb = _cur_vga_file_1; + bb = _curVgaFile1; b = bb + READ_BE_UINT16(&((VgaFile1Header *) bb)->hdr2_start); b = bb + READ_BE_UINT16(&((VgaFile1Header2 *) b)->unk2_offs); while (READ_BE_UINT16(&((VgaFile1Struct0x8 *) b)->id) != num) b += sizeof(VgaFile1Struct0x8); - vc_ptr_org = _vc_ptr; + vc_ptr_org = _vcPtr; - _vc_ptr = _cur_vga_file_1 + READ_BE_UINT16(&((VgaFile1Struct0x8 *) b)->script_offs); + _vcPtr = _curVgaFile1 + READ_BE_UINT16(&((VgaFile1Struct0x8 *) b)->script_offs); - //dump_vga_script(_vc_ptr, res, num); + //dump_vga_script(_vcPtr, res, num); run_vga_script(); - _cur_vga_file_1 = old_file_1; - _cur_vga_file_2 = old_file_2; + _curVgaFile1 = old_file_1; + _curVgaFile2 = old_file_2; - _vc_ptr = vc_ptr_org; + _vcPtr = vc_ptr_org; } void SimonEngine::vc_3_new_sprite() { @@ -294,7 +294,7 @@ void SimonEngine::vc_3_new_sprite() { if (has_vga_sprite_with_id(vga_sprite_id, f)) return; - vsp = _vga_sprites; + vsp = _vgaSprites; while (vsp->id) vsp++; @@ -308,21 +308,21 @@ void SimonEngine::vc_3_new_sprite() { vsp->id = vga_sprite_id; vsp->unk7 = res = f; - old_file_1 = _cur_vga_file_1; + old_file_1 = _curVgaFile1; for (;;) { - vpe = &_vga_buffer_pointers[res]; - _cur_vga_file_1 = vpe->vgaFile1; + vpe = &_vgaBufferPointers[res]; + _curVgaFile1 = vpe->vgaFile1; if (vpe->vgaFile1 != NULL) break; - if (_vga_cur_file_2 != res) - _video_var_7 = _vga_cur_file_2; + if (_vgaCurFile2 != res) + _videoVar7 = _vgaCurFile2; ensureVgaResLoaded(res); - _video_var_7 = 0xFFFF; + _videoVar7 = 0xFFFF; } - pp = _cur_vga_file_1; + pp = _curVgaFile1; p = pp + READ_BE_UINT16(&((VgaFile1Header *) pp)->hdr2_start); p = pp + READ_BE_UINT16(&((VgaFile1Header2 *) p)->id_table); @@ -334,7 +334,7 @@ void SimonEngine::vc_3_new_sprite() { static bool dumped = false; if (res == DUMP_FILE_NR && !dumped) { dumped = true; - dump_vga_file(_cur_vga_file_1); + dump_vga_file(_curVgaFile1); } } #endif @@ -344,21 +344,21 @@ void SimonEngine::vc_3_new_sprite() { static bool dumped = false; if (res == DUMP_BITMAPS_FILE_NR && !dumped) { dumped = true; - dump_vga_bitmaps(_cur_vga_file_2, _cur_vga_file_1, res); + dump_vga_bitmaps(_curVgaFile2, _curVgaFile1, res); } } #endif - if (_start_vgascript) - dump_vga_script(_cur_vga_file_1 + READ_BE_UINT16(&((VgaFile1Struct0x6*)p)->script_offs), res, vga_sprite_id); + if (_startVgaScript) + dump_vga_script(_curVgaFile1 + READ_BE_UINT16(&((VgaFile1Struct0x6*)p)->script_offs), res, vga_sprite_id); - add_vga_timer(VGA_DELAY_BASE, _cur_vga_file_1 + READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->script_offs), vga_sprite_id, res); - _cur_vga_file_1 = old_file_1; + add_vga_timer(VGA_DELAY_BASE, _curVgaFile1 + READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->script_offs), vga_sprite_id, res); + _curVgaFile1 = old_file_1; } void SimonEngine::vc_4_dummy_op() { /* dummy opcode */ - _vc_ptr += 6; + _vcPtr += 6; } void SimonEngine::vc_5_skip_if_neq() { @@ -446,7 +446,7 @@ byte *SimonEngine::vc_10_depack_swap(const byte *src, uint w, uint h) { w <<= 3; { - byte *dst_org = _video_buf_1 + w; + byte *dst_org = _videoBuf1 + w; byte color; int8 cur = -0x80; uint w_cur = w; @@ -496,7 +496,7 @@ byte *SimonEngine::vc_10_depack_swap(const byte *src, uint w, uint h) { byte *dst_org, *src_org; uint i; - src_org = dst_org = _video_buf_1 + w; + src_org = dst_org = _videoBuf1 + w; do { byte *dst = dst_org; @@ -512,16 +512,16 @@ byte *SimonEngine::vc_10_depack_swap(const byte *src, uint w, uint h) { } - return _video_buf_1; + return _videoBuf1; } byte *SimonEngine::vc_10_no_depack_swap(const byte *src, uint w, uint h) { - if (src == _vc_10_base_ptr_old) - return _video_buf_1; + if (src == _vc10BasePtrOld) + return _videoBuf1; - _vc_10_base_ptr_old = src; + _vc10BasePtrOld = src; h *= 8; - byte *dst = _video_buf_1 + h - 1; + byte *dst = _videoBuf1 + h - 1; uint h_cur = h; do { @@ -533,7 +533,7 @@ byte *SimonEngine::vc_10_no_depack_swap(const byte *src, uint w, uint h) { dst += h * 2; } while (--w != 0); - return _video_buf_1; + return _videoBuf1; } /* must not be const */ @@ -547,7 +547,7 @@ static uint16 _video_windows[128] = { /* simon2 specific */ void SimonEngine::decodeStripA(byte *dst, const byte *src, int height) { - const uint pitch = _dx_surface_pitch; + const uint pitch = _dxSurfacePitch; int8 reps = (int8)0x80; byte color; byte *dst_org = dst; @@ -603,11 +603,11 @@ void SimonEngine::vc_10_draw() { if (state.image == 0) return; - state.base_color = (_vc_ptr[1] << 4); - _vc_ptr += 2; + state.base_color = (_vcPtr[1] << 4); + _vcPtr += 2; state.x = (int16)vc_read_next_word(); if (_game & GF_SIMON2) { - state.x -= _x_scroll; + state.x -= _xScroll; } state.y = (int16)vc_read_next_word(); @@ -620,8 +620,8 @@ void SimonEngine::vc_10_draw() { if (state.image < 0) state.image = vc_read_var(-state.image); - p2 = _cur_vga_file_2 + state.image * 8; - state.depack_src = _cur_vga_file_2 + READ_BE_UINT32(p2); + p2 = _curVgaFile2 + state.image * 8; + state.depack_src = _curVgaFile2 + READ_BE_UINT32(p2); width = READ_BE_UINT16(p2 + 6) >> 4; height = p2[5]; @@ -630,8 +630,8 @@ void SimonEngine::vc_10_draw() { if (height == 0 || width == 0) return; - if (_dump_images) - dump_single_bitmap(_vga_cur_file_id, state.image, state.depack_src, width * 16, height, + if (_dumpImages) + dump_single_bitmap(_vgaCurFileId, state.image, state.depack_src, width * 16, height, state.base_color); if (flags & 0x80 && !(state.e & 0x10)) { @@ -648,18 +648,18 @@ void SimonEngine::vc_10_draw() { byte *dst; uint w; - _vga_var1 = width * 2 - 40; - _vga_var7 = state.depack_src; - _sprite_height = height; + _vgaVar1 = width * 2 - 40; + _vgaVar7 = state.depack_src; + _spriteHeight = height; if (_variableArray[34] == -1) state.x = _variableArray[251]; - _x_scroll = state.x; + _xScroll = state.x; - vc_write_var(0xfb, _x_scroll); + vc_write_var(0xfb, _xScroll); dst = dx_lock_attached(); - src = state.depack_src + _x_scroll * 4; + src = state.depack_src + _xScroll * 4; for (w = 0; w < 40; w++) { decodeStripA(dst, src + READ_BE_UINT32(src), height); @@ -678,7 +678,7 @@ void SimonEngine::vc_10_draw() { state.depack_src = vc_10_no_depack_swap(state.depack_src, width, height); } - vlut = &_video_windows[_video_palette_mode * 4]; + vlut = &_video_windows[_videoPaletteMode * 4]; state.draw_width = width << 1; /* cl */ state.draw_height = height; /* ch */ @@ -727,10 +727,10 @@ void SimonEngine::vc_10_draw() { state.draw_width <<= 2; state.surf2_addr = dx_lock_2(); - state.surf2_pitch = _dx_surface_pitch; + state.surf2_pitch = _dxSurfacePitch; state.surf_addr = dx_lock_attached(); - state.surf_pitch = _dx_surface_pitch; + state.surf_pitch = _dxSurfacePitch; { uint offs, offs2; @@ -796,7 +796,7 @@ void SimonEngine::vc_10_draw() { } while (++w != state.draw_width); /* vc_10_helper_5 */ - } else if (_lock_word & 0x20 && state.base_color == 0 || state.base_color == 0xC0) { + } else if (_lockWord & 0x20 && state.base_color == 0 || state.base_color == 0xC0) { const byte *src; byte *dst; uint h, i; @@ -907,7 +907,7 @@ void SimonEngine::vc_10_draw() { } /* vc_10_helper_4 */ } else { - if (_game & GF_SIMON2 && state.e & 0x4 && _bit_array[10] & 0x800) { + if (_game & GF_SIMON2 && state.e & 0x4 && _bitArray[10] & 0x800) { state.surf_addr = state.surf2_addr; state.surf_pitch = state.surf2_pitch; } @@ -1009,7 +1009,7 @@ void SimonEngine::vc_10_draw() { } void SimonEngine::vc_11_clear_pathfind_array() { - memset(&_pathfind_array, 0, sizeof(_pathfind_array)); + memset(&_pathFindArray, 0, sizeof(_pathFindArray)); } void SimonEngine::vc_12_delay() { @@ -1019,7 +1019,7 @@ void SimonEngine::vc_12_delay() { if (!(_game & GF_SIMON2)) { num = vc_read_var_or_word(); } else { - num = vc_read_next_byte() * _vga_base_delay; + num = vc_read_next_byte() * _vgaBaseDelay; } // Work around to allow inventory arrows to be @@ -1029,24 +1029,24 @@ void SimonEngine::vc_12_delay() { else num += VGA_DELAY_BASE; - add_vga_timer(num, _vc_ptr, _vga_cur_sprite_id, _vga_cur_file_id); - _vc_ptr = (byte *)&_vc_get_out_of_code; + add_vga_timer(num, _vcPtr, _vgaCurSpriteId, _vgaCurFileId); + _vcPtr = (byte *)&_vc_get_out_of_code; } void SimonEngine::vc_13_set_sprite_offset_x() { VgaSprite *vsp = find_cur_sprite(); vsp->x += (int16)vc_read_next_word(); - _vga_sprite_changed++; + _vgaSpriteChanged++; } void SimonEngine::vc_14_set_sprite_offset_y() { VgaSprite *vsp = find_cur_sprite(); vsp->y += (int16)vc_read_next_word(); - _vga_sprite_changed++; + _vgaSpriteChanged++; } void SimonEngine::vc_15_wakeup_id() { - VgaSleepStruct *vfs = _vga_sleep_structs, *vfs_tmp; + VgaSleepStruct *vfs = _vgaSleepStructs, *vfs_tmp; uint16 id = vc_read_next_word(); while (vfs->ident != 0) { if (vfs->ident == id) { @@ -1062,34 +1062,34 @@ void SimonEngine::vc_15_wakeup_id() { } /* clear a wait event */ - if (id == _vga_wait_for) - _vga_wait_for = 0; + if (id == _vgaWaitFor) + _vgaWaitFor = 0; } void SimonEngine::vc_16_sleep_on_id() { - VgaSleepStruct *vfs = _vga_sleep_structs; + VgaSleepStruct *vfs = _vgaSleepStructs; while (vfs->ident) vfs++; vfs->ident = vc_read_next_word(); - vfs->code_ptr = _vc_ptr; - vfs->sprite_id = _vga_cur_sprite_id; - vfs->cur_vga_file = _vga_cur_file_id; + vfs->code_ptr = _vcPtr; + vfs->sprite_id = _vgaCurSpriteId; + vfs->cur_vga_file = _vgaCurFileId; - _vc_ptr = (byte *)&_vc_get_out_of_code; + _vcPtr = (byte *)&_vc_get_out_of_code; } void SimonEngine::vc_17_set_pathfind_item() { uint a = vc_read_next_word(); - _pathfind_array[a - 1] = (const uint16 *)_vc_ptr; - while (READ_BE_UINT16(_vc_ptr) != 999) - _vc_ptr += 4; - _vc_ptr += 2; + _pathFindArray[a - 1] = (const uint16 *)_vcPtr; + while (READ_BE_UINT16(_vcPtr) != 999) + _vcPtr += 4; + _vcPtr += 2; } void SimonEngine::vc_18_jump_rel() { int16 offs = vc_read_next_word(); - _vc_ptr += offs; + _vcPtr += offs; } /* chain to script? */ @@ -1106,13 +1106,13 @@ void SimonEngine::vc_20_set_code_word() { * back the same word, this time as LE, into the script. */ uint16 a = vc_read_next_word(); - WRITE_LE_UINT16(const_cast<byte *>(_vc_ptr), a); - _vc_ptr += 2; + WRITE_LE_UINT16(const_cast<byte *>(_vcPtr), a); + _vcPtr += 2; } void SimonEngine::vc_21_jump_if_code_word() { int16 a = vc_read_next_word(); - const byte *tmp = _vc_ptr + a; + const byte *tmp = _vcPtr + a; if (_game & GF_SIMON2) tmp += 3; else @@ -1122,7 +1122,7 @@ void SimonEngine::vc_21_jump_if_code_word() { if (val != 0) { // Decrement counter WRITE_LE_UINT16(const_cast<byte *>(tmp), val - 1); - _vc_ptr = tmp + 2; + _vcPtr = tmp + 2; } } @@ -1134,7 +1134,7 @@ void SimonEngine::vc_22_set_sprite_palette() { palptr = &_palette[(a << 6)]; - src = _cur_vga_file_1 + 6 + b * 96; + src = _curVgaFile1 + 6 + b * 96; do { palptr[0] = src[0] << 2; @@ -1146,8 +1146,8 @@ void SimonEngine::vc_22_set_sprite_palette() { src += 3; } while (--num); - _video_var_9 = 2; - _vga_sprite_changed++; + _videoVar9 = 2; + _vgaSpriteChanged++; } void SimonEngine::vc_23_set_sprite_priority() { @@ -1164,10 +1164,10 @@ void SimonEngine::vc_23_set_sprite_priority() { vus2 = vsp; - if (vsp != _vga_sprites && pri < vsp[-1].priority) { + if (vsp != _vgaSprites && pri < vsp[-1].priority) { do { vsp--; - } while (vsp != _vga_sprites && pri < vsp[-1].priority); + } while (vsp != _vgaSprites && pri < vsp[-1].priority); do { memcpy(vus2, vus2 - 1, sizeof(VgaSprite)); } while (--vus2 != vsp); @@ -1183,7 +1183,7 @@ void SimonEngine::vc_23_set_sprite_priority() { } else { vsp->priority = pri; } - _vga_sprite_changed++; + _vgaSpriteChanged++; } void SimonEngine::vc_24_set_sprite_xy() { @@ -1198,7 +1198,7 @@ void SimonEngine::vc_24_set_sprite_xy() { vsp->unk4 = vc_read_next_byte(); } - _vga_sprite_changed++; + _vgaSpriteChanged++; } void SimonEngine::vc_25_halt_sprite() { @@ -1207,8 +1207,8 @@ void SimonEngine::vc_25_halt_sprite() { memcpy(vsp, vsp + 1, sizeof(VgaSprite)); vsp++; } - _vc_ptr = (byte *)&_vc_get_out_of_code; - _vga_sprite_changed++; + _vcPtr = (byte *)&_vc_get_out_of_code; + _vgaSpriteChanged++; } void SimonEngine::vc_26_set_window() { @@ -1224,11 +1224,11 @@ void SimonEngine::vc_27_reset() { VgaSleepStruct *vfs; VgaTimerEntry *vte, *vte2; - _lock_word |= 8; + _lockWord |= 8; memset(&bak, 0, sizeof(bak)); - vsp = _vga_sprites; + vsp = _vgaSprites; while (vsp->id) { if ((_game & GF_SIMON1) && vsp->id == 0x80) { memcpy(&bak, vsp, sizeof(VgaSprite)); @@ -1238,15 +1238,15 @@ void SimonEngine::vc_27_reset() { } if (bak.id != 0) - memcpy(_vga_sprites, &bak, sizeof(VgaSprite)); + memcpy(_vgaSprites, &bak, sizeof(VgaSprite)); - vfs = _vga_sleep_structs; + vfs = _vgaSleepStructs; while (vfs->ident) { vfs->ident = 0; vfs++; } - vte = _vga_timer_list; + vte = _vgaTimerList; while (vte->delay) { if ((_game & GF_SIMON1) && vsp->id == 0x80) { vte++; @@ -1261,12 +1261,12 @@ void SimonEngine::vc_27_reset() { vc_write_var(0xFE, 0); - _lock_word &= ~8; + _lockWord &= ~8; } void SimonEngine::vc_28_dummy_op() { /* unused */ - _vc_ptr += 8; + _vcPtr += 8; } void SimonEngine::vc_29_stop_all_sounds() { @@ -1274,11 +1274,11 @@ void SimonEngine::vc_29_stop_all_sounds() { } void SimonEngine::vc_30_set_base_delay() { - _vga_base_delay = vc_read_next_word(); + _vgaBaseDelay = vc_read_next_word(); } void SimonEngine::vc_31_set_palette_mode() { - _video_palette_mode = vc_read_next_word(); + _videoPaletteMode = vc_read_next_word(); } uint SimonEngine::vc_read_var(uint var) { @@ -1296,32 +1296,32 @@ void SimonEngine::vc_32_copy_var() { } void SimonEngine::vc_33_force_unlock() { - if (_lock_counter != 0) { - _lock_counter = 1; + if (_lockCounter != 0) { + _lockCounter = 1; unlock(); } } void SimonEngine::vc_34_force_lock() { lock(); - _lock_counter = 200; - _left_button_down = 0; + _lockCounter = 200; + _leftButtonDown = 0; } void SimonEngine::vc_35() { /* unused */ - _vc_ptr += 4; - _vga_sprite_changed++; + _vcPtr += 4; + _vgaSpriteChanged++; } void SimonEngine::vc_36_saveload_thing() { - _video_var_8 = false; + _videoVar8 = false; uint vga_res = vc_read_next_word(); uint mode = vc_read_next_word(); if (!(_game & GF_SIMON2)) { if (mode == 16) { - _copy_partial_mode = 2; + _copyPartialMode = 2; } else { set_video_mode_internal(mode, vga_res); } @@ -1333,7 +1333,7 @@ void SimonEngine::vc_36_saveload_thing() { void SimonEngine::vc_37_set_sprite_offset_y() { VgaSprite *vsp = find_cur_sprite(); vsp->y += vc_read_var(vc_read_next_word()); - _vga_sprite_changed++; + _vgaSpriteChanged++; } void SimonEngine::vc_38_skip_if_var_zero() { @@ -1352,23 +1352,23 @@ void SimonEngine::vc_40_var_add() { uint var = vc_read_next_word(); int16 value = vc_read_var(var) + vc_read_next_word(); - if (_game & GF_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { + if (_game & GF_SIMON2 && var == 0xF && !(_bitArray[5] & 1)) { int16 tmp; - if (_vga_var2 != 0) { - if (_vga_var2 >= 0) + if (_vgaVar2 != 0) { + if (_vgaVar2 >= 0) goto no_scroll; - _vga_var2 = 0; + _vgaVar2 = 0; } else { - if (_xscroll_step != 0) + if (_xScrollStep != 0) goto no_scroll; } - if (value - _x_scroll >= 30) { - _vga_var2 = 20; - tmp = _vga_var1 - _x_scroll; + if (value - _xScroll >= 30) { + _vgaVar2 = 20; + tmp = _vgaVar1 - _xScroll; if (tmp < 20) - _vga_var2 = tmp; + _vgaVar2 = tmp; add_vga_timer(6, NULL, 0, 0); /* special timer */ } } @@ -1381,23 +1381,23 @@ void SimonEngine::vc_41_var_sub() { uint var = vc_read_next_word(); int16 value = vc_read_var(var) - vc_read_next_word(); - if (_game & GF_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { + if (_game & GF_SIMON2 && var == 0xF && !(_bitArray[5] & 1)) { int16 tmp; - if (_vga_var2 != 0) { - if (_vga_var2 < 0) + if (_vgaVar2 != 0) { + if (_vgaVar2 < 0) goto no_scroll; - _vga_var2 = 0; + _vgaVar2 = 0; } else { - if (_xscroll_step != 0) + if (_xScrollStep != 0) goto no_scroll; } - if ((uint16)(value - _x_scroll) < 11) { - _vga_var2 = -20; - tmp = _vga_var1 - _x_scroll; - if (_x_scroll < 20) - _vga_var2 = -_x_scroll; + if ((uint16)(value - _xScroll) < 11) { + _vgaVar2 = -20; + tmp = _vgaVar1 - _xScroll; + if (_xScroll < 20) + _vgaVar2 = -_xScroll; add_vga_timer(6, NULL, 0, 0); /* special timer */ } } @@ -1410,8 +1410,8 @@ void SimonEngine::vc_42_delay_if_not_eq() { uint val = vc_read_var(vc_read_next_word()); if (val != vc_read_next_word()) { - add_vga_timer(_vga_base_delay + 1, _vc_ptr - 4, _vga_cur_sprite_id, _vga_cur_file_id); - _vc_ptr = (byte *)&_vc_get_out_of_code; + add_vga_timer(_vgaBaseDelay + 1, _vcPtr - 4, _vgaCurSpriteId, _vgaCurFileId); + _vcPtr = (byte *)&_vc_get_out_of_code; } } @@ -1430,13 +1430,13 @@ void SimonEngine::vc_44_skip_if_bit_set() { void SimonEngine::vc_45_set_sprite_x() { VgaSprite *vsp = find_cur_sprite(); vsp->x = vc_read_var(vc_read_next_word()); - _vga_sprite_changed++; + _vgaSpriteChanged++; } void SimonEngine::vc_46_set_sprite_y() { VgaSprite *vsp = find_cur_sprite(); vsp->y = vc_read_var(vc_read_next_word()); - _vga_sprite_changed++; + _vgaSpriteChanged++; } void SimonEngine::vc_47_add_var_f() { @@ -1448,7 +1448,7 @@ void SimonEngine::vc_48() { uint a = (uint16)_variableArray[12]; uint b = (uint16)_variableArray[13]; int c = _variableArray[14]; - const uint16 *p = _pathfind_array[a - 1]; + const uint16 *p = _pathFindArray[a - 1]; int step; int y1, y2; int16 *vp; @@ -1476,12 +1476,12 @@ void SimonEngine::vc_48() { } void SimonEngine::vc_set_bit_to(uint bit, bool value) { - uint16 *bits = &_bit_array[bit >> 4]; + uint16 *bits = &_bitArray[bit >> 4]; *bits = (*bits & ~(1 << (bit & 15))) | (value << (bit & 15)); } bool SimonEngine::vc_get_bit(uint bit) { - uint16 *bits = &_bit_array[bit >> 4]; + uint16 *bits = &_bitArray[bit >> 4]; return (*bits & (1 << (bit & 15))) != 0; } @@ -1516,17 +1516,17 @@ void SimonEngine::vc_52_play_sound() { void SimonEngine::vc_53_no_op() { /* unused */ - _vc_ptr += 4; + _vcPtr += 4; } void SimonEngine::vc_54_no_op() { /* unused */ - _vc_ptr += 6; + _vcPtr += 6; } void SimonEngine::vc_55_offset_hit_area() { - HitArea *ha = _hit_areas; - uint count = ARRAYSIZE(_hit_areas); + HitArea *ha = _hitAreas; + uint count = ARRAYSIZE(_hitAreas); uint16 id = vc_read_next_word(); int16 x = vc_read_next_word(); int16 y = vc_read_next_word(); @@ -1542,15 +1542,15 @@ void SimonEngine::vc_55_offset_hit_area() { break; } - _need_hitarea_recalc++; + _needHitAreaRecalc++; } void SimonEngine::vc_56_delay() { if (_game & GF_SIMON2) { - uint num = vc_read_var_or_word() * _vga_base_delay; + uint num = vc_read_var_or_word() * _vgaBaseDelay; - add_vga_timer(num + VGA_DELAY_BASE, _vc_ptr, _vga_cur_sprite_id, _vga_cur_file_id); - _vc_ptr = (byte *)&_vc_get_out_of_code; + add_vga_timer(num + VGA_DELAY_BASE, _vcPtr, _vgaCurSpriteId, _vgaCurFileId); + _vcPtr = (byte *)&_vc_get_out_of_code; } } @@ -1570,23 +1570,23 @@ void SimonEngine::vc_59() { } void SimonEngine::vc_58() { - uint sprite = _vga_cur_sprite_id; - uint file = _vga_cur_file_id; + uint sprite = _vgaCurSpriteId; + uint file = _vgaCurFileId; const byte *vc_ptr_org; uint16 tmp; - _vga_cur_file_id = vc_read_next_word(); - _vga_cur_sprite_id = vc_read_next_word(); + _vgaCurFileId = vc_read_next_word(); + _vgaCurSpriteId = vc_read_next_word(); tmp = TO_BE_16(vc_read_next_word()); - vc_ptr_org = _vc_ptr; - _vc_ptr = (byte *)&tmp; + vc_ptr_org = _vcPtr; + _vcPtr = (byte *)&tmp; vc_23_set_sprite_priority(); - _vc_ptr = vc_ptr_org; - _vga_cur_sprite_id = sprite; - _vga_cur_file_id = file; + _vcPtr = vc_ptr_org; + _vgaCurSpriteId = sprite; + _vgaCurFileId = file; } void SimonEngine::vc_57_no_op() { @@ -1600,17 +1600,17 @@ void SimonEngine::vc_kill_sprite(uint file, uint sprite) { VgaTimerEntry *vte; const byte *vc_ptr_org; - old_sprite_id = _vga_cur_sprite_id; - old_cur_file_id = _vga_cur_file_id; - vc_ptr_org = _vc_ptr; + old_sprite_id = _vgaCurSpriteId; + old_cur_file_id = _vgaCurFileId; + vc_ptr_org = _vcPtr; - _vga_cur_file_id = file; - _vga_cur_sprite_id = sprite; + _vgaCurFileId = file; + _vgaCurSpriteId = sprite; - vfs = _vga_sleep_structs; + vfs = _vgaSleepStructs; while (vfs->ident != 0) { - if (vfs->sprite_id == _vga_cur_sprite_id - && (vfs->cur_vga_file == _vga_cur_file_id || !(_game & GF_SIMON2)) + if (vfs->sprite_id == _vgaCurSpriteId + && (vfs->cur_vga_file == _vgaCurFileId || !(_game & GF_SIMON2)) ) { while (vfs->ident != 0) { memcpy(vfs, vfs + 1, sizeof(VgaSleepStruct)); @@ -1625,10 +1625,10 @@ void SimonEngine::vc_kill_sprite(uint file, uint sprite) { if (vsp->id) { vc_25_halt_sprite(); - vte = _vga_timer_list; + vte = _vgaTimerList; while (vte->delay != 0) { - if (vte->sprite_id == _vga_cur_sprite_id - && (vte->cur_vga_file == _vga_cur_file_id || !(_game & GF_SIMON2)) + if (vte->sprite_id == _vgaCurSpriteId + && (vte->cur_vga_file == _vgaCurFileId || !(_game & GF_SIMON2)) ) { delete_vga_timer(vte); break; @@ -1637,9 +1637,9 @@ void SimonEngine::vc_kill_sprite(uint file, uint sprite) { } } - _vga_cur_file_id = old_cur_file_id; - _vga_cur_sprite_id = old_sprite_id; - _vc_ptr = vc_ptr_org; + _vgaCurFileId = old_cur_file_id; + _vgaCurSpriteId = old_sprite_id; + _vcPtr = vc_ptr_org; } void SimonEngine::vc_60_kill_sprite() { @@ -1648,7 +1648,7 @@ void SimonEngine::vc_60_kill_sprite() { if (_game & GF_SIMON2) { file = vc_read_next_word(); } else { - file = _vga_cur_file_id; + file = _vgaCurFileId; } uint sprite = vc_read_next_word(); vc_kill_sprite(file, sprite); @@ -1663,7 +1663,7 @@ void SimonEngine::vc_61_sprite_change() { vsp->y += vc_read_next_word(); vsp->unk4 = 36; - _vga_sprite_changed++; + _vgaSpriteChanged++; } void SimonEngine::vc_62_palette_thing() { @@ -1671,17 +1671,17 @@ void SimonEngine::vc_62_palette_thing() { vc_29_stop_all_sounds(); - if (!_video_var_3) { - _video_var_3 = true; + if (!_videoVar3) { + _videoVar3 = true; - _video_num_pal_colors = 256; - if (_video_palette_mode == 4) - _video_num_pal_colors = 208; + _videoNumPalColors = 256; + if (_videoPaletteMode == 4) + _videoNumPalColors = 208; - memcpy(_video_buf_1, _palette_backup, _video_num_pal_colors * sizeof(uint32)); + memcpy(_videoBuf1, _paletteBackup, _videoNumPalColors * sizeof(uint32)); for (i = NUM_PALETTE_FADEOUT; i != 0; --i) { - palette_fadeout((uint32 *)_video_buf_1, _video_num_pal_colors); - _system->setPalette(_video_buf_1, 0, _video_num_pal_colors); + palette_fadeout((uint32 *)_videoBuf1, _videoNumPalColors); + _system->setPalette(_videoBuf1, 0, _videoNumPalColors); if (_fade) _system->updateScreen(); delay(5); @@ -1691,36 +1691,36 @@ void SimonEngine::vc_62_palette_thing() { uint16 params[5]; /* parameters to vc_10_draw */ VgaSprite *vsp; VgaPointersEntry *vpe; - const byte *vc_ptr_org = _vc_ptr; + const byte *vc_ptr_org = _vcPtr; - vsp = _vga_sprites; + vsp = _vgaSprites; while (vsp->id != 0) { if (vsp->id == 0x80) { - byte *old_file_1 = _cur_vga_file_1; - byte *old_file_2 = _cur_vga_file_2; - uint palmode = _video_palette_mode; + byte *old_file_1 = _curVgaFile1; + byte *old_file_2 = _curVgaFile2; + uint palmode = _videoPaletteMode; - vpe = &_vga_buffer_pointers[vsp->unk7]; - _cur_vga_file_1 = vpe->vgaFile1; - _cur_vga_file_2 = vpe->vgaFile2; - _video_palette_mode = vsp->paletteMode; + vpe = &_vgaBufferPointers[vsp->unk7]; + _curVgaFile1 = vpe->vgaFile1; + _curVgaFile2 = vpe->vgaFile2; + _videoPaletteMode = vsp->paletteMode; params[0] = READ_BE_UINT16(&vsp->image); params[1] = READ_BE_UINT16(&vsp->base_color); params[2] = READ_BE_UINT16(&vsp->x); params[3] = READ_BE_UINT16(&vsp->y); params[4] = READ_BE_UINT16(&vsp->unk4); - _vc_ptr = (byte *)params; + _vcPtr = (byte *)params; vc_10_draw(); - _video_palette_mode = palmode; - _cur_vga_file_1 = old_file_1; - _cur_vga_file_2 = old_file_2; + _videoPaletteMode = palmode; + _curVgaFile1 = old_file_1; + _curVgaFile2 = old_file_2; break; } vsp++; } - _vc_ptr = vc_ptr_org; + _vcPtr = vc_ptr_org; } // Allow one section of Simon the Sorcerer 1 introduction to be displayed @@ -1728,21 +1728,21 @@ void SimonEngine::vc_62_palette_thing() { if ((_game & GF_SIMON1) && (_subroutine == 2923 || _subroutine == 2926)) dx_clear_surfaces(200); else - dx_clear_surfaces(_video_palette_mode == 4 ? 134 : 200); + dx_clear_surfaces(_videoPaletteMode == 4 ? 134 : 200); } if (_game & GF_SIMON2) { - if (_next_music_to_play != -1) - loadMusic(_next_music_to_play); + if (_nextMusicToPlay != -1) + loadMusic(_nextMusicToPlay); } } void SimonEngine::vc_63_palette_thing_2() { - _palette_color_count = 208; - if (_video_palette_mode != 4) { - _palette_color_count = 256; + _paletteColorCount = 208; + if (_videoPaletteMode != 4) { + _paletteColorCount = 256; } - _video_var_3 = false; + _videoVar3 = false; } void SimonEngine::vc_64_skip_if_no_speech() { @@ -1753,14 +1753,14 @@ void SimonEngine::vc_64_skip_if_no_speech() { void SimonEngine::vc_65_palette_thing_3() { // Simon2 - _palette_color_count = 624; - _video_num_pal_colors = 208; - if (_video_palette_mode != 4) { - _palette_color_count = 768; - _video_num_pal_colors = 256; + _paletteColorCount = 624; + _videoNumPalColors = 208; + if (_videoPaletteMode != 4) { + _paletteColorCount = 768; + _videoNumPalColors = 256; } - _palette_color_count |= 0x8000; - _video_var_3 = false; + _paletteColorCount |= 0x8000; + _videoVar3 = false; } void SimonEngine::vc_66_skip_if_nz() { @@ -1869,13 +1869,13 @@ void SimonEngine::vc_72_play_track_2() { void SimonEngine::vc_73_set_op189_flag() { // Simon2 vc_read_next_byte(); - _op_189_flags |= 1 << vc_read_next_byte(); + _op189Flags |= 1 << vc_read_next_byte(); } void SimonEngine::vc_74_clear_op189_flag() { // Simon2 vc_read_next_byte(); - _op_189_flags &= ~(1 << vc_read_next_byte()); + _op189Flags &= ~(1 << vc_read_next_byte()); } } // End of namespace Simon |