- sync recent changes to to mdfn 1.22.2
This commit is contained in:
retro-wertz 2019-04-29 19:34:39 +08:00
parent c2b75292a2
commit 173020a460
12 changed files with 158 additions and 176 deletions

View File

@ -214,10 +214,10 @@ void CSystem::Reset(void)
gSystemCycleCount=0;
gNextTimerEvent=0;
gCPUBootAddress=0;
gSystemIRQ=FALSE;
gSystemNMI=FALSE;
gSystemCPUSleep=FALSE;
gSystemHalt=FALSE;
gSystemIRQ=false;
gSystemNMI=false;
gSystemCPUSleep=false;
gSystemHalt=false;
gSuzieDoneTime = 0;
mMemMap->Reset();
@ -825,7 +825,7 @@ void retro_run()
if (memcmp(&last_pixel_format, &spec.surface->format, sizeof(MDFN_PixelFormat)))
{
spec.VideoFormatChanged = TRUE;
spec.VideoFormatChanged = true;
last_pixel_format = spec.surface->format;
}

View File

@ -258,8 +258,8 @@
PUSH(mPC&0xff);\
PUSH(PS()|0x10);\
\
mD=FALSE;\
mI=TRUE;\
mD=false;\
mI=true;\
\
mPC=CPU_PEEKW(IRQ_VECTOR);\
}
@ -299,22 +299,22 @@
#define xCLC()\
{\
mC=FALSE;\
mC=false;\
}
#define xCLD()\
{\
mD=FALSE;\
mD=false;\
}
#define xCLI()\
{\
mI=FALSE;\
mI=false;\
}
#define xCLV()\
{\
mV=FALSE;\
mV=false;\
}
#define xCMP()\
@ -618,7 +618,7 @@
#define xSTP()\
{\
gSystemCPUSleep=TRUE;\
gSystemCPUSleep=true;\
}
#define xSTX()\
@ -689,6 +689,6 @@
#define xWAI()\
{\
gSystemCPUSleep=TRUE;\
gSystemCPUSleep=true;\
}

View File

@ -12,8 +12,8 @@ void C65C02::Update(void)
PUSH(mPC&0xff);
PUSH(PS()&0xef); // Clear B flag on stack
mI=TRUE; // Stop further interrupts
mD=FALSE; // Clear decimal mode
mI=true; // Stop further interrupts
mD=false; // Clear decimal mode
// Pick up the new PC
mPC=CPU_PEEKW(IRQ_VECTOR);

View File

@ -163,18 +163,18 @@ class C65C02
mOpcode=0;
mOperand=0;
mPC=CPU_PEEKW(BOOT_VECTOR);
mN=FALSE;
mV=FALSE;
mB=FALSE;
mD=FALSE;
mI=TRUE;
mZ=TRUE;
mC=FALSE;
mIRQActive=FALSE;
mN=false;
mV=false;
mB=false;
mD=false;
mI=true;
mZ=true;
mC=false;
mIRQActive=false;
gSystemNMI=FALSE;
gSystemIRQ=FALSE;
gSystemCPUSleep=FALSE;
gSystemNMI=false;
gSystemIRQ=false;
gSystemCPUSleep=false;
}
inline int StateAction(StateMem *sm, int load, int data_only)

View File

@ -92,12 +92,12 @@ LYNX_HEADER CCart::DecodeHeader(const uint8 *data)
bool CCart::TestMagic(const uint8 *data, uint32 size)
{
if(size < HEADER_RAW_SIZE)
return(FALSE);
return(false);
if(memcmp(data, "LYNX", 4) || data[8] != 0x01)
return(FALSE);
return(false);
return(TRUE);
return(true);
}
CCart::CCart(const uint8 *gamedata, uint32 gamesize)
@ -109,9 +109,9 @@ CCart::CCart(const uint8 *gamedata, uint32 gamesize)
md5_context md5;
md5.starts();
mWriteEnableBank0=FALSE;
mWriteEnableBank1=FALSE;
mCartRAM=FALSE;
mWriteEnableBank0=false;
mWriteEnableBank1=false;
mCartRAM=false;
if (gamesize) {
// Checkout the header bytes
@ -286,8 +286,8 @@ CCart::CCart(const uint8 *gamedata, uint32 gamesize)
mCountMask1=0x0ff;
mCartBank1 = new uint8[mMaskBank1+1];
for(loop=0;loop<mMaskBank1+1;loop++) mCartBank1[loop]=DEFAULT_RAM_CONTENTS;
mWriteEnableBank1=TRUE;
mCartRAM=TRUE;
mWriteEnableBank1=true;
mCartRAM=true;
}
}

View File

@ -108,7 +108,7 @@ INLINE void CMemMap::Poke(uint32 addr, uint8 data)
int newstate,loop;
// FC00-FCFF Susie area
newstate=(data&0x01)?FALSE:TRUE;
newstate=(data&0x01)?false:true;
if(newstate!=mSusieEnabled)
{
mSusieEnabled=newstate;
@ -124,7 +124,7 @@ INLINE void CMemMap::Poke(uint32 addr, uint8 data)
}
// FD00-FCFF Mikie area
newstate=(data&0x02)?FALSE:TRUE;
newstate=(data&0x02)?false:true;
if(newstate!=mMikieEnabled)
{
mMikieEnabled=newstate;
@ -140,7 +140,7 @@ INLINE void CMemMap::Poke(uint32 addr, uint8 data)
}
// FE00-FFF7 Rom area
newstate=(data&0x04)?FALSE:TRUE;
newstate=(data&0x04)?false:true;
if(newstate!=mRomEnabled)
{
mRomEnabled=newstate;
@ -156,7 +156,7 @@ INLINE void CMemMap::Poke(uint32 addr, uint8 data)
}
// FFFA-FFFF Vector area - Overload ROM space
newstate=(data&0x08)?FALSE:TRUE;
newstate=(data&0x08)?false:true;
if(newstate!=mVectorsEnabled)
{
mVectorsEnabled=newstate;

View File

@ -61,7 +61,7 @@ void CMikie::BlowOut(void)
mSystem.GetRegs(regs);
//sprintf(addr,"Runtime Error - System Halted\nCMikie::Poke() - Read/Write to counter clocks at PC=$%04x.",regs.PC);
//gError->Warning(addr);
gSystemHalt=TRUE;
gSystemHalt=true;
}
@ -73,7 +73,7 @@ CMikie::CMikie(CSystem& parent)
mpDisplayCurrent=NULL;
mpRamPointer=NULL;
mUART_CABLE_PRESENT=FALSE;
mUART_CABLE_PRESENT=false;
mpUART_TX_CALLBACK=NULL;
int loop;
@ -93,7 +93,7 @@ void CMikie::Reset(void)
{
TRACE_MIKIE0("Reset()");
mAudioInputComparator=FALSE; // Initialises to unknown
mAudioInputComparator=false; // Initialises to unknown
mDisplayAddress=0x00; // Initialises to unknown
mLynxLine=0;
mLynxLineDMACounter=0;
@ -242,8 +242,8 @@ void CMikie::Reset(void)
//
// Initialise display control register vars
//
mDISPCTL_DMAEnable=FALSE;
mDISPCTL_Flip=FALSE;
mDISPCTL_DMAEnable=false;
mDISPCTL_Flip=false;
mDISPCTL_FourColour=0;
mDISPCTL_Colour=0;
@ -309,18 +309,18 @@ void CMikie::PresetForHomebrew(void)
// i.e LR.O doesn't bother to setup the timers
mTIM_0_BKUP=0x9e;
mTIM_0_ENABLE_RELOAD=TRUE;
mTIM_0_ENABLE_COUNT=TRUE;
mTIM_0_ENABLE_RELOAD=true;
mTIM_0_ENABLE_COUNT=true;
mTIM_2_BKUP=0x68;
mTIM_2_ENABLE_RELOAD=TRUE;
mTIM_2_ENABLE_COUNT=TRUE;
mTIM_2_ENABLE_RELOAD=true;
mTIM_2_ENABLE_COUNT=true;
mTIM_2_LINKING=7;
mDISPCTL_DMAEnable=TRUE;
mDISPCTL_Flip=FALSE;
mDISPCTL_DMAEnable=true;
mDISPCTL_Flip=false;
mDISPCTL_FourColour=0;
mDISPCTL_Colour=TRUE;
mDISPCTL_Colour=true;
}
void CMikie::ComLynxCable(int status)
@ -479,7 +479,7 @@ uint32 CMikie::DisplayRenderLine(void)
// the beginning of count==99 hence the code below !!
// Emulate REST signal
if(mLynxLine==mTIM_2_BKUP-2 || mLynxLine==mTIM_2_BKUP-3 || mLynxLine==mTIM_2_BKUP-4) mIODAT_REST_SIGNAL=TRUE; else mIODAT_REST_SIGNAL=FALSE;
if(mLynxLine==mTIM_2_BKUP-2 || mLynxLine==mTIM_2_BKUP-3 || mLynxLine==mTIM_2_BKUP-4) mIODAT_REST_SIGNAL=true; else mIODAT_REST_SIGNAL=false;
if(mLynxLine==(mTIM_2_BKUP-3))
{
@ -526,7 +526,7 @@ uint32 CMikie::DisplayRenderLine(void)
}
if(mpDisplayCurrentLine < 102)
LynxLineDrawn[mpDisplayCurrentLine] = TRUE;
LynxLineDrawn[mpDisplayCurrentLine] = true;
mpDisplayCurrentLine++;
}
@ -928,11 +928,11 @@ void CMikie::Poke(uint32 addr,uint8 data)
{
C6502_REGS regs;
mSystem.GetRegs(regs);
MDFN_printf("Runtime Alert - System Halted\nCMikie::Poke(SYSCTL1) - Lynx power down occured at PC=$%04x.\nResetting system.",regs.PC);
MDFN_printf("Runtime Alert - System Halted\nCMikie::Poke(SYSCTL1) - Lynx power down occured at PC=$%04x.\nResetting system.\n",regs.PC);
mSystem.Reset();
gSystemHalt=TRUE;
gSystemHalt=true;
}
mSystem.CartAddressStrobe((data&0x01)?TRUE:FALSE);
mSystem.CartAddressStrobe((data&0x01)?true:false);
break;
case (MIKEYSREV&0xff):
@ -947,9 +947,9 @@ void CMikie::Poke(uint32 addr,uint8 data)
case (IODAT&0xff):
TRACE_MIKIE2("Poke(IODAT ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
mIODAT=data;
mSystem.CartAddressData((mIODAT&0x02)?TRUE:FALSE);
mSystem.CartAddressData((mIODAT&0x02)?true:false);
// Enable cart writes to BANK1 on AUDIN if AUDIN is set to output
if(mIODIR&0x10) mSystem.mCart->mWriteEnableBank1=(mIODAT&0x10)?TRUE:FALSE;
if(mIODIR&0x10) mSystem.mCart->mWriteEnableBank1=(mIODAT&0x10)?true:false;
break;
case (SERCTL&0xff):
@ -1962,7 +1962,7 @@ void CMikie::Update(void)
if(mTIM_0_CURRENT&0x80000000)
{
// Set carry out
mTIM_0_BORROW_OUT=TRUE;
mTIM_0_BORROW_OUT=true;
// // Reload if neccessary
// if(mTIM_0_ENABLE_RELOAD)
@ -1974,7 +1974,7 @@ void CMikie::Update(void)
// mTIM_0_CURRENT=0;
// }
mTIM_0_TIMER_DONE=TRUE;
mTIM_0_TIMER_DONE=true;
// Interupt flag setting code moved into DisplayRenderLine()
@ -1986,17 +1986,17 @@ void CMikie::Update(void)
}
else
{
mTIM_0_BORROW_OUT=FALSE;
mTIM_0_BORROW_OUT=false;
}
// Set carry in as we did a count
mTIM_0_BORROW_IN=TRUE;
mTIM_0_BORROW_IN=true;
}
else
{
// Clear carry in as we didn't count
mTIM_0_BORROW_IN=FALSE;
mTIM_0_BORROW_IN=false;
// Clear carry out
mTIM_0_BORROW_OUT=FALSE;
mTIM_0_BORROW_OUT=false;
}
}
@ -2057,7 +2057,7 @@ void CMikie::Update(void)
if(mTIM_2_CURRENT&0x80000000)
{
// Set carry out
mTIM_2_BORROW_OUT=TRUE;
mTIM_2_BORROW_OUT=true;
// // Reload if neccessary
// if(mTIM_2_ENABLE_RELOAD)
@ -2068,7 +2068,7 @@ void CMikie::Update(void)
// {
// mTIM_2_CURRENT=0;
// }
mTIM_2_TIMER_DONE=TRUE;
mTIM_2_TIMER_DONE=true;
// Interupt flag setting code moved into DisplayEndOfFrame(), also
// park any CPU cycles lost for later inclusion
@ -2076,17 +2076,17 @@ void CMikie::Update(void)
}
else
{
mTIM_2_BORROW_OUT=FALSE;
mTIM_2_BORROW_OUT=false;
}
// Set carry in as we did a count
mTIM_2_BORROW_IN=TRUE;
mTIM_2_BORROW_IN=true;
}
else
{
// Clear carry in as we didn't count
mTIM_2_BORROW_IN=FALSE;
mTIM_2_BORROW_IN=false;
// Clear carry out
mTIM_2_BORROW_OUT=FALSE;
mTIM_2_BORROW_OUT=false;
}
// Prediction for next timer event cycle number
@ -2140,7 +2140,7 @@ void CMikie::Update(void)
if(mTIM_4_CURRENT&0x80000000)
{
// Set carry out
mTIM_4_BORROW_OUT=TRUE;
mTIM_4_BORROW_OUT=true;
//
// Update the UART counter models for Rx & Tx
@ -2245,21 +2245,21 @@ void CMikie::Update(void)
// {
// mTIM_4_CURRENT=0;
// }
// mTIM_4_TIMER_DONE=TRUE;
// mTIM_4_TIMER_DONE=true;
}
// else
// {
// mTIM_4_BORROW_OUT=FALSE;
// mTIM_4_BORROW_OUT=false;
// }
// // Set carry in as we did a count
// mTIM_4_BORROW_IN=TRUE;
// mTIM_4_BORROW_IN=true;
}
// else
// {
// // Clear carry in as we didn't count
// mTIM_4_BORROW_IN=FALSE;
// mTIM_4_BORROW_IN=false;
// // Clear carry out
// mTIM_4_BORROW_OUT=FALSE;
// mTIM_4_BORROW_OUT=false;
// }
//
// // Prediction for next timer event cycle number
@ -2323,7 +2323,7 @@ void CMikie::Update(void)
if(mTIM_1_CURRENT&0x80000000)
{
// Set carry out
mTIM_1_BORROW_OUT=TRUE;
mTIM_1_BORROW_OUT=true;
// Set the timer status flag
if(mTimerInterruptMask&0x02)
@ -2341,21 +2341,21 @@ void CMikie::Update(void)
{
mTIM_1_CURRENT=0;
}
mTIM_1_TIMER_DONE=TRUE;
mTIM_1_TIMER_DONE=true;
}
else
{
mTIM_1_BORROW_OUT=FALSE;
mTIM_1_BORROW_OUT=false;
}
// Set carry in as we did a count
mTIM_1_BORROW_IN=TRUE;
mTIM_1_BORROW_IN=true;
}
else
{
// Clear carry in as we didn't count
mTIM_1_BORROW_IN=FALSE;
mTIM_1_BORROW_IN=false;
// Clear carry out
mTIM_1_BORROW_OUT=FALSE;
mTIM_1_BORROW_OUT=false;
}
}
@ -2409,7 +2409,7 @@ void CMikie::Update(void)
if(mTIM_3_CURRENT&0x80000000)
{
// Set carry out
mTIM_3_BORROW_OUT=TRUE;
mTIM_3_BORROW_OUT=true;
// Set the timer status flag
if(mTimerInterruptMask&0x08)
@ -2427,21 +2427,21 @@ void CMikie::Update(void)
{
mTIM_3_CURRENT=0;
}
mTIM_3_TIMER_DONE=TRUE;
mTIM_3_TIMER_DONE=true;
}
else
{
mTIM_3_BORROW_OUT=FALSE;
mTIM_3_BORROW_OUT=false;
}
// Set carry in as we did a count
mTIM_3_BORROW_IN=TRUE;
mTIM_3_BORROW_IN=true;
}
else
{
// Clear carry in as we didn't count
mTIM_3_BORROW_IN=FALSE;
mTIM_3_BORROW_IN=false;
// Clear carry out
mTIM_3_BORROW_OUT=FALSE;
mTIM_3_BORROW_OUT=false;
}
// Prediction for next timer event cycle number
@ -2494,7 +2494,7 @@ void CMikie::Update(void)
if(mTIM_5_CURRENT&0x80000000)
{
// Set carry out
mTIM_5_BORROW_OUT=TRUE;
mTIM_5_BORROW_OUT=true;
// Set the timer status flag
if(mTimerInterruptMask&0x20)
@ -2512,21 +2512,21 @@ void CMikie::Update(void)
{
mTIM_5_CURRENT=0;
}
mTIM_5_TIMER_DONE=TRUE;
mTIM_5_TIMER_DONE=true;
}
else
{
mTIM_5_BORROW_OUT=FALSE;
mTIM_5_BORROW_OUT=false;
}
// Set carry in as we did a count
mTIM_5_BORROW_IN=TRUE;
mTIM_5_BORROW_IN=true;
}
else
{
// Clear carry in as we didn't count
mTIM_5_BORROW_IN=FALSE;
mTIM_5_BORROW_IN=false;
// Clear carry out
mTIM_5_BORROW_OUT=FALSE;
mTIM_5_BORROW_OUT=false;
}
// Prediction for next timer event cycle number
@ -2579,7 +2579,7 @@ void CMikie::Update(void)
if(mTIM_7_CURRENT&0x80000000)
{
// Set carry out
mTIM_7_BORROW_OUT=TRUE;
mTIM_7_BORROW_OUT=true;
// Set the timer status flag
if(mTimerInterruptMask&0x80)
@ -2597,22 +2597,22 @@ void CMikie::Update(void)
{
mTIM_7_CURRENT=0;
}
mTIM_7_TIMER_DONE=TRUE;
mTIM_7_TIMER_DONE=true;
}
else
{
mTIM_7_BORROW_OUT=FALSE;
mTIM_7_BORROW_OUT=false;
}
// Set carry in as we did a count
mTIM_7_BORROW_IN=TRUE;
mTIM_7_BORROW_IN=true;
}
else
{
// Clear carry in as we didn't count
mTIM_7_BORROW_IN=FALSE;
mTIM_7_BORROW_IN=false;
// Clear carry out
mTIM_7_BORROW_OUT=FALSE;
mTIM_7_BORROW_OUT=false;
}
// Prediction for next timer event cycle number
@ -2656,7 +2656,7 @@ void CMikie::Update(void)
if(mTIM_6_CURRENT&0x80000000)
{
// Set carry out
mTIM_6_BORROW_OUT=TRUE;
mTIM_6_BORROW_OUT=true;
// Set the timer status flag
if(mTimerInterruptMask&0x40)
@ -2674,21 +2674,21 @@ void CMikie::Update(void)
{
mTIM_6_CURRENT=0;
}
mTIM_6_TIMER_DONE=TRUE;
mTIM_6_TIMER_DONE=true;
}
else
{
mTIM_6_BORROW_OUT=FALSE;
mTIM_6_BORROW_OUT=false;
}
// Set carry in as we did a count
mTIM_6_BORROW_IN=TRUE;
mTIM_6_BORROW_IN=true;
}
else
{
// Clear carry in as we didn't count
mTIM_6_BORROW_IN=FALSE;
mTIM_6_BORROW_IN=false;
// Clear carry out
mTIM_6_BORROW_OUT=FALSE;
mTIM_6_BORROW_OUT=false;
}
}
@ -2717,7 +2717,6 @@ void CMikie::Update(void)
//
// Update the sound subsystem
//
{
int y;
for(y = 0; y < 4; y++)
@ -2753,7 +2752,7 @@ void CMikie::Update(void)
if(mAUDIO_CURRENT[y]&0x80000000)
{
// Set carry out
mAUDIO_BORROW_OUT[y]=TRUE;
mAUDIO_BORROW_OUT[y]=true;
// Reload if neccessary
if(mAUDIO_ENABLE_RELOAD[y])
@ -2764,7 +2763,7 @@ void CMikie::Update(void)
else
{
// Set timer done
mAUDIO_TIMER_DONE[y]=TRUE;
mAUDIO_TIMER_DONE[y]=true;
mAUDIO_CURRENT[y]=0;
}
@ -2790,17 +2789,17 @@ void CMikie::Update(void)
}
else
{
mAUDIO_BORROW_OUT[y]=FALSE;
mAUDIO_BORROW_OUT[y]=false;
}
// Set carry in as we did a count
mAUDIO_BORROW_IN[y]=TRUE;
mAUDIO_BORROW_IN[y]=true;
}
else
{
// Clear carry in as we didn't count
mAUDIO_BORROW_IN[y]=FALSE;
mAUDIO_BORROW_IN[y]=false;
// Clear carry out
mAUDIO_BORROW_OUT[y]=FALSE;
mAUDIO_BORROW_OUT[y]=false;
}
// Prediction for next timer event cycle number
@ -2828,7 +2827,7 @@ void CMikie::Update(void)
// Update system IRQ status as a result of timer activity
// OR is required to ensure serial IRQ's are not masked accidentally
gSystemIRQ=(mTimerStatusFlags)?TRUE:FALSE;
gSystemIRQ=(mTimerStatusFlags)?true:false;
if(gSystemIRQ && gSystemCPUSleep) { ClearCPUSleep(); /*puts("ARLARM"); */ }
//else if(gSuzieDoneTime) SetCPUSleep();

View File

@ -210,8 +210,8 @@ class CMikie : public CLynxBase
int StateAction(StateMem *sm, int load, int data_only);
inline void SetCPUSleep(void) {gSystemCPUSleep=TRUE;};
inline void ClearCPUSleep(void) {gSystemCPUSleep=FALSE;};
inline void SetCPUSleep(void) {gSystemCPUSleep=true;};
inline void ClearCPUSleep(void) {gSystemCPUSleep=false;};
void CombobulateSound(uint32 teatime);
void Update(void);

View File

@ -55,7 +55,7 @@
CRom::CRom(const char *romfile)
{
unsigned loop;
mWriteEnable=FALSE;
mWriteEnable=false;
Reset();
// Initialise ROM

View File

@ -58,13 +58,9 @@
// wa can access this directly without the hassle of
// going through the system object, much faster
//
//#define RAM_PEEK(m) (mSystem.Peek_RAM((m)))
//#define RAM_POKE(m1,m2) (mSystem.Poke_RAM((m1),(m2)))
//#define RAM_PEEKW(m) (mSystem.PeekW_RAM((m)))
#define RAM_PEEK(m) (mRamPointer[(m)])
#define RAM_PEEKW(m) (mRamPointer[(m)]+(mRamPointer[(m)+1]<<8))
#define RAM_POKE(m1,m2) {mRamPointer[(m1)]=(m2);}
#define RAM_PEEK(m) (mRamPointer[(uint16)(m)])
#define RAM_PEEKW(m) (mRamPointer[(uint16)(m)]+(mRamPointer[(uint16)((m)+1)]<<8))
#define RAM_POKE(m1,m2) {mRamPointer[(uint16)(m1)]=(m2);}
uint32 cycles_used=0;
@ -157,12 +153,12 @@ void CSusie::Reset(void)
mSPRSYS_Mathbit=0;
mSPRSYS_MathInProgress=0;
mSUZYBUSEN=FALSE;
mSUZYBUSEN=false;
mSPRINIT.Byte=0;
mSPRGO=FALSE;
mEVERON=FALSE;
mSPRGO=false;
mEVERON=false;
for(int loop=0;loop<16;loop++) mPenIndex[loop]=loop;
@ -175,7 +171,7 @@ void CSusie::Reset(void)
void CSusie::DoMathMultiply(void)
{
mSPRSYS_Mathbit=FALSE;
mSPRSYS_Mathbit=false;
// Multiplies with out sign or accumulate take 44 ticks to complete.
// Multiplies with sign and accumulate take 54 ticks to complete.
@ -221,11 +217,11 @@ void CSusie::DoMathMultiply(void)
if((tmp&0x80000000)!=(mMATHJKLM.Long&0x80000000))
{
TRACE_SUSIE0("DoMathMultiply() - OVERFLOW DETECTED");
// mSPRSYS_Mathbit=TRUE;
// mSPRSYS_Mathbit=true;
}
else
{
// mSPRSYS_Mathbit=FALSE;
// mSPRSYS_Mathbit=false;
}
// Save accumulated result
mMATHJKLM.Long=tmp;
@ -238,7 +234,7 @@ void CSusie::DoMathMultiply(void)
void CSusie::DoMathDivide(void)
{
mSPRSYS_Mathbit=FALSE;
mSPRSYS_Mathbit=false;
//
// Divides take 176 + 14*N ticks
@ -263,7 +259,7 @@ void CSusie::DoMathDivide(void)
TRACE_SUSIE0("DoMathDivide() - DIVIDE BY ZERO ERROR");
mMATHABCD.Long=0xffffffff;
mMATHJKLM.Long=0;
mSPRSYS_Mathbit=TRUE;
mSPRSYS_Mathbit=true;
}
TRACE_SUSIE2("DoMathDivide() EFGH=$%08x / NP=%04x",mMATHEFGH.Long,mMATHNP.Long);
TRACE_SUSIE1("DoMathDivide() Results (div) ABCD=$%08x",mMATHABCD.Long);
@ -311,7 +307,7 @@ uint32 CSusie::PaintSprites(void)
{
TRACE_SUSIE0("PaintSprites() mSCBNEXT==0 - FINISHED");
mSPRSYS_Status=0; // Engine has finished
mSPRGO=FALSE;
mSPRGO=false;
break;
}
else
@ -383,9 +379,9 @@ uint32 CSusie::PaintSprites(void)
cycles_used+=6*SPR_RDWR_CYC;
bool enable_sizing=FALSE;
bool enable_stretch=FALSE;
bool enable_tilt=FALSE;
bool enable_sizing=false;
bool enable_stretch=false;
bool enable_tilt=false;
// Optional section defined by reload type in Control 1
@ -394,7 +390,7 @@ uint32 CSusie::PaintSprites(void)
{
case 1:
TRACE_SUSIE0("PaintSprites() Sizing Enabled");
enable_sizing=TRUE;
enable_sizing=true;
mSPRHSIZ.Val16=RAM_PEEKW(mTMPADR.Val16); // Sprite Horizontal size
mTMPADR.Val16+=2;
@ -408,8 +404,8 @@ uint32 CSusie::PaintSprites(void)
case 2:
TRACE_SUSIE0("PaintSprites() Sizing Enabled");
TRACE_SUSIE0("PaintSprites() Stretch Enabled");
enable_sizing=TRUE;
enable_stretch=TRUE;
enable_sizing=true;
enable_stretch=true;
mSPRHSIZ.Val16=RAM_PEEKW(mTMPADR.Val16); // Sprite Horizontal size
mTMPADR.Val16+=2;
@ -427,9 +423,9 @@ uint32 CSusie::PaintSprites(void)
TRACE_SUSIE0("PaintSprites() Sizing Enabled");
TRACE_SUSIE0("PaintSprites() Stretch Enabled");
TRACE_SUSIE0("PaintSprites() Tilt Enabled");
enable_sizing=TRUE;
enable_stretch=TRUE;
enable_tilt=TRUE;
enable_sizing=true;
enable_stretch=true;
enable_tilt=true;
mSPRHSIZ.Val16=RAM_PEEKW(mTMPADR.Val16); // Sprite Horizontal size
mTMPADR.Val16+=2;
@ -490,7 +486,7 @@ uint32 CSusie::PaintSprites(void)
TRACE_SUSIE2("PaintSprites() screen_v_start $%04x screen_v_end $%04x",screen_v_start,screen_v_end);
TRACE_SUSIE2("PaintSprites() world_h_mid $%04x world_v_mid $%04x",world_h_mid,world_v_mid);
bool superclip=FALSE;
bool superclip=false;
int quadrant=0;
int hsign,vsign;
@ -507,7 +503,7 @@ uint32 CSusie::PaintSprites(void)
// Check ref is inside screen area
//if((int16)mHPOSSTRT.Val16<screen_h_start || (int16)mHPOSSTRT.Val16>=screen_h_end ||
// (int16)mVPOSSTRT.Val16<screen_v_start || (int16)mVPOSSTRT.Val16>=screen_v_end) superclip=TRUE;
// (int16)mVPOSSTRT.Val16<screen_v_start || (int16)mVPOSSTRT.Val16>=screen_v_end) superclip=true;
TRACE_SUSIE1("PaintSprites() Superclip=%d",superclip);
@ -532,7 +528,7 @@ uint32 CSusie::PaintSprites(void)
int sprite_v=mVPOSSTRT.Val16;
int sprite_h=mHPOSSTRT.Val16;
bool render=FALSE;
bool render=false;
// Set quadrand multipliers
hsign=(quadrant==0 || quadrant==1)?1:-1;
@ -589,22 +585,22 @@ uint32 CSusie::PaintSprites(void)
switch(modquad)
{
case 3:
if((sprite_h>=screen_h_start || sprite_h<world_h_mid) && (sprite_v<screen_v_end || sprite_v>world_v_mid)) render=TRUE;
if((sprite_h>=screen_h_start || sprite_h<world_h_mid) && (sprite_v<screen_v_end || sprite_v>world_v_mid)) render=true;
break;
case 2:
if((sprite_h>=screen_h_start || sprite_h<world_h_mid) && (sprite_v>=screen_v_start || sprite_v<world_v_mid)) render=TRUE;
if((sprite_h>=screen_h_start || sprite_h<world_h_mid) && (sprite_v>=screen_v_start || sprite_v<world_v_mid)) render=true;
break;
case 1:
if((sprite_h<screen_h_end || sprite_h>world_h_mid) && (sprite_v>=screen_v_start || sprite_v<world_v_mid)) render=TRUE;
if((sprite_h<screen_h_end || sprite_h>world_h_mid) && (sprite_v>=screen_v_start || sprite_v<world_v_mid)) render=true;
break;
default:
if((sprite_h<screen_h_end || sprite_h>world_h_mid) && (sprite_v<screen_v_end || sprite_v>world_v_mid)) render=TRUE;
if((sprite_h<screen_h_end || sprite_h>world_h_mid) && (sprite_v<screen_v_end || sprite_v>world_v_mid)) render=true;
break;
}
}
else
{
render=TRUE;
render=true;
}
// Is this quad to be rendered ??
@ -688,7 +684,7 @@ uint32 CSusie::PaintSprites(void)
// Initialise our line
LineInit(voff);
onscreen=FALSE;
onscreen=false;
// Now render an individual destination line
while((pixel=LineGetPixel())!=LINE_END)
@ -704,8 +700,8 @@ uint32 CSusie::PaintSprites(void)
if(hoff>=0 && hoff<SCREEN_WIDTH)
{
ProcessPixel(hoff,pixel);
onscreen = TRUE;
everonscreen = TRUE;
onscreen = true;
everonscreen = true;
}
else
{
@ -812,7 +808,7 @@ uint32 CSusie::PaintSprites(void)
// if(mSPRSYS.Read.StopOnCurrent)
// {
// mSPRSYS.Read.Status=0; // Engine has finished
// mSPRGO=FALSE;
// mSPRGO=false;
// break;
// }
@ -820,7 +816,7 @@ uint32 CSusie::PaintSprites(void)
if(sprcount>4096)
{
// Stop the system, otherwise we may just come straight back in.....
gSystemHalt=TRUE;
gSystemHalt=true;
// Display warning message
//gError->Warning("CSusie:PaintSprites(): Single draw sprite limit exceeded (>4096). The SCB is most likely looped back on itself. Reset/Exit is recommended");
// Signal error to the caller
@ -838,7 +834,7 @@ uint32 CSusie::PaintSprites(void)
INLINE void CSusie::WritePixel(uint32 hoff,uint32 pixel)
{
uint32 scr_addr=mLineBaseAddress+(hoff/2);
const uint16 scr_addr=mLineBaseAddress+(hoff/2);
uint8 dest=RAM_PEEK(scr_addr);
if(!(hoff&0x01))
@ -861,7 +857,7 @@ INLINE void CSusie::WritePixel(uint32 hoff,uint32 pixel)
INLINE uint32 CSusie::ReadPixel(uint32 hoff)
{
uint32 scr_addr=mLineBaseAddress+(hoff/2);
const uint16 scr_addr=mLineBaseAddress+(hoff/2);
uint32 data=RAM_PEEK(scr_addr);
if(!(hoff&0x01))
@ -883,7 +879,7 @@ INLINE uint32 CSusie::ReadPixel(uint32 hoff)
INLINE void CSusie::WriteCollision(uint32 hoff,uint32 pixel)
{
uint32 col_addr=mLineCollisionAddress+(hoff/2);
const uint16 col_addr=mLineCollisionAddress+(hoff/2);
uint8 dest=RAM_PEEK(col_addr);
if(!(hoff&0x01))
@ -906,7 +902,7 @@ INLINE void CSusie::WriteCollision(uint32 hoff,uint32 pixel)
INLINE uint32 CSusie::ReadCollision(uint32 hoff)
{
uint32 col_addr=mLineCollisionAddress+(hoff/2);
const uint16 col_addr=mLineCollisionAddress+(hoff/2);
uint32 data=RAM_PEEK(col_addr);
if(!(hoff&0x01))
@ -1624,7 +1620,7 @@ void CSusie::Poke(uint32 addr,uint8 data)
case (MATHM&0xff):
mMATHJKLM.Bytes.M=data;
mMATHJKLM.Bytes.L=0;
mSPRSYS_Mathbit=FALSE;
mSPRSYS_Mathbit=false;
TRACE_SUSIE2("Poke(MATHM,%02x) at PC=$%04x",data,mSystem.mCpu->GetPC());
break;
case (MATHL&0xff):

View File

@ -61,11 +61,6 @@ class CSystemBase
virtual void PokeW_CPU(uint32 addr,uint16 data)=0;
virtual uint16 PeekW_CPU(uint32 addr)=0;
virtual void Poke_RAM(uint32 addr,uint8 data)=0;
virtual uint8 Peek_RAM(uint32 addr)=0;
virtual void PokeW_RAM(uint32 addr,uint16 data)=0;
virtual uint16 PeekW_RAM(uint32 addr)=0;
virtual uint8* GetRamPointer(void)=0;
};

View File

@ -70,10 +70,10 @@
uint32 gSystemCycleCount=0;
uint32 gNextTimerEvent=0;
uint32 gCPUBootAddress=0;
uint32 gSystemIRQ=FALSE;
uint32 gSystemNMI=FALSE;
uint32 gSystemCPUSleep=FALSE;
uint32 gSystemHalt=FALSE;
uint32 gSystemIRQ=false;
uint32 gSystemNMI=false;
uint32 gSystemCPUSleep=false;
uint32 gSystemHalt=false;
#else
extern uint32 gSystemCycleCount;
extern uint32 gSuzieDoneTime;
@ -161,14 +161,6 @@ class CSystem : public CSystemBase
inline void PokeW_CPU(uint32 addr,uint16 data) { mMemoryHandlers[addr]->Poke(addr,data&0xff);addr++;mMemoryHandlers[addr]->Poke(addr,data>>8);};
inline uint16 PeekW_CPU(uint32 addr) {return ((mMemoryHandlers[addr]->Peek(addr))+(mMemoryHandlers[addr]->Peek(addr+1)<<8));};
//
// RAM
//
inline void Poke_RAM(uint32 addr, uint8 data) { mRam->Poke(addr,data);};
inline uint8 Peek_RAM(uint32 addr) { return mRam->Peek(addr);};
inline void PokeW_RAM(uint32 addr,uint16 data) { mRam->Poke(addr,data&0xff);addr++;mRam->Poke(addr,data>>8);};
inline uint16 PeekW_RAM(uint32 addr) {return ((mRam->Peek(addr))+(mRam->Peek(addr+1)<<8));};
// High level cart access for debug etc
inline void Poke_CART(uint32 addr, uint8 data) {mCart->Poke(addr,data);};