Commit 7193304e authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Convert main.cpp to C

parent 153a846f
......@@ -37,11 +37,11 @@ SOURCES_CXX := \
$(CORE_DIR)/tlcs900h.cpp \
$(CORE_DIR)/flash.cpp \
$(CORE_DIR)/graphics.cpp \
$(CORE_DIR)/main.cpp \
$(CORE_DIR)/libretro/libretro.cpp \
$(CORE_DIR)/libretro/log.cpp
SOURCES_C += \
$(CORE_DIR)/main.c \
$(CORE_DIR)/input.c \
$(CORE_DIR)/race-memory.c \
$(CORE_DIR)/ngpBios.c \
......
......@@ -489,7 +489,7 @@ void flashWriteByte(unsigned int addr, unsigned char data, unsigned char operati
mainrom[addr] &= data; /* actually writing data */
}
unsigned char flashReadInfo(unsigned int addr)
extern "C" unsigned char flashReadInfo(unsigned int addr)
{
currentWriteCycle = 1;
currentCommand = COMMAND_INFO_READ;
......@@ -699,7 +699,7 @@ void vectFlashChipErase(unsigned char chip)
{
}
void setFlashSize(unsigned int romSize)
extern "C" void setFlashSize(unsigned int romSize)
{
/* add individual hacks here. */
......
......@@ -27,9 +27,16 @@ void vectFlashWrite(unsigned char chip, unsigned int to,
unsigned char *fromAddr, unsigned int numBytes);
void vectFlashErase(unsigned char chip, unsigned char blockNum);
void vectFlashChipErase(unsigned char chip);
void setFlashSize(unsigned int romSize);
void flashShutdown(void);
#ifdef __cplusplus
extern "C" {
#endif
void setFlashSize(unsigned int romSize);
unsigned char flashReadInfo(unsigned int addr);
#ifdef __cplusplus
}
#endif
extern unsigned char needToWriteFile;
......
......@@ -1517,7 +1517,7 @@ void myGraphicsBlitLine(unsigned char render) /* NOTA */
*
*/
BOOL graphics_init(void)
extern "C" BOOL graphics_init(void)
{
#ifdef __LIBRETRO__
palette_init = palette_init16;
......
......@@ -25,19 +25,13 @@
#define SIZEX 260//480//368//320//480
#define SIZEY 152//272//207//240//272
//extern unsigned char bwPaletteDirty, spritePaletteDirty, frontPaletteDirty, backPaletteDirty;
//extern unsigned char bgoowDirty;
//extern unsigned int spritesDirty;
// graphics buffer will hold the screen transformed to full RGB colors used by the emulated system
//extern int *graphics_buffer;
//extern unsigned short *drawBuffer;
//extern unsigned short drawBuffer[SIZEX*SIZEY];
//extern unsigned char *drawBuffer;
//extern BITMAP myBitmap;
#ifdef __cplusplus
extern "C" {
#endif
BOOL graphics_init(void);
#ifdef __cplusplus
}
#endif
void graphics_blit(void);
void graphics_paint();
void graphics_cleanup();
......
......@@ -103,7 +103,7 @@ static void SetEmu(int machine)
m_emuInfo.drv = &m_sysInfo[machine];
}
static bool initRom(void)
static int initRom(void)
{
int i, m;
char *licenseInfo = " BY SNK CORPORATION";
......
......@@ -9,24 +9,6 @@
#include <ctype.h>
#include <math.h>
typedef struct SYSTEMINFO
{
int hSize;
int vSize;
int Ticks;
int InputKeys[12];
} SYSTEMINFO;
typedef struct EMUINFO
{
char RomFileName[_MAX_PATH];
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;
#define KEY_UP 0
#define KEY_DOWN 1
#define KEY_LEFT 2
......@@ -46,6 +28,30 @@ typedef struct EMUINFO
#define NR_OF_SYSTEMS 2
/* to call these FPS is a bit of a misnomer */
#define HOST_FPS 60 /* the number of frames we want to draw to the host's screen every second */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SYSTEMINFO
{
int hSize;
int vSize;
int Ticks;
int InputKeys[12];
} SYSTEMINFO;
typedef struct EMUINFO
{
char RomFileName[_MAX_PATH];
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;
......@@ -55,7 +61,8 @@ extern int romSize;
int handleInputFile(char *romName);
void mainemuinit(void);
/* to call these FPS is a bit of a misnomer */
#define HOST_FPS 60 /* the number of frames we want to draw to the host's screen every second */
#ifdef __cplusplus
}
#endif
#endif
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