VS compatibility edits

This commit is contained in:
Alberto Fustinoni 2017-03-21 10:52:23 +09:00
parent e24e0a6291
commit fb7a085994
6 changed files with 21 additions and 7 deletions

View File

@ -46,4 +46,11 @@
#define INLINE static __inline__ #define INLINE static __inline__
#endif /* INLINE */ #endif /* INLINE */
/* Alignment macros for cross compiler compatibility */
#if defined(_MSC_VER)
#define ALIGNED_(x) __declspec(align(x))
#elif defined(__GNUC__)
#define ALIGNED_(x) __attribute__ ((aligned(x)))
#endif
#endif /* _MACROS_H_ */ #endif /* _MACROS_H_ */

View File

@ -54,10 +54,10 @@
} }
/* VDP context */ /* VDP context */
uint8 sat[0x400] __attribute__((aligned(4))); /* Internal copy of sprite attribute table */ uint8 ALIGNED_(4) sat[0x400]; /* Internal copy of sprite attribute table */
uint8 vram[0x10000] __attribute__((aligned(4))); /* Video RAM (64K x 8-bit) */ uint8 ALIGNED_(4) vram[0x10000]; /* Video RAM (64K x 8-bit) */
uint8 cram[0x80] __attribute__((aligned(4))); /* On-chip color RAM (64 x 9-bit) */ uint8 ALIGNED_(4) cram[0x80]; /* On-chip color RAM (64 x 9-bit) */
uint8 vsram[0x80] __attribute__((aligned(4))); /* On-chip vertical scroll RAM (40 x 11-bit) */ uint8 ALIGNED_(4) vsram[0x80]; /* On-chip vertical scroll RAM (40 x 11-bit) */
uint8 reg[0x20]; /* Internal VDP registers (23 x 8-bit) */ uint8 reg[0x20]; /* Internal VDP registers (23 x 8-bit) */
uint8 hint_pending; /* 0= Line interrupt is pending */ uint8 hint_pending; /* 0= Line interrupt is pending */
uint8 vint_pending; /* 1= Frame interrupt is pending */ uint8 vint_pending; /* 1= Frame interrupt is pending */

View File

@ -553,7 +553,7 @@ static const uint32 tms_palette[16] =
#endif #endif
/* Cached and flipped patterns */ /* Cached and flipped patterns */
static uint8 bg_pattern_cache[0x80000] __attribute__((aligned(4))); static uint8 ALIGNED_(4) bg_pattern_cache[0x80000];
/* Sprite pattern name offset look-up table (Mode 5) */ /* Sprite pattern name offset look-up table (Mode 5) */
static uint8 name_lut[0x400]; static uint8 name_lut[0x400];

View File

@ -1,4 +1,4 @@
LIBRARY "msvc-2010" LIBRARY "msvc-2017"
EXPORTS EXPORTS
retro_set_environment retro_set_environment
retro_set_video_refresh retro_set_video_refresh

View File

@ -30,6 +30,7 @@
<ClCompile Include="..\..\..\core\genesis.c" /> <ClCompile Include="..\..\..\core\genesis.c" />
<ClCompile Include="..\..\..\core\input_hw\activator.c" /> <ClCompile Include="..\..\..\core\input_hw\activator.c" />
<ClCompile Include="..\..\..\core\input_hw\gamepad.c" /> <ClCompile Include="..\..\..\core\input_hw\gamepad.c" />
<ClCompile Include="..\..\..\core\input_hw\graphic_board.c" />
<ClCompile Include="..\..\..\core\input_hw\input.c" /> <ClCompile Include="..\..\..\core\input_hw\input.c" />
<ClCompile Include="..\..\..\core\input_hw\lightgun.c" /> <ClCompile Include="..\..\..\core\input_hw\lightgun.c" />
<ClCompile Include="..\..\..\core\input_hw\mouse.c" /> <ClCompile Include="..\..\..\core\input_hw\mouse.c" />
@ -37,7 +38,7 @@
<ClCompile Include="..\..\..\core\input_hw\sportspad.c" /> <ClCompile Include="..\..\..\core\input_hw\sportspad.c" />
<ClCompile Include="..\..\..\core\input_hw\teamplayer.c" /> <ClCompile Include="..\..\..\core\input_hw\teamplayer.c" />
<ClCompile Include="..\..\..\core\input_hw\terebi_oekaki.c" /> <ClCompile Include="..\..\..\core\input_hw\terebi_oekaki.c" />
<ClCompile Include="..\..\..\core\input_hw\xe_a1p.c" /> <ClCompile Include="..\..\..\core\input_hw\xe_1ap.c" />
<ClCompile Include="..\..\..\core\io_ctrl.c" /> <ClCompile Include="..\..\..\core\io_ctrl.c" />
<ClCompile Include="..\..\..\core\loadrom.c" /> <ClCompile Include="..\..\..\core\loadrom.c" />
<ClCompile Include="..\..\..\core\m68k\m68kcpu.c" /> <ClCompile Include="..\..\..\core\m68k\m68kcpu.c" />

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
</Project>