=\r
======================\r
*/\r
-/*++++\r
+\r
#define NEARTAG 0xa7\r
#define FARTAG 0xa8\r
\r
count = ch&0xff;\r
if (!count)\r
{ // have to insert a word containing the tag byte\r
- ch |= *((unsigned char far *)inptr)++;\r
+ ch |= *(/*(unsigned char far *)*/inptr)++;\r
*outptr++ = ch;\r
length--;\r
}\r
else\r
{\r
- offset = *((unsigned char far *)inptr)++;\r
+ offset = *(/*(unsigned char far *)*/inptr)++;\r
copyptr = outptr - offset;\r
length -= count;\r
while (count--)\r
count = ch&0xff;\r
if (!count)\r
{ // have to insert a word containing the tag byte\r
- ch |= *((unsigned char far *)inptr)++;\r
+ ch |= *(/*(unsigned char far *)*/inptr)++;\r
*outptr++ = ch;\r
length --;\r
}\r
}\r
}\r
}\r
-*/\r
\r
\r
/*\r
=\r
======================\r
*/\r
-/*++++\r
+\r
long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,\r
unsigned rlewtag)\r
{\r
complength = 2*(dest-start);\r
return complength;\r
}\r
-*/\r
+\r
\r
/*\r
======================\r
=\r
======================\r
*/\r
-/*++++\r
+\r
void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,\r
unsigned rlewtag)\r
{\r
//\r
// NOTE: A repeat count that produces 0xfff0 bytes can blow this!\r
//\r
-\r
-asm mov bx,rlewtag\r
-asm mov si,sourceoff\r
-asm mov di,destoff\r
-asm mov es,destseg\r
-asm mov ds,sourceseg\r
-\r
+ __asm{\r
+ mov bx,rlewtag\r
+ mov si,sourceoff\r
+ mov di,destoff\r
+ mov es,destseg\r
+ mov ds,sourceseg\r
+#ifdef __BORLANDC__\r
+ }\r
+#endif\r
expand:\r
-asm lodsw\r
-asm cmp ax,bx\r
-asm je repeat\r
-asm stosw\r
-asm jmp next\r
-\r
+#ifdef __BORLANDC__\r
+ __asm {\r
+#endif\r
+ lodsw\r
+ cmp ax,bx\r
+ je repeat\r
+ stosw\r
+ jmp next\r
+#ifdef __BORLANDC__\r
+ }\r
+#endif\r
repeat:\r
-asm lodsw\r
-asm mov cx,ax // repeat count\r
-asm lodsw // repeat value\r
-asm rep stosw\r
-\r
+#ifdef __BORLANDC__\r
+ __asm {\r
+#endif\r
+ lodsw\r
+ mov cx,ax // repeat count\r
+ lodsw // repeat value\r
+ rep stosw\r
+#ifdef __BORLANDC__\r
+ }\r
+#endif\r
next:\r
-\r
-asm cmp si,0x10 // normalize ds:si\r
-asm jb sinorm\r
-asm mov ax,si\r
-asm shr ax,1\r
-asm shr ax,1\r
-asm shr ax,1\r
-asm shr ax,1\r
-asm mov dx,ds\r
-asm add dx,ax\r
-asm mov ds,dx\r
-asm and si,0xf\r
+#ifdef __BORLANDC__\r
+ __asm {\r
+#endif\r
+ cmp si,0x10 // normalize ds:si\r
+ jb sinorm\r
+ mov ax,si\r
+ shr ax,1\r
+ shr ax,1\r
+ shr ax,1\r
+ shr ax,1\r
+ mov dx,ds\r
+ add dx,ax\r
+ mov ds,dx\r
+ and si,0xf\r
+#ifdef __BORLANDC__\r
+ }\r
+#endif\r
sinorm:\r
-asm cmp di,0x10 // normalize es:di\r
-asm jb dinorm\r
-asm mov ax,di\r
-asm shr ax,1\r
-asm shr ax,1\r
-asm shr ax,1\r
-asm shr ax,1\r
-asm mov dx,es\r
-asm add dx,ax\r
-asm mov es,dx\r
-asm and di,0xf\r
+#ifdef __BORLANDC__\r
+ __asm {\r
+#endif\r
+ cmp di,0x10 // normalize es:di\r
+ jb dinorm\r
+ mov ax,di\r
+ shr ax,1\r
+ shr ax,1\r
+ shr ax,1\r
+ shr ax,1\r
+ mov dx,es\r
+ add dx,ax\r
+ mov es,dx\r
+ and di,0xf\r
+#ifdef __BORLANDC__\r
+ }\r
+#endif\r
dinorm:\r
+#ifdef __BORLANDC__\r
+ __asm {\r
+#endif\r
+ cmp di,ss:endoff\r
+ jne expand\r
+ mov ax,es\r
+ cmp ax,ss:endseg\r
+ jb expand\r
\r
-asm cmp di,ss:endoff\r
-asm jne expand\r
-asm mov ax,es\r
-asm cmp ax,ss:endseg\r
-asm jb expand\r
-\r
-asm mov ax,ss\r
-asm mov ds,ax\r
-\r
+ mov ax,ss\r
+ mov ds,ax\r
+ }\r
}\r
-*/\r
\r
\r
/*\r
boolean CA_WriteFile (char *filename, void far *ptr, long length, mminfo_t *mm);\r
boolean CA_LoadFile (char *filename, memptr *ptr, mminfo_t *mm, mminfotype *mmi);\r
\r
-//long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,unsigned rlewtag);\r
+long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,unsigned rlewtag);\r
\r
-//void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,unsigned rlewtag);\r
+void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,unsigned rlewtag);\r
\r
void CA_Startup (global_game_variables_t *gvar);\r
void CA_Shutdown (global_game_variables_t *gvar);\r