aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--simon/items.cpp18
-rw-r--r--simon/simon.cpp110
-rw-r--r--simon/simon.h34
-rw-r--r--simon/verb.cpp2
-rw-r--r--simon/vga.cpp146
-rw-r--r--simon/vga.h2
6 files changed, 156 insertions, 156 deletions
diff --git a/simon/items.cpp b/simon/items.cpp
index 1e14dd5e21..62fd13d537 100644
--- a/simon/items.cpp
+++ b/simon/items.cpp
@@ -526,7 +526,7 @@ int SimonEngine::runScript() {
break;
case 98:{ /* start vga */
- uint vga_res, vgaSpriteId, paletteMode, x, y, base_color;
+ uint vga_res, vgaSpriteId, windowNum, x, y, palette;
if (_game & GF_SIMON2) {
vga_res = getVarOrWord();
vgaSpriteId = getVarOrWord();
@@ -534,11 +534,11 @@ int SimonEngine::runScript() {
vgaSpriteId = getVarOrWord();
vga_res = vgaSpriteId / 100;
}
- paletteMode = getVarOrByte();
+ windowNum = getVarOrByte();
x = getVarOrWord();
y = getVarOrWord();
- base_color = getVarOrWord();
- loadSprite(paletteMode, vga_res, vgaSpriteId, x, y, base_color);
+ palette = getVarOrWord();
+ loadSprite(windowNum, vga_res, vgaSpriteId, x, y, palette);
}
break;
@@ -1060,7 +1060,7 @@ int SimonEngine::runScript() {
case 189:{ /* clear_op189_flag */
if (_game & GF_SIMON1)
goto invalid_opcode;
- _op189Flags = 0;
+ _marks = 0;
}
break;
@@ -1069,8 +1069,8 @@ int SimonEngine::runScript() {
if (_game & GF_SIMON1)
goto invalid_opcode;
i = getVarOrByte();
- if (!(_op189Flags & (1 << i)))
- o_190_helper(i);
+ if (!(_marks & (1 << i)))
+ o_waitForMark(i);
}
break;
@@ -1163,9 +1163,9 @@ void SimonEngine::o_83_helper() {
}
}
-void SimonEngine::o_190_helper(uint i) {
+void SimonEngine::o_waitForMark(uint i) {
_exitCutscene = false;
- while (!(_op189Flags & (1 << i))) {
+ while (!(_marks & (1 << i))) {
if (_exitCutscene) {
if (vc_get_bit(9)) {
startSubroutine170();
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 9b3898b814..0223880e4b 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -473,7 +473,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_lastVgaTick = 0;
- _op189Flags = 0;
+ _marks = 0;
_scriptVar2 = 0;
_runScriptReturn1 = 0;
@@ -507,12 +507,12 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_vgaVar9 = 0;
_scriptUnk1 = 0;
_vgaVar6 = 0;
- _xScroll = 0;
- _vgaVar1 = 0;
- _vgaVar2 = 0;
- _xScrollStep = 0;
- _spriteHeight = 0;
- _vgaVar7 = 0;
+ _scrollX = 0;
+ _scrollXMax = 0;
+ _scrollCount = 0;
+ _scrollFlag = 0;
+ _scrollHeight = 0;
+ _scrollImage = 0;
_vgaVar8 = 0;
_scriptCondA = 0;
@@ -539,7 +539,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_hitAreaUnk4 = 0;
_lockCounter = 0;
- _videoPaletteMode = 0;
+ _windowNum = 0;
_printCharUnk1 = 0;
_printCharUnk2 = 0;
@@ -600,7 +600,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_timer5 = 0;
_timer4 = 0;
- _vgaBaseDelay = 1;
+ _frameRate = 1;
_vgaCurFile2 = 0;
_vgaWaitFor = 0;
@@ -1754,13 +1754,13 @@ void SimonEngine::handle_mouse_moved() {
goto get_out2;
_vgaVar9 = 1;
}
- if (_vgaVar2 == 0) {
+ if (_scrollCount == 0) {
if (_mouseX >= 631 / 2) {
- if (_xScroll != _vgaVar1)
- _xScrollStep = 1;
+ if (_scrollX != _scrollXMax)
+ _scrollFlag = 1;
} else if (_mouseX < 8) {
- if (_xScroll != 0)
- _xScrollStep = -1;
+ if (_scrollX != 0)
+ _scrollFlag = -1;
}
}
} else {
@@ -2014,7 +2014,7 @@ void SimonEngine::f10_key() {
y_ = (ha->height >> 1) - 4 + ha->y;
- x_ = (ha->width >> 1) - 4 + ha->x - (_xScroll << 3);
+ x_ = (ha->width >> 1) - 4 + ha->x - (_scrollX << 3);
if (x_ >= 0x137)
continue;
@@ -2463,7 +2463,7 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) {
uint16 c;
const byte *vc_ptr_org;
- _videoPaletteMode = mode;
+ _windowNum = mode;
_lockWord |= 0x20;
if (vga_res_id == 0) {
@@ -2506,11 +2506,11 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) {
_usePaletteDelay = true;
}
} else {
- _xScroll = 0;
- _vgaVar1 = 0;
- _vgaVar2 = 0;
- _xScrollStep = 0;
- _spriteHeight = 134;
+ _scrollX = 0;
+ _scrollXMax = 0;
+ _scrollCount = 0;
+ _scrollFlag = 0;
+ _scrollHeight = 134;
if (_variableArray[34] != -1)
_variableArray[251] = 0;
}
@@ -2525,7 +2525,7 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) {
if (_game & GF_SIMON2) {
if (!_dxUse3Or4ForLock) {
- num_lines = _videoPaletteMode == 4 ? 134 : 200;
+ num_lines = _windowNum == 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);
@@ -2538,7 +2538,7 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) {
if (_subroutine == 2923 || _subroutine == 2926)
num_lines = 200;
else
- num_lines = _videoPaletteMode == 4 ? 134 : 200;
+ num_lines = _windowNum == 4 ? 134 : 200;
dx_copy_from_attached_to_2(0, 0, 320, num_lines);
dx_copy_from_attached_to_3(num_lines);
_syncFlag2 = 1;
@@ -2622,19 +2622,19 @@ void SimonEngine::expire_vga_timers() {
// Simon2 specific
void SimonEngine::scroll_timeout() {
- if (_vgaVar2 == 0)
+ if (_scrollCount == 0)
return;
- if (_vgaVar2 < 0) {
- if (_xScrollStep != -1) {
- _xScrollStep = -1;
- if (++_vgaVar2 == 0)
+ if (_scrollCount < 0) {
+ if (_scrollFlag != -1) {
+ _scrollFlag = -1;
+ if (++_scrollCount == 0)
return;
}
} else {
- if (_xScrollStep != 1) {
- _xScrollStep = 1;
- if (--_vgaVar2 == 0)
+ if (_scrollFlag != 1) {
+ _scrollFlag = 1;
+ if (--_scrollCount == 0)
return;
}
}
@@ -2758,23 +2758,23 @@ void SimonEngine::timer_vga_sprites() {
if (_videoVar9 == 2)
_videoVar9 = 1;
- if (_game & GF_SIMON2 && _xScrollStep) {
+ if (_game & GF_SIMON2 && _scrollFlag) {
timer_vga_sprites_helper();
}
vsp = _vgaSprites;
while (vsp->id != 0) {
- vsp->paletteMode &= 0x7FFF;
+ vsp->windowNum &= 0x7FFF;
vpe = &_vgaBufferPointers[vsp->fileId];
_curVgaFile1 = vpe->vgaFile1;
_curVgaFile2 = vpe->vgaFile2;
- _videoPaletteMode = vsp->paletteMode;
+ _windowNum = vsp->windowNum;
_vgaCurSpriteId = vsp->id;
params[0] = READ_BE_UINT16(&vsp->image);
- params[1] = READ_BE_UINT16(&vsp->base_color);
+ params[1] = READ_BE_UINT16(&vsp->palette);
params[2] = READ_BE_UINT16(&vsp->x);
params[3] = READ_BE_UINT16(&vsp->y);
@@ -2802,34 +2802,34 @@ void SimonEngine::timer_vga_sprites_helper() {
const byte *src;
uint x;
- if (_xScrollStep < 0) {
- memmove(dst + 8, dst, 320 * _spriteHeight - 8);
+ if (_scrollFlag < 0) {
+ memmove(dst + 8, dst, 320 * _scrollHeight - 8);
} else {
- memmove(dst, dst + 8, 320 * _spriteHeight - 8);
+ memmove(dst, dst + 8, 320 * _scrollHeight - 8);
}
- x = _xScroll - 1;
+ x = _scrollX - 1;
- if (_xScrollStep > 0) {
+ if (_scrollFlag > 0) {
dst += 320 - 8;
x += 41;
}
- src = _vgaVar7 + x * 4;
- decodeStripA(dst, src + READ_BE_UINT32(src), _spriteHeight);
+ src = _scrollImage + x * 4;
+ decodeStripA(dst, src + READ_BE_UINT32(src), _scrollHeight);
dx_unlock_2();
memcpy(_sdl_buf_attached, _sdl_buf, 320 * 200);
- dx_copy_from_attached_to_3(_spriteHeight);
+ dx_copy_from_attached_to_3(_scrollHeight);
- _xScroll += _xScrollStep;
+ _scrollX += _scrollFlag;
- vc_write_var(0xfB, _xScroll);
+ vc_write_var(0xfB, _scrollX);
- _xScrollStep = 0;
+ _scrollFlag = 0;
}
void SimonEngine::timer_vga_sprites_2() {
@@ -2843,19 +2843,19 @@ void SimonEngine::timer_vga_sprites_2() {
vsp = _vgaSprites;
while (vsp->id != 0) {
- vsp->paletteMode &= 0x7FFF;
+ vsp->windowNum &= 0x7FFF;
vpe = &_vgaBufferPointers[vsp->fileId];
_curVgaFile1 = vpe->vgaFile1;
_curVgaFile2 = vpe->vgaFile2;
- _videoPaletteMode = vsp->paletteMode;
+ _windowNum = vsp->windowNum;
_vgaCurSpriteId = vsp->id;
if (vsp->image)
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->flags);
+ vsp->id, vsp->image, vsp->palette, vsp->x, vsp->y, vsp->flags);
params[0] = READ_BE_UINT16(&vsp->image);
- params[1] = READ_BE_UINT16(&vsp->base_color);
+ params[1] = READ_BE_UINT16(&vsp->palette);
params[2] = READ_BE_UINT16(&vsp->x);
params[3] = READ_BE_UINT16(&vsp->y);
params[4] = READ_BE_UINT16(&vsp->flags);
@@ -3058,7 +3058,7 @@ 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 += _xScroll * 8;
+ x += _scrollX * 8;
}
prev_i = 21 - _variableArray[12];
@@ -3375,7 +3375,7 @@ void SimonEngine::video_copy_if_flag_0x8_c(FillOrCopyStruct *fcs) {
fcs->mode = 0;
}
-void SimonEngine::loadSprite(uint paletteMode, uint fileId, uint vgaSpriteId, uint x, uint y, uint base_color) {
+void SimonEngine::loadSprite(uint windowNum, uint fileId, uint vgaSpriteId, uint x, uint y, uint palette) {
VgaSprite *vsp;
VgaPointersEntry *vpe;
byte *p, *pp;
@@ -3392,14 +3392,14 @@ void SimonEngine::loadSprite(uint paletteMode, uint fileId, uint vgaSpriteId, ui
while (vsp->id != 0)
vsp++;
- vsp->paletteMode = paletteMode;
+ vsp->windowNum = windowNum;
vsp->priority = 0;
vsp->flags = 0;
vsp->y = y;
vsp->x = x;
vsp->image = 0;
- vsp->base_color = base_color;
+ vsp->palette = palette;
vsp->id = vgaSpriteId;
if (_game & GF_SIMON1)
vsp->fileId = fileId = vgaSpriteId / 100;
@@ -4023,7 +4023,7 @@ int SimonEngine::go() {
openGameFile();
_lastMusicPlayed = -1;
- _vgaBaseDelay = 1;
+ _frameRate = 1;
_startMainScript = false;
_continousMainScript = false;
diff --git a/simon/simon.h b/simon/simon.h
index 1e9b411fa9..8f9cf34c04 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -77,11 +77,11 @@ struct VgaPointersEntry {
struct VgaSprite {
uint16 id;
uint16 image;
- uint16 base_color;
+ uint16 palette;
uint16 x, y; /* actually signed numbers */
uint16 flags;
uint16 priority;
- uint16 paletteMode, fileId;
+ uint16 windowNum, fileId;
VgaSprite() { memset(this, 0, sizeof(*this)); }
};
@@ -176,7 +176,7 @@ protected:
uint32 _lastVgaTick;
- uint16 _op189Flags;
+ uint16 _marks;
bool _scriptVar2;
bool _runScriptReturn1;
@@ -211,8 +211,8 @@ protected:
bool _vgaVar9;
int16 _scriptUnk1;
bool _vgaVar6;
- int _xScroll, _vgaVar1, _vgaVar2, _xScrollStep, _spriteHeight;
- const byte *_vgaVar7;
+ int _scrollX, _scrollXMax, _scrollCount, _scrollFlag, _scrollHeight;
+ const byte *_scrollImage;
byte _vgaVar8;
int16 _scriptCondA, _scriptCondB, _scriptCondC;
@@ -235,7 +235,7 @@ protected:
uint16 _hitAreaUnk4;
uint _lockCounter;
- uint16 _videoPaletteMode;
+ uint16 _windowNum;
uint _printCharUnk1, _printCharUnk2;
uint _numLettersToPrint;
@@ -287,7 +287,7 @@ protected:
uint16 _timer1, _timer5, _timer4;
- uint16 _vgaBaseDelay;
+ uint16 _frameRate;
uint16 _vgaCurFile2;
uint16 _vgaWaitFor, _vgaCurFileId;
@@ -589,7 +589,7 @@ protected:
void ensureVgaResLoadedC(uint vga_res);
void ensureVgaResLoaded(uint vga_res);
- void loadSprite(uint paletteMode, uint vga_res, uint vga_sprite_id, uint x, uint y, uint base_color);
+ void loadSprite(uint windowNum, uint vga_res, uint vga_sprite_id, uint x, uint y, uint palette);
void o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h);
void talk_with_speech(uint speech_id, uint vga_sprite_id);
void talk_with_text(uint vga_sprite_id, uint color, const char *string_ptr, int16 x, int16 y, int16 width);
@@ -641,8 +641,8 @@ public:
void vc27_resetSprite();
void vc28_dummy_op();
void vc29_stopAllSounds();
- void vc30_setBaseDelay();
- void vc31_setPaletteMode();
+ void vc30_setFrameRate();
+ void vc31_setWindow();
void vc32_copyVar();
void vc33_forceUnlock();
void vc34_forceLock();
@@ -673,12 +673,12 @@ public:
void vc59();
void vc60_killSprite();
void vc61_changeSprite();
- void vc62_fadeOut();
- void vc63_palette_thing_2();
+ void vc62_fastFadeOut();
+ void vc63_fastFadeIn();
// Simon2 specific Video Script Opcodes
- void vc64_skipIfNoSpeech();
- void vc65_palette_thing_3();
+ void vc64_skipIfSpeechEnded();
+ void vc65_slowFadeIn();
void vc66_skipIfNotEqual();
void vc67_skipIfGE();
void vc68_skipIfLE();
@@ -686,8 +686,8 @@ public:
void vc70_queueMusic();
void vc71_checkMusicQueue();
void vc72_play_track_2();
- void vc73_setOp189Flag();
- void vc74_clearOp189Flag();
+ void vc73_setMark();
+ void vc74_clearMark();
protected:
void delete_vga_timer(VgaTimerEntry * vte);
@@ -787,7 +787,7 @@ protected:
void pause();
void o_83_helper();
- void o_190_helper(uint i);
+ void o_waitForMark(uint i);
void timer_vga_sprites_helper();
void decodeStripA(byte *dst, const byte *src, int height);
diff --git a/simon/verb.cpp b/simon/verb.cpp
index 1d629d468e..556573c475 100644
--- a/simon/verb.cpp
+++ b/simon/verb.cpp
@@ -460,7 +460,7 @@ void SimonEngine::setup_hitarea_from_pos(uint x, uint y, uint mode) {
if (_game & GF_SIMON2) {
if (_bitArray[4] & 0x8000 || y < 134) {
- x_ += _xScroll * 8;
+ x_ += _scrollX * 8;
}
}
diff --git a/simon/vga.cpp b/simon/vga.cpp
index 13b2dfa3d4..e50b26e3c1 100644
--- a/simon/vga.cpp
+++ b/simon/vga.cpp
@@ -63,8 +63,8 @@ static const VgaOpcodeProc vga_opcode_table[] = {
&SimonEngine::vc27_resetSprite,
&SimonEngine::vc28_dummy_op,
&SimonEngine::vc29_stopAllSounds,
- &SimonEngine::vc30_setBaseDelay,
- &SimonEngine::vc31_setPaletteMode,
+ &SimonEngine::vc30_setFrameRate,
+ &SimonEngine::vc31_setWindow,
&SimonEngine::vc32_copyVar,
&SimonEngine::vc33_forceUnlock,
&SimonEngine::vc34_forceLock,
@@ -95,10 +95,10 @@ static const VgaOpcodeProc vga_opcode_table[] = {
&SimonEngine::vc59,
&SimonEngine::vc60_killSprite,
&SimonEngine::vc61_changeSprite,
- &SimonEngine::vc62_fadeOut,
- &SimonEngine::vc63_palette_thing_2,
- &SimonEngine::vc64_skipIfNoSpeech,
- &SimonEngine::vc65_palette_thing_3,
+ &SimonEngine::vc62_fastFadeOut,
+ &SimonEngine::vc63_fastFadeIn,
+ &SimonEngine::vc64_skipIfSpeechEnded,
+ &SimonEngine::vc65_slowFadeIn,
&SimonEngine::vc66_skipIfNotEqual,
&SimonEngine::vc67_skipIfGE,
&SimonEngine::vc68_skipIfLE,
@@ -106,8 +106,8 @@ static const VgaOpcodeProc vga_opcode_table[] = {
&SimonEngine::vc70_queueMusic,
&SimonEngine::vc71_checkMusicQueue,
&SimonEngine::vc72_play_track_2,
- &SimonEngine::vc73_setOp189Flag,
- &SimonEngine::vc74_clearOp189Flag,
+ &SimonEngine::vc73_setMark,
+ &SimonEngine::vc74_clearMark,
};
// Script parser
@@ -269,14 +269,14 @@ void SimonEngine::vc2_call() {
}
void SimonEngine::vc3_loadSprite() {
- uint16 paletteMode, fileId, base_color, x, y, vgaSpriteId;
+ uint16 windowNum, fileId, palette, x, y, vgaSpriteId;
uint16 res;
VgaSprite *vsp;
VgaPointersEntry *vpe;
byte *p, *pp;
byte *old_file_1;
- paletteMode = vc_read_next_word(); /* 0 */
+ windowNum = vc_read_next_word(); /* 0 */
if (_game & GF_SIMON2) {
fileId = vc_read_next_word(); /* 0 */
@@ -288,7 +288,7 @@ void SimonEngine::vc3_loadSprite() {
x = vc_read_next_word(); /* 4 */
y = vc_read_next_word(); /* 6 */
- base_color = vc_read_next_word(); /* 8 */
+ palette = vc_read_next_word(); /* 8 */
/* 2nd param ignored with simon1 */
if (isSpriteLoaded(vgaSpriteId, fileId))
@@ -298,8 +298,8 @@ void SimonEngine::vc3_loadSprite() {
while (vsp->id)
vsp++;
- vsp->base_color = base_color;
- vsp->paletteMode = paletteMode;
+ vsp->palette = palette;
+ vsp->windowNum = windowNum;
vsp->priority = 0;
vsp->flags = 0;
vsp->image = 0;
@@ -603,11 +603,11 @@ void SimonEngine::vc10_draw() {
if (state.image == 0)
return;
- state.base_color = (_vcPtr[1] << 4);
+ state.palette = (_vcPtr[1] << 4);
_vcPtr += 2;
state.x = (int16)vc_read_next_word();
if (_game & GF_SIMON2) {
- state.x -= _xScroll;
+ state.x -= _scrollX;
}
state.y = (int16)vc_read_next_word();
@@ -632,7 +632,7 @@ void SimonEngine::vc10_draw() {
if (_dumpImages)
dump_single_bitmap(_vgaCurFileId, state.image, state.depack_src, width * 16, height,
- state.base_color);
+ state.palette);
if (flags & 0x80 && !(state.flags & 0x10)) {
if (state.flags & 1) {
@@ -648,18 +648,18 @@ void SimonEngine::vc10_draw() {
byte *dst;
uint w;
- _vgaVar1 = width * 2 - 40;
- _vgaVar7 = state.depack_src;
- _spriteHeight = height;
+ _scrollXMax = width * 2 - 40;
+ _scrollImage = state.depack_src;
+ _scrollHeight = height;
if (_variableArray[34] == -1)
state.x = _variableArray[251];
- _xScroll = state.x;
+ _scrollX = state.x;
- vc_write_var(0xfb, _xScroll);
+ vc_write_var(0xfb, _scrollX);
dst = dx_lock_attached();
- src = state.depack_src + _xScroll * 4;
+ src = state.depack_src + _scrollX * 4;
for (w = 0; w < 40; w++) {
decodeStripA(dst, src + READ_BE_UINT32(src), height);
@@ -678,7 +678,7 @@ void SimonEngine::vc10_draw() {
state.depack_src = vc10_no_depack_swap(state.depack_src, width, height);
}
- vlut = &_video_windows[_videoPaletteMode * 4];
+ vlut = &_video_windows[_windowNum * 4];
state.draw_width = width << 1; /* cl */
state.draw_height = height; /* ch */
@@ -796,7 +796,7 @@ void SimonEngine::vc10_draw() {
} while (++w != state.draw_width);
/* vc10_helper_5 */
- } else if (_lockWord & 0x20 && state.base_color == 0 || state.base_color == 0xC0) {
+ } else if (_lockWord & 0x20 && state.palette == 0 || state.palette == 0xC0) {
const byte *src;
byte *dst;
uint h, i;
@@ -931,8 +931,8 @@ void SimonEngine::vc10_draw() {
h = 0;
do {
- dst[0] = (*src >> 4) | state.base_color;
- dst[1] = (*src & 15) | state.base_color;
+ dst[0] = (*src >> 4) | state.palette;
+ dst[1] = (*src & 15) | state.palette;
dst += 320;
src++;
} while (++h != state.draw_height);
@@ -954,10 +954,10 @@ void SimonEngine::vc10_draw() {
do {
color = (*src >> 4);
if (color)
- dst[0] = color | state.base_color;
+ dst[0] = color | state.palette;
color = (*src & 15);
if (color)
- dst[1] = color | state.base_color;
+ dst[1] = color | state.palette;
dst += 320;
src++;
} while (++h != state.draw_height);
@@ -976,8 +976,8 @@ void SimonEngine::vc10_draw() {
if (state.flags & 2) {
do {
for (count = 0; count != state.draw_width; count++) {
- dst[count * 2] = (src[count + state.x_skip] >> 4) | state.base_color;
- dst[count * 2 + 1] = (src[count + state.x_skip] & 15) | state.base_color;
+ dst[count * 2] = (src[count + state.x_skip] >> 4) | state.palette;
+ dst[count * 2 + 1] = (src[count + state.x_skip] & 15) | state.palette;
}
dst += 320;
src += width * 8;
@@ -988,10 +988,10 @@ void SimonEngine::vc10_draw() {
byte color;
color = (src[count + state.x_skip] >> 4);
if (color)
- dst[count * 2] = color | state.base_color;
+ dst[count * 2] = color | state.palette;
color = (src[count + state.x_skip] & 15);
if (color)
- dst[count * 2 + 1] = color | state.base_color;
+ dst[count * 2 + 1] = color | state.palette;
}
dst += 320;
src += width * 8;
@@ -1019,7 +1019,7 @@ void SimonEngine::vc12_delay() {
if (_game & GF_SIMON1) {
num = vc_read_var_or_word();
} else {
- num = vc_read_next_byte() * _vgaBaseDelay;
+ num = vc_read_next_byte() * _frameRate;
}
// Work around to allow inventory arrows to be
@@ -1160,7 +1160,7 @@ void SimonEngine::vc23_setSpritePriority() {
memcpy(&bak, vsp, sizeof(bak));
bak.priority = pri;
- bak.paletteMode |= 0x8000;
+ bak.windowNum |= 0x8000;
vus2 = vsp;
@@ -1273,12 +1273,12 @@ void SimonEngine::vc29_stopAllSounds() {
_sound->stopAll();
}
-void SimonEngine::vc30_setBaseDelay() {
- _vgaBaseDelay = vc_read_next_word();
+void SimonEngine::vc30_setFrameRate() {
+ _frameRate = vc_read_next_word();
}
-void SimonEngine::vc31_setPaletteMode() {
- _videoPaletteMode = vc_read_next_word();
+void SimonEngine::vc31_setWindow() {
+ _windowNum = vc_read_next_word();
}
uint SimonEngine::vc_read_var(uint var) {
@@ -1355,20 +1355,20 @@ void SimonEngine::vc40() {
if ((_game & GF_SIMON2) && var == 0xF && !(_bitArray[5] & 1)) {
int16 tmp;
- if (_vgaVar2 != 0) {
- if (_vgaVar2 >= 0)
+ if (_scrollCount != 0) {
+ if (_scrollCount >= 0)
goto no_scroll;
- _vgaVar2 = 0;
+ _scrollCount = 0;
} else {
- if (_xScrollStep != 0)
+ if (_scrollFlag != 0)
goto no_scroll;
}
- if (value - _xScroll >= 30) {
- _vgaVar2 = 20;
- tmp = _vgaVar1 - _xScroll;
+ if (value - _scrollX >= 30) {
+ _scrollCount = 20;
+ tmp = _scrollXMax - _scrollX;
if (tmp < 20)
- _vgaVar2 = tmp;
+ _scrollCount = tmp;
add_vga_timer(6, NULL, 0, 0); /* special timer */
}
}
@@ -1384,20 +1384,20 @@ void SimonEngine::vc41() {
if ((_game & GF_SIMON2) && var == 0xF && !(_bitArray[5] & 1)) {
int16 tmp;
- if (_vgaVar2 != 0) {
- if (_vgaVar2 < 0)
+ if (_scrollCount != 0) {
+ if (_scrollCount < 0)
goto no_scroll;
- _vgaVar2 = 0;
+ _scrollCount = 0;
} else {
- if (_xScrollStep != 0)
+ if (_scrollFlag != 0)
goto no_scroll;
}
- if ((uint16)(value - _xScroll) < 11) {
- _vgaVar2 = -20;
- tmp = _vgaVar1 - _xScroll;
- if (_xScroll < 20)
- _vgaVar2 = -_xScroll;
+ if ((uint16)(value - _scrollX) < 11) {
+ _scrollCount = -20;
+ tmp = _scrollXMax - _scrollX;
+ if (_scrollX < 20)
+ _scrollCount = -_scrollX;
add_vga_timer(6, NULL, 0, 0); /* special timer */
}
}
@@ -1410,7 +1410,7 @@ void SimonEngine::vc42_delayIfNotEQ() {
uint val = vc_read_var(vc_read_next_word());
if (val != vc_read_next_word()) {
- add_vga_timer(_vgaBaseDelay + 1, _vcPtr - 4, _vgaCurSpriteId, _vgaCurFileId);
+ add_vga_timer(_frameRate + 1, _vcPtr - 4, _vgaCurSpriteId, _vgaCurFileId);
_vcPtr = (byte *)&_vc_get_out_of_code;
}
}
@@ -1547,7 +1547,7 @@ void SimonEngine::vc55_offset_hit_area() {
void SimonEngine::vc56_delay() {
if (_game & GF_SIMON2) {
- uint num = vc_read_var_or_word() * _vgaBaseDelay;
+ uint num = vc_read_var_or_word() * _frameRate;
add_vga_timer(num + VGA_DELAY_BASE, _vcPtr, _vgaCurSpriteId, _vgaCurFileId);
_vcPtr = (byte *)&_vc_get_out_of_code;
@@ -1662,7 +1662,7 @@ void SimonEngine::vc61_changeSprite() {
_vgaSpriteChanged++;
}
-void SimonEngine::vc62_fadeOut() {
+void SimonEngine::vc62_fastFadeOut() {
uint i;
vc29_stopAllSounds();
@@ -1671,7 +1671,7 @@ void SimonEngine::vc62_fadeOut() {
_videoVar3 = true;
_videoNumPalColors = 256;
- if (_videoPaletteMode == 4)
+ if (_windowNum == 4)
_videoNumPalColors = 208;
memcpy(_videoBuf1, _paletteBackup, _videoNumPalColors * sizeof(uint32));
@@ -1694,22 +1694,22 @@ void SimonEngine::vc62_fadeOut() {
if (vsp->id == 0x80) {
byte *old_file_1 = _curVgaFile1;
byte *old_file_2 = _curVgaFile2;
- uint palmode = _videoPaletteMode;
+ uint palmode = _windowNum;
vpe = &_vgaBufferPointers[vsp->fileId];
_curVgaFile1 = vpe->vgaFile1;
_curVgaFile2 = vpe->vgaFile2;
- _videoPaletteMode = vsp->paletteMode;
+ _windowNum = vsp->windowNum;
params[0] = READ_BE_UINT16(&vsp->image);
- params[1] = READ_BE_UINT16(&vsp->base_color);
+ params[1] = READ_BE_UINT16(&vsp->palette);
params[2] = READ_BE_UINT16(&vsp->x);
params[3] = READ_BE_UINT16(&vsp->y);
params[4] = READ_BE_UINT16(&vsp->flags);
_vcPtr = (byte *)params;
vc10_draw();
- _videoPaletteMode = palmode;
+ _windowNum = palmode;
_curVgaFile1 = old_file_1;
_curVgaFile2 = old_file_2;
break;
@@ -1724,7 +1724,7 @@ void SimonEngine::vc62_fadeOut() {
if ((_game & GF_SIMON1) && (_subroutine == 2923 || _subroutine == 2926))
dx_clear_surfaces(200);
else
- dx_clear_surfaces(_videoPaletteMode == 4 ? 134 : 200);
+ dx_clear_surfaces(_windowNum == 4 ? 134 : 200);
}
if (_game & GF_SIMON2) {
if (_nextMusicToPlay != -1)
@@ -1733,25 +1733,25 @@ void SimonEngine::vc62_fadeOut() {
}
-void SimonEngine::vc63_palette_thing_2() {
+void SimonEngine::vc63_fastFadeIn() {
_paletteColorCount = 208;
- if (_videoPaletteMode != 4) {
+ if (_windowNum != 4) {
_paletteColorCount = 256;
}
_videoVar3 = false;
}
-void SimonEngine::vc64_skipIfNoSpeech() {
+void SimonEngine::vc64_skipIfSpeechEnded() {
// Simon2
if (!_sound->isVoiceActive() || (_subtitles && _language != 20))
vc_skip_next_instruction();
}
-void SimonEngine::vc65_palette_thing_3() {
+void SimonEngine::vc65_slowFadeIn() {
// Simon2
_paletteColorCount = 624;
_videoNumPalColors = 208;
- if (_videoPaletteMode != 4) {
+ if (_windowNum != 4) {
_paletteColorCount = 768;
_videoNumPalColors = 256;
}
@@ -1862,16 +1862,16 @@ void SimonEngine::vc72_play_track_2() {
}
}
-void SimonEngine::vc73_setOp189Flag() {
+void SimonEngine::vc73_setMark() {
// Simon2
vc_read_next_byte();
- _op189Flags |= 1 << vc_read_next_byte();
+ _marks |= 1 << vc_read_next_byte();
}
-void SimonEngine::vc74_clearOp189Flag() {
+void SimonEngine::vc74_clearMark() {
// Simon2
vc_read_next_byte();
- _op189Flags &= ~(1 << vc_read_next_byte());
+ _marks &= ~(1 << vc_read_next_byte());
}
} // End of namespace Simon
diff --git a/simon/vga.h b/simon/vga.h
index 015c3f20cd..e20f32f034 100644
--- a/simon/vga.h
+++ b/simon/vga.h
@@ -69,7 +69,7 @@ struct VC10_state {
uint16 flags;
int x, y;
- byte base_color;
+ byte palette;
uint draw_width, draw_height;
uint x_skip, y_skip;