Commit 99c7cb30 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Cleanups

parent 95a47eb0
Pipeline #30100 passed with stages
in 1 minute and 44 seconds
......@@ -45,25 +45,6 @@
#ifndef C65C02_H
#define C65C02_H
//#include <crtdbg.h>
//#define TRACE_CPU
#ifdef TRACE_CPU
#define TRACE_CPU0(msg) _RPT1(_CRT_WARN,"C65C02::"msg" (Time=%012d)\n",gSystemCycleCount)
#define TRACE_CPU1(msg,arg1) _RPT2(_CRT_WARN,"C65C02::"msg" (Time=%012d)\n",arg1,gSystemCycleCount)
#define TRACE_CPU2(msg,arg1,arg2) _RPT3(_CRT_WARN,"C65C02::"msg" (Time=%012d)\n",arg1,arg2,gSystemCycleCount)
#define TRACE_CPU3(msg,arg1,arg2,arg3) _RPT4(_CRT_WARN,"C65C02::"msg" (Time=%012d)\n",arg1,arg2,arg3,gSystemCycleCount)
#else
#define TRACE_CPU0(msg)
#define TRACE_CPU1(msg,arg1)
#define TRACE_CPU2(msg,arg1,arg2)
#define TRACE_CPU3(msg,arg1,arg2,arg3)
#endif
//
// Handy definitions
//
......@@ -140,7 +121,6 @@ class C65C02
C65C02(CSystemBase& parent)
:mSystem(parent)
{
TRACE_CPU0("C65C02()");
// Compute the BCD lookup table
for(UWORD t=0;t<256;++t)
{
......@@ -157,13 +137,11 @@ class C65C02
~C65C02()
{
TRACE_CPU0("~C65C02()");
}
public:
inline void Reset(void)
{
TRACE_CPU0("Reset()");
mRamPointer=mSystem.GetRamPointer();
mA=0;
mX=0;
......@@ -190,7 +168,6 @@ class C65C02
inline bool ContextSave(LSS_FILE *fp)
{
TRACE_CPU0("ContextSave()");
int mPS;
mPS=PS();
if(!lss_printf(fp,"C6502::ContextSave")) return 0;
......@@ -206,7 +183,6 @@ class C65C02
inline bool ContextLoad(LSS_FILE *fp)
{
TRACE_CPU0("ContextLoad()");
int mPS;
char teststr[100]="XXXXXXXXXXXXXXXXXX";
if(!lss_read(teststr,sizeof(char),18,fp)) return 0;
......@@ -247,7 +223,6 @@ class C65C02
if(gSystemIRQ && !mI)
{
TRACE_CPU1("Update() IRQ taken at PC=%04x",mPC);
// IRQ signal clearance is handled by CMikie::Update() as this
// is the only source of interrupts
......@@ -280,7 +255,6 @@ class C65C02
// Fetch opcode
mOpcode=CPU_PEEK(mPC);
TRACE_CPU2("Update() PC=$%04x, Opcode=%02x",mPC,mOpcode);
mPC++;
// Execute Opcode
......
......@@ -45,7 +45,6 @@
#define CART_CPP
//#include <crtdbg.h>
//#define TRACE_CART
#include <stdlib.h>
#include <stdio.h>
......@@ -57,8 +56,7 @@
CCart::CCart(UBYTE *gamedata,ULONG gamesize)
{
int headersize=0
TRACE_CART1("CCart() called with %s",gamefile);
int headersize=0;
LYNX_HEADER header;
mWriteEnableBank0=FALSE;
......@@ -158,7 +156,6 @@ CCart::CCart(UBYTE *gamedata,ULONG gamesize)
fprintf(stderr, "Invalid cart (bank0 size).\n");
break;
}
TRACE_CART1("CCart() - Bank0 = $%06x",mMaskBank0);
switch(header.page_size_bank1) {
case 0x000:
......@@ -195,7 +192,6 @@ CCart::CCart(UBYTE *gamedata,ULONG gamesize)
fprintf(stderr, "Invalid cart (bank1 size).\n");
break;
}
TRACE_CART1("CCart() - Bank1 = $%06x",mMaskBank1);
// Make some space for the new carts
......@@ -273,7 +269,6 @@ CCart::CCart(UBYTE *gamedata,ULONG gamesize)
}
}
}
TRACE_CART1("CCart() - mHeaderLess=%d",mHeaderLess);
}
// Dont allow an empty Bank1 - Use it for shadow SRAM/EEPROM
......@@ -281,7 +276,6 @@ CCart::CCart(UBYTE *gamedata,ULONG gamesize)
// Delete the single byte allocated earlier
delete[] mCartBank1;
// Allocate some new memory for us
TRACE_CART0("CCart() - Bank1 being converted to 64K SRAM");
banktype1=C64K;
mMaskBank1=0x00ffff;
mShiftCount1=8;
......@@ -295,7 +289,6 @@ CCart::CCart(UBYTE *gamedata,ULONG gamesize)
CCart::~CCart()
{
TRACE_CART0("~CCart()");
delete[] mCartBank0;
delete[] mCartBank1;
delete[] mCartBank0A;
......@@ -305,7 +298,6 @@ CCart::~CCart()
void CCart::Reset(void)
{
TRACE_CART0("Reset()");
mCounter=0;
mShifter=0;
mAddrData=0;
......@@ -314,7 +306,6 @@ void CCart::Reset(void)
bool CCart::ContextSave(LSS_FILE *fp)
{
TRACE_CART0("ContextSave()");
if(!lss_printf(fp,"CCart::ContextSave")) return 0;
if(!lss_write(&mCounter,sizeof(ULONG),1,fp)) return 0;
if(!lss_write(&mShifter,sizeof(ULONG),1,fp)) return 0;
......@@ -338,7 +329,6 @@ bool CCart::ContextSave(LSS_FILE *fp)
bool CCart::ContextLoad(LSS_FILE *fp)
{
TRACE_CART0("ContextLoad()");
char teststr[100]="XXXXXXXXXXXXXXXXXX";
if(!lss_read(teststr,sizeof(char),18,fp)) return 0;
if(strcmp(teststr,"CCart::ContextSave")!=0) return 0;
......@@ -366,7 +356,6 @@ bool CCart::ContextLoad(LSS_FILE *fp)
bool CCart::ContextLoadLegacy(LSS_FILE *fp)
{
TRACE_CART0("ContextLoadLegacy()");
strcpy(mName,"<** IMAGE **>");
strcpy(mManufacturer,"<** RESTORED **>");
char teststr[100]="XXXXXXXXXXXXXXXXXX";
......@@ -436,12 +425,10 @@ void CCart::CartAddressStrobe(bool strobe)
mShifter&=0xff;
}
last_strobe=mStrobe;
TRACE_CART2("CartAddressStrobe(strobe=%d) mShifter=$%06x",strobe,mShifter);
}
void CCart::CartAddressData(bool data)
{
TRACE_CART1("CartAddressData($%02x)",data);
mAddrData=data;
}
......
......@@ -62,22 +62,6 @@
_a > _b ? _b : _a; })
#endif
#ifdef TRACE_CART
#define TRACE_CART0(msg) _RPT1(_CRT_WARN,"CCart::"msg" (Time=%012d)\n",gSystemCycleCount)
#define TRACE_CART1(msg,arg1) _RPT2(_CRT_WARN,"CCart::"msg" (Time=%012d)\n",arg1,gSystemCycleCount)
#define TRACE_CART2(msg,arg1,arg2) _RPT3(_CRT_WARN,"CCart::"msg" (Time=%012d)\n",arg1,arg2,gSystemCycleCount)
#define TRACE_CART3(msg,arg1,arg2,arg3) _RPT4(_CRT_WARN,"CCart::"msg" (Time=%012d)\n",arg1,arg2,arg3,gSystemCycleCount)
#else
#define TRACE_CART0(msg)
#define TRACE_CART1(msg,arg1)
#define TRACE_CART2(msg,arg1,arg2)
#define TRACE_CART3(msg,arg1,arg2,arg3)
#endif
#define DEFAULT_CART_CONTENTS 0xFF
enum CTYPE {UNUSED,C64K,C128K,C256K,C512K,C1024K};
......
......@@ -44,9 +44,6 @@
#define MEMMAP_CPP
//#include <crtdbg.h>
//#define TRACE_MEMMAP
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
......@@ -144,8 +141,6 @@ bool CMemMap::ContextLoad(LSS_FILE *fp)
inline void CMemMap::Poke(ULONG addr, UBYTE data)
{
TRACE_MEMMAP1("Poke() - Data %02x",data);
int newstate,loop;
// FC00-FCFF Susie area
......@@ -207,7 +202,6 @@ inline UBYTE CMemMap::Peek(ULONG addr)
retval+=(mMikieEnabled)?0:0x02;
retval+=(mRomEnabled)?0:0x04;
retval+=(mVectorsEnabled)?0:0x08;
TRACE_MEMMAP1("Peek() - Data %02x",retval);
return retval;
}
......
......@@ -48,22 +48,6 @@
#define MEMMAP_SIZE 0x1
#ifdef TRACE_CART
#define TRACE_MEMMAP0(msg) _RPT1(_CRT_WARN,"CMamMap::"msg" (Time=%012d)\n",gSystemCycleCount)
#define TRACE_MEMMAP1(msg,arg1) _RPT2(_CRT_WARN,"CMamMap::"msg" (Time=%012d)\n",arg1,gSystemCycleCount)
#define TRACE_MEMMAP2(msg,arg1,arg2) _RPT3(_CRT_WARN,"CMamMap::"msg" (Time=%012d)\n",arg1,arg2,gSystemCycleCount)
#define TRACE_MEMMAP3(msg,arg1,arg2,arg3) _RPT4(_CRT_WARN,"CMamMap::"msg" (Time=%012d)\n",arg1,arg2,arg3,gSystemCycleCount)
#else
#define TRACE_MEMMAP0(msg)
#define TRACE_MEMMAP1(msg,arg1)
#define TRACE_MEMMAP2(msg,arg1,arg2)
#define TRACE_MEMMAP3(msg,arg1,arg2,arg3)
#endif
class CMemMap : public CLynxBase
{
// Function members
......
......@@ -47,9 +47,6 @@
#define MIKIE_CPP
//#include <crtdbg.h>
//#define TRACE_MIKIE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -72,7 +69,6 @@ void CMikie::BlowOut(void)
CMikie::CMikie(CSystem& parent)
:mSystem(parent)
{
TRACE_MIKIE0("CMikie()");
mpDisplayBits=NULL;
mpDisplayCurrent=NULL;
......@@ -101,14 +97,11 @@ void CMikie::BlowOut(void)
CMikie::~CMikie()
{
TRACE_MIKIE0("~CMikie()");
}
void CMikie::Reset(void)
{
TRACE_MIKIE0("Reset()");
mAudioInputComparator=FALSE; // Initialises to unknown
mDisplayAddress=0x00; // Initialises to unknown
mLynxLine=0;
......@@ -361,8 +354,6 @@ ULONG CMikie::GetLfsrNext(ULONG current)
bool CMikie::ContextSave(LSS_FILE *fp)
{
TRACE_MIKIE0("ContextSave()");
if(!lss_printf(fp,"CMikie::ContextSave")) return 0;
if(!lss_write(&mDisplayAddress,sizeof(ULONG),1,fp)) return 0;
......@@ -565,8 +556,6 @@ bool CMikie::ContextSave(LSS_FILE *fp)
bool CMikie::ContextLoad(LSS_FILE *fp)
{
TRACE_MIKIE0("ContextLoad()");
char teststr[100]="XXXXXXXXXXXXXXXXXXX";
if(!lss_read(teststr,sizeof(char),19,fp)) return 0;
if(strcmp(teststr,"CMikie::ContextSave")!=0) return 0;
......@@ -772,8 +761,6 @@ bool CMikie::ContextLoad(LSS_FILE *fp)
void CMikie::PresetForHomebrew(void)
{
TRACE_MIKIE0("PresetForHomebrew()");
//
// After all of that nice timer init we'll start timers running as some homebrew
// i.e LR.O doesn't bother to setup the timers
......@@ -800,9 +787,9 @@ void CMikie::ComLynxCable(int status)
void CMikie::ComLynxRxData(int data)
{
TRACE_MIKIE1("ComLynxRxData() - Received %04x",data);
// Copy over the data
if(mUART_Rx_waiting<UART_MAX_RX_QUEUE) {
if(mUART_Rx_waiting<UART_MAX_RX_QUEUE)
{
// Trigger incoming receive IF none waiting otherwise
// we NEVER get to receive it!!!
if(!mUART_Rx_waiting) mUART_RX_COUNTDOWN=UART_RX_TIME_PERIOD;
......@@ -811,17 +798,13 @@ void CMikie::ComLynxRxData(int data)
mUART_Rx_input_queue[mUART_Rx_input_ptr]=data;
mUART_Rx_input_ptr=(++mUART_Rx_input_ptr)%UART_MAX_RX_QUEUE;
mUART_Rx_waiting++;
TRACE_MIKIE2("ComLynxRxData() - input ptr=%02d waiting=%02d",mUART_Rx_input_ptr,mUART_Rx_waiting);
} else {
TRACE_MIKIE0("ComLynxRxData() - UART RX Overun");
}
}
void CMikie::ComLynxTxLoopback(int data)
{
TRACE_MIKIE1("ComLynxTxLoopback() - Received %04x",data);
if(mUART_Rx_waiting<UART_MAX_RX_QUEUE) {
if(mUART_Rx_waiting<UART_MAX_RX_QUEUE)
{
// Trigger incoming receive IF none waiting otherwise
// we NEVER get to receive it!!!
if(!mUART_Rx_waiting) mUART_RX_COUNTDOWN=UART_RX_TIME_PERIOD;
......@@ -830,9 +813,6 @@ void CMikie::ComLynxTxLoopback(int data)
mUART_Rx_output_ptr=(--mUART_Rx_output_ptr)%UART_MAX_RX_QUEUE;
mUART_Rx_input_queue[mUART_Rx_output_ptr]=data;
mUART_Rx_waiting++;
TRACE_MIKIE2("ComLynxTxLoopback() - input ptr=%02d waiting=%02d",mUART_Rx_input_ptr,mUART_Rx_waiting);
} else {
TRACE_MIKIE0("ComLynxTxLoopback() - UART RX Overun");
}
}
......@@ -934,7 +914,6 @@ ULONG CMikie::DisplayRenderLine(void)
// Set the timer interrupt flag
if(mTimerInterruptMask&0x01) {
TRACE_MIKIE0("Update() - TIMER0 IRQ Triggered (Line Timer)");
mTimerStatusFlags|=0x01;
gSystemIRQ=TRUE; // Added 19/09/06 fix for IRQ issue
}
......@@ -963,7 +942,6 @@ ULONG CMikie::DisplayRenderLine(void)
// Do 102 lines, nothing more, less is OK.
if(mLynxLineDMACounter) {
// TRACE_MIKIE1("Update() - Screen DMA, line %03d",line_count);
mLynxLineDMACounter--;
// Cycle hit for a 80 RAM access in rendering a line
......@@ -1277,12 +1255,11 @@ ULONG CMikie::DisplayEndOfFrame(void)
// Set the timer status flag
if(mTimerInterruptMask&0x04) {
TRACE_MIKIE0("Update() - TIMER2 IRQ Triggered (Frame Timer)");
mTimerStatusFlags|=0x04;
gSystemIRQ=TRUE; // Added 19/09/06 fix for IRQ issue
}
// TRACE_MIKIE0("Update() - Frame end");
// ("Update() - Frame end");
// Trigger the callback to the display sub-system to render the
// display and fetch the new pointer to be used for the lynx
// display buffer for the forthcoming frame
......@@ -1334,35 +1311,27 @@ void CMikie::Poke(ULONG addr,UBYTE data)
switch(addr&0xff) {
case (TIM0BKUP&0xff):
mTIM_0_BKUP=data;
TRACE_MIKIE2("Poke(TIM0BKUP,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM1BKUP&0xff):
mTIM_1_BKUP=data;
TRACE_MIKIE2("Poke(TIM1BKUP,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM2BKUP&0xff):
mTIM_2_BKUP=data;
TRACE_MIKIE2("Poke(TIM2BKUP,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM3BKUP&0xff):
mTIM_3_BKUP=data;
TRACE_MIKIE2("Poke(TIM3BKUP,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM4BKUP&0xff):
mTIM_4_BKUP=data;
TRACE_MIKIE2("Poke(TIM4BKUP,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM5BKUP&0xff):
mTIM_5_BKUP=data;
TRACE_MIKIE2("Poke(TIM5BKUP,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM6BKUP&0xff):
mTIM_6_BKUP=data;
TRACE_MIKIE2("Poke(TIM6BKUP,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM7BKUP&0xff):
mTIM_7_BKUP=data;
TRACE_MIKIE2("Poke(TIM7BKUP,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
......@@ -1377,7 +1346,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_0_LAST_COUNT=gSystemCycleCount;
gNextTimerEvent=gSystemCycleCount;
}
TRACE_MIKIE2("Poke(TIM0CTLA,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM1CTLA&0xff):
mTimerInterruptMask&=(0x02^0xff);
......@@ -1390,7 +1358,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_1_LAST_COUNT=gSystemCycleCount;
gNextTimerEvent=gSystemCycleCount;
}
TRACE_MIKIE2("Poke(TIM1CTLA,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM2CTLA&0xff):
mTimerInterruptMask&=(0x04^0xff);
......@@ -1403,7 +1370,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_2_LAST_COUNT=gSystemCycleCount;
gNextTimerEvent=gSystemCycleCount;
}
TRACE_MIKIE2("Poke(TIM2CTLA,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM3CTLA&0xff):
mTimerInterruptMask&=(0x08^0xff);
......@@ -1416,7 +1382,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_3_LAST_COUNT=gSystemCycleCount;
gNextTimerEvent=gSystemCycleCount;
}
TRACE_MIKIE2("Poke(TIM3CTLA,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM4CTLA&0xff):
// Timer 4 can never generate interrupts as its timer output is used
......@@ -1429,7 +1394,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_4_LAST_COUNT=gSystemCycleCount;
gNextTimerEvent=gSystemCycleCount;
}
TRACE_MIKIE2("Poke(TIM4CTLA,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM5CTLA&0xff):
mTimerInterruptMask&=(0x20^0xff);
......@@ -1442,7 +1406,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_5_LAST_COUNT=gSystemCycleCount;
gNextTimerEvent=gSystemCycleCount;
}
TRACE_MIKIE2("Poke(TIM5CTLA,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM6CTLA&0xff):
mTimerInterruptMask&=(0x40^0xff);
......@@ -1455,7 +1418,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_6_LAST_COUNT=gSystemCycleCount;
gNextTimerEvent=gSystemCycleCount;
}
TRACE_MIKIE2("Poke(TIM6CTLA,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM7CTLA&0xff):
mTimerInterruptMask&=(0x80^0xff);
......@@ -1468,49 +1430,40 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_7_LAST_COUNT=gSystemCycleCount;
gNextTimerEvent=gSystemCycleCount;
}
TRACE_MIKIE2("Poke(TIM7CTLA,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM0CNT&0xff):
mTIM_0_CURRENT=data;
gNextTimerEvent=gSystemCycleCount;
TRACE_MIKIE2("Poke(TIM0CNT ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM1CNT&0xff):
mTIM_1_CURRENT=data;
gNextTimerEvent=gSystemCycleCount;
TRACE_MIKIE2("Poke(TIM1CNT ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM2CNT&0xff):
mTIM_2_CURRENT=data;
gNextTimerEvent=gSystemCycleCount;
TRACE_MIKIE2("Poke(TIM2CNT ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM3CNT&0xff):
mTIM_3_CURRENT=data;
gNextTimerEvent=gSystemCycleCount;
TRACE_MIKIE2("Poke(TIM3CNT ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM4CNT&0xff):
mTIM_4_CURRENT=data;
gNextTimerEvent=gSystemCycleCount;
TRACE_MIKIE2("Poke(TIM4CNT ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM5CNT&0xff):
mTIM_5_CURRENT=data;
gNextTimerEvent=gSystemCycleCount;
TRACE_MIKIE2("Poke(TIM5CNT ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM6CNT&0xff):
mTIM_6_CURRENT=data;
gNextTimerEvent=gSystemCycleCount;
TRACE_MIKIE2("Poke(TIM6CNT ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM7CNT&0xff):
mTIM_7_CURRENT=data;
gNextTimerEvent=gSystemCycleCount;
TRACE_MIKIE2("Poke(TIM7CNT ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (TIM0CTLB&0xff):
......@@ -1518,7 +1471,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_0_LAST_CLOCK=data&0x04;
mTIM_0_BORROW_IN=data&0x02;
mTIM_0_BORROW_OUT=data&0x01;
TRACE_MIKIE2("Poke(TIM0CTLB ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
// BlowOut();
break;
case (TIM1CTLB&0xff):
......@@ -1526,7 +1478,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_1_LAST_CLOCK=data&0x04;
mTIM_1_BORROW_IN=data&0x02;
mTIM_1_BORROW_OUT=data&0x01;
TRACE_MIKIE2("Poke(TIM1CTLB ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
// BlowOut();
break;
case (TIM2CTLB&0xff):
......@@ -1534,7 +1485,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_2_LAST_CLOCK=data&0x04;
mTIM_2_BORROW_IN=data&0x02;
mTIM_2_BORROW_OUT=data&0x01;
TRACE_MIKIE2("Poke(TIM2CTLB ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
// BlowOut();
break;
case (TIM3CTLB&0xff):
......@@ -1542,7 +1492,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_3_LAST_CLOCK=data&0x04;
mTIM_3_BORROW_IN=data&0x02;
mTIM_3_BORROW_OUT=data&0x01;
TRACE_MIKIE2("Poke(TIM3CTLB ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
// BlowOut();
break;
case (TIM4CTLB&0xff):
......@@ -1550,7 +1499,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_4_LAST_CLOCK=data&0x04;
mTIM_4_BORROW_IN=data&0x02;
mTIM_4_BORROW_OUT=data&0x01;
TRACE_MIKIE2("Poke(TIM4CTLB ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
// BlowOut();
break;
case (TIM5CTLB&0xff):
......@@ -1558,7 +1506,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_5_LAST_CLOCK=data&0x04;
mTIM_5_BORROW_IN=data&0x02;
mTIM_5_BORROW_OUT=data&0x01;
TRACE_MIKIE2("Poke(TIM5CTLB ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
// BlowOut();
break;
case (TIM6CTLB&0xff):
......@@ -1566,7 +1513,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_6_LAST_CLOCK=data&0x04;
mTIM_6_BORROW_IN=data&0x02;
mTIM_6_BORROW_OUT=data&0x01;
TRACE_MIKIE2("Poke(TIM6CTLB ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
// BlowOut();
break;
case (TIM7CTLB&0xff):
......@@ -1574,27 +1520,22 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mTIM_7_LAST_CLOCK=data&0x04;
mTIM_7_BORROW_IN=data&0x02;
mTIM_7_BORROW_OUT=data&0x01;
TRACE_MIKIE2("Poke(TIM7CTLB ,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
// BlowOut();
break;
case (AUD0VOL&0xff):
mAUDIO_0_VOLUME=(SBYTE)data;
TRACE_MIKIE2("Poke(AUD0VOL,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD0SHFTFB&0xff):
mAUDIO_0_WAVESHAPER&=0x001fff;
mAUDIO_0_WAVESHAPER|=(ULONG)data<<13;
TRACE_MIKIE2("Poke(AUD0SHFTB,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD0OUTVAL&0xff):
mAUDIO_OUTPUT[0]=data;
TRACE_MIKIE2("Poke(AUD0OUTVAL,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD0L8SHFT&0xff):
mAUDIO_0_WAVESHAPER&=0x1fff00;
mAUDIO_0_WAVESHAPER|=data;
TRACE_MIKIE2("Poke(AUD0L8SHFT,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD0TBACK&0xff):
// Counter is disabled when backup is zero for optimisation
......@@ -1605,7 +1546,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
gNextTimerEvent=gSystemCycleCount;
}
mAUDIO_0_BKUP=data;
TRACE_MIKIE2("Poke(AUD0TBACK,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD0CTL&0xff):
mAUDIO_0_ENABLE_RELOAD=data&0x10;
......@@ -1619,11 +1559,9 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mAUDIO_0_LAST_COUNT=gSystemCycleCount;
gNextTimerEvent=gSystemCycleCount;
}
TRACE_MIKIE2("Poke(AUD0CTL,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD0COUNT&0xff):
mAUDIO_0_CURRENT=data;
TRACE_MIKIE2("Poke(AUD0COUNT,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD0MISC&0xff):
mAUDIO_0_WAVESHAPER&=0x1ff0ff;
......@@ -1631,26 +1569,21 @@ void CMikie::Poke(ULONG addr,UBYTE data)
mAUDIO_0_BORROW_IN=data&0x02;
mAUDIO_0_BORROW_OUT=data&0x01;
mAUDIO_0_LAST_CLOCK=data&0x04;
TRACE_MIKIE2("Poke(AUD0MISC,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD1VOL&0xff):
mAUDIO_1_VOLUME=(SBYTE)data;
TRACE_MIKIE2("Poke(AUD1VOL,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD1SHFTFB&0xff):
mAUDIO_1_WAVESHAPER&=0x001fff;
mAUDIO_1_WAVESHAPER|=(ULONG)data<<13;
TRACE_MIKIE2("Poke(AUD1SHFTFB,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD1OUTVAL&0xff):
mAUDIO_OUTPUT[1]=data;
TRACE_MIKIE2("Poke(AUD1OUTVAL,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD1L8SHFT&0xff):
mAUDIO_1_WAVESHAPER&=0x1fff00;
mAUDIO_1_WAVESHAPER|=data;
TRACE_MIKIE2("Poke(AUD1L8SHFT,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD1TBACK&0xff):
// Counter is disabled when backup is zero for optimisation
......@@ -1661,7 +1594,6 @@ void CMikie::Poke(ULONG addr,UBYTE data)
gNextTimerEvent=gSystemCycleCount;
}
mAUDIO_1_BKUP=data;
TRACE_MIKIE2("Poke(AUD1TBACK,%02x) at PC=%04x",data,mSystem.mCpu->GetPC());
break;
case (AUD1CTL&0xff):