Ticket #7365: wip-2.diff
File wip-2.diff, 21.6 KB (added by , 18 years ago) |
---|
-
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_Amiga(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); -
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 { -
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; 547 if (getFeatures() & GF_32COLOR) { 548 w *= 16; 549 dstPtr = _videoBuf1 + w; 550 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; 557 } 551 do { 552 byte *dst = dstPtr; 553 for (i = 0; i != w; ++i) { 554 *--dst = src[i]; 555 } 558 556 559 src += w; 560 dstPtr += w; 561 } while (--h); 557 src += w; 558 dstPtr += w; 559 } while (--h); 560 } else { 561 w *= 8; 562 dstPtr = _videoBuf1 + w; 562 563 564 do { 565 byte *dst = dstPtr; 566 for (i = 0; i != w; ++i) { 567 byte b = src[i]; 568 b = (b >> 4) | (b << 4); 569 *--dst = b; 570 } 571 572 src += w; 573 dstPtr += w; 574 } while (--h); 575 } 576 563 577 return _videoBuf1; 564 578 } 565 579 … … 620 634 if (_dumpImages) 621 635 dumpSingleBitmap(_vgaCurZoneNum, state.image, state.depack_src, width, height, 622 636 state.palette); 637 if (getFeatures() & GF_PLANAR) { 638 bool is32Colors = (getFeatures() & GF_32COLOR); 639 if ((((_lockWord & 0x20) && !state.palette) || state.palette == 0xC0) && 640 getGameType() == GType_SIMON1) { 641 is32Colors = true; 642 } 643 644 state.depack_src = convertclip(state.depack_src, is32Colors, height, width * 16, flags); 645 // decoded data in res_ami.cpp is always uncompressed 646 flags &= ~0x80; 647 if (state.flags & kDFCompressedFlip) { 648 state.flags &= ~kDFCompressedFlip; 649 state.flags |= kDFFlip; 650 } 651 if (state.flags & kDFCompressed) { 652 state.flags &= ~kDFCompressed; 653 } 654 } 655 623 656 // Check if image is compressed 624 657 if (getGameType() == GType_FF || getGameType() == GType_PP) { 625 658 if (flags & 0x80) { … … 654 687 return; 655 688 } 656 689 690 state.surf2_addr = getFrontBuf(); 691 state.surf2_pitch = _dxSurfacePitch; 692 693 state.surf_addr = getBackBuf(); 694 state.surf_pitch = _dxSurfacePitch; 695 657 696 if (getGameType() != GType_FF && getGameType() != GType_PP) { 658 697 if (state.flags & kDFCompressedFlip) { 659 698 state.depack_src = vc10_uncompressFlip(state.depack_src, width, height); … … 662 701 } 663 702 } 664 703 665 state.surf2_addr = getFrontBuf();666 state.surf2_pitch = _dxSurfacePitch;667 668 state.surf_addr = getBackBuf();669 state.surf_pitch = _dxSurfacePitch;670 671 704 if (getGameType() == GType_FF || getGameType() == GType_PP) { 672 705 drawImages_Feeble(&state); 706 } else if (getFeatures() & GF_32COLOR) { 707 drawImages_Amiga(&state); 673 708 } else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) { 674 drawImages_Simon(&state); 709 if ((((_lockWord & 0x20) && state.palette == 0) || state.palette == 0xC0)) { 710 drawImages_Amiga(&state); 711 } else { 712 drawImages_Simon(&state); 713 } 675 714 } else { 676 715 drawImages(&state); 677 716 } … … 1107 1146 1108 1147 if (num == 3) { 1109 1148 memset(getBackBuf(), 0, _screenWidth * _screenHeight); 1110 } else { 1149 } else { 1111 1150 const uint16 *vlut = &_videoWindows[num * 4]; 1112 1151 byte *dst = getBackBuf() + vlut[0] * 16 + vlut[1] * _dxSurfacePitch; 1113 1152 -
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 { -
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; 32 enum { 33 kMaxColorDepth = 5 34 }; 40 35 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++; 36 static void uncompressplane(const byte *plane, byte *outptr, uint16 length) { 37 debug(0, "uncompressplane: length %d", length); 38 while (length != 0) { 39 char x = *plane++; 48 40 if (x >= 0) { 49 x += 1;50 y = *plane++;51 z = *plane++;52 while (x ) {41 x++; 42 byte y = *plane++; 43 byte z = *plane++; 44 while (x != 0) { 53 45 *outptr++ = y; 54 46 *outptr++ = z; 55 length--; 56 if (length == 0) 47 if (--length == 0) 57 48 break; 58 49 x--; 59 50 } 60 51 } else { 61 while (x ) {52 while (x != 0) { 62 53 *outptr++ = *plane++; 63 54 *outptr++ = *plane++; 64 length--; 65 if (length == 0) 55 if (--length == 0) 66 56 break; 67 57 x++; 68 58 } … … 70 60 } 71 61 } 72 62 73 static void convertcompressedclip(uint16 height, uint16 width) { 74 debug(10, "convertcompressedclip: height %d width %d", height, width); 75 76 byte *plane0; 77 byte *plane1; 78 byte *plane2; 79 byte *plane3; 80 byte *uncbuffer; 81 byte *uncptr0; 82 byte *uncptr1; 83 byte *uncptr2; 84 byte *uncptr3; 85 byte *uncbfrout; 86 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 93 byte *free_uncbuffer = uncbuffer; 94 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; 106 uncptr0 = uncbuffer; 107 uncptr1 = uncptr0+(length*2); 108 uncptr2 = uncptr1+(length*2); 109 uncptr3 = uncptr2+(length*2); 110 uncompressplane(plane0, uncptr0, length); 111 uncompressplane(plane1, uncptr1, length); 112 uncompressplane(plane2, uncptr2, length); 113 uncompressplane(plane3, uncptr3, length); 114 uncbfroutptr = uncbfrout; 115 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 } 133 } 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; 63 static void bitplanetochunky(uint16 *w, uint8 colorDepth, uint8 *&dst) { 64 for (int j = 0; j < 8; j++) { 65 byte color1 = 0; 66 byte color2 = 0; 67 for (int p = 0; p < 5; ++p) { 68 if (w[p] & 0x8000) { 69 color1 |= 1 << p; 143 70 } 144 uncptr2++; 145 uncptr1 = uncptr2; 146 } 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; 71 if (w[p] & 0x4000) { 72 color2 |= 1 << p; 171 73 } 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++; 74 w[p] <<= 2; 75 } 76 if (colorDepth > 4) { 77 *dst++ = color1; 78 *dst++ = color2; 189 79 } 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; 80 *dst++ = (color1 << 4) | color2; 220 81 } 221 82 } 222 if (cliplength > (height * width / 2))223 warning("Negative compression. Clip %d. %d bytes bigger.",clipnumber,(cliplength-(height*width/2)));224 free(free_uncbuffer);225 free(free_uncbfrout);226 83 } 227 84 228 static void convertc lip(uint32 offset, uint16 height, uint16 width) {229 debug( 10, "convertclip: height %d width %d", height, width);85 static void convertcompressedclip(const byte *src, byte *dst, uint8 colorDepth, uint16 height, uint16 width) { 86 debug(0, "convertcompressedclip: height %d width %d", height, width); 230 87 88 const byte *plane[kMaxColorDepth]; 89 byte *uncptr[kMaxColorDepth]; 231 90 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); 241 } else { 242 width /= 16; 243 length = height * width; 244 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++; 261 } 91 uint16 w[kMaxColorDepth]; 92 93 byte *uncbfrout = (byte *)malloc(width * height); 94 95 length = (width + 15) / 16 * height; 96 97 for (i = 0; i < colorDepth; ++i) { 98 plane[i] = src + READ_BE_UINT16(src + i * 4) + READ_BE_UINT16(src + i * 4 + 2); 99 uncptr[i] = (uint8 *)malloc(length * 2); 100 uncompressplane(plane[i], uncptr[i], length); 101 plane[i] = uncptr[i]; 102 } 103 104 byte *uncbfroutptr = uncbfrout; 105 for (i = 0; i < length; ++i) { 106 for (j = 0; j < colorDepth; ++j) { 107 w[j] = READ_BE_UINT16(plane[j]); plane[j] += 2; 262 108 } 109 bitplanetochunky(w, colorDepth, uncbfroutptr); 263 110 } 264 }265 111 266 void AGOSEngine::convertAmiga(byte *srcBuf, int32 fileSize) { 267 // TODO Better detection of full screen images268 if ((getGameType() == GType_WW && fileSize == 178624) ||269 f ileSize == 64800) {270 byte *dstBuf = allocBlock (fileSize);271 memcpy(dstBuf, srcBuf, fileSize);272 return;112 uncbfroutptr = uncbfrout; 113 const int chunkSize = colorDepth > 4 ? 16 : 8; 114 for (i = 0; i < width / 16; ++i) { 115 for (j = 0; j < height; ++j) { 116 memcpy(dst + width * chunkSize / 16 * j + chunkSize * i, uncbfroutptr, chunkSize); 117 uncbfroutptr += chunkSize; 118 } 273 119 } 274 120 275 uint32 clipoffset, outlength; 276 uint16 clipwidth, clipheight; 277 byte *clipsend; 121 free(uncbfrout); 122 for (i = 0; i < colorDepth; ++i) { 123 free(uncptr[i]); 124 } 125 } 278 126 279 debug(10, "convertAmiga: fizeSize %d", fileSize); 127 byte *AGOSEngine::convertclip(const byte *src, bool is32Colors, uint height, uint width, byte flags) { 128 debug(0, "convertclip: is32Colors %d height %d width %d", is32Colors, height, width); 280 129 281 buffer = (byte *)malloc((int32)fileSize); 282 memcpy(buffer, srcBuf, fileSize); 283 bufptr = buffer; 130 static byte *_planarBuf = 0; 131 static uint32 _planarBufSize = 0; // FIXME move these variables to AGOSEngine 284 132 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++; 133 uint8 colorDepth = is32Colors ? 5 : 4; 134 135 uint32 length, i, j; 136 137 if (_planarBufSize < width * height) { 138 free(_planarBuf); 139 _planarBufSize = width * height; 140 _planarBuf = (byte *)malloc(_planarBufSize); 298 141 } 299 142 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; 143 byte *dst = _planarBuf; // can't re-use _videoBuf1 here as it's already used in vc10_flip 144 if (flags & 0x80) { 145 convertcompressedclip(src, dst, colorDepth, height, width); 146 } else { 147 length = (width + 15) / 16 * height; 148 for (i = 0; i < length; i++) { 149 uint16 w[kMaxColorDepth]; 150 for (j = 0; j < colorDepth; ++j) { 151 w[j] = READ_BE_UINT16(src); src += 2; 152 } 153 bitplanetochunky(w, colorDepth, dst); 308 154 } 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 155 } 314 outlength = bufoutend;315 debug(10, "convertAmiga: outlength %d",outlength);316 156 317 byte *dstBuf = allocBlock (outlength); 318 memcpy(dstBuf, bufferout, outlength); 319 free(buffer); 320 free(bufferout); 157 // printf("Decode complete\n"); 158 return _planarBuf; 321 159 } 322 160 323 161 } // End of namespace AGOS -
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 -
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_Amiga(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