17 files changed:
static unsigned char *cd_realloc(void *old, int filesize)\r
{\r
unsigned char *rom;\r
static unsigned char *cd_realloc(void *old, int filesize)\r
{\r
unsigned char *rom;\r
- dprintf("sizeof(mcd_state): %i", sizeof(mcd_state));\r
rom=realloc(old, sizeof(mcd_state));\r
if (rom) memset(rom+0x20000, 0, sizeof(mcd_state)-0x20000);\r
return rom;\r
rom=realloc(old, sizeof(mcd_state));\r
if (rom) memset(rom+0x20000, 0, sizeof(mcd_state)-0x20000);\r
return rom;\r
alloc_size&=~0x7ffff; // use alloc size of multiples of 512K, so that memhandlers could be set up more efficiently\r
if((filesize&0x3fff)==0x200) alloc_size+=0x200;\r
else if(alloc_size-filesize < 4) alloc_size+=4; // padding for out-of-bound exec protection\r
alloc_size&=~0x7ffff; // use alloc size of multiples of 512K, so that memhandlers could be set up more efficiently\r
if((filesize&0x3fff)==0x200) alloc_size+=0x200;\r
else if(alloc_size-filesize < 4) alloc_size+=4; // padding for out-of-bound exec protection\r
- //dprintf("alloc_size: %x\n", alloc_size);\r
\r
// Allocate space for the rom plus padding\r
rom=(unsigned char *)malloc(alloc_size);\r
\r
// Allocate space for the rom plus padding\r
rom=(unsigned char *)malloc(alloc_size);\r
// This is part of Pico Library\r
\r
// (c) Copyright 2004 Dave, All rights reserved.\r
// This is part of Pico Library\r
\r
// (c) Copyright 2004 Dave, All rights reserved.\r
-// (c) Copyright 2006 notaz, All rights reserved.\r
+// (c) Copyright 2006,2007 notaz, All rights reserved.\r
// Free for non-commercial use.\r
\r
// For commercial use, separate licencing terms must be obtained.\r
\r
\r
// Free for non-commercial use.\r
\r
// For commercial use, separate licencing terms must be obtained.\r
\r
\r
-//#define __debug_io\r
-\r
#include "PicoInt.h"\r
\r
#include "sound/ym2612.h"\r
#include "PicoInt.h"\r
\r
#include "sound/ym2612.h"\r
if ((a&1)==0) d>>=8;\r
\r
end:\r
if ((a&1)==0) d>>=8;\r
\r
end:\r
-#ifdef __debug_io\r
- dprintf("r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc);\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
else d = OtherRead16(a, 16);\r
\r
end:\r
else d = OtherRead16(a, 16);\r
\r
end:\r
-#ifdef __debug_io\r
- dprintf("r16: %06x, %04x @%06x", a&0xffffff, d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "r16: %06x, %04x @%06x", a&0xffffff, d, SekPc);\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
else d = (OtherRead16(a, 32)<<16)|OtherRead16(a+2, 32);\r
\r
end:\r
else d = (OtherRead16(a, 32)<<16)|OtherRead16(a+2, 32);\r
\r
end:\r
-#ifdef __debug_io\r
- dprintf("r32: %06x, %08x @%06x", a&0xffffff, d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "r32: %06x, %08x @%06x", a&0xffffff, d, SekPc);\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
#if !defined(_ASM_MEMORY_C) || defined(_ASM_MEMORY_C_AMIPS)\r
PICO_INTERNAL_ASM void PicoWrite8(u32 a,u8 d)\r
{\r
#if !defined(_ASM_MEMORY_C) || defined(_ASM_MEMORY_C_AMIPS)\r
PICO_INTERNAL_ASM void PicoWrite8(u32 a,u8 d)\r
{\r
-#ifdef __debug_io\r
- dprintf("w8 : %06x, %02x @%06x", a&0xffffff, d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "w8 : %06x, %02x @%06x", a&0xffffff, d, SekPc);\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
\r
void PicoWrite16(u32 a,u16 d)\r
{\r
\r
void PicoWrite16(u32 a,u16 d)\r
{\r
-#ifdef __debug_io\r
- dprintf("w16: %06x, %04x", a&0xffffff, d);\r
-#endif\r
+ elprintf(EL_IO, "w16: %06x, %04x", a&0xffffff, d);\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
\r
static void PicoWrite32(u32 a,u32 d)\r
{\r
\r
static void PicoWrite32(u32 a,u32 d)\r
{\r
-#ifdef __debug_io\r
- dprintf("w32: %06x, %08x", a&0xffffff, d);\r
-#endif\r
+ elprintf(EL_IO, "w32: %06x, %08x", a&0xffffff, d);\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
if (a<Pico.romsize && m68ki_cpu_p==&PicoCpuMM68k)\r
d = *(u8 *) (Pico.rom+(a^1));\r
else d = (u8) lastread_d[lrp_mus++&15];\r
if (a<Pico.romsize && m68ki_cpu_p==&PicoCpuMM68k)\r
d = *(u8 *) (Pico.rom+(a^1));\r
else d = (u8) lastread_d[lrp_mus++&15];\r
-#ifdef __debug_io\r
- dprintf("r8_mu : %06x, %02x @%06x", a&0xffffff, d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "r8_mu : %06x, %02x @%06x", a&0xffffff, d, SekPc);\r
return d;\r
}\r
unsigned int m68k_read_memory_16(unsigned int a)\r
return d;\r
}\r
unsigned int m68k_read_memory_16(unsigned int a)\r
if (a<Pico.romsize && m68ki_cpu_p==&PicoCpuMM68k)\r
d = *(u16 *)(Pico.rom+(a&~1));\r
else d = (u16) lastread_d[lrp_mus++&15];\r
if (a<Pico.romsize && m68ki_cpu_p==&PicoCpuMM68k)\r
d = *(u16 *)(Pico.rom+(a&~1));\r
else d = (u16) lastread_d[lrp_mus++&15];\r
-#ifdef __debug_io\r
- dprintf("r16_mu: %06x, %04x @%06x", a&0xffffff, d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "r16_mu: %06x, %04x @%06x", a&0xffffff, d, SekPc);\r
return d;\r
}\r
unsigned int m68k_read_memory_32(unsigned int a)\r
return d;\r
}\r
unsigned int m68k_read_memory_32(unsigned int a)\r
{ u16 *pm=(u16 *)(Pico.rom+(a&~1));d=(pm[0]<<16)|pm[1]; }\r
else if (a <= 0x78) d = m68k_read_32(a, 0);\r
else d = lastread_d[lrp_mus++&15];\r
{ u16 *pm=(u16 *)(Pico.rom+(a&~1));d=(pm[0]<<16)|pm[1]; }\r
else if (a <= 0x78) d = m68k_read_32(a, 0);\r
else d = lastread_d[lrp_mus++&15];\r
-#ifdef __debug_io\r
- dprintf("r32_mu: %06x, %08x @%06x", a&0xffffff, d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "r32_mu: %06x, %08x @%06x", a&0xffffff, d, SekPc);\r
void OtherWrite16(u32 a,u32 d)
{
if (a==0xa11100) { z80WriteBusReq(d>>8); return; }
void OtherWrite16(u32 a,u32 d)
{
if (a==0xa11100) { z80WriteBusReq(d>>8); return; }
- if (a==0xa11200) { dprintf("write z80reset: %04x", d); if(!(d&0x100)) z80_reset(); return; }
+ if (a==0xa11200) { elprintf(EL_BUSREQ, "write z80reset: %04x", d); if(!(d&0x100)) z80_reset(); return; }
if ((a&0xffffe0)==0xa10000) { IoWrite8(a, d); return; } // I/O ports
if ((a&0xff4000)==0xa00000) { if(!(Pico.m.z80Run&1)) Pico.zram[a&0x1fff]=(u8)(d>>8); return; } // Z80 ram (MSB only)
if ((a&0xe700f8)==0xc00010||(a&0xff7ff8)==0xa07f10) { if(PicoOpt&2) SN76496Write(d); return; } // PSG Sound
if ((a&0xffffe0)==0xa10000) { IoWrite8(a, d); return; } // I/O ports
if ((a&0xff4000)==0xa00000) { if(!(Pico.m.z80Run&1)) Pico.zram[a&0x1fff]=(u8)(d>>8); return; } // Z80 ram (MSB only)
if ((a&0xe700f8)==0xc00010||(a&0xff7ff8)==0xa07f10) { if(PicoOpt&2) SN76496Write(d); return; } // PSG Sound
#define SekPcS68k (PicoCpuCS68k.pc-PicoCpuCS68k.membase)\r
#define SekSetStop(x) { PicoCpuCM68k.state_flags&=~1; if (x) { PicoCpuCM68k.state_flags|=1; PicoCpuCM68k.cycles=0; } }\r
#define SekSetStopS68k(x) { PicoCpuCS68k.state_flags&=~1; if (x) { PicoCpuCS68k.state_flags|=1; PicoCpuCS68k.cycles=0; } }\r
#define SekPcS68k (PicoCpuCS68k.pc-PicoCpuCS68k.membase)\r
#define SekSetStop(x) { PicoCpuCM68k.state_flags&=~1; if (x) { PicoCpuCM68k.state_flags|=1; PicoCpuCM68k.cycles=0; } }\r
#define SekSetStopS68k(x) { PicoCpuCS68k.state_flags&=~1; if (x) { PicoCpuCS68k.state_flags|=1; PicoCpuCS68k.cycles=0; } }\r
+#define SekIsStoppedS68k() (PicoCpuCS68k.state_flags&1)\r
#define SekShouldInterrupt (PicoCpuCM68k.irq > (PicoCpuCM68k.srh&7))\r
\r
#define SekInterrupt(i) PicoCpuCM68k.irq=i\r
#define SekShouldInterrupt (PicoCpuCM68k.irq > (PicoCpuCM68k.srh&7))\r
\r
#define SekInterrupt(i) PicoCpuCM68k.irq=i\r
PicoCpuFS68k.execinfo &= ~FM68K_HALTED; \\r
if (x) { PicoCpuFS68k.execinfo |= FM68K_HALTED; PicoCpuFS68k.io_cycle_counter = 0; } \\r
}\r
PicoCpuFS68k.execinfo &= ~FM68K_HALTED; \\r
if (x) { PicoCpuFS68k.execinfo |= FM68K_HALTED; PicoCpuFS68k.io_cycle_counter = 0; } \\r
}\r
+#define SekIsStoppedS68k() (PicoCpuFS68k.execinfo&FM68K_HALTED)\r
#define SekShouldInterrupt fm68k_would_interrupt()\r
\r
#define SekInterrupt(irq) PicoCpuFM68k.interrupts[0]=irq\r
#define SekShouldInterrupt fm68k_would_interrupt()\r
\r
#define SekInterrupt(irq) PicoCpuFM68k.interrupts[0]=irq\r
if(x) { SET_CYCLES(0); PicoCpuMS68k.stopped=STOP_LEVEL_STOP; } \\r
else PicoCpuMS68k.stopped=0; \\r
}\r
if(x) { SET_CYCLES(0); PicoCpuMS68k.stopped=STOP_LEVEL_STOP; } \\r
else PicoCpuMS68k.stopped=0; \\r
}\r
+#define SekIsStoppedS68k() (PicoCpuMS68k.stopped==STOP_LEVEL_STOP)\r
#define SekShouldInterrupt (CPU_INT_LEVEL > FLAG_INT_MASK)\r
\r
#define SekInterrupt(irq) { \\r
#define SekShouldInterrupt (CPU_INT_LEVEL > FLAG_INT_MASK)\r
\r
#define SekInterrupt(irq) { \\r
#define EL_SRAMIO 0x0200 /* sram i/o */\r
#define EL_EEPROM 0x0400 /* eeprom debug */\r
#define EL_UIO 0x0800 /* unmapped i/o */\r
#define EL_SRAMIO 0x0200 /* sram i/o */\r
#define EL_EEPROM 0x0400 /* eeprom debug */\r
#define EL_UIO 0x0800 /* unmapped i/o */\r
-#define EL_IO 0x1000 /* all i/o (TODO) */\r
+#define EL_IO 0x1000 /* all i/o */\r
+#define EL_CDPOLL 0x2000 /* MCD: log poll detection */\r
\r
#define EL_STATUS 0x4000 /* status messages */\r
#define EL_ANOMALY 0x8000 /* some unexpected conditions (during emulation) */\r
\r
#define EL_STATUS 0x4000 /* status messages */\r
#define EL_ANOMALY 0x8000 /* some unexpected conditions (during emulation) */\r
\r
#include "../PicoInt.h"\r
\r
\r
#include "../PicoInt.h"\r
\r
-#define cdprintf dprintf\r
-//#define cdprintf(x...)\r
+#define cdprintf(x...)\r
\r
\r
#define CDC_DMA_SPEED 256\r
\r
\r
#define CDC_DMA_SPEED 256\r
\r
if (Pico_mcd->s68k_regs[0x33] & (1<<5))\r
{\r
\r
if (Pico_mcd->s68k_regs[0x33] & (1<<5))\r
{\r
- dprintf("cdc DTE irq 5");\r
+ elprintf(EL_INTS, "cdc DTE irq 5");\r
SekInterruptS68k(5);\r
}\r
}\r
SekInterruptS68k(5);\r
}\r
}\r
else if (which == 4) // PCM RAM (check: popful Mail)\r
{\r
dep = (DMA_Adr & 0x03FF) << 2;\r
else if (which == 4) // PCM RAM (check: popful Mail)\r
{\r
dep = (DMA_Adr & 0x03FF) << 2;\r
- dprintf("CD DMA # %04x -> PCM[%i] # %04x, len=%i",\r
+ cdprintf("CD DMA # %04x -> PCM[%i] # %04x, len=%i",\r
Pico_mcd->cdc.DAC.N, Pico_mcd->pcm.bank, dep, length);\r
dest = (unsigned short *) (Pico_mcd->pcm_ram_b[Pico_mcd->pcm.bank] + dep);\r
\r
Pico_mcd->cdc.DAC.N, Pico_mcd->pcm.bank, dep, length);\r
dest = (unsigned short *) (Pico_mcd->pcm_ram_b[Pico_mcd->pcm.bank] + dep);\r
\r
Pico_mcd->cdc.IFSTAT &= ~0x40;\r
\r
if (Pico_mcd->s68k_regs[0x33]&(1<<5)) {\r
Pico_mcd->cdc.IFSTAT &= ~0x40;\r
\r
if (Pico_mcd->s68k_regs[0x33]&(1<<5)) {\r
- dprintf("m68k: s68k irq 5");\r
+ elprintf(EL_INTS, "m68k: s68k irq 5");\r
SekInterruptS68k(5);\r
}\r
\r
SekInterruptS68k(5);\r
}\r
\r
\r
if (Pico_mcd->s68k_regs[0x33] & (1<<4))\r
{\r
\r
if (Pico_mcd->s68k_regs[0x33] & (1<<4))\r
{\r
- dprintf("cdd export irq 4");\r
+ elprintf(EL_INTS, "cdd export irq 4");\r
SekInterruptS68k(4);\r
}\r
\r
SekInterruptS68k(4);\r
}\r
\r
// (c) Copyright 2007, Grazvydas "notaz" Ignotas\r
\r
\r
// (c) Copyright 2007, Grazvydas "notaz" Ignotas\r
\r
\r
-//#define __debug_io\r
-\r
#include "../PicoInt.h"\r
\r
#include "../sound/ym2612.h"\r
#include "../PicoInt.h"\r
\r
#include "../sound/ym2612.h"\r
#define UTYPES_DEFINED\r
#endif\r
\r
#define UTYPES_DEFINED\r
#endif\r
\r
-//#define __debug_io\r
-//#define __debug_io2\r
-\r
//#define rdprintf dprintf\r
#define rdprintf(...)\r
//#define wrdprintf dprintf\r
#define wrdprintf(...)\r
//#define rdprintf dprintf\r
#define rdprintf(...)\r
//#define wrdprintf dprintf\r
#define wrdprintf(...)\r
-#define plprintf dprintf\r
-//#define plprintf(...)\r
\r
#ifdef EMU_CORE_DEBUG\r
extern u32 lastread_a, lastread_d[16], lastwrite_cyc_d[16];\r
\r
#ifdef EMU_CORE_DEBUG\r
extern u32 lastread_a, lastread_d[16], lastwrite_cyc_d[16];\r
d = Read_CDC_Host(0);\r
goto end;\r
case 0xA:\r
d = Read_CDC_Host(0);\r
goto end;\r
case 0xA:\r
- dprintf("m68k FIXME: reserved read");\r
+ elprintf(EL_UIO, "m68k FIXME: reserved read");\r
goto end;\r
case 0xC:\r
d = Pico_mcd->m.timer_stopwatch >> 16;\r
goto end;\r
case 0xC:\r
d = Pico_mcd->m.timer_stopwatch >> 16;\r
- dprintf("m68k_regs FIXME invalid read @ %02x", a);\r
+ elprintf(EL_UIO, "m68k_regs FIXME invalid read @ %02x", a);\r
- // dprintf("ret = %04x", d);\r
switch (a) {\r
case 0:\r
d &= 1;\r
switch (a) {\r
case 0:\r
d &= 1;\r
- if ((d&1) && (Pico_mcd->s68k_regs[0x33]&(1<<2))) { dprintf("m68k: s68k irq 2"); SekInterruptS68k(2); }\r
+ if ((d&1) && (Pico_mcd->s68k_regs[0x33]&(1<<2))) { elprintf(EL_INTS, "m68k: s68k irq 2"); SekInterruptS68k(2); }\r
return;\r
case 1:\r
d &= 3;\r
return;\r
case 1:\r
d &= 3;\r
#ifdef USE_POLL_DETECT\r
if ((s68k_poll_adclk&0xfe) == 2 && s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(0); s68k_poll_adclk = 0;\r
#ifdef USE_POLL_DETECT\r
if ((s68k_poll_adclk&0xfe) == 2 && s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(0); s68k_poll_adclk = 0;\r
- plprintf("s68k poll release, a=%02x\n", a);\r
+ elprintf(EL_CDPOLL, "s68k poll release, a=%02x\n", a);\r
#ifdef USE_POLL_DETECT\r
if ((s68k_poll_adclk&0xfe) == 0xe && s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(0); s68k_poll_adclk = 0;\r
#ifdef USE_POLL_DETECT\r
if ((s68k_poll_adclk&0xfe) == 0xe && s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(0); s68k_poll_adclk = 0;\r
- plprintf("s68k poll release, a=%02x\n", a);\r
+ elprintf(EL_CDPOLL, "s68k poll release, a=%02x\n", a);\r
#ifdef USE_POLL_DETECT\r
if ((a&0xfe) == (s68k_poll_adclk&0xfe) && s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(0); s68k_poll_adclk = 0;\r
#ifdef USE_POLL_DETECT\r
if ((a&0xfe) == (s68k_poll_adclk&0xfe) && s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(0); s68k_poll_adclk = 0;\r
- plprintf("s68k poll release, a=%02x\n", a);\r
+ elprintf(EL_CDPOLL, "s68k poll release, a=%02x\n", a);\r
}\r
#endif\r
return;\r
}\r
\r
}\r
#endif\r
return;\r
}\r
\r
- dprintf("m68k FIXME: invalid write? [%02x] %02x", a, d);\r
+ elprintf(EL_UIO, "m68k FIXME: invalid write? [%02x] %02x", a, d);\r
}\r
\r
#ifndef _ASM_CD_MEMORY_C\r
}\r
\r
#ifndef _ASM_CD_MEMORY_C\r
u32 s68k_poll_detect(u32 a, u32 d)\r
{\r
#ifdef USE_POLL_DETECT\r
u32 s68k_poll_detect(u32 a, u32 d)\r
{\r
#ifdef USE_POLL_DETECT\r
+ // needed mostly for Cyclone, which doesn't always check it's cycle counter\r
+ if (SekIsStoppedS68k()) return d;\r
// polling detection\r
if (a == (s68k_poll_adclk&0xff)) {\r
unsigned int clkdiff = SekCyclesDoneS68k() - (s68k_poll_adclk>>8);\r
// polling detection\r
if (a == (s68k_poll_adclk&0xff)) {\r
unsigned int clkdiff = SekCyclesDoneS68k() - (s68k_poll_adclk>>8);\r
//printf("-- diff: %u, cnt = %i\n", clkdiff, s68k_poll_cnt);\r
if (s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(1);\r
//printf("-- diff: %u, cnt = %i\n", clkdiff, s68k_poll_cnt);\r
if (s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(1);\r
- plprintf("s68k poll detected @ %06x, a=%02x\n", SekPcS68k, a);\r
+ elprintf(EL_CDPOLL, "s68k poll detected @ %06x, a=%02x\n", SekPcS68k, a);\r
}\r
s68k_poll_adclk = (SekCyclesDoneS68k() << 8) | a;\r
return d;\r
}\r
s68k_poll_adclk = (SekCyclesDoneS68k() << 8) | a;\r
return d;\r
\r
if ((a&0x1f0) == 0x10 || (a >= 0x38 && a < 0x42))\r
{\r
\r
if ((a&0x1f0) == 0x10 || (a >= 0x38 && a < 0x42))\r
{\r
- dprintf("s68k FIXME: invalid write @ %02x?", a);\r
+ elprintf(EL_UIO, "s68k FIXME: invalid write @ %02x?", a);\r
- dprintf("m68k FIXME: unusual r%i: %06x @%06x", realsize&~1, (a&0xfffffe)+(realsize&1), SekPc);\r
+ elprintf(EL_UIO, "m68k FIXME: unusual r%i: %06x @%06x", realsize&~1, (a&0xfffffe)+(realsize&1), SekPc);\r
- dprintf("m68k FIXME: strange w%i: [%06x], %08x @%06x", realsize, a&0xffffff, d, SekPc);\r
+ elprintf(EL_UIO, "m68k FIXME: strange w%i: [%06x], %08x @%06x", realsize, a&0xffffff, d, SekPc);\r
}\r
\r
#define _CD_MEMORY_C\r
}\r
\r
#define _CD_MEMORY_C\r
-#ifdef __debug_io\r
- dprintf("r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPc);\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
-#ifdef __debug_io\r
- dprintf("r16: %06x, %04x @%06x", a&0xffffff, d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "r16: %06x, %04x @%06x", a&0xffffff, d, SekPc);\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
-#ifdef __debug_io\r
- dprintf("r32: %06x, %08x @%06x", a&0xffffff, d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "r32: %06x, %08x @%06x", a&0xffffff, d, SekPc);\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
#ifdef EMU_CORE_DEBUG\r
if (a>=Pico.romsize) {\r
lastread_a = a;\r
#else\r
void PicoWriteM68k8(u32 a,u8 d)\r
{\r
#else\r
void PicoWriteM68k8(u32 a,u8 d)\r
{\r
-#ifdef __debug_io\r
- dprintf("w8 : %06x, %02x @%06x", a&0xffffff, d, SekPc);\r
-#endif\r
+ elprintf(EL_IO, "w8 : %06x, %02x @%06x", a&0xffffff, d, SekPc);\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
#else\r
static void PicoWriteM68k16(u32 a,u16 d)\r
{\r
#else\r
static void PicoWriteM68k16(u32 a,u16 d)\r
{\r
-#ifdef __debug_io\r
- dprintf("w16: %06x, %04x", a&0xffffff, d);\r
-#endif\r
+ elprintf(EL_IO, "w16: %06x, %04x", a&0xffffff, d);\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
#ifdef USE_POLL_DETECT\r
if ((s68k_poll_adclk&0xfe) == 0xe && s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(0); s68k_poll_adclk = 0;\r
#ifdef USE_POLL_DETECT\r
if ((s68k_poll_adclk&0xfe) == 0xe && s68k_poll_cnt > POLL_LIMIT) {\r
SekSetStopS68k(0); s68k_poll_adclk = 0;\r
- plprintf("s68k poll release, a=%02x\n", a);\r
+ elprintf(EL_CDPOLL, "s68k poll release, a=%02x\n", a);\r
#else\r
static void PicoWriteM68k32(u32 a,u32 d)\r
{\r
#else\r
static void PicoWriteM68k32(u32 a,u32 d)\r
{\r
-#ifdef __debug_io\r
- dprintf("w32: %06x, %08x", a&0xffffff, d);\r
-#endif\r
+ elprintf(EL_IO, "w32: %06x, %08x", a&0xffffff, d);\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
#ifdef EMU_CORE_DEBUG\r
lastwrite_cyc_d[lwp_cyc++&15] = d;\r
#endif\r
d = Pico_mcd->word_ram1M[bank][((a>>1)^1)&0x1ffff];\r
if (a&1) d &= 0x0f;\r
else d >>= 4;\r
d = Pico_mcd->word_ram1M[bank][((a>>1)^1)&0x1ffff];\r
if (a&1) d &= 0x0f;\r
else d >>= 4;\r
- dprintf("FIXME: decode");\r
} else {\r
// allow access in any mode, like Gens does\r
d = Pico_mcd->word_ram2M[(a^1)&0x3ffff];\r
} else {\r
// allow access in any mode, like Gens does\r
d = Pico_mcd->word_ram2M[(a^1)&0x3ffff];\r
\r
// PCM\r
if ((a&0xff8000)==0xff0000) {\r
\r
// PCM\r
if ((a&0xff8000)==0xff0000) {\r
- dprintf("s68k_pcm r8: [%06x] @%06x", a, SekPcS68k);\r
+ elprintf(EL_IO, "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
a &= 0x7fff;\r
if (a >= 0x2000)\r
d = Pico_mcd->pcm_ram_b[Pico_mcd->pcm.bank][(a>>1)&0xfff];\r
d = Pico_mcd->pcm.ch[a>>2].addr >> PCM_STEP_SHIFT;\r
if (a & 2) d >>= 8;\r
}\r
d = Pico_mcd->pcm.ch[a>>2].addr >> PCM_STEP_SHIFT;\r
if (a & 2) d >>= 8;\r
}\r
- dprintf("ret = %02x", (u8)d);\r
+ elprintf(EL_IO, "ret = %02x", (u8)d);\r
- dprintf("s68k r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPcS68k);\r
+ elprintf(EL_UIO, "s68k r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPcS68k);\r
-#ifdef __debug_io2\r
- dprintf("s68k r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPcS68k);\r
-#endif\r
+ elprintf(EL_IO, "s68k r8 : %06x, %02x @%06x", a&0xffffff, (u8)d, SekPcS68k);\r
#ifdef EMU_CORE_DEBUG\r
lastread_a = ab;\r
lastread_d[lrp_cyc++&15] = d;\r
#ifdef EMU_CORE_DEBUG\r
lastread_a = ab;\r
lastread_d[lrp_cyc++&15] = d;\r
int bank = (Pico_mcd->s68k_regs[3]&1)^1;\r
d = Pico_mcd->word_ram1M[bank][((a>>1)^1)&0x1ffff];\r
d |= d << 4; d &= ~0xf0;\r
int bank = (Pico_mcd->s68k_regs[3]&1)^1;\r
d = Pico_mcd->word_ram1M[bank][((a>>1)^1)&0x1ffff];\r
d |= d << 4; d &= ~0xf0;\r
- dprintf("FIXME: decode");\r
} else {\r
// allow access in any mode, like Gens does\r
d = *(u16 *)(Pico_mcd->word_ram2M+(a&0x3fffe));\r
} else {\r
// allow access in any mode, like Gens does\r
d = *(u16 *)(Pico_mcd->word_ram2M+(a&0x3fffe));\r
- dprintf("s68k r16: %06x, %04x @%06x", a&0xffffff, d, SekPcS68k);\r
+ elprintf(EL_UIO, "s68k r16: %06x, %04x @%06x", a&0xffffff, d, SekPcS68k);\r
-#ifdef __debug_io2\r
- dprintf("s68k r16: %06x, %04x @%06x", a&0xffffff, d, SekPcS68k);\r
-#endif\r
+ elprintf(EL_IO, "s68k r16: %06x, %04x @%06x", a&0xffffff, d, SekPcS68k);\r
#ifdef EMU_CORE_DEBUG\r
lastread_a = ab;\r
lastread_d[lrp_cyc++&15] = d;\r
#ifdef EMU_CORE_DEBUG\r
lastread_a = ab;\r
lastread_d[lrp_cyc++&15] = d;\r
- dprintf("s68k r32: %06x, %08x @%06x", a&0xffffff, d, SekPcS68k);\r
+ elprintf(EL_UIO, "s68k r32: %06x, %08x @%06x", a&0xffffff, d, SekPcS68k);\r
-#ifdef __debug_io2\r
- dprintf("s68k r32: %06x, %08x @%06x", a&0xffffff, d, SekPcS68k);\r
-#endif\r
+ elprintf(EL_IO, "s68k r32: %06x, %08x @%06x", a&0xffffff, d, SekPcS68k);\r
#ifdef EMU_CORE_DEBUG\r
if (ab > 0x78) { // not vectors and stuff\r
lastread_a = ab;\r
#ifdef EMU_CORE_DEBUG\r
if (ab > 0x78) { // not vectors and stuff\r
lastread_a = ab;\r
#else\r
static void PicoWriteS68k8(u32 a,u8 d)\r
{\r
#else\r
static void PicoWriteS68k8(u32 a,u8 d)\r
{\r
-#ifdef __debug_io2\r
- dprintf("s68k w8 : %06x, %02x @%06x", a&0xffffff, d, SekPcS68k);\r
-#endif\r
+ elprintf(EL_IO, "s68k w8 : %06x, %02x @%06x", a&0xffffff, d, SekPcS68k);\r
- dprintf("s68k w8 : %06x, %02x @%06x", a&0xffffff, d, SekPcS68k);\r
+ elprintf(EL_UIO, "s68k w8 : %06x, %02x @%06x", a&0xffffff, d, SekPcS68k);\r
#else\r
static void PicoWriteS68k16(u32 a,u16 d)\r
{\r
#else\r
static void PicoWriteS68k16(u32 a,u16 d)\r
{\r
-#ifdef __debug_io2\r
- dprintf("s68k w16: %06x, %04x @%06x", a&0xffffff, d, SekPcS68k);\r
-#endif\r
+ elprintf(EL_IO, "s68k w16: %06x, %04x @%06x", a&0xffffff, d, SekPcS68k);\r
- dprintf("s68k w16: %06x, %04x @%06x", a&0xffffff, d, SekPcS68k);\r
+ elprintf(EL_UIO, "s68k w16: %06x, %04x @%06x", a&0xffffff, d, SekPcS68k);\r
#else\r
static void PicoWriteS68k32(u32 a,u32 d)\r
{\r
#else\r
static void PicoWriteS68k32(u32 a,u32 d)\r
{\r
-#ifdef __debug_io2\r
- dprintf("s68k w32: %06x, %08x @%06x", a&0xffffff, d, SekPcS68k);\r
-#endif\r
+ elprintf(EL_IO, "s68k w32: %06x, %08x @%06x", a&0xffffff, d, SekPcS68k);\r
- dprintf("s68k w32: %06x, %08x @%06x", a&0xffffff, d, SekPcS68k);\r
+ elprintf(EL_UIO, "s68k w32: %06x, %08x @%06x", a&0xffffff, d, SekPcS68k);\r
}\r
\r
// Error - Program Counter is invalid\r
}\r
\r
// Error - Program Counter is invalid\r
- dprintf("m68k FIXME: unhandled jump to %06x", pc);\r
+ elprintf(EL_ANOMALY, "m68k FIXME: unhandled jump to %06x", pc);\r
\r
return (int)Pico_mcd->bios;\r
}\r
\r
return (int)Pico_mcd->bios;\r
}\r
}\r
\r
// Error - Program Counter is invalid\r
}\r
\r
// Error - Program Counter is invalid\r
- dprintf("s68k FIXME: unhandled jump to %06x", pc);\r
+ elprintf(EL_ANOMALY, "s68k FIXME: unhandled jump to %06x", pc);\r
\r
return (int)Pico_mcd->prg_ram;\r
}\r
\r
return (int)Pico_mcd->prg_ram;\r
}\r
\r
PICO_INTERNAL void PicoMemSetupCD(void)\r
{\r
\r
PICO_INTERNAL void PicoMemSetupCD(void)\r
{\r
- dprintf("PicoMemSetupCD()");\r
#ifdef EMU_C68K\r
// Setup m68k memory callbacks:\r
PicoCpuCM68k.checkpc=PicoCheckPcM68k;\r
#ifdef EMU_C68K\r
// Setup m68k memory callbacks:\r
PicoCpuCM68k.checkpc=PicoCheckPcM68k;\r
int bank = (Pico_mcd->s68k_regs[3]&1)^1;\r
return *(u8 *)(Pico_mcd->word_ram1M[bank]+((a^1)&0x1ffff));\r
}\r
int bank = (Pico_mcd->s68k_regs[3]&1)^1;\r
return *(u8 *)(Pico_mcd->word_ram1M[bank]+((a^1)&0x1ffff));\r
}\r
- dprintf("s68k_read_pcrelative_CD8 FIXME: can't handle %06x", a);\r
+ elprintf(EL_ANOMALY, "s68k_read_pcrelative_CD8 FIXME: can't handle %06x", a);\r
} else {\r
if((a&0xe00000)==0xe00000) return *(u8 *)(Pico.ram+((a^1)&0xffff)); // Ram\r
if(a<0x20000) return *(u8 *)(Pico.rom+(a^1)); // Bios\r
} else {\r
if((a&0xe00000)==0xe00000) return *(u8 *)(Pico.ram+((a^1)&0xffff)); // Ram\r
if(a<0x20000) return *(u8 *)(Pico.rom+(a^1)); // Bios\r
return *(u8 *)(Pico_mcd->word_ram1M[bank]+((a^1)&0x1ffff));\r
}\r
}\r
return *(u8 *)(Pico_mcd->word_ram1M[bank]+((a^1)&0x1ffff));\r
}\r
}\r
- dprintf("m68k_read_pcrelative_CD8 FIXME: can't handle %06x", a);\r
+ elprintf(EL_ANOMALY, "m68k_read_pcrelative_CD8 FIXME: can't handle %06x", a);\r
}\r
return 0;//(u8) lastread_d;\r
}\r
}\r
return 0;//(u8) lastread_d;\r
}\r
int bank = (Pico_mcd->s68k_regs[3]&1)^1;\r
return *(u16 *)(Pico_mcd->word_ram1M[bank]+(a&0x1fffe));\r
}\r
int bank = (Pico_mcd->s68k_regs[3]&1)^1;\r
return *(u16 *)(Pico_mcd->word_ram1M[bank]+(a&0x1fffe));\r
}\r
- dprintf("s68k_read_pcrelative_CD16 FIXME: can't handle %06x", a);\r
+ elprintf(EL_ANOMALY, "s68k_read_pcrelative_CD16 FIXME: can't handle %06x", a);\r
} else {\r
if((a&0xe00000)==0xe00000) return *(u16 *)(Pico.ram+(a&0xfffe)); // Ram\r
if(a<0x20000) return *(u16 *)(Pico.rom+(a&~1)); // Bios\r
} else {\r
if((a&0xe00000)==0xe00000) return *(u16 *)(Pico.ram+(a&0xfffe)); // Ram\r
if(a<0x20000) return *(u16 *)(Pico.rom+(a&~1)); // Bios\r
return *(u16 *)(Pico_mcd->word_ram1M[bank]+(a&0x1fffe));\r
}\r
}\r
return *(u16 *)(Pico_mcd->word_ram1M[bank]+(a&0x1fffe));\r
}\r
}\r
- dprintf("m68k_read_pcrelative_CD16 FIXME: can't handle %06x", a);\r
+ elprintf(EL_ANOMALY, "m68k_read_pcrelative_CD16 FIXME: can't handle %06x", a);\r
pm=(u16 *)(Pico_mcd->word_ram1M[bank]+(a&0x1fffe));\r
return (pm[0]<<16)|pm[1];\r
}\r
pm=(u16 *)(Pico_mcd->word_ram1M[bank]+(a&0x1fffe));\r
return (pm[0]<<16)|pm[1];\r
}\r
- dprintf("s68k_read_pcrelative_CD32 FIXME: can't handle %06x", a);\r
+ elprintf(EL_ANOMALY, "s68k_read_pcrelative_CD32 FIXME: can't handle %06x", a);\r
} else {\r
if((a&0xe00000)==0xe00000) { u16 *pm=(u16 *)(Pico.ram+(a&0xfffe)); return (pm[0]<<16)|pm[1]; } // Ram\r
if(a<0x20000) { u16 *pm=(u16 *)(Pico.rom+(a&~1)); return (pm[0]<<16)|pm[1]; }\r
} else {\r
if((a&0xe00000)==0xe00000) { u16 *pm=(u16 *)(Pico.ram+(a&0xfffe)); return (pm[0]<<16)|pm[1]; } // Ram\r
if(a<0x20000) { u16 *pm=(u16 *)(Pico.rom+(a&~1)); return (pm[0]<<16)|pm[1]; }\r
return (pm[0]<<16)|pm[1];\r
}\r
}\r
return (pm[0]<<16)|pm[1];\r
}\r
}\r
- dprintf("m68k_read_pcrelative_CD32 FIXME: can't handle %06x", a);\r
+ elprintf(EL_ANOMALY, "m68k_read_pcrelative_CD32 FIXME: can't handle %06x", a);\r
{
int level_new = new_irq_level(level);
{
int level_new = new_irq_level(level);
- dprintf("s68kACK %i -> %i", level, level_new);
+ elprintf(EL_INTS, "s68kACK %i -> %i", level, level_new);
PicoCpuCS68k.irq = level_new;
return CYCLONE_INT_ACK_AUTOVECTOR;
}
static void SekResetAckS68k(void)
{
PicoCpuCS68k.irq = level_new;
return CYCLONE_INT_ACK_AUTOVECTOR;
}
static void SekResetAckS68k(void)
{
- dprintf("s68k: Reset encountered @ %06x", SekPcS68k);
+ elprintf(EL_ANOMALY, "s68k: Reset encountered @ %06x", SekPcS68k);
}
static int SekUnrecognizedOpcodeS68k(void)
}
static int SekUnrecognizedOpcodeS68k(void)
unsigned int pc, op;
pc = SekPcS68k;
op = PicoCpuCS68k.read16(pc);
unsigned int pc, op;
pc = SekPcS68k;
op = PicoCpuCS68k.read16(pc);
- dprintf("Unrecognized Opcode %04x @ %06x", op, pc);
+ elprintf(EL_ANOMALY, "Unrecognized Opcode %04x @ %06x", op, pc);
{
#ifndef EMU_CORE_DEBUG
int level_new = new_irq_level(level);
{
#ifndef EMU_CORE_DEBUG
int level_new = new_irq_level(level);
- dprintf("s68kACK %i -> %i", level, level_new);
+ elprintf(EL_INTS, "s68kACK %i -> %i", level, level_new);
CPU_INT_LEVEL = level_new << 8;
#else
CPU_INT_LEVEL = 0;
CPU_INT_LEVEL = level_new << 8;
#else
CPU_INT_LEVEL = 0;
static void SekIntAckFS68k(unsigned level)
{
int level_new = new_irq_level(level);
static void SekIntAckFS68k(unsigned level)
{
int level_new = new_irq_level(level);
- dprintf("s68kACK %i -> %i", level, level_new);
+ elprintf(EL_INTS, "s68kACK %i -> %i", level, level_new);
#ifndef EMU_CORE_DEBUG
PicoCpuFS68k.interrupts[0] = level_new;
#else
#ifndef EMU_CORE_DEBUG
PicoCpuFS68k.interrupts[0] = level_new;
#else
#include "../PicoInt.h"
#include "cd_file.h"
#include "../PicoInt.h"
#include "cd_file.h"
-#define cdprintf dprintf
-//#define cdprintf(x...)
//#define cdprintf(f,...) printf(f "\n",##__VA_ARGS__) // tmp
#define DEBUG_CD
//#define cdprintf(f,...) printf(f "\n",##__VA_ARGS__) // tmp
#define DEBUG_CD
{
if (Pico_mcd->s68k_regs[0x33] & (1<<5))
{
{
if (Pico_mcd->s68k_regs[0x33] & (1<<5))
{
- dprintf("cdc dec irq 5");
+ elprintf(EL_INTS, "cdc dec irq 5");
#include "cd_sys.h"\r
#include "cd_file.h"\r
\r
#include "cd_sys.h"\r
#include "cd_file.h"\r
\r
-#define cdprintf dprintf\r
-//#define cdprintf(x...)\r
+#define cdprintf(x...)\r
#define DEBUG_CD\r
\r
#define TRAY_OPEN 0x0500 // TRAY OPEN CDD status\r
#define DEBUG_CD\r
\r
#define TRAY_OPEN 0x0500 // TRAY OPEN CDD status\r
_rot_comp.Reg_64 = 0;
if (Pico_mcd->s68k_regs[0x33] & (1<<1))
{
_rot_comp.Reg_64 = 0;
if (Pico_mcd->s68k_regs[0x33] & (1<<1))
{
- dprintf("gfx_cd irq 1");
+ elprintf(EL_INTS, "gfx_cd irq 1");
-#if defined(__GP2X__)
- #include <stdio.h>
- #define lprintf printf
-#elif defined(PSP)
- extern void lprintf(const char *fmt, ...);
-#else
- #include "giz.h"
-#endif
+extern void lprintf(const char *fmt, ...);
DEFINC = -I../.. -I. -DARM -D__GP2X__ # -DBENCHMARK\r
COPT_COMMON = -static -Wall -Winline\r
ifeq ($(DEBUG),)\r
DEFINC = -I../.. -I. -DARM -D__GP2X__ # -DBENCHMARK\r
COPT_COMMON = -static -Wall -Winline\r
ifeq ($(DEBUG),)\r
-COPT_COMMON += -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
+COPT_COMMON += -O3 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
else\r
COPT_COMMON += -ggdb\r
endif\r
else\r
COPT_COMMON += -ggdb\r
endif\r
\r
extern int crashed_940;\r
\r
\r
extern int crashed_940;\r
\r
-static short sndBuffer[2*44100/50];\r
+static short __attribute__((aligned(4))) sndBuffer[2*44100/50];\r
static struct timeval noticeMsgTime = { 0, 0 }; // when started showing\r
static int osd_fps_x;\r
static int combo_keys = 0, combo_acts = 0; // keys and actions which need button combos\r
static struct timeval noticeMsgTime = { 0, 0 }; // when started showing\r
static int osd_fps_x;\r
static int combo_keys = 0, combo_acts = 0; // keys and actions which need button combos\r
\r
#include <stdio.h>\r
#include <stdlib.h>\r
\r
#include <stdio.h>\r
#include <stdlib.h>\r
#include <string.h>\r
#include <unistd.h>\r
#include <sys/mman.h>\r
#include <string.h>\r
#include <unistd.h>\r
#include <sys/mman.h>\r
+/* lprintf */\r
+void lprintf(const char *fmt, ...)\r
+{\r
+ va_list vl;\r
+\r
+ va_start(vl, fmt);\r
+ vprintf(fmt, vl);\r
+ va_end(vl);\r
+}\r
\r
smalltext_out16(1, 3*10, "Processing CD image / MP3s", 0xffff);\r
smalltext_out16_lim(1, 4*10, romFileName, 0xffff, 80);\r
\r
smalltext_out16(1, 3*10, "Processing CD image / MP3s", 0xffff);\r
smalltext_out16_lim(1, 4*10, romFileName, 0xffff, 80);\r
\r
if (len > 320) len = 320;\r
for (ln = 8; ln > 0; ln--, dst += 320)\r
memset(dst, 0xff, len*2);\r
\r
if (len > 320) len = 320;\r
for (ln = 8; ln > 0; ln--, dst += 320)\r
memset(dst, 0xff, len*2);\r
cdload_called = 1;\r
}\r
\r
cdload_called = 1;\r
}\r
\r
\r
void menu_romload_end(void)\r
{\r
\r
void menu_romload_end(void)\r
{\r
- PicoCartLoadProgressCB = NULL;\r
+ PicoCartLoadProgressCB = PicoCDLoadProgressCB = NULL;\r
smalltext_out16(1, cdload_called ? 60 : 30, "Starting emulation...", 0xffff);\r
menu_flip();\r
}\r
smalltext_out16(1, cdload_called ? 60 : 30, "Starting emulation...", 0xffff);\r
menu_flip();\r
}\r
#define CAN_HANDLE_240_LINES 1\r
\r
// logging emu events\r
#define CAN_HANDLE_240_LINES 1\r
\r
// logging emu events\r
-#define EL_LOGMASK 0 // (EL_STATUS|EL_ANOMALY|EL_UIO|EL_SRAMIO) // xffff\r
+#define EL_LOGMASK EL_STATUS // (EL_STATUS|EL_ANOMALY|EL_UIO|EL_SRAMIO|EL_INTS|EL_CDPOLL) // xffff\r
\r
//#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)\r
#define dprintf(x...)\r
\r
//#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)\r
#define dprintf(x...)\r
+/* lprintf */
+void lprintf(const char *fmt, ...)
+{
+ va_list vl;
+ va_start(vl, fmt);
+ vprintf(fmt, vl);
+ va_end(vl);
+}