Commit 51a0912c authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Cleanups

parent 07bcd9fc
Pipeline #59955 passed with stages
in 10 minutes and 11 seconds
......@@ -83,7 +83,6 @@ unsigned char *rasterY = NULL;
int m_bIsActive;
EMUINFO m_emuInfo;
SYSTEMINFO m_sysInfo[NR_OF_SYSTEMS];
void mainemuinit(void)
{
......@@ -173,7 +172,6 @@ static void SetActive(BOOL bActive)
static void SetEmu(int machine)
{
m_emuInfo.machine = machine;
m_emuInfo.drv = &m_sysInfo[machine];
}
static int initRom(void)
......@@ -239,18 +237,9 @@ static void initSysInfo(void)
m_bIsActive = FALSE;
m_emuInfo.machine = NGPC;
m_emuInfo.drv = &m_sysInfo[m_emuInfo.machine];
m_emuInfo.romSize = 0;
strcpy(m_emuInfo.RomFileName, "");
m_sysInfo[NGP].hSize = 160;
m_sysInfo[NGP].vSize = 152;
m_sysInfo[NGP].Ticks = 6*1024*1024;
m_sysInfo[NGPC].hSize = 160;
m_sysInfo[NGPC].vSize = 152;
m_sysInfo[NGPC].Ticks = 6*1024*1024;
}
int handleInputFile(const char *romName,
......
......@@ -34,14 +34,6 @@
extern "C" {
#endif
typedef struct SYSTEMINFO
{
int hSize;
int vSize;
int Ticks;
int InputKeys[12];
} SYSTEMINFO;
typedef struct EMUINFO
{
char RomFileName[_MAX_PATH];
......@@ -49,12 +41,10 @@ typedef struct EMUINFO
int machine; // what kind of machine should we emulate
int romSize; // what is the size of the currently loaded file
int samples;
SYSTEMINFO *drv;
} EMUINFO;
extern int m_bIsActive;
extern EMUINFO m_emuInfo;
extern SYSTEMINFO m_sysInfo[NR_OF_SYSTEMS];
extern int romSize;
int handleInputFile(const char *romName,
......
......@@ -322,49 +322,17 @@ void dac_writeL(unsigned char data)
/* Write to buffer */
dacBufferL[dacLBufferWrite++] = (data-0x80)<<8;
#if 0
dacLBufferWrite++;
#endif
if (dacLBufferWrite == DAC_BUFFERSIZE)
dacLBufferWrite = 0;
/* Overflow? */
dacLBufferCount++;
if (dacLBufferCount == DAC_BUFFERSIZE)
{
#if 0
dbg_printf("dac_write: DAC buffer overflow\nPlease report this to the author.");
#endif
dacLBufferCount = 0;
}
}
}
#if 0
void dac_writeR(unsigned char data)
{
/* Write to buffer */
dacBufferR[dacRBufferWrite] = data;
dacRBufferWrite++;
if (dacRBufferWrite == DAC_BUFFERSIZE)
dacRBufferWrite = 0;
/* Overflow? */
dacRBufferCount++;
if (dacRBufferCount == DAC_BUFFERSIZE)
{
dbg_printf("dac_write: DAC buffer overflow\nPlease report this to the author.");
dacRBufferCount = 0;
}
}
#endif
void dac_mixer(_u16* stream, int length_bytes)
{
}
void dac_update(_u16* dac_buffer, int length_bytes)
{
while (length_bytes > 1)
......@@ -380,9 +348,6 @@ void dac_update(_u16* dac_buffer, int length_bytes)
dacLBufferCount--;
/* Advance the DAC read */
#if 0
dacLBufferRead++;
#endif
if (++dacLBufferRead == DAC_BUFFERSIZE)
dacLBufferRead = 0;
}
......@@ -444,33 +409,16 @@ void sound_init(int SampleRate)
dacBufferL[i] = 0;
dacLBufferCount = 0;
dacLBufferRead = 0;
dacLBufferRead = 0;
dacLBufferWrite = 0;
}
/* ============================================================================= */
#define NGPC_CHIP_FREQUENCY 44100
int chip_freq=NGPC_CHIP_FREQUENCY; /* what we'd prefer */
#define CHIPBUFFERLENGTH 35280
#define UNDEFINED 0xFFFFFF
/* ====== Chip sound ========= */
static int lastChipWrite = 0, chipWrite = UNDEFINED; /* Write Cursor */
/* ====== DAC sound ========= */
static int lastDacWrite = 0, dacWrite = UNDEFINED; /* Write Cursor */
_u8 blockSound[CHIPBUFFERLENGTH], blockDAC[CHIPBUFFERLENGTH]; /* Gets filled with sound data. */
unsigned int blockSoundWritePtr = 0;
unsigned int blockSoundReadPtr = 0;
void system_sound_chipreset(void)
{
/* Initialises sound chips, matching frequencies */
sound_init(chip_freq);
/* Initialises sound chips, matching frequencies */
sound_init(44100);
}
int sound_system_init(void)
......@@ -478,9 +426,3 @@ int sound_system_init(void)
system_sound_chipreset(); /* Resets chips */
return 1;
}
/* call this every so often to update the sound output */
void system_sound_update(int nframes)
{
}
......@@ -52,7 +52,6 @@ int sound_system_init(void);
BOOL system_sound_init(void);
void system_sound_chipreset(void);
void system_sound_update(int nframes);
void system_VBL(void);
#define Write_SoundChipTone(VALUE) (WriteSoundChip(&toneChip, VALUE))
......@@ -60,14 +59,9 @@ void system_VBL(void);
void sound_init(int SampleRate);
extern BOOL mute;
void dac_update(_u16* dac_buffer, int length_bytes);
void sound_update(_u16* chip_buffer, int length_bytes);
void increaseVolume(void);
void decreaseVolume(void);
void dac_writeL(unsigned char a);
void dac_write(unsigned char a);
......
......@@ -213,10 +213,6 @@ unsigned char opcode;
unsigned char lastbyte;
//unsigned char opcode1, opcode2;
// for debugging
int debugIndex, debugCount;
// wrapper
int memoryCycles;
......@@ -7819,10 +7815,6 @@ void tlcs_init(void)
pendingInterrupts[i][j] = 0;
}
}
debugIndex = 0;
debugCount = 1;
//saved_my_pc = my_pc;
}
void tlcs_reinit(void)
......@@ -7917,18 +7909,8 @@ void tlcs_reinit(void)
set_cregs();
my_pc = get_address(gen_regsPC);
debugIndex = 0;
debugCount = 1;
//saved_my_pc = my_pc;
}
/*int check_pc(unsigned int addr)
{
if (gen_regsPC==addr) return 1;
else return 0;
}*/
static void tlcsDMA(unsigned char vector);
// handle receiving of interrupt i
......@@ -8484,8 +8466,6 @@ void tlcs_execute(int cycles)
}
else if (*scanlineY == 152)
{
system_sound_update(1);
// VBlank
if (tlcsMemReadB(0x8000)&0x80)
tlcs_interrupt(2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment