Ticket #7365: wip.diff
File wip.diff, 22.0 KB (added by , 18 years ago) |
---|
-
engines/agos/agos.h
479 479 uint8 _currentPalette[1024]; 480 480 uint8 _displayPalette[1024]; 481 481 482 byte _videoBuf1[ 32000];482 byte _videoBuf1[64000]; 483 483 uint16 _videoWindows[128]; 484 484 485 485 VgaTimerEntry _vgaTimerList[205]; … … 558 558 void setUserItem(Item *item, int n, int m); 559 559 560 560 void paletteFadeOut(byte *palPtr, uint num, uint size); 561 561 562 562 byte *allocateItem(uint size); 563 563 byte *allocateTable(uint size); 564 564 void alignTableMem(); … … 796 796 void drawIconArray_Simon(uint i, Item *item_ptr, int line, int classMask); 797 797 void removeIconArray(uint num); 798 798 799 void loadIconData(); 799 void loadIconData(); 800 800 void loadIconFile(); 801 801 void loadMenuFile(); 802 802 … … 1119 1119 void oe1_printPlayerHit(); 1120 1120 void oe1_printMonsterHit(); 1121 1121 1122 int16 levelOf(Item *item); 1122 int16 levelOf(Item *item); 1123 1123 int16 moreText(Item *i); 1124 1124 void lobjFunc(Item *i, const char *f); 1125 1125 uint confirmQuit(); … … 1278 1278 1279 1279 void drawImages(VC10_state *state); 1280 1280 void drawImages_Simon(VC10_state *state); 1281 void drawImages_SimonAmiga(VC10_state *state); 1281 1282 void drawImages_Feeble(VC10_state *state); 1282 1283 1283 1284 void scaleClip(int16 h, int16 w, int16 y, int16 x, int16 scrollY); … … 1335 1336 byte *getBackGround(); 1336 1337 byte *getScaleBuf(); 1337 1338 1338 void convertAmiga(byte *srcBuf, int32 fileSize); 1339 byte *convertclip(const byte *src, bool is32Colors, uint height, uint width, byte flags); 1340 1339 1341 bool decrunchFile(byte *src, byte *dst, uint32 size); 1340 1342 void loadVGABeardFile(uint id); 1341 1343 void loadVGAVideoFile(uint id, uint type); -
engines/agos/intern.h
210 210 GF_CRUNCHED_GAMEPC = 1 << 3, 211 211 GF_ZLIBCOMP = 1 << 4, 212 212 GF_32COLOR = 1 << 5, 213 GF_DEMO = 1 << 6 213 GF_PLANAR = 1 << 6, 214 GF_DEMO = 1 << 7 214 215 }; 215 216 216 217 enum GameFileTypes { -
engines/agos/vga.cpp
541 541 } 542 542 543 543 byte *AGOSEngine::vc10_flip(const byte *src, uint w, uint h) { 544 w *= 8;545 546 544 byte *dstPtr; 547 545 uint i; 548 546 549 dstPtr = _videoBuf1 + w; 550 551 do { 552 byte *dst = dstPtr; 553 for (i = 0; i != w; ++i) { 554 byte b = src[i]; 555 b = (b >> 4) | (b << 4); 556 *--dst = b; 547 if (getFeatures() & GF_32COLOR) { 548 const uint flipw = w * 16; 549 for (uint y = 0; y < h; ++y) { 550 dstPtr = _videoBuf1 + y * flipw; 551 for (i = 0; i < flipw; ++i) { 552 *--dstPtr = *src++; 553 } 557 554 } 555 } else { 556 w *= 8; 557 dstPtr = _videoBuf1 + w; 558 558 559 src += w; 560 dstPtr += w; 561 } while (--h); 559 do { 560 byte *dst = dstPtr; 561 for (i = 0; i != w; ++i) { 562 byte b = src[i]; 563 b = (b >> 4) | (b << 4); 564 *--dst = b; 565 } 562 566 567 src += w; 568 dstPtr += w; 569 } while (--h); 570 } 571 563 572 return _videoBuf1; 564 573 } 565 574 … … 620 629 if (_dumpImages) 621 630 dumpSingleBitmap(_vgaCurZoneNum, state.image, state.depack_src, width, height, 622 631 state.palette); 632 if (getFeatures() & GF_PLANAR) { 633 bool is32Colors = (getFeatures() & GF_32COLOR); 634 if ((((_lockWord & 0x20) && !state.palette) || state.palette == 0xC0) && 635 getGameType() == GType_SIMON1) { 636 is32Colors = true; 637 } 638 639 state.depack_src = convertclip(state.depack_src, is32Colors, height, width * 16, flags); 640 flags &= ~0x80; 641 } 642 623 643 // Check if image is compressed 624 644 if (getGameType() == GType_FF || getGameType() == GType_PP) { 625 645 if (flags & 0x80) { … … 654 674 return; 655 675 } 656 676 677 state.surf2_addr = getFrontBuf(); 678 state.surf2_pitch = _dxSurfacePitch; 679 680 state.surf_addr = getBackBuf(); 681 state.surf_pitch = _dxSurfacePitch; 682 657 683 if (getGameType() != GType_FF && getGameType() != GType_PP) { 658 if (state.flags & kDFCompressed Flip) {684 if (state.flags & kDFCompressed && state.flags & kDFCompressedFlip) { 659 685 state.depack_src = vc10_uncompressFlip(state.depack_src, width, height); 660 } else if (state.flags & kDF Flip) {686 } else if (state.flags & kDFCompressedFlip || state.flags & kDFFlip) { 661 687 state.depack_src = vc10_flip(state.depack_src, width, height); 662 688 } 663 689 } 664 690 665 state.surf2_addr = getFrontBuf();666 state.surf2_pitch = _dxSurfacePitch;667 668 state.surf_addr = getBackBuf();669 state.surf_pitch = _dxSurfacePitch;670 671 691 if (getGameType() == GType_FF || getGameType() == GType_PP) { 672 692 drawImages_Feeble(&state); 693 } else if (getFeatures() & GF_32COLOR) { 694 drawImages_SimonAmiga(&state); 673 695 } else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) { 674 drawImages_Simon(&state); 696 if ((((_lockWord & 0x20) && state.palette == 0) || state.palette == 0xC0)) { 697 drawImages_SimonAmiga(&state); 698 } else { 699 drawImages_Simon(&state); 700 } 675 701 } else { 676 702 drawImages(&state); 677 703 } … … 1107 1133 1108 1134 if (num == 3) { 1109 1135 memset(getBackBuf(), 0, _screenWidth * _screenHeight); 1110 } else { 1136 } else { 1111 1137 const uint16 *vlut = &_videoWindows[num * 4]; 1112 1138 byte *dst = getBackBuf() + vlut[0] * 16 + vlut[1] * _dxSurfacePitch; 1113 1139 -
engines/agos/res.cpp
718 718 error("loadVGAVideoFile: Read failed"); 719 719 720 720 dstSize = READ_BE_UINT32(srcBuffer + srcSize - 4); 721 if (type == 2) { 722 dst = (byte *)malloc(dstSize); 723 decrunchFile(srcBuffer, dst, srcSize); 724 convertAmiga(dst, dstSize); 725 free(dst); 726 } else { 727 dst = allocBlock (dstSize + extraBuffer); 728 decrunchFile(srcBuffer, dst, srcSize); 729 } 721 dst = allocBlock (dstSize + extraBuffer); 722 decrunchFile(srcBuffer, dst, srcSize); 730 723 free(srcBuffer); 731 724 } else { 732 if (getGameId() == GID_SIMON1CD32 && type == 2) { 733 dst = (byte *)malloc(dstSize); 734 if (in.read(dst, dstSize) != dstSize) 735 error("loadVGAVideoFile: Read failed"); 736 convertAmiga(dst, dstSize); 737 free(dst); 738 } else { 739 dst = allocBlock(dstSize + extraBuffer); 740 if (in.read(dst, dstSize) != dstSize) 741 error("loadVGAVideoFile: Read failed"); 742 } 725 dst = allocBlock(dstSize + extraBuffer); 726 if (in.read(dst, dstSize) != dstSize) 727 error("loadVGAVideoFile: Read failed"); 743 728 } 744 729 in.close(); 745 730 } else { -
engines/agos/res_ami.cpp
29 29 30 30 namespace AGOS { 31 31 32 byte *buffer; 33 byte *bufptr; 34 byte *bufferout; 35 byte *bufptrout; 36 uint32 bufoutend; 37 byte *clipptr; 38 byte *clipoutptr; 39 int clipnumber; 40 41 static void uncompressplane(byte *plane, byte *outptr, uint16 length) { 42 debug(10, "uncompressplane: length %d", length); 43 44 char x; 45 byte y, z; 46 while (length) { 47 x = *plane++; 32 static void uncompressplane(const byte *plane, byte *outptr, uint16 length) { 33 debug(0, "uncompressplane: length %d", length); 34 while (length != 0) { 35 char x = *plane++; 48 36 if (x >= 0) { 49 x += 1;50 y = *plane++;51 z = *plane++;52 while (x ) {37 x++; 38 byte y = *plane++; 39 byte z = *plane++; 40 while (x != 0) { 53 41 *outptr++ = y; 54 42 *outptr++ = z; 55 length--; 56 if (length == 0) 43 if (--length == 0) 57 44 break; 58 45 x--; 59 46 } 60 47 } else { 61 while (x ) {48 while (x != 0) { 62 49 *outptr++ = *plane++; 63 50 *outptr++ = *plane++; 64 length--; 65 if (length == 0) 51 if (--length == 0) 66 52 break; 67 53 x++; 68 54 } … … 70 56 } 71 57 } 72 58 73 static void convertcompressedclip(uint16 height, uint16 width) { 74 debug(10, "convertcompressedclip: height %d width %d", height, width); 59 static void decodeBitPlaneData(uint16 *w, bool is32Colors, uint8 *&dst) { 60 for (int j = 0; j < 8; j++) { 61 byte color1 = 0; 62 byte color2 = 0; 63 for (int p = 0; p < 5; ++p) { 64 if (w[p] & 0x8000) { 65 color1 |= 1 << p; 66 } 67 if (w[p] & 0x4000) { 68 color2 |= 1 << p; 69 } 70 w[p] <<= 2; 71 } 72 if (is32Colors) { 73 *dst++ = color1; 74 *dst++ = color2; 75 } else { 76 *dst++ = color1 * 16 + color2; 77 } 78 } 79 } 75 80 76 byte *plane0; 77 byte *plane1; 78 byte *plane2; 79 byte *plane3; 81 static void convertcompressedclip(const byte *src, byte *dst, bool is32Colors, uint16 height, uint16 width) { 82 debug(0, "convertcompressedclip: height %d width %d", height, width); 83 84 const byte *plane0; 85 const byte *plane1; 86 const byte *plane2; 87 const byte *plane3; 88 const byte *plane4; 80 89 byte *uncbuffer; 81 90 byte *uncptr0; 82 91 byte *uncptr1; 83 92 byte *uncptr2; 84 93 byte *uncptr3; 94 byte *uncptr4; 85 95 byte *uncbfrout; 86 96 byte *uncbfroutptr; 87 uint16 length, i, j, k, word1, word2, word3, word4, cliplength; 88 byte outbyte, outbyte1, x, y; 89 char n; 90 uncbuffer = (byte *)malloc(height * width * 4); 91 uncbfrout = (byte *)malloc(height * width * 4); 92 97 uint32 length, i, j; 98 uint16 w[5]; 99 uncbuffer = (byte *)malloc(height * width * 5); 100 uncbfrout = (byte *)malloc(height * width * 5); 101 93 102 byte *free_uncbuffer = uncbuffer; 94 103 byte *free_uncbfrout = uncbfrout; 95 96 length = width / 16;97 length *= height; 98 plane0 = READ_BE_UINT16(clipptr) + READ_BE_UINT16(clipptr + 2) + clipptr; clipptr += 4; plane0 += 4;99 plane1 = READ_BE_UINT16(clipptr) + READ_BE_UINT16(clipptr + 2) + clipptr; clipptr += 4; plane1 += 4;100 plane2 = READ_BE_UINT16(clipptr) + READ_BE_UINT16(clipptr + 2) + clipptr; clipptr += 4; plane2 += 4;101 plane3 = READ_BE_UINT16(clipptr) + READ_BE_UINT16(clipptr + 2) + clipptr; clipptr += 4; plane3 += 4;102 plane0 -= 4;103 plane1 -= 8;104 plane2 -= 12;105 plane3 -= 16; 104 105 length = (width + 15) / 16 * height; 106 107 plane0 = src + READ_BE_UINT16(src + 0) + READ_BE_UINT16(src + 2); 108 plane1 = src + READ_BE_UINT16(src + 4) + READ_BE_UINT16(src + 6); 109 plane2 = src + READ_BE_UINT16(src + 8) + READ_BE_UINT16(src + 10); 110 plane3 = src + READ_BE_UINT16(src + 12) + READ_BE_UINT16(src + 14); 111 if (is32Colors) { 112 plane4 = src + READ_BE_UINT16(src + 16) + READ_BE_UINT16(src + 18); 113 } 114 106 115 uncptr0 = uncbuffer; 107 116 uncptr1 = uncptr0+(length*2); 108 117 uncptr2 = uncptr1+(length*2); 109 118 uncptr3 = uncptr2+(length*2); 119 if (is32Colors) { 120 uncptr4 = uncptr3+(length*2); 121 } 110 122 uncompressplane(plane0, uncptr0, length); 111 123 uncompressplane(plane1, uncptr1, length); 112 124 uncompressplane(plane2, uncptr2, length); 113 125 uncompressplane(plane3, uncptr3, length); 126 if (is32Colors) { 127 uncompressplane(plane4, uncptr4, length); 128 } 114 129 uncbfroutptr = uncbfrout; 130 115 131 for (i = 0; i < length; i++) { 116 word1=READ_BE_UINT16(uncptr0); uncptr0 += 2; 117 word2=READ_BE_UINT16(uncptr1); uncptr1 += 2; 118 word3=READ_BE_UINT16(uncptr2); uncptr2 += 2; 119 word4=READ_BE_UINT16(uncptr3); uncptr3 += 2; 120 for (j = 0; j < 8; j++) { 121 outbyte = ((word1 / 32768) + ((word2 / 32768) * 2) + ((word3 / 32768) * 4) + ((word4 / 32768) * 8)); 122 word1 <<= 1; 123 word2 <<= 1; 124 word3 <<= 1; 125 word4 <<= 1; 126 outbyte1 = ((word1 / 32768) + ((word2 / 32768) * 2) + ((word3 / 32768) * 4) + ((word4 / 32768) * 8)); 127 word1 <<= 1; 128 word2 <<= 1; 129 word3 <<= 1; 130 word4 <<= 1; 131 *uncbfroutptr++ = (outbyte * 16 + outbyte1); 132 w[0] = READ_BE_UINT16(uncptr0); uncptr0 += 2; 133 w[1] = READ_BE_UINT16(uncptr1); uncptr1 += 2; 134 w[2] = READ_BE_UINT16(uncptr2); uncptr2 += 2; 135 w[3] = READ_BE_UINT16(uncptr3); uncptr3 += 2; 136 if (is32Colors) { 137 w[4] = READ_BE_UINT16(uncptr4); uncptr4 += 2; 138 } else { 139 w[4] = 0; 132 140 } 141 decodeBitPlaneData(w, is32Colors, uncbfroutptr); 133 142 } 134 uncptr0 = uncbuffer; 135 uncptr1 = uncbfrout; 136 uncptr2 = uncbfrout; 137 uncptr3 = uncbfrout; 138 for (i = 0; i < (width / 16); i++) { 139 for (k = 0; k < 8; k++) { 140 for (j = 0; j < height; j++) { 141 *uncptr0++ = *uncptr1; 142 uncptr1 += 8; 143 const uint8 *srcPtr = uncbfrout; 144 if (is32Colors) { 145 for (i = 0; i < width / 16; ++i) { 146 for (j = 0; j < height; ++j) { 147 memcpy(dst + width * j + 16 * i, srcPtr, 16); 148 srcPtr += 16; 143 149 } 144 uncptr2++;145 uncptr1 = uncptr2;146 150 } 147 uncptr3 += (height * 8); 148 uncptr2 = uncptr3; 149 uncptr1 = uncptr2; 150 } 151 length *= 8; 152 cliplength = 0; 153 while(1) { 154 if (length == 1) { 155 *clipoutptr++ = 0xFF; bufoutend++; 156 *clipoutptr++ = *uncbuffer; bufoutend++; 157 cliplength += 2; 158 break; 159 } 160 x = *uncbuffer++; 161 y = *uncbuffer++; 162 length -= 2; 163 if (x == y) { 164 n = 1; 165 y = *uncbuffer++; 166 if (length == 0) { 167 *clipoutptr++ = n; bufoutend++; 168 *clipoutptr++ = x; bufoutend++; 169 cliplength += 2; 170 break; 151 } else { 152 for (i = 0; i < width / 16; ++i) { 153 for (j = 0; j < height; ++j) { 154 memcpy(dst + width / 2 * j + 8 * i, srcPtr, 8); 155 srcPtr += 8; 171 156 } 172 length--;173 while (x == y) {174 n++;175 y = *uncbuffer++;176 if (length == 0)177 break;178 length--;179 if(n == 127)180 break;181 }182 *clipoutptr++ = n; bufoutend++;183 *clipoutptr++ = x; bufoutend++;184 cliplength += 2;185 uncbuffer--;186 if (length == 0)187 break;188 length++;189 } else {190 n =- 1;191 uncptr0 = clipoutptr;192 clipoutptr++;193 bufoutend++;194 *clipoutptr++ = x; bufoutend++;195 cliplength += 2;196 x = y;197 y = *uncbuffer++;198 if (length == 0) {199 *uncptr0 = n;200 break;201 }202 length--;203 while (x != y) {204 if (n == -127)205 break;206 n--;207 *clipoutptr++ = x; bufoutend++;208 cliplength++;209 x = y;210 y = *uncbuffer++;211 if (length == 0)212 break;213 length--;214 }215 *uncptr0 = n;216 if (length == 0)217 break;218 uncbuffer -= 2;219 length += 2;220 157 } 221 158 } 222 if (cliplength > (height * width / 2))223 warning("Negative compression. Clip %d. %d bytes bigger.",clipnumber,(cliplength-(height*width/2)));224 159 free(free_uncbuffer); 225 160 free(free_uncbfrout); 226 161 } 227 162 228 static void convertclip(uint32 offset, uint16 height, uint16 width) {229 debug( 10, "convertclip: height %d width %d", height, width);163 byte *AGOSEngine::convertclip(const byte *src, bool is32Colors, uint height, uint width, byte flags) { 164 debug(0, "convertclip: is32Colors %d height %d width %d", is32Colors, height, width); 230 165 231 uint32 length, i, j; 232 uint16 word1, word2, word3, word4; 233 byte outbyte, outbyte1; 234 clipptr = offset + buffer; 235 clipoutptr = bufoutend + bufferout; 236 WRITE_BE_UINT32(bufptrout, bufoutend); bufptrout += 4; 237 WRITE_BE_UINT16(bufptrout, height); bufptrout += 2; 238 WRITE_BE_UINT16(bufptrout, width); bufptrout += 2; 239 if (height > 32000) { 240 convertcompressedclip((uint16)(height - 32768), width); 166 uint32 length, i; 167 byte *dst = _videoBuf1; 168 169 if (flags & 0x80) { 170 convertcompressedclip(src, dst, is32Colors, height, width); 241 171 } else { 242 width /= 16; 243 length = height * width; 172 length = (width + 15) / 16 * height; 244 173 for (i = 0; i < length; i++) { 245 word1 = READ_BE_UINT16(clipptr); clipptr += 2; 246 word2 = READ_BE_UINT16(clipptr); clipptr += 2; 247 word3 = READ_BE_UINT16(clipptr); clipptr += 2; 248 word4 = READ_BE_UINT16(clipptr); clipptr += 2; 249 for (j = 0; j < 8; j++) { 250 outbyte = ((word1 / 32768) + ((word2 / 32768) * 2) + ((word3 / 32768) * 4) + ((word4 / 32768) * 8)); 251 word1 <<= 1; 252 word2 <<= 1; 253 word3 <<= 1; 254 word4 <<= 1; 255 outbyte1 = ((word1 / 32768) + ((word2 / 32768) * 2) + ((word3 / 32768) * 4) + ((word4 / 32768) * 8)); 256 word1 <<= 1; 257 word2 <<= 1; 258 word3 <<= 1; 259 word4 <<= 1; 260 *clipoutptr++ = (outbyte * 16 + outbyte1); bufoutend++; 174 uint16 w[5]; 175 w[0] = READ_BE_UINT16(src); src += 2; 176 w[1] = READ_BE_UINT16(src); src += 2; 177 w[2] = READ_BE_UINT16(src); src += 2; 178 w[3] = READ_BE_UINT16(src); src += 2; 179 if (is32Colors) { 180 w[4] = READ_BE_UINT16(src); src += 2; 181 } else { 182 w[4] = 0; 261 183 } 184 decodeBitPlaneData(w, is32Colors, dst); 262 185 } 263 186 } 264 }265 187 266 void AGOSEngine::convertAmiga(byte *srcBuf, int32 fileSize) { 267 // TODO Better detection of full screen images 268 if ((getGameType() == GType_WW && fileSize == 178624) || 269 fileSize == 64800) { 270 byte *dstBuf = allocBlock (fileSize); 271 memcpy(dstBuf, srcBuf, fileSize); 272 return; 273 } 274 275 uint32 clipoffset, outlength; 276 uint16 clipwidth, clipheight; 277 byte *clipsend; 278 279 debug(10, "convertAmiga: fizeSize %d", fileSize); 280 281 buffer = (byte *)malloc((int32)fileSize); 282 memcpy(buffer, srcBuf, fileSize); 283 bufptr = buffer; 284 285 bufferout = (byte *)malloc((int32)(fileSize * 2)); 286 bufptr = buffer; 287 bufptrout = bufferout; 288 clipnumber = 0; 289 while(1) { 290 clipoffset = READ_BE_UINT32(bufptr); bufptr += 4; 291 clipheight = READ_BE_UINT16(bufptr); bufptr += 2; 292 clipwidth = READ_BE_UINT16(bufptr); bufptr += 2; 293 if (clipoffset != 0) 294 break; 295 WRITE_BE_UINT32(bufptrout, 0); bufptrout += 4; 296 WRITE_BE_UINT32(bufptrout, 0); bufptrout += 4; 297 clipnumber++; 298 } 299 300 clipsend = buffer + clipoffset; 301 bufoutend = clipoffset; 302 while (bufptr <= clipsend) { 303 if (clipoffset != 0) { 304 convertclip(clipoffset, clipheight, clipwidth); 305 } else { 306 WRITE_BE_UINT32(bufptrout, 0); bufptrout += 4; 307 WRITE_BE_UINT32(bufptrout, 0); bufptrout += 4; 308 } 309 clipoffset = READ_BE_UINT32(bufptr); bufptr += 4; 310 clipheight = READ_BE_UINT16(bufptr); bufptr += 2; 311 clipwidth = READ_BE_UINT16(bufptr); bufptr += 2; 312 clipnumber++; 313 } 314 outlength = bufoutend; 315 debug(10, "convertAmiga: outlength %d",outlength); 316 317 byte *dstBuf = allocBlock (outlength); 318 memcpy(dstBuf, bufferout, outlength); 319 free(buffer); 320 free(bufferout); 188 printf("Decode complete\n"); 189 return _videoBuf1; 321 190 } 322 191 323 192 } // End of namespace AGOS -
engines/agos/agosgame.cpp
16 16 17 17 GType_ELVIRA1, 18 18 GID_ELVIRA1, 19 GF_OLD_BUNDLE | GF_CRUNCHED 19 GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR 20 20 }, 21 21 22 22 // Elvira 1 - English Amiga Demo … … 37 37 38 38 GType_ELVIRA1, 39 39 GID_ELVIRA1, 40 GF_OLD_BUNDLE | GF_CRUNCHED | GF_ DEMO40 GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR | GF_DEMO 41 41 }, 42 42 43 43 // Elvira 1 - English Atari ST Floppy … … 59 59 60 60 GType_ELVIRA1, 61 61 GID_ELVIRA1, 62 GF_OLD_BUNDLE | GF_CRUNCHED 62 GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR 63 63 }, 64 64 65 65 // Elvira 1 - French Atari ST Floppy … … 81 81 82 82 GType_ELVIRA1, 83 83 GID_ELVIRA1, 84 GF_OLD_BUNDLE | GF_CRUNCHED 84 GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR 85 85 }, 86 86 87 87 // Elvira 1 - English DOS Floppy … … 171 171 172 172 GType_ELVIRA2, 173 173 GID_ELVIRA2, 174 GF_OLD_BUNDLE | GF_CRUNCHED 174 GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR 175 175 }, 176 176 177 177 // Elvira 2 - English Atari ST Floppy … … 195 195 196 196 GType_ELVIRA2, 197 197 GID_ELVIRA2, 198 GF_OLD_BUNDLE | GF_CRUNCHED 198 GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR 199 199 }, 200 200 201 201 // Elvira 2 - French Atari ST Floppy … … 219 219 220 220 GType_ELVIRA2, 221 221 GID_ELVIRA2, 222 GF_OLD_BUNDLE | GF_CRUNCHED 222 GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR 223 223 }, 224 224 225 225 … … 365 365 366 366 GType_WW, 367 367 GID_WAXWORKS, 368 GF_OLD_BUNDLE | GF_CRUNCHED | GF_CRUNCHED_GAMEPC 368 GF_OLD_BUNDLE | GF_CRUNCHED | GF_CRUNCHED_GAMEPC | GF_PLANAR 369 369 }, 370 370 371 371 // Waxworks - English DOS Floppy … … 459 459 460 460 GType_SIMON1, 461 461 GID_SIMON1AMIGA, 462 GF_32COLOR | GF_CRUNCHED | GF_OLD_BUNDLE 462 GF_32COLOR | GF_CRUNCHED | GF_OLD_BUNDLE | GF_PLANAR 463 463 }, 464 464 465 465 // Simon the Sorcerer 1 - English Amiga ECS Demo … … 481 481 482 482 GType_SIMON1, 483 483 GID_SIMON1AMIGA, 484 GF_32COLOR | GF_CRUNCHED | GF_CRUNCHED_GAMEPC | GF_OLD_BUNDLE | GF_ DEMO484 GF_32COLOR | GF_CRUNCHED | GF_CRUNCHED_GAMEPC | GF_OLD_BUNDLE | GF_PLANAR | GF_DEMO 485 485 }, 486 486 487 487 // Simon the Sorcerer 1 - English Amiga AGA Floppy … … 503 503 504 504 GType_SIMON1, 505 505 GID_SIMON1AMIGA, 506 GF_CRUNCHED | GF_OLD_BUNDLE 506 GF_CRUNCHED | GF_OLD_BUNDLE | GF_PLANAR 507 507 }, 508 508 509 509 // Simon the Sorcerer 1 - French Amiga AGA Floppy … … 525 525 526 526 GType_SIMON1, 527 527 GID_SIMON1AMIGA, 528 GF_CRUNCHED | GF_OLD_BUNDLE 528 GF_CRUNCHED | GF_OLD_BUNDLE | GF_PLANAR 529 529 }, 530 530 531 531 // Simon the Sorcerer 1 - German Amiga AGA Floppy … … 547 547 548 548 GType_SIMON1, 549 549 GID_SIMON1AMIGA, 550 GF_CRUNCHED | GF_OLD_BUNDLE 550 GF_CRUNCHED | GF_OLD_BUNDLE | GF_PLANAR 551 551 }, 552 552 553 553 // Simon the Sorcerer 1 - English Amiga CD32 … … 569 569 570 570 GType_SIMON1, 571 571 GID_SIMON1CD32, 572 GF_TALKIE | GF_OLD_BUNDLE 572 GF_TALKIE | GF_OLD_BUNDLE | GF_PLANAR 573 573 }, 574 574 575 575 // Simon the Sorcerer 1 - English Amiga CD32 alternative? … … 591 591 592 592 GType_SIMON1, 593 593 GID_SIMON1CD32, 594 GF_TALKIE | GF_OLD_BUNDLE 594 GF_TALKIE | GF_OLD_BUNDLE | GF_PLANAR 595 595 }, 596 596 597 597 // Simon the Sorcerer 1 - English DOS Floppy Demo -
engines/agos/gfx.cpp
175 175 176 176 if (getGameType() != GType_FF && getGameType() != GType_PP) { 177 177 state->draw_width = state->width * 2; 178 } 178 } 179 179 180 180 cur = state->x; 181 181 if (cur < 0) { … … 384 384 dst += _screenWidth; 385 385 src += state->width; 386 386 } while (--state->draw_height); 387 } 387 } 388 388 } 389 389 390 390 void AGOSEngine::drawImages_Simon(VC10_state *state) { … … 408 408 state->surf_addr += xoffs + yoffs * state->surf2_pitch; 409 409 410 410 if (state->flags & kDFMasked) { 411 return; 412 411 413 byte *mask, *src, *dst; 412 414 byte h; 413 415 uint w; … … 529 531 } 530 532 531 533 if (state->flags & kDFCompressed) { 534 535 return; 536 532 537 uint w, h; 533 538 byte *src, *dst, *dstPtr; 534 539 … … 589 594 } 590 595 } 591 596 597 void AGOSEngine::drawImages_SimonAmiga(VC10_state *state) { 598 uint8 *dst; 599 const byte *src; 600 const uint16 *vlut = &_videoWindows[_windowNum * 4]; 601 602 if (drawImages_clip(state) == 0) 603 return; 604 605 uint xoffs = ((vlut[0] - _videoWindows[16]) * 2 + state->x) * 8; 606 uint yoffs = (vlut[1] - _videoWindows[17] + state->y); 607 608 state->surf2_addr += xoffs + yoffs * state->surf_pitch; 609 state->surf_addr += xoffs + yoffs * state->surf2_pitch; 610 611 if (state->flags & kDFMasked) { 612 warning("Unhandled kDFMasked"); 613 } else { 614 src = state->depack_src + (state->width * state->y_skip * 16) + (state->x_skip * 8); 615 dst = state->surf_addr; 616 617 state->draw_width *= 2; 618 619 uint h = state->draw_height; 620 do { 621 for (uint i = 0; i != state->draw_width; i++) 622 if ((state->flags & kDFNonTrans) || src[i]) 623 dst[i] = src[i] | state->palette; 624 dst += _screenWidth; 625 src += state->width * 16; 626 } while (--h); 627 } 628 } 629 592 630 void AGOSEngine::drawImages(VC10_state *state) { 593 631 const uint16 *vlut = &_videoWindows[_windowNum * 4]; 594 632