Commit d0653dd8 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Get rid of __GP32__ code

parent d4d87c4e
......@@ -11,9 +11,7 @@
* Support functions for interfacing with DrZ80
*/
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "main.h"
#include "memory.h"
......
......@@ -13,9 +13,7 @@
* for emulation of NGPC carts
*/
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "memory.h"
#include "flash.h"
#include <string.h>
......@@ -63,11 +61,7 @@ unsigned int cartAddrMask = 0x3FFFFF;
extern char retro_save_directory[2048];
#define SAVEGAME_DIR retro_save_directory
#else
#ifdef __GP32__
#define SAVEGAME_DIR "dev0:\\GPMM\\NGPC\\BATTERY\\"
#else
#define SAVEGAME_DIR "states/"
#endif
#endif
unsigned char currentWriteCycle = 1; /* can be 1 through 6 */
......@@ -398,14 +392,12 @@ void writeSaveGameFile(void)
sprintf(msg, "Saved File %s", ngfFilename);
printTTF(msg, 0, 100, yellow, 1, actualScreen, 1);*/
needToWriteFile = 0;
#ifndef __GP32__
#ifdef TARGET_GP2X
sync();
#if 0
system("sync");
#endif
#endif
#endif
#ifdef DEBUG_FLASH
fprintf(debugFile, "writeSaveGameFile: exit\n");
......
......@@ -47,18 +47,8 @@ int totalpalette[32*32*32];
*/
static unsigned dark_filter_level = 0;
#ifdef __GP32__
#define OFFSETX 80
#define OFFSETY 44
unsigned short drawBuffer[NGPC_SIZEX*NGPC_SIZEY];
#else
static unsigned short *drawBuffer;
#endif
/* NGP specific
* precalculated pattern structures */
const unsigned char mypatterns[256*4] =
......@@ -171,9 +161,6 @@ unsigned short p2[16] = {
#endif
#if defined(DO_FPS_DISPLAY) || defined(DO_PERIODIC_FLASH_SAVES)
static unsigned int frameCount = 0;
#ifdef __GP32__
static char fps[32];
#endif
#endif
/* Flavor - For speed testing, you can turn off screen updates */
......@@ -558,8 +545,6 @@ static const unsigned short bwTable[8] =
0x0FFF, 0x0DDD, 0x0BBB, 0x0999, 0x0777, 0x0555, 0x0333, 0x0000
};
#ifndef __GP32__
/* used for rendering the sprites */
typedef struct
......@@ -1167,8 +1152,6 @@ void graphicsBlitLine(unsigned char render)
}
#endif /* __GP32__ */
/*
* THOR'S GRAPHIC CORE
*/
......@@ -1488,9 +1471,7 @@ void myGraphicsBlitLine(unsigned char render) /* NOTA */
{
if(render)
{
#ifdef __GP32__
unsigned short* draw = &drawBuffer[*scanlineY*NGPC_SIZEX];
#elif __LIBRETRO__
#if __LIBRETRO__
unsigned short* draw = &drawBuffer[(*scanlineY)*(screen->w)];
#else
unsigned short* draw = &drawBuffer[(*scanlineY)*(screen->w+PSP_FUDGE)];/* extra fudge factor for PSP??? */
......@@ -1509,11 +1490,7 @@ void myGraphicsBlitLine(unsigned char render) /* NOTA */
for (i=0;i<NGPC_SIZEX;i++)
draw[i] = OOWCol;
}
#ifdef __GP32
else if (zoom==0 ||( *scanlineY>=zoomy && *scanlineY<zoomy+120))
#else
else
#endif
{
#ifdef __LIBRETRO__
......@@ -1605,10 +1582,8 @@ void myGraphicsBlitLine(unsigned char render) /* NOTA */
{
/* start VBlank period */
tlcsMemWriteB(0x00008010,tlcsMemReadB(0x00008010) | 0x40);
#ifndef __GP32__
if (render)
graphics_paint();
#endif
}
*scanlineY+= 1;
}
......@@ -1637,19 +1612,12 @@ const char ErrCreateSurface[] = "CreateSurface Failed";
#define DDOK(x) if (hRet != DD_OK) { LastErr = x; return FALSE; }
#ifdef __GP32__
BOOL graphics_init(void)
#else
BOOL graphics_init(HWND phWnd)
#endif
{
#ifdef __LIBRETRO__
palette_init = palette_init16;
palette_init(0xf800,0x7e0,0x1f);
drawBuffer = (unsigned short*)screen->pixels;
#elif __GP32__
palette_init = palette_init16;
palette_init(0xf800,0x07c0,0x003e);
#else
dbg_print("in graphics_init\n");
......@@ -1686,9 +1654,7 @@ BOOL graphics_init(HWND phWnd)
#if 0
set_palette = set_paletteBW;
#endif
#ifndef __GP32__
graphicsBlitInit();
#endif
*scanlineY = 0;
break;
case NGPC:
......@@ -1697,9 +1663,7 @@ BOOL graphics_init(HWND phWnd)
#if 0
set_palette = set_paletteCol;
#endif
#ifndef __GP32__
graphicsBlitInit();
#endif
*scanlineY = 0;
break;
}
......
......@@ -37,11 +37,7 @@
//extern unsigned char *drawBuffer;
//extern BITMAP myBitmap;
#ifndef __GP32__
BOOL graphics_init(HWND phWnd);
#else
BOOL graphics_init();
#endif
void graphics_blit(void);
void graphics_paint();
void graphics_cleanup();
......
/* input.cpp: implementation of the input class. */
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "main.h"
#include "input.h"
#include "memory.h"
......@@ -14,16 +12,6 @@ unsigned char *InputByte = get_address(0x00006F82);
unsigned char ngpInputState = 0;
unsigned char *InputByte = &ngpInputState;
#ifdef __GP32__
#define DIK_UP BUTTON_UP
#define DIK_DOWN BUTTON_DOWN
#define DIK_LEFT BUTTON_LEFT
#define DIK_RIGHT BUTTON_RIGHT
#define DIK_SPACE BUTTON_A
#define DIK_N BUTTON_B
#define DIK_S BUTTON_SELECT
#define DIK_O BUTTON_START
#else
#define DIK_UP SDLK_UP
#define DIK_DOWN SDLK_DOWN
#define DIK_LEFT SDLK_LEFT
......@@ -32,38 +20,20 @@ unsigned char *InputByte = &ngpInputState;
#define DIK_N SDLK_b
#define DIK_S SDLK_ESCAPE
#define DIK_O SDLK_SPACE
#endif
#define DOWN(x) keystates[x]
#ifdef __GP32__
u16 keystates = 0;
#else
Uint8 *keystates = NULL;
#endif
struct joy_range
{
int minx, maxx, miny, maxy;
} range;
#ifdef __GP32__
void InitInput(void)
#else
BOOL InitInput(HWND hwnd)
#endif
{
return TRUE;
}
#ifdef __GP32__
extern "C"
{
int gp_getButton();
void clearScreen();
}
int zoom=0,zoomy=16;
#endif
void FreeInput(void)
{
......
......@@ -18,11 +18,7 @@
extern unsigned char ngpInputState;
#ifndef __GP32__
BOOL InitInput(HWND hWnd);
#else
void InitInput(void);
#endif
void UpdateInputState(void);
void FreeInput(void);
......
......@@ -12,10 +12,7 @@
#include "unzip.h"
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "main.h"
......@@ -27,9 +24,6 @@
#include "graphics.h"
#include "tlcs900h.h"
#ifndef __GP32__
//#include "timer.h"
#endif
#include "neopopsound.h"
......@@ -43,11 +37,6 @@
#endif
#endif
#ifdef __GP32__
#include "fileio.h"
#include "gfx.h"
#endif
extern int finscan;
extern int language;
extern int tipo_consola;
......@@ -66,11 +55,7 @@ void mainemuinit()
{
// initialize cpu memory
mem_init();
#ifndef __GP32__
graphics_init(NULL);
#else
graphics_init();
#endif
// initialize the TLCS-900H cpu
tlcs_init();
......@@ -108,23 +93,6 @@ void mainemuinit()
//Flavor sound_start();
}
#if !defined(__GP32__) && !defined(__LIBRETRO__)
void AfxMessageBox(char *a, int b, int c)
{
dbg_print(a);
}
void AfxMessageBox(char *a, int b)
{
dbg_print(a);
}
void AfxMessageBox(char *a)
{
dbg_print(a);
}
#endif
void SetActive(BOOL bActive)
{
m_bIsActive = bActive;
......
......@@ -14,18 +14,11 @@
* TODO:
*/
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "main.h"
#include "memory.h"
#include "input.h" /* for Gameboy Input */
#include "graphics.h" /* for i/o ports of the game gear */
#if 0
#include "mainemu.h"
#include "sound.h"
#include "z80.h"
#endif
#include "tlcs900h.h"
#include "koyote_bin.h"
......
......@@ -10,9 +10,7 @@
#ifndef _MEMORYH_
#define _MEMORYH_
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "neopopsound.h"
#include "sound.h"
#include "input.h"
......
......@@ -26,9 +26,7 @@
* *
************************************************************************/
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "neopopsound.h"
......@@ -459,10 +457,6 @@ void dac_update(_u16* dac_buffer, int length_bytes)
//=============================================================================
#ifdef __GP32__
volatile int soundON = 0;
#endif
//Resets the sound chips, also used whenever sound options are changed
void sound_init(int SampleRate)
{
......@@ -519,10 +513,6 @@ void sound_init(int SampleRate)
dacLBufferCount = 0;
dacLBufferRead = 0;
dacLBufferWrite = 0;
#ifdef __GP32__
soundON = 1;
#endif
}
//=============================================================================
......@@ -560,40 +550,14 @@ void system_sound_chipreset(void)
sound_init(chip_freq);
}
#ifdef __GP32__
int audioCallback(unsigned short* sndBuf,int len) {
int i,smp;
if (soundON==0)
return 0;
for (i=0;i<len;i++)
{
smp = (sample_chip_tone() + sample_chip_noise()) >> 1;
smp = (smp + dacBufferL[dacLBufferRead]) >> 1;
*(sndBuf++) = smp;
*(sndBuf++) = smp; // stereo ?
dacBufferL[dacLBufferRead] = 0; //silence?
if (dacLBufferCount > 0)
{
dacLBufferCount--;
if (++dacLBufferRead == DAC_BUFFERSIZE)
dacLBufferRead = 0;
}
}
return 1;
}
#endif
int sound_system_init(void)
{
system_sound_chipreset(); //Resets chips
system_sound_chipreset(); /* Resets chips */
return 1;
}
//call this every so often to update the sound output
/* call this every so often to update the sound output */
void system_sound_update(int nframes)
{
}
......
......@@ -22,9 +22,6 @@
#define __NEOPOPSOUND__
//=============================================================================
#ifdef __GP32__
#include "main.h"
#endif
#include "StdAfx.h"
typedef struct
......@@ -73,10 +70,8 @@ extern BOOL mute;
void dac_update(_u16* dac_buffer, int length_bytes);
void sound_update(_u16* chip_buffer, int length_bytes);
#ifndef __GP32__
void increaseVolume();
void decreaseVolume();
#endif
void increaseVolume(void);
void decreaseVolume(void);
//#define dac_writeL dac_write
//#define dac_writeR dac_write
......
......@@ -10,9 +10,7 @@
//
//////////////////////////////////////////////////////////////////////
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "main.h"
#include "ngpBios.h"
......
......@@ -9,9 +9,7 @@
/* sound.cpp: implementation of the sound class. */
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "main.h"
#include "sound.h"
#include "memory.h"
......@@ -26,9 +24,7 @@
#endif
#endif
#ifndef __GP32__
#include <math.h>
#endif
#define Machine (&m_emuInfo)
......
......@@ -16,17 +16,13 @@
#pragma once
#endif /* _MSC_VER > 1000 */
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include "main.h"
int initSound();
void soundCleanup();
#ifndef __GP32__
void setHwnd(HWND hWnd);
#endif
/* stolen MAME things */
int osd_start_audio_stream(int stereo);
......@@ -40,9 +36,6 @@ void soundStep(int cycles);
void soundOutput(void);
#define NUM_CHANNELS 32
#if !defined(__GP32__) && !defined(__LIBRETRO__)
extern Mix_Chunk *chunks[NUM_CHANNELS];
#endif
/* Gameboy sound system */
void gbSoundInit(void);
......
......@@ -29,9 +29,7 @@
//////////////////////////////////////////////////////////////////////
#ifndef __GP32__
#include "StdAfx.h"
#endif
#include <stdio.h>
#include <stdlib.h>
......@@ -9296,37 +9294,6 @@ void ngpc_run()
while(m_bIsActive) //should be some way to exit
{
#ifndef __LIBRETRO__
#ifndef __GP32__
currTick = SDL_GetTicks();
//if ((currTick - lastTick) >= (1000/m_emuInfo.fps))
if((currTick - lastTick) < (ticks_per_sec/HOST_FPS))
{
#ifdef AUTO_FRAMESKIP
if(skipFrames)
{
skipFrames--;
}
#endif /* AUTO_FRAMESKIP */
#ifdef FRAME_RATE_LIMIT
while((currTick - lastTick) < (ticks_per_sec/HOST_FPS))
{
currTick = SDL_GetTicks();
}
#endif /* FRAME_RATE_LIMIT */
}
#ifdef AUTO_FRAMESKIP
else
{
if(skipFrames<MAX_SKIPFRAMES) //cap skipFrames
skipFrames++;
}
#endif /* AUTO_FRAMESKIP */
lastTick = currTick;
#endif /* !__GP32 */
#endif /* !__LIBRETRO__ */
#ifdef AUTO_FRAMESKIP
tlcs_execute((6*1024*1024) / HOST_FPS, skipFrames);
#else
......
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