aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2005-05-06 08:46:45 +0000
committerTravis Howell2005-05-06 08:46:45 +0000
commit947be5edc2fa2c000ad315c19f1711eea2fb4de0 (patch)
treedb504cc5702f7b2817d03b2dc46d6e70c273e17d /simon
parent21fe989da9b54389fae71465fe0ba62382935e5e (diff)
downloadscummvm-rg350-947be5edc2fa2c000ad315c19f1711eea2fb4de0.tar.gz
scummvm-rg350-947be5edc2fa2c000ad315c19f1711eea2fb4de0.tar.bz2
scummvm-rg350-947be5edc2fa2c000ad315c19f1711eea2fb4de0.zip
Rename sprite field.
Cleanup svn-id: r17928
Diffstat (limited to 'simon')
-rw-r--r--simon/simon.cpp10
-rw-r--r--simon/simon.h4
-rw-r--r--simon/vga.cpp62
3 files changed, 16 insertions, 60 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index a08415b08b..c569407edd 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -2738,12 +2738,12 @@ void SimonEngine::timer_vga_sprites() {
vsp = _vga_sprites;
while (vsp->id != 0) {
- vsp->unk6 &= 0x7FFF;
+ 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->unk6;
+ _video_palette_mode = vsp->paletteMode;
_vga_cur_sprite_id = vsp->id;
params[0] = READ_BE_UINT16(&vsp->image);
@@ -2816,12 +2816,12 @@ void SimonEngine::timer_vga_sprites_2() {
vsp = _vga_sprites;
while (vsp->id != 0) {
- vsp->unk6 &= 0x7FFF;
+ 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->unk6;
+ _video_palette_mode = vsp->paletteMode;
_vga_cur_sprite_id = vsp->id;
if (vsp->image)
@@ -3365,7 +3365,7 @@ void SimonEngine::start_vga_code(uint b, uint vga_res, uint vga_sprite_id, uint
while (vsp->id != 0)
vsp++;
- vsp->unk6 = b;
+ vsp->paletteMode = b;
vsp->priority = 0;
vsp->unk4 = 0;
diff --git a/simon/simon.h b/simon/simon.h
index 2d5a4cf0e4..cfb44229e0 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -81,7 +81,7 @@ struct VgaSprite {
uint16 x, y; /* actually signed numbers */
uint16 unk4;
uint16 priority;
- uint16 unk6, unk7;
+ uint16 paletteMode, unk7;
VgaSprite() { memset(this, 0, sizeof(*this)); }
};
@@ -643,8 +643,6 @@ public:
void vc_25_halt_sprite();
void vc_26_set_window();
void vc_27_reset();
- void vc_27_reset_simon1();
- void vc_27_reset_simon2();
void vc_28_dummy_op();
void vc_29_stop_all_sounds();
void vc_30_set_base_delay();
diff --git a/simon/vga.cpp b/simon/vga.cpp
index f5925fe46b..99015475b1 100644
--- a/simon/vga.cpp
+++ b/simon/vga.cpp
@@ -299,7 +299,7 @@ void SimonEngine::vc_3_new_sprite() {
vsp++;
vsp->base_color = base_color;
- vsp->unk6 = a;
+ vsp->paletteMode = a;
vsp->priority = 0;
vsp->unk4 = 0;
vsp->image = 0;
@@ -1160,7 +1160,7 @@ void SimonEngine::vc_23_set_sprite_priority() {
memcpy(&bak, vsp, sizeof(bak));
bak.priority = pri;
- bak.unk6 |= 0x8000;
+ bak.paletteMode |= 0x8000;
vus2 = vsp;
@@ -1219,7 +1219,7 @@ void SimonEngine::vc_26_set_window() {
as[3] = vc_read_next_word();
}
-void SimonEngine::vc_27_reset_simon1() {
+void SimonEngine::vc_27_reset() {
VgaSprite bak, *vsp;
VgaSleepStruct *vfs;
VgaTimerEntry *vte, *vte2;
@@ -1230,7 +1230,7 @@ void SimonEngine::vc_27_reset_simon1() {
vsp = _vga_sprites;
while (vsp->id) {
- if (vsp->id == 0x80) {
+ if ((_game & GF_SIMON1) && vsp->id == 0x80) {
memcpy(&bak, vsp, sizeof(VgaSprite));
}
vsp->id = 0;
@@ -1248,45 +1248,10 @@ void SimonEngine::vc_27_reset_simon1() {
vte = _vga_timer_list;
while (vte->delay) {
- if (vte->sprite_id != 0x80) {
- vte2 = vte;
- while (vte2->delay) {
- memcpy(vte2, vte2 + 1, sizeof(VgaTimerEntry));
- vte2++;
- }
- } else {
+ if ((_game & GF_SIMON1) && vsp->id == 0x80) {
vte++;
- }
- }
-
- vc_write_var(0xFE, 0);
-
- _lock_word &= ~8;
-}
-
-void SimonEngine::vc_27_reset_simon2() {
- _lock_word |= 8;
-
- {
- VgaSprite *vsp = _vga_sprites;
- while (vsp->id) {
- vsp->id = 0;
- vsp++;
- }
- }
-
- {
- VgaSleepStruct *vfs = _vga_sleep_structs;
- while (vfs->ident) {
- vfs->ident = 0;
- vfs++;
- }
- }
-
- {
- VgaTimerEntry *vte = _vga_timer_list;
- while (vte->delay) {
- VgaTimerEntry *vte2 = vte;
+ } else {
+ vte2 = vte;
while (vte2->delay) {
memcpy(vte2, vte2 + 1, sizeof(VgaTimerEntry));
vte2++;
@@ -1299,13 +1264,6 @@ void SimonEngine::vc_27_reset_simon2() {
_lock_word &= ~8;
}
-void SimonEngine::vc_27_reset() {
- if (!(_game & GF_SIMON2))
- vc_27_reset_simon1();
- else
- vc_27_reset_simon2();
-}
-
void SimonEngine::vc_28_dummy_op() {
/* unused */
_vc_ptr += 8;
@@ -1729,7 +1687,7 @@ void SimonEngine::vc_62_palette_thing() {
delay(5);
}
- if (!(_game & GF_SIMON2)) {
+ if (_game & GF_SIMON1) {
uint16 params[5]; /* parameters to vc_10_draw */
VgaSprite *vsp;
VgaPointersEntry *vpe;
@@ -1745,7 +1703,7 @@ void SimonEngine::vc_62_palette_thing() {
vpe = &_vga_buffer_pointers[vsp->unk7];
_cur_vga_file_1 = vpe->vgaFile1;
_cur_vga_file_2 = vpe->vgaFile2;
- _video_palette_mode = vsp->unk6;
+ _video_palette_mode = vsp->paletteMode;
params[0] = READ_BE_UINT16(&vsp->image);
params[1] = READ_BE_UINT16(&vsp->base_color);
@@ -1767,7 +1725,7 @@ void SimonEngine::vc_62_palette_thing() {
// Allow one section of Simon the Sorcerer 1 introduction to be displayed
// in lower half of screen
- if (!(_game & GF_SIMON2) && (_subroutine == 2923 || _subroutine == 2926))
+ if ((_game & GF_SIMON1) && (_subroutine == 2923 || _subroutine == 2926))
dx_clear_surfaces(200);
else
dx_clear_surfaces(_video_palette_mode == 4 ? 134 : 200);