From dfced2a4d0663889f755e9efea476ed2a157c1ec Mon Sep 17 00:00:00 2001 From: Oliver Kiehl Date: Sun, 12 Jan 2003 15:17:58 +0000 Subject: added F10 support (Hitareas are indicated when F10 is pressed) svn-id: r6429 --- simon/simon.cpp | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ simon/simon.h | 1 + 2 files changed, 82 insertions(+) (limited to 'simon') diff --git a/simon/simon.cpp b/simon/simon.cpp index ed31378b42..3cbf04624b 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -1522,6 +1522,85 @@ uint SimonState::setup_icon_hit_area(FillOrCopyStruct *fcs, uint x, uint y, uint return ha - _hit_areas; } +void SimonState::f10_key() +{ + HitArea *ha; + uint count; + uint y_, x_; + byte *dst; + uint b; + + _lock_word |= 0x8000; + + for (int i = 0; i < 5; i++) { + ha = _hit_areas; + count = ARRAYSIZE(_hit_areas); + + timer_vga_sprites(); + + do { + if (ha->id != 0 && ha->flags & 0x20 && !(ha->flags & 0x40)) { + if (ha->y >= 0xc8 || ha->y >= _vga_var8) + continue; + + y_ = (ha->height >> 1) - 4 + ha->y; + + x_ = (ha->width >> 1) - 4 + ha->x - (_x_scroll << 3); + + if (x_ < 0 || x_ >= 0x137) + continue; + + dst = dx_lock_attached(); + + dst += (((_dx_surface_pitch >> 2) * y_) << 2) + x_; + + b = _dx_surface_pitch; + dst[4] = 0xec; + dst[b+1] = 0xec; + dst[b+4] = 0xec; + dst[b+7] = 0xec; + b += _dx_surface_pitch; + dst[b+2] = 0xec; + dst[b+4] = 0xec; + dst[b+6] = 0xec; + b += _dx_surface_pitch; + dst[b+3] = 0xec; + dst[b+5] = 0xec; + b += _dx_surface_pitch; + dst[b] = 0xec; + dst[b+1] = 0xec; + dst[b+2] = 0xec; + dst[b+6] = 0xec; + dst[b+7] = 0xec; + dst[b+8] = 0xec; + b += _dx_surface_pitch; + dst[b+3] = 0xec; + dst[b+5] = 0xec; + b += _dx_surface_pitch; + dst[b+2] = 0xec; + dst[b+4] = 0xec; + dst[b+6] = 0xec; + b += _dx_surface_pitch; + dst[b+1] = 0xec; + dst[b+4] = 0xec; + dst[b+7] = 0xec; + b += _dx_surface_pitch; + dst[b+4] = 0xec; + + dx_unlock_attached(); + } + } while (ha++, --count); + + dx_update_screen_and_palette(); + delay(100); + timer_vga_sprites(); + dx_update_screen_and_palette(); + delay(100); + } + + _lock_word &= ~0x8000; +} + void SimonState::hitarea_stuff() { HitArea *ha; @@ -1540,6 +1619,8 @@ startOver: _last_hitarea = NULL; _last_hitarea_3 = NULL; for (;;) { + if (_game & GAME_SIMON2 && _key_pressed == 35) + f10_key(); processSpecialKeys(); if (_last_hitarea_3 == (HitArea *) 0xFFFFFFFF) goto startOver; diff --git a/simon/simon.h b/simon/simon.h index 11bf50b67b..036e35bd50 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -540,6 +540,7 @@ public: void new_current_hitarea(HitArea * ha); bool hitarea_proc_2(uint a); bool hitarea_proc_3(Item *item); + void f10_key(); void hitarea_stuff(); void handle_mouse_moved(); -- cgit v1.2.3