/* Data definition */\r
/*******************/\r
\r
+#include <pico/pico_types.h>\r
+/*\r
+#ifdef u8\r
+#undef u8\r
+#endif\r
+\r
+#ifdef s8\r
+#undef s8\r
+#endif\r
+\r
+#ifdef u16\r
+#undef u16\r
+#endif\r
+\r
+#ifdef s16\r
+#undef s16\r
+#endif\r
+\r
+#ifdef u32\r
+#undef u32\r
+#endif\r
+\r
+#ifdef s32\r
+#undef s32\r
+#endif\r
+\r
+#ifdef uptr\r
+#undef uptr\r
+#endif\r
+\r
+#define u8 unsigned char\r
+#define s8 signed char\r
+#define u16 unsigned short\r
+#define s16 signed short\r
+#define u32 unsigned int\r
+#define s32 signed int\r
+#define uptr uintptr_t\r
+*/\r
+\r
+/*\r
+typedef unsigned char u8;\r
+typedef signed char s8;\r
+typedef unsigned short u16;\r
+typedef signed short s16;\r
+typedef unsigned int u32;\r
+typedef signed int s32;\r
+*/\r
+\r
typedef union\r
{\r
- unsigned char B;\r
- signed char SB;\r
- unsigned short W;\r
- signed short SW;\r
- unsigned int D;\r
- signed int SD;\r
+ u8 B;\r
+ s8 SB;\r
+ u16 W;\r
+ s16 SW;\r
+ u32 D;\r
+ s32 SD;\r
} famec_union32;\r
\r
/* M68K CPU CONTEXT */\r
int fm68k_emulate(M68K_CONTEXT *ctx, int n, fm68k_call_reason reason);\r
int fm68k_would_interrupt(M68K_CONTEXT *ctx); // to be called from fm68k_emulate()\r
\r
-unsigned int fm68k_get_pc(const M68K_CONTEXT *ctx);\r
+u32 fm68k_get_pc(const M68K_CONTEXT *ctx);\r
\r
// PICODRIVE_HACK\r
int fm68k_idle_install(void);\r
#define FAMEC_EXTRA_INLINE INLINE\r
#endif\r
\r
-#include <pico/pico_types.h>\r
-/*\r
-#ifdef u8\r
-#undef u8\r
-#endif\r
-\r
-#ifdef s8\r
-#undef s8\r
-#endif\r
-\r
-#ifdef u16\r
-#undef u16\r
-#endif\r
-\r
-#ifdef s16\r
-#undef s16\r
-#endif\r
-\r
-#ifdef u32\r
-#undef u32\r
-#endif\r
-\r
-#ifdef s32\r
-#undef s32\r
-#endif\r
-\r
-#ifdef uptr\r
-#undef uptr\r
-#endif\r
-\r
-#define u8 unsigned char\r
-#define s8 signed char\r
-#define u16 unsigned short\r
-#define s16 signed short\r
-#define u32 unsigned int\r
-#define s32 signed int\r
-#define uptr uintptr_t\r
-*/\r
-\r
-/*\r
-typedef unsigned char u8;\r
-typedef signed char s8;\r
-typedef unsigned short u16;\r
-typedef signed short s16;\r
-typedef unsigned int u32;\r
-typedef signed int s32;\r
-*/\r
-\r
#ifndef M68K_OK\r
#define M68K_OK 0\r
#endif\r
// main exec function\r
//////////////////////\r
\r
-int fm68k_emulate(M68K_CONTEXT *ctx, s32 cycles, fm68k_call_reason reason)\r
+int fm68k_emulate(M68K_CONTEXT *ctx, int cycles, fm68k_call_reason reason)\r
{\r
#ifndef FAMEC_NO_GOTOS\r
u32 Opcode;\r
#define SH2_DUMP(sh2, reason) { \
char ms = (sh2)->is_slave ? 's' : 'm'; \
- printf("%csh2 %s %08x\n", ms, reason, (sh2)->pc); \
- printf("%csh2 r0-7 %08x %08x %08x %08x %08x %08x %08x %08x\n", ms, \
- (sh2)->r[0], (sh2)->r[1], (sh2)->r[2], (sh2)->r[3], \
- (sh2)->r[4], (sh2)->r[5], (sh2)->r[6], (sh2)->r[7]); \
- printf("%csh2 r8-15 %08x %08x %08x %08x %08x %08x %08x %08x\n", ms, \
- (sh2)->r[8], (sh2)->r[9], (sh2)->r[10], (sh2)->r[11], \
- (sh2)->r[12], (sh2)->r[13], (sh2)->r[14], (sh2)->r[15]); \
- printf("%csh2 pc-ml %08x %08x %08x %08x %08x %08x %08x %08x\n", ms, \
- (sh2)->pc, (sh2)->ppc, (sh2)->pr, (sh2)->sr&0xfff, \
- (sh2)->gbr, (sh2)->vbr, (sh2)->mach, (sh2)->macl); \
- printf("%csh2 tmp-p %08x %08x %08x %08x %08x %08x %08x %08x\n", ms, \
+ printf("%csh2 %s %08lx\n", ms, reason, (ulong)(sh2)->pc); \
+ printf("%csh2 r0-7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", ms, \
+ (ulong)(sh2)->r[0], (ulong)(sh2)->r[1], (ulong)(sh2)->r[2], (ulong)(sh2)->r[3], \
+ (ulong)(sh2)->r[4], (ulong)(sh2)->r[5], (ulong)(sh2)->r[6], (ulong)(sh2)->r[7]); \
+ printf("%csh2 r8-15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", ms, \
+ (ulong)(sh2)->r[8], (ulong)(sh2)->r[9], (ulong)(sh2)->r[10], (ulong)(sh2)->r[11], \
+ (ulong)(sh2)->r[12], (ulong)(sh2)->r[13], (ulong)(sh2)->r[14], (ulong)(sh2)->r[15]); \
+ printf("%csh2 pc-ml %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", ms, \
+ (ulong)(sh2)->pc, (ulong)(sh2)->ppc, (ulong)(sh2)->pr, (ulong)(sh2)->sr&0xfff, \
+ (ulong)(sh2)->gbr, (ulong)(sh2)->vbr, (ulong)(sh2)->mach, (ulong)(sh2)->macl); \
+ printf("%csh2 tmp-p %08x %08x %08x %08x %08x %08lx %08x %08x\n", ms, \
(sh2)->drc_tmp, (sh2)->irq_cycles, \
(sh2)->pdb_io_csum[0], (sh2)->pdb_io_csum[1], (sh2)->state, \
- (sh2)->poll_addr, (sh2)->poll_cycles, (sh2)->poll_cnt); \
+ (ulong)(sh2)->poll_addr, (sh2)->poll_cycles, (sh2)->poll_cnt); \
}
#if (DRC_DEBUG & (8|256|512|1024)) || defined(PDB)
char *ps = (char *)sh2, *pf = (char *)&fsh2;
for (idx = 0; idx < offsetof(SH2, read8_map); idx += sizeof(u32))
if (*(u32 *)(ps+idx) != *(u32 *)(pf+idx))
- printf("diff reg %ld\n",idx/sizeof(u32));
+ printf("diff reg %ld\n",(long)idx/sizeof(u32));
exit(1);
}
csh2[idx][0] = fsh2;
#if (DRC_DEBUG & 2)
if (be->next != NULL) {
- printf(" %08x@%p: entry hash collision with %08x@%p\n",
- be->pc, be->tcache_ptr, be->next->pc, be->next->tcache_ptr);
+ printf(" %08lx@%p: entry hash collision with %08lx@%p\n",
+ (ulong)be->pc, be->tcache_ptr, (ulong)be->next->pc, be->next->tcache_ptr);
hash_collisions++;
}
#endif
for (i = 0; i < ARRAY_SIZE(cache_regs); i++) { \
cp = &cache_regs[i]; \
if (cp->type != HR_FREE || cp->gregs || cp->locked || cp->flags) \
- printf(" %d: hr=%d t=%d f=%x c=%d m=%x\n", i, cp->hreg, cp->type, cp->flags, cp->locked, cp->gregs); \
+ printf(" %d: hr=%d t=%d f=%x c=%d m=%lx\n", i, cp->hreg, cp->type, cp->flags, cp->locked, (ulong)cp->gregs); \
} \
printf(" guest_regs:\n"); \
for (i = 0; i < ARRAY_SIZE(guest_regs); i++) { \
printf(" gconsts:\n"); \
for (i = 0; i < ARRAY_SIZE(gconsts); i++) { \
if (gconsts[i].gregs) \
- printf(" %d: m=%x v=%x\n", i, gconsts[i].gregs, gconsts[i].val); \
+ printf(" %d: m=%lx v=%lx\n", i, (ulong)gconsts[i].gregs, (ulong)gconsts[i].val); \
} \
}
else tmp3 = '*';
} else if (drcf.loop_type) tmp3 = '.';
else tmp3 = ' ';
- printf("%c%08x %04x %s\n", tmp3, pc, op, sh2dasm_buff);
+ printf("%c%08lx %04x %s\n", tmp3, (ulong)pc, op, sh2dasm_buff);
#endif
pc += 2;
}
if (maxb == NULL)
break;
- printf("%08x %p %9d %2.3f%%\n", maxb->addr, maxb->tcache_ptr, maxb->refcount,
+ printf("%08lx %p %9d %2.3f%%\n", (ulong)maxb->addr, maxb->tcache_ptr, maxb->refcount,
(double)maxb->refcount / total * 100.0);
maxb->refcount = 0;
}
}
if (maxb == NULL)
break;
- printf("%08x %p %9d %2.3f%%\n", maxb->pc, maxb->tcache_ptr, maxb->entry_count,
+ printf("%08lx %p %9d %2.3f%%\n", (ulong)maxb->pc, maxb->tcache_ptr, maxb->entry_count,
(double)100 * maxb->entry_count / total);
maxb->entry_count = 0;
}
int i;
SH2_DUMP(&sh2s[0], "master");
- printf("VBR msh2: %x\n", sh2s[0].vbr);
+ printf("VBR msh2: %lx\n", (ulong)sh2s[0].vbr);
for (i = 0; i < 0x60; i++) {
- printf("%08x ",p32x_sh2_read32(sh2s[0].vbr + i*4, &sh2s[0]));
+ printf("%08lx ",(ulong)p32x_sh2_read32(sh2s[0].vbr + i*4, &sh2s[0]));
if ((i+1) % 8 == 0) printf("\n");
}
- printf("stack msh2: %x\n", sh2s[0].r[15]);
+ printf("stack msh2: %lx\n", (ulong)sh2s[0].r[15]);
for (i = -0x30; i < 0x30; i++) {
- printf("%08x ",p32x_sh2_read32(sh2s[0].r[15] + i*4, &sh2s[0]));
+ printf("%08lx ",(ulong)p32x_sh2_read32(sh2s[0].r[15] + i*4, &sh2s[0]));
if ((i+1) % 8 == 0) printf("\n");
}
SH2_DUMP(&sh2s[1], "slave");
- printf("VBR ssh2: %x\n", sh2s[1].vbr);
+ printf("VBR ssh2: %lx\n", (ulong)sh2s[1].vbr);
for (i = 0; i < 0x60; i++) {
- printf("%08x ",p32x_sh2_read32(sh2s[1].vbr + i*4, &sh2s[1]));
+ printf("%08lx ",(ulong)p32x_sh2_read32(sh2s[1].vbr + i*4, &sh2s[1]));
if ((i+1) % 8 == 0) printf("\n");
}
- printf("stack ssh2: %x\n", sh2s[1].r[15]);
+ printf("stack ssh2: %lx\n", (ulong)sh2s[1].r[15]);
for (i = -0x30; i < 0x30; i++) {
- printf("%08x ",p32x_sh2_read32(sh2s[1].r[15] + i*4, &sh2s[1]));
+ printf("%08lx ",(ulong)p32x_sh2_read32(sh2s[1].r[15] + i*4, &sh2s[1]));
if ((i+1) % 8 == 0) printf("\n");
}
#endif
printf("return cache hits:%d misses:%d depth: %d index: %d/%d\n", rchit, rcmiss, i,sh2s[0].rts_cache_idx,sh2s[1].rts_cache_idx);
for (i = 0; i < ARRAY_SIZE(sh2s[0].rts_cache); i++) {
- printf("%08x ",sh2s[0].rts_cache[i].pc);
+ printf("%08lx ",(ulong)sh2s[0].rts_cache[i].pc);
if ((i+1) % 8 == 0) printf("\n");
}
for (i = 0; i < ARRAY_SIZE(sh2s[1].rts_cache); i++) {
- printf("%08x ",sh2s[1].rts_cache[i].pc);
+ printf("%08lx ",(ulong)sh2s[1].rts_cache[i].pc);
if ((i+1) % 8 == 0) printf("\n");
}
#endif
printf("branch cache hits:%d misses:%d\n", bchit, bcmiss);
printf("branch cache master:\n");
for (i = 0; i < ARRAY_SIZE(sh2s[0].branch_cache); i++) {
- printf("%08x ",sh2s[0].branch_cache[i].pc);
+ printf("%08lx ",(ulong)sh2s[0].branch_cache[i].pc);
if ((i+1) % 8 == 0) printf("\n");
}
printf("branch cache slave:\n");
for (i = 0; i < ARRAY_SIZE(sh2s[1].branch_cache); i++) {
- printf("%08x ",sh2s[1].branch_cache[i].pc);
+ printf("%08lx ",(ulong)sh2s[1].branch_cache[i].pc);
if ((i+1) % 8 == 0) printf("\n");
}
#endif
}
-static int PicoSVPDma(u32 source, int len, unsigned short **base, unsigned int *mask)
+static int PicoSVPDma(u32 source, int len, unsigned short **base, u32 *mask)
{
if (source < Pico.romsize) // Rom
{
#endif\r
#ifdef EMU_F68K\r
// s68k\r
- PicoCpuFS68k.read_byte = s68k_read8;\r
- PicoCpuFS68k.read_word = s68k_read16;\r
- PicoCpuFS68k.read_long = s68k_read32;\r
- PicoCpuFS68k.write_byte = s68k_write8;\r
- PicoCpuFS68k.write_word = s68k_write16;\r
- PicoCpuFS68k.write_long = s68k_write32;\r
+ PicoCpuFS68k.read_byte = (void *)s68k_read8;\r
+ PicoCpuFS68k.read_word = (void *)s68k_read16;\r
+ PicoCpuFS68k.read_long = (void *)s68k_read32;\r
+ PicoCpuFS68k.write_byte = (void *)s68k_write8;\r
+ PicoCpuFS68k.write_word = (void *)s68k_write16;\r
+ PicoCpuFS68k.write_long = (void *)s68k_write32;\r
\r
// setup FAME fetchmap\r
{\r
r = (reg[5]<<9)+(reg[6]<<11);
sprintf(dstrp, "sprite #0: %04x %04x %04x %04x\n",PicoMem.vram[r/2],PicoMem.vram[r/2+1],PicoMem.vram[r/2+2],PicoMem.vram[r/2+3]); MVP;
sprintf(dstrp, "pal: %i, hw: %02x, frame#: %i, cycles: %u\n", Pico.m.pal, Pico.m.hardware, Pico.m.frame_count, SekCyclesDone()); MVP;
- sprintf(dstrp, "M68k: PC: %06x, SR: %04x, irql: %i\n", SekPc, SekSr, SekIrqLevel); MVP;
+ sprintf(dstrp, "M68k: PC: %06lx, SR: %04x, irql: %i\n", (ulong)SekPc, SekSr, SekIrqLevel); MVP;
for (r = 0; r < 8; r++) {
- sprintf(dstrp, "d%i=%08x, a%i=%08x\n", r, SekDar(r), r, SekDar(r+8)); MVP;
+ sprintf(dstrp, "d%i=%08lx, a%i=%08lx\n", r, (ulong)SekDar(r), r, (ulong)SekDar(r+8)); MVP;
}
sprintf(dstrp, "z80Run: %i, z80_reset: %i, z80_bnk: %06x\n", Pico.m.z80Run, Pico.m.z80_reset, Pico.m.z80_bank68k<<15); MVP;
z80_debug(dstrp); MVP;
i*2, r[i+0], r[i+1], r[i+2], r[i+3], r[i+4], r[i+5], r[i+6], r[i+7]); MVP;
sprintf(dstrp, " mSH2 sSH2\n"); MVP;
- sprintf(dstrp, "PC,SR %08x, %03x %08x, %03x\n", sh2_pc(&msh2), sh2_sr(0), sh2_pc(&ssh2), sh2_sr(1)); MVP;
+ sprintf(dstrp, "PC,SR %08lx, %03x %08lx, %03x\n", (ulong)sh2_pc(&msh2), (uint)sh2_sr(0), (ulong)sh2_pc(&ssh2), (uint)sh2_sr(1)); MVP;
for (i = 0; i < 16/2; i++) {
- sprintf(dstrp, "R%d,%2d %08x,%08x %08x,%08x\n", i, i + 8,
- sh2_reg(0,i), sh2_reg(0,i+8), sh2_reg(1,i), sh2_reg(1,i+8)); MVP;
+ sprintf(dstrp, "R%d,%2d %08lx,%08lx %08lx,%08lx\n", i, i + 8,
+ (ulong)sh2_reg(0,i), (ulong)sh2_reg(0,i+8), (ulong)sh2_reg(1,i), (ulong)sh2_reg(1,i+8)); MVP;
}
- sprintf(dstrp, "gb,vb %08x,%08x %08x,%08x\n", sh2_gbr(0), sh2_vbr(0), sh2_gbr(1), sh2_vbr(1)); MVP;
+ sprintf(dstrp, "gb,vb %08lx,%08lx %08lx,%08lx\n", (ulong)sh2_gbr(0), (ulong)sh2_vbr(0), (ulong)sh2_gbr(1), (ulong)sh2_vbr(1)); MVP;
sprintf(dstrp, "IRQs/mask: %02x/%02x %02x/%02x\n",
Pico32x.sh2irqi[0], Pico32x.sh2irq_mask[0], Pico32x.sh2irqi[1], Pico32x.sh2irq_mask[1]); MVP;
#else
unsigned char *pd = Pico.est.HighCol;\r
u32 *hc = ts->hc;\r
int tilex, dx, ty, cells;\r
- int oldcode = -1, blank = -1; // The tile we know is blank\r
- unsigned int pal = 0, pack = 0, sh;\r
+ u32 pack = 0, oldcode = -1, blank = -1; // The tile we know is blank\r
+ unsigned int pal = 0, sh;\r
\r
// Draw tiles across screen:\r
sh = (lflags & LF_SH) << 6; // shadow\r
}\r
\r
if (code & 0x8000) { // (un-forced) high priority tile\r
- int cval = code | (dx<<16) | (ty<<25);\r
- if (code & 0x1000) cval ^= 0xe<<25;\r
- *hc++ = cval, *hc++ = pack; // cache it\r
+ code |= (dx<<16) | (ty<<25);\r
+ if (code & 0x1000) code ^= 0xe<<25;\r
+ *hc++ = code, *hc++ = pack; // cache it\r
} else if (code != blank) {\r
if (code & 0x0800) TileFlip(pd + dx, pack, pal);\r
else TileNorm(pd + dx, pack, pal);\r
unsigned char *pd = Pico.est.HighCol;\r
u32 *hc = ts->hc;\r
int tilex, dx, ty = 0, addr = 0, cell = 0, nametabadd = 0;\r
- int oldcode = -1, blank = -1; // The tile we know is blank\r
+ u32 oldcode = -1, blank = -1; // The tile we know is blank\r
unsigned int pal = 0, scan = Pico.est.DrawScanline, sh, plane;\r
\r
// Draw tiles across screen:\r
\r
code= PicoMem.vram[ts->nametab + nametabadd + (tilex & ts->xmask)];\r
// code &= ~force; // forced always draw everything\r
- code |= ty<<16; // add ty since that can change pixel row for every 2nd tile\r
+ code |= ty<<25; // add ty since that can change pixel row for every 2nd tile\r
\r
if (code == blank && !((code & 0x8000) && sh))\r
continue;\r
blank = code;\r
\r
if (code & 0x8000) { // (un-forced) high priority tile\r
- int cval = (u16)code | (dx<<16) | (ty<<25);\r
- if (code & 0x1000) cval ^= 0xe<<25;\r
- *hc++ = cval, *hc++ = pack; // cache it\r
+ code |= (dx<<16);\r
+ if (code & 0x1000) code ^= 0xe<<25;\r
+ *hc++ = code, *hc++ = pack; // cache it\r
} else if (code != blank) {\r
if (code & 0x0800) TileFlip(pd + dx, pack, pal);\r
else TileNorm(pd + dx, pack, pal);\r
unsigned char *pd = Pico.est.HighCol;\r
u32 *hc = ts->hc;\r
int tilex = 0, dx = 0, ty = 0, cells;\r
- int oldcode = -1, blank = -1; // The tile we know is blank\r
+ u32 oldcode = -1, blank = -1; // The tile we know is blank\r
unsigned int pal = 0, pack = 0, sh;\r
\r
// Draw tiles across screen:\r
\r
if (code & 0x8000) { // high priority tile\r
if ((plane_sh&LF_SH) | (code!=blank)) {\r
- int cval = (code&0xfc00) | ((code&0x3ff)<<1) | (dx<<16) | (ty<<25);\r
- if (code & 0x1000) cval ^= 0x1e<<25;\r
- *hc++ = cval, *hc++ = pack; // cache it\r
+ code = (code&0xfc00) | ((code&0x3ff)<<1) | (dx<<16) | (ty<<25);\r
+ if (code & 0x1000) code ^= 0x1e<<25;\r
+ *hc++ = code, *hc++ = pack; // cache it\r
}\r
continue;\r
} else if (code != blank) {\r
static void DrawTilesFromCache(u32 *hc, int sh, int rlim, struct PicoEState *est)\r
{\r
unsigned char *pd = Pico.est.HighCol;\r
- int code, dx;\r
- unsigned int pack;\r
+ u32 code, dx;\r
+ u32 pack;\r
int pal;\r
\r
// *ts->hc++ = code | (dx<<16) | (ty<<25); // cache it\r
}\r
#endif\r
\r
-static void DrawSpriteInterlace(unsigned int *sprite)\r
+static void DrawSpriteInterlace(u32 *sprite)\r
{\r
unsigned char *pd = Pico.est.HighCol;\r
int width=0,height=0;\r
{\r
struct PicoVideo *pvid=&Pico.video;\r
int i,u,table,link=0,sline=Pico.est.DrawScanline<<1;\r
- unsigned int *sprites[80]; // Sprite index\r
+ u32 *sprites[80]; // Sprite index\r
int max_sprites = Pico.video.reg[12]&1 ? 80 : 64;\r
\r
table=pvid->reg[5]&0x7f;\r
\r
for (i = u = 0; u < max_sprites && link < max_sprites; u++)\r
{\r
- unsigned int *sprite;\r
+ u32 *sprite;\r
int code, sx, sy, height;\r
\r
sprite=(u32 *)(PicoMem.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
static void DrawStripForced(struct TileStrip *ts, int cellskip)\r
{\r
unsigned char *pd = Pico.est.HighCol;\r
- int tilex, dx, ty, code=0, addr=0, cells;\r
- int oldcode = -1;\r
+ int tilex, dx, ty, addr=0, cells;\r
+ u32 code = 0, oldcode = -1;\r
int pal = 0;\r
\r
// Draw tiles across screen:\r
\r
for (; cells > 0; dx+=8, tilex++, cells--)\r
{\r
- unsigned int pack;\r
+ u32 pack;\r
\r
code = PicoMem.vram[ts->nametab + (tilex & ts->xmask)];\r
\r
static void DrawStripVSRamForced(struct TileStrip *ts, int plane_sh, int cellskip)\r
{\r
unsigned char *pd = Pico.est.HighCol;\r
- int tilex, dx, ty=0, code=0, addr=0, cell=0, nametabadd=0;\r
- int oldcode=-1;\r
+ int tilex, dx, ty=0, addr=0, cell=0, nametabadd=0;\r
+ u32 code=0, oldcode=-1;\r
int pal=0, scan=Pico.est.DrawScanline, plane;\r
\r
// Draw tiles across screen:\r
\r
for (u = 0; u < max_sprites && link < max_sprites; u++)\r
{\r
- unsigned int *sprite;\r
+ u32 *sprite;\r
int code, code2, sx, sy, hv, height, width;\r
\r
sprite=(u32 *)(PicoMem.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
\r
\r
// sx and sy are coords of virtual screen with 8pix borders on top and on left\r
-static void DrawSpriteFull(unsigned int *sprite, struct PicoEState *est)\r
+static void DrawSpriteFull(u32 *sprite, struct PicoEState *est)\r
{\r
int width=0,height=0;\r
// unsigned short *pal=NULL;\r
struct PicoVideo *pvid=&est->Pico->video;\r
int table=0,maskrange=0;\r
int i,u,link=0;\r
- unsigned int *sprites[80]; // Sprites\r
+ u32 *sprites[80]; // Sprites\r
int y_min=START_ROW*8, y_max=END_ROW*8; // for a simple sprite masking\r
int max_sprites = pvid->reg[12]&1 ? 80 : 64;\r
\r
\r
for (i = u = 0; u < max_sprites && link < max_sprites; u++)\r
{\r
- unsigned int *sprite=NULL;\r
+ u32 *sprite=NULL;\r
int code, code2, sx, sy, height;\r
\r
sprite=(u32 *)(est->PicoMem_vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
PicoCpuCM68k.fetch32 = NULL;\r
#endif\r
#ifdef EMU_F68K\r
- PicoCpuFM68k.read_byte = m68k_read8;\r
- PicoCpuFM68k.read_word = m68k_read16;\r
- PicoCpuFM68k.read_long = m68k_read32;\r
- PicoCpuFM68k.write_byte = m68k_write8;\r
- PicoCpuFM68k.write_word = m68k_write16;\r
- PicoCpuFM68k.write_long = m68k_write32;\r
+ PicoCpuFM68k.read_byte = (void *)m68k_read8;\r
+ PicoCpuFM68k.read_word = (void *)m68k_read16;\r
+ PicoCpuFM68k.read_long = (void *)m68k_read32;\r
+ PicoCpuFM68k.write_byte = (void *)m68k_write8;\r
+ PicoCpuFM68k.write_word = (void *)m68k_write16;\r
+ PicoCpuFM68k.write_long = (void *)m68k_write32;\r
\r
// setup FAME fetchmap\r
{\r
#define sh2_cycles_done_m68k(sh2) \\r
(unsigned)((sh2)->m68krcycles_done + C_SH2_TO_M68K(sh2, sh2_cycles_done(sh2)))\r
\r
-#define sh2_reg(c, x) (c) ? ssh2.r[x] : msh2.r[x]\r
-#define sh2_gbr(c) (c) ? ssh2.gbr : msh2.gbr\r
-#define sh2_vbr(c) (c) ? ssh2.vbr : msh2.vbr\r
-#define sh2_sr(c) (((c) ? ssh2.sr : msh2.sr) & 0xfff)\r
+#define sh2_reg(c, x) ((c) ? ssh2.r[x] : msh2.r[x])\r
+#define sh2_gbr(c) ((c) ? ssh2.gbr : msh2.gbr)\r
+#define sh2_vbr(c) ((c) ? ssh2.vbr : msh2.vbr)\r
+#define sh2_sr(c) (((c) ? ssh2.sr : msh2.sr) & 0xfff)\r
\r
#define sh2_set_gbr(c, v) \\r
{ if (c) ssh2.gbr = v; else msh2.gbr = v; }\r
unsigned char PicoVideoRead8CtlL(int is_from_z80);\r
unsigned char PicoVideoRead8HV_H(int is_from_z80);\r
unsigned char PicoVideoRead8HV_L(int is_from_z80);\r
-extern int (*PicoDmaHook)(u32 source, int len, unsigned short **base, unsigned int *mask);\r
+extern int (*PicoDmaHook)(u32 source, int len, unsigned short **base, u32 *mask);\r
void PicoVideoFIFOSync(int cycles);\r
int PicoVideoFIFOHint(void);\r
void PicoVideoFIFOMode(int active, int h40);\r
\r
typedef uintptr_t uptr; /* unsigned pointer-sized int */\r
\r
+typedef unsigned int uint; /* printf casts */\r
+typedef unsigned long ulong;\r
#endif\r
\r
u32 SATaddr, SATmask; // VRAM addr of sprite attribute table\r
\r
-int (*PicoDmaHook)(u32 source, int len, unsigned short **base, unsigned int *mask) = NULL;\r
+int (*PicoDmaHook)(u32 source, int len, unsigned short **base, u32 *mask) = NULL;\r
\r
\r
/* VDP FIFO implementation\r
}\r
}\r
\r
-PICO_INTERNAL_ASM void PicoVideoWrite(unsigned int a,unsigned short d)\r
+PICO_INTERNAL_ASM void PicoVideoWrite(u32 a,unsigned short d)\r
{\r
struct PicoVideo *pvid=&Pico.video;\r
\r
static void keys_parse_all(FILE *f)
{
- char line[256], *var, *val;
+ char line[640], *var, *val;
int dev_id = -1;
int acts, type;
int ret;
*sym = 0;
if (pi == NULL) {
- snprintf(buf, buflen, "0x%x", insn);
+ snprintf(buf, buflen, "0x%08lx", (unsigned long)insn);
return 0;
}
break;
case REG_ST:
if ((insn & 0x38) == 0x30 /*T..*/)
- snprintf(buf, buflen, "%s %s, %s (code %d)", pi->name, rs, rt, (insn>>6) & 0x3ff);
+ snprintf(buf, buflen, "%s %s, %s (code %d)", pi->name, rs, rt, (int)(insn>>6) & 0x3ff);
else
snprintf(buf, buflen, "%s %s, %s", pi->name, rs, rt);
break;
snprintf(buf, buflen, "%s %s, %d", pi->name, rs, imm);
break;
case SB_CODE:
- snprintf(buf, buflen, "%s %d", pi->name, (insn>>6) & 0xfffff);
+ snprintf(buf, buflen, "%s %ld", pi->name, (unsigned long)(insn>>6) & 0xfffff);
break;
}
return 1;
if (ret != 0)
exit(1);
SDL_ShowCursor(0);
-#if defined(__RG350__) || defined(__GCW0__)
+#if defined(__RG350__) || defined(__GCW0__) || defined(__OPENDINGUX__)
// opendingux on JZ47x0 may falsely report a HW overlay, fix to window
plat_target.vout_method = 0;
#endif