\r
for (len = length; len > 0; len--, src+=2, dest+=2)\r
*dest = (src[0]<<8) | src[1];\r
+\r
+ { // debug\r
+ unsigned char *b1 = Pico_mcd->word_ram + dep;\r
+ unsigned char *b2 = (unsigned char *)dest - 8;\r
+ dprintf("%02x %02x %02x %02x .. %02x %02x %02x %02x",\r
+ b1[0], b1[1], b1[4], b1[5], b2[0], b2[1], b2[4], b2[5]);\r
+ }\r
}\r
else\r
{\r
\r
for (len = length; len > 0; len--, src+=2, dest++)\r
*dest = (src[0]<<8) | src[1];\r
+\r
+ { // debug\r
+ unsigned char *b1 = Pico_mcd->word_ram + dep;\r
+ unsigned char *b2 = (unsigned char *)dest - 4;\r
+ dprintf("%02x %02x %02x %02x .. %02x %02x %02x %02x",\r
+ b1[0], b1[1], b1[2], b1[3], b2[0], b2[1], b2[2], b2[3]);\r
+ }\r
}\r
}\r
else if (which == 4) // PCM RAM\r
dest = (unsigned char *) Ram_PCM;\r
dep = ((DMA_Adr & 0x03FF) << 2) + PCM_Chip.Bank;\r
#else\r
- cdprintf("CD DMA # %04x -> PCD TODO", Pico_mcd->cdc.DAC.N);\r
+ cdprintf("CD DMA # %04x -> PCM TODO", Pico_mcd->cdc.DAC.N);\r
#endif\r
}\r
else if (which == 5) // PRG RAM\r
\r
for (len = length; len > 0; len--, src+=2, dest++)\r
*dest = (src[0]<<8) | src[1];\r
+\r
+ { // debug\r
+ unsigned char *b1 = Pico_mcd->prg_ram + dep;\r
+ unsigned char *b2 = (unsigned char *)dest - 4;\r
+ dprintf("%02x %02x %02x %02x .. %02x %02x %02x %02x",\r
+ b1[0], b1[1], b1[2], b1[3], b2[0], b2[1], b2[2], b2[3]);\r
+ }\r
}\r
\r
length <<= 1;\r
Pico_mcd->cdc.DAC.N = (Pico_mcd->cdc.DAC.N + length) & 0xFFFF;\r
if (Pico_mcd->scd.Status_CDC & 0x08) Pico_mcd->cdc.DBC.N -= length;\r
else Pico_mcd->cdc.DBC.N = 0;\r
+\r
+ // update DMA_Adr\r
+ length >>= 2;\r
+ if (which != 4) length >>= 1;\r
+ DMA_Adr += length;\r
+ Pico_mcd->s68k_regs[0xA] = DMA_Adr >> 8;\r
+ Pico_mcd->s68k_regs[0xB] = DMA_Adr;\r
}\r
\r
\r
goto end;\r
case 2:\r
d = (Pico_mcd->s68k_regs[a]<<8) | (Pico_mcd->s68k_regs[a+1]&0xc7);\r
- dprintf("m68k_regs r3: %02x @%06x", (u8)d, SekPc);\r
+ dprintf("m68k_regs r3: %02x @%06x", (u8)d, SekPcS68k);\r
goto end;\r
case 4:\r
d = Pico_mcd->s68k_regs[4]<<8;\r
goto end;\r
case 0xC:\r
dprintf("m68k stopwatch timer read");\r
- break;\r
+ d = Pico_mcd->m.timer_stopwatch >> 16;\r
+ goto end;\r
}\r
\r
if (a < 0x30) {\r
return;\r
case 0xe:\r
//dprintf("m68k: comm flag: %02x", d);\r
-\r
- //dprintf("s68k @ %06x", SekPcS68k);\r
-\r
Pico_mcd->s68k_regs[0xe] = d;\r
return;\r
}\r
dprintf("s68k set stopwatch timer");\r
Pico_mcd->m.timer_stopwatch = 0;\r
return;\r
+ case 0xe:\r
+ Pico_mcd->s68k_regs[0Xf] = (d>>1) | (d<<7); // ror8, Gens note: Dragons lair\r
+ Pico_mcd->m.timer_stopwatch = 0;\r
+ return;\r
case 0x31:\r
dprintf("s68k set int3 timer: %02x", d);\r
Pico_mcd->m.timer_int3 = d << 16;\r
return;\r
}\r
\r
- if ((a&0x1f0) == 0x10 || a == 0x0e || (a >= 0x38 && a < 0x42))\r
+ if ((a&0x1f0) == 0x10 || (a >= 0x38 && a < 0x42))\r
{\r
- dprintf("m68k: invalid write @ %02x?", a);\r
+ dprintf("s68k: invalid write @ %02x?", a);\r
return;\r
}\r
\r
\r
// word RAM (2M area)\r
if ((a&0xfc0000)==0x080000) { // 080000-0bffff\r
- dprintf("s68k_wram2M r8: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_wram2M r8: [%06x] @%06x", a, SekPcS68k);\r
if (Pico_mcd->s68k_regs[3]&4) { // 1M mode?\r
// TODO (decode)\r
dprintf("(decode)");\r
\r
// word RAM (1M area)\r
if ((a&0xfe0000)==0x0c0000 && (Pico_mcd->s68k_regs[3]&4)) { // 0c0000-0dffff\r
- dprintf("s68k_wram1M r8: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_wram1M r8: [%06x] @%06x", a, SekPcS68k);\r
a=((a&0x1fffe)<<1)|(a&1);\r
if (!(Pico_mcd->s68k_regs[3]&1)) a+=2;\r
d = Pico_mcd->word_ram[a^1];\r
\r
// PCM\r
if ((a&0xff8000)==0xff0000) {\r
- dprintf("s68k_pcm r8: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_pcm r8: [%06x] @%06x", a, SekPcS68k);\r
a &= 0x7fff;\r
if (a >= 0x2000)\r
d = Pico_mcd->pcm_ram_b[Pico_mcd->pcm.bank][(a>>1)&0xfff];\r
\r
// word RAM (2M area)\r
if ((a&0xfc0000)==0x080000) { // 080000-0bffff\r
- dprintf("s68k_wram2M r16: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_wram2M r16: [%06x] @%06x", a, SekPcS68k);\r
if (Pico_mcd->s68k_regs[3]&4) { // 1M mode?\r
// TODO (decode)\r
dprintf("(decode)");\r
\r
// word RAM (1M area)\r
if ((a&0xfe0000)==0x0c0000 && (Pico_mcd->s68k_regs[3]&4)) { // 0c0000-0dffff\r
- dprintf("s68k_wram1M r16: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_wram1M r16: [%06x] @%06x", a, SekPcS68k);\r
a=((a&0x1fffe)<<1);\r
if (!(Pico_mcd->s68k_regs[3]&1)) a+=2;\r
d = *(u16 *)(Pico_mcd->word_ram+a);\r
\r
// bram\r
if ((a&0xff0000)==0xfe0000) {\r
- dprintf("s68k_bram r16: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_bram r16: [%06x] @%06x", a, SekPcS68k);\r
a = (a>>1)&0x1fff;\r
d = Pico_mcd->bram[a++]; // Gens does little endian here, and so do we..\r
d|= Pico_mcd->bram[a++] << 8;\r
\r
// PCM\r
if ((a&0xff8000)==0xff0000) {\r
- dprintf("s68k_pcm r16: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_pcm r16: [%06x] @%06x", a, SekPcS68k);\r
a &= 0x7fff;\r
if (a >= 0x2000)\r
d = Pico_mcd->pcm_ram_b[Pico_mcd->pcm.bank][(a>>1)&0xfff];\r
\r
// word RAM (2M area)\r
if ((a&0xfc0000)==0x080000) { // 080000-0bffff\r
- dprintf("s68k_wram2M r32: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_wram2M r32: [%06x] @%06x", a, SekPcS68k);\r
if (Pico_mcd->s68k_regs[3]&4) { // 1M mode?\r
// TODO (decode)\r
dprintf("(decode)");\r
\r
// word RAM (1M area)\r
if ((a&0xfe0000)==0x0c0000 && (Pico_mcd->s68k_regs[3]&4)) { // 0c0000-0dffff\r
- dprintf("s68k_wram1M r32: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_wram1M r32: [%06x] @%06x", a, SekPcS68k);\r
a=((a&0x1fffe)<<1);\r
if (!(Pico_mcd->s68k_regs[3]&1)) a+=2;\r
d = *(u16 *)(Pico_mcd->word_ram+a) << 16;\r
\r
// PCM\r
if ((a&0xff8000)==0xff0000) {\r
- dprintf("s68k_pcm r32: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_pcm r32: [%06x] @%06x", a, SekPcS68k);\r
a &= 0x7fff;\r
if (a >= 0x2000) {\r
a >>= 1;\r
\r
// bram\r
if ((a&0xff0000)==0xfe0000) {\r
- dprintf("s68k_bram r32: [%06x] @%06x", a, SekPc);\r
+ dprintf("s68k_bram r32: [%06x] @%06x", a, SekPcS68k);\r
a = (a>>1)&0x1fff;\r
d = Pico_mcd->bram[a++] << 16; // middle endian? TODO: verify against Fusion..\r
d|= Pico_mcd->bram[a++] << 24;\r
\r
// word RAM (2M area)\r
if ((a&0xfc0000)==0x080000) { // 080000-0bffff\r
- dprintf("s68k_wram2M w8: [%06x] %02x @%06x", a, d, SekPc);\r
+ dprintf("s68k_wram2M w8: [%06x] %02x @%06x", a, d, SekPcS68k);\r
if (Pico_mcd->s68k_regs[3]&4) { // 1M mode?\r
// TODO (decode)\r
dprintf("(decode)");\r
// word RAM (1M area)\r
if ((a&0xfe0000)==0x0c0000 && (Pico_mcd->s68k_regs[3]&4)) { // 0c0000-0dffff\r
if (d)\r
- dprintf("s68k_wram1M w8: [%06x] %02x @%06x", a, d, SekPc);\r
+ dprintf("s68k_wram1M w8: [%06x] %02x @%06x", a, d, SekPcS68k);\r
a=((a&0x1fffe)<<1)|(a&1);\r
if (!(Pico_mcd->s68k_regs[3]&1)) a+=2;\r
*(u8 *)(Pico_mcd->word_ram+(a^1))=d;\r
if (a >= 0x50 && a < 0x68)\r
gfx_cd_write(a, d);\r
else {\r
+ if (a == 0xe) { // special case, 2 byte writes would be handled differently\r
+ Pico_mcd->s68k_regs[0xf] = d;\r
+ return;\r
+ }\r
s68k_reg_write8(a, d>>8);\r
s68k_reg_write8(a+1,d&0xff);\r
}\r
\r
// word RAM (2M area)\r
if ((a&0xfc0000)==0x080000) { // 080000-0bffff\r
- dprintf("s68k_wram2M w16: [%06x] %04x @%06x", a, d, SekPc);\r
+ dprintf("s68k_wram2M w16: [%06x] %04x @%06x", a, d, SekPcS68k);\r
if (Pico_mcd->s68k_regs[3]&4) { // 1M mode?\r
// TODO (decode)\r
dprintf("(decode)");\r
// word RAM (1M area)\r
if ((a&0xfe0000)==0x0c0000 && (Pico_mcd->s68k_regs[3]&4)) { // 0c0000-0dffff\r
if (d)\r
- dprintf("s68k_wram1M w16: [%06x] %04x @%06x", a, d, SekPc);\r
+ dprintf("s68k_wram1M w16: [%06x] %04x @%06x", a, d, SekPcS68k);\r
a=((a&0x1fffe)<<1);\r
if (!(Pico_mcd->s68k_regs[3]&1)) a+=2;\r
*(u16 *)(Pico_mcd->word_ram+a)=d;\r
\r
// bram\r
if ((a&0xff0000)==0xfe0000) {\r
- dprintf("s68k_bram w16: [%06x] %04x @%06x", a, d, SekPc);\r
+ dprintf("s68k_bram w16: [%06x] %04x @%06x", a, d, SekPcS68k);\r
a = (a>>1)&0x1fff;\r
Pico_mcd->bram[a++] = d; // Gens does little endian here, an so do we..\r
Pico_mcd->bram[a++] = d >> 8;\r
\r
// word RAM (2M area)\r
if ((a&0xfc0000)==0x080000) { // 080000-0bffff\r
- dprintf("s68k_wram2M w32: [%06x] %08x @%06x", a, d, SekPc);\r
+ dprintf("s68k_wram2M w32: [%06x] %08x @%06x", a, d, SekPcS68k);\r
if (Pico_mcd->s68k_regs[3]&4) { // 1M mode?\r
// TODO (decode)\r
dprintf("(decode)");\r
// word RAM (1M area)\r
if ((a&0xfe0000)==0x0c0000 && (Pico_mcd->s68k_regs[3]&4)) { // 0c0000-0dffff\r
if (d)\r
- dprintf("s68k_wram1M w32: [%06x] %08x @%06x", a, d, SekPc);\r
+ dprintf("s68k_wram1M w32: [%06x] %08x @%06x", a, d, SekPcS68k);\r
a=((a&0x1fffe)<<1);\r
if (!(Pico_mcd->s68k_regs[3]&1)) a+=2;\r
*(u16 *)(Pico_mcd->word_ram+a) = d>>16;\r
\r
// bram\r
if ((a&0xff0000)==0xfe0000) {\r
- dprintf("s68k_bram w32: [%06x] %08x @%06x", a, d, SekPc);\r
+ dprintf("s68k_bram w32: [%06x] %08x @%06x", a, d, SekPcS68k);\r
a = (a>>1)&0x1fff;\r
Pico_mcd->bram[a++] = d >> 16; // middle endian? verify?\r
Pico_mcd->bram[a++] = d >> 24;\r