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