aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorMax Horn2003-12-21 18:50:44 +0000
committerMax Horn2003-12-21 18:50:44 +0000
commitdfa5e09aece8eefd582c51822214b3a207316bfa (patch)
tree0f9520a65984f45e5d4539286b984ec48f5953ed /simon
parente342d624d0fb9bbdc9c2a90a0ec1afcf8065dcec (diff)
downloadscummvm-rg350-dfa5e09aece8eefd582c51822214b3a207316bfa.tar.gz
scummvm-rg350-dfa5e09aece8eefd582c51822214b3a207316bfa.tar.bz2
scummvm-rg350-dfa5e09aece8eefd582c51822214b3a207316bfa.zip
cleanup; fix endian bug which caused the dreaded Simon1 hang on MacOS (_palette_color_count was treated as a 32 bit int when it is only 16 bit -> once again proves that one should be really really carefully with pointer cast hacks!)
svn-id: r11835
Diffstat (limited to 'simon')
-rw-r--r--simon/simon.cpp6
-rw-r--r--simon/simon.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 7b72d5dcba..56539bccb2 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -2420,7 +2420,7 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) {
if (!(_game & GF_SIMON2)) {
if (_unk_pal_flag) {
_unk_pal_flag = false;
- while (*(volatile int *)&_palette_color_count != 0) {
+ while (_palette_color_count != 0) {
delay(10);
}
}
@@ -2432,7 +2432,7 @@ void SimonEngine::set_video_mode(uint mode, uint vga_res_id) {
lock();
if (_lock_word == 0) {
_sync_flag_1 = true;
- while ((*(volatile bool *)&_sync_flag_1) == true) {
+ while (_sync_flag_1) {
delay(10);
}
}
@@ -2440,7 +2440,7 @@ void SimonEngine::set_video_mode(uint mode, uint vga_res_id) {
_lock_word |= 0x20;
- while ((*(volatile uint16*)&_lock_word) & 2) {
+ while (_lock_word & 2) {
delay(10);
}
diff --git a/simon/simon.h b/simon/simon.h
index 49d92d7ab5..cc21a75b84 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -179,7 +179,7 @@ protected:
bool _vga_res_328_loaded;
bool _hitarea_unk_3;
bool _mortal_flag;
- bool _sync_flag_1;
+ volatile bool _sync_flag_1;
byte _video_var_8;
bool _use_palette_delay;
bool _sync_flag_2;
@@ -248,12 +248,12 @@ protected:
Item *_dummy_item_2;
Item *_dummy_item_3;
- uint16 _lock_word;
+ volatile uint16 _lock_word;
uint16 _scroll_up_hit_area;
uint16 _scroll_down_hit_area;
uint16 _video_var_7;
- uint16 _palette_color_count;
+ volatile uint16 _palette_color_count;
byte _video_var_4;
bool _video_var_5;