Merge remote-tracking branch 'refs/remotes/project64/master'
This commit is contained in:
commit
7f0deb2ced
|
@ -10,13 +10,15 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <Project64\N64 System\Interpreter\Interpreter Ops.h>
|
||||||
|
|
||||||
class CInterpreterCPU :
|
class CInterpreterCPU :
|
||||||
private R4300iOp
|
private R4300iOp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void BuildCPU();
|
static void BuildCPU();
|
||||||
static void ExecuteCPU();
|
static void ExecuteCPU();
|
||||||
static void ExecuteOps(int Cycles);
|
static void ExecuteOps(int32_t Cycles);
|
||||||
static void InPermLoop();
|
static void InPermLoop();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Interpreter Ops.h"
|
||||||
|
|
||||||
class R4300iOp32 :
|
class R4300iOp32 :
|
||||||
public R4300iOp
|
public R4300iOp
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,10 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <Project64\Settings\Debug Settings.h>
|
||||||
|
#include <Project64\N64 System\Mips\Register Class.h>
|
||||||
|
#include <Project64\N64 System\Mips\OpCode.h>
|
||||||
|
|
||||||
class R4300iOp :
|
class R4300iOp :
|
||||||
public CLogging,
|
public CLogging,
|
||||||
protected CDebugSettings,
|
protected CDebugSettings,
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
* *
|
* *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "Audio.h"
|
||||||
|
#include <Project64\N64 System\System Globals.h>
|
||||||
|
#include <Project64\N64 System\N64 Class.h>
|
||||||
|
|
||||||
CAudio::CAudio()
|
CAudio::CAudio()
|
||||||
{
|
{
|
||||||
|
@ -17,7 +20,6 @@ CAudio::CAudio()
|
||||||
|
|
||||||
CAudio::~CAudio()
|
CAudio::~CAudio()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAudio::Reset()
|
void CAudio::Reset()
|
||||||
|
@ -30,10 +32,10 @@ void CAudio::Reset()
|
||||||
m_FramesPerSecond = 60;
|
m_FramesPerSecond = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD CAudio::GetLength()
|
uint32_t CAudio::GetLength()
|
||||||
{
|
{
|
||||||
WriteTraceF(TraceAudio, __FUNCTION__ ": Start (m_SecondBuff = %d)", m_SecondBuff);
|
WriteTraceF(TraceAudio, __FUNCTION__ ": Start (m_SecondBuff = %d)", m_SecondBuff);
|
||||||
DWORD TimeLeft = g_SystemTimer->GetTimer(CSystemTimer::AiTimerInterrupt), Res = 0;
|
uint32_t TimeLeft = g_SystemTimer->GetTimer(CSystemTimer::AiTimerInterrupt), Res = 0;
|
||||||
if (TimeLeft > 0)
|
if (TimeLeft > 0)
|
||||||
{
|
{
|
||||||
Res = (TimeLeft / m_CountsPerByte);
|
Res = (TimeLeft / m_CountsPerByte);
|
||||||
|
@ -42,7 +44,7 @@ DWORD CAudio::GetLength()
|
||||||
return (Res + 3)&~3;
|
return (Res + 3)&~3;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD CAudio::GetStatus()
|
uint32_t CAudio::GetStatus()
|
||||||
{
|
{
|
||||||
WriteTraceF(TraceAudio, __FUNCTION__ ": m_Status = %X", m_Status);
|
WriteTraceF(TraceAudio, __FUNCTION__ ": m_Status = %X", m_Status);
|
||||||
return m_Status;
|
return m_Status;
|
||||||
|
@ -56,9 +58,11 @@ void CAudio::LenChanged()
|
||||||
if (g_Reg->AI_LEN_REG >= 0x40000)
|
if (g_Reg->AI_LEN_REG >= 0x40000)
|
||||||
{
|
{
|
||||||
WriteTraceF(TraceAudio, __FUNCTION__ ": *** Ignoring Write, To Large (%X)", g_Reg->AI_LEN_REG);
|
WriteTraceF(TraceAudio, __FUNCTION__ ": *** Ignoring Write, To Large (%X)", g_Reg->AI_LEN_REG);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
m_Status |= ai_busy;
|
m_Status |= ai_busy;
|
||||||
DWORD AudioLeft = g_SystemTimer->GetTimer(CSystemTimer::AiTimerInterrupt);
|
uint32_t AudioLeft = g_SystemTimer->GetTimer(CSystemTimer::AiTimerInterrupt);
|
||||||
if (m_SecondBuff == 0)
|
if (m_SecondBuff == 0)
|
||||||
{
|
{
|
||||||
if (AudioLeft == 0)
|
if (AudioLeft == 0)
|
||||||
|
@ -124,20 +128,19 @@ void CAudio::BusyTimerDone()
|
||||||
m_Status &= ~ai_busy;
|
m_Status &= ~ai_busy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAudio::SetViIntr ( DWORD VI_INTR_TIME )
|
void CAudio::SetViIntr(uint32_t VI_INTR_TIME)
|
||||||
{
|
{
|
||||||
double CountsPerSecond = (DWORD)((double)VI_INTR_TIME * m_FramesPerSecond);
|
double CountsPerSecond = (uint32_t)((double)VI_INTR_TIME * m_FramesPerSecond);
|
||||||
if (m_BytesPerSecond != 0 && (g_System->AiCountPerBytes() == 0))
|
if (m_BytesPerSecond != 0 && (g_System->AiCountPerBytes() == 0))
|
||||||
{
|
{
|
||||||
m_CountsPerByte = (int)((double)CountsPerSecond / (double)m_BytesPerSecond);
|
m_CountsPerByte = (int32_t)((double)CountsPerSecond / (double)m_BytesPerSecond);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CAudio::SetFrequency(uint32_t Dacrate, uint32_t System)
|
||||||
void CAudio::SetFrequency (DWORD Dacrate, DWORD System)
|
|
||||||
{
|
{
|
||||||
WriteTraceF(TraceAudio, __FUNCTION__ "(Dacrate: %X System: %d): AI_BITRATE_REG = %X", Dacrate, System, g_Reg->AI_BITRATE_REG);
|
WriteTraceF(TraceAudio, __FUNCTION__ "(Dacrate: %X System: %d): AI_BITRATE_REG = %X", Dacrate, System, g_Reg->AI_BITRATE_REG);
|
||||||
DWORD Frequency;
|
uint32_t Frequency;
|
||||||
|
|
||||||
switch (System)
|
switch (System)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,19 +21,22 @@ public:
|
||||||
CAudio();
|
CAudio();
|
||||||
~CAudio();
|
~CAudio();
|
||||||
|
|
||||||
DWORD GetLength ();
|
uint32_t GetLength ();
|
||||||
DWORD GetStatus ();
|
uint32_t GetStatus ();
|
||||||
void LenChanged ();
|
void LenChanged ();
|
||||||
void InterruptTimerDone();
|
void InterruptTimerDone();
|
||||||
void BusyTimerDone ();
|
void BusyTimerDone ();
|
||||||
void Reset ();
|
void Reset ();
|
||||||
void SetViIntr ( DWORD VI_INTR_TIME );
|
void SetViIntr ( uint32_t VI_INTR_TIME );
|
||||||
void SetFrequency ( DWORD Dacrate, DWORD System );
|
void SetFrequency ( uint32_t Dacrate, uint32_t System );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DWORD m_SecondBuff;
|
CAudio(const CAudio&); // Disable copy constructor
|
||||||
DWORD m_Status;
|
CAudio& operator=(const CAudio&); // Disable assignment
|
||||||
DWORD m_BytesPerSecond;
|
|
||||||
int m_CountsPerByte;
|
uint32_t m_SecondBuff;
|
||||||
int m_FramesPerSecond;
|
uint32_t m_Status;
|
||||||
|
uint32_t m_BytesPerSecond;
|
||||||
|
int32_t m_CountsPerByte;
|
||||||
|
int32_t m_FramesPerSecond;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue