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() ...@@ -645,23 +645,6 @@ static void OPLCloseTable()
free(VIB_TABLE); 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 ---------- */ /* ---------- opl initialize ---------- */
static void OPL_initalize(FM_OPL *OPL) static void OPL_initalize(FM_OPL *OPL)
{ {
......
...@@ -74,13 +74,12 @@ boolean CA_WriteFile(char *filename, void *ptr, long length) ...@@ -74,13 +74,12 @@ boolean CA_WriteFile(char *filename, void *ptr, long length)
ssize_t l; ssize_t l;
int handle; int handle;
handle = open(filename, O_CREAT | O_BINARY | O_WRONLY, handle = OpenWrite(filename);
S_IREAD | S_IWRITE | S_IFREG);
if (handle == -1) if (handle == -1)
return false; return false;
l = write(handle, ptr, length); l = WriteBytes(handle, (byte *)ptr, length);
if (l == -1) { if (l == -1) {
perror("CA_FarWrite"); perror("CA_FarWrite");
return false; return false;
...@@ -92,7 +91,8 @@ boolean CA_WriteFile(char *filename, void *ptr, long length) ...@@ -92,7 +91,8 @@ boolean CA_WriteFile(char *filename, void *ptr, long length)
return false; return false;
} }
close(handle); CloseWrite(handle);
return true; return true;
} }
...@@ -112,13 +112,13 @@ boolean CA_LoadFile(char *filename, memptr *ptr) ...@@ -112,13 +112,13 @@ boolean CA_LoadFile(char *filename, memptr *ptr)
ssize_t l; ssize_t l;
long size; long size;
if ((handle = open(filename, O_RDONLY | O_BINARY)) == -1) if ((handle = OpenRead(filename)) == -1)
return false; return false;
size = filelength(handle); size = ReadLength(handle);
MM_GetPtr(ptr, size); MM_GetPtr(ptr, size);
l = read(handle, ptr, size); l = ReadBytes(handle, (byte *)ptr, size);
if (l == -1) { if (l == -1) {
perror("CA_FarRead"); perror("CA_FarRead");
...@@ -131,7 +131,8 @@ boolean CA_LoadFile(char *filename, memptr *ptr) ...@@ -131,7 +131,8 @@ boolean CA_LoadFile(char *filename, memptr *ptr)
return false; return false;
} }
close(handle); CloseRead(handle);
return true; return true;
} }
...@@ -274,7 +275,7 @@ void CA_RLEWexpand(word *source, word *dest, long length, word rlewtag) ...@@ -274,7 +275,7 @@ void CA_RLEWexpand(word *source, word *dest, long length, word rlewtag)
/* compressed string */ /* compressed string */
count = SwapInt16L(*source); source++; count = SwapInt16L(*source); source++;
value = *source++; value = *source++;
for (i = 1; i <= count; i++) for (i = 0; i < count; i++)
*dest++ = value; *dest++ = value;
} }
} while (dest < end); } while (dest < end);
...@@ -371,7 +372,6 @@ static void CAL_SetupGrFile() ...@@ -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