Skip to content

Commit

Permalink
HOPKINS: Correct video decompression methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Oct 13, 2012
1 parent 4c456f7 commit 4ec8e71
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions engines/hopkins/graphics.cpp
Expand Up @@ -1129,7 +1129,7 @@ void GraphicsManager::Copy_WinScan_Vbe3(const byte *sourceSurface, byte *destSur
}
}

void GraphicsManager::Copy_Video_Vbe3(const byte *surface) {
void GraphicsManager::Copy_Video_Vbe3(const byte *srcData) {
int result;
int v2;
int v3;
Expand All @@ -1146,7 +1146,7 @@ void GraphicsManager::Copy_Video_Vbe3(const byte *surface) {
result = 0;
v2 = 0;
v3 = 0;
v4 = surface;
v4 = srcData;
for (;;) {
v5 = *v4;
if (*v4 < 222)
Expand All @@ -1162,7 +1162,7 @@ void GraphicsManager::Copy_Video_Vbe3(const byte *surface) {
v5 = *(v4 + 2);
v4 += 2;
} else if (v5 == (byte)-2) {
v2 += (int16)READ_LE_UINT16(v4 + 1);
v2 += READ_LE_UINT16(v4 + 1);
v5 = *(v4 + 3);
v4 += 3;
} else {
Expand Down Expand Up @@ -1199,8 +1199,8 @@ void GraphicsManager::Copy_Video_Vbe3(const byte *surface) {
}
}

void GraphicsManager::Copy_Video_Vbe16(const byte *surface) {
const byte *srcP = surface;
void GraphicsManager::Copy_Video_Vbe16(const byte *srcData) {
const byte *srcP = srcData;
int destOffset = 0;
assert(VideoPtr);

Expand All @@ -1217,7 +1217,7 @@ void GraphicsManager::Copy_Video_Vbe16(const byte *surface) {
srcByte = *(const byte *)(srcP + 2);
srcP += 2;
} else if (srcByte == 254) {
destOffset += (int16)READ_LE_UINT16(srcP + 1);
destOffset += READ_LE_UINT16(srcP + 1);
srcByte = *(const byte *)(srcP + 3);
srcP += 3;
} else {
Expand Down Expand Up @@ -1259,13 +1259,13 @@ void GraphicsManager::Copy_Video_Vbe16(const byte *surface) {
}
}

void GraphicsManager::Copy_Video_Vbe16a(const byte *surface) {
void GraphicsManager::Copy_Video_Vbe16a(const byte *srcData) {
int v2;
const byte *v3;
unsigned __int8 v4;

v2 = 0;
v3 = surface;
v3 = srcData;
for (;;) {
v4 = *v3;
if (*v3 < 0xFCu)
Expand All @@ -1277,7 +1277,7 @@ void GraphicsManager::Copy_Video_Vbe16a(const byte *surface) {
v4 = *(v3 + 2);
v3 += 2;
} else if (v4 == -2) {
v2 += (int16)READ_LE_UINT16(v3 + 1);
v2 += READ_LE_UINT16(v3 + 1);
v4 = *(v3 + 3);
v3 += 3;
} else {
Expand All @@ -1286,7 +1286,7 @@ void GraphicsManager::Copy_Video_Vbe16a(const byte *surface) {
v3 += 5;
}
Video_Cont_Vbe16a:
WRITE_LE_UINT16(v2 + v2 + VideoPtr, (int16)READ_LE_UINT16(PAL_PIXELS + 2 * v4));
WRITE_LE_UINT16(v2 + v2 + VideoPtr, READ_LE_UINT16(PAL_PIXELS + 2 * v4));
++v3;
++v2;
}
Expand Down Expand Up @@ -1336,9 +1336,9 @@ void GraphicsManager::Sprite_Vesa(byte *surface, const byte *spriteData, int xp,
clip_flag = false;

spriteP += 4;
int width = (int16)READ_LE_UINT16(spriteP);
int width = READ_LE_UINT16(spriteP);
spriteP += 2;
int height = (int16)READ_LE_UINT16(spriteP);
int height = READ_LE_UINT16(spriteP);

// Clip X
clip_x1 = width;
Expand Down Expand Up @@ -1386,7 +1386,7 @@ void GraphicsManager::Sprite_Vesa(byte *surface, const byte *spriteData, int xp,

// Set up source
spriteP += 6;
int srcOffset = (int16)READ_LE_UINT16(spriteP);
int srcOffset = READ_LE_UINT16(spriteP);
spriteP += 4;
const byte *srcP = spriteP;
spriteP += srcOffset;
Expand All @@ -1404,7 +1404,7 @@ void GraphicsManager::Sprite_Vesa(byte *surface, const byte *spriteData, int xp,

while ((byteVal = *srcP) != 253) {
++srcP;
width = (int16)READ_LE_UINT16(srcP);
width = READ_LE_UINT16(srcP);
srcP += 2;

if (byteVal == 254) {
Expand Down Expand Up @@ -1432,7 +1432,7 @@ void GraphicsManager::Sprite_Vesa(byte *surface, const byte *spriteData, int xp,

while ((byteVal = *srcP) != 253) {
++srcP;
width = (int16)READ_LE_UINT16(srcP);
width = READ_LE_UINT16(srcP);
srcP += 2;

if (byteVal == 254) {
Expand Down
6 changes: 3 additions & 3 deletions engines/hopkins/graphics.h
Expand Up @@ -145,9 +145,9 @@ class GraphicsManager {
uint16 MapRGB(byte r, byte g, byte b);
void DD_VBL();
void Copy_WinScan_Vbe3(const byte *sourceSurface, byte *destSurface);
void Copy_Video_Vbe3(const byte *surface);
void Copy_Video_Vbe16(const byte *surface);
void Copy_Video_Vbe16a(const byte *surface);
void Copy_Video_Vbe3(const byte *srcData);
void Copy_Video_Vbe16(const byte *srcData);
void Copy_Video_Vbe16a(const byte *srcData);
void Capture_Mem(const byte *srcSurface, byte *destSurface, int xs, int ys, unsigned int width, int height);

/**
Expand Down

0 comments on commit 4ec8e71

Please sign in to comment.