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

Start getting rid of non-libretro codepaths

parent d0653dd8
...@@ -57,12 +57,8 @@ unsigned int cartAddrMask = 0x3FFFFF; ...@@ -57,12 +57,8 @@ unsigned int cartAddrMask = 0x3FFFFF;
/* with selector, I get /* with selector, I get
* writeSaveGameFile: Couldn't open Battery//mnt/sd/Games/race/ChryMast.ngf file * writeSaveGameFile: Couldn't open Battery//mnt/sd/Games/race/ChryMast.ngf file
*/ */
#ifdef __LIBRETRO__
extern char retro_save_directory[2048]; extern char retro_save_directory[2048];
#define SAVEGAME_DIR retro_save_directory #define SAVEGAME_DIR retro_save_directory
#else
#define SAVEGAME_DIR "states/"
#endif
unsigned char currentWriteCycle = 1; /* can be 1 through 6 */ unsigned char currentWriteCycle = 1; /* can be 1 through 6 */
unsigned char currentCommand = NO_COMMAND; unsigned char currentCommand = NO_COMMAND;
......
...@@ -15,17 +15,11 @@ ...@@ -15,17 +15,11 @@
#include "StdAfx.h" #include "StdAfx.h"
#include "main.h" #include "main.h"
#ifndef __LIBRETRO__
#include "menu.h"
#include "GP2X.h"
#endif
#include "graphics.h" #include "graphics.h"
#include "memory.h" #include "memory.h"
#ifdef __LIBRETRO__
extern ngp_screen* screen; extern ngp_screen* screen;
extern int gfx_hacks; extern int gfx_hacks;
#endif
#define INITGUID #define INITGUID
...@@ -157,9 +151,8 @@ unsigned short p2[16] = { ...@@ -157,9 +151,8 @@ unsigned short p2[16] = {
#ifndef __LIBRETRO__ #ifndef __LIBRETRO__
#define DO_PERIODIC_FLASH_SAVES #define DO_PERIODIC_FLASH_SAVES
#define DO_FPS_DISPLAY
#endif #endif
#if defined(DO_FPS_DISPLAY) || defined(DO_PERIODIC_FLASH_SAVES) #if defined(DO_PERIODIC_FLASH_SAVES)
static unsigned int frameCount = 0; static unsigned int frameCount = 0;
#endif #endif
...@@ -181,7 +174,7 @@ void graphicsBlitEnd(void) ...@@ -181,7 +174,7 @@ void graphicsBlitEnd(void)
void graphics_paint(void); void graphics_paint(void);
#if defined(DO_FPS_DISPLAY) || defined(DO_PERIODIC_FLASH_SAVES) #if defined(DO_PERIODIC_FLASH_SAVES)
inline void incFrameCount() inline void incFrameCount()
{ {
frameCount++; frameCount++;
...@@ -470,15 +463,13 @@ void palette_init16(DWORD dwRBitMask, DWORD dwGBitMask, DWORD dwBBitMask) ...@@ -470,15 +463,13 @@ void palette_init16(DWORD dwRBitMask, DWORD dwGBitMask, DWORD dwBBitMask)
*/ */
void graphicsSetDarkFilterLevel(unsigned filterLevel) void graphicsSetDarkFilterLevel(unsigned filterLevel)
{ {
#ifdef __LIBRETRO__ unsigned prev_dark_filter_level = dark_filter_level;
unsigned prev_dark_filter_level = dark_filter_level;
dark_filter_level = filterLevel; dark_filter_level = filterLevel;
dark_filter_level = (dark_filter_level > 100) ? 100 : dark_filter_level; dark_filter_level = (dark_filter_level > 100) ? 100 : dark_filter_level;
if (dark_filter_level != prev_dark_filter_level) if (dark_filter_level != prev_dark_filter_level)
palette_init16(0xf800,0x7e0,0x1f); palette_init16(0xf800,0x7e0,0x1f);
#endif
} }
void palette_init8(DWORD dwRBitMask, DWORD dwGBitMask, DWORD dwBBitMask) void palette_init8(DWORD dwRBitMask, DWORD dwGBitMask, DWORD dwBBitMask)
...@@ -1141,7 +1132,7 @@ void graphicsBlitLine(unsigned char render) ...@@ -1141,7 +1132,7 @@ void graphicsBlitLine(unsigned char render)
tlcsMemWriteB(0x00008010,tlcsMemReadB(0x00008010) & ~0x40); tlcsMemWriteB(0x00008010,tlcsMemReadB(0x00008010) & ~0x40);
graphicsBlitInit(); graphicsBlitInit();
#if defined(DO_FPS_DISPLAY) || defined(DO_PERIODIC_FLASH_SAVES) #if defined(DO_PERIODIC_FLASH_SAVES)
incFrameCount(); incFrameCount();
#endif #endif
......
...@@ -363,49 +363,43 @@ void WriteSoundChip(SoundChip* chip, _u8 data) ...@@ -363,49 +363,43 @@ void WriteSoundChip(SoundChip* chip, _u8 data)
//============================================================================= //=============================================================================
//#ifdef __LIBRETRO__
void dac_writeL(unsigned char data) void dac_writeL(unsigned char data)
{ {
static int conv=5; static int conv=5;
#ifdef __LIBRETRO__ /* pretend that conv=5.5 (44100/8000) conversion factor */
//pretend that conv=5.5 (44100/8000) conversion factor
if(conv==5)
if(conv==5) conv=6;
conv=6; else
else {
{ conv=5;
conv=5;
/* Arregla el sonido del Super Real Mahjong */
//Arregla el sonido del Super Real Mahjong if (fixsoundmahjong>500)
if (fixsoundmahjong>500) conv=3;
conv=3; }
}
#else
conv=1;
#endif
for(int i=0;i<conv;i++) for(int i=0;i<conv;i++)
{ {
//Write to buffer //Write to buffer
dacBufferL[dacLBufferWrite++] = (data-0x80)<<8; dacBufferL[dacLBufferWrite++] = (data-0x80)<<8;
//dacLBufferWrite++; //dacLBufferWrite++;
if (dacLBufferWrite == DAC_BUFFERSIZE) if (dacLBufferWrite == DAC_BUFFERSIZE)
dacLBufferWrite = 0; dacLBufferWrite = 0;
//Overflow? //Overflow?
dacLBufferCount++; dacLBufferCount++;
if (dacLBufferCount == DAC_BUFFERSIZE) if (dacLBufferCount == DAC_BUFFERSIZE)
{ {
//dbg_printf("dac_write: DAC buffer overflow\nPlease report this to the author."); //dbg_printf("dac_write: DAC buffer overflow\nPlease report this to the author.");
dacLBufferCount = 0; dacLBufferCount = 0;
} }
} }
} }
//#endif
/*void dac_writeR(unsigned char data) /*void dac_writeR(unsigned char data)
{ {
...@@ -434,11 +428,7 @@ void dac_update(_u16* dac_buffer, int length_bytes) ...@@ -434,11 +428,7 @@ void dac_update(_u16* dac_buffer, int length_bytes)
while (length_bytes > 1) while (length_bytes > 1)
{ {
//Copy then clear DAC data //Copy then clear DAC data
#ifdef __LIBRETRO__
*(dac_buffer++) |= dacBufferL[dacLBufferRead]; *(dac_buffer++) |= dacBufferL[dacLBufferRead];
#else
*(dac_buffer++) = dacBufferL[dacLBufferRead];
#endif
dacBufferL[dacLBufferRead] = 0; //silence? dacBufferL[dacLBufferRead] = 0; //silence?
length_bytes -= 2; // 1 byte = 8 bits length_bytes -= 2; // 1 byte = 8 bits
...@@ -518,14 +508,8 @@ void sound_init(int SampleRate) ...@@ -518,14 +508,8 @@ void sound_init(int SampleRate)
//============================================================================= //=============================================================================
#ifdef __LIBRETRO__
#define NGPC_CHIP_FREQUENCY 44100 #define NGPC_CHIP_FREQUENCY 44100
#else int chip_freq=NGPC_CHIP_FREQUENCY; /* what we'd prefer */
#define NGPC_CHIP_FREQUENCY 8000
#endif
int chip_freq=NGPC_CHIP_FREQUENCY;//what we'd prefer
#define CHIPBUFFERLENGTH 35280 #define CHIPBUFFERLENGTH 35280
......
...@@ -6983,7 +6983,7 @@ inline unsigned char makeBCD(int i) ...@@ -6983,7 +6983,7 @@ inline unsigned char makeBCD(int i)
//extern "C" int sceUtilityGetSystemParamInt (int id, int *value); //extern "C" int sceUtilityGetSystemParamInt (int id, int *value);
void initTimezone() void initTimezone(void)
{ {
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
/*#define PSP_SYSTEMPARAM_ID_INT_TIMEZONE 6 /*#define PSP_SYSTEMPARAM_ID_INT_TIMEZONE 6
...@@ -9181,10 +9181,6 @@ void tlcs_execute(int cycles) ...@@ -9181,10 +9181,6 @@ void tlcs_execute(int cycles)
static unsigned int steps=1; static unsigned int steps=1;
#endif #endif
#ifndef __LIBRETRO__
UpdateInputState();
#endif
while(cycles > 0) while(cycles > 0)
{ {
/* AKTODO */ /* AKTODO */
...@@ -9281,13 +9277,8 @@ void tlcs_execute(int cycles) ...@@ -9281,13 +9277,8 @@ void tlcs_execute(int cycles)
//Flavor, this auto-frameskip code is messed up //Flavor, this auto-frameskip code is messed up
void ngpc_run() void ngpc_run(void)
{ {
#ifndef __LIBRETRO__
int currTick=0,lastTick=0;
u32 ticks_per_sec = 1000;
#endif /* !__LIBRETRO__ */
#ifdef AUTO_FRAMESKIP #ifdef AUTO_FRAMESKIP
unsigned int skipFrames=0; unsigned int skipFrames=0;
#endif /* AUTO_FRAMESKIP */ #endif /* AUTO_FRAMESKIP */
......
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