[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.540,1.541 vga.cpp,1.152,1.153 vga.h,1.15,1.16
kirben
kirben at users.sourceforge.net
Sun Nov 13 03:55:09 CET 2005
Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27777/simon
Modified Files:
simon.cpp vga.cpp vga.h
Log Message:
Fix invalid writes in FF.
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.540
retrieving revision 1.541
diff -u -d -r1.540 -r1.541
--- simon.cpp 13 Nov 2005 07:04:56 -0000 1.540
+++ simon.cpp 13 Nov 2005 11:53:57 -0000 1.541
@@ -2496,7 +2496,11 @@
_timer5 = 0;
} else {
if (!_dxUse3Or4ForLock) {
- num_lines = _windowNum == 4 ? 134 : 200;
+ if (getGameType() == GType_FF)
+ num_lines = 480;
+ else
+ num_lines = _windowNum == 4 ? 134 : 200;
+
_vgaVar8 = num_lines;
dx_copy_from_attached_to_2(0, 0, _screenWidth, num_lines);
dx_copy_from_attached_to_3(num_lines);
Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -d -r1.152 -r1.153
--- vga.cpp 13 Nov 2005 07:04:56 -0000 1.152
+++ vga.cpp 13 Nov 2005 11:53:57 -0000 1.153
@@ -457,7 +457,7 @@
int8 a = vs->depack_cont;
const byte *src = vs->depack_src;
byte *dst = vs->depack_dest;
- byte dh = vs->dh;
+ uint16 dh = vs->dh;
byte color;
if (a == -0x80)
@@ -696,6 +696,8 @@
width = READ_LE_UINT16(p2 + 6);
height = READ_LE_UINT16(p2 + 4) & 0x7FFF;
flags = p2[5];
+
+ debug(1, "Width %d Height %d Flags 0x%x", width, height, flags);
} else {
state.depack_src = _curVgaFile2 + READ_BE_UINT32(p2);
width = READ_BE_UINT16(p2 + 6) / 16;
@@ -703,8 +705,6 @@
flags = p2[4];
}
- debug(1, "Width %d Height %d Flags 0x%x", width, height, flags);
-
if (height == 0 || width == 0)
return;
@@ -752,7 +752,7 @@
return;
}
- if (getGameType() != GType_FF) {
+ if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
if (state.flags & 0x10) {
state.depack_src = vc10_uncompressFlip(state.depack_src, width, height);
} else if (state.flags & 1) {
@@ -762,8 +762,12 @@
vlut = &_video_windows[_windowNum * 4];
- state.draw_width = width * 2; /* cl */
+ state.draw_width = width; /* cl */
state.draw_height = height; /* ch */
+
+ if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
+ state.draw_width = width * 2; /* cl */
+ }
state.x_skip = 0; /* colums to skip = bh */
state.y_skip = 0; /* rows to skip = bl */
@@ -808,7 +812,9 @@
assert(state.draw_width != 0 && state.draw_height != 0);
- state.draw_width *= 4;
+ if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
+ state.draw_width *= 4;
+ }
state.surf2_addr = dx_lock_2();
state.surf2_pitch = _dxSurfacePitch;
@@ -880,7 +886,7 @@
} while (++w != state.draw_width);
/* vc10_helper_5 */
- } else if (((_lockWord & 0x20) && state.palette == 0) || state.palette == 0xC0) {
+ } else if (getGameType() != GType_FF && (((_lockWord & 0x20) && state.palette == 0) || state.palette == 0xC0)) {
const byte *src;
byte *dst;
uint h, i;
@@ -1001,6 +1007,7 @@
byte *src, *dst, *dst_org;
state.x_skip *= 4; /* reached */
+
state.dl = width;
state.dh = height;
@@ -1817,10 +1824,13 @@
// Allow one section of Simon the Sorcerer 1 introduction to be displayed
// in lower half of screen
- if ((getGameType() == GType_SIMON1) && (_subroutine == 2923 || _subroutine == 2926))
+ if ((getGameType() == GType_SIMON1) && (_subroutine == 2923 || _subroutine == 2926)) {
dx_clear_surfaces(200);
- else
+ } else if (getGameType() == GType_FF) {
+ dx_clear_surfaces(480);
+ } else {
dx_clear_surfaces(_windowNum == 4 ? 134 : 200);
+ }
}
if (getGameType() == GType_SIMON2) {
if (_nextMusicToPlay != -1)
Index: vga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- vga.h 11 Nov 2005 02:56:36 -0000 1.15
+++ vga.h 13 Nov 2005 11:53:57 -0000 1.16
@@ -112,7 +112,7 @@
byte *surf_addr;
uint surf_pitch;
- byte dl, dh;
+ uint16 dl, dh;
const byte *depack_src;
int8 depack_cont;
More information about the Scummvm-git-logs
mailing list