\r
=============================================================================\r
*/\r
-
+\r
#include "src/lib/16_ca.h"\r
//#include "ID_STRS.H"\r
\r
*/\r
\r
boolean CA_FarRead (int handle, byte far *dest, dword length)\r
-{
+{\r
boolean flag;\r
if (length>0xffffl)\r
printf("CA_FarRead doesn't support 64K reads yet!\n");\r
-
- __asm
+\r
+ __asm\r
{\r
push ds\r
mov bx,[handle]\r
mov ah,0x3f // READ w/handle\r
int 21h\r
pop ds\r
- jnc good
- mov errno,ax
- mov flag,0
- jmp End
+ jnc good\r
+ mov errno,ax\r
+ mov flag,0\r
+ jmp End\r
good:\r
cmp ax,[WORD PTR length]\r
je done\r
// errno = EINVFMT; // user manager knows this is bad read\r
- mov flag,0
- jmp End
-done:
- mov flag,1
-End:
+ mov flag,0\r
+ jmp End\r
+done:\r
+ mov flag,1\r
+End:\r
}\r
return flag;\r
}\r
*/\r
\r
boolean CA_FarWrite (int handle, byte far *source, dword length)\r
-{
+{\r
boolean flag;\r
if (length>0xffffl)\r
- printf("CA_FarWrite doesn't support 64K reads yet!\n");
+ printf("CA_FarWrite doesn't support 64K reads yet!\n");\r
\r
- __asm
+ __asm\r
{\r
push ds\r
mov bx,[handle]\r
mov ah,0x40 // WRITE w/handle\r
int 21h\r
pop ds\r
- jnc good
+ jnc good\r
mov errno,ax\r
- mov flag,0
+ mov flag,0\r
jmp End\r
good:\r
cmp ax,[WORD PTR length]\r
je done\r
- //errno = ENOMEM; // user manager knows this is bad write
- mov flag,0
+ //errno = ENOMEM; // user manager knows this is bad write\r
+ mov flag,0\r
jmp End\r
-done:
- mov flag,1
+done:\r
+ mov flag,1\r
End:\r
- }
+ }\r
return flag;\r
}\r
\r
==========================\r
*/\r
\r
-boolean CA_LoadFile(char *filename, memptr *ptr)\r
+boolean CA_LoadFile(char *filename, memptr *ptr, mminfo_t *mm, mminfotype *mmi)\r
{\r
int handle;\r
long size;\r
return false;\r
\r
size = filelength (handle);\r
- MM_GetPtr (ptr,size);\r
- if(!CA_FarRead (handle,*ptr,size))\r
+ MM_GetPtr(ptr,size, mm, mmi);\r
+ if(!CA_FarRead(handle,*ptr,size))\r
{\r
- close (handle);\r
+ close(handle);\r
return false;\r
}\r
close(handle);\r
//--------------------------\r
// expand less than 64k of data\r
//--------------------------\r
-
- __asm
+\r
+ __asm\r
{\r
mov bx,[headptr]\r
\r
asm mov bx,[headptr] // back to the head node for next bit\r
\r
asm cmp di,ax // done?\r
-asm jne expandshort
+asm jne expandshort\r
}\r
}\r
else\r
//--------------------------\r
\r
length--;\r
-
- __asm
+\r
+ __asm\r
{\r
asm mov bx,[headptr]\r
asm mov cl,1\r
asm jns expand // when length = ffff ffff, done\r
}\r
}\r
-
- __asm
+\r
+ __asm\r
{\r
mov ax,ss\r
- mov ds,ax
+ mov ds,ax\r
}\r
\r
}*/\r
=\r
======================\r
*/\r
-/*++++
+/*++++\r
void CA_CacheAudioChunk (int chunk)\r
{\r
long pos,compressed;\r
=\r
======================\r
*/\r
-/*++++
+/*++++\r
void CA_LoadAllSounds (void)\r
{\r
unsigned start,i;\r
\r
// ID_CA.H\r
#ifndef __16_CA__\r
-#define __16_CA__
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef __16_MM__
-#include "src/lib/16_head.h"
+#define __16_CA__\r
+\r
+#include <unistd.h>\r
+#include <fcntl.h>\r
+#include <sys/stat.h>\r
+\r
+#ifndef __16_MM__\r
+#include "src/lib/16_head.h"\r
#include "src/lib/16_mm.h"\r
#endif\r
\r
boolean CA_FarRead (int handle, byte far *dest, dword length);\r
boolean CA_FarWrite (int handle, byte far *source, dword length);\r
boolean CA_ReadFile (char *filename, memptr *ptr);\r
-boolean CA_LoadFile (char *filename, memptr *ptr);\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
\r