From: notaz Date: Sat, 14 Oct 2017 18:28:24 +0000 (+0300) Subject: let it build on msvc X-Git-Tag: v1.93~41 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24aab4da7352b5cecad4e09b0dcc0807b14786f2;p=picodrive.git let it build on msvc supposedly for the original XBox? --- diff --git a/pico/32x/32x.c b/pico/32x/32x.c index b20ebf30..1c166cee 100644 --- a/pico/32x/32x.c +++ b/pico/32x/32x.c @@ -297,9 +297,9 @@ typedef void (event_cb)(unsigned int now); unsigned int p32x_event_times[P32X_EVENT_COUNT]; static unsigned int event_time_next; static event_cb *p32x_event_cbs[P32X_EVENT_COUNT] = { - [P32X_EVENT_PWM] = p32x_pwm_irq_event, - [P32X_EVENT_FILLEND] = fillend_event, - [P32X_EVENT_HINT] = hint_event, + p32x_pwm_irq_event, // P32X_EVENT_PWM + fillend_event, // P32X_EVENT_FILLEND + hint_event, // P32X_EVENT_HINT }; // schedule event at some time 'after', in m68k clocks diff --git a/pico/32x/draw.c b/pico/32x/draw.c index f8021502..ee541bd9 100644 --- a/pico/32x/draw.c +++ b/pico/32x/draw.c @@ -292,7 +292,7 @@ void PicoDraw32xLayerMdOnly(int offs, int lines) for (l = 0; l < lines; l++) { if (have_scan) { PicoScan32xBegin(l + offs); - dst = Pico.est.DrawLineDest + poffs; + dst = (unsigned short *)Pico.est.DrawLineDest + poffs; } for (p = 0; p < plen; p += 4) { dst[p + 0] = pal[*pmd++]; diff --git a/pico/cd/mcd.c b/pico/cd/mcd.c index 043b4a25..af320bd0 100644 --- a/pico/cd/mcd.c +++ b/pico/cd/mcd.c @@ -30,9 +30,11 @@ PICO_INTERNAL void PicoExitMCD(void) PICO_INTERNAL void PicoPowerMCD(void) { + int fmt_size; + SekCycleCntS68k = SekCycleAimS68k = 0; - int fmt_size = sizeof(formatted_bram); + fmt_size = sizeof(formatted_bram); memset(Pico_mcd->prg_ram, 0, sizeof(Pico_mcd->prg_ram)); memset(Pico_mcd->word_ram2M, 0, sizeof(Pico_mcd->word_ram2M)); memset(Pico_mcd->pcm_ram, 0, sizeof(Pico_mcd->pcm_ram)); @@ -200,10 +202,10 @@ typedef void (event_cb)(unsigned int now); unsigned int pcd_event_times[PCD_EVENT_COUNT]; static unsigned int event_time_next; static event_cb *pcd_event_cbs[PCD_EVENT_COUNT] = { - [PCD_EVENT_CDC] = pcd_cdc_event, - [PCD_EVENT_TIMER3] = pcd_int3_timer_event, - [PCD_EVENT_GFX] = gfx_update, - [PCD_EVENT_DMA] = pcd_dma_event, + pcd_cdc_event, // PCD_EVENT_CDC + pcd_int3_timer_event, // PCD_EVENT_TIMER3 + gfx_update, // PCD_EVENT_GFX + pcd_dma_event, // PCD_EVENT_DMA }; void pcd_event_schedule(unsigned int now, enum pcd_event event, int after) diff --git a/pico/draw.c b/pico/draw.c index bb051b6d..83010a49 100644 --- a/pico/draw.c +++ b/pico/draw.c @@ -1617,7 +1617,7 @@ void PicoDrawSetOutBuf(void *dest, int increment) { DrawLineDestBase = dest; DrawLineDestIncrement = increment; - Pico.est.DrawLineDest = DrawLineDestBase + Pico.est.DrawScanline * increment; + Pico.est.DrawLineDest = (char *)DrawLineDestBase + Pico.est.DrawScanline * increment; } void PicoDrawSetInternalBuf(void *dest, int increment) diff --git a/pico/pico_port.h b/pico/pico_port.h index f1d95a56..605778d8 100644 --- a/pico/pico_port.h +++ b/pico/pico_port.h @@ -15,4 +15,11 @@ #define ALIGNED(n) #endif +#ifdef _MSC_VER +#define snprintf _snprintf +#define strcasecmp _stricmp +#define strncasecmp _strnicmp +#define strdup _strdup +#endif + #endif // PICO_PORT_INCLUDED diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index e7f588a1..7896ffbf 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -484,6 +484,8 @@ int plat_mem_set_exec(void *ptr, size_t size) void emu_video_mode_change(int start_line, int line_count, int is_32cols) { + struct retro_system_av_info av_info; + memset(vout_buf, 0, 320 * 240 * 2); vout_width = is_32cols ? 256 : 320; PicoDrawSetOutBuf(vout_buf, vout_width * 2); @@ -494,7 +496,6 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols) vout_offset = vout_width * start_line; // Update the geometry - struct retro_system_av_info av_info; retro_get_system_av_info(&av_info); environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &av_info); } @@ -566,6 +567,8 @@ void retro_get_system_info(struct retro_system_info *info) void retro_get_system_av_info(struct retro_system_av_info *info) { + float common_width; + memset(info, 0, sizeof(*info)); info->timing.fps = Pico.m.pal ? 50 : 60; info->timing.sample_rate = 44100; @@ -574,7 +577,7 @@ void retro_get_system_av_info(struct retro_system_av_info *info) info->geometry.max_width = vout_width; info->geometry.max_height = vout_height; - float common_width = vout_width; + common_width = vout_width; if (user_vout_width != 0) common_width = user_vout_width; @@ -1208,6 +1211,8 @@ static enum input_device input_name_to_val(const char *name) static void update_variables(void) { struct retro_variable var; + int OldPicoRegionOverride; + float old_user_vout_width; var.value = NULL; var.key = "picodrive_input1"; @@ -1237,7 +1242,7 @@ static void update_variables(void) PicoOpt &= ~POPT_EN_MCD_RAMCART; } - int OldPicoRegionOverride = PicoRegionOverride; + OldPicoRegionOverride = PicoRegionOverride; var.value = NULL; var.key = "picodrive_region"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { @@ -1261,7 +1266,7 @@ static void update_variables(void) PsndRerate(1); } - float old_user_vout_width = user_vout_width; + old_user_vout_width = user_vout_width; var.value = NULL; var.key = "picodrive_aspect"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { diff --git a/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj b/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj index 4b8784a3..e9bde075 100644 --- a/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj +++ b/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj @@ -51,9 +51,10 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);INLINE=_inline;_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;NO_ZLIB;FAMEC_NO_GOTOS + WIN32;_DEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;FAMEC_NO_GOTOS CompileAsC - $(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;%(AdditionalIncludeDirectories) + $(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;$(SolutionDIr)\..\..\..\zlib;%(AdditionalIncludeDirectories) + 4018;4090;4101;4146;4244 Windows @@ -69,9 +70,10 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);INLINE=_inline;_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;NO_ZLIB;FAMEC_NO_GOTOS + WIN32;NDEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;FAMEC_NO_GOTOS CompileAsC - $(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;%(AdditionalIncludeDirectories) + $(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;$(SolutionDIr)\..\..\..\zlib;%(AdditionalIncludeDirectories) + 4018;4090;4101;4146;4244 Windows @@ -88,13 +90,23 @@ - - + + $(IntDir)\32x\ + $(IntDir)\32x\ + + + $(IntDir)\32x\ + $(IntDir)\32x\ + - + + + $(IntDir)\svp\ + $(IntDir)\svp\ + @@ -106,10 +118,19 @@ - - + + $(IntDir)\cd\ + $(IntDir)\cd\ + + + $(IntDir)\cd\ + $(IntDir)\cd\ + - + + $(IntDir)\cd\ + $(IntDir)\cd\ + @@ -120,8 +141,14 @@ - - + + $(IntDir)\pico\ + $(IntDir)\pico\ + + + $(IntDir)\pico\ + $(IntDir)\pico\ + @@ -133,7 +160,6 @@ - diff --git a/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters b/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters index 1a70e495..a1c0e0f6 100644 --- a/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters +++ b/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters @@ -120,9 +120,6 @@ Source Files\unzip - - Source Files\unzip - Source Files\pico @@ -198,22 +195,22 @@ Source Files\pico\cd - + Source Files\pico\cd - + Source Files\pico\cd Source Files\pico\cd - + Source Files\pico\cd Source Files\pico\32x - + Source Files\pico\32x @@ -225,7 +222,10 @@ Source Files\pico\carthw - + + Source Files\pico\carthw + + Source Files\pico\carthw\svp @@ -261,17 +261,17 @@ Source Files\cpu\sh2\mame - - Source Files - - + Source Files\pico\pico - + Source Files\pico\pico - + Source Files\pico\pico + + Source Files\pico\32x + \ No newline at end of file