From dede1680692e7cd60aedab0d517055abb675104d Mon Sep 17 00:00:00 2001 From: Oliver Kiehl Date: Sat, 1 Mar 2003 22:52:49 +0000 Subject: change GameIDs to GameFeatures svn-id: r6654 --- simon/debug.cpp | 6 +-- simon/intern.h | 33 +++++++------ simon/items.cpp | 36 +++++++------- simon/simon.cpp | 148 ++++++++++++++++++++++++++++---------------------------- simon/sound.cpp | 6 +-- simon/verb.cpp | 14 +++--- simon/vga.cpp | 46 +++++++++--------- 7 files changed, 145 insertions(+), 144 deletions(-) (limited to 'simon') diff --git a/simon/debug.cpp b/simon/debug.cpp index 01d8233527..8fc4f58f04 100644 --- a/simon/debug.cpp +++ b/simon/debug.cpp @@ -42,7 +42,7 @@ byte *SimonState::dumpOpcode(byte *p) st = s = simon1dos_opcode_name_table[opcode]; } else if (_game == GAME_SIMON1TALKIE || _game == GAME_SIMON1WIN) { st = s = simon1talkie_opcode_name_table[opcode]; - } else if (_game == GAME_SIMON2TALKIE || _game & GAME_SIMON2WIN) { + } else if (_game == GAME_SIMON2TALKIE || _game == GAME_SIMON2WIN) { st = s = simon2talkie_opcode_name_table[opcode]; } else { st = s = simon2dos_opcode_name_table[opcode]; @@ -180,7 +180,7 @@ void SimonState::dump_video_script(byte *src, bool one_opcode_only) const char *str, *strn; do { - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { opcode = READ_BE_UINT16_UNALIGNED(src); src += 2; } else { @@ -192,7 +192,7 @@ void SimonState::dump_video_script(byte *src, bool one_opcode_only) return; } - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { strn = str = simon1_video_opcode_name_table[opcode]; } else { strn = str = simon2_video_opcode_name_table[opcode]; diff --git a/simon/intern.h b/simon/intern.h index 9128f024a2..c1e66a0958 100644 --- a/simon/intern.h +++ b/simon/intern.h @@ -132,25 +132,26 @@ struct GameSpecificSettings { const char *gamepc_filename; }; -// TODO: the following really should be turned into GameFeatures... enum { - GAME_SIMON2 = 1 << 0, - GAME_WIN = 1 << 1, - GAME_TALKIE = 1 << 2, - GAME_DEMO = 1 << 3, - GAME_MAC = 1 << 4, - GAME_AMIGA = 1 << 5, + GF_SIMON2 = 1 << 0, + GF_WIN = 1 << 1, + GF_TALKIE = 1 << 2, + GF_DEMO = 1 << 3, + GF_MAC = 1 << 4, + GF_AMIGAS = 1 << 5 // rename to GF_AMIGA once the scumm GF_* have been removed from gameDetector.h +}; +enum { GAME_SIMON1DOS = 0, - GAME_SIMON2DOS = GAME_SIMON2, - GAME_SIMON1TALKIE = GAME_TALKIE, - GAME_SIMON2TALKIE = GAME_SIMON2 + GAME_TALKIE, - GAME_SIMON1WIN = GAME_WIN + GAME_TALKIE, - GAME_SIMON2WIN = GAME_SIMON2 + GAME_WIN + GAME_TALKIE, - GAME_SIMON1DEMO = GAME_DEMO, - GAME_SIMON2MAC = GAME_SIMON2WIN + GAME_MAC, - GAME_SIMON1AMIGA = GAME_AMIGA, - GAME_SIMON1CD32 = GAME_SIMON1TALKIE + GAME_AMIGA + GAME_SIMON2DOS = GF_SIMON2, + GAME_SIMON1TALKIE = GF_TALKIE, + GAME_SIMON2TALKIE = GF_SIMON2 | GF_TALKIE, + GAME_SIMON1WIN = GF_WIN | GF_TALKIE, + GAME_SIMON2WIN = GF_SIMON2 | GF_WIN | GF_TALKIE, + GAME_SIMON1DEMO = GF_DEMO, + GAME_SIMON2MAC = GF_SIMON2 | GF_WIN | GF_TALKIE | GF_MAC, + GAME_SIMON1AMIGA = GF_AMIGAS, + GAME_SIMON1CD32 = GF_TALKIE | GF_AMIGAS }; #endif diff --git a/simon/items.cpp b/simon/items.cpp index 825f51759a..01247b1b88 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -371,7 +371,7 @@ int SimonState::runScript() uint string_id = getNextStringID(); if (var < 20) { _stringid_array_3[var] = string_id; - if (_game & GAME_TALKIE) + if (_game & GF_TALKIE) _array_4[var] = getNextWord(); } } @@ -389,7 +389,7 @@ int SimonState::runScript() case 70:{ /* show string from array */ const char *str = (const char *)getStringPtrByID(_stringid_array_3[getVarOrByte()]); - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { writeVariable(51, strlen(str) / 53 * 8 + 8); } @@ -438,7 +438,7 @@ int SimonState::runScript() break; case 83:{ /* restart subroutine */ - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) o_83_helper(); return -10; } @@ -515,7 +515,7 @@ int SimonState::runScript() break; case 98:{ /* start vga */ - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { uint b = getVarOrWord(); uint c = getVarOrByte(); uint d = getVarOrWord(); @@ -535,7 +535,7 @@ int SimonState::runScript() break; case 99:{ /* kill thread */ - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { o_unk_99_simon1(getVarOrWord()); } else { uint a = getVarOrWord(); @@ -990,7 +990,7 @@ int SimonState::runScript() const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]); ThreeValues *tv = getThreeValues(b); - if (_game & GAME_TALKIE) + if (_game & GF_TALKIE) d = _array_4[a]; if (d != 0 && !_vk_t_toggle) { @@ -1008,7 +1008,7 @@ int SimonState::runScript() case 181:{ /* force lock */ o_force_lock(); - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { fcs_unk_2(1); showMessageFormat("\xC"); } @@ -1016,14 +1016,14 @@ int SimonState::runScript() break; case 182:{ /* read vgares 328 */ - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) goto invalid_opcode; o_read_vgares_328(); } break; case 183:{ /* read vgares 23 */ - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) goto invalid_opcode; o_read_vgares_23(); } @@ -1035,7 +1035,7 @@ int SimonState::runScript() break; case 185:{ - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) goto invalid_opcode; _midi_sfx = getVarOrWord(); } @@ -1047,14 +1047,14 @@ int SimonState::runScript() break; case 187:{ /* fade to black */ - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) goto invalid_opcode; o_fade_to_black(); } break; case 188: /* string2 is */ - if (!(_game & GAME_SIMON2)) + if (!(_game & GF_SIMON2)) goto invalid_opcode; { uint i = getVarOrByte(); @@ -1064,7 +1064,7 @@ int SimonState::runScript() break; case 189:{ - if (!(_game & GAME_SIMON2)) + if (!(_game & GF_SIMON2)) goto invalid_opcode; _op_189_flags = 0; } @@ -1072,7 +1072,7 @@ int SimonState::runScript() case 190:{ uint i; - if (!(_game & GAME_SIMON2)) + if (!(_game & GF_SIMON2)) goto invalid_opcode; i = getVarOrByte(); if (!(_op_189_flags & (1 << i))) @@ -1246,7 +1246,7 @@ void SimonState::o_177() if (!_vk_t_toggle) talk_with_speech(child->array[offs] + 3550, a); } - } else if (_game == GAME_SIMON2TALKIE || _game & GAME_SIMON2WIN) { + } else if (_game == GAME_SIMON2TALKIE || _game == GAME_SIMON2WIN) { if (child != NULL && child->avail_props & 0x200) { uint var200 = child->array[getOffsetOfChild2Param(child, 0x200)]; @@ -1456,7 +1456,7 @@ void SimonState::o_unk_127() { uint a = getVarOrWord(); uint b = getVarOrWord(); - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { uint c = getVarOrByte(); if (_debugMode) @@ -1471,7 +1471,7 @@ void SimonState::o_unk_127() _vc70_var1 = 0xffff; _vc72_var3 = 0xffff; _midi_unk2 = 0xffff; - if (_game & GAME_WIN) { + if (_game & GF_WIN) { midi.initialize(); midi.play(); } @@ -1494,7 +1494,7 @@ void SimonState::o_unk_127() void SimonState::o_unk_120(uint a) { uint16 id = TO_BE_16(a); - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { _lock_word |= 0x8000; _vc_ptr = (byte *)&id; vc_15_wakeup_id(); diff --git a/simon/simon.cpp b/simon/simon.cpp index c86d74ff7f..33bb77d587 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -38,20 +38,20 @@ extern bool draw_keyboard; static const VersionSettings simon_settings[] = { /* Simon the Sorcerer 1 & 2 (not SCUMM games) */ - {"simon1dos", "Simon the Sorcerer 1 for DOS", GID_SIMON_FIRST+0, 99, 99, 99, 0, "GAMEPC"}, - {"simon1amiga", "Simon the Sorcerer 1 for Amiga", GID_SIMON_FIRST+GAME_SIMON1AMIGA, 99, 99, 99, 0, "gameamiga"}, - {"simon2dos", "Simon the Sorcerer 2 for DOS", GID_SIMON_FIRST+GAME_SIMON2DOS, 99, 99, 99, 0, "GAME32"}, - {"simon1talkie", "Simon the Sorcerer 1 Talkie for DOS", GID_SIMON_FIRST+GAME_SIMON1TALKIE, 99, 99, 99, 0, "SIMON.GME"}, - {"simon2talkie", "Simon the Sorcerer 2 Talkie for DOS", GID_SIMON_FIRST+GAME_SIMON2TALKIE, 99, 99, 99, 0, "GSPTR30"}, - {"simon2talkie", "Simon the Sorcerer 2 Talkie for DOS", GID_SIMON_FIRST+GAME_SIMON2TALKIE, 99, 99, 99, 0, "GSPTR30."}, - {"simon1win", "Simon the Sorcerer 1 Talkie for Windows", GID_SIMON_FIRST+GAME_SIMON1WIN, 99, 99, 99, 0, "SIMON.GME"}, - {"simon1cd32", "Simon the Sorcerer 1 Talkie for Amiga CD32", GID_SIMON_FIRST+GAME_SIMON1CD32, 99, 99, 99, 0, "gameamiga"}, - {"simon2win", "Simon the Sorcerer 2 Talkie for Windows", GID_SIMON_FIRST+GAME_SIMON2WIN, 99, 99, 99, 0, "GSPTR30"}, - {"simon2win", "Simon the Sorcerer 2 Talkie for Windows", GID_SIMON_FIRST+GAME_SIMON2WIN, 99, 99, 99, 0, "GSPTR30."}, - {"simon2amiga", "Simon the Sorcerer 2 Talkie for Amiga", GID_SIMON_FIRST+GAME_SIMON2MAC, 99, 99, 99, 0, "GSPTR30"}, - {"simon2mac", "Simon the Sorcerer 2 Talkie for Mac", GID_SIMON_FIRST+GAME_SIMON2MAC, 99, 99, 99, 0, "GSPTR30"}, - {"simon1demo", "Simon the Sorcerer 1 for DOS (Demo)", GID_SIMON_FIRST+GAME_SIMON1DEMO, 99, 99, 99, 0, "GDEMO"}, - {"simon2demo", "Simon the Sorcerer 2 Talkie for DOS (Demo)", GID_SIMON_FIRST+GAME_SIMON2TALKIE, 99, 99, 99, 0, "GSPTR30"}, + {"simon1dos", "Simon the Sorcerer 1 for DOS", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON1DOS, "GAMEPC"}, + {"simon1amiga", "Simon the Sorcerer 1 for Amiga", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON1AMIGA, "gameamiga"}, + {"simon2dos", "Simon the Sorcerer 2 for DOS", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON2DOS, "GAME32"}, + {"simon1talkie", "Simon the Sorcerer 1 Talkie for DOS", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON1TALKIE, "SIMON.GME"}, + {"simon2talkie", "Simon the Sorcerer 2 Talkie for DOS", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON2TALKIE, "GSPTR30"}, + {"simon2talkie", "Simon the Sorcerer 2 Talkie for DOS", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON2TALKIE, "GSPTR30."}, + {"simon1win", "Simon the Sorcerer 1 Talkie for Windows", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON1WIN, "SIMON.GME"}, + {"simon1cd32", "Simon the Sorcerer 1 Talkie for Amiga CD32", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON1CD32, "gameamiga"}, + {"simon2win", "Simon the Sorcerer 2 Talkie for Windows", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON2WIN, "GSPTR30"}, + {"simon2win", "Simon the Sorcerer 2 Talkie for Windows", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON2WIN, "GSPTR30."}, + {"simon2amiga", "Simon the Sorcerer 2 Talkie for Amiga", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON2MAC, "GSPTR30"}, + {"simon2mac", "Simon the Sorcerer 2 Talkie for Mac", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON2MAC, "GSPTR30"}, + {"simon1demo", "Simon the Sorcerer 1 for DOS (Demo)", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON1DEMO, "GDEMO"}, + {"simon2demo", "Simon the Sorcerer 2 Talkie for DOS (Demo)", GID_SIMON_FIRST, 99, 99, 99, GAME_SIMON2TALKIE, "GSPTR30"}, {NULL, NULL, 0, 0, 0, 0, 0, NULL} }; @@ -191,7 +191,7 @@ SimonState::SimonState(GameDetector *detector, OSystem *syst) driver = MidiDriver_NULL_create(); midi.set_driver(driver); - _game = detector->_gameId - GID_SIMON_FIRST; + _game = detector->_features; /* Setup mixer */ if (!_mixer->bindToSystem(syst)) @@ -870,7 +870,7 @@ void SimonState::loadTablesIntoMem(uint subr_id) memcpy(filename, "SFXXXX", 6); if (_game == GAME_SIMON1WIN) _sound->readSfxFile(filename, _gameDataPath); - else if (_game & GAME_SIMON2) { + else if (_game & GF_SIMON2) { _sound->loadSfxTable(_game_file, _game_offsets_ptr[atoi(filename + 6) - 1 + gss->SOUND_INDEX_BASE]); } @@ -1009,7 +1009,7 @@ void SimonState::closeTablesFile_simon1(File *in) uint SimonState::loadTextFile(const char *filename, byte *dst) { - if (_game & GAME_AMIGA || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) + if (_game & GF_AMIGAS || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) return loadTextFile_simon1(filename, dst); else return loadTextFile_gme(filename, dst); @@ -1017,7 +1017,7 @@ uint SimonState::loadTextFile(const char *filename, byte *dst) File *SimonState::openTablesFile(const char *filename) { - if (_game & GAME_AMIGA || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) + if (_game & GF_AMIGAS || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) return openTablesFile_simon1(filename); else return openTablesFile_gme(filename); @@ -1025,7 +1025,7 @@ File *SimonState::openTablesFile(const char *filename) void SimonState::closeTablesFile(File *in) { - if (_game & GAME_AMIGA || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) + if (_game & GF_AMIGAS || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) closeTablesFile_simon1(in); else closeTablesFile_gme(in); @@ -1167,7 +1167,7 @@ void SimonState::setup_cond_c_helper() { HitArea *last; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { _mouse_cursor = 0; if (_hitarea_unk_4 != 999) { _mouse_cursor = 9; @@ -1285,7 +1285,7 @@ void SimonState::handle_mouse_moved() hitarea_proc_1(); } - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (_bit_array[4] & 0x8000) { if (!_vga_var9) { if (_mouse_x >= 630 / 2 || _mouse_x < 9) @@ -1341,7 +1341,7 @@ void SimonState::fcs_unk_proc_1(uint fcs_index, Item *item_ptr, int unk1, int un fcs_ptr = _fcs_ptr_array_3[fcs_index & 7]; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { width_div_3 = fcs_ptr->width / 3; height_div_3 = fcs_ptr->height / 3; } else { @@ -1370,7 +1370,7 @@ void SimonState::fcs_unk_proc_1(uint fcs_index, Item *item_ptr, int unk1, int un num_sibs_with_flag = 0; while (item_ptr && width_div_3 > num_sibs_with_flag) { if ((unk2 == 0 || item_ptr->unk4 & unk2) && has_item_childflag_0x10(item_ptr)) - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { num_sibs_with_flag++; } else { num_sibs_with_flag += 20; @@ -1394,7 +1394,7 @@ void SimonState::fcs_unk_proc_1(uint fcs_index, Item *item_ptr, int unk1, int un if ((unk2 == 0 || item_ptr->unk4 & unk2) && has_item_childflag_0x10(item_ptr)) { if (item_again == false) { fcs_ptr->fcs_data->e[k].item = item_ptr; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { draw_icon_c(fcs_ptr, item_get_icon_number(item_ptr), x_pos * 3, y_pos); fcs_ptr->fcs_data->e[k].hit_area = setup_icon_hit_area(fcs_ptr, x_pos * 3, y_pos, @@ -1409,12 +1409,12 @@ void SimonState::fcs_unk_proc_1(uint fcs_index, Item *item_ptr, int unk1, int un fcs_ptr->fcs_data->e[k].item = NULL; j = 1; } - x_pos += (_game & GAME_SIMON2) ? 20 : 1; + x_pos += (_game & GF_SIMON2) ? 20 : 1; if (x_pos >= width_div_3) { x_pos = 0; - y_pos += (_game & GAME_SIMON2) ? 20 : 1; + y_pos += (_game & GF_SIMON2) ? 20 : 1; if (y_pos >= height_div_3) item_again = true; } @@ -1443,7 +1443,7 @@ void SimonState::setup_hit_areas(FillOrCopyStruct *fcs, uint fcs_index) ha = findEmptyHitArea(); _scroll_up_hit_area = ha - _hit_areas; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { ha->x = 308; ha->y = 149; ha->width = 12; @@ -1468,7 +1468,7 @@ void SimonState::setup_hit_areas(FillOrCopyStruct *fcs, uint fcs_index) ha = findEmptyHitArea(); _scroll_down_hit_area = ha - _hit_areas; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { ha->x = 308; ha->y = 176; ha->width = 12; @@ -1517,7 +1517,7 @@ uint SimonState::item_get_icon_number(Item *item) void SimonState::loadIconFile() { File in; - if (_game & GAME_AMIGA) + if (_game & GF_AMIGAS) in.open("icon.pkd", _gameDataPath); else in.open("ICON.DAT", _gameDataPath); @@ -1544,7 +1544,7 @@ uint SimonState::setup_icon_hit_area(FillOrCopyStruct *fcs, uint x, uint y, uint ha = findEmptyHitArea(); - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { ha->x = (x + fcs->x) << 3; ha->y = y * 25 + fcs->y; ha->item_ptr = item_ptr; @@ -1666,7 +1666,7 @@ startOver: _last_hitarea = NULL; _last_hitarea_3 = NULL; for (;;) { - if (_game & GAME_SIMON2 && _key_pressed == 35) + if (_game & GF_SIMON2 && _key_pressed == 35) f10_key(); processSpecialKeys(); if (_last_hitarea_3 == (HitArea *) 0xFFFFFFFF) @@ -1725,7 +1725,7 @@ void SimonState::hitarea_stuff_helper() { time_t cur_time; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { uint subr_id = _variableArray[0x1FC / 2]; if (subr_id != 0) { Subroutine *sub = getSubroutineByID(subr_id); @@ -1866,7 +1866,7 @@ void SimonState::handle_verb_clicked(uint verb) if (sub) startSubroutine(sub); - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) _run_script_return_1 = false; startUp_helper_2(); @@ -1899,7 +1899,7 @@ void SimonState::o_print_str() uint speech_id = 0; ThreeValues *tv; - if (_game & GAME_TALKIE) { + if (_game & GF_TALKIE) { if (string_id != 0xFFFF) string_ptr = getStringPtrByID(string_id); @@ -2115,7 +2115,7 @@ void SimonState::set_video_mode_internal(uint mode, uint vga_res_id) if (vga_res_id == 0) { - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { _unk_pal_flag = true; } else { _dx_use_3_or_4_for_lock = true; @@ -2147,7 +2147,7 @@ void SimonState::set_video_mode_internal(uint mode, uint vga_res_id) while (READ_BE_UINT16_UNALIGNED(&((VgaFile1Struct0x8 *) b)->id) != vga_res_id) b += sizeof(VgaFile1Struct0x8); - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { if (num == 16300) { dx_clear_attached_from_top(134); _use_palette_delay = true; @@ -2170,7 +2170,7 @@ void SimonState::set_video_mode_internal(uint mode, uint vga_res_id) _vc_ptr = vc_ptr_org; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (!_dx_use_3_or_4_for_lock) { uint num_lines = _video_palette_mode == 4 ? 134 : 200; _vga_var8 = num_lines; @@ -2191,7 +2191,7 @@ void SimonState::set_video_mode_internal(uint mode, uint vga_res_id) /* XXX: fix */ - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { if (_unk_pal_flag) { _unk_pal_flag = false; while (*(volatile int *)&_palette_color_count != 0) { @@ -2269,7 +2269,7 @@ void SimonState::delete_vga_timer(VgaTimerEntry * vte) void SimonState::expire_vga_timers() { - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { VgaTimerEntry *vte = _vga_timer_list; _vga_tick_counter++; @@ -2381,14 +2381,14 @@ void SimonState::add_vga_timer(uint num, byte *code_ptr, uint cur_sprite, uint c void SimonState::o_force_unlock() { - if (_game & GAME_SIMON2 && _bit_array[4] & 0x8000) + if (_game & GF_SIMON2 && _bit_array[4] & 0x8000) _mouse_cursor = 0; _lock_counter = 0; } void SimonState::o_force_lock() { - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { _lock_word |= 0x8000; vc_34_force_lock(); _lock_word &= ~0x8000; @@ -2653,7 +2653,7 @@ void SimonState::o_wait_for_vga(uint a) _system->show_mouse(false); while (_vga_wait_for != 0) { if (_skip_speech) { - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (_vga_wait_for == 200 && !vc_get_bit(14)) { skip_speech(); break; @@ -2671,7 +2671,7 @@ void SimonState::o_wait_for_vga(uint a) delay(10); - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (_timer_1 >= 1000) { warning("wait timed out"); break; @@ -2711,7 +2711,7 @@ void SimonState::timer_vga_sprites() fprintf(_dump_file, "***\n"); #endif - if (_game & GAME_SIMON2 && _vga_var3) { + if (_game & GF_SIMON2 && _vga_var3) { timer_vga_sprites_helper(); } @@ -2730,7 +2730,7 @@ void SimonState::timer_vga_sprites() params[2] = READ_BE_UINT16_UNALIGNED(&vsp->x); params[3] = READ_BE_UINT16_UNALIGNED(&vsp->y); - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { *(byte *)(¶ms[4]) = (byte)vsp->unk4; } else { params[4] = READ_BE_UINT16_UNALIGNED(&vsp->unk4); @@ -2832,10 +2832,10 @@ void SimonState::timer_proc1() { _timer_4++; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (_lock_word & 0x80E9 || _lock_word & 2) return; - } else if (_game & GAME_TALKIE) { + } else if (_game & GF_TALKIE) { if (_lock_word & 0xC0E9 || _lock_word & 2) return; } else if (_lock_word & 0x8000 || _lock_word & 0xE9 || _lock_word & 2) @@ -2846,7 +2846,7 @@ void SimonState::timer_proc1() _lock_word |= 2; if (!(_lock_word & 0x10)) { - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { expire_vga_timers(); expire_vga_timers(); _sync_flag_2 ^= 1; @@ -2932,7 +2932,7 @@ void SimonState::fcs_setTextColor(FillOrCopyStruct *fcs, uint value) void SimonState::o_vga_reset() { - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { _lock_word |= 0x8000; vc_27_reset(); _lock_word &= ~0x8000; @@ -3064,7 +3064,7 @@ void SimonState::o_pathfind(int x, int y, uint var_1, uint var_2) uint x_diff, y_diff; uint best_i = 0, best_j = 0, best_dist = 0xFFFFFFFF; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { x += _x_scroll * 8; } @@ -3136,7 +3136,7 @@ void SimonState::fcs_unk1(uint fcs_index) /* ok */ void SimonState::fcs_unk_5(FillOrCopyStruct *fcs, uint fcs_index) { - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { o_unk_99_simon1(0x80); } } @@ -3173,7 +3173,7 @@ void SimonState::copy_img_from_3_to_2(FillOrCopyStruct *fcs) { _lock_word |= 0x8000; - if (!(_game & GAME_SIMON2)) { + 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); } else { if (_vga_var6 && _fcs_ptr_array_3[2] == fcs) { @@ -3209,7 +3209,7 @@ void SimonState::video_erase(FillOrCopyStruct *fcs) VgaSprite *SimonState::find_cur_sprite() { - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { VgaSprite *vsp = _vga_sprites; while (vsp->id) { if (vsp->id == _vga_cur_sprite_id && vsp->unk7 == _vga_cur_file_id) @@ -3230,7 +3230,7 @@ VgaSprite *SimonState::find_cur_sprite() bool SimonState::has_vgastruct_with_id(uint16 id, uint16 file) { - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { VgaSprite *vsp = _vga_sprites; while (vsp->id) { if (vsp->id == id && vsp->unk7 == file) @@ -3257,12 +3257,12 @@ void SimonState::processSpecialKeys() break; case 63: // F5 - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) _exit_cutscene = true; break; case 't': - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) _vk_t_toggle ^= 1; break; @@ -3505,7 +3505,7 @@ static const byte _simon2_cursors[10][256] = { void SimonState::draw_mouse_pointer() { - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) _system->set_mouse_cursor(_simon2_cursors[_mouse_cursor], 16, 16, 7, 7); else _system->set_mouse_cursor(_simon1_cursor, 16, 16, 0, 0); @@ -3578,7 +3578,7 @@ void SimonState::draw_icon_c(FillOrCopyStruct *fcs, uint icon, uint x, uint y) byte *dst; byte *src; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { _lock_word |= 0x8000; dst = dx_lock_2(); @@ -4045,7 +4045,7 @@ void SimonState::start_vga_code(uint b, uint vga_res, uint vga_struct_id, uint c void SimonState::talk_with_speech(uint speech_id, uint num_1) { - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { if (speech_id == 9999) { if (!(_bit_array[0] & 0x4000) && !(_bit_array[1] & 0x1000)) { _bit_array[0] |= 0x4000; @@ -4114,7 +4114,7 @@ void SimonState::talk_with_text(uint num_1, uint num_2, const char *string_ptr, len_div_3 = (strlen(string_ptr) + 3) / 3; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { if (_variableArray[141] == 0) _variableArray[141] = 9; _variableArray[85] = _variableArray[141] * len_div_3; @@ -4331,7 +4331,7 @@ void SimonState::talk_with_text(uint num_1, uint num_2, const char *string_ptr, } strcpy(char_buf, string_ptr_2); - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { o_unk_99_simon1(199 + num_1); } else { o_unk_99_simon2(2, num_1); @@ -4346,7 +4346,7 @@ void SimonState::talk_with_text(uint num_1, uint num_2, const char *string_ptr, if (threeval_b < 2) threeval_b = 2; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { start_vga_code(num_of_rows, 2, 199 + num_1, threeval_a >> 3, threeval_b, 12); } else { start_vga_code(num_of_rows, 2, num_1, threeval_a >> 3, threeval_b, 12); @@ -4496,7 +4496,7 @@ void SimonState::print_char_helper_6(uint i) void SimonState::read_vga_from_datfile_1(uint vga_id) { - if (_game & GAME_AMIGA || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) { + if (_game & GF_AMIGAS || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) { File in; char buf[50]; uint32 size; @@ -4533,7 +4533,7 @@ void SimonState::read_vga_from_datfile_1(uint vga_id) byte *SimonState::read_vga_from_datfile_2(uint id) { - if (_game & GAME_AMIGA || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) { + if (_game & GF_AMIGAS || _game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) { File in; char buf[50]; uint32 size; @@ -4583,7 +4583,7 @@ void SimonState::resfile_read(void *dst, uint32 offs, uint32 size) void SimonState::openGameFile() { - if (!(_game & GAME_AMIGA) && _game != GAME_SIMON1DEMO && _game != GAME_SIMON1DOS) { + if (!(_game & GF_AMIGAS) && _game != GAME_SIMON1DEMO && _game != GAME_SIMON1DOS) { _game_file = new File(); _game_file->open(gss->gme_filename, _gameDataPath); @@ -4727,7 +4727,7 @@ void SimonState::dx_update_screen_and_palette() memcpy(_sdl_buf_attached, _sdl_buf, 320 * 200); if (_palette_color_count != 0) { - if (!(_game & GAME_SIMON2) && _use_palette_delay) { + if (!(_game & GF_SIMON2) && _use_palette_delay) { delay(100); _use_palette_delay = false; } @@ -4798,7 +4798,7 @@ void SimonState::go() gss = &simon2win_settings; } else if (_game == GAME_SIMON2DOS) { gss = &simon2dos_settings; - } else if (_game & GAME_AMIGA) { + } else if (_game & GF_AMIGAS) { gss = &simon1amiga_settings; } else if (_game == GAME_SIMON1DEMO) { gss = &simon1demo_settings; @@ -4910,7 +4910,7 @@ void SimonState::delay(uint amount) break; case OSystem::EVENT_RBUTTONDOWN: - if (_game & GAME_SIMON2) + if (_game & GF_SIMON2) _skip_speech = true; else _exit_cutscene = true; @@ -5026,7 +5026,7 @@ char *SimonState::gen_savename(int slot) { static char buf[256]; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { sprintf(buf, "simon2.%.3d", slot); } else { sprintf(buf, "simon1.%.3d", slot); @@ -5153,8 +5153,8 @@ void SimonState::playMusic(uint music_unk, uint music) if (midi._midi_sfx_toggle) return; - if (_game & GAME_SIMON2) { // Simon 2 music - if (_game & GAME_WIN) { + if (_game & GF_SIMON2) { // Simon 2 music + if (_game & GF_WIN) { midi.shutdown(); _game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music - 1], SEEK_SET); midi.read_all_songs(_game_file, music); @@ -5169,12 +5169,12 @@ void SimonState::playMusic(uint music_unk, uint music) _vc70_var1 = 0xFFFF; _vc72_var3 = 0xFFFF; _midi_unk2 = 0xFFFF; - } else if (!(_game & GAME_DEMO) && !(_game & GAME_AMIGA)){ // Simon 1 music + } else if (!(_game & GF_DEMO) && !(_game & GF_AMIGAS)){ // Simon 1 music midi.shutdown(); - if (_game & GAME_WIN) { + if (_game & GF_WIN) { _game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET); midi.read_all_songs(_game_file, music); - } else if (_game & GAME_TALKIE) { + } else if (_game & GF_TALKIE) { _game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET); midi.read_all_songs_old(_game_file, music); } else { diff --git a/simon/sound.cpp b/simon/sound.cpp index 2c5adf89bb..1e58257fcd 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -66,7 +66,7 @@ SimonSound::SimonSound(const byte game, const GameSpecificSettings *gss, const c file->open(gss->mp3_filename, gameDataPath); if (file->isOpen() == false) { #endif - if (_game & GAME_WIN) { + if (_game & GF_WIN) { s = gss->wav_filename; file->open(s, gameDataPath); if (file->isOpen() == false) { @@ -75,7 +75,7 @@ SimonSound::SimonSound(const byte game, const GameSpecificSettings *gss, const c _voice_file = true; _voice = new WavSound(_mixer, file); } - } else if (_game & GAME_TALKIE) { + } else if (_game & GF_TALKIE) { s = gss->voc_filename; file->open(s, gameDataPath); if (file->isOpen() == false) { @@ -141,7 +141,7 @@ void SimonSound::loadSfxTable(File *gameFile, uint32 base) { stopAll(); - if (_game & GAME_WIN) + if (_game & GF_WIN) _effects = new WavSound(_mixer, gameFile, base); else _effects = new VocSound(_mixer, gameFile, base); diff --git a/simon/verb.cpp b/simon/verb.cpp index 38334e5c1c..0f00e8f1a8 100644 --- a/simon/verb.cpp +++ b/simon/verb.cpp @@ -82,7 +82,7 @@ void SimonState::defocusHitarea() HitArea *last; HitArea *ha; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (_bit_array[4] & 0x8000) { o_unk_120(202); _last_hitarea_2_ptr = NULL; @@ -151,7 +151,7 @@ void SimonState::hitareaChangedHelper() { FillOrCopyStruct *fcs; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (_bit_array[4] & 0x8000) return; } @@ -258,7 +258,7 @@ void SimonState::hitarea_proc_1() uint id; HitArea *ha; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { id = 2; if (!(_bit_array[4] & 0x8000)) id = (_mouse_y >= 136) ? 102 : 101; @@ -289,7 +289,7 @@ void SimonState::handle_verb_hitarea(HitArea * ha) if (ha == tmp) return; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { if (tmp != NULL) { tmp->flags |= 8; video_toggle_colors(tmp, 0xd5, 0xd0, 0xd5, 0xA); @@ -315,7 +315,7 @@ void SimonState::handle_verb_hitarea(HitArea * ha) void SimonState::hitarea_leave(HitArea * ha) { - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { video_toggle_colors(ha, 0xdf, 0xd5, 0xda, 5); } else { video_toggle_colors(ha, 0xe7, 0xe5, 0xe6, 1); @@ -363,7 +363,7 @@ void SimonState::setup_hitarea_from_pos(uint x, uint y, uint mode) uint16 x_ = x; const uint16 y_ = y; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (_bit_array[4] & 0x8000 || y < 134) { x_ += _x_scroll * 8; } @@ -435,7 +435,7 @@ bool SimonState::hitarea_proc_2(uint a) uint x; const byte *string_ptr; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (_bit_array[4] & 0x8000) { Subroutine *sub; _variableArray[84] = a; diff --git a/simon/vga.cpp b/simon/vga.cpp index f35fda69b5..1e29de9d16 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -120,7 +120,7 @@ if (_continous_vgascript) { } } - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { opcode = READ_BE_UINT16_UNALIGNED(_vc_ptr); _vc_ptr += 2; } else { @@ -184,7 +184,7 @@ void SimonState::vc_skip_next_instruction() 4, 2, 2 }; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { uint opcode = vc_read_next_byte(); _vc_ptr += opcode_param_len_simon2[opcode]; } else { @@ -283,7 +283,7 @@ void SimonState::vc_3_new_thread() a = vc_read_next_word(); /* 0 */ - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { f = vc_read_next_word(); /* 0 */ b = vc_read_next_word(); /* 2 */ } else { @@ -606,12 +606,12 @@ void SimonState::vc_10_draw() state.base_color = (_vc_ptr[1] << 4); _vc_ptr += 2; state.x = (int16)vc_read_next_word(); - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { state.x -= _x_scroll; } state.y = (int16)vc_read_next_word(); - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { state.e = vc_read_next_word(); } else { state.e = vc_read_next_byte(); @@ -644,7 +644,7 @@ void SimonState::vc_10_draw() } } - if (_game & GAME_SIMON2 && width >= 21) { + if (_game & GF_SIMON2 && width >= 21) { byte *src, *dst; uint w; @@ -885,7 +885,7 @@ void SimonState::vc_10_draw() } /* vc_10_helper_4 */ } else { - if (_game & GAME_SIMON2 && state.e & 0x4 && _bit_array[10] & 0x800) { + if (_game & GF_SIMON2 && state.e & 0x4 && _bit_array[10] & 0x800) { state.surf_addr = state.surf2_addr; state.surf_pitch = state.surf2_pitch; if (_debugMode) @@ -996,7 +996,7 @@ void SimonState::vc_12_delay() //vc_12_sleep_variable { uint num; - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { num = vc_read_var_or_word(); } else { num = vc_read_next_byte() * _vga_base_delay; @@ -1108,7 +1108,7 @@ void SimonState::vc_20_set_code_word() /* FIXME: unaligned access */ void SimonState::vc_21_jump_if_code_word() { - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { int16 a = vc_read_next_word(); byte *tmp = _vc_ptr + a; uint16 val = read_16_le(tmp + 4); @@ -1206,7 +1206,7 @@ void SimonState::vc_24_set_image_xy() vsp->x += (int16)vc_read_next_word(); vsp->y += (int16)vc_read_next_word(); - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { vsp->unk4 = vc_read_next_word(); } else { vsp->unk4 = vc_read_next_byte(); @@ -1321,7 +1321,7 @@ void SimonState::vc_27_reset_simon2() void SimonState::vc_27_reset() { - if (!(_game & GAME_SIMON2)) + if (!(_game & GF_SIMON2)) vc_27_reset_simon1(); else vc_27_reset_simon2(); @@ -1393,7 +1393,7 @@ void SimonState::vc_36_saveload_thing() uint vga_res = vc_read_next_word(); uint mode = vc_read_next_word(); - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { if (mode == 16) { _copy_partial_mode = 2; } else { @@ -1430,7 +1430,7 @@ void SimonState::vc_40_var_add() uint var = vc_read_next_word(); int16 value = vc_read_var(var) + vc_read_next_word(); - if (_game & GAME_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { + if (_game & GF_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { int16 tmp; if (_vga_var2 != 0) { @@ -1460,7 +1460,7 @@ void SimonState::vc_41_var_sub() uint var = vc_read_next_word(); int16 value = vc_read_var(var) - vc_read_next_word(); - if (_game & GAME_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { + if (_game & GF_SIMON2 && var == 0xF && !(_bit_array[5] & 1)) { int16 tmp; if (_vga_var2 != 0) { @@ -1597,7 +1597,7 @@ void SimonState::vc_52_play_sound() if (_game == GAME_SIMON1DOS) { playSting(a); - } else if (!(_game & GAME_SIMON2)) { + } else if (!(_game & GF_SIMON2)) { _sound->playEffects(a); } else { if (a >= 0x8000) { @@ -1644,7 +1644,7 @@ void SimonState::vc_55_offset_hit_area() void SimonState::vc_56_no_op() { /* no op in simon1 */ - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { uint num = vc_read_var_or_word() * _vga_base_delay; if (_continous_vgascript) @@ -1657,7 +1657,7 @@ void SimonState::vc_56_no_op() void SimonState::vc_59() { - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { uint file = vc_read_next_word(); uint start = vc_read_next_word(); uint end = vc_read_next_word() + 1; @@ -1716,7 +1716,7 @@ void SimonState::vc_kill_thread(uint file, uint sprite) vfs = _vga_sleep_structs; while (vfs->ident != 0) { if (vfs->sprite_id == _vga_cur_sprite_id - && (vfs->cur_vga_file == _vga_cur_file_id || !(_game & GAME_SIMON2)) + && (vfs->cur_vga_file == _vga_cur_file_id || !(_game & GF_SIMON2)) ) { while (vfs->ident != 0) { memcpy(vfs, vfs + 1, sizeof(VgaSleepStruct)); @@ -1734,7 +1734,7 @@ void SimonState::vc_kill_thread(uint file, uint sprite) vte = _vga_timer_list; while (vte->delay != 0) { if (vte->sprite_id == _vga_cur_sprite_id - && (vte->cur_vga_file == _vga_cur_file_id || !(_game & GAME_SIMON2)) + && (vte->cur_vga_file == _vga_cur_file_id || !(_game & GF_SIMON2)) ) { delete_vga_timer(vte); break; @@ -1752,7 +1752,7 @@ void SimonState::vc_60_kill_thread() { uint file; - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { file = vc_read_next_word(); } else { file = _vga_cur_file_id; @@ -1783,7 +1783,7 @@ void SimonState::vc_62_palette_thing() vc_29_stop_all_sounds(); if (!_video_var_3) { - if (_game & GAME_SIMON2) { + if (_game & GF_SIMON2) { if (_midi_unk2 != 0xffff) { playMusic(999, _midi_unk2); } @@ -1803,7 +1803,7 @@ void SimonState::vc_62_palette_thing() delay(5); } - if (!(_game & GAME_SIMON2)) { + if (!(_game & GF_SIMON2)) { uint16 params[5]; /* parameters to vc_10_draw */ VgaSprite *vsp; VgaPointersEntry *vpe; @@ -1906,7 +1906,7 @@ void SimonState::vc_69() if (_vc72_var1 == 999) { _vc70_var2 = b; - if (_game & GAME_WIN) { + if (_game & GF_WIN) { midi.initialize(); midi.play(); } -- cgit v1.2.3