let it build on msvc
authornotaz <notasas@gmail.com>
Sat, 14 Oct 2017 18:28:24 +0000 (21:28 +0300)
committernotaz <notasas@gmail.com>
Sat, 14 Oct 2017 18:28:24 +0000 (21:28 +0300)
supposedly for the original XBox?

pico/32x/32x.c
pico/32x/draw.c
pico/cd/mcd.c
pico/draw.c
pico/pico_port.h
platform/libretro/libretro.c
platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj
platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters

index b20ebf3..1c166ce 100644 (file)
@@ -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
index f802150..ee541bd 100644 (file)
@@ -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++];
index 043b4a2..af320bd 100644 (file)
@@ -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)
index bb051b6..83010a4 100644 (file)
@@ -1617,7 +1617,7 @@ void PicoDrawSetOutBuf(void *dest, int increment)
 {\r
   DrawLineDestBase = dest;\r
   DrawLineDestIncrement = increment;\r
-  Pico.est.DrawLineDest = DrawLineDestBase + Pico.est.DrawScanline * increment;\r
+  Pico.est.DrawLineDest = (char *)DrawLineDestBase + Pico.est.DrawScanline * increment;\r
 }\r
 \r
 void PicoDrawSetInternalBuf(void *dest, int increment)\r
index f1d95a5..605778d 100644 (file)
 #define ALIGNED(n)
 #endif
 
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
+#define strdup _strdup
+#endif
+
 #endif // PICO_PORT_INCLUDED
index e7f588a..7896ffb 100644 (file)
@@ -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) {
index 4b8784a..e9bde07 100644 (file)
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);INLINE=_inline;_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;NO_ZLIB;FAMEC_NO_GOTOS</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;FAMEC_NO_GOTOS</PreprocessorDefinitions>\r
       <CompileAs>CompileAsC</CompileAs>\r
-      <AdditionalIncludeDirectories>$(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;$(SolutionDIr)\..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <DisableSpecificWarnings>4018;4090;4101;4146;4244</DisableSpecificWarnings>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
       <Optimization>MaxSpeed</Optimization>\r
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);INLINE=_inline;_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;NO_ZLIB;FAMEC_NO_GOTOS</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;FAMEC_NO_GOTOS</PreprocessorDefinitions>\r
       <CompileAs>CompileAsC</CompileAs>\r
-      <AdditionalIncludeDirectories>$(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;$(SolutionDIr)\..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <DisableSpecificWarnings>4018;4090;4101;4146;4244</DisableSpecificWarnings>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
     <ClCompile Include="..\..\..\..\cpu\sh2\mame\sh2pico.c" />\r
     <ClCompile Include="..\..\..\..\cpu\sh2\sh2.c" />\r
     <ClCompile Include="..\..\..\..\pico\32x\32x.c" />\r
-    <ClCompile Include="..\..\..\..\pico\32x\32x_draw.c" />\r
-    <ClCompile Include="..\..\..\..\pico\32x\32x_memory.c" />\r
+    <ClCompile Include="..\..\..\..\pico\32x\draw.c">\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\32x\</ObjectFileName>\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\32x\</ObjectFileName>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\..\pico\32x\memory.c">\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\32x\</ObjectFileName>\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\32x\</ObjectFileName>\r
+    </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\32x\pwm.c" />\r
     <ClCompile Include="..\..\..\..\pico\32x\sh2soc.c" />\r
     <ClCompile Include="..\..\..\..\pico\cart.c" />\r
     <ClCompile Include="..\..\..\..\pico\carthw\carthw.c" />\r
-    <ClCompile Include="..\..\..\..\pico\carthw\svp\svp_memory.c" />\r
+    <ClCompile Include="..\..\..\..\pico\carthw\eeprom_spi.c" />\r
+    <ClCompile Include="..\..\..\..\pico\carthw\svp\memory.c">\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\svp\</ObjectFileName>\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\svp\</ObjectFileName>\r
+    </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\carthw\svp\ssp16.c" />\r
     <ClCompile Include="..\..\..\..\pico\carthw\svp\svp.c" />\r
     <ClCompile Include="..\..\..\..\pico\carthw_cfg.c" />\r
     <ClCompile Include="..\..\..\..\pico\cd\gfx.c" />\r
     <ClCompile Include="..\..\..\..\pico\cd\gfx_dma.c" />\r
     <ClCompile Include="..\..\..\..\pico\cd\mcd.c" />\r
-    <ClCompile Include="..\..\..\..\pico\cd\cd_memory.c" />\r
-    <ClCompile Include="..\..\..\..\pico\cd\cd_misc.c" />\r
+    <ClCompile Include="..\..\..\..\pico\cd\memory.c">\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\cd\</ObjectFileName>\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\cd\</ObjectFileName>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\..\pico\cd\misc.c">\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\cd\</ObjectFileName>\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\cd\</ObjectFileName>\r
+    </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\cd\pcm.c" />\r
-    <ClCompile Include="..\..\..\..\pico\cd\cd_sek.c" />\r
+    <ClCompile Include="..\..\..\..\pico\cd\sek.c">\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\cd\</ObjectFileName>\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\cd\</ObjectFileName>\r
+    </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\debug.c" />\r
     <ClCompile Include="..\..\..\..\pico\draw.c" />\r
     <ClCompile Include="..\..\..\..\pico\draw2.c" />\r
     <ClCompile Include="..\..\..\..\pico\mode4.c" />\r
     <ClCompile Include="..\..\..\..\pico\patch.c" />\r
     <ClCompile Include="..\..\..\..\pico\pico.c" />\r
-    <ClCompile Include="..\..\..\..\pico\pico\pico_memory.c" />\r
-    <ClCompile Include="..\..\..\..\pico\pico\pico_pico.c" />\r
+    <ClCompile Include="..\..\..\..\pico\pico\memory.c">\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\pico\</ObjectFileName>\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\pico\</ObjectFileName>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\..\pico\pico\pico.c">\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\pico\</ObjectFileName>\r
+      <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\pico\</ObjectFileName>\r
+    </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\pico\xpcm.c" />\r
     <ClCompile Include="..\..\..\..\pico\sek.c" />\r
     <ClCompile Include="..\..\..\..\pico\sms.c" />\r
     <ClCompile Include="..\..\..\..\pico\videoport.c" />\r
     <ClCompile Include="..\..\..\..\pico\z80if.c" />\r
     <ClCompile Include="..\..\..\..\unzip\unzip.c" />\r
-    <ClCompile Include="..\..\..\..\unzip\unzip_stream.c" />\r
     <ClCompile Include="..\..\..\..\zlib\adler32.c" />\r
     <ClCompile Include="..\..\..\..\zlib\compress.c" />\r
     <ClCompile Include="..\..\..\..\zlib\crc32.c" />\r
index 1a70e49..a1c0e0f 100644 (file)
     <ClCompile Include="..\..\..\..\unzip\unzip.c">\r
       <Filter>Source Files\unzip</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\..\unzip\unzip_stream.c">\r
-      <Filter>Source Files\unzip</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\cart.c">\r
       <Filter>Source Files\pico</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\cd\mcd.c">\r
       <Filter>Source Files\pico\cd</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\..\pico\cd\cd_memory.c">\r
+    <ClCompile Include="..\..\..\..\pico\cd\memory.c">\r
       <Filter>Source Files\pico\cd</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\..\pico\cd\cd_misc.c">\r
+    <ClCompile Include="..\..\..\..\pico\cd\misc.c">\r
       <Filter>Source Files\pico\cd</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\cd\pcm.c">\r
       <Filter>Source Files\pico\cd</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\..\pico\cd\cd_sek.c">\r
+    <ClCompile Include="..\..\..\..\pico\cd\sek.c">\r
       <Filter>Source Files\pico\cd</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\32x\32x.c">\r
       <Filter>Source Files\pico\32x</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\..\pico\32x\32x_memory.c">\r
+    <ClCompile Include="..\..\..\..\pico\32x\memory.c">\r
       <Filter>Source Files\pico\32x</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\32x\pwm.c">\r
     <ClCompile Include="..\..\..\..\pico\carthw\carthw.c">\r
       <Filter>Source Files\pico\carthw</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\..\pico\carthw\svp\svp_memory.c">\r
+    <ClCompile Include="..\..\..\..\pico\carthw\eeprom_spi.c">\r
+      <Filter>Source Files\pico\carthw</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\..\pico\carthw\svp\memory.c">\r
       <Filter>Source Files\pico\carthw\svp</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\..\pico\carthw\svp\ssp16.c">\r
     <ClCompile Include="..\..\..\..\cpu\sh2\mame\sh2pico.c">\r
       <Filter>Source Files\cpu\sh2\mame</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\..\pico\32x\32x_draw.c">\r
-      <Filter>Source Files</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\..\..\..\pico\pico\pico_memory.c">\r
+    <ClCompile Include="..\..\..\..\pico\pico\xpcm.c">\r
       <Filter>Source Files\pico\pico</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\..\pico\pico\pico_pico.c">\r
+    <ClCompile Include="..\..\..\..\pico\pico\pico.c">\r
       <Filter>Source Files\pico\pico</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\..\pico\pico\xpcm.c">\r
+    <ClCompile Include="..\..\..\..\pico\pico\memory.c">\r
       <Filter>Source Files\pico\pico</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\..\pico\32x\draw.c">\r
+      <Filter>Source Files\pico\32x</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
 </Project>
\ No newline at end of file