Unverified Commit 2f94ed35 authored by Libretro-Admin's avatar Libretro-Admin Committed by GitHub
Browse files

Merge pull request #5 from phcoder/msvc-rb

Add compilation for msvc
parents 7f166e57 b3a74b3c
Pipeline #83333 failed with stages
in 9 minutes and 35 seconds
......@@ -22,6 +22,18 @@ include:
# Windows 32-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-i686-mingw.yml'
# Windows msvc10 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-x64-msvc10-msys2.yml'
# Windows msvc10 32-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-i686-msvc10-msys2.yml'
# Windows msvc05 32-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-i686-msvc05-msys2.yml'
# Linux 64-bit
- project: 'libretro-infrastructure/ci-templates'
......@@ -129,6 +141,24 @@ libretro-build-windows-i686:
extends:
- .libretro-windows-i686-mingw-make-default
- .core-defs
# Windows msvc10 64-bit
libretro-build-windows-msvc10-x64:
extends:
- .libretro-windows-x64-msvc10-msys2-make-default
- .core-defs
# Windows msvc10 32-bit
libretro-build-windows-msvc10-i686:
extends:
- .libretro-windows-i686-msvc10-msys2-make-default
- .core-defs
# Windows msvc05 32-bit
libretro-build-windows-msvc05-i686:
extends:
- .libretro-windows-i686-msvc05-msys2-make-default
- .core-defs
# Linux 64-bit
libretro-build-linux-x64:
......
......@@ -216,6 +216,91 @@ else ifeq ($(platform), gcw0)
DISABLE_ERROR_LOGGING := 1
CFLAGS += -march=mips32 -mtune=mips32r2 -mhard-float
LIBS = -lm
# Windows MSVC 2010 x64
else ifeq ($(platform), windows_msvc2010_x64)
CC = cl.exe
CXX = cl.exe
CFLAGS += -wd4711 -wd4514 -wd4820 -DNO_VA_COPY=1
CXXFLAGS += -wd4711 -wd4514 -wd4820 -DNO_VA_COPY=1
PATH := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/bin/amd64"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE")
LIB := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/lib/amd64")
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include")
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -io '[A-Z]:\\.*')
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -io '[A-Z]:\\.*')
WindowsSDKIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include")
WindowsSDKGlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\gl")
WindowsSDKLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib\x64")
INCFLAGS_PLATFORM = -I"$(WindowsSdkDirInc)"
export INCLUDE := $(INCLUDE);$(WindowsSDKIncludeDir);$(WindowsSDKGlIncludeDir);$(CORE_DIR)/libretro-common/include/compat/msvc
export LIB := $(LIB);$(WindowsSDKLibDir)
TARGET := $(TARGET_NAME)_libretro.dll
LDFLAGS += -DLL
LIBS =
# Windows MSVC 2010 x86
else ifeq ($(platform), windows_msvc2010_x86)
CC = cl.exe
CXX = cl.exe
CFLAGS += -wd4711 -wd4514 -wd4820 -DNO_VA_COPY=1
CXXFLAGS += -wd4711 -wd4514 -wd4820 -DNO_VA_COPY=1
PATH := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/bin"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE")
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS100COMNTOOLS)../../VC/lib")
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../../VC/include")
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -io '[A-Z]:\\.*')
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -io '[A-Z]:\\.*')
WindowsSDKIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include")
WindowsSDKGlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\gl")
WindowsSDKLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib")
INCFLAGS_PLATFORM = -I"$(WindowsSdkDirInc)"
export INCLUDE := $(INCLUDE);$(WindowsSDKIncludeDir);$(WindowsSDKGlIncludeDir);$(CORE_DIR)/libretro-common/include/compat/msvc
export LIB := $(LIB);$(WindowsSDKLibDir)
TARGET := $(TARGET_NAME)_libretro.dll
LDFLAGS += -DLL
LIBS =
# Windows MSVC 2005 x86
else ifeq ($(platform), windows_msvc2005_x86)
CC = cl.exe
CXX = cl.exe
CFLAGS += -wd4711 -wd4514 -wd4820 -DNO_VA_COPY=1
CXXFLAGS += -wd4711 -wd4514 -wd4820 -DNO_VA_COPY=1
PATH := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../IDE")
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/include")
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS80COMNTOOLS)../../VC/lib")
BIN := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin")
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3" -v "Install Dir" | grep -o '[A-Z]:\\.*')
WindowsSDKIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include")
WindowsSDKLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib")
INCLUDE := $(INCLUDE);$(WindowsSDKIncludeDir);$(WindowsSDKAtlIncludeDir);$(WindowsSDKCrtIncludeDir);$(WindowsSDKGlIncludeDir);$(WindowsSDKMfcIncludeDir);libretro/msvc/msvc-2005
LIB := $(LIB);$(WindowsSDKLibDir)
export INCLUDE := $(INCLUDE);$(INETSDK)/Include;$(CORE_DIR)/libretro-common/include/compat/msvc
export LIB := $(LIB);$(WindowsSdkDir);$(INETSDK)/Lib
TARGET := $(TARGET_NAME)_libretro.dll
PSS_STYLE :=2
LDFLAGS += -DLL
CFLAGS += -D_CRT_SECURE_NO_DEPRECATE
LIBS =
else
CC ?= gcc
......@@ -233,27 +318,36 @@ include Makefile.common
OBJECTS := $(SOURCES_C:.c=.o)
CFLAGS += -DMAC2=1 \
-std=gnu99 \
-O3 \
-finline-functions \
-funroll-loops \
-fsigned-char \
-Wno-strict-prototypes \
-ffast-math \
-fomit-frame-pointer \
-fno-strength-reduce \
-fno-builtin \
-finline-functions \
-D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565
CFLAGS += -DMAC2=1 -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565
ifeq (,$(findstring msvc,$(platform)))
CFLAGS += -std=gnu99 \
-O3 \
-finline-functions \
-funroll-loops \
-fsigned-char \
-Wno-strict-prototypes \
-ffast-math \
-fomit-frame-pointer \
-fno-strength-reduce \
-fno-builtin \
-finline-functions
endif
LDFLAGS += -lm
OBJOUT = -o
ifneq (,$(findstring msvc,$(platform)))
OBJOUT = -Fo
endif
all: $(TARGET)
$(TARGET): $(OBJECTS)
ifeq ($(platform), emscripten)
$(LD) $(fpic) $(SHARED) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
else ifneq (,$(findstring msvc,$(platform)))
link.exe -out:$@ $(OBJECTS) $(LDFLAGS) $(LIBS)
else ifeq ($(STATIC_LINKING),1)
$(AR) rcs $@ $(OBJECTS)
else
......@@ -261,7 +355,7 @@ else
endif
%.o: %.c
$(CC) $(fpic) $(CFLAGS) $(INCFLAGS) -c -o $@ $<
$(CC) $(fpic) $(CFLAGS) $(INCFLAGS) -c $(OBJOUT)$@ $<
clean:
rm -f $(OBJECTS) $(TARGET)
......
......@@ -37,6 +37,8 @@ SOURCES_C := \
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += \
$(CORE_DIR)/libretro-common/compat/compat_posix_string.c \
$(CORE_DIR)/libretro-common/compat/compat_snprintf.c
$(CORE_DIR)/libretro-common/compat/compat_strl.c \
$(CORE_DIR)/libretro-common/compat/fopen_utf8.c \
$(CORE_DIR)/libretro-common/encodings/encoding_utf.c \
......
#include <ctype.h>
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
#ifdef WIIU
#include <features_cpu.h>
......@@ -89,6 +87,8 @@ int VIRTUAL_WIDTH;
int retrow=640;
int retroh=480;
static int64_t ticks_count; // For the interface
unsigned minivmac_devices[ 2 ];
extern int RETROSTATUS;
......@@ -120,9 +120,9 @@ static char CMDFILE[512];
int loadcmdfile(char *argv)
{
int res = 0;
memset(CMDFILE, 0, sizeof(CMDFILE));
RFILE *h = filestream_open(argv, RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
char *p;
memset(CMDFILE, 0, sizeof(CMDFILE));
if (h) {
filestream_read(h, CMDFILE, sizeof(CMDFILE) - 1);
filestream_close(h);
......@@ -287,25 +287,8 @@ void parse_cmdline(const char *argv)
}
long GetTicks(void)
{ // in MSec
#ifndef _ANDROID_
#if defined(WIIU)
return (cpu_features_get_time_usec());///1000;
#else
struct timeval tv;
gettimeofday (&tv, NULL);
return (tv.tv_sec*1000000 + tv.tv_usec);///1000;
#endif
#else
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
return (now.tv_sec*1000000 + now.tv_nsec/1000);///1000;
#endif
{
return ticks_count;
}
void save_bkg(void)
......@@ -328,8 +311,6 @@ void Screen_SetFullUpdate(int scr)
void retro_set_environment(retro_environment_t cb)
{
environ_cb = cb;
static const struct retro_controller_description p1_controllers[] = {
{ "Minivmac Joystick", RETRO_DEVICE_MINIVMAC_JOYSTICK },
{ "Minivmac Keyboard", RETRO_DEVICE_MINIVMAC_KEYBOARD },
......@@ -346,8 +327,6 @@ void retro_set_environment(retro_environment_t cb)
{ NULL, 0 }
};
cb( RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports );
struct retro_variable variables[] = {
{
"minivmac_Statusbar",
......@@ -360,12 +339,15 @@ void retro_set_environment(retro_environment_t cb)
{ NULL, NULL },
};
struct retro_vfs_interface_info vfs_interface_info;
bool no_content = true;
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_content);
environ_cb = cb;
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_content);
cb( RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports );
cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
struct retro_vfs_interface_info vfs_interface_info;
vfs_interface_info.required_interface_version = 3;
vfs_interface_info.iface = NULL;
if(cb(RETRO_ENVIRONMENT_GET_VFS_INTERFACE, &vfs_interface_info)) {
......@@ -451,6 +433,34 @@ static void keyboard_cb(bool down, unsigned keycode, uint32_t character, uint16_
void retro_init(void)
{
const char *system_dir = NULL;
const char *content_dir = NULL;
const char *save_dir = NULL;
#ifdef FRONTEND_SUPPORTS_RGB565
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
#else
enum retro_pixel_format fmt =RETRO_PIXEL_FORMAT_XRGB8888;
#endif
static struct retro_input_descriptor inputDescriptors[] = {
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "Right" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "Left" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "Up" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "Down" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R2, "R2" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L2, "L2" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R3, "R3" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L3, "L3" },
{ 0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X, "Mouse X" },
{ 0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y, "Mouse Y" },
{ 0, 0, 0, 0, NULL }
};
struct retro_keyboard_callback cb = { keyboard_cb };
environ_cb(RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK, &cb);
......@@ -461,16 +471,12 @@ void retro_init(void)
retro_system_directory=system_dir;
}
const char *content_dir = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY, &content_dir) && content_dir)
{
// if defined, use the system directory
retro_content_directory=content_dir;
}
const char *save_dir = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &save_dir) && save_dir)
{
// If save directory is defined use it, otherwise use system directory
......@@ -491,41 +497,13 @@ void retro_init(void)
sprintf(retro_system_data_directory, "%s/data",RETRO_DIR);
#endif
#ifdef FRONTEND_SUPPORTS_RGB565
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
#else
enum retro_pixel_format fmt =RETRO_PIXEL_FORMAT_XRGB8888;
#endif
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
{
fprintf(stderr, "PIXEL FORMAT is not supported.\n");
exit(0);
}
static struct retro_input_descriptor inputDescriptors[] = {
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X, "X" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y, "Y" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "Right" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "Left" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "Up" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "Down" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R, "R" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L, "L" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R2, "R2" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L2, "L2" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R3, "R3" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L3, "L3" },
{ 0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X, "Mouse X" },
{ 0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y, "Mouse Y" },
{ 0, 0, 0, 0, NULL }
};
environ_cb(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, &inputDescriptors);
}
void retro_deinit(void)
......@@ -605,6 +583,8 @@ void retro_run(void)
static int mfirst=1;
bool updated = false;
ticks_count += 1000000 / 60;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
update_variables();
......@@ -650,6 +630,7 @@ bool retro_load_game(const struct retro_game_info *info)
retro_init_time();
ticks_count = 0;
app_init();
memset(SNDBUF,0,1024*2*2);
......
......@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include "boolean.h"
//#define MATRIX(a,b) (((a) << 3) | (b))
......
......@@ -141,6 +141,7 @@ int app_event(int poll)
int app_render(int poll)
{
static int prevpoll=0,prevstate=0,reset_state=0;
int state;
if(prevpoll!=poll || reset_state){nk_clear(ctx);reset_state=0;}
if(poll==0)
......@@ -150,7 +151,7 @@ int app_render(int poll)
app_event(poll);
int state=gui(&browser,ctx);
state=gui(&browser,ctx);
if(state==1 && prevstate!=1)reset_state=1;
nk_retro_render(nk_rgba(0,0,0,0));
......
......@@ -5,6 +5,9 @@
//misc options
static int showled = nk_false;
static int current_drvtype = 2;
static int old_drvtype = 2;
int i;
if (minivmac_statusbar) {
showled = nk_true;
......@@ -12,8 +15,8 @@
else showled = nk_false;
//floppy option
static int current_drvtype = 2;
static int old_drvtype = 2;
current_drvtype = 2;
old_drvtype = 2;
// button toggle GUI/EMU
nk_layout_row_dynamic(ctx, DEFHSZ, 3);
......@@ -47,8 +50,6 @@
//floppy option
int i;
for(i=0;i<2;i++)
if(LOADCONTENT==2 && LDRIVE==(i+8));
else if( (i==0? DISKA_NAME: DISKB_NAME)!=NULL){
......
......@@ -47,6 +47,7 @@ gui(struct file_browser *browser,struct nk_context *ctx)
static nk_flags window_flags = 0;
static int minimizable = nk_false;
static int title = nk_true;
int tmpval;
/* window flags */
window_flags = 0;
......@@ -58,8 +59,6 @@ gui(struct file_browser *browser,struct nk_context *ctx)
if (minimizable) window_flags |= NK_WINDOW_MINIMIZABLE;
if (title) window_flags |= NK_WINDOW_TITLE;
int tmpval;
if(pauseg==1 && SHOWKEY==1)SHOWKEY=-1;
if(pauseg==0 && SHOWKEY==1)GUISTATE=GUI_VKBD;
if(pauseg==1 && SHOWKEY==-1 && LOADCONTENT==1)GUISTATE=GUI_BROWSE;
......
......@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <time.h>
#include <retro_inline.h>
/* The number of elements in a table */
#define RSDL_TABLESIZE(table) (sizeof(table)/sizeof(table[0]))
......@@ -68,11 +69,11 @@ typedef struct RSDL_Surface {
} RSDL_Surface;
static __inline__ unsigned short RSDL_Swap16(unsigned short x){
static INLINE unsigned short RSDL_Swap16(unsigned short x){
unsigned short result= ((x<<8)|(x>>8));
return result;
}
static __inline__ unsigned RSDL_Swap32(unsigned x){
static INLINE unsigned RSDL_Swap32(unsigned x){
unsigned result= ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
return result;
}
......
......@@ -630,8 +630,6 @@ nk_retro_handle_event(int *evt,int poll)
{
struct nk_context *ctx = &retro.ctx;
if(poll)input_poll_cb();
static int lmx=0,lmy=0;
static int mmbL=0,mmbR=0,mmbM=0;
static int mbt[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
......@@ -639,10 +637,13 @@ nk_retro_handle_event(int *evt,int poll)
int mouse_l,mouse_m,mouse_r;
int16_t mouse_x=0,mouse_y=0;
int i;
if(poll)input_poll_cb();
Process_key();
int i=2;//TOGGLE: real mouse/ joypad emulate mouse
i=2;//TOGGLE: real mouse/ joypad emulate mouse
if ( input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) && mbt[i]==0 )
mbt[i]=1;
else if ( mbt[i]==1 && ! input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) ){
......
......@@ -2,6 +2,7 @@
#include "RSDL_wrapper.h"
#include <stdio.h>
#include <string.h>
#include <retro_inline.h>
static const char *cross[] = {
"X ",
......@@ -79,7 +80,7 @@ unsigned int Retro_MapRGBA(RSDL_PixelFormat *a, int r, int g, int b,int alpha){
| ((alpha >> a->Aloss) << a->Ashift & a->Amask);
}
static __inline__
static INLINE
RSDL_bool RSDL_IntersectRect(const RSDL_Rect *A, const RSDL_Rect *B, RSDL_Rect *intersection)
{
int Amin, Amax, Bmin, Bmax;
......@@ -167,11 +168,11 @@ void Retro_FreeSurface(RSDL_Surface *surf )
RSDL_Surface *Retro_CreateRGBSurface32( int w,int h, int d, int rm,int rg,int rb,int ra)
{
printf("s(%d,%d,%d) (%x,%x,%x,%x)\n",w,h,d,rm,rg,rb,ra);
{
RSDL_Surface *bitmp;
printf("s(%d,%d,%d) (%x,%x,%x,%x)\n",w,h,d,rm,rg,rb,ra);
bitmp = (RSDL_Surface *) calloc(1, sizeof(*bitmp));
if (bitmp == NULL)
{
......@@ -257,10 +258,10 @@ RSDL_Surface *Retro_CreateRGBSurface32( int w,int h, int d, int rm,int rg,int rb
RSDL_Surface *Retro_CreateRGBSurface16( int w,int h, int d, int rm,int rg,int rb,int ra)
{
printf("s(%d,%d,%d) (%x,%x,%x,%x)\n",w,h,d,rm,rg,rb,ra);
RSDL_Surface *bitmp;
printf("s(%d,%d,%d) (%x,%x,%x,%x)\n",w,h,d,rm,rg,rb,ra);
bitmp = (RSDL_Surface *) calloc(1, sizeof(*bitmp));
if (bitmp == NULL)
{
......@@ -369,7 +370,10 @@ void Retro_Draw_string(RSDL_Surface *surface, signed short int x, signed short i
unsigned *mbuffer=(unsigned*)surface->pixels;
#endif
Sint16 left, right, top, bottom;
Sint16 x1, y1, x2, y2;
int surfw;
int surfh;
#define VIRTUAL_WIDTH surface->w
......@@ -380,9 +384,6 @@ void Retro_Draw_string(RSDL_Surface *surface, signed short int x, signed short i
#define charWidthLocal 8
#define charHeightLocal 8
Sint16 left, right, top, bottom;
Sint16 x1, y1, x2, y2;
left = surface->clip_rect.x;
x2 = x + charWidthLocal;
if (x2<left) {
......@@ -409,8 +410,8 @@ void Retro_Draw_string(RSDL_Surface *surface, signed short int x, signed short i
for(strlen = 0; strlen<maxstrlen && string[strlen]; strlen++) {}
int surfw=strlen * 7 * xscale;
int surfh=8 * yscale;
surfw=strlen * 7 * xscale;
surfh=8 * yscale;
#ifdef M16B
linesurf =(unsigned char *)malloc(sizeof(unsigned short)*surfw*surfh );
......@@ -480,6 +481,12 @@ void Retro_Draw_char(RSDL_Surface *surface, signed short int x, signed short int
unsigned *mbuffer=(unsigned*)surface->pixels;
#endif
Sint16 left, right, top, bottom;
Sint16 x1, y1, x2, y2;
int surfw;
int surfh;
#define VIRTUAL_WIDTH surface->w
if ((surface->clip_rect.w==0) || (surface->clip_rect.h==0)) {
......@@ -490,9 +497,6 @@ void Retro_Draw_char(RSDL_Surface *surface, signed short int x, signed short int
#define charWidthLocal2 7*xscale
#define charHeightLocal2 8*yscale
Sint16 left, right, top, bottom;
Sint16 x1, y1, x2, y2;