Browse Source

fixed some portability issues

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@336 be3aeb3a-fb24-0410-a615-afba39da0efa
notaz 16 years ago
parent
commit
dca310c413
8 changed files with 24 additions and 13 deletions
  1. 1 1
      Pico/Draw.c
  2. 2 0
      Pico/Memory.c
  3. 13 5
      Pico/PicoInt.h
  4. 0 3
      Pico/cd/LC89510.c
  5. 7 1
      Pico/cd/Memory.c
  6. 0 1
      Pico/cd/cd_file.c
  7. 0 1
      Pico/cd/cd_sys.c
  8. 1 1
      Pico/sound/ym2612.c

+ 1 - 1
Pico/Draw.c

@@ -610,8 +610,8 @@ static void DrawTilesFromCacheShPrep(void)
   {
     // as some layer has covered whole line with hi priority tiles,
     // we can process whole line and then act as if sh/hi mode was off.
-    rendstatus|=0x80;
     int c = 320/4, *zb = (int *)(HighCol+8);
+    rendstatus|=0x80;
     while (c--)
     {
       int tmp = *zb;

+ 2 - 0
Pico/Memory.c

@@ -37,6 +37,8 @@ extern unsigned int ppop;
 
 #ifdef IO_STATS
 void log_io(unsigned int addr, int bits, int rw);
+#elif defined(_MSC_VER)
+#define log_io
 #else
 #define log_io(...)
 #endif

+ 13 - 5
Pico/PicoInt.h

@@ -169,7 +169,7 @@ extern int SekCycleAimS68k;
 // ----------------------- Z80 CPU -----------------------
 
 #if defined(_USE_MZ80)
-#include "../../cpu/mz80/mz80.h"
+#include "../cpu/mz80/mz80.h"
 
 #define z80_run(cycles)    mz80_run(cycles)
 #define z80_run_nr(cycles) mz80_run(cycles)
@@ -177,7 +177,7 @@ extern int SekCycleAimS68k;
 #define z80_resetCycles()  mz80GetElapsedTicks(1)
 
 #elif defined(_USE_DRZ80)
-#include "../../cpu/DrZ80/drz80.h"
+#include "../cpu/DrZ80/drz80.h"
 
 extern struct DrZ80 drZ80;
 
@@ -190,7 +190,7 @@ extern struct DrZ80 drZ80;
 #define z80_resetCycles()
 
 #elif defined(_USE_CZ80)
-#include "../../cpu/cz80/cz80.h"
+#include "../cpu/cz80/cz80.h"
 
 #define z80_run(cycles)    Cz80_Exec(&CZ80, cycles)
 #define z80_run_nr(cycles) Cz80_Exec(&CZ80, cycles)
@@ -335,10 +335,10 @@ typedef struct
 	union {						// 0a0000: 256K
 		struct {
 			unsigned char word_ram2M[0x40000];
-			unsigned char unused[0x20000];
+			unsigned char unused0[0x20000];
 		};
 		struct {
-			unsigned char unused[0x20000];
+			unsigned char unused1[0x20000];
 			unsigned char word_ram1M[2][0x20000];
 		};
 	};
@@ -503,9 +503,17 @@ extern void lprintf(const char *fmt, ...);
 	if ((w) & EL_LOGMASK) \
 		lprintf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__); \
 }
+#elif defined(_MSC_VER)
+#define elprintf
 #else
 #define elprintf(w,f,...)
 #endif
 
+#ifdef _MSC_VER
+#define cdprintf
+#else
+#define cdprintf(x...)
+#endif
+
 #endif // PICO_INTERNAL_INCLUDED
 

+ 0 - 3
Pico/cd/LC89510.c

@@ -9,9 +9,6 @@
 
 #include "../PicoInt.h"
 
-#define cdprintf(x...)
-
-
 #define CDC_DMA_SPEED 256
 
 

+ 7 - 1
Pico/cd/Memory.c

@@ -18,10 +18,15 @@ typedef unsigned int   u32;
 #define UTYPES_DEFINED
 #endif
 
+#ifdef _MSC_VER
+#define rdprintf
+#define wrdprintf
+#else
 //#define rdprintf dprintf
 #define rdprintf(...)
 //#define wrdprintf dprintf
 #define wrdprintf(...)
+#endif
 
 #ifdef EMU_CORE_DEBUG
 extern u32 lastread_a, lastread_d[16], lastwrite_cyc_d[16];
@@ -1158,11 +1163,12 @@ static u32 PicoReadS68k32(u32 a)
   // word RAM (1M area)
   if ((a&0xfe0000)==0x0c0000 && (Pico_mcd->s68k_regs[3]&4)) { // 0c0000-0dffff
     int bank;
+    u16 *pm;
     wrdprintf("s68k_wram1M r32: [%06x] @%06x", a, SekPcS68k);
 //    if (!(Pico_mcd->s68k_regs[3]&4))
 //      dprintf("s68k_wram1M FIXME: wrong mode");
     bank = (Pico_mcd->s68k_regs[3]&1)^1;
-    u16 *pm=(u16 *)(Pico_mcd->word_ram1M[bank]+(a&0x1fffe)); d = (pm[0]<<16)|pm[1];
+    pm=(u16 *)(Pico_mcd->word_ram1M[bank]+(a&0x1fffe)); d = (pm[0]<<16)|pm[1];
     wrdprintf("ret = %08x", d);
     goto end;
   }

+ 0 - 1
Pico/cd/cd_file.c

@@ -10,7 +10,6 @@
 #include "../PicoInt.h"
 #include "cd_file.h"
 
-#define cdprintf(x...)
 //#define cdprintf(f,...) printf(f "\n",##__VA_ARGS__) // tmp
 #define DEBUG_CD
 

+ 0 - 1
Pico/cd/cd_sys.c

@@ -13,7 +13,6 @@
 #include "cd_sys.h"
 #include "cd_file.h"
 
-#define cdprintf(x...)
 #define DEBUG_CD
 
 #define TRAY_OPEN	0x0500		// TRAY OPEN CDD status

+ 1 - 1
Pico/sound/ym2612.c

@@ -1085,7 +1085,7 @@ static void chan_render_loop(chan_rend_context *ct, int *buffer, int length)
 void chan_render_loop(chan_rend_context *ct, int *buffer, unsigned short length);
 #endif
 
-static chan_rend_context __attribute__((aligned(64))) crct;
+static chan_rend_context crct;
 
 static int chan_render(int *buffer, int length, int c, UINT32 flags) // flags: stereo, ?, disabled, ?, pan_r, pan_l
 {