Merge pull request #4362 from cam900/scsp_minor

scsp.cpp : Minor updates
This commit is contained in:
R. Belmont 2018-12-02 07:49:54 -05:00 committed by GitHub
commit 57a0782136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 545 additions and 574 deletions

File diff suppressed because it is too large Load Diff

View File

@ -173,7 +173,6 @@ private:
TIMER_CALLBACK_MEMBER( timerC_cb );
int Get_AR(int base, int R);
int Get_DR(int base, int R);
int Get_RR(int base, int R);
void Compute_EG(SCSP_SLOT *slot);
int EG_Update(SCSP_SLOT *slot);
uint32_t Step(SCSP_SLOT *slot);

View File

@ -61,7 +61,7 @@ static int32_t UNPACK(uint16_t val)
void SCSPDSP::Init()
{
std::memset(this, 0, sizeof(*this));
RBL = 0x8000;
RBL = (8*1024); // Initial RBL is 0
Stopped = true;
}
@ -80,8 +80,6 @@ void SCSPDSP::Step()
#endif
int32_t ACC = 0; //26 bit
int32_t SHIFTED = 0; //24 bit
int32_t Y = 0; //13 bit
int32_t MEMVAL = 0;
int32_t FRC_REG = 0; //13 bit
int32_t Y_REG = 0; //24 bit
@ -210,6 +208,7 @@ void SCSPDSP::Step()
//X |= 0xFF000000;
}
int32_t Y = 0; //13 bit
if (YSEL == 0)
Y = FRC_REG;
else if (YSEL == 1)
@ -223,6 +222,7 @@ void SCSPDSP::Step()
Y_REG = INPUTS;
//Shifter
int32_t SHIFTED = 0; //24 bit
if (SHIFT == 0)
SHIFTED = std::max<int32_t>(std::min<int32_t>(ACC, 0x007FFFFF), -0x00800000);
else if (SHIFT == 1)
@ -236,7 +236,7 @@ void SCSPDSP::Step()
//if (SHIFTED & 0x00800000)
//SHIFTED |= 0xFF000000;
}
else if(SHIFT==3)
else if (SHIFT == 3)
{
SHIFTED = ACC;
SHIFTED <<= 8;