notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
error checking for png
[picodrive.git]
/
Pico
/
Pico
/
Memory.c
diff --git
a/Pico/Pico/Memory.c
b/Pico/Pico/Memory.c
index
2f8e1d6
..
7e106a3
100644
(file)
--- a/
Pico/Pico/Memory.c
+++ b/
Pico/Pico/Memory.c
@@
-34,7
+34,7
@@
static u32 PicoReadPico8(u32 a)
case 0x01: d = PicoPicohw.r1; break;
case 0x03:
d = PicoPad[0]&0x1f; // d-pad
case 0x01: d = PicoPicohw.r1; break;
case 0x03:
d = PicoPad[0]&0x1f; // d-pad
- d |= (PicoPad[0]&0x20) << 2; //
red button
-> C
+ d |= (PicoPad[0]&0x20) << 2; //
pen push
-> C
d = ~d;
break;
d = ~d;
break;
@@
-50,7
+50,7
@@
static u32 PicoReadPico8(u32 a)
}
}
}
}
-
//
elprintf(EL_UIO, "r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc);
+
//
elprintf(EL_UIO, "r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc);
end:
elprintf(EL_IO, "r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc);
end:
elprintf(EL_IO, "r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc);
@@
-76,8
+76,10
@@
static u32 PicoReadPico16(u32 a)
d = (PicoPicohw.fifo_bytes > 0x3f) ? 0 : (0x3f - PicoPicohw.fifo_bytes);
else if (a == 0x800012)
d = PicoPicohw.fifo_bytes == 0 ? 0x8000 : 0; // guess
d = (PicoPicohw.fifo_bytes > 0x3f) ? 0 : (0x3f - PicoPicohw.fifo_bytes);
else if (a == 0x800012)
d = PicoPicohw.fifo_bytes == 0 ? 0x8000 : 0; // guess
+ else
+ elprintf(EL_UIO, "r16: %06x, %04x @%06x", a&0xffffff, d, SekPc);
- elprintf(EL_UIO, "r16: %06x, %04x @%06x", a&0xffffff, d, SekPc);
+
//
elprintf(EL_UIO, "r16: %06x, %04x @%06x", a&0xffffff, d, SekPc);
end:
elprintf(EL_IO, "r16: %06x, %04x @%06x", a&0xffffff, d, SekPc);
end:
elprintf(EL_IO, "r16: %06x, %04x @%06x", a&0xffffff, d, SekPc);
@@
-109,13
+111,20
@@
end:
// -----------------------------------------------------------------
// Write Ram
// -----------------------------------------------------------------
// Write Ram
+/*
void dump(u16 w)
{
void dump(u16 w)
{
- FILE *f = fopen("dump.bin", "a");
- fwrite(&w, 1, 2, f);
- fclose(f);
+ static FILE *f[0x10] = { NULL, };
+ char fname[32];
+ int num = PicoPicohw.r12 & 0xf;
+
+ sprintf(fname, "ldump%i.bin", num);
+ if (f[num] == NULL)
+ f[num] = fopen(fname, "wb");
+ fwrite(&w, 1, 2, f[num]);
+ //fclose(f);
}
}
-
+*/
static void PicoWritePico8(u32 a,u8 d)
{
static void PicoWritePico8(u32 a,u8 d)
{
@@
-132,7
+141,13
@@
static void PicoWritePico8(u32 a,u8 d)
return;
}
return;
}
- elprintf(EL_UIO, "w8 : %06x, %02x @%06x", a&0xffffff, d, SekPc);
+ switch (a & 0x1f) {
+ case 0x19: case 0x1b: case 0x1d: case 0x1f: break; // 'S' 'E' 'G' 'A'
+ default:
+ elprintf(EL_UIO, "w8 : %06x, %02x @%06x", a&0xffffff, d, SekPc);
+ break;
+ }
+ //elprintf(EL_UIO, "w8 : %06x, %02x @%06x", a&0xffffff, d, SekPc);
}
static void PicoWritePico16(u32 a,u16 d)
}
static void PicoWritePico16(u32 a,u16 d)
@@
-154,7
+169,7
@@
static void PicoWritePico16(u32 a,u16 d)
*PicoPicohw.xpcm_ptr++ = d;
}
else if (PicoPicohw.xpcm_ptr == PicoPicohw.xpcm_buffer + XPCM_BUFFER_SIZE) {
*PicoPicohw.xpcm_ptr++ = d;
}
else if (PicoPicohw.xpcm_ptr == PicoPicohw.xpcm_buffer + XPCM_BUFFER_SIZE) {
- elprintf(EL_ANOMALY, "xpcm_buffer overflow!");
+ elprintf(EL_ANOMALY
|EL_PICOHW
, "xpcm_buffer overflow!");
PicoPicohw.xpcm_ptr++;
}
}
PicoPicohw.xpcm_ptr++;
}
}
@@
-164,8
+179,10
@@
static void PicoWritePico16(u32 a,u16 d)
if (r12_old != d)
PicoReratePico();
}
if (r12_old != d)
PicoReratePico();
}
+ else
+ elprintf(EL_UIO, "w16: %06x, %04x", a&0xffffff, d);
- elprintf(EL_UIO, "w16: %06x, %04x", a&0xffffff, d);
+
//
elprintf(EL_UIO, "w16: %06x, %04x", a&0xffffff, d);
}
static void PicoWritePico32(u32 a,u32 d)
}
static void PicoWritePico32(u32 a,u32 d)
@@
-245,5
+262,15
@@
PICO_INTERNAL void PicoMemSetupPico(void)
pm68k_read_memory_pcr_16 = m68k_read_memory_pcrp_16;
pm68k_read_memory_pcr_32 = m68k_read_memory_pcrp_32;
#endif
pm68k_read_memory_pcr_16 = m68k_read_memory_pcrp_16;
pm68k_read_memory_pcr_32 = m68k_read_memory_pcrp_32;
#endif
+#ifdef EMU_F68K
+ // use standard setup, only override handlers
+ PicoMemSetup();
+ PicoCpuFM68k.read_byte =PicoReadPico8;
+ PicoCpuFM68k.read_word =PicoReadPico16;
+ PicoCpuFM68k.read_long =PicoReadPico32;
+ PicoCpuFM68k.write_byte=PicoWritePico8;
+ PicoCpuFM68k.write_word=PicoWritePico16;
+ PicoCpuFM68k.write_long=PicoWritePico32;
+#endif
}
}