if ((a & 0x00f0) == 0x0000) {\r
switch (a & 0x0d)\r
{\r
- case 0x00: return PicoVideoRead8DataH();\r
- case 0x01: return PicoVideoRead8DataL();\r
- case 0x04: return PicoVideoRead8CtlH();\r
- case 0x05: return PicoVideoRead8CtlL();\r
+ case 0x00: return PicoVideoRead8DataH(0);\r
+ case 0x01: return PicoVideoRead8DataL(0);\r
+ case 0x04: return PicoVideoRead8CtlH(0);\r
+ case 0x05: return PicoVideoRead8CtlL(0);\r
case 0x08:\r
- case 0x0c: return PicoVideoRead8HV_H();\r
+ case 0x0c: return PicoVideoRead8HV_H(0);\r
case 0x09:\r
- case 0x0d: return PicoVideoRead8HV_L();\r
+ case 0x0d: return PicoVideoRead8HV_L(0);\r
}\r
}\r
\r
if ((a & 0x00f0) == 0x0000) {\r
switch (a & 0x0d)\r
{\r
- case 0x00: return PicoVideoRead8DataH();\r
- case 0x01: return PicoVideoRead8DataL();\r
- case 0x04: return PicoVideoRead8CtlH();\r
- case 0x05: return PicoVideoRead8CtlL();\r
+ case 0x00: return PicoVideoRead8DataH(1);\r
+ case 0x01: return PicoVideoRead8DataL(1);\r
+ case 0x04: return PicoVideoRead8CtlH(1);\r
+ case 0x05: return PicoVideoRead8CtlL(1);\r
case 0x08:\r
case 0x0c: return get_scanline(1); // FIXME: make it proper\r
case 0x09:\r
\r
PICO_INTERNAL_ASM void PicoVideoWrite(unsigned int a,unsigned short d);\r
PICO_INTERNAL_ASM unsigned int PicoVideoRead(unsigned int a);\r
-unsigned char PicoVideoRead8DataH(void);\r
-unsigned char PicoVideoRead8DataL(void);\r
-unsigned char PicoVideoRead8CtlH(void);\r
-unsigned char PicoVideoRead8CtlL(void);\r
-unsigned char PicoVideoRead8HV_H(void);\r
-unsigned char PicoVideoRead8HV_L(void);\r
+unsigned char PicoVideoRead8DataH(int is_from_z80);\r
+unsigned char PicoVideoRead8DataL(int is_from_z80);\r
+unsigned char PicoVideoRead8CtlH(int is_from_z80);\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)(unsigned int source, int len, unsigned short **base, unsigned int *mask);\r
void PicoVideoFIFOSync(int cycles);\r
int PicoVideoFIFOHint(void);\r
AutoIncrement();\r
}\r
\r
-static unsigned int VideoRead(void)\r
+static unsigned int VideoRead(int is_from_z80)\r
{\r
unsigned int a, d = VdpFIFO.fifo_data[(VdpFIFO.fifo_dx+1)&3];\r
\r
a=Pico.video.addr; a>>=1;\r
\r
- SekCyclesBurnRun(PicoVideoFIFORead());\r
+ if (!is_from_z80)\r
+ SekCyclesBurnRun(PicoVideoFIFORead());\r
switch (Pico.video.type)\r
{\r
case 0: d=PicoMem.vram [a & 0x7fff]; break;\r
\r
if (a==0x00) // data port\r
{\r
- return VideoRead();\r
+ return VideoRead(0);\r
}\r
\r
return 0;\r
}\r
\r
-unsigned char PicoVideoRead8DataH(void)\r
+unsigned char PicoVideoRead8DataH(int is_from_z80)\r
{\r
- return VideoRead() >> 8;\r
+ return VideoRead(is_from_z80) >> 8;\r
}\r
\r
-unsigned char PicoVideoRead8DataL(void)\r
+unsigned char PicoVideoRead8DataL(int is_from_z80)\r
{\r
- return VideoRead();\r
+ return VideoRead(is_from_z80);\r
}\r
\r
-unsigned char PicoVideoRead8CtlH(void)\r
+unsigned char PicoVideoRead8CtlH(int is_from_z80)\r
{\r
struct PicoVideo *pv = &Pico.video;\r
u8 d = VideoSr(pv) >> 8;\r
return d;\r
}\r
\r
-unsigned char PicoVideoRead8CtlL(void)\r
+unsigned char PicoVideoRead8CtlL(int is_from_z80)\r
{\r
struct PicoVideo *pv = &Pico.video;\r
u8 d = VideoSr(pv);\r
return d;\r
}\r
\r
-unsigned char PicoVideoRead8HV_H(void)\r
+unsigned char PicoVideoRead8HV_H(int is_from_z80)\r
{\r
elprintf(EL_HVCNT, "vcounter: %02x [%u] @ %06x", Pico.video.v_counter, SekCyclesDone(), SekPc);\r
return Pico.video.v_counter;\r
}\r
\r
// FIXME: broken\r
-unsigned char PicoVideoRead8HV_L(void)\r
+unsigned char PicoVideoRead8HV_L(int is_from_z80)\r
{\r
u32 d = (SekCyclesDone() - Pico.t.m68c_line_start) & 0x1ff; // FIXME\r
if (Pico.video.reg[0]&2)\r