From: Twinaphex Date: Mon, 17 Mar 2014 17:15:55 +0000 (+0100) Subject: (MSVC) Compatibility fixes X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed06ffd3391ff81fa1f34455f1311ba060a41cac;p=picodrive.git (MSVC) Compatibility fixes --- diff --git a/cpu/drc/cmn.c b/cpu/drc/cmn.c index 37f17ce9..a07dcbdd 100644 --- a/cpu/drc/cmn.c +++ b/cpu/drc/cmn.c @@ -10,7 +10,11 @@ #include #include "cmn.h" +#ifdef _MSC_VER +u8 tcache[DRC_TCACHE_SIZE]; +#else u8 __attribute__((aligned(4096))) tcache[DRC_TCACHE_SIZE]; +#endif void drc_cmn_init(void) diff --git a/pico/32x/32x.c b/pico/32x/32x.c index ddb95eca..14d1c847 100644 --- a/pico/32x/32x.c +++ b/pico/32x/32x.c @@ -294,9 +294,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, + fillend_event, + hint_event, }; // schedule event at some time 'after', in m68k clocks diff --git a/pico/32x/draw.c b/pico/32x/draw.c index 66f67a7e..ff07ef2a 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 = DrawLineDest + poffs; + dst = (unsigned short*)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 687dfc3c..73502b28 100644 --- a/pico/cd/mcd.c +++ b/pico/cd/mcd.c @@ -30,9 +30,10 @@ 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 +201,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_int3_timer_event, + gfx_update, + pcd_dma_event, }; void pcd_event_schedule(unsigned int now, enum pcd_event event, int after) diff --git a/pico/draw.c b/pico/draw.c index a03d8873..dbd63631 100644 --- a/pico/draw.c +++ b/pico/draw.c @@ -1568,7 +1568,7 @@ void PicoDrawSetOutBuf(void *dest, int increment) { DrawLineDestBase = dest; DrawLineDestIncrement = increment; - DrawLineDest = DrawLineDestBase + DrawScanline * increment; + DrawLineDest = (unsigned char*)DrawLineDestBase + DrawScanline * increment; } void PicoDrawSetInternalBuf(void *dest, int increment) diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 7b35c870..662254e2 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -42,7 +42,11 @@ static retro_audio_sample_batch_t audio_batch_cb; static void *vout_buf; static int vout_width, vout_height, vout_offset; +#ifdef _MSC_VER +static short sndBuffer[2*44100/50]; +#else static short __attribute__((aligned(4))) sndBuffer[2*44100/50]; +#endif static void snd_write(int len); @@ -109,6 +113,11 @@ void cache_flush_d_inval_i(void *start, void *end) static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) { + uint32_t flProtect, dwDesiredAccess; + off_t end; + HANDLE mmap_fd, h; + void *ret; + if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) return MAP_FAILED; if (fd == -1) { @@ -117,7 +126,6 @@ static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t } else if (flags & MAP_ANON) return MAP_FAILED; - DWORD flProtect; if (prot & PROT_WRITE) { if (prot & PROT_EXEC) flProtect = PAGE_EXECUTE_READWRITE; @@ -131,8 +139,8 @@ static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t } else flProtect = PAGE_READONLY; - off_t end = length + offset; - HANDLE mmap_fd, h; + end = length + offset; + if (fd == -1) mmap_fd = INVALID_HANDLE_VALUE; else @@ -141,7 +149,6 @@ static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t if (h == NULL) return MAP_FAILED; - DWORD dwDesiredAccess; if (prot & PROT_WRITE) dwDesiredAccess = FILE_MAP_WRITE; else @@ -150,7 +157,7 @@ static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t dwDesiredAccess |= FILE_MAP_EXECUTE; if (flags & MAP_PRIVATE) dwDesiredAccess |= FILE_MAP_COPY; - void *ret = MapViewOfFile(h, dwDesiredAccess, DWORD_HI(offset), DWORD_LO(offset), length); + ret = MapViewOfFile(h, dwDesiredAccess, DWORD_HI(offset), DWORD_LO(offset), length); if (ret == NULL) { CloseHandle(h); ret = MAP_FAILED; @@ -582,13 +589,13 @@ static bool disk_add_image_index(void) } static struct retro_disk_control_callback disk_control = { - .set_eject_state = disk_set_eject_state, - .get_eject_state = disk_get_eject_state, - .get_image_index = disk_get_image_index, - .set_image_index = disk_set_image_index, - .get_num_images = disk_get_num_images, - .replace_image_index = disk_replace_image_index, - .add_image_index = disk_add_image_index, + disk_set_eject_state, + disk_get_eject_state, + disk_get_image_index, + disk_set_image_index, + disk_get_num_images, + disk_replace_image_index, + disk_add_image_index, }; static void disk_tray_open(void) @@ -792,18 +799,18 @@ void retro_reset(void) } static const unsigned short retro_pico_map[] = { - [RETRO_DEVICE_ID_JOYPAD_B] = 1 << GBTN_B, - [RETRO_DEVICE_ID_JOYPAD_Y] = 1 << GBTN_A, - [RETRO_DEVICE_ID_JOYPAD_SELECT] = 1 << GBTN_MODE, - [RETRO_DEVICE_ID_JOYPAD_START] = 1 << GBTN_START, - [RETRO_DEVICE_ID_JOYPAD_UP] = 1 << GBTN_UP, - [RETRO_DEVICE_ID_JOYPAD_DOWN] = 1 << GBTN_DOWN, - [RETRO_DEVICE_ID_JOYPAD_LEFT] = 1 << GBTN_LEFT, - [RETRO_DEVICE_ID_JOYPAD_RIGHT] = 1 << GBTN_RIGHT, - [RETRO_DEVICE_ID_JOYPAD_A] = 1 << GBTN_C, - [RETRO_DEVICE_ID_JOYPAD_X] = 1 << GBTN_Y, - [RETRO_DEVICE_ID_JOYPAD_L] = 1 << GBTN_X, - [RETRO_DEVICE_ID_JOYPAD_R] = 1 << GBTN_Z, + 1 << GBTN_B, + 1 << GBTN_A, + 1 << GBTN_MODE, + 1 << GBTN_START, + 1 << GBTN_UP, + 1 << GBTN_DOWN, + 1 << GBTN_LEFT, + 1 << GBTN_RIGHT, + 1 << GBTN_C, + 1 << GBTN_Y, + 1 << GBTN_X, + 1 << GBTN_Z, }; #define RETRO_PICO_MAP_LEN (sizeof(retro_pico_map) / sizeof(retro_pico_map[0])) diff --git a/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj b/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj index 81e23ae1..8d3ac9ce 100644 --- a/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj +++ b/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj @@ -49,7 +49,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);INLINE=_inline;_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;NO_ZLIB CompileAsC $(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;%(AdditionalIncludeDirectories) @@ -66,7 +66,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;%(PreprocessorDefinitions);INLINE=_inline;_CRT_SECURE_NO_WARNINGS;EMU_F68K;_USE_CZ80;NO_ZLIB CompileAsC $(SolutionDir)\..\..\..\;$(SolutionDIr)\..\..\..\pico;%(AdditionalIncludeDirectories) @@ -78,6 +78,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters b/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters index 851d90e9..e4a0ccff 100644 --- a/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters +++ b/platform/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters @@ -19,10 +19,247 @@ {56e5d1cc-a749-46f0-9c75-e26037b4e2b3} + + {ab1e9796-fcf3-49c2-92f2-cbce4ad50f7f} + + + {d7cd40e2-d074-4967-84ad-89488a9eed11} + + + {76c63342-13b7-413c-b44b-52ef07b4dccc} + + + {04bd626c-6833-49c7-8256-dc94935efe03} + + + {3b94bd08-c15d-46a4-9672-094f4cafbc06} + + + {403b507e-7278-436e-b8a5-5a0deb70dfae} + + + {27323686-5607-4502-9488-ac65c90e6969} + + + {2e0a2f96-c25d-473e-9456-5e25b6eb8036} + + + {a208ee7f-75c1-4ff9-9ed5-ea2d42832fc6} + + + {04862576-b191-4769-a0f8-bb6400cfa861} + + + {337acc4a-3fe4-4547-b655-058d31318ffc} + + + {63c3bec2-54b1-4831-a420-5e1aa120738b} + + + {85be1810-42b8-4ec7-bbd5-6c7d1dc5b763} + + + {055bac11-1f11-4fe7-be7b-09ebaeab74d5} + + + {dd1911b8-6d08-42aa-ab21-0ba1154613e1} + Source Files\platform\libretro + + Source Files\platform\common + + + Source Files\platform\common + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\zlib + + + Source Files\unzip + + + Source Files\unzip + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico + + + Source Files\pico\cd + + + Source Files\pico\cd + + + Source Files\pico\cd + + + Source Files\pico\cd + + + Source Files\pico\cd + + + Source Files\pico\cd + + + Source Files\pico\cd + + + 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 + + + Source Files\pico\32x + + + Source Files\pico\32x + + + Source Files\pico\32x + + + Source Files\pico\carthw + + + Source Files\pico\carthw\svp + + + Source Files\pico\carthw\svp + + + Source Files\pico\carthw\svp + + + Source Files\pico\sound + + + Source Files\pico\sound + + + Source Files\pico\sound + + + Source Files\pico\sound + + + Source Files\cpu\famec + + + Source Files\cpu\cz80 + + + Source Files\cpu\drc + + + Source Files\cpu\sh2 + + + Source Files\cpu\sh2\mame + \ No newline at end of file