Fix some init glitches.

This commit is contained in:
n-a-c-h
2005-02-24 13:03:51 +00:00
parent 6a144dd8a2
commit df3275b8c4
3 changed files with 18 additions and 17 deletions

View File

@@ -20,6 +20,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <string.h>
typedef unsigned char bool8;
typedef unsigned char uint8;
typedef unsigned short uint16;
@@ -30,19 +32,6 @@ typedef long int32;
#define FALSE 0
#define TRUE 1
struct
{
bool8 waiting4command;
bool8 half_command;
uint16 command;
uint32 in_count;
uint32 in_index;
uint32 out_count;
uint32 out_index;
uint8 parameters[512];
uint8 output[512];
} DSP4;
/*
Due recognition and credit are given on Overload's DSP website.
Thank those contributors for their hard work on this chip.
@@ -61,6 +50,19 @@ Fixed-point math reminder:
#define WRITE_WORD(s, d) (*(uint16 *) (s)) = (d)
#define WRITE_DWORD(s, d) (*(uint32 *) (s)) = (d)
struct
{
bool8 waiting4command;
bool8 half_command;
uint16 command;
uint32 in_count;
uint32 in_index;
uint32 out_count;
uint32 out_index;
uint8 parameters[512];
uint8 output[512];
} DSP4;
// op control
int8 DSP4_Logic; // controls op flow
@@ -2043,14 +2045,12 @@ void DSP4_OP11(int16 A, int16 B, int16 C, int16 D, int16 *M)
//Processing Code
/////////////////////////////////////////////////////////////
uint8 dsp4_byte;
uint16 dsp4_address;
void InitDSP4()
{
memset(&DSP4, 0, sizeof(DSP4));
DSP4.waiting4command = TRUE;
}