Commit 2492518c authored by Steven Fuller's avatar Steven Fuller

id_ca.c: converted the last usage of open() to the new functions

fmopl.c: removed an unused function
parent 8decf6bd
......@@ -645,23 +645,6 @@ static void OPLCloseTable()
free(VIB_TABLE);
}
/* CSM Key Controll */
INLINE void CSMKeyControll(OPL_CH *CH)
{
OPL_SLOT *slot1 = &CH->SLOT[SLOT1];
OPL_SLOT *slot2 = &CH->SLOT[SLOT2];
/* all key off */
OPL_KEYOFF(slot1);
OPL_KEYOFF(slot2);
/* total level latch */
slot1->TLL = slot1->TL + (CH->ksl_base>>slot1->ksl);
slot1->TLL = slot1->TL + (CH->ksl_base>>slot1->ksl);
/* key on */
CH->op1_out[0] = CH->op1_out[1] = 0;
OPL_KEYON(slot1);
OPL_KEYON(slot2);
}
/* ---------- opl initialize ---------- */
static void OPL_initalize(FM_OPL *OPL)
{
......
......@@ -74,13 +74,12 @@ boolean CA_WriteFile(char *filename, void *ptr, long length)
ssize_t l;
int handle;
handle = open(filename, O_CREAT | O_BINARY | O_WRONLY,
S_IREAD | S_IWRITE | S_IFREG);
handle = OpenWrite(filename);
if (handle == -1)
return false;
l = write(handle, ptr, length);
l = WriteBytes(handle, (byte *)ptr, length);
if (l == -1) {
perror("CA_FarWrite");
return false;
......@@ -92,7 +91,8 @@ boolean CA_WriteFile(char *filename, void *ptr, long length)
return false;
}
close(handle);
CloseWrite(handle);
return true;
}
......@@ -112,13 +112,13 @@ boolean CA_LoadFile(char *filename, memptr *ptr)
ssize_t l;
long size;
if ((handle = open(filename, O_RDONLY | O_BINARY)) == -1)
if ((handle = OpenRead(filename)) == -1)
return false;
size = filelength(handle);
size = ReadLength(handle);
MM_GetPtr(ptr, size);
l = read(handle, ptr, size);
l = ReadBytes(handle, (byte *)ptr, size);
if (l == -1) {
perror("CA_FarRead");
......@@ -131,7 +131,8 @@ boolean CA_LoadFile(char *filename, memptr *ptr)
return false;
}
close(handle);
CloseRead(handle);
return true;
}
......@@ -274,7 +275,7 @@ void CA_RLEWexpand(word *source, word *dest, long length, word rlewtag)
/* compressed string */
count = SwapInt16L(*source); source++;
value = *source++;
for (i = 1; i <= count; i++)
for (i = 0; i < count; i++)
*dest++ = value;
}
} while (dest < end);
......@@ -371,7 +372,6 @@ static void CAL_SetupGrFile()
/* ======================================================================== */
/*
======================
=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment